diffing 0.1.2 → 0.2.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 (82) hide show
  1. package/README.md +75 -3
  2. package/dist/cli-agent-Vbs-ePHv.mjs +443 -0
  3. package/dist/cli.mjs +422 -10
  4. package/dist/client/assets/{angular-html-BABKYppC.js → angular-html-fdYbuxHF.js} +1 -1
  5. package/dist/client/assets/{angular-ts-CtXLuOQb.js → angular-ts-D3iFqR-R.js} +1 -1
  6. package/dist/client/assets/{apl-DOi69evI.js → apl-MnBV-iQN.js} +1 -1
  7. package/dist/client/assets/{astro-J8Em2tfW.js → astro-BrpK01E7.js} +1 -1
  8. package/dist/client/assets/{blade-B_tOnqRD.js → blade-CGmyBuwD.js} +1 -1
  9. package/dist/client/assets/{c-C0tRZWSi.js → c-xQnwtG9Y.js} +1 -1
  10. package/dist/client/assets/{cobol-Dj_rkgIY.js → cobol-ypVzOIQu.js} +1 -1
  11. package/dist/client/assets/{coffee-C6Vq4BFF.js → coffee-CrtE1uj2.js} +1 -1
  12. package/dist/client/assets/{cpp-Cno48fgF.js → cpp-DLd4XEKA.js} +1 -1
  13. package/dist/client/assets/{crystal-C7tmDnU1.js → crystal-CJYvpLt_.js} +1 -1
  14. package/dist/client/assets/{css-0v4o-iNQ.js → css-DrX2B9os.js} +1 -1
  15. package/dist/client/assets/{edge-CvULxRem.js → edge-BsQYk9OW.js} +1 -1
  16. package/dist/client/assets/{elixir-vRTauEw-.js → elixir-DU_VfGYR.js} +1 -1
  17. package/dist/client/assets/{elm-fLFTu1xn.js → elm-W4eOLEDv.js} +1 -1
  18. package/dist/client/assets/{erb-CtItcikB.js → erb-D9FdIJ2e.js} +1 -1
  19. package/dist/client/assets/{git-rebase-5MeRBXZD.js → git-rebase-BtPCXjbS.js} +1 -1
  20. package/dist/client/assets/{glimmer-js-B7yA-u8_.js → glimmer-js-BVfUGMUb.js} +1 -1
  21. package/dist/client/assets/{glimmer-ts-B2g1OaHc.js → glimmer-ts-BZEaHDZL.js} +1 -1
  22. package/dist/client/assets/{glsl-CqNPWp5Y.js → glsl-CSiNDuwt.js} +1 -1
  23. package/dist/client/assets/{graphql-CF78KbfF.js → graphql-Crf08Rhb.js} +1 -1
  24. package/dist/client/assets/{hack-Dz8fQ8O9.js → hack-DUiQuO20.js} +1 -1
  25. package/dist/client/assets/{haml-3Gbl257r.js → haml-BtvVTDRG.js} +1 -1
  26. package/dist/client/assets/{handlebars-5UZnh5L7.js → handlebars-Bu_cdZA_.js} +1 -1
  27. package/dist/client/assets/{html-JOaQiIkL.js → html-C4cun3zD.js} +1 -1
  28. package/dist/client/assets/{html-derivative-GyX6oYy3.js → html-derivative-CQnD80KV.js} +1 -1
  29. package/dist/client/assets/{http-t6uVAxgS.js → http-DuOJF9Kg.js} +1 -1
  30. package/dist/client/assets/{hurl-OLQZpg0E.js → hurl-DgrdYsYh.js} +1 -1
  31. package/dist/client/assets/{index-CghVgrAF.js → index-CZZd7iTh.js} +99 -68
  32. package/dist/client/assets/index-CkC-EvWo.css +1 -0
  33. package/dist/client/assets/{java-BqL_yaya.js → java-D-vtFiv8.js} +1 -1
  34. package/dist/client/assets/{javascript-CxBNAxR5.js → javascript-CFYFXvdN.js} +1 -1
  35. package/dist/client/assets/{jinja-CuaK033Z.js → jinja-fZvIg2_s.js} +1 -1
  36. package/dist/client/assets/{jison-aL_w2vvo.js → jison-DEzxLq5g.js} +1 -1
  37. package/dist/client/assets/{json-Byruj-EC.js → json-QM4VBqMC.js} +1 -1
  38. package/dist/client/assets/{jsx-CosY06uG.js → jsx-DLzUM_cC.js} +1 -1
  39. package/dist/client/assets/{julia-u1y7fV63.js → julia-Dwt1SIpn.js} +1 -1
  40. package/dist/client/assets/{just-DS4T9P_K.js → just-Dwp-hLcL.js} +1 -1
  41. package/dist/client/assets/{latex-C9c2IWW4.js → latex-CMF1JViz.js} +1 -1
  42. package/dist/client/assets/{liquid-DcXQgkEV.js → liquid-czkpOZWY.js} +1 -1
  43. package/dist/client/assets/{lua-DWe0hUn1.js → lua-DE5PD0Vh.js} +1 -1
  44. package/dist/client/assets/{marko-CIW7o2up.js → marko-DHeEvZiW.js} +1 -1
  45. package/dist/client/assets/{mdc-DKjGzb4k.js → mdc-B941liUQ.js} +1 -1
  46. package/dist/client/assets/{nginx-CBXzDlkk.js → nginx-Pb9t8c-r.js} +1 -1
  47. package/dist/client/assets/{nim-CBf_vdee.js → nim-MMUvW_R1.js} +1 -1
  48. package/dist/client/assets/{perl-xC9qc39I.js → perl-DXwXRmuC.js} +1 -1
  49. package/dist/client/assets/{php-n4vnn5oz.js → php-D42kv59r.js} +1 -1
  50. package/dist/client/assets/{pug-Db536lA_.js → pug-v0iesski.js} +1 -1
  51. package/dist/client/assets/{qml-CrATLnNN.js → qml-spxQQ-ei.js} +1 -1
  52. package/dist/client/assets/{r-DBQ-dydl.js → r-CobWTBG9.js} +1 -1
  53. package/dist/client/assets/{razor-C_wvK1iP.js → razor-B-_Ww3MB.js} +1 -1
  54. package/dist/client/assets/{regexp-DowFj0Xd.js → regexp-BJMVs8R0.js} +1 -1
  55. package/dist/client/assets/{rst-rY4UPiwe.js → rst-BHcaWsY0.js} +1 -1
  56. package/dist/client/assets/{ruby-C4cISY4u.js → ruby-BCMT6kog.js} +1 -1
  57. package/dist/client/assets/{sas-ui1PNNkD.js → sas-DHfZnd3R.js} +1 -1
  58. package/dist/client/assets/{scss-BZrs95TC.js → scss-DjDsJvDO.js} +1 -1
  59. package/dist/client/assets/{shellscript-D9YVFS67.js → shellscript-B6qaIiU-.js} +1 -1
  60. package/dist/client/assets/{shellsession-DK7LMzYg.js → shellsession-ByCeir2b.js} +1 -1
  61. package/dist/client/assets/{soy-CNkc-Oji.js → soy-C6WpnMSF.js} +1 -1
  62. package/dist/client/assets/{sql-BvRdqBMa.js → sql-BIvSNLV_.js} +1 -1
  63. package/dist/client/assets/{stata-Bawjgtiz.js → stata-PG9iZ--I.js} +1 -1
  64. package/dist/client/assets/{surrealql-7v7lT5jp.js → surrealql-CmvCzG09.js} +1 -1
  65. package/dist/client/assets/{svelte-p7w_kluv.js → svelte-ChumG88s.js} +1 -1
  66. package/dist/client/assets/{templ-0Gi_yZZr.js → templ-CmzuRY_a.js} +1 -1
  67. package/dist/client/assets/{tex-nZ_J3lks.js → tex-DL8t-_eJ.js} +1 -1
  68. package/dist/client/assets/{ts-tags-CuG-Aj5j.js → ts-tags-BFfE0Egm.js} +1 -1
  69. package/dist/client/assets/{tsx-Cc7GNb_V.js → tsx-C1bFyHcE.js} +1 -1
  70. package/dist/client/assets/{twig-BBlmihVM.js → twig-DkIluZEQ.js} +1 -1
  71. package/dist/client/assets/{typescript-aiXwsZhm.js → typescript-Gc86Bc3j.js} +1 -1
  72. package/dist/client/assets/{vue-Cs5tk2kn.js → vue-C88JmL53.js} +1 -1
  73. package/dist/client/assets/{vue-html-BEI_B8Ml.js → vue-html-Cry4aksC.js} +1 -1
  74. package/dist/client/assets/{vue-vine-CpWdOkP4.js → vue-vine-zlDkA3Ui.js} +1 -1
  75. package/dist/client/assets/{xml-madLQSkS.js → xml-NvwpIFDy.js} +1 -1
  76. package/dist/client/assets/{xsl-CqZR37V9.js → xsl-CDjXvY9w.js} +1 -1
  77. package/dist/client/assets/{yaml-DHr9ndbK.js → yaml-Bh-LPjcH.js} +1 -1
  78. package/dist/client/index.html +2 -2
  79. package/dist/mcp-DKlThflu.mjs +253 -0
  80. package/dist/server-lock-CAdqFSfl.mjs +691 -0
  81. package/package.json +1 -1
  82. package/dist/client/assets/index-CmfB2R-C.css +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BABKYppC.js","assets/html-JOaQiIkL.js","assets/css-0v4o-iNQ.js","assets/javascript-CxBNAxR5.js","assets/angular-ts-CtXLuOQb.js","assets/scss-BZrs95TC.js","assets/apl-DOi69evI.js","assets/json-Byruj-EC.js","assets/xml-madLQSkS.js","assets/java-BqL_yaya.js","assets/astro-J8Em2tfW.js","assets/postcss-8kqfa9f0.js","assets/tsx-Cc7GNb_V.js","assets/typescript-aiXwsZhm.js","assets/blade-B_tOnqRD.js","assets/html-derivative-GyX6oYy3.js","assets/sql-BvRdqBMa.js","assets/bsl-Dx5tFn3i.js","assets/sdbl-Be_XWc3n.js","assets/cairo-wCCQTdA9.js","assets/python-CqTCsi7P.js","assets/cobol-Dj_rkgIY.js","assets/coffee-C6Vq4BFF.js","assets/cpp-Cno48fgF.js","assets/glsl-CqNPWp5Y.js","assets/c-C0tRZWSi.js","assets/regexp-DowFj0Xd.js","assets/crystal-C7tmDnU1.js","assets/shellscript-D9YVFS67.js","assets/edge-CvULxRem.js","assets/elixir-vRTauEw-.js","assets/elm-fLFTu1xn.js","assets/erb-CtItcikB.js","assets/ruby-C4cISY4u.js","assets/graphql-CF78KbfF.js","assets/jsx-CosY06uG.js","assets/haml-3Gbl257r.js","assets/lua-DWe0hUn1.js","assets/yaml-DHr9ndbK.js","assets/erlang-CtK0kQ6z.js","assets/markdown-CS4LI6sN.js","assets/fortran-fixed-form-DBM4e0_k.js","assets/fortran-free-form-BIQEK2Jw.js","assets/fsharp-CmzzGQLe.js","assets/gdresource-B_wbPqHd.js","assets/gdscript-B5JQPh_-.js","assets/gdshader-vVjJ_Qr8.js","assets/git-commit-1z4D6NzL.js","assets/diff-togOXQX6.js","assets/git-rebase-5MeRBXZD.js","assets/glimmer-js-B7yA-u8_.js","assets/glimmer-ts-B2g1OaHc.js","assets/hack-Dz8fQ8O9.js","assets/handlebars-5UZnh5L7.js","assets/http-t6uVAxgS.js","assets/hurl-OLQZpg0E.js","assets/csv-Dr8ri5Nd.js","assets/hxml-DC4KwKt2.js","assets/haxe-BRbuo5UO.js","assets/jinja-CuaK033Z.js","assets/jison-aL_w2vvo.js","assets/julia-u1y7fV63.js","assets/r-DBQ-dydl.js","assets/just-DS4T9P_K.js","assets/perl-xC9qc39I.js","assets/latex-C9c2IWW4.js","assets/tex-nZ_J3lks.js","assets/liquid-DcXQgkEV.js","assets/marko-CIW7o2up.js","assets/less-Dj0T9pWC.js","assets/mdc-DKjGzb4k.js","assets/nextflow-CApkvBGW.js","assets/nextflow-groovy-eDLuZ_oi.js","assets/nginx-CBXzDlkk.js","assets/nim-CBf_vdee.js","assets/php-n4vnn5oz.js","assets/pug-Db536lA_.js","assets/qml-CrATLnNN.js","assets/razor-C_wvK1iP.js","assets/csharp-kfNshAa7.js","assets/rst-rY4UPiwe.js","assets/cmake-CCpZLdLI.js","assets/sas-ui1PNNkD.js","assets/shaderlab-DXAhMdPo.js","assets/hlsl-C8Wes1nf.js","assets/shellsession-DK7LMzYg.js","assets/soy-CNkc-Oji.js","assets/sparql-BdcL8cbr.js","assets/turtle-Dpr8zLlw.js","assets/stata-Bawjgtiz.js","assets/surrealql-7v7lT5jp.js","assets/svelte-p7w_kluv.js","assets/templ-0Gi_yZZr.js","assets/go-toi-uWvg.js","assets/ts-tags-CuG-Aj5j.js","assets/twig-BBlmihVM.js","assets/vue-Cs5tk2kn.js","assets/vue-html-BEI_B8Ml.js","assets/vue-vine-CpWdOkP4.js","assets/stylus-tqAsmugv.js","assets/xsl-CqZR37V9.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-fdYbuxHF.js","assets/html-C4cun3zD.js","assets/css-DrX2B9os.js","assets/javascript-CFYFXvdN.js","assets/angular-ts-D3iFqR-R.js","assets/scss-DjDsJvDO.js","assets/apl-MnBV-iQN.js","assets/json-QM4VBqMC.js","assets/xml-NvwpIFDy.js","assets/java-D-vtFiv8.js","assets/astro-BrpK01E7.js","assets/postcss-8kqfa9f0.js","assets/tsx-C1bFyHcE.js","assets/typescript-Gc86Bc3j.js","assets/blade-CGmyBuwD.js","assets/html-derivative-CQnD80KV.js","assets/sql-BIvSNLV_.js","assets/bsl-Dx5tFn3i.js","assets/sdbl-Be_XWc3n.js","assets/cairo-wCCQTdA9.js","assets/python-CqTCsi7P.js","assets/cobol-ypVzOIQu.js","assets/coffee-CrtE1uj2.js","assets/cpp-DLd4XEKA.js","assets/glsl-CSiNDuwt.js","assets/c-xQnwtG9Y.js","assets/regexp-BJMVs8R0.js","assets/crystal-CJYvpLt_.js","assets/shellscript-B6qaIiU-.js","assets/edge-BsQYk9OW.js","assets/elixir-DU_VfGYR.js","assets/elm-W4eOLEDv.js","assets/erb-D9FdIJ2e.js","assets/ruby-BCMT6kog.js","assets/graphql-Crf08Rhb.js","assets/jsx-DLzUM_cC.js","assets/haml-BtvVTDRG.js","assets/lua-DE5PD0Vh.js","assets/yaml-Bh-LPjcH.js","assets/erlang-CtK0kQ6z.js","assets/markdown-CS4LI6sN.js","assets/fortran-fixed-form-DBM4e0_k.js","assets/fortran-free-form-BIQEK2Jw.js","assets/fsharp-CmzzGQLe.js","assets/gdresource-B_wbPqHd.js","assets/gdscript-B5JQPh_-.js","assets/gdshader-vVjJ_Qr8.js","assets/git-commit-1z4D6NzL.js","assets/diff-togOXQX6.js","assets/git-rebase-BtPCXjbS.js","assets/glimmer-js-BVfUGMUb.js","assets/glimmer-ts-BZEaHDZL.js","assets/hack-DUiQuO20.js","assets/handlebars-Bu_cdZA_.js","assets/http-DuOJF9Kg.js","assets/hurl-DgrdYsYh.js","assets/csv-Dr8ri5Nd.js","assets/hxml-DC4KwKt2.js","assets/haxe-BRbuo5UO.js","assets/jinja-fZvIg2_s.js","assets/jison-DEzxLq5g.js","assets/julia-Dwt1SIpn.js","assets/r-CobWTBG9.js","assets/just-Dwp-hLcL.js","assets/perl-DXwXRmuC.js","assets/latex-CMF1JViz.js","assets/tex-DL8t-_eJ.js","assets/liquid-czkpOZWY.js","assets/marko-DHeEvZiW.js","assets/less-Dj0T9pWC.js","assets/mdc-B941liUQ.js","assets/nextflow-CApkvBGW.js","assets/nextflow-groovy-eDLuZ_oi.js","assets/nginx-Pb9t8c-r.js","assets/nim-MMUvW_R1.js","assets/php-D42kv59r.js","assets/pug-v0iesski.js","assets/qml-spxQQ-ei.js","assets/razor-B-_Ww3MB.js","assets/csharp-kfNshAa7.js","assets/rst-BHcaWsY0.js","assets/cmake-CCpZLdLI.js","assets/sas-DHfZnd3R.js","assets/shaderlab-DXAhMdPo.js","assets/hlsl-C8Wes1nf.js","assets/shellsession-ByCeir2b.js","assets/soy-C6WpnMSF.js","assets/sparql-BdcL8cbr.js","assets/turtle-Dpr8zLlw.js","assets/stata-PG9iZ--I.js","assets/surrealql-CmvCzG09.js","assets/svelte-ChumG88s.js","assets/templ-CmzuRY_a.js","assets/go-toi-uWvg.js","assets/ts-tags-BFfE0Egm.js","assets/twig-DkIluZEQ.js","assets/vue-C88JmL53.js","assets/vue-html-Cry4aksC.js","assets/vue-vine-zlDkA3Ui.js","assets/stylus-tqAsmugv.js","assets/xsl-CDjXvY9w.js"])))=>i.map(i=>d[i]);
2
2
  var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=d(),n=p(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function te(e){return{current:e}}function B(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function V(e,t){ee++,z[ee]=e.current,e.current=t}var H=te(null),ne=te(null),re=te(null),ie=te(null);function ae(e,t){switch(V(re,t),V(ne,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function oe(){B(H),B(ne),B(re)}function se(e){e.memoizedState!==null&&V(ie,e);var t=H.current,n=qd(t,e.type);t!==n&&(V(ne,e),V(H,n))}function ce(e){ne.current===e&&(B(H),B(ne)),ie.current===e&&(B(ie),rp._currentValue=R)}var le,ue;function U(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+le+e+ue}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -18,7 +18,7 @@ Error generating stack: `+e.message+`
18
18
  \f\r "&'<=>\``.split(``)],[`\0
19
19
  \f\r "&'<=>\``.split(``),`\0
20
20
  \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Do(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=ha);let l=Oo(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!bo(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!ro(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Oo(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=ko(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function ko(e,t,n){let r=da(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=za(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Eo.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Ka:qa)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=za(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Eo.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Ga(n,o)>Ga(n,e.alternative)&&(o=e.alternative),s=o+za(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Eo.single:Eo.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Ao=[`<`,`&`];function jo(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:za(e.value,Object.assign({},r.settings.characterReferences,{subset:Ao}))}function Mo(e,t,n,r){return r.settings.allowDangerousHtml?e.value:jo(e,t,n,r)}function No(e,t,n,r){return r.all(e)}var Po=_a(`type`,{invalid:Fo,unknown:Io,handlers:{comment:Ua,doctype:Wa,element:Do,raw:Mo,root:No,text:jo}});function Fo(e){throw Error("Expected node, not `"+e+"`")}function Io(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Lo={},Ro={},zo=[];function Bo(e,t){let n=t||Lo,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Vo,all:Ho,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||Ii,characterReferences:n.characterReferences||Ro,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?ha:ma,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Vo(e,t,n){return Po(e,t,n,this)}function Ho(e){let t=[],n=e&&e.children||zo,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Uo(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function Wo(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Go(e){return Array.isArray(e)?e:[e]}async function Ko(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function qo(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Jo(e){return e===`ansi`||qo(e)}function Yo(e){return e===`none`}function Xo(e){return Yo(e)}function Zo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Qo(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function $o(e){let t=Qo(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function es(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var ts=`light-dark()`,ns=[`color`,`background-color`];function rs(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function is(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?rs(e,t):e})):e}function as(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>os(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&ns.includes(a))if(r===ts&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function os(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&yr.Italic&&(t[`font-style`]=`italic`),e.fontStyle&yr.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&yr.Underline&&n.push(`underline`),e.fontStyle&yr.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function ss(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var cs=new WeakMap;function ls(e,t){cs.set(e,t)}function us(e){return cs.get(e)}var ds=class e{_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 e(Object.fromEntries(Go(n).map(e=>[e,Fi])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return fs(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function fs(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function ps(e,t){if(!(e instanceof ds))throw new Qn(`Invalid grammar state`);return e.getInternalStack(t)}function ms(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Qn(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}else{let t=r.lines[e.line];if(t===void 0)throw new Qn(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Qn(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=$o(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));hs(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return is(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Qn(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=gs(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Qn(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Qn(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Zo(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function hs(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Qn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Qn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function gs(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(gs).join(``):``}var _s=[ms()];function vs(e){let t=ys(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._s]}function ys(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var bs=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],xs={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ss(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Cs(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function ws(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)xs[r]&&t.push({type:`setDecoration`,value:xs[r]});else if(r<=29){let e=xs[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:bs[r-30]}});else if(r===38){let n=Cs(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:bs[r-40]}});else if(r===48){let n=Cs(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:bs[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:bs[r-100+8]}})}return t}function Ts(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ss(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=ws(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Es={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 Ds(e=Es){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<bs.length;e++)r.push(t(bs[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Os={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 ks(e,t,n){let r=Uo(e,n),i=Qo(t),a=Ds(Object.fromEntries(bs.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Os[t]]}))),o=Ts();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=Wo(i,r),o=Wo(o,r),n.decorations.has(`dim`)&&(i=As(i));let s=yr.None;return n.decorations.has(`bold`)&&(s|=yr.Bold),n.decorations.has(`italic`)&&(s|=yr.Italic),n.decorations.has(`underline`)&&(s|=yr.Underline),n.decorations.has(`strikethrough`)&&(s|=yr.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function As(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function js(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(qo(i)||Yo(r))return Qo(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return ks(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new Qn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Qn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Ns(t,s,a,o,n)}function Ms(...e){if(e.length===2)return us(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(qo(i)||Yo(a))throw new Qn(`Plain language does not have grammar state`);if(i===`ansi`)throw new Qn(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new ds(Ps(n,c,o,s,r).stateStack,c.name,o.name)}function Ns(e,t,n,r,i){let a=Ps(e,t,n,r,i),o=new ds(a.stateStack,t.name,n.name);return ls(a.tokens,o),a.tokens}function Ps(e,t,n,r,i){let a=Uo(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=Qo(e),l=i.grammarState?ps(i.grammarState,n.name)??Fi:i.grammarContextCode==null?Fi:Ps(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=Wo(r[Tr.getForeground(s)],a),l=Tr.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Fs(t.scopes):Is(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Fs(e){return e.map(e=>({scopeName:e}))}function Is(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:zs(e,i,t.slice(0,r))}}return n}function Ls(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Rs(e,t,n){if(!Ls(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Ls(e[r],n[i])&&--r,--i;return r===-1}function zs(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Rs(e,t,n)){r.push(a);break}return r}function Bs(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=js(e,t,{...n,theme:r.theme});return{tokens:i,state:us(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=Vs(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new ds(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&ls(o,s),o}function Vs(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function Hs(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:t.color===l?1:0);if(f.length===0)throw new Qn("`themes` option must not be empty");let p=Bs(e,t,n);if(c=us(p),l&&ts!==l&&!f.find(e=>e.color===l))throw new Qn(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>as(e,h,u,l,d))),c&&ls(a,c);let g=f.map(e=>Uo(e.theme,n));i=Us(f,m,g,u,l,`fg`,d),r=Us(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=Uo(n.theme,n);a=js(e,t,n);let l=e.getTheme(n.theme);r=Wo(l.bg,s),i=Wo(l.fg,s),o=l.name,c=us(a)}else throw new Qn("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Us(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Wo(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===ts&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Wo(t[r][a],n[r])||`inherit`}, ${Wo(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function Ws(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Ws(e,t,n),codeToTokens:(t,n)=>Hs(e,t,n)}){let i=t;for(let e of vs(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Hs(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Ks(a):d===`never`&&(a=qs(a)),f&&(a=Js(a));let p={...r,get source(){return i}};for(let e of vs(n))a=e.tokens?.call(p,a)||a;return Gs(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Gs(e,t,n,r=us(e)){let i=vs(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:Zo,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
21
- `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=ss(a.htmlStyle||os(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&ls(m,r),m}function Ks(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&yr.Underline||i.fontStyle&yr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function qs(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Js(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=ss(e.htmlStyle||os(e)),i=ss(n.htmlStyle||os(n)),a=e.fontStyle&&(e.fontStyle&yr.Underline||e.fontStyle&yr.Strikethrough),o=n.fontStyle&&(n.fontStyle&yr.Underline||n.fontStyle&yr.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Ys=Bo;function Xs(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Ws(e,t,n),codeToTokens:(t,n)=>Hs(e,t,n)},i=Ys(Ws(e,t,n,r));for(let e of vs(n))i=e.postprocess?.call(r,i,n)||i;return i}var Zs={light:`#333333`,dark:`#bbbbbb`},Qs={light:`#fffffe`,dark:`#1e1e1e`},$s=`__shiki_resolved`;function ec(e){if(e?.[$s])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Zs.light:Zs.dark,n||=t.type===`light`?Qs.light:Qs.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,$s,{enumerable:!1,writable:!1,value:!0}),t}async function tc(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Jo(e)).map(async e=>await Ko(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function nc(e){return(await Promise.all(e.map(async e=>Xo(e)?null:ec(await Ko(e))))).filter(e=>!!e)}var rc=3,ic=!1;function ac(e,t=3){if(rc&&!(typeof rc==`number`&&t>rc)){if(ic)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var oc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function sc(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new oc(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var cc=class extends Pi{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ec(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=fr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=sc(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new oc(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},lc=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}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){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},uc=0;function dc(e){uc+=1,e.warnings!==!1&&uc>=10&&uc%10==0&&console.warn(`[Shiki] ${uc} 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 oc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ec),i=new cc(new lc(e.engine,n),r,n,e.langAlias),a;function o(t){return sc(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new oc(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new oc(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await tc(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await nc(e))}function g(){if(t)throw new oc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--uc)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function fc(e){e.engine||ac("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([nc(e.themes||[]),tc(e.langs||[]),e.engine]);return dc({...e,themes:t,langs:n,engine:r})}async function pc(e){let t=await fc(e);return{getLastGrammarState:(...e)=>Ms(t,...e),codeToTokensBase:(e,n)=>js(t,e,n),codeToTokensWithThemes:(e,n)=>Bs(t,e,n),codeToTokens:(e,n)=>Hs(t,e,n),codeToHast:(e,n)=>Ws(t,e,n),codeToHtml:(e,n)=>Xs(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function mc(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Jo(n))return[];let r=t[n];if(!r)throw new Qn(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Xo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Qn(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await pc({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function hc(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function gc(e,t){let n=hc(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var _c=`modulepreload`,vc=function(e){return`/`+e},yc={},J=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=vc(t,n),t in yc)return;yc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:_c,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},bc=[{id:`abap`,name:`ABAP`,import:(()=>J(()=>import(`./abap-CkQ0tsz-.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>J(()=>import(`./actionscript-3-DHm0ZfF4.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>J(()=>import(`./ada-DK_ua92Z.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>J(()=>import(`./angular-html-BABKYppC.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>J(()=>import(`./angular-ts-CtXLuOQb.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>J(()=>import(`./apache-DXtpFu7o.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>J(()=>import(`./apex-DlnRRWpl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>J(()=>import(`./apl-DOi69evI.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>J(()=>import(`./applescript-CShk62ad.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>J(()=>import(`./ara-CWN-FDkm.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>J(()=>import(`./asciidoc-Bg-PM9Vn.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>J(()=>import(`./asm-DKOhR24S.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>J(()=>import(`./astro-J8Em2tfW.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>J(()=>import(`./awk-3ibKHffv.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>J(()=>import(`./ballerina-xx7VNGxs.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>J(()=>import(`./bat-DGYsZ5wR.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>J(()=>import(`./beancount-D_ATR1UV.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>J(()=>import(`./berry-BqYMORfH.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>J(()=>import(`./bibtex-CQTBDajW.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>J(()=>import(`./bicep-CfNtxPrK.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>J(()=>import(`./bird2-C0dUPe3I.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>J(()=>import(`./blade-B_tOnqRD.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>J(()=>import(`./bsl-Dx5tFn3i.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>J(()=>import(`./c-C0tRZWSi.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>J(()=>import(`./c3-BUwZ5e3k.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>J(()=>import(`./cadence-C3OKDYrr.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>J(()=>import(`./cairo-wCCQTdA9.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>J(()=>import(`./clarity-Crxe8gSr.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>J(()=>import(`./clojure-BuzOUPMr.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>J(()=>import(`./cmake-CCpZLdLI.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>J(()=>import(`./cobol-Dj_rkgIY.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>J(()=>import(`./codeowners-Bo1VYpHz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>J(()=>import(`./codeql-Db01hzHE.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>J(()=>import(`./coffee-C6Vq4BFF.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>J(()=>import(`./common-lisp-CMlJIc6Y.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>J(()=>import(`./coq-BlzBYp3f.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>J(()=>import(`./cpp-Cno48fgF.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>J(()=>import(`./crystal-C7tmDnU1.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>J(()=>import(`./csharp-kfNshAa7.js`),[]))},{id:`css`,name:`CSS`,import:(()=>J(()=>import(`./css-0v4o-iNQ.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>J(()=>import(`./csv-Dr8ri5Nd.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>J(()=>import(`./cue-jXfhyOwY.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>J(()=>import(`./cypher-CayLeiaR.js`),[]))},{id:`d`,name:`D`,import:(()=>J(()=>import(`./d-BMZQ0mAy.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>J(()=>import(`./dart-gMOEMyuz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>J(()=>import(`./dax-C3t5LadU.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>J(()=>import(`./desktop-DmhXLwLR.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>J(()=>import(`./diff-togOXQX6.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>J(()=>import(`./docker--6N01olR.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>J(()=>import(`./dotenv-Bq930Yx8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>J(()=>import(`./dream-maker-BiMf3DHl.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>J(()=>import(`./edge-CvULxRem.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>J(()=>import(`./elixir-vRTauEw-.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>J(()=>import(`./elm-fLFTu1xn.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>J(()=>import(`./emacs-lisp-Dhht7he2.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>J(()=>import(`./erb-CtItcikB.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>J(()=>import(`./erlang-CtK0kQ6z.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>J(()=>import(`./fennel-BExc9TZf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>J(()=>import(`./fish-C2p-AJmZ.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>J(()=>import(`./fluent-CeYzs8Qy.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>J(()=>import(`./fortran-fixed-form-DBM4e0_k.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>J(()=>import(`./fortran-free-form-BIQEK2Jw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>J(()=>import(`./fsharp-CmzzGQLe.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>J(()=>import(`./gdresource-B_wbPqHd.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>J(()=>import(`./gdscript-B5JQPh_-.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>J(()=>import(`./gdshader-vVjJ_Qr8.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>J(()=>import(`./genie-DGl5rqC8.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>J(()=>import(`./gherkin-CY_VLUnD.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>J(()=>import(`./git-commit-1z4D6NzL.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>J(()=>import(`./git-rebase-5MeRBXZD.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>J(()=>import(`./gleam-BarIG9kQ.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>J(()=>import(`./glimmer-js-B7yA-u8_.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>J(()=>import(`./glimmer-ts-B2g1OaHc.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>J(()=>import(`./glsl-CqNPWp5Y.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>J(()=>import(`./gn-DhYsTPYc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>J(()=>import(`./gnuplot-CucLlTBc.js`),[]))},{id:`go`,name:`Go`,import:(()=>J(()=>import(`./go-toi-uWvg.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>J(()=>import(`./graphql-CF78KbfF.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>J(()=>import(`./groovy-Ds4dis_k.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>J(()=>import(`./hack-Dz8fQ8O9.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>J(()=>import(`./haml-3Gbl257r.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>J(()=>import(`./handlebars-5UZnh5L7.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>J(()=>import(`./haskell-B_jvz5Po.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>J(()=>import(`./haxe-BRbuo5UO.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>J(()=>import(`./hcl-BzNUCtsK.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>J(()=>import(`./hjson-BxVo3sS2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>J(()=>import(`./hlsl-C8Wes1nf.js`),[]))},{id:`html`,name:`HTML`,import:(()=>J(()=>import(`./html-JOaQiIkL.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>J(()=>import(`./html-derivative-GyX6oYy3.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>J(()=>import(`./http-t6uVAxgS.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>J(()=>import(`./hurl-OLQZpg0E.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>J(()=>import(`./hxml-DC4KwKt2.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>J(()=>import(`./hy-dMrJKKU_.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>J(()=>import(`./imba-DG_oO8tg.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>J(()=>import(`./ini-geHw79Aj.js`),[]))},{id:`java`,name:`Java`,import:(()=>J(()=>import(`./java-BqL_yaya.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>J(()=>import(`./javascript-CxBNAxR5.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>J(()=>import(`./jinja-CuaK033Z.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>J(()=>import(`./jison-aL_w2vvo.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>J(()=>import(`./json-Byruj-EC.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>J(()=>import(`./json5-CDUsNqz6.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>J(()=>import(`./jsonc-D48xcwyD.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>J(()=>import(`./jsonl-cpIYDXEe.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>J(()=>import(`./jsonnet-Da1lhszN.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>J(()=>import(`./jssm-B8BLrEGL.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>J(()=>import(`./jsx-CosY06uG.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>J(()=>import(`./julia-u1y7fV63.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>J(()=>import(`./just-DS4T9P_K.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>J(()=>import(`./kdl-B-2tSRmp.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>J(()=>import(`./kotlin-DepsEzh3.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>J(()=>import(`./kusto-BcCtXIb8.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>J(()=>import(`./latex-C9c2IWW4.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>J(()=>import(`./lean-CNO9ffpX.js`),[]))},{id:`less`,name:`Less`,import:(()=>J(()=>import(`./less-Dj0T9pWC.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>J(()=>import(`./liquid-DcXQgkEV.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>J(()=>import(`./llvm-DbV9b66l.js`),[]))},{id:`log`,name:`Log file`,import:(()=>J(()=>import(`./log-BMblmPyH.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>J(()=>import(`./logo-B78qMxws.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>J(()=>import(`./lua-DWe0hUn1.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>J(()=>import(`./luau-BUd8xsdE.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>J(()=>import(`./make-Ev-6cJrd.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>J(()=>import(`./markdown-CS4LI6sN.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>J(()=>import(`./marko-CIW7o2up.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>J(()=>import(`./matlab-C0qEtAx9.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>J(()=>import(`./mdc-DKjGzb4k.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>J(()=>import(`./mdx-CzvnbLXb.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>J(()=>import(`./mermaid-BPquZaKt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>J(()=>import(`./mipsasm-k5DQoS6j.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>J(()=>import(`./mojo-sTTDuNnR.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>J(()=>import(`./moonbit-j5ChFtBC.js`),[]))},{id:`move`,name:`Move`,import:(()=>J(()=>import(`./move-Dj0Gmn6R.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>J(()=>import(`./narrat-DJgMz2oW.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>J(()=>import(`./nextflow-CApkvBGW.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>J(()=>import(`./nextflow-groovy-eDLuZ_oi.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>J(()=>import(`./nginx-CBXzDlkk.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>J(()=>import(`./nim-CBf_vdee.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>J(()=>import(`./nix-CxIPS3pb.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>J(()=>import(`./nushell-GDfBmoBU.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>J(()=>import(`./objective-c-MFQ_MGUa.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>J(()=>import(`./objective-cpp-Y83LcBE7.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>J(()=>import(`./ocaml-FxYfaJxu.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>J(()=>import(`./odin-CprihY3z.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>J(()=>import(`./openscad-Bc1FbpOi.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>J(()=>import(`./pascal-Bb4d8cUL.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>J(()=>import(`./perl-xC9qc39I.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>J(()=>import(`./php-n4vnn5oz.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>J(()=>import(`./pkl-tM25Sq0w.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>J(()=>import(`./plsql-CLEfFhSj.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>J(()=>import(`./po-CaAzdrrh.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>J(()=>import(`./polar-TG7aTGdK.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>J(()=>import(`./postcss-8kqfa9f0.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>J(()=>import(`./powerquery-CtSu1Nfd.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>J(()=>import(`./powershell-87lLBHMy.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>J(()=>import(`./prisma-Dnf694DZ.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>J(()=>import(`./prolog-C0XbHTWa.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>J(()=>import(`./proto-BZP-HLIb.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>J(()=>import(`./pug-Db536lA_.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>J(()=>import(`./puppet-CJYWgYC5.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>J(()=>import(`./purescript-B95Q6BAd.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>J(()=>import(`./python-CqTCsi7P.js`),[]))},{id:`qml`,name:`QML`,import:(()=>J(()=>import(`./qml-CrATLnNN.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>J(()=>import(`./qmldir-DlIL4hls.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>J(()=>import(`./qss-BW72E0q_.js`),[]))},{id:`r`,name:`R`,import:(()=>J(()=>import(`./r-DBQ-dydl.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>J(()=>import(`./racket-CCAimEsC.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>J(()=>import(`./raku-mSuqElkM.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>J(()=>import(`./razor-C_wvK1iP.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>J(()=>import(`./reg-CGwMBJ2c.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>J(()=>import(`./regexp-DowFj0Xd.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>J(()=>import(`./rel-JwrbYgX4.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>J(()=>import(`./riscv-CoYyE75b.js`),[]))},{id:`ron`,name:`RON`,import:(()=>J(()=>import(`./ron-C5wrhnmJ.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>J(()=>import(`./rosmsg-DlimTR9t.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>J(()=>import(`./rst-rY4UPiwe.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>J(()=>import(`./ruby-C4cISY4u.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>J(()=>import(`./rust-Cxnkxx3h.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>J(()=>import(`./sas-ui1PNNkD.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>J(()=>import(`./sass-DEyqUIpU.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>J(()=>import(`./scala-i3RN3yAN.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>J(()=>import(`./scheme-BcKdjYkO.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>J(()=>import(`./scss-BZrs95TC.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>J(()=>import(`./sdbl-Be_XWc3n.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>J(()=>import(`./shaderlab-DXAhMdPo.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>J(()=>import(`./shellscript-D9YVFS67.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>J(()=>import(`./shellsession-DK7LMzYg.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>J(()=>import(`./smalltalk-BdBlL6ks.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>J(()=>import(`./solidity-DH-yUSWc.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>J(()=>import(`./soy-CNkc-Oji.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>J(()=>import(`./sparql-BdcL8cbr.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>J(()=>import(`./splunk-CIjc4kxs.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>J(()=>import(`./sql-BvRdqBMa.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>J(()=>import(`./ssh-config-BKVd4drG.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>J(()=>import(`./stata-Bawjgtiz.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>J(()=>import(`./stylus-tqAsmugv.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>J(()=>import(`./surrealql-7v7lT5jp.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>J(()=>import(`./svelte-p7w_kluv.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>J(()=>import(`./swift-CdDBQ3_Z.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>J(()=>import(`./system-verilog-CBqEY-9v.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>J(()=>import(`./systemd-khRP5zwK.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>J(()=>import(`./talonscript-D_lneH-6.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>J(()=>import(`./tasl-CLymawGe.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>J(()=>import(`./tcl-BRY1S87U.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>J(()=>import(`./templ-0Gi_yZZr.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>J(()=>import(`./terraform-BqohMo2f.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>J(()=>import(`./tex-nZ_J3lks.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>J(()=>import(`./toml-C4c85Lwg.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>J(()=>import(`./ts-tags-CuG-Aj5j.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>J(()=>import(`./tsv-DsZq9HBQ.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>J(()=>import(`./tsx-Cc7GNb_V.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>J(()=>import(`./turtle-Dpr8zLlw.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>J(()=>import(`./twig-BBlmihVM.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>J(()=>import(`./typescript-aiXwsZhm.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>J(()=>import(`./typespec-DcqgATB-.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>J(()=>import(`./typst-CeVxmuPg.js`),[]))},{id:`v`,name:`V`,import:(()=>J(()=>import(`./v-C2Qsh2-1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>J(()=>import(`./vala-CvZ3yL7c.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>J(()=>import(`./vb-B_p4qDw4.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>J(()=>import(`./verilog-D8MGjxD7.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>J(()=>import(`./vhdl-MLyYh_Gz.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>J(()=>import(`./viml-BuYIArcz.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>J(()=>import(`./vue-Cs5tk2kn.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>J(()=>import(`./vue-html-BEI_B8Ml.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>J(()=>import(`./vue-vine-CpWdOkP4.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>J(()=>import(`./vyper-CNqG09-_.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>J(()=>import(`./wasm-BsQDV7Y0.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>J(()=>import(`./wenyan-BmOQge13.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>J(()=>import(`./wgsl-CgWrmvIg.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>J(()=>import(`./wikitext-DkwckXCk.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>J(()=>import(`./wit-CtyVFGe7.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>J(()=>import(`./wolfram-CXE4FrKz.js`),[]))},{id:`xml`,name:`XML`,import:(()=>J(()=>import(`./xml-madLQSkS.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>J(()=>import(`./xsl-CqZR37V9.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>J(()=>import(`./yaml-DHr9ndbK.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>J(()=>import(`./zenscript-DH15wJt0.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>J(()=>import(`./zig-CqXN9brD.js`),[]))}],xc=Object.fromEntries(bc.map(e=>[e.id,e.import])),Sc=Object.fromEntries(bc.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Cc={...xc,...Sc},wc=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-D2ccw8v4.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-DpaEirL8.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-ursiSH5k.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-DMjlrKmx.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-DZEMb75h.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-CMnRXVZP.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CqhXSjCC.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-B6kneE0C.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-CP8YZpvj.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-B__q47Nr.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-CBkSghcw.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-CCSYeoxL.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-NqSz4oHS.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-a3Yzs_lT.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-ClO4AStc.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-CM0dPco8.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Cb6xxpXY.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-BpYtx2-M.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-CeOVFgf_.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BmnCWL6x.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-rpagNF5O.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-aPiW8pQh.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-2HJCvzsS.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-Da97ODX9.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BXlEipFe.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-Cun-GjGk.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-Bd3qiiSw.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-D54PjLAY.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>J(()=>import(`./horizon-bright-D9RccdIr.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CMu1N_4K.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-2Sk8Rx83.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-CQVSWfJp.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BKWNioLX.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-BUqkO46F.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-C9Hnuc1T.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-5rA1zn0D.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-DGOEiL65.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-CULfFRX0.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-LQZ9CleP.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-Di_f5oks.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-rkuIbtJV.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-Dj_HOGsr.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-D5p-u2ij.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-CEdtPl3A.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-GdSldewm.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-3WFAz5H9.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-BB6mpmmA.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-BYLoxNtg.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-D3k2Xp_5.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-bPTvT4Da.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-C-DA4yBI.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-DlrMPYYd.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-DBHFtZD2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-BBfrpe5q.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-3PDtm74m.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-CwiuFRJD.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-Dyqc8Is2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-DZiTscIX.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DBcfxrfG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-CbbRs73K.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-BWUONxad.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DossXiE1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-C3kc1227.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-kWOu5V36.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-DMtiL8bK.js`),[]))}].map(e=>[e.id,e.import])),Tc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ec(){return 2147483648}function Dc(){return typeof performance<`u`?performance.now():Date.now()}var Oc=(e,t)=>e+(t-e%t)%t;async function kc(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Ec();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Oc(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Dc,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Ac=Object.defineProperty,jc=(e,t,n)=>t in e?Ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t,n)=>jc(e,typeof t==`symbol`?t:t+``,n),Nc=null;function Pc(e){throw new Tc(e.UTF8ToString(e.getLastOnigError()))}var Fc=class e{constructor(t){Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16Value`),Mc(this,`utf8Value`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Ic=class e{constructor(t){if(Mc(this,`id`,++e.LAST_ID),Mc(this,`_onigBinding`),Mc(this,`content`),Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`),Mc(this,`ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);this._onigBinding=Nc,this.content=t;let n=new Fc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Nc.omalloc(1e4),e._sharedPtrInUse=!0,Nc.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Nc)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Mc(Ic,`LAST_ID`,0),Mc(Ic,`_sharedPtr`,0),Mc(Ic,`_sharedPtrInUse`,!1);var Lc=Ic,Rc=class{constructor(e){if(Mc(this,`_onigBinding`),Mc(this,`_ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Fc(e[r]);t[r]=i.createString(Nc),n[r]=i.utf8Length}let r=Nc.omalloc(4*e.length);Nc.HEAPU32.set(t,r/4);let i=Nc.omalloc(4*e.length);Nc.HEAPU32.set(n,i/4);let a=Nc.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Nc.ofree(t[n]);Nc.ofree(i),Nc.ofree(r),a===0&&Pc(Nc),this._onigBinding=Nc,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Lc(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function zc(e){return typeof e.instantiator==`function`}function Bc(e){return typeof e.default==`function`}function Vc(e){return e.data!==void 0}function Hc(e){return typeof Response<`u`&&e instanceof Response}function Uc(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}var Wc;function Gc(e){if(Wc)return Wc;async function t(){Nc=await kc(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),zc(n)?n=await n.instantiator(t):Bc(n)?n=await n.default(t):(Vc(n)&&(n=n.data),Hc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await qc(n)(t):await Jc(n)(t):Uc(n)||n instanceof WebAssembly.Module?n=await Kc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Kc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Wc=t(),Wc}function Kc(e){return t=>WebAssembly.instantiate(e,t)}function qc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Jc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Yc(e){return e&&await Gc(e),{createScanner(e){return new Rc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Lc(e)}}}var Xc=mc({langs:Cc,themes:wc,engine:()=>Yc(J(()=>import(`./wasm-DFVlQlgd.js`),[]))}),{codeToHtml:Zc,codeToHast:Qc,codeToTokens:$c,codeToTokensBase:el,codeToTokensWithThemes:tl,getSingletonHighlighter:nl,getLastGrammarState:rl}=gc(Xc,{guessEmbeddedLanguages:es});function il(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function al(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var ol=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),sl=String.raw;function cl(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ll=sl`\[\^?`,ul=`c.? | C(?:-.?)?|${sl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${sl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${sl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${sl`o\{[^\}]*\}?`}|${sl`\d{1,3}`}`,dl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,fl=new RegExp(sl`
21
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=ss(a.htmlStyle||os(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&ls(m,r),m}function Ks(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&yr.Underline||i.fontStyle&yr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function qs(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Js(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=ss(e.htmlStyle||os(e)),i=ss(n.htmlStyle||os(n)),a=e.fontStyle&&(e.fontStyle&yr.Underline||e.fontStyle&yr.Strikethrough),o=n.fontStyle&&(n.fontStyle&yr.Underline||n.fontStyle&yr.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Ys=Bo;function Xs(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Ws(e,t,n),codeToTokens:(t,n)=>Hs(e,t,n)},i=Ys(Ws(e,t,n,r));for(let e of vs(n))i=e.postprocess?.call(r,i,n)||i;return i}var Zs={light:`#333333`,dark:`#bbbbbb`},Qs={light:`#fffffe`,dark:`#1e1e1e`},$s=`__shiki_resolved`;function ec(e){if(e?.[$s])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Zs.light:Zs.dark,n||=t.type===`light`?Qs.light:Qs.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,$s,{enumerable:!1,writable:!1,value:!0}),t}async function tc(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Jo(e)).map(async e=>await Ko(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function nc(e){return(await Promise.all(e.map(async e=>Xo(e)?null:ec(await Ko(e))))).filter(e=>!!e)}var rc=3,ic=!1;function ac(e,t=3){if(rc&&!(typeof rc==`number`&&t>rc)){if(ic)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var oc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function sc(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new oc(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var cc=class extends Pi{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ec(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=fr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=sc(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new oc(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},lc=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}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){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},uc=0;function dc(e){uc+=1,e.warnings!==!1&&uc>=10&&uc%10==0&&console.warn(`[Shiki] ${uc} 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 oc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ec),i=new cc(new lc(e.engine,n),r,n,e.langAlias),a;function o(t){return sc(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new oc(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new oc(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await tc(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await nc(e))}function g(){if(t)throw new oc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--uc)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function fc(e){e.engine||ac("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([nc(e.themes||[]),tc(e.langs||[]),e.engine]);return dc({...e,themes:t,langs:n,engine:r})}async function pc(e){let t=await fc(e);return{getLastGrammarState:(...e)=>Ms(t,...e),codeToTokensBase:(e,n)=>js(t,e,n),codeToTokensWithThemes:(e,n)=>Bs(t,e,n),codeToTokens:(e,n)=>Hs(t,e,n),codeToHast:(e,n)=>Ws(t,e,n),codeToHtml:(e,n)=>Xs(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function mc(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Jo(n))return[];let r=t[n];if(!r)throw new Qn(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Xo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Qn(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await pc({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function hc(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function gc(e,t){let n=hc(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var _c=`modulepreload`,vc=function(e){return`/`+e},yc={},J=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=vc(t,n),t in yc)return;yc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:_c,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},bc=[{id:`abap`,name:`ABAP`,import:(()=>J(()=>import(`./abap-CkQ0tsz-.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>J(()=>import(`./actionscript-3-DHm0ZfF4.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>J(()=>import(`./ada-DK_ua92Z.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>J(()=>import(`./angular-html-fdYbuxHF.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>J(()=>import(`./angular-ts-D3iFqR-R.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>J(()=>import(`./apache-DXtpFu7o.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>J(()=>import(`./apex-DlnRRWpl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>J(()=>import(`./apl-MnBV-iQN.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>J(()=>import(`./applescript-CShk62ad.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>J(()=>import(`./ara-CWN-FDkm.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>J(()=>import(`./asciidoc-Bg-PM9Vn.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>J(()=>import(`./asm-DKOhR24S.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>J(()=>import(`./astro-BrpK01E7.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>J(()=>import(`./awk-3ibKHffv.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>J(()=>import(`./ballerina-xx7VNGxs.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>J(()=>import(`./bat-DGYsZ5wR.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>J(()=>import(`./beancount-D_ATR1UV.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>J(()=>import(`./berry-BqYMORfH.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>J(()=>import(`./bibtex-CQTBDajW.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>J(()=>import(`./bicep-CfNtxPrK.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>J(()=>import(`./bird2-C0dUPe3I.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>J(()=>import(`./blade-CGmyBuwD.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>J(()=>import(`./bsl-Dx5tFn3i.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>J(()=>import(`./c-xQnwtG9Y.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>J(()=>import(`./c3-BUwZ5e3k.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>J(()=>import(`./cadence-C3OKDYrr.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>J(()=>import(`./cairo-wCCQTdA9.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>J(()=>import(`./clarity-Crxe8gSr.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>J(()=>import(`./clojure-BuzOUPMr.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>J(()=>import(`./cmake-CCpZLdLI.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>J(()=>import(`./cobol-ypVzOIQu.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>J(()=>import(`./codeowners-Bo1VYpHz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>J(()=>import(`./codeql-Db01hzHE.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>J(()=>import(`./coffee-CrtE1uj2.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>J(()=>import(`./common-lisp-CMlJIc6Y.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>J(()=>import(`./coq-BlzBYp3f.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>J(()=>import(`./cpp-DLd4XEKA.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>J(()=>import(`./crystal-CJYvpLt_.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>J(()=>import(`./csharp-kfNshAa7.js`),[]))},{id:`css`,name:`CSS`,import:(()=>J(()=>import(`./css-DrX2B9os.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>J(()=>import(`./csv-Dr8ri5Nd.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>J(()=>import(`./cue-jXfhyOwY.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>J(()=>import(`./cypher-CayLeiaR.js`),[]))},{id:`d`,name:`D`,import:(()=>J(()=>import(`./d-BMZQ0mAy.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>J(()=>import(`./dart-gMOEMyuz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>J(()=>import(`./dax-C3t5LadU.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>J(()=>import(`./desktop-DmhXLwLR.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>J(()=>import(`./diff-togOXQX6.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>J(()=>import(`./docker--6N01olR.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>J(()=>import(`./dotenv-Bq930Yx8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>J(()=>import(`./dream-maker-BiMf3DHl.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>J(()=>import(`./edge-BsQYk9OW.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>J(()=>import(`./elixir-DU_VfGYR.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>J(()=>import(`./elm-W4eOLEDv.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>J(()=>import(`./emacs-lisp-Dhht7he2.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>J(()=>import(`./erb-D9FdIJ2e.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>J(()=>import(`./erlang-CtK0kQ6z.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>J(()=>import(`./fennel-BExc9TZf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>J(()=>import(`./fish-C2p-AJmZ.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>J(()=>import(`./fluent-CeYzs8Qy.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>J(()=>import(`./fortran-fixed-form-DBM4e0_k.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>J(()=>import(`./fortran-free-form-BIQEK2Jw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>J(()=>import(`./fsharp-CmzzGQLe.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>J(()=>import(`./gdresource-B_wbPqHd.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>J(()=>import(`./gdscript-B5JQPh_-.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>J(()=>import(`./gdshader-vVjJ_Qr8.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>J(()=>import(`./genie-DGl5rqC8.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>J(()=>import(`./gherkin-CY_VLUnD.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>J(()=>import(`./git-commit-1z4D6NzL.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>J(()=>import(`./git-rebase-BtPCXjbS.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>J(()=>import(`./gleam-BarIG9kQ.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>J(()=>import(`./glimmer-js-BVfUGMUb.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>J(()=>import(`./glimmer-ts-BZEaHDZL.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>J(()=>import(`./glsl-CSiNDuwt.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>J(()=>import(`./gn-DhYsTPYc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>J(()=>import(`./gnuplot-CucLlTBc.js`),[]))},{id:`go`,name:`Go`,import:(()=>J(()=>import(`./go-toi-uWvg.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>J(()=>import(`./graphql-Crf08Rhb.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>J(()=>import(`./groovy-Ds4dis_k.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>J(()=>import(`./hack-DUiQuO20.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>J(()=>import(`./haml-BtvVTDRG.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>J(()=>import(`./handlebars-Bu_cdZA_.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>J(()=>import(`./haskell-B_jvz5Po.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>J(()=>import(`./haxe-BRbuo5UO.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>J(()=>import(`./hcl-BzNUCtsK.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>J(()=>import(`./hjson-BxVo3sS2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>J(()=>import(`./hlsl-C8Wes1nf.js`),[]))},{id:`html`,name:`HTML`,import:(()=>J(()=>import(`./html-C4cun3zD.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>J(()=>import(`./html-derivative-CQnD80KV.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>J(()=>import(`./http-DuOJF9Kg.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>J(()=>import(`./hurl-DgrdYsYh.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>J(()=>import(`./hxml-DC4KwKt2.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>J(()=>import(`./hy-dMrJKKU_.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>J(()=>import(`./imba-DG_oO8tg.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>J(()=>import(`./ini-geHw79Aj.js`),[]))},{id:`java`,name:`Java`,import:(()=>J(()=>import(`./java-D-vtFiv8.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>J(()=>import(`./javascript-CFYFXvdN.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>J(()=>import(`./jinja-fZvIg2_s.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>J(()=>import(`./jison-DEzxLq5g.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>J(()=>import(`./json-QM4VBqMC.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>J(()=>import(`./json5-CDUsNqz6.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>J(()=>import(`./jsonc-D48xcwyD.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>J(()=>import(`./jsonl-cpIYDXEe.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>J(()=>import(`./jsonnet-Da1lhszN.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>J(()=>import(`./jssm-B8BLrEGL.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>J(()=>import(`./jsx-DLzUM_cC.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>J(()=>import(`./julia-Dwt1SIpn.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>J(()=>import(`./just-Dwp-hLcL.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>J(()=>import(`./kdl-B-2tSRmp.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>J(()=>import(`./kotlin-DepsEzh3.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>J(()=>import(`./kusto-BcCtXIb8.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>J(()=>import(`./latex-CMF1JViz.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>J(()=>import(`./lean-CNO9ffpX.js`),[]))},{id:`less`,name:`Less`,import:(()=>J(()=>import(`./less-Dj0T9pWC.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>J(()=>import(`./liquid-czkpOZWY.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>J(()=>import(`./llvm-DbV9b66l.js`),[]))},{id:`log`,name:`Log file`,import:(()=>J(()=>import(`./log-BMblmPyH.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>J(()=>import(`./logo-B78qMxws.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>J(()=>import(`./lua-DE5PD0Vh.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>J(()=>import(`./luau-BUd8xsdE.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>J(()=>import(`./make-Ev-6cJrd.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>J(()=>import(`./markdown-CS4LI6sN.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>J(()=>import(`./marko-DHeEvZiW.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>J(()=>import(`./matlab-C0qEtAx9.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>J(()=>import(`./mdc-B941liUQ.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>J(()=>import(`./mdx-CzvnbLXb.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>J(()=>import(`./mermaid-BPquZaKt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>J(()=>import(`./mipsasm-k5DQoS6j.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>J(()=>import(`./mojo-sTTDuNnR.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>J(()=>import(`./moonbit-j5ChFtBC.js`),[]))},{id:`move`,name:`Move`,import:(()=>J(()=>import(`./move-Dj0Gmn6R.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>J(()=>import(`./narrat-DJgMz2oW.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>J(()=>import(`./nextflow-CApkvBGW.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>J(()=>import(`./nextflow-groovy-eDLuZ_oi.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>J(()=>import(`./nginx-Pb9t8c-r.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>J(()=>import(`./nim-MMUvW_R1.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>J(()=>import(`./nix-CxIPS3pb.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>J(()=>import(`./nushell-GDfBmoBU.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>J(()=>import(`./objective-c-MFQ_MGUa.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>J(()=>import(`./objective-cpp-Y83LcBE7.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>J(()=>import(`./ocaml-FxYfaJxu.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>J(()=>import(`./odin-CprihY3z.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>J(()=>import(`./openscad-Bc1FbpOi.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>J(()=>import(`./pascal-Bb4d8cUL.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>J(()=>import(`./perl-DXwXRmuC.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>J(()=>import(`./php-D42kv59r.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>J(()=>import(`./pkl-tM25Sq0w.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>J(()=>import(`./plsql-CLEfFhSj.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>J(()=>import(`./po-CaAzdrrh.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>J(()=>import(`./polar-TG7aTGdK.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>J(()=>import(`./postcss-8kqfa9f0.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>J(()=>import(`./powerquery-CtSu1Nfd.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>J(()=>import(`./powershell-87lLBHMy.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>J(()=>import(`./prisma-Dnf694DZ.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>J(()=>import(`./prolog-C0XbHTWa.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>J(()=>import(`./proto-BZP-HLIb.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>J(()=>import(`./pug-v0iesski.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>J(()=>import(`./puppet-CJYWgYC5.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>J(()=>import(`./purescript-B95Q6BAd.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>J(()=>import(`./python-CqTCsi7P.js`),[]))},{id:`qml`,name:`QML`,import:(()=>J(()=>import(`./qml-spxQQ-ei.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>J(()=>import(`./qmldir-DlIL4hls.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>J(()=>import(`./qss-BW72E0q_.js`),[]))},{id:`r`,name:`R`,import:(()=>J(()=>import(`./r-CobWTBG9.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>J(()=>import(`./racket-CCAimEsC.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>J(()=>import(`./raku-mSuqElkM.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>J(()=>import(`./razor-B-_Ww3MB.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>J(()=>import(`./reg-CGwMBJ2c.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>J(()=>import(`./regexp-BJMVs8R0.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>J(()=>import(`./rel-JwrbYgX4.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>J(()=>import(`./riscv-CoYyE75b.js`),[]))},{id:`ron`,name:`RON`,import:(()=>J(()=>import(`./ron-C5wrhnmJ.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>J(()=>import(`./rosmsg-DlimTR9t.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>J(()=>import(`./rst-BHcaWsY0.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>J(()=>import(`./ruby-BCMT6kog.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>J(()=>import(`./rust-Cxnkxx3h.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>J(()=>import(`./sas-DHfZnd3R.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>J(()=>import(`./sass-DEyqUIpU.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>J(()=>import(`./scala-i3RN3yAN.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>J(()=>import(`./scheme-BcKdjYkO.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>J(()=>import(`./scss-DjDsJvDO.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>J(()=>import(`./sdbl-Be_XWc3n.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>J(()=>import(`./shaderlab-DXAhMdPo.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>J(()=>import(`./shellscript-B6qaIiU-.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>J(()=>import(`./shellsession-ByCeir2b.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>J(()=>import(`./smalltalk-BdBlL6ks.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>J(()=>import(`./solidity-DH-yUSWc.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>J(()=>import(`./soy-C6WpnMSF.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>J(()=>import(`./sparql-BdcL8cbr.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>J(()=>import(`./splunk-CIjc4kxs.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>J(()=>import(`./sql-BIvSNLV_.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>J(()=>import(`./ssh-config-BKVd4drG.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>J(()=>import(`./stata-PG9iZ--I.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>J(()=>import(`./stylus-tqAsmugv.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>J(()=>import(`./surrealql-CmvCzG09.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>J(()=>import(`./svelte-ChumG88s.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>J(()=>import(`./swift-CdDBQ3_Z.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>J(()=>import(`./system-verilog-CBqEY-9v.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>J(()=>import(`./systemd-khRP5zwK.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>J(()=>import(`./talonscript-D_lneH-6.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>J(()=>import(`./tasl-CLymawGe.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>J(()=>import(`./tcl-BRY1S87U.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>J(()=>import(`./templ-CmzuRY_a.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>J(()=>import(`./terraform-BqohMo2f.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>J(()=>import(`./tex-DL8t-_eJ.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>J(()=>import(`./toml-C4c85Lwg.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>J(()=>import(`./ts-tags-BFfE0Egm.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>J(()=>import(`./tsv-DsZq9HBQ.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>J(()=>import(`./tsx-C1bFyHcE.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>J(()=>import(`./turtle-Dpr8zLlw.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>J(()=>import(`./twig-DkIluZEQ.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>J(()=>import(`./typescript-Gc86Bc3j.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>J(()=>import(`./typespec-DcqgATB-.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>J(()=>import(`./typst-CeVxmuPg.js`),[]))},{id:`v`,name:`V`,import:(()=>J(()=>import(`./v-C2Qsh2-1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>J(()=>import(`./vala-CvZ3yL7c.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>J(()=>import(`./vb-B_p4qDw4.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>J(()=>import(`./verilog-D8MGjxD7.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>J(()=>import(`./vhdl-MLyYh_Gz.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>J(()=>import(`./viml-BuYIArcz.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>J(()=>import(`./vue-C88JmL53.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>J(()=>import(`./vue-html-Cry4aksC.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>J(()=>import(`./vue-vine-zlDkA3Ui.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>J(()=>import(`./vyper-CNqG09-_.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>J(()=>import(`./wasm-BsQDV7Y0.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>J(()=>import(`./wenyan-BmOQge13.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>J(()=>import(`./wgsl-CgWrmvIg.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>J(()=>import(`./wikitext-DkwckXCk.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>J(()=>import(`./wit-CtyVFGe7.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>J(()=>import(`./wolfram-CXE4FrKz.js`),[]))},{id:`xml`,name:`XML`,import:(()=>J(()=>import(`./xml-NvwpIFDy.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>J(()=>import(`./xsl-CDjXvY9w.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>J(()=>import(`./yaml-Bh-LPjcH.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>J(()=>import(`./zenscript-DH15wJt0.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>J(()=>import(`./zig-CqXN9brD.js`),[]))}],xc=Object.fromEntries(bc.map(e=>[e.id,e.import])),Sc=Object.fromEntries(bc.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Cc={...xc,...Sc},wc=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-D2ccw8v4.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-DpaEirL8.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-ursiSH5k.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-DMjlrKmx.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-DZEMb75h.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-CMnRXVZP.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CqhXSjCC.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-B6kneE0C.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-CP8YZpvj.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-B__q47Nr.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-CBkSghcw.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-CCSYeoxL.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-NqSz4oHS.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-a3Yzs_lT.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-ClO4AStc.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-CM0dPco8.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Cb6xxpXY.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-BpYtx2-M.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-CeOVFgf_.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BmnCWL6x.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-rpagNF5O.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-aPiW8pQh.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-2HJCvzsS.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-Da97ODX9.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BXlEipFe.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-Cun-GjGk.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-Bd3qiiSw.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-D54PjLAY.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>J(()=>import(`./horizon-bright-D9RccdIr.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CMu1N_4K.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-2Sk8Rx83.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-CQVSWfJp.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BKWNioLX.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-BUqkO46F.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-C9Hnuc1T.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-5rA1zn0D.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-DGOEiL65.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-CULfFRX0.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-LQZ9CleP.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-Di_f5oks.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-rkuIbtJV.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-Dj_HOGsr.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-D5p-u2ij.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-CEdtPl3A.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-GdSldewm.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-3WFAz5H9.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-BB6mpmmA.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-BYLoxNtg.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-D3k2Xp_5.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-bPTvT4Da.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-C-DA4yBI.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-DlrMPYYd.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-DBHFtZD2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-BBfrpe5q.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-3PDtm74m.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-CwiuFRJD.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-Dyqc8Is2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-DZiTscIX.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DBcfxrfG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-CbbRs73K.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-BWUONxad.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DossXiE1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-C3kc1227.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-kWOu5V36.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-DMtiL8bK.js`),[]))}].map(e=>[e.id,e.import])),Tc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ec(){return 2147483648}function Dc(){return typeof performance<`u`?performance.now():Date.now()}var Oc=(e,t)=>e+(t-e%t)%t;async function kc(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Ec();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Oc(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Dc,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Ac=Object.defineProperty,jc=(e,t,n)=>t in e?Ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t,n)=>jc(e,typeof t==`symbol`?t:t+``,n),Nc=null;function Pc(e){throw new Tc(e.UTF8ToString(e.getLastOnigError()))}var Fc=class e{constructor(t){Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16Value`),Mc(this,`utf8Value`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Ic=class e{constructor(t){if(Mc(this,`id`,++e.LAST_ID),Mc(this,`_onigBinding`),Mc(this,`content`),Mc(this,`utf16Length`),Mc(this,`utf8Length`),Mc(this,`utf16OffsetToUtf8`),Mc(this,`utf8OffsetToUtf16`),Mc(this,`ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);this._onigBinding=Nc,this.content=t;let n=new Fc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Nc.omalloc(1e4),e._sharedPtrInUse=!0,Nc.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Nc)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Mc(Ic,`LAST_ID`,0),Mc(Ic,`_sharedPtr`,0),Mc(Ic,`_sharedPtrInUse`,!1);var Lc=Ic,Rc=class{constructor(e){if(Mc(this,`_onigBinding`),Mc(this,`_ptr`),!Nc)throw new Tc(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Fc(e[r]);t[r]=i.createString(Nc),n[r]=i.utf8Length}let r=Nc.omalloc(4*e.length);Nc.HEAPU32.set(t,r/4);let i=Nc.omalloc(4*e.length);Nc.HEAPU32.set(n,i/4);let a=Nc.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Nc.ofree(t[n]);Nc.ofree(i),Nc.ofree(r),a===0&&Pc(Nc),this._onigBinding=Nc,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Lc(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function zc(e){return typeof e.instantiator==`function`}function Bc(e){return typeof e.default==`function`}function Vc(e){return e.data!==void 0}function Hc(e){return typeof Response<`u`&&e instanceof Response}function Uc(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}var Wc;function Gc(e){if(Wc)return Wc;async function t(){Nc=await kc(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),zc(n)?n=await n.instantiator(t):Bc(n)?n=await n.default(t):(Vc(n)&&(n=n.data),Hc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await qc(n)(t):await Jc(n)(t):Uc(n)||n instanceof WebAssembly.Module?n=await Kc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Kc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Wc=t(),Wc}function Kc(e){return t=>WebAssembly.instantiate(e,t)}function qc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Jc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Yc(e){return e&&await Gc(e),{createScanner(e){return new Rc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Lc(e)}}}var Xc=mc({langs:Cc,themes:wc,engine:()=>Yc(J(()=>import(`./wasm-DFVlQlgd.js`),[]))}),{codeToHtml:Zc,codeToHast:Qc,codeToTokens:$c,codeToTokensBase:el,codeToTokensWithThemes:tl,getSingletonHighlighter:nl,getLastGrammarState:rl}=gc(Xc,{guessEmbeddedLanguages:es});function il(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function al(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var ol=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),sl=String.raw;function cl(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ll=sl`\[\^?`,ul=`c.? | C(?:-.?)?|${sl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${sl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${sl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${sl`o\{[^\}]*\}?`}|${sl`\d{1,3}`}`,dl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,fl=new RegExp(sl`
22
22
  \\ (?:
23
23
  ${ul}
24
24
  | [gk]<[^>]*>?
@@ -1951,7 +1951,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
1951
1951
  `),i=``;i=n?`\n${e.lineContent.split(`
1952
1952
  `).map(e=>`${t} ${e}`).join(`
1953
1953
  `)}\n`:`${t} ${e.lineContent}`,r.push(` <code><![CDATA[${i}]]></code>`)}if(r.push(` <body><![CDATA[${e.body}]]></body>`),e.replies&&e.replies.length>0){r.push(` <replies>`);for(let t of e.replies){let e=new Date(t.createdAt).toISOString(),n=t.role?` role="${t.role}"`:` role="agent"`,i=t.model?` model="${t.model}"`:``;r.push(` <reply id="${t.id}" created-at="${e}"${n}${i}>`),r.push(` <![CDATA[${t.body}]]>`),r.push(` </reply>`)}r.push(` </replies>`)}r.push(` </comment>`)}r.push(` </file>`)}return r.push(`</code-review-comments>`),r.join(`
1954
- `)}var kj=[`comments`];async function Aj(){return(await fetch(`/api/comments`)).json()}function jj(){let e=Ve(),{data:t=[]}=nt({queryKey:kj,queryFn:Aj});(0,W.useEffect)(()=>wj(`comments`,()=>{e.invalidateQueries({queryKey:kj})}),[e]);let[n,r]=(0,W.useState)({round:0,waiters:0,lastSentAt:null});(0,W.useEffect)(()=>{let e=!1;fetch(`/api/review/status`).then(e=>e.json()).then(t=>{e||r(t)}).catch(()=>{});let t=wj(`agent-status`,e=>{try{r(JSON.parse(e))}catch{}});return()=>{e=!0,t()}},[]);let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(null);(0,W.useEffect)(()=>{let e=i.current===null;i.current===null&&(i.current=new Set);let n=i.current,r=null;for(let i of t)for(let t of i.replies??[]){if(n.has(t.id))continue;n.add(t.id);let a=t.role===`agent`||t.role==null&&!!t.model;!e&&a&&(!r||t.createdAt>r.at)&&(r={at:t.createdAt,commentId:i.id,filePath:i.filePath,model:t.model,body:t.body})}r&&o(r)},[t]);let s=rt({mutationFn:async e=>(await fetch(`/api/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>[...e,t])}}),c=rt({mutationFn:async e=>(await fetch(`/api/comments/${e}`,{method:`DELETE`}),e),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.filter(e=>e.id!==t))}}),l=rt({mutationFn:async({id:e,body:t,status:n})=>(await fetch(`/api/comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,status:n})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),u=rt({mutationFn:async({id:e,body:t})=>(await fetch(`/api/comments/${e}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,role:`user`})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),d=rt({mutationFn:async({commentId:e,replyId:t})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`DELETE`})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),f=rt({mutationFn:async({commentId:e,replyId:t,body:n})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),p=rt({mutationFn:async e=>{let t=await fetch(`/api/review/send`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({generalComment:e?.trim()||void 0})});if(!t.ok)throw Error(`Failed to send to agent`);return t.json()}}),m=rt({mutationFn:async e=>{let t=await fetch(`/api/comments/${e}/apply-suggestion`,{method:`POST`});if(!t.ok){let e=await t.json();throw Error(e.error||`Failed to apply suggestion`)}return t.json()},onSuccess:()=>{e.invalidateQueries({queryKey:kj})}}),h=(0,W.useCallback)((e,t,n,r,i,a)=>{s.mutate({filePath:e,side:t,lineNumber:n,startLineNumber:a,lineContent:r,body:i})},[s.mutate]),g=(0,W.useCallback)(e=>{c.mutate(e)},[c.mutate]),_=(0,W.useCallback)((e,t)=>{l.mutate({id:e,body:t})},[l.mutate]),v=(0,W.useCallback)(e=>{l.mutate({id:e,status:`resolved`})},[l.mutate]),y=(0,W.useCallback)(e=>{l.mutate({id:e,status:`open`})},[l.mutate]),b=(0,W.useCallback)((e,t)=>{u.mutate({id:e,body:t})},[u.mutate]),x=(0,W.useCallback)((e,t)=>{d.mutate({commentId:e,replyId:t})},[d.mutate]),S=(0,W.useCallback)((e,t,n)=>{f.mutate({commentId:e,replyId:t,body:n})},[f.mutate]),C=(0,W.useCallback)(async e=>{await m.mutateAsync(e)},[m.mutateAsync]),w=(0,W.useCallback)(()=>Oj(t),[t]),T=(0,W.useCallback)(e=>t.filter(t=>t.filePath===e).map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),[t]),E=(0,W.useCallback)(async()=>{let e=w();await navigator.clipboard.writeText(e)},[w]),D=(0,W.useCallback)(e=>p.mutateAsync(e),[p.mutateAsync]);return{comments:t,addComment:h,removeComment:g,editComment:_,resolveComment:v,unresolveComment:y,addReply:b,removeReply:x,editReply:S,applySuggestion:C,getAnnotationsForFile:T,formatAllComments:w,copyAllComments:E,agentActivity:a,clearAgentActivity:(0,W.useCallback)(()=>o(null),[]),sendToAgent:D,sending:p.isPending,agentWaiting:n.waiters>0}}function Mj(e){let[t,n]=(0,W.useState)({inMerge:!1,conflicts:[]}),r=(0,W.useCallback)(()=>{fetch(`/api/merge-status`).then(e=>e.ok?e.json():{inMerge:!1,conflicts:[]}).then(n).catch(()=>n({inMerge:!1,conflicts:[]}))},[]);return(0,W.useEffect)(()=>{r()},[r,e]),{status:t,refresh:r}}var Nj={staged:!0,untracked:!0,diffStyle:`split`,defaultTabSize:4,theme:`nord`,editorIDE:`default`,lineDiffType:`word`,lineWrap:!1,diffIndicators:`classic`,showLineNumbers:!0,hunkSeparators:`line-info`,lineHoverHighlight:`both`,fontSize:13,expandContextByDefault:!1,collapsedContextThreshold:10,expansionLineCount:20,haptics:!0,sounds:!0};function Pj(){let[e,t]=(0,W.useState)(Nj),[n,r]=(0,W.useState)(!1),i=(0,W.useRef)(!0);return(0,W.useEffect)(()=>{fetch(`/api/settings`).then(e=>e.json()).then(e=>{i.current=!0,t({...Nj,...e}),r(!0)}).catch(()=>r(!0))},[]),(0,W.useEffect)(()=>{if(i.current){i.current=!1;return}let t=setTimeout(()=>{fetch(`/api/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})},300);return()=>clearTimeout(t)},[e]),{settings:e,loaded:n,updateSettings:(0,W.useCallback)(e=>{t(t=>({...t,...e}))},[])}}var Fj=[`viewed`];async function Ij(){return(await fetch(`/api/viewed`)).json()}function Lj(){let e=Ve(),{data:t=[]}=nt({queryKey:Fj,queryFn:Ij});return{viewedFiles:(0,W.useMemo)(()=>new Set(t),[t]),setViewed:(0,W.useCallback)(async(t,n)=>{e.setQueryData(Fj,(e=[])=>n?e.includes(t)?e:[...e,t]:e.filter(e=>e!==t)),await fetch(`/api/viewed`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:t,viewed:n})})},[e])}}var Rj={success:{pattern:[{duration:30,intensity:.5},{delay:60,duration:40,intensity:1}]},warning:{pattern:[{duration:40,intensity:.8},{delay:100,duration:40,intensity:.6}]},error:{pattern:[{duration:40,intensity:.9},{delay:40,duration:40,intensity:.9},{delay:40,duration:40,intensity:.9}]},light:{pattern:[{duration:15,intensity:.4}]},medium:{pattern:[{duration:25,intensity:.7}]},heavy:{pattern:[{duration:35,intensity:1}]},soft:{pattern:[{duration:40,intensity:.5}]},rigid:{pattern:[{duration:10,intensity:1}]},selection:{pattern:[{duration:8,intensity:.3}]},nudge:{pattern:[{duration:80,intensity:.8},{delay:80,duration:50,intensity:.3}]},buzz:{pattern:[{duration:1e3,intensity:1}]}},zj=16,Bj=184,Vj=1e3,Hj=20;function Uj(e){if(typeof e==`number`)return{vibrations:[{duration:e}]};if(typeof e==`string`){let t=Rj[e];return t?{vibrations:t.pattern.map(e=>({...e}))}:(console.warn(`[web-haptics] Unknown preset: "${e}"`),null)}if(Array.isArray(e)){if(e.length===0)return{vibrations:[]};if(typeof e[0]==`number`){let t=e,n=[];for(let e=0;e<t.length;e+=2){let r=e>0?t[e-1]:0;n.push({...r>0&&{delay:r},duration:t[e]})}return{vibrations:n}}return{vibrations:e.map(e=>({...e}))}}return{vibrations:e.pattern.map(e=>({...e}))}}function Wj(e,t){if(t>=1)return[e];if(t<=0)return[];let n=Math.max(1,Math.round(Hj*t)),r=Hj-n,i=[],a=e;for(;a>=Hj;)i.push(n),i.push(r),a-=Hj;if(a>0){let e=Math.max(1,Math.round(a*t));i.push(e);let n=a-e;n>0&&i.push(n)}return i}function Gj(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=Math.max(0,Math.min(1,i.intensity??t)),o=i.delay??0;o>0&&(n.length>0&&n.length%2==0?n[n.length-1]+=o:(n.length===0&&n.push(0),n.push(o)));let s=Wj(i.duration,a);if(s.length===0){n.length>0&&n.length%2==0?n[n.length-1]+=i.duration:i.duration>0&&(n.push(0),n.push(i.duration));continue}for(let e of s)n.push(e)}return n}var Kj=0,qj=class e{hapticLabel=null;domInitialized=!1;instanceId;debug;showSwitch;rafId=null;patternResolve=null;audioCtx=null;audioFilter=null;audioGain=null;audioBuffer=null;constructor(e){this.instanceId=++Kj,this.debug=e?.debug??!1,this.showSwitch=e?.showSwitch??!1}static isSupported=typeof navigator<`u`&&typeof navigator.vibrate==`function`;async trigger(t=[{duration:25,intensity:.7}],n){let r=Uj(t);if(!r)return;let{vibrations:i}=r;if(i.length===0)return;let a=Math.max(0,Math.min(1,n?.intensity??.5));for(let e of i)if(e.duration>Vj&&(e.duration=Vj),!Number.isFinite(e.duration)||e.duration<0||e.delay!==void 0&&(!Number.isFinite(e.delay)||e.delay<0)){console.warn(`[web-haptics] Invalid vibration values. Durations and delays must be finite non-negative numbers.`);return}if(e.isSupported&&navigator.vibrate(Gj(i,a)),!e.isSupported||this.debug){if(this.ensureDOM(),!this.hapticLabel)return;this.debug&&await this.ensureAudio(),this.stopPattern();let e=(i[0]?.delay??0)===0;if(e&&(this.hapticLabel.click(),this.debug&&this.audioCtx)){let e=Math.max(0,Math.min(1,i[0].intensity??a));this.playClick(e)}await this.runPattern(i,a,e)}}cancel(){this.stopPattern(),e.isSupported&&navigator.vibrate(0)}destroy(){this.stopPattern(),this.hapticLabel&&(this.hapticLabel.remove(),this.hapticLabel=null,this.domInitialized=!1),this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setDebug(e){this.debug=e,!e&&this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setShowSwitch(e){if(this.showSwitch=e,this.hapticLabel){let t=this.hapticLabel.querySelector(`input`);this.hapticLabel.style.display=e?``:`none`,t&&(t.style.display=e?``:`none`)}}stopPattern(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.patternResolve?.(),this.patternResolve=null}runPattern(e,t,n){return new Promise(r=>{this.patternResolve=r;let i=[],a=0;for(let n of e){let e=Math.max(0,Math.min(1,n.intensity??t)),r=n.delay??0;r>0&&(a+=r,i.push({end:a,isOn:!1,intensity:0})),a+=n.duration,i.push({end:a,isOn:!0,intensity:e})}let o=a,s=0,c=-1,l=e=>{s===0&&(s=e);let t=e-s;if(t>=o){this.rafId=null,this.patternResolve=null,r();return}let a=i[0];for(let e of i)if(t<e.end){a=e;break}if(a.isOn){let t=zj+(1-a.intensity)*Bj;c===-1?(c=e,n||=(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),!0)):e-c>=t&&(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),c=e)}this.rafId=requestAnimationFrame(l)};this.rafId=requestAnimationFrame(l)})}playClick(e){if(!this.audioCtx||!this.audioFilter||!this.audioGain||!this.audioBuffer)return;let t=this.audioBuffer.getChannelData(0);for(let e=0;e<t.length;e++)t[e]=(Math.random()*2-1)*Math.exp(-e/25);this.audioGain.gain.value=.5*e;let n=2e3+e*2e3,r=1+(Math.random()-.5)*.3;this.audioFilter.frequency.value=n*r;let i=this.audioCtx.createBufferSource();i.buffer=this.audioBuffer,i.connect(this.audioFilter),i.onended=()=>i.disconnect(),i.start()}async ensureAudio(){if(!this.audioCtx&&typeof AudioContext<`u`){this.audioCtx=new AudioContext,this.audioFilter=this.audioCtx.createBiquadFilter(),this.audioFilter.type=`bandpass`,this.audioFilter.frequency.value=4e3,this.audioFilter.Q.value=8,this.audioGain=this.audioCtx.createGain(),this.audioFilter.connect(this.audioGain),this.audioGain.connect(this.audioCtx.destination),this.audioBuffer=this.audioCtx.createBuffer(1,this.audioCtx.sampleRate*.004,this.audioCtx.sampleRate);let e=this.audioBuffer.getChannelData(0);for(let t=0;t<e.length;t++)e[t]=(Math.random()*2-1)*Math.exp(-t/25)}this.audioCtx?.state===`suspended`&&await this.audioCtx.resume()}ensureDOM(){if(this.domInitialized||typeof document>`u`)return;let e=`web-haptics-${this.instanceId}`,t=document.createElement(`label`);t.setAttribute(`for`,e),t.textContent=`Haptic feedback`,t.style.position=`fixed`,t.style.bottom=`10px`,t.style.left=`10px`,t.style.padding=`5px 10px`,t.style.backgroundColor=`rgba(0, 0, 0, 0.7)`,t.style.color=`white`,t.style.fontFamily=`sans-serif`,t.style.fontSize=`14px`,t.style.borderRadius=`4px`,t.style.zIndex=`9999`,t.style.userSelect=`none`,this.hapticLabel=t;let n=document.createElement(`input`);n.type=`checkbox`,n.setAttribute(`switch`,``),n.id=e,n.style.all=`initial`,n.style.appearance=`auto`,this.showSwitch||(t.style.display=`none`,n.style.display=`none`),t.appendChild(n),document.body.appendChild(t),this.domInitialized=!0}};function Jj(e){let t=(0,W.useRef)(null);return(0,W.useEffect)(()=>(t.current=new qj(e),()=>{t.current?.destroy(),t.current=null}),[]),(0,W.useEffect)(()=>{t.current?.setDebug(e?.debug??!1)},[e?.debug]),(0,W.useEffect)(()=>{t.current?.setShowSwitch(e?.showSwitch??!1)},[e?.showSwitch]),{trigger:(0,W.useCallback)((e,n)=>t.current?.trigger(e,n),[]),cancel:(0,W.useCallback)(()=>t.current?.cancel(),[]),isSupported:qj.isSupported}}var Yj=(0,W.createContext)({hapticsEnabled:!1,soundsEnabled:!1,haptic:()=>{},sound:()=>{}}),Xj=null;function Zj(){if(typeof window>`u`)return null;if(Xj)return Xj;try{Xj=new(window.AudioContext||window.webkitAudioContext)}catch{Xj=null}return Xj}function Qj(e,t){let n=e.currentTime,r=e.destination,i=(t,i,a,o,s,c)=>{let l=e.createOscillator(),u=e.createGain();l.connect(u),u.connect(r),l.type=i,l.frequency.setValueAtTime(t,n+o),c!==void 0&&l.frequency.exponentialRampToValueAtTime(c,n+o+s),u.gain.setValueAtTime(a,n+o),u.gain.exponentialRampToValueAtTime(.001,n+o+s),l.start(n+o),l.stop(n+o+s)};switch(t){case`click`:i(700,`sine`,.16,0,.03,350);break;case`toggle`:i(460,`square`,.06,0,.04,230);break;case`navigate`:i(520,`sine`,.07,0,.02);break;case`open`:i(210,`sine`,.12,0,.13,560);break;case`close`:i(560,`sine`,.1,0,.11,210);break;case`success`:i(523,`sine`,.17,0,.1),i(784,`sine`,.17,.09,.13);break;case`resolve`:i(659,`sine`,.15,0,.1),i(988,`sine`,.15,.09,.13);break;case`send`:i(523,`sine`,.15,0,.1),i(659,`sine`,.15,.07,.1),i(784,`sine`,.15,.14,.14);break;case`error`:i(280,`sawtooth`,.16,0,.15,80);break;case`warning`:i(330,`sine`,.13,0,.09),i(330,`sine`,.09,.12,.09);break;case`remove`:i(380,`sine`,.13,0,.08,140);break}}var $j={current:!1},eM={current:!1},tM=null;function nM(e=`click`){if(!$j.current)return;let t=Zj();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{Qj(t,e)}catch{}}).catch(()=>{})}function rM(e=`selection`){if(!(!eM.current||!tM))try{tM(e)}catch{}}function iM(e=`selection`,t=`click`){rM(e),nM(t)}function aM({enabled:e,soundsEnabled:t,children:n}){let{trigger:r,isSupported:i}=Jj({showSwitch:!1}),a=(0,W.useRef)(e);a.current=e;let o=(0,W.useRef)(t);o.current=t;let s=(0,W.useRef)(r);s.current=r,(0,W.useEffect)(()=>{eM.current=e&&i,tM=r}),(0,W.useEffect)(()=>{$j.current=t});let c=(0,W.useMemo)(()=>(e=`selection`)=>{if(a.current)try{s.current(e)}catch{}},[]),l=(0,W.useMemo)(()=>(e=`click`)=>{if(!o.current)return;let t=Zj();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{Qj(t,e)}catch{}}).catch(()=>{})},[]);(0,W.useEffect)(()=>{if(!e&&!t)return;let n=e=>{let t=e.target?.closest(`button, a[href], [role="button"], input[type="checkbox"], [role="option"]`);if(!t||t.disabled)return;let n=t.tagName===`INPUT`&&t.type===`checkbox`;if(a.current)try{s.current(`selection`)}catch{}if(o.current){let e=Zj();e&&(e.state===`suspended`?e.resume():Promise.resolve()).then(()=>{try{Qj(e,n?`toggle`:`click`)}catch{}}).catch(()=>{})}};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e,t]);let u=(0,W.useMemo)(()=>({hapticsEnabled:e&&i,soundsEnabled:t,haptic:c,sound:l}),[e,i,t,c,l]);return(0,G.jsx)(Yj.Provider,{value:u,children:n})}function oM(){let{haptic:e,sound:t}=(0,W.useContext)(Yj);return{haptic:e,sound:t}}function sM(e){return(0,W.useMemo)(()=>{let t=[];for(let n of e)for(let e of n.hunks)for(let r of e.hunkContent)if(r.type===`change`){if(r.additions>0){let i=r.additionLineIndex,a=r.additions;for(let r=0;r<a;r++){let a=i+r,o=n.additionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.additionStart+(a-e.additionLineIndex),side:`additions`,content:o})}}if(r.deletions>0){let i=r.deletionLineIndex,a=r.deletions;for(let r=0;r<a;r++){let a=i+r,o=n.deletionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.deletionStart+(a-e.deletionLineIndex),side:`deletions`,content:o})}}}return t},[e])}var cM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),lM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),uM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),dM=e=>{let t=uM(e);return t.charAt(0).toUpperCase()+t.slice(1)},fM={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},pM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},mM=(0,W.createContext)({}),hM=()=>(0,W.useContext)(mM),gM=(0,W.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=hM()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,W.createElement)(`svg`,{ref:c,...fM,width:t??l??fM.width,height:t??l??fM.height,stroke:e??f,strokeWidth:m,className:cM(`lucide`,p,i),...!a&&!pM(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),_M=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(gM,{ref:i,iconNode:t,className:cM(`lucide-${lM(dM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=dM(e),n},vM=_M(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),yM=_M(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),bM=_M(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),xM=_M(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),SM=_M(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),CM=_M(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),wM=_M(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),TM=_M(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),EM=_M(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),DM=_M(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),OM=_M(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),kM=_M(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),AM=_M(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),jM=_M(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),MM=_M(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),NM=_M(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),PM=_M(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),FM=_M(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),IM=_M(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),LM=_M(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),RM=_M(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),zM=_M(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),BM=_M(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]),VM=_M(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),HM=_M(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),UM=_M(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),WM=_M(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),GM=_M(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),KM=_M(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),qM=_M(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),JM=_M(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),YM=_M(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),XM=_M(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ZM=_M(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),QM=_M(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),$M=_M(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),eN=_M(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),tN=_M(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),nN=_M(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),rN=_M(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),iN=_M(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),aN=_M(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),oN={},sN={},cN=``;function lN(e){if(typeof document>`u`)return!1;let t=Sx(e);return H_(t).innerWidth-t.documentElement.clientWidth>0}function uN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=J_(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function dN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=H_(n),a=0,o=0,s=bx.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(xv&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,oN={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cN=n.style.scrollBehavior,sN={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=J_(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,oN),Object.assign(r.style,sN),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=cN)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var fN=new class{lockCount=0;restore=null;timeoutLock=R_.create();timeoutUnlock=R_.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Sx(e).documentElement,n=H_(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Rb;return}this.restore=Sv||!lN(e)?uN(e):dN(e)}};function pN(e=!0,t=null){Y(()=>{if(e)return fN.acquire(t)},[e,t])}var mN=W.createContext(void 0);function hN(e){let t=W.useContext(mN);if(t===void 0&&!e)throw Error(A_(47));return t}function gN(){return{...xw(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}var _N={...Sw,disabled:Z(e=>e.disabled),instantType:Z(e=>e.instantType),openMethod:Z(e=>e.openMethod),openChangeReason:Z(e=>e.openChangeReason),modal:Z(e=>e.modal),stickIfOpen:Z(e=>e.stickIfOpen),titleElementId:Z(e=>e.titleElementId),descriptionElementId:Z(e=>e.descriptionElementId),openOnHover:Z(e=>e.openOnHover),closeDelay:Z(e=>e.closeDelay)},vN=class e extends lw{constructor(e){let t={...gN(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),stickIfOpenTimeout:new R_,triggerElements:new yw},_N)}setOpen=(e,t)=>{let n=t.reason===Jb,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),iS.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=P_(()=>t??new e(n)).current;return I_(r.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function yN(e){let t=W.useRef(``),n=W.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:W.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function bN(e){let[t,n]=W.useState(null),r=X((t,r)=>{e||n(r)}),i=W.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=yN(r);return W.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function xN({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=vN.useStore(s?.store,{open:n??r,modal:o,activeTriggerId:c===void 0?l:c});u.useControlledProp(`open`,n,r),u.useControlledProp(`activeTriggerId`,c,l);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g,reset:_}=bN(d);_w(u);let{forceUnmount:v}=vw(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),_()});pN(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),W.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let y=W.useCallback(e=>{let t=ax(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),b=W.useCallback(()=>{u.setOpen(!1,y(rx))},[u,y]);W.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=Tw({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=Rw([IC(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Yw(x)]),T=W.useMemo(()=>S(g),[S,g]),E=W.useMemo(()=>w(g),[w,g]),D=W.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:Nb()!=null});let O=W.useMemo(()=>({store:u}),[u]);return(0,G.jsx)(mN.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function SN(e){return hN(!0)?(0,G.jsx)(xN,{props:e}):(0,G.jsx)(Lb,{children:(0,G.jsx)(xN,{props:e})})}var CN=W.createContext(void 0);function wN(e=!1){let t=W.useContext(CN);if(t===void 0&&!e)throw Error(A_(16));return t}function TN(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:W.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function EN(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=W.useRef(null),o=wN(!0)!==void 0,s=X(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=TN({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=W.useCallback(()=>{let e=a.current;DN(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return Y(l,[l]),{getButtonProps:W.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return Ux({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Zx(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(Zx(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:X(e=>{a.current=e,l()})}}function DN(e){return K_(e)&&e.tagName===`BUTTON`}var ON=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=hN(!0),m=o?.store??p?.store;if(!m)throw Error(A_(74));let h=yT(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=W.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=gw(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),S=m.useState(`openChangeReason`),C=m.useState(`stickIfOpen`),w=m.useState(`openMethod`),T=Lw(_,{enabled:_!=null&&c&&(w!==`touch`||S!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:$w(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),E=Rw([xS(_,{enabled:_!=null,stickIfOpen:C})]),D=m.useState(`triggerProps`,x),O=W.useMemo(()=>({disabled:i,open:v}),[i,v]),{getButtonProps:k,buttonRef:A}=EN({disabled:i,native:a}),j=W.useMemo(()=>({open(e){return e&&S===`trigger-press`?_T.open(e):gT.open(e)}}),[S]),M=eS(`button`,e,{state:O,ref:[A,t,b,y],props:[E.getReferenceProps(),T,D,{[Hb]:``,id:h},f,k],stateAttributesMapping:j}),N=W.useRef(null),P=X(e=>{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))}),bb(N.current)?.focus()}),F=X(e=>{let t=m.select(`positionerElement`);if(t&&xb(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))});let n=yb(y.current);for(;n!==null&&Lv(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=gb(n),n===e)break}n?.focus()}});return g?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(Cx,{ref:N,onFocus:P}),(0,G.jsx)(W.Fragment,{children:M},h),(0,G.jsx)(Cx,{ref:m.context.triggerFocusTargetRef,onFocus:F})]}):(0,G.jsx)(W.Fragment,{children:M},h)}),kN=W.createContext(void 0);function AN(){let e=W.useContext(kN);if(e===void 0)throw Error(A_(45));return e}var jN=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=hN();return i.useState(`mounted`)||n?(0,G.jsx)(kN.Provider,{value:n,children:(0,G.jsx)(lS,{ref:t,...r,renderGuards:!1})}):null}),MN=W.createContext(void 0);function NN(){let e=W.useContext(MN);if(!e)throw Error(A_(46));return e}var PN=W.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
1954
+ `)}var kj=[`comments`];async function Aj(){return(await fetch(`/api/comments`)).json()}function jj(){let e=Ve(),{data:t=[]}=nt({queryKey:kj,queryFn:Aj});(0,W.useEffect)(()=>wj(`comments`,()=>{e.invalidateQueries({queryKey:kj})}),[e]);let[n,r]=(0,W.useState)({round:0,waiters:0,lastSentAt:null});(0,W.useEffect)(()=>{let e=!1;fetch(`/api/review/status`).then(e=>e.json()).then(t=>{e||r(t)}).catch(()=>{});let t=wj(`agent-status`,e=>{try{r(JSON.parse(e))}catch{}});return()=>{e=!0,t()}},[]);let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(null);(0,W.useEffect)(()=>{let e=i.current===null;i.current===null&&(i.current=new Set);let n=i.current,r=null;for(let i of t)for(let t of i.replies??[]){if(n.has(t.id))continue;n.add(t.id);let a=t.role===`agent`||t.role==null&&!!t.model;!e&&a&&(!r||t.createdAt>r.at)&&(r={at:t.createdAt,commentId:i.id,filePath:i.filePath,model:t.model,body:t.body})}r&&o(r)},[t]);let s=rt({mutationFn:async e=>(await fetch(`/api/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>[...e,t])}}),c=rt({mutationFn:async e=>(await fetch(`/api/comments/${e}`,{method:`DELETE`}),e),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.filter(e=>e.id!==t))}}),l=rt({mutationFn:async({id:e,body:t,status:n})=>(await fetch(`/api/comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,status:n})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),u=rt({mutationFn:async({id:e,body:t})=>(await fetch(`/api/comments/${e}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,role:`user`})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),d=rt({mutationFn:async({commentId:e,replyId:t})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`DELETE`})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),f=rt({mutationFn:async({commentId:e,replyId:t,body:n})=>(await fetch(`/api/comments/${e}/replies/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n})})).json(),onSuccess:t=>{e.setQueryData(kj,(e=[])=>e.map(e=>e.id===t.id?t:e))}}),p=rt({mutationFn:async e=>{let t=await fetch(`/api/review/send`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({generalComment:e?.trim()||void 0})});if(!t.ok)throw Error(`Failed to send to agent`);return t.json()}}),m=rt({mutationFn:async e=>{let t=await fetch(`/api/comments/${e}/apply-suggestion`,{method:`POST`});if(!t.ok){let e=await t.json();throw Error(e.error||`Failed to apply suggestion`)}return t.json()},onSuccess:()=>{e.invalidateQueries({queryKey:kj})}}),h=(0,W.useCallback)((e,t,n,r,i,a)=>{s.mutate({filePath:e,side:t,lineNumber:n,startLineNumber:a,lineContent:r,body:i})},[s.mutate]),g=(0,W.useCallback)(e=>{c.mutate(e)},[c.mutate]),_=(0,W.useCallback)((e,t)=>{l.mutate({id:e,body:t})},[l.mutate]),v=(0,W.useCallback)(e=>{l.mutate({id:e,status:`resolved`})},[l.mutate]),y=(0,W.useCallback)(e=>{l.mutate({id:e,status:`open`})},[l.mutate]),b=(0,W.useCallback)((e,t)=>{u.mutate({id:e,body:t})},[u.mutate]),x=(0,W.useCallback)((e,t)=>{d.mutate({commentId:e,replyId:t})},[d.mutate]),S=(0,W.useCallback)((e,t,n)=>{f.mutate({commentId:e,replyId:t,body:n})},[f.mutate]),C=(0,W.useCallback)(async e=>{await m.mutateAsync(e)},[m.mutateAsync]),w=(0,W.useCallback)(()=>Oj(t),[t]),T=(0,W.useCallback)(e=>t.filter(t=>t.filePath===e).map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),[t]),E=(0,W.useCallback)(async()=>{let e=w();await navigator.clipboard.writeText(e)},[w]),D=(0,W.useCallback)(e=>p.mutateAsync(e),[p.mutateAsync]);return{comments:t,addComment:h,removeComment:g,editComment:_,resolveComment:v,unresolveComment:y,addReply:b,removeReply:x,editReply:S,applySuggestion:C,getAnnotationsForFile:T,formatAllComments:w,copyAllComments:E,agentActivity:a,clearAgentActivity:(0,W.useCallback)(()=>o(null),[]),sendToAgent:D,sending:p.isPending,agentWaiting:n.waiters>0}}var Mj=[`plans`];async function Nj(){return(await fetch(`/api/plans`)).json()}function Pj(){let e=Ve(),{data:t=[]}=nt({queryKey:Mj,queryFn:Nj});(0,W.useEffect)(()=>wj(`plans`,()=>{e.invalidateQueries({queryKey:Mj})}),[e]);let[n,r]=(0,W.useState)({round:0,waiters:0,lastDecidedAt:null});(0,W.useEffect)(()=>{let e=!1;fetch(`/api/plan-review/status`).then(e=>e.json()).then(t=>{e||r(t)}).catch(()=>{});let t=wj(`plan-review-status`,e=>{try{r(JSON.parse(e))}catch{}});return()=>{e=!0,t()}},[]);let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(null);(0,W.useEffect)(()=>{let e=i.current===null;i.current===null&&(i.current=new Set);let n=i.current,r=null;for(let i of t)for(let t of i.comments??[])for(let a of t.replies??[]){if(n.has(a.id))continue;n.add(a.id);let o=a.role===`agent`||a.role==null&&!!a.model;!e&&o&&(!r||a.createdAt>r.at)&&(r={at:a.createdAt,planId:i.id,commentId:t.id,model:a.model,body:a.body})}r&&o(r)},[t]);let s=(0,W.useCallback)(t=>{e.setQueryData(Mj,(e=[])=>e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t])},[e]),c=rt({mutationFn:async({planId:e,...t})=>(await fetch(`/api/plans/${e}/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).json(),onSuccess:s}),l=rt({mutationFn:async({planId:e,commentId:t,body:n,status:r})=>(await fetch(`/api/plans/${e}/comments/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n,status:r})})).json(),onSuccess:s}),u=rt({mutationFn:async({planId:e,commentId:t})=>(await fetch(`/api/plans/${e}/comments/${t}`,{method:`DELETE`})).json(),onSuccess:s}),d=rt({mutationFn:async({planId:e,commentId:t,body:n})=>(await fetch(`/api/plans/${e}/comments/${t}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:n,role:`user`})})).json(),onSuccess:s}),f=rt({mutationFn:async({planId:e,commentId:t,replyId:n,body:r})=>(await fetch(`/api/plans/${e}/comments/${t}/replies/${n}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:r})})).json(),onSuccess:s}),p=rt({mutationFn:async({planId:e,commentId:t,replyId:n})=>(await fetch(`/api/plans/${e}/comments/${t}/replies/${n}`,{method:`DELETE`})).json(),onSuccess:s}),m=rt({mutationFn:async({planId:e,decision:t,decisionComment:n})=>{let r=await fetch(`/api/plans/${e}/decision`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:t,decisionComment:n?.trim()||void 0})});if(!r.ok)throw Error(`Failed to submit plan decision`);return r.json()},onSuccess:()=>e.invalidateQueries({queryKey:Mj})}),h=rt({mutationFn:async e=>(await fetch(`/api/plans/${e}`,{method:`DELETE`}),e),onSuccess:t=>{e.setQueryData(Mj,(e=[])=>e.filter(e=>e.id!==t))}});return{plans:t,getPlan:(0,W.useCallback)(e=>t.find(t=>t.id===e)??null,[t]),addPlanComment:(0,W.useCallback)(e=>c.mutate(e),[c.mutate]),editPlanComment:(0,W.useCallback)((e,t,n)=>l.mutate({planId:e,commentId:t,body:n}),[l.mutate]),resolvePlanComment:(0,W.useCallback)((e,t)=>l.mutate({planId:e,commentId:t,status:`resolved`}),[l.mutate]),unresolvePlanComment:(0,W.useCallback)((e,t)=>l.mutate({planId:e,commentId:t,status:`open`}),[l.mutate]),removePlanComment:(0,W.useCallback)((e,t)=>u.mutate({planId:e,commentId:t}),[u.mutate]),addPlanReply:(0,W.useCallback)((e,t,n)=>d.mutate({planId:e,commentId:t,body:n}),[d.mutate]),editPlanReply:(0,W.useCallback)((e,t,n,r)=>f.mutate({planId:e,commentId:t,replyId:n,body:r}),[f.mutate]),removePlanReply:(0,W.useCallback)((e,t,n)=>p.mutate({planId:e,commentId:t,replyId:n}),[p.mutate]),removePlan:(0,W.useCallback)(e=>h.mutate(e),[h.mutate]),submitDecision:(0,W.useCallback)((e,t,n)=>m.mutateAsync({planId:e,decision:t,decisionComment:n}),[m.mutateAsync]),submitting:m.isPending,agentWaiting:n.waiters>0,agentActivity:a,clearAgentActivity:(0,W.useCallback)(()=>o(null),[])}}var Fj=new Set;function Ij(){for(let e of Fj)e()}function Lj(e,t={}){e!==window.location.pathname+window.location.search&&(t.replace?window.history.replaceState(null,``,e):window.history.pushState(null,``,e),Ij())}function Rj(e){return Fj.add(e),window.addEventListener(`popstate`,e),()=>{Fj.delete(e),window.removeEventListener(`popstate`,e)}}function zj(){return window.location.pathname}function Bj(){return`/`}function Vj(){return(0,W.useSyncExternalStore)(Rj,zj,Bj)}function Hj(e){let[t,n]=(0,W.useState)({inMerge:!1,conflicts:[]}),r=(0,W.useCallback)(()=>{fetch(`/api/merge-status`).then(e=>e.ok?e.json():{inMerge:!1,conflicts:[]}).then(n).catch(()=>n({inMerge:!1,conflicts:[]}))},[]);return(0,W.useEffect)(()=>{r()},[r,e]),{status:t,refresh:r}}var Uj={staged:!0,untracked:!0,diffStyle:`split`,defaultTabSize:4,theme:`nord`,editorIDE:`default`,lineDiffType:`word`,lineWrap:!1,diffIndicators:`classic`,showLineNumbers:!0,hunkSeparators:`line-info`,lineHoverHighlight:`both`,fontSize:13,expandContextByDefault:!1,collapsedContextThreshold:10,expansionLineCount:20,haptics:!0,sounds:!0};function Wj(){let[e,t]=(0,W.useState)(Uj),[n,r]=(0,W.useState)(!1),i=(0,W.useRef)(!0);return(0,W.useEffect)(()=>{fetch(`/api/settings`).then(e=>e.json()).then(e=>{i.current=!0,t({...Uj,...e}),r(!0)}).catch(()=>r(!0))},[]),(0,W.useEffect)(()=>{if(i.current){i.current=!1;return}let t=setTimeout(()=>{fetch(`/api/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})},300);return()=>clearTimeout(t)},[e]),{settings:e,loaded:n,updateSettings:(0,W.useCallback)(e=>{t(t=>({...t,...e}))},[])}}var Gj=[`viewed`];async function Kj(){return(await fetch(`/api/viewed`)).json()}function qj(){let e=Ve(),{data:t=[]}=nt({queryKey:Gj,queryFn:Kj});return{viewedFiles:(0,W.useMemo)(()=>new Set(t),[t]),setViewed:(0,W.useCallback)(async(t,n)=>{e.setQueryData(Gj,(e=[])=>n?e.includes(t)?e:[...e,t]:e.filter(e=>e!==t)),await fetch(`/api/viewed`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:t,viewed:n})})},[e])}}var Jj={success:{pattern:[{duration:30,intensity:.5},{delay:60,duration:40,intensity:1}]},warning:{pattern:[{duration:40,intensity:.8},{delay:100,duration:40,intensity:.6}]},error:{pattern:[{duration:40,intensity:.9},{delay:40,duration:40,intensity:.9},{delay:40,duration:40,intensity:.9}]},light:{pattern:[{duration:15,intensity:.4}]},medium:{pattern:[{duration:25,intensity:.7}]},heavy:{pattern:[{duration:35,intensity:1}]},soft:{pattern:[{duration:40,intensity:.5}]},rigid:{pattern:[{duration:10,intensity:1}]},selection:{pattern:[{duration:8,intensity:.3}]},nudge:{pattern:[{duration:80,intensity:.8},{delay:80,duration:50,intensity:.3}]},buzz:{pattern:[{duration:1e3,intensity:1}]}},Yj=16,Xj=184,Zj=1e3,Qj=20;function $j(e){if(typeof e==`number`)return{vibrations:[{duration:e}]};if(typeof e==`string`){let t=Jj[e];return t?{vibrations:t.pattern.map(e=>({...e}))}:(console.warn(`[web-haptics] Unknown preset: "${e}"`),null)}if(Array.isArray(e)){if(e.length===0)return{vibrations:[]};if(typeof e[0]==`number`){let t=e,n=[];for(let e=0;e<t.length;e+=2){let r=e>0?t[e-1]:0;n.push({...r>0&&{delay:r},duration:t[e]})}return{vibrations:n}}return{vibrations:e.map(e=>({...e}))}}return{vibrations:e.pattern.map(e=>({...e}))}}function eM(e,t){if(t>=1)return[e];if(t<=0)return[];let n=Math.max(1,Math.round(Qj*t)),r=Qj-n,i=[],a=e;for(;a>=Qj;)i.push(n),i.push(r),a-=Qj;if(a>0){let e=Math.max(1,Math.round(a*t));i.push(e);let n=a-e;n>0&&i.push(n)}return i}function tM(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=Math.max(0,Math.min(1,i.intensity??t)),o=i.delay??0;o>0&&(n.length>0&&n.length%2==0?n[n.length-1]+=o:(n.length===0&&n.push(0),n.push(o)));let s=eM(i.duration,a);if(s.length===0){n.length>0&&n.length%2==0?n[n.length-1]+=i.duration:i.duration>0&&(n.push(0),n.push(i.duration));continue}for(let e of s)n.push(e)}return n}var nM=0,rM=class e{hapticLabel=null;domInitialized=!1;instanceId;debug;showSwitch;rafId=null;patternResolve=null;audioCtx=null;audioFilter=null;audioGain=null;audioBuffer=null;constructor(e){this.instanceId=++nM,this.debug=e?.debug??!1,this.showSwitch=e?.showSwitch??!1}static isSupported=typeof navigator<`u`&&typeof navigator.vibrate==`function`;async trigger(t=[{duration:25,intensity:.7}],n){let r=$j(t);if(!r)return;let{vibrations:i}=r;if(i.length===0)return;let a=Math.max(0,Math.min(1,n?.intensity??.5));for(let e of i)if(e.duration>Zj&&(e.duration=Zj),!Number.isFinite(e.duration)||e.duration<0||e.delay!==void 0&&(!Number.isFinite(e.delay)||e.delay<0)){console.warn(`[web-haptics] Invalid vibration values. Durations and delays must be finite non-negative numbers.`);return}if(e.isSupported&&navigator.vibrate(tM(i,a)),!e.isSupported||this.debug){if(this.ensureDOM(),!this.hapticLabel)return;this.debug&&await this.ensureAudio(),this.stopPattern();let e=(i[0]?.delay??0)===0;if(e&&(this.hapticLabel.click(),this.debug&&this.audioCtx)){let e=Math.max(0,Math.min(1,i[0].intensity??a));this.playClick(e)}await this.runPattern(i,a,e)}}cancel(){this.stopPattern(),e.isSupported&&navigator.vibrate(0)}destroy(){this.stopPattern(),this.hapticLabel&&(this.hapticLabel.remove(),this.hapticLabel=null,this.domInitialized=!1),this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setDebug(e){this.debug=e,!e&&this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.audioFilter=null,this.audioGain=null,this.audioBuffer=null)}setShowSwitch(e){if(this.showSwitch=e,this.hapticLabel){let t=this.hapticLabel.querySelector(`input`);this.hapticLabel.style.display=e?``:`none`,t&&(t.style.display=e?``:`none`)}}stopPattern(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.patternResolve?.(),this.patternResolve=null}runPattern(e,t,n){return new Promise(r=>{this.patternResolve=r;let i=[],a=0;for(let n of e){let e=Math.max(0,Math.min(1,n.intensity??t)),r=n.delay??0;r>0&&(a+=r,i.push({end:a,isOn:!1,intensity:0})),a+=n.duration,i.push({end:a,isOn:!0,intensity:e})}let o=a,s=0,c=-1,l=e=>{s===0&&(s=e);let t=e-s;if(t>=o){this.rafId=null,this.patternResolve=null,r();return}let a=i[0];for(let e of i)if(t<e.end){a=e;break}if(a.isOn){let t=Yj+(1-a.intensity)*Xj;c===-1?(c=e,n||=(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),!0)):e-c>=t&&(this.hapticLabel?.click(),this.debug&&this.audioCtx&&this.playClick(a.intensity),c=e)}this.rafId=requestAnimationFrame(l)};this.rafId=requestAnimationFrame(l)})}playClick(e){if(!this.audioCtx||!this.audioFilter||!this.audioGain||!this.audioBuffer)return;let t=this.audioBuffer.getChannelData(0);for(let e=0;e<t.length;e++)t[e]=(Math.random()*2-1)*Math.exp(-e/25);this.audioGain.gain.value=.5*e;let n=2e3+e*2e3,r=1+(Math.random()-.5)*.3;this.audioFilter.frequency.value=n*r;let i=this.audioCtx.createBufferSource();i.buffer=this.audioBuffer,i.connect(this.audioFilter),i.onended=()=>i.disconnect(),i.start()}async ensureAudio(){if(!this.audioCtx&&typeof AudioContext<`u`){this.audioCtx=new AudioContext,this.audioFilter=this.audioCtx.createBiquadFilter(),this.audioFilter.type=`bandpass`,this.audioFilter.frequency.value=4e3,this.audioFilter.Q.value=8,this.audioGain=this.audioCtx.createGain(),this.audioFilter.connect(this.audioGain),this.audioGain.connect(this.audioCtx.destination),this.audioBuffer=this.audioCtx.createBuffer(1,this.audioCtx.sampleRate*.004,this.audioCtx.sampleRate);let e=this.audioBuffer.getChannelData(0);for(let t=0;t<e.length;t++)e[t]=(Math.random()*2-1)*Math.exp(-t/25)}this.audioCtx?.state===`suspended`&&await this.audioCtx.resume()}ensureDOM(){if(this.domInitialized||typeof document>`u`)return;let e=`web-haptics-${this.instanceId}`,t=document.createElement(`label`);t.setAttribute(`for`,e),t.textContent=`Haptic feedback`,t.style.position=`fixed`,t.style.bottom=`10px`,t.style.left=`10px`,t.style.padding=`5px 10px`,t.style.backgroundColor=`rgba(0, 0, 0, 0.7)`,t.style.color=`white`,t.style.fontFamily=`sans-serif`,t.style.fontSize=`14px`,t.style.borderRadius=`4px`,t.style.zIndex=`9999`,t.style.userSelect=`none`,this.hapticLabel=t;let n=document.createElement(`input`);n.type=`checkbox`,n.setAttribute(`switch`,``),n.id=e,n.style.all=`initial`,n.style.appearance=`auto`,this.showSwitch||(t.style.display=`none`,n.style.display=`none`),t.appendChild(n),document.body.appendChild(t),this.domInitialized=!0}};function iM(e){let t=(0,W.useRef)(null);return(0,W.useEffect)(()=>(t.current=new rM(e),()=>{t.current?.destroy(),t.current=null}),[]),(0,W.useEffect)(()=>{t.current?.setDebug(e?.debug??!1)},[e?.debug]),(0,W.useEffect)(()=>{t.current?.setShowSwitch(e?.showSwitch??!1)},[e?.showSwitch]),{trigger:(0,W.useCallback)((e,n)=>t.current?.trigger(e,n),[]),cancel:(0,W.useCallback)(()=>t.current?.cancel(),[]),isSupported:rM.isSupported}}var aM=(0,W.createContext)({hapticsEnabled:!1,soundsEnabled:!1,haptic:()=>{},sound:()=>{}}),oM=null;function sM(){if(typeof window>`u`)return null;if(oM)return oM;try{oM=new(window.AudioContext||window.webkitAudioContext)}catch{oM=null}return oM}function cM(e,t){let n=e.currentTime,r=e.destination,i=(t,i,a,o,s,c)=>{let l=e.createOscillator(),u=e.createGain();l.connect(u),u.connect(r),l.type=i,l.frequency.setValueAtTime(t,n+o),c!==void 0&&l.frequency.exponentialRampToValueAtTime(c,n+o+s),u.gain.setValueAtTime(a,n+o),u.gain.exponentialRampToValueAtTime(.001,n+o+s),l.start(n+o),l.stop(n+o+s)};switch(t){case`click`:i(700,`sine`,.16,0,.03,350);break;case`toggle`:i(460,`square`,.06,0,.04,230);break;case`navigate`:i(520,`sine`,.07,0,.02);break;case`open`:i(210,`sine`,.12,0,.13,560);break;case`close`:i(560,`sine`,.1,0,.11,210);break;case`success`:i(523,`sine`,.17,0,.1),i(784,`sine`,.17,.09,.13);break;case`resolve`:i(659,`sine`,.15,0,.1),i(988,`sine`,.15,.09,.13);break;case`send`:i(523,`sine`,.15,0,.1),i(659,`sine`,.15,.07,.1),i(784,`sine`,.15,.14,.14);break;case`error`:i(280,`sawtooth`,.16,0,.15,80);break;case`warning`:i(330,`sine`,.13,0,.09),i(330,`sine`,.09,.12,.09);break;case`remove`:i(380,`sine`,.13,0,.08,140);break}}var lM={current:!1},uM={current:!1},dM=null;function fM(e=`click`){if(!lM.current)return;let t=sM();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{cM(t,e)}catch{}}).catch(()=>{})}function pM(e=`selection`){if(!(!uM.current||!dM))try{dM(e)}catch{}}function mM(e=`selection`,t=`click`){pM(e),fM(t)}function hM({enabled:e,soundsEnabled:t,children:n}){let{trigger:r,isSupported:i}=iM({showSwitch:!1}),a=(0,W.useRef)(e);a.current=e;let o=(0,W.useRef)(t);o.current=t;let s=(0,W.useRef)(r);s.current=r,(0,W.useEffect)(()=>{uM.current=e&&i,dM=r}),(0,W.useEffect)(()=>{lM.current=t});let c=(0,W.useMemo)(()=>(e=`selection`)=>{if(a.current)try{s.current(e)}catch{}},[]),l=(0,W.useMemo)(()=>(e=`click`)=>{if(!o.current)return;let t=sM();t&&(t.state===`suspended`?t.resume():Promise.resolve()).then(()=>{try{cM(t,e)}catch{}}).catch(()=>{})},[]);(0,W.useEffect)(()=>{if(!e&&!t)return;let n=e=>{let t=e.target?.closest(`button, a[href], [role="button"], input[type="checkbox"], [role="option"]`);if(!t||t.disabled)return;let n=t.tagName===`INPUT`&&t.type===`checkbox`;if(a.current)try{s.current(`selection`)}catch{}if(o.current){let e=sM();e&&(e.state===`suspended`?e.resume():Promise.resolve()).then(()=>{try{cM(e,n?`toggle`:`click`)}catch{}}).catch(()=>{})}};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e,t]);let u=(0,W.useMemo)(()=>({hapticsEnabled:e&&i,soundsEnabled:t,haptic:c,sound:l}),[e,i,t,c,l]);return(0,G.jsx)(aM.Provider,{value:u,children:n})}function gM(){let{haptic:e,sound:t}=(0,W.useContext)(aM);return{haptic:e,sound:t}}function _M(e){return(0,W.useMemo)(()=>{let t=[];for(let n of e)for(let e of n.hunks)for(let r of e.hunkContent)if(r.type===`change`){if(r.additions>0){let i=r.additionLineIndex,a=r.additions;for(let r=0;r<a;r++){let a=i+r,o=n.additionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.additionStart+(a-e.additionLineIndex),side:`additions`,content:o})}}if(r.deletions>0){let i=r.deletionLineIndex,a=r.deletions;for(let r=0;r<a;r++){let a=i+r,o=n.deletionLines[a];o&&o.trim()&&t.push({filePath:n.name,lineNumber:e.deletionStart+(a-e.deletionLineIndex),side:`deletions`,content:o})}}}return t},[e])}var vM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),bM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),xM=e=>{let t=bM(e);return t.charAt(0).toUpperCase()+t.slice(1)},SM={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},CM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},wM=(0,W.createContext)({}),TM=()=>(0,W.useContext)(wM),EM=(0,W.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=TM()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,W.createElement)(`svg`,{ref:c,...SM,width:t??l??SM.width,height:t??l??SM.height,stroke:e??f,strokeWidth:m,className:vM(`lucide`,p,i),...!a&&!CM(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),DM=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(EM,{ref:i,iconNode:t,className:vM(`lucide-${yM(xM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=xM(e),n},OM=DM(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),kM=DM(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),AM=DM(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),jM=DM(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),MM=DM(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),NM=DM(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),PM=DM(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),FM=DM(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),IM=DM(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),LM=DM(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),RM=DM(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),zM=DM(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),BM=DM(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),VM=DM(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),HM=DM(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),UM=DM(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),WM=DM(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),GM=DM(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),KM=DM(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),qM=DM(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),JM=DM(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),YM=DM(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),XM=DM(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ZM=DM(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),QM=DM(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),$M=DM(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),eN=DM(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),tN=DM(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]),nN=DM(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),rN=DM(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),iN=DM(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),aN=DM(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),oN=DM(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),sN=DM(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),cN=DM(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),lN=DM(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),uN=DM(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),dN=DM(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),fN=DM(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),pN=DM(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),mN=DM(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),hN=DM(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),gN=DM(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_N=DM(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),vN=DM(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),yN=DM(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),bN=DM(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),xN={},SN={},CN=``;function wN(e){if(typeof document>`u`)return!1;let t=Sx(e);return H_(t).innerWidth-t.documentElement.clientWidth>0}function TN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=J_(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function EN(e){let t=Sx(e),n=t.documentElement,r=t.body,i=H_(n),a=0,o=0,s=bx.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(xv&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,xN={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},CN=n.style.scrollBehavior,SN={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=J_(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,xN),Object.assign(r.style,SN),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=CN)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var DN=new class{lockCount=0;restore=null;timeoutLock=R_.create();timeoutUnlock=R_.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Sx(e).documentElement,n=H_(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Rb;return}this.restore=Sv||!wN(e)?TN(e):EN(e)}};function ON(e=!0,t=null){Y(()=>{if(e)return DN.acquire(t)},[e,t])}var kN=W.createContext(void 0);function AN(e){let t=W.useContext(kN);if(t===void 0&&!e)throw Error(A_(47));return t}function jN(){return{...xw(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}var MN={...Sw,disabled:Z(e=>e.disabled),instantType:Z(e=>e.instantType),openMethod:Z(e=>e.openMethod),openChangeReason:Z(e=>e.openChangeReason),modal:Z(e=>e.modal),stickIfOpen:Z(e=>e.stickIfOpen),titleElementId:Z(e=>e.titleElementId),descriptionElementId:Z(e=>e.descriptionElementId),openOnHover:Z(e=>e.openOnHover),closeDelay:Z(e=>e.closeDelay)},NN=class e extends lw{constructor(e){let t={...jN(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),stickIfOpenTimeout:new R_,triggerElements:new yw},MN)}setOpen=(e,t)=>{let n=t.reason===Jb,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),iS.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=P_(()=>t??new e(n)).current;return I_(r.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function PN(e){let t=W.useRef(``),n=W.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:W.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function FN(e){let[t,n]=W.useState(null),r=X((t,r)=>{e||n(r)}),i=W.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=PN(r);return W.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function IN({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=NN.useStore(s?.store,{open:n??r,modal:o,activeTriggerId:c===void 0?l:c});u.useControlledProp(`open`,n,r),u.useControlledProp(`activeTriggerId`,c,l);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g,reset:_}=FN(d);_w(u);let{forceUnmount:v}=vw(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),_()});ON(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),W.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let y=W.useCallback(e=>{let t=ax(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),b=W.useCallback(()=>{u.setOpen(!1,y(rx))},[u,y]);W.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=Tw({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=Rw([IC(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Yw(x)]),T=W.useMemo(()=>S(g),[S,g]),E=W.useMemo(()=>w(g),[w,g]),D=W.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:Nb()!=null});let O=W.useMemo(()=>({store:u}),[u]);return(0,G.jsx)(kN.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function LN(e){return AN(!0)?(0,G.jsx)(IN,{props:e}):(0,G.jsx)(Lb,{children:(0,G.jsx)(IN,{props:e})})}var RN=W.createContext(void 0);function zN(e=!1){let t=W.useContext(RN);if(t===void 0&&!e)throw Error(A_(16));return t}function BN(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:W.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function VN(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=W.useRef(null),o=zN(!0)!==void 0,s=X(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=BN({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=W.useCallback(()=>{let e=a.current;HN(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return Y(l,[l]),{getButtonProps:W.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return Ux({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Zx(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(Zx(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:X(e=>{a.current=e,l()})}}function HN(e){return K_(e)&&e.tagName===`BUTTON`}var UN=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=AN(!0),m=o?.store??p?.store;if(!m)throw Error(A_(74));let h=yT(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=W.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=gw(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),S=m.useState(`openChangeReason`),C=m.useState(`stickIfOpen`),w=m.useState(`openMethod`),T=Lw(_,{enabled:_!=null&&c&&(w!==`touch`||S!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:$w(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),E=Rw([xS(_,{enabled:_!=null,stickIfOpen:C})]),D=m.useState(`triggerProps`,x),O=W.useMemo(()=>({disabled:i,open:v}),[i,v]),{getButtonProps:k,buttonRef:A}=VN({disabled:i,native:a}),j=W.useMemo(()=>({open(e){return e&&S===`trigger-press`?_T.open(e):gT.open(e)}}),[S]),M=eS(`button`,e,{state:O,ref:[A,t,b,y],props:[E.getReferenceProps(),T,D,{[Hb]:``,id:h},f,k],stateAttributesMapping:j}),N=W.useRef(null),P=X(e=>{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))}),bb(N.current)?.focus()}),F=X(e=>{let t=m.select(`positionerElement`);if(t&&xb(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{iS.flushSync(()=>{m.setOpen(!1,ax(Qb,e.nativeEvent,e.currentTarget))});let n=yb(y.current);for(;n!==null&&Lv(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=gb(n),n===e)break}n?.focus()}});return g?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(Cx,{ref:N,onFocus:P}),(0,G.jsx)(W.Fragment,{children:M},h),(0,G.jsx)(Cx,{ref:m.context.triggerFocusTargetRef,onFocus:F})]}):(0,G.jsx)(W.Fragment,{children:M},h)}),WN=W.createContext(void 0);function GN(){let e=W.useContext(WN);if(e===void 0)throw Error(A_(45));return e}var KN=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=AN();return i.useState(`mounted`)||n?(0,G.jsx)(WN.Provider,{value:n,children:(0,G.jsx)(lS,{ref:t,...r,renderGuards:!1})}):null}),qN=W.createContext(void 0);function JN(){let e=W.useContext(qN);if(!e)throw Error(A_(46));return e}var YN=W.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
1955
1955
  0% 0%,
1956
1956
  100% 0%,
1957
1957
  100% 100%,
@@ -1962,9 +1962,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
1962
1962
  ${e.right}px ${e.bottom}px,
1963
1963
  ${e.right}px ${e.top}px,
1964
1964
  ${e.left}px ${e.top}px
1965
- )`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),FN=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Wb,...g}=e,{store:_}=hN(),v=AN(),y=Fb(),b=_.useState(`floatingRootContext`),x=_.useState(`mounted`),S=_.useState(`open`),C=_.useState(`openChangeReason`),w=_.useState(`activeTriggerElement`),T=_.useState(`modal`),E=_.useState(`positionerElement`),D=_.useState(`instantType`),O=_.useState(`transitionStatus`),k=W.useRef(null),A=pw(E,!1,!1),j=RT({anchor:i,floatingRootContext:b,positionMethod:a,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:FT}),M=W.useMemo(()=>{let e={};return S||(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...j.positionerStyles,...e}}},[S,x,j.positionerStyles]),N=W.useMemo(()=>({props:M,...j}),[M,j]),P=b?.select(`domReferenceElement`);Y(()=>{let e=P,t=k.current;if(e&&(k.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return A(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,A,_]);let F=W.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:D}),[S,N.side,N.align,N.anchorHidden,D]),I=W.useCallback(e=>{_.set(`positionerElement`,e)},[_]),L=eS(`div`,e,{state:F,props:[N.props,BT(O),g],ref:[t,I],stateAttributesMapping:vT});return(0,G.jsxs)(MN.Provider,{value:N,children:[x&&T===!0&&C!==`trigger-hover`&&(0,G.jsx)(PN,{ref:_.context.internalBackdropRef,inert:XT(!S),cutout:w}),(0,G.jsx)(Ib,{id:y,children:L})]})}),IN=`ArrowUp`,LN=`ArrowDown`,RN=`ArrowLeft`,zN=`ArrowRight`,BN=`Home`,VN=new Set([RN,zN]),HN=new Set([IN,LN]),UN=new Set([...VN,...HN]);new Set([...UN,BN,`End`]);var WN=new Set([IN,LN,RN,zN,BN,`End`]),GN=W.createContext(void 0);function KN(e){let t=W.useContext(GN);if(t===void 0&&!e)throw Error(A_(69));return t}var qN={...vT,...cT},JN=W.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=hN(),c=NN(),l=KN(!0)!=null,u=AT(),d=s.useState(`open`),f=s.useState(`openMethod`),p=s.useState(`instantType`),m=s.useState(`transitionStatus`),h=s.useState(`popupProps`),g=s.useState(`titleElementId`),_=s.useState(`descriptionElementId`),v=s.useState(`modal`),y=s.useState(`mounted`),b=s.useState(`openChangeReason`),x=s.useState(`popupElement`),S=s.useState(`payload`),C=s.useState(`positionerElement`),w=s.useState(`activeTriggerElement`),T=s.useState(`floatingRootContext`);mw({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}});let E=s.useState(`disabled`),D=s.useState(`openOnHover`),O=s.useState(`closeDelay`);Nw(T,{enabled:D&&!E,closeDelay:O});function k(e){return e===`touch`?s.context.popupRef.current:!0}let A=i===void 0?k:i,j=W.useMemo(()=>({open:d,side:c.side,align:c.align,instant:p,transitionStatus:m}),[d,c.side,c.align,p,m]),M=W.useCallback(e=>{s.set(`popupElement`,e)},[s]);function N(){T.context.events.emit(`measure-layout`)}function P(e,t){T.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}GT({popupElement:x,positionerElement:C,mounted:y,content:S,enabled:W.useCallback(()=>s.context.triggerElements.size>1,[s]),onMeasureLayout:N,onMeasureLayoutComplete:P,side:c.side,direction:u});let F=eS(`div`,e,{state:j,ref:[t,s.context.popupRef,M],props:[h,{"aria-labelledby":g,"aria-describedby":_,onKeyDown(e){l&&WN.has(e.key)&&e.stopPropagation()}},BT(m),o],stateAttributesMapping:qN});return(0,G.jsx)(bS,{context:T,openInteractionType:f,modal:v===`trap-focus`,disabled:!y||b===`trigger-hover`,initialFocus:A,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:K_(w)?w:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:F})});function YN({trigger:e,children:t,open:n,onOpenChange:r,side:i=`bottom`,align:a=`end`,className:o,ariaLabel:s}){return(0,G.jsxs)(SN,{open:n,onOpenChange:r,children:[(0,G.jsx)(ON,{render:e}),(0,G.jsx)(jN,{children:(0,G.jsx)(FN,{className:`ui-popover-positioner`,side:i,align:a,sideOffset:8,children:(0,G.jsx)(JN,{className:`ui-popover ${o??``}`,"aria-label":s,children:t})})})]})}function XN(e){let t=W.useRef(!0);t.current&&(t.current=!1,e())}function ZN({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=W.useRef(e!==void 0),[a,o]=W.useState(t);return[i?e:a,W.useCallback(e=>{i||o(e)},[])]}var QN=W.createContext(null),$N=W.createContext(null);function eP(){let e=W.useContext(QN);if(e===null)throw Error(A_(60));return e}function tP(){let e=W.useContext($N);if(e===null)throw Error(A_(61));return e}var nP=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),rP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},iP={valid(e){return e===null?null:e?{[nP.valid]:``}:{[nP.invalid]:``}}},aP=W.createContext({invalid:void 0,name:void 0,validityData:{state:rP,errors:[],error:``,value:``,initialValue:null},setValidityData:Rb,disabled:void 0,touched:!1,setTouched:Rb,dirty:!1,setDirty:Rb,filled:!1,setFilled:Rb,focused:!1,setFocused:Rb,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Bb)=>e,getInputValidationProps:(e=Bb)=>e,inputRef:{current:null},commit:async()=>{}}});function oP(e=!0){let t=W.useContext(aP);if(t.setValidityData===Rb&&!e)throw Error(A_(28));return t}var sP=W.createContext({controlId:void 0,setControlId:Rb,labelId:void 0,setLabelId:Rb,messageIds:[],setMessageIds:Rb,getDescriptionProps:e=>e});function cP(){return W.useContext(sP)}function lP(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=cP(),o=yT(t);return Y(()=>{if(!(!n&&!t||a===Rb)){if(n){let e=r?.current;G_(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}var uP=(e,t)=>Object.is(e,t);function dP(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function fP(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:dP(e,t,n))}function pP(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:dP(e,t,n))}function mP(e,t,n){return e.filter(e=>!dP(e,t,n))}function hP(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function gP(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function _P(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return hP(e)}function vP(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?hP(e.value):hP(e)}function yP(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??_P(e,n);if(Array.isArray(t)){let r=gP(t)?t.flatMap(e=>e.items):t;if(e==null){let t=r.find(e=>e.value==null);return t&&t.label!=null?t.label:_P(e,n)}if(typeof e!=`object`){let t=r.find(t=>t&&t.value===e);return t&&t.label!=null?t.label:_P(e,n)}if(`value`in e){let t=r.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return _P(e,n)}function bP(e,t){return!Array.isArray(e)||e.length===0?``:e.map(e=>_P(e,t)).join(`, `)}var xP={id:Z(e=>e.id),modal:Z(e=>e.modal),multiple:Z(e=>e.multiple),items:Z(e=>e.items),itemToStringLabel:Z(e=>e.itemToStringLabel),itemToStringValue:Z(e=>e.itemToStringValue),isItemEqualToValue:Z(e=>e.isItemEqualToValue),value:Z(e=>e.value),open:Z(e=>e.open),mounted:Z(e=>e.mounted),forceMount:Z(e=>e.forceMount),transitionStatus:Z(e=>e.transitionStatus),touchModality:Z(e=>e.touchModality),activeIndex:Z(e=>e.activeIndex),selectedIndex:Z(e=>e.selectedIndex),isActive:Z((e,t)=>e.activeIndex===t),isSelected:Z((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>dP(e,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:dP(i,n,r)}),isSelectedByFocus:Z((e,t)=>e.selectedIndex===t),popupProps:Z(e=>e.popupProps),triggerProps:Z(e=>e.triggerProps),triggerElement:Z(e=>e.triggerElement),positionerElement:Z(e=>e.positionerElement),listElement:Z(e=>e.listElement),scrollUpArrowVisible:Z(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Z(e=>e.scrollDownArrowVisible),hasScrollArrows:Z(e=>e.hasScrollArrows),serializedValue:Z(e=>{let{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?``:vP(n,r)})},SP=W.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Rb,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function CP(){return W.useContext(SP)}function wP(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function TP(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=CP(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=oP(),f=X(e.getValue);Y(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),Y(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:wP(u,c),validate(){let e=n;e===void 0&&(e=f()),l.current=!0,iS.flushSync(()=>o(e))}})},[o,a,t,s,f,r,c,l,i,u,n]),Y(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}function EP(e,t){let n=W.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current)},[e,r]),Y(()=>{n.current=e},[e])}function DP(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,disabled:l=!1,readOnly:u=!1,required:d=!1,modal:f=!0,actionsRef:p,inputRef:m,onOpenChangeComplete:h,items:g,multiple:_=!1,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b=uP,highlightItemOnHover:x=!0,children:S}=e,{clearErrors:C}=CP(),{setDirty:w,shouldValidateOnChange:T,validityData:E,setFilled:D,name:O,disabled:k,validation:A}=oP(),{controlId:j}=cP(),M=lP({id:t}),N=k||l,P=O??c,[F,I]=ZN({controlled:n,default:_?r??zb:r,name:`Select`,state:`value`}),[L,R]=ZN({controlled:a,default:o,name:`Select`,state:`open`}),z=W.useRef([]),ee=W.useRef([]),te=W.useRef(null),B=W.useRef(null),V=W.useRef(0),H=W.useRef(null),ne=W.useRef([]),re=W.useRef(!1),ie=W.useRef(!1),ae=W.useRef(null),oe=W.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),se=W.useRef(!1),{mounted:ce,setMounted:le,transitionStatus:ue}=fw(L),U=P_(()=>new cw({id:M,modal:f,multiple:_,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b,value:F,open:L,mounted:ce,transitionStatus:ue,items:g,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,de=aw(U,xP.activeIndex),fe=aw(U,xP.selectedIndex),pe=aw(U,xP.triggerElement),me=aw(U,xP.positionerElement),he=W.useMemo(()=>_&&Array.isArray(F)&&F.length===0?``:vP(F,y),[_,F,y]),ge=dv(U.state.triggerElement);TP({id:M,commit:A.commit,value:F,controlRef:ge,name:P,getValue:()=>F});let _e=W.useRef(F);Y(()=>{F!==_e.current&&U.set(`forceMount`,!0)},[U,F]),Y(()=>{D(F!==null)},[F,D]),Y(function(){if(L)return;let e=ne.current;if(_){let t=Array.isArray(F)?F:[];if(t.length===0){U.set(`selectedIndex`,null);return}let n=t[t.length-1],r=pP(e,n,b);U.set(`selectedIndex`,r===-1?null:r);return}let t=pP(e,F,b);U.set(`selectedIndex`,t===-1?null:t)},[_,L,F,ne,b,U]),EP(F,()=>{C(P),w(F!==E.initialValue),T()?A.commit(F):A.commit(F,!0)});let ve=X((e,t)=>{if(s?.(e,t),!t.isCanceled&&(R(e),!e&&U.state.activeIndex!==null)){let e=z.current[U.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),ye=X(()=>{le(!1),U.set(`activeIndex`,null),h?.(!1)});mw({enabled:!p,open:L,ref:te,onComplete(){L||ye()}}),W.useImperativeHandle(p,()=>({unmount:ye}),[ye]);let be=X((e,t)=>{i?.(e,t),!t.isCanceled&&I(e)}),xe=X(()=>{let e=U.state.listElement||te.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;U.state.scrollUpArrowVisible!==r&&U.set(`scrollUpArrowVisible`,r),U.state.scrollDownArrowVisible!==i&&U.set(`scrollDownArrowVisible`,i)}),Se=Cw({open:L,onOpenChange:ve,elements:{reference:pe,floating:me}}),{getReferenceProps:Ce,getFloatingProps:we,getItemProps:Te}=Rw([xS(Se,{enabled:!u&&!N,event:`mousedown`}),IC(Se,{bubbles:!1}),qw(Se,{enabled:!u&&!N,listRef:z,activeIndex:de,selectedIndex:fe,disabledIndices:zb,onNavigate(e){e===null&&!L||U.set(`activeIndex`,e)},focusItemOnHover:!1}),Xw(Se,{enabled:!u&&!N&&(L||!_),listRef:ee,activeIndex:de,selectedIndex:fe,onMatch(e){L?U.set(`activeIndex`,e):be(ne.current[e],ax(`none`))},onTypingChange(e){re.current=e}})]);XN(()=>{U.update({popupProps:we(),triggerProps:Ce()})}),Y(()=>{U.update({id:M,modal:f,multiple:_,value:F,open:L,mounted:ce,transitionStatus:ue,popupProps:we(),triggerProps:Ce(),items:g,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b})},[U,M,f,_,F,L,ce,ue,we,Ce,g,v,y,b]);let Ee=W.useMemo(()=>({store:U,name:P,required:d,disabled:N,readOnly:u,multiple:_,itemToStringLabel:v,itemToStringValue:y,highlightItemOnHover:x,setValue:be,setOpen:ve,listRef:z,popupRef:te,scrollHandlerRef:B,handleScrollArrowVisibility:xe,scrollArrowsMountedCountRef:V,getItemProps:Te,events:Se.context.events,valueRef:H,valuesRef:ne,labelsRef:ee,typingRef:re,selectionRef:oe,selectedItemTextRef:ae,validation:A,onOpenChangeComplete:h,keyboardActiveRef:ie,alignItemWithTriggerActiveRef:se,initialValueRef:_e}),[U,P,d,N,u,_,v,y,x,be,ve,Te,Se.context.events,A,h,xe]),De=dx(m,A.inputRef),Oe=_&&Array.isArray(F)&&F.length>0,ke=W.useMemo(()=>!_||!Array.isArray(F)||!P?null:F.map(e=>{let t=vP(e,y);return(0,G.jsx)(`input`,{type:`hidden`,name:P,value:t},t)}),[_,F,P,y]);return(0,G.jsx)(QN.Provider,{value:Ee,children:(0,G.jsxs)($N.Provider,{value:Se,children:[S,(0,G.jsx)(`input`,{...A.getInputValidationProps({onFocus(){U.state.triggerElement?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=ax(Kb,e.nativeEvent);function r(){if(_)return;let e=ne.current.find(e=>vP(e,y).toLowerCase()===t.toLowerCase());e!=null&&(w(e!==E.initialValue),be(e,n),T()&&A.commit(e))}U.set(`forceMount`,!0),queueMicrotask(r)}}),id:t||j||void 0,name:_?void 0:P,value:he,disabled:N,required:d&&!Oe,readOnly:u,ref:De,style:_x,tabIndex:-1,"aria-hidden":!0}),ke]})})}function OP(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var kP=2,AP={..._T,...iP,value:()=>null},jP=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{setTouched:s,setFocused:c,validationMode:l,state:u,disabled:d}=oP(),{labelId:f}=cP(),{store:p,setOpen:m,selectionRef:h,validation:g,readOnly:_,alignItemWithTriggerActiveRef:v,disabled:y,keyboardActiveRef:b}=eP(),x=d||y||i,S=aw(p,xP.open),C=aw(p,xP.value),w=aw(p,xP.triggerProps),T=aw(p,xP.positionerElement),E=aw(p,xP.listElement),D=aw(p,xP.serializedValue),O=dv(T),k=W.useRef(null),A=z_(),j=z_(),{getButtonProps:M,buttonRef:N}=EN({disabled:x,native:a}),P=dx(t,k,N,X(e=>{p.set(`triggerElement`,e)})),F=z_(),I=z_();W.useEffect(()=>{if(S)return I.start(200,()=>{h.current.allowUnselectedMouseUp=!0,F.start(200,()=>{h.current.allowSelectedMouseUp=!0})}),()=>{F.clear(),I.clear()};h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},j.clear()},[S,h,j,F,I]);let L=W.useMemo(()=>E?.id??Gv(T)?.id,[E,T]),R=Ux(w,{role:`combobox`,"aria-expanded":S?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":S?L:void 0,"aria-labelledby":f,"aria-readonly":_||void 0,tabIndex:x?-1:0,ref:P,onFocus(e){c(!0),S&&v.current&&m(!1,ax(Qb,e.nativeEvent)),A.start(0,()=>{p.set(`forceMount`,!0)})},onBlur(){s(!0),c(!1),l===`onBlur`&&g.commit(C)},onPointerMove({pointerType:e}){b.current=!1,p.set(`touchModality`,e===`touch`)},onPointerDown({pointerType:e}){p.set(`touchModality`,e===`touch`)},onKeyDown(){b.current=!0},onMouseDown(e){if(S)return;let t=Sx(e.currentTarget);function n(e){if(!k.current)return;let t=e.target;if(Lv(k.current,t)||Lv(O.current,t)||t===k.current)return;let n=OP(k.current);e.clientX>=n.left-kP&&e.clientX<=n.right+kP&&e.clientY>=n.top-kP&&e.clientY<=n.bottom+kP||m(!1,ax(tx,e))}j.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},g.getValidationProps,o,M);R.role=`combobox`;let z=W.useMemo(()=>({...u,open:S,disabled:x,value:C,readOnly:_,placeholder:!D}),[u,S,x,C,_,D]);return eS(`button`,e,{ref:[t,k],state:z,stateAttributesMapping:AP,props:R})}),MP={value:()=>null},NP=W.forwardRef(function(e,t){let{className:n,render:r,children:i,...a}=e,{store:o,valueRef:s}=eP(),c=aw(o,xP.value),l=aw(o,xP.items),u=aw(o,xP.itemToStringLabel),d=aw(o,xP.serializedValue),f=W.useMemo(()=>({value:c,placeholder:!d}),[c,d]),p=typeof i==`function`?i(c):i??(Array.isArray(c)?bP(c,u):yP(c,l,u));return eS(`span`,e,{state:f,ref:[t,s],props:[{children:p},a],stateAttributesMapping:MP})}),PP=W.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=eP(),o=aw(a,xP.open);return eS(`span`,e,{state:W.useMemo(()=>({open:o}),[o]),ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:gT})}),FP=W.createContext(void 0),IP=W.forwardRef(function(e,t){let{store:n}=eP(),r=aw(n,xP.mounted),i=aw(n,xP.forceMount);return r||i?(0,G.jsx)(FP.Provider,{value:!0,children:(0,G.jsx)(lS,{ref:t,...e})}):null}),LP=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function RP(){return W.useContext(LP)}function zP(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),o=W.useRef(0),s=P_(VP).current,c=P_(BP).current,[l,u]=W.useState(0),d=W.useRef(l),f=X((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=X(e=>{c.delete(e),d.current+=1,u(d.current)}),m=W.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(HP).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Y(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),Y(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),Y(()=>()=>{n.current=[]},[n]),Y(()=>()=>{r&&(r.current=[])},[r]);let h=X(e=>(s.add(e),()=>{s.delete(e)}));Y(()=>{s.forEach(e=>e(m))},[s,m]);let g=W.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,G.jsx)(LP.Provider,{value:g,children:t})}function BP(){return new Map}function VP(){return new Set}function HP(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var UP=W.createContext(void 0);function WP(){let e=W.useContext(UP);if(!e)throw Error(A_(59));return e}function GP(e,t){e&&Object.assign(e.style,t)}var KP={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},qP={position:`fixed`},JP=W.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Ub,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=eP(),D=tP(),O=aw(v,xP.open),k=aw(v,xP.mounted),A=aw(v,xP.modal),j=aw(v,xP.value),M=aw(v,xP.touchModality),N=aw(v,xP.positionerElement),P=aw(v,xP.triggerElement),F=aw(v,xP.isItemEqualToValue),I=W.useRef(null),L=W.useRef(null),[R,z]=W.useState(h),ee=k&&R&&!M;!k&&R!==h&&z(h),Y(()=>{k||(xP.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),xP.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),W.useImperativeHandle(x,()=>ee),pN((ee||A)&&O&&!M,P);let te=RT({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??ee,collisionAvoidance:g,keepMounted:!0}),B=ee?`none`:te.side,V=ee?qP:te.positionerStyles,H=W.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...V,...e}}},[O,k,V]),ne=W.useMemo(()=>({open:O,side:B,align:te.align,anchorHidden:te.anchorHidden}),[O,B,te.align,te.anchorHidden]),re=eS(`div`,e,{ref:[t,X(e=>{v.set(`positionerElement`,e)})],state:ne,stateAttributesMapping:vT,props:[H,_]}),ie=W.useRef(0),ae=X(e=>{if(e.size===0&&ie.current===0||C.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=ax(Kb);if(t!==0&&!v.state.multiple&&j!==null&&pP(C.current,j,F)===-1){let e=w.current,t=e!=null&&fP(C.current,e,F)?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=j.filter(e=>fP(C.current,e,F));(e.length!==j.length||e.some(e=>!fP(j,e,F)))&&(E(e,n),e.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&ee){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};GP(N,e),GP(T.current,e)}}),oe=W.useMemo(()=>({...te,side:B,alignItemWithTriggerActive:ee,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[te,B,ee,z]);return(0,G.jsx)(zP,{elementsRef:y,labelsRef:b,onMapChange:ae,children:(0,G.jsxs)(UP.Provider,{value:oe,children:[k&&A&&(0,G.jsx)(PN,{inert:XT(!O),cutout:P}),re]})})});function YP(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var XP=`base-ui-disable-scrollbar`,ZP={className:XP,element:(0,G.jsx)(`style`,{href:XP,precedence:`base-ui:low`,children:`.${XP}{scrollbar-width:none}.${XP}::-webkit-scrollbar{display:none}`})},QP={...vT,...cT},$P=W.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a,popupRef:o,onOpenChangeComplete:s,setOpen:c,valueRef:l,selectedItemTextRef:u,keyboardActiveRef:d,multiple:f,handleScrollArrowVisibility:p,scrollHandlerRef:m}=eP(),{side:h,align:g,alignItemWithTriggerActive:_,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:y,scrollUpArrowRef:b}=WP(),x=KN(!0)!=null,S=tP(),C=z_(),w=aw(a,xP.id),T=aw(a,xP.open),E=aw(a,xP.mounted),D=aw(a,xP.popupProps),O=aw(a,xP.transitionStatus),k=aw(a,xP.triggerElement),A=aw(a,xP.positionerElement),j=aw(a,xP.listElement),M=W.useRef(0),N=W.useRef(!1),P=W.useRef(0),F=W.useRef(!1),I=W.useRef({}),L=xx(),R=X(e=>{if(!A||!o.current||!F.current)return;if(N.current||!_){p();return}let t=A.style.top===`0px`,n=A.style.bottom===`0px`,r=A.getBoundingClientRect().height,i=Sx(A),a=getComputedStyle(A),s=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=i.documentElement.clientHeight-s-c,u=e.scrollTop,d=e.scrollHeight-e.clientHeight,f=null,m=null,h=!1;if(t){let e=r+(d-u),t=Math.min(e,l);f=t,t===l?h=!0:m=d}else if(n){let e=u-0,t=r+e,n=Math.min(t,l),i=t-l;f=n,n===l?(h=!0,u<d&&(m=u-(e-i))):m=0}f!=null&&(A.style.height=`${f}px`),m!=null&&(e.scrollTop=m),h&&(N.current=!0),p()});W.useImperativeHandle(m,()=>R,[R]),mw({open:T,ref:o,onComplete(){T&&s?.(!0)}});let z=W.useMemo(()=>({open:T,transitionStatus:O,side:h,align:g}),[T,O,h,g]);Y(()=>{!A||!o.current||Object.keys(I.current).length||(I.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[o,A]),Y(()=>{E||_||(F.current=!1,N.current=!1,M.current=0,P.current=0,GP(A,I.current))},[E,_,A,o]),Y(()=>{let e=o.current;if(!(!E||!k||!A||!e)){if(!_){F.current=!0,L.request(p);return}queueMicrotask(()=>{let t=getComputedStyle(A),n=getComputedStyle(e),r=Sx(k),i=H_(A),a=k.getBoundingClientRect(),o=A.getBoundingClientRect(),s=a.left,c=a.height,d=j||e,f=d.scrollHeight,m=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,_=parseFloat(t.minHeight)||100,y=r.documentElement.clientHeight-h-g,b=r.documentElement.clientWidth,x=y-a.bottom+c,S=u.current,C=l.current,w=0,T=0;if(S&&C){let e=C.getBoundingClientRect(),t=S.getBoundingClientRect(),n=e.left-s,r=t.left-o.left,i=e.top-a.top+e.height/2,c=t.top-o.top+t.height/2;w=n-r,T=c-i}let E=x+T+g+m,D=Math.min(y,E),O=y-h-g,P=E-D,L=Math.max(5,s+w),R=b-5,z=Math.max(0,L+o.width-R);A.style.left=`${L-z}px`,A.style.height=`${D}px`,A.style.maxHeight=`auto`,A.style.marginTop=`${h}px`,A.style.marginBottom=`${g}px`,e.style.height=`100%`;let ee=d.scrollHeight-d.clientHeight,te=P>=ee;te&&(D=Math.min(y,o.height)-(P-ee));let B=a.top<20||a.bottom>y-20||D<Math.min(f,_),V=(i.visualViewport?.scale??1)!==1&&xv;if(B||V){F.current=!0,GP(A,I.current),iS.flushSync(()=>v(!1));return}if(te){let e=Math.max(0,y-E);A.style.top=o.height>=O?`0`:`${e}px`,A.style.height=`${D}px`,d.scrollTop=d.scrollHeight-d.clientHeight,M.current=Math.max(_,D)}else A.style.bottom=`0`,M.current=Math.max(_,D),d.scrollTop=P;M.current===y&&(N.current=!0),p(),setTimeout(()=>{F.current=!0})})}},[a,E,A,k,l,u,o,p,_,v,L,y,b,j]),W.useEffect(()=>{if(!_||!A||!E)return;let e=H_(A);function t(e){c(!1,ax(ix,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[c,_,A,E]);let ee={...j?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":f||void 0,id:`${w}-list`},onKeyDown(e){d.current=!0,x&&WN.has(e.key)&&e.stopPropagation()},onMouseMove(){d.current=!1},onPointerLeave(e){if(YP(e)||e.pointerType===`touch`)return;let t=e.currentTarget;C.start(0,()=>{a.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){j||m.current?.(e.currentTarget)},..._&&{style:j?{height:`100%`}:KP}},te=eS(`div`,e,{ref:[t,o],state:z,stateAttributesMapping:QP,props:[D,ee,BT(O),{className:!j&&_?ZP.className:void 0},i]});return(0,G.jsxs)(W.Fragment,{children:[ZP.element,(0,G.jsx)(bS,{context:S,modal:!1,disabled:!E,restoreFocus:!0,children:te})]})}),eF=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function tF(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=RP(),f=W.useRef(-1),[p,m]=W.useState(a??(i===eF.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=W.useRef(null),g=W.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return Y(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Y(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),W.useMemo(()=>({ref:g,index:p}),[p,g])}var nF=W.createContext(void 0);function rF(){let e=W.useContext(nF);if(!e)throw Error(A_(57));return e}var iF=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=W.useRef(null),u=tF({label:a,textRef:l,indexGuessBehavior:eF.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=eP(),x=z_(),S=aw(d,xP.isActive,u.index),C=aw(d,xP.isSelected,u.index,i),w=aw(d,xP.isSelectedByFocus,u.index),T=aw(d,xP.isItemEqualToValue),E=u.index,D=E!==-1,O=W.useRef(null),k=dv(E);Y(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),Y(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&dP(t,i,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A=W.useMemo(()=>({disabled:o,selected:C,highlighted:S}),[o,C,S]),j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=W.useRef(null),N=W.useRef(`mouse`),P=W.useRef(!1),{getButtonProps:F,buttonRef:I}=EN({disabled:o,focusableWhenDisabled:!0,native:s});function L(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(C?mP(n,i,T):[...n,i],ax(Zb,e))}else m(i,ax(Zb,e)),p(!1,ax(Zb,e))}let R={role:`option`,"aria-selected":C,"aria-disabled":o||void 0,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||YP(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E)},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,L(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(e){if(o)return;if(P.current){P.current=!1;return}let t=!h.current.allowSelectedMouseUp&&C,n=!h.current.allowUnselectedMouseUp&&!C;t||n||N.current!==`touch`&&!S||L(e.nativeEvent)}},z=eS(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,R,c,F]}),ee=W.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,G.jsx)(nF.Provider,{value:ee,children:z})})),aF=W.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=rF();return n||r?(0,G.jsx)(oF,{...e,ref:t}):null}),oF=W.memo(W.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=rF(),s=W.useRef(null),{transitionStatus:c,setMounted:l}=fw(o),u=W.useMemo(()=>({selected:o,transitionStatus:c}),[o,c]),d=eS(`span`,e,{ref:[t,s],state:u,props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:cT});return mw({open:o,ref:s,onComplete(){o||l(!1)}}),d})),sF=W.memo(W.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=rF(),{selectedItemTextRef:o}=eP(),{className:s,render:c,...l}=e;return eS(`div`,e,{ref:[W.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})}));function cF({value:e,onValueChange:t,options:n,ariaLabel:r,className:i}){return(0,G.jsxs)(DP,{value:e,onValueChange:e=>t(e),modal:!1,children:[(0,G.jsxs)(jP,{className:`ui-select-trigger ${i??``}`,"aria-label":r,children:[(0,G.jsx)(NP,{children:e=>n.find(t=>t.value===e)?.label??e}),(0,G.jsx)(PP,{className:`ui-select-icon`,children:(0,G.jsx)(SM,{size:12})})]}),(0,G.jsx)(IP,{children:(0,G.jsx)(JP,{className:`ui-select-positioner`,sideOffset:4,align:`end`,side:`bottom`,alignItemWithTrigger:!1,children:(0,G.jsx)($P,{className:`ui-select-popup`,children:n.map(e=>(0,G.jsxs)(iF,{value:e.value,className:`ui-select-item`,children:[(0,G.jsx)(sF,{children:e.label}),(0,G.jsx)(aF,{className:`ui-select-indicator`,children:(0,G.jsx)(yM,{size:13})})]},e.value))})})})]})}function lF({comments:e,onEditComment:t,onDeleteComment:n,onSend:r,sending:i,agentWaiting:a}){let{haptic:o,sound:s}=oM(),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(``),f=e.length,p=(0,W.useMemo)(()=>[...e].sort((e,t)=>e.createdAt-t.createdAt),[e]);(0,W.useEffect)(()=>{c&&f===0&&l(!1)},[c,f]);let m=async()=>{o(`heavy`),s(`send`),await r(u),d(``),l(!1)};return(0,G.jsx)(YN,{open:c,onOpenChange:l,ariaLabel:`Review comments before sending to agent`,className:`send-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm`,disabled:f===0||i,title:a?`An agent is connected and waiting`:`Review and send comments to a waiting agent`,children:[a&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),i?`Sending…`:`Send to agent (${f})`]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(vM,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Send review to agent`}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[f,` comment`,f===1?``:`s`]})]}),(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:p.map(e=>(0,G.jsx)(uF,{comment:e,onEdit:t,onDelete:n},e.id))}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional)`})]}),(0,G.jsx)(`textarea`,{id:`srp-general-input`,className:`srp-general-input`,value:u,placeholder:`Add an overall note for the agent that applies to the whole review…`,rows:3,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())}})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>l(!1),disabled:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:m,disabled:f===0||i,children:i?`Sending…`:`Send ${f} comment${f===1?``:`s`}`})]})]})})}function uF({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(yM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(aN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(GM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(eN,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}var dF=[{value:`word`,label:`Word`},{value:`word-alt`,label:`Word (alt)`},{value:`char`,label:`Character`},{value:`none`,label:`None`}],fF=[{value:`classic`,label:`Classic (+/−)`},{value:`bars`,label:`Bars`},{value:`none`,label:`None`}],pF=[{value:`line-info`,label:`Line info + context`},{value:`line-info-basic`,label:`Line info`},{value:`metadata`,label:`Metadata only`},{value:`simple`,label:`Simple`}],mF=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}],hF=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),gF=[2,4,8].map(e=>({value:String(e),label:String(e)})),_F=[{value:``,label:`Default`},{value:`chrome`,label:`Chrome`},{value:`firefox`,label:`Firefox`},{value:`edge`,label:`Edge`},{value:`brave`,label:`Brave`}],vF=[{value:`default`,label:`Default / System`},{value:`vscode`,label:`VS Code`},{value:`zed`,label:`Zed`},{value:`vim`,label:`Vim`},{value:`neovim`,label:`Neovim`}],yF=(0,W.memo)(function({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,diffStyle:o,diffOptions:s,defaultTabSize:c,browser:l,theme:u,editorIDE:d,customMode:f,lineDiffType:p,lineWrap:m,diffIndicators:h,showLineNumbers:g,hunkSeparators:_,lineHoverHighlight:v,fontSize:y,haptics:b,sounds:x,onDiffStyleChange:S,onDiffOptionsChange:C,onDefaultTabSizeChange:w,onBrowserChange:T,onOpenThemeModal:E,onEditorIDEChange:D,onLineDiffTypeChange:O,onLineWrapChange:k,onDiffIndicatorsChange:A,onShowLineNumbersChange:j,onHunkSeparatorsChange:M,onLineHoverHighlightChange:N,onFontSizeChange:P,onHapticsChange:F,onSoundsChange:I,onOpenSearch:L,onCopyComments:R,onSendToAgent:z,agentWaiting:ee,sending:te,comments:B,onEditComment:V,onDeleteComment:H}){let[ne,re]=(0,W.useState)(!1),[ie,ae]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`,`&&(e.preventDefault(),ae(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,G.jsxs)(`div`,{className:`toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,G.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,G.jsx)(jM,{size:12}),t]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,G.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,G.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-search-btn`,onClick:L,title:`Search (⌘K)`,children:[(0,G.jsx)(XM,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Search`}),(0,G.jsx)(`kbd`,{className:`toolbar-search-kbd`,children:`⌘K`})]}),(0,G.jsxs)(`div`,{className:`toolbar-toggle`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm ${o===`split`?`btn-active`:``}`,onClick:()=>S(`split`),children:`Split`}),(0,G.jsx)(`button`,{className:`btn btn-sm ${o===`unified`?`btn-active`:``}`,onClick:()=>S(`unified`),children:`Unified`})]}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn flex-1`,title:`Switch Theme`,onClick:E,children:[(0,G.jsx)(VM,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Theme`})]}),(0,G.jsx)(YN,{open:ie,onOpenChange:ae,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsx)(`button`,{className:`btn btn-sm settings-btn ${ie?`btn-active`:``}`,title:`Settings`,children:(0,G.jsx)(ZM,{size:14})}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[!f&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Source`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:s.staged,onChange:e=>C({...s,staged:e.target.checked})}),`Show staged`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:s.untracked,onChange:e=>C({...s,untracked:e.target.checked})}),`Show untracked`]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Inline diff`}),(0,G.jsx)(cF,{value:p,onValueChange:e=>O(e),options:dF,ariaLabel:`Inline diff style`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>k(e.target.checked)}),`Wrap long lines`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff indicators`}),(0,G.jsx)(cF,{value:h,onValueChange:e=>A(e),options:fF,ariaLabel:`Diff indicators`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>j(e.target.checked)}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hunk separator`}),(0,G.jsx)(cF,{value:_,onValueChange:e=>M(e),options:pF,ariaLabel:`Hunk separator style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(cF,{value:v,onValueChange:e=>N(e),options:mF,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(cF,{value:String(y),onValueChange:e=>P(Number(e)),options:hF,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(cF,{value:String(c),onValueChange:e=>w(Number(e)),options:gF,ariaLabel:`Default tab size`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`External tools`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Browser`}),(0,G.jsx)(cF,{value:l||``,onValueChange:T,options:_F,ariaLabel:`Browser`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Preferred IDE`}),(0,G.jsx)(cF,{value:d||`default`,onValueChange:D,options:vF,ariaLabel:`Preferred IDE`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Feedback`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:b,onChange:e=>F(e.target.checked)}),`Haptic feedback`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>I(e.target.checked)}),`Sound effects`]})]})}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:async()=>{await R(),re(!0),setTimeout(()=>re(!1),2e3)},disabled:a===0,children:ne?`Copied!`:`Copy comments (${a})`}),(0,G.jsx)(lF,{comments:B,onEditComment:V,onDeleteComment:H,onSend:z,sending:te,agentWaiting:ee})]})]})}),bF=W.createContext(void 0);function xF(e){let t=W.useContext(bF);if(e===!1&&t===void 0)throw Error(A_(27));return t}var SF={...vT,...cT},CF=W.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=xF(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return eS(`div`,e,{state:W.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:SF,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),wF=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),TF=function(e){return e[e.open=lT.open]=`open`,e[e.closed=lT.closed]=`closed`,e[e.startingStyle=lT.startingStyle]=`startingStyle`,e[e.endingStyle=lT.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),EF=W.createContext(void 0);function DF(){let e=W.useContext(EF);if(e===void 0)throw Error(A_(26));return e}var OF={...vT,...cT,nestedDialogOpen(e){return e?{[TF.nestedDialogOpen]:``}:null}},kF=W.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=xF(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);DF(),mw({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=eS(`div`,e,{state:W.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){WN.has(e.key)&&e.stopPropagation()},style:{[wF.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:OF});return(0,G.jsx)(bS,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),AF=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=xF(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,G.jsx)(EF.Provider,{value:n,children:(0,G.jsxs)(lS,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(PN,{ref:i.context.internalBackdropRef,inert:XT(!open)}),e.children]})}):null});function jF(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=bN(i);_w(t);let{forceUnmount:d}=vw(i,t,()=>{u()}),f=X(e=>{let n=ax(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=W.useCallback(()=>{t.setOpen(!1,f(rx))},[t,f]);W.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Tw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=W.useState(0),_=h===0,v=Yw(m),y=IC(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=Rv(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||Lv(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});pN(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=Rw([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),W.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=W.useMemo(()=>b(l),[b,l]),w=W.useMemo(()=>S(l),[S,l]),T=W.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var MF={...Sw,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)},NF=class extends lw{constructor(e){super(PF(e),{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),triggerElements:new yw,onOpenChange:void 0,onOpenChangeComplete:void 0},MF)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function PF(e={}){return{...xw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function FF(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=xF(!0),p=!!f,m=P_(()=>l?.store??new NF({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);jF({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=W.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(bF.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}function IF({open:e,onClose:t,className:n,ariaLabel:r,initialFocus:i,onKeyDown:a,children:o}){return(0,G.jsx)(FF,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(AF,{children:[(0,G.jsx)(CF,{className:`ui-modal-backdrop`}),(0,G.jsx)(kF,{className:`ui-modal-popup ${n??``}`,"aria-label":r,initialFocus:i,onKeyDown:a,children:o})]})})}async function LF(e,t){let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=${t}`);if(!n.ok){if(n.status===404)return null;throw Error(`HTTP ${n.status} fetching ${t} ${e}`)}let r=await n.json();if(r.missing)return null;if(r.error)throw Error(r.error);return r.content??``}function RF(e,t){let[n,r]=(0,W.useState)({loading:!1,error:null,oldContent:null,newContent:null});return(0,W.useEffect)(()=>{if(!t||!e)return;let n=!1;return r(e=>({...e,loading:!0,error:null})),Promise.all([LF(e,`old`),LF(e,`new`)]).then(([e,t])=>{n||r({loading:!1,error:null,oldContent:e,newContent:t})}).catch(e=>{n||r({loading:!1,error:e.message,oldContent:null,newContent:null})}),()=>{n=!0}},[e,t]),n}var zF=`diffing-draft-`,BF=10080*60*1e3;function VF(...e){return zF+e.join(`:`)}function HF(...e){try{let t=localStorage.getItem(VF(...e));if(!t)return null;let n=JSON.parse(t);return Date.now()-n.timestamp>BF?(localStorage.removeItem(VF(...e)),null):n.body}catch{return null}}var UF={};function WF(e,...t){let n=VF(...t);UF[n]&&clearTimeout(UF[n]),UF[n]=setTimeout(()=>{GF(e,...t),delete UF[n]},500)}function GF(e,...t){let n=VF(...t);try{e.trim()?localStorage.setItem(n,JSON.stringify({body:e,timestamp:Date.now()})):localStorage.removeItem(n)}catch{}}function KF(...e){try{localStorage.removeItem(VF(...e))}catch{}}function qF({initialBody:e,lineContent:t,draftKey:n,onSubmit:r,onCancel:i}){let{haptic:a,sound:o}=oM(),[s,c]=(0,W.useState)(()=>{if(n){let e=HF(n);if(e)return e}return e||``}),[l,u]=(0,W.useState)(`write`),d=(0,W.useRef)(null);(0,W.useEffect)(()=>{l===`write`&&d.current?.focus()},[l]),(0,W.useEffect)(()=>{n&&WF(s,n)},[s,n]);let f=()=>{let e=s.trim();e&&(n&&KF(n),a(`success`),o(`success`),r(e))},p=e=>{if(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f()),e.key===`Escape`){if(s.includes(`
1966
- `))return;i()}},m=async e=>{let t=e.clipboardData.items,n=null;for(let e=0;e<t.length;e++){let r=t[e];if(r.kind===`file`&&r.type.startsWith(`image/`)){n=r.getAsFile();break}}if(!n)return;e.preventDefault();let r=d.current;if(!r)return;let i=r.selectionStart,a=r.selectionEnd,o=Math.random().toString(36).slice(2,8),s=`![Uploading image… ${o}]()`,l=r.value;c(l.slice(0,i)+s+l.slice(a));try{let e=new FormData;e.append(`file`,n,n.name||`pasted-${o}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);let i=`![pasted image](${r.url})`;c(e=>e.replace(s,i))}catch(e){console.error(`Image upload failed:`,e),c(e=>e.replace(s,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`comment-form`,style:{padding:`16px`},role:`form`,"aria-label":`Comment form`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Comment form mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`write`,"aria-controls":`comment-write-panel`,onClick:()=>u(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),u(`preview`))},className:`comment-form-tab-btn ${l===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`preview`,"aria-controls":`comment-preview-panel`,onClick:()=>u(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),u(`write`))},className:`comment-form-tab-btn ${l===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),l===`write`?(0,G.jsx)(`textarea`,{id:`comment-write-panel`,ref:d,value:s,onChange:e=>c(e.target.value),onKeyDown:p,onPaste:m,placeholder:`Leave a review comment (supports Markdown and Pasting Clipboard Images)...`,rows:4,"aria-label":`Comment body`,style:{minHeight:`100px`}}):(0,G.jsxs)(`div`,{id:`comment-preview-panel`,role:`tabpanel`,"aria-label":`Preview`,style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:[(()=>{let e=!!s.match(/```suggestion\n([\s\S]*?)```/);return s.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0||!e?(0,G.jsx)(`div`,{className:`comment-preview markdown-body`,style:{minHeight:`100px`,padding:`12px 16px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,background:`var(--bg-primary)`,fontSize:`14px`,lineHeight:1.6,color:`var(--text-primary)`,overflowY:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`},dangerouslySetInnerHTML:{__html:s.trim()?mj(s):`<span style="color: var(--text-muted); font-style: italic;">Nothing to preview</span>`}}):null})(),(()=>{let e=s.match(/```suggestion\n([\s\S]*?)```/),n=!!e,r=e?e[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsx)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change Preview`})}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[t&&(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:t})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]}),(0,G.jsxs)(`div`,{className:`comment-form-actions`,style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:f,disabled:!s.trim(),children:e?`Save`:`Comment`})]})]})}function JF(e,t,n){if(t===`agent`)return{bg:`var(--primary)`,initial:n?n.charAt(0).toUpperCase():`A`};let r=[`#ff5858`,`#11998e`,`#ff9966`,`#7f00ff`,`#00c6ff`,`#f12711`,`#0575e6`],i=e.split(``).reduce((e,t)=>e+t.charCodeAt(0),0);return{bg:r[Math.abs(i)%r.length],initial:`U`}}function YF({comment:e,onDelete:t}){let[,n]=(0,W.useState)(0),{resolveComment:r,unresolveComment:i,addReply:a,removeReply:o,editReply:s,applySuggestion:c,editComment:l}=jj(),u=e.status===`resolved`,[d,f]=(0,W.useState)(u),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(null),x=(0,W.useRef)(null),S=e.body.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0;(0,W.useEffect)(()=>{f(e.status===`resolved`)},[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]);let C=()=>r(e.id),w=()=>i(e.id),T=e=>{b(e)},E=t=>{o(e.id,t)};if(u&&d)return(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed`,style:{padding:`12px 18px`,margin:`14px 20px`,background:`var(--bg-secondary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-md)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,opacity:.85,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--text-muted)`},children:[(0,G.jsx)(wM,{size:16,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Conversation resolved`}),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`2px 6px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`2px 6px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]}),(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length>0?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{style:{background:`none`,border:`none`,color:`var(--primary)`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},onClick:()=>f(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(!1))},"aria-label":`Show resolved conversation`,children:`Show resolved`})]});let D=JF(e.id,`user`);return h?(0,G.jsx)(`div`,{className:`comment-bubble-canvas`,id:`comment-${e.id}`,role:`article`,"aria-label":`Edit comment`,children:(0,G.jsxs)(`div`,{className:`comment-node`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(`div`,{className:`comment-avatar-circle`,style:{background:D.bg},children:D.initial})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]})]}),(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(qF,{draftKey:`edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:t=>{l(e.id,t),g(!1)},onCancel:()=>g(!1)})})]})]})}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${u?`comment-bubble-canvas-resolved`:``}`,id:`comment-${e.id}`,role:`article`,"aria-label":e.lineNumber===0?`File-level comment`:`Comment by user on line ${e.lineNumber}`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${u?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(`div`,{className:`comment-avatar-circle`,style:{background:D.bg},children:D.initial})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]}),u&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(wM,{size:13}),`Resolved`]}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{ref:x,className:`comment-node-btn`,onClick:()=>g(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(!0))},title:`Edit comment`,"aria-label":`Edit comment`,tabIndex:0,children:(0,G.jsx)(GM,{size:13,"aria-hidden":`true`})}),_?(0,G.jsxs)(`div`,{className:`comment-delete-confirm`,style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>t(e.id),title:`Confirm delete`,"aria-label":`Confirm delete comment`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,borderRadius:`var(--radius-sm)`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`,width:`auto`,height:`auto`},children:[(0,G.jsx)(tN,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>v(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!1))},title:`Cancel delete`,"aria-label":`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>v(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!0))},title:`Delete comment`,"aria-label":`Delete comment`,tabIndex:0,children:(0,G.jsx)(eN,{size:13,"aria-hidden":`true`})})]})]}),S&&(0,G.jsx)(`div`,{className:`comment-node-body markdown-body ${u?`comment-resolved-line`:``}`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(()=>{let t=e.body.match(/```suggestion\n([\s\S]*?)```/),n=!!t&&e.side===`additions`,r=t?t[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{marginTop:`12px`,marginBottom:`4px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:[(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change`}),u?(0,G.jsxs)(`span`,{style:{color:`var(--feedback-success-text)`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(wM,{size:12}),` Applied`]}):(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{try{await c(e.id)}catch(e){alert(e.message)}},style:{fontSize:`11px`,padding:`2px 8px`,borderRadius:`var(--radius-sm)`,height:`24px`},children:`Apply Suggestion`})]}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:e.lineContent})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=y===t.id,a=JF(t.id,t.role,t.model);return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${u?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:r?(0,G.jsx)(`div`,{className:`comment-avatar-circle`,style:{background:a.bg,width:`28px`,height:`28px`,fontSize:`11px`},children:a.initial}):(0,G.jsx)(`div`,{style:{width:`28px`}})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:dj(t.createdAt)}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>T(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(t.id))},title:`Edit reply`,"aria-label":`Edit reply`,tabIndex:0,children:(0,G.jsx)(GM,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>E(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),E(t.id))},title:`Delete reply`,"aria-label":`Delete reply`,tabIndex:0,children:(0,G.jsx)(eN,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(qF,{draftKey:`reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:n=>{s(e.id,t.id,n),b(null)},onCancel:()=>b(null)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(t.body)}})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!p&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>m(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(!0))},className:`comment-reply-trigger`,"aria-label":`Write a reply`,tabIndex:0,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(qM,{size:14,"aria-hidden":`true`}),`Reply...`]}),u?(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:w,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Unresolve conversation`,children:`Unresolve conversation`}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:C,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Resolve conversation`,children:`Resolve conversation`})]}),p&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(qF,{draftKey:`reply:${e.id}`,onSubmit:t=>{a(e.id,t),m(!1)},onCancel:()=>{m(!1),x.current?.focus()}})})]})]})}var XF=(0,W.memo)(function({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,theme:s,editorIDE:c,lineDiffType:l,lineWrap:u,diffIndicators:d,showLineNumbers:f,hunkSeparators:p,lineHoverHighlight:m,fontSize:h,expandContextByDefault:g,collapsedContextThreshold:_,expansionLineCount:v,onViewedChange:y,onAddComment:b,onDeleteComment:x}){let[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(null),[E,D]=(0,W.useState)(0),[O,k]=(0,W.useState)(null),[A,j]=(0,W.useState)(o),[M,N]=(0,W.useState)(!1),[P,F]=(0,W.useState)(!1),[I,L]=(0,W.useState)(g),[R,z]=(0,W.useState)(null),[ee,te]=(0,W.useState)(null),[B,V]=(0,W.useState)(null),H=(0,W.useRef)(null),ne=async(e,t=!1)=>{if(R===null&&!(!t&&typeof window<`u`&&!window.confirm(`Revert hunk #${e+1} in ${n}? This rewrites the file via "git apply --reverse".`))){z(e),te(null);try{let t=await fetch(`/api/revert-hunk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,hunkIndex:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}}catch(e){te(e.message)}finally{z(null)}}},re=t.type===`change`||t.type===`rename-changed`,ie=!A&&re,{loading:ae,oldContent:oe,newContent:se}=RF(n,I&&ie),ce=I&&oe!==null&&se!==null,le=t.prevName??n;(0,W.useEffect)(()=>{j(o)},[o]);let ue=pj[s]||pj.nord,U=(0,W.useMemo)(()=>QF(a,h),[a,h]),de=(e,n,r)=>{let i=r&&r!==n?r:n,a=n,o=[];for(let n=i;n<=a;n++){let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,s=e===`additions`?`additionLineIndex`:`deletionLineIndex`,c=!1;for(let e of t.hunks){let t=e[i],l=e[a];if(n>=t&&n<t+l){let i=e[s]+(n-t);o.push(r[i]??``),c=!0;break}}c||o.push(``)}return o.join(`
1967
- `)},fe=async e=>{if(e.stopPropagation(),t.type!==`deleted`){N(!0);try{await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,editor:c})})}catch(e){console.error(`Failed to open file in IDE editor:`,e)}finally{N(!1)}}},pe=()=>{switch(t.type){case`new`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-new`,children:`Added`});case`deleted`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-deleted`,children:`Deleted`});case`rename-pure`:case`rename-changed`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-renamed`,children:`Renamed`});default:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-modified`,children:`Modified`})}},me=r.filter(e=>e.lineNumber===0),he=r.filter(e=>e.lineNumber>0),ge=e=>`_pending`in e.metadata?(0,G.jsx)(qF,{draftKey:`new:${n}:${S.side}:${S.startLineNumber||S.lineNumber}:${S.lineNumber}`,lineContent:de(S.side,S.lineNumber,S.startLineNumber),onSubmit:e=>{let t=de(S.side,S.lineNumber,S.startLineNumber);b(n,S.side,S.lineNumber,t,e,S.startLineNumber),C(null),T(null)},onCancel:()=>{C(null),T(null)}}):(0,G.jsx)(YF,{comment:e.metadata,onDelete:x}),_e=e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&C({side:t.side,lineNumber:t.lineNumber})},children:`+`}),ve=[...he,...S?[{side:S.side,lineNumber:S.lineNumber,metadata:{_pending:!0}}]:[]];return(0,G.jsxs)(`div`,{ref:H,className:`file-diff-card ${o?`file-diff-viewed`:``} ${A?`file-diff-collapsed`:``}`,id:e,children:[(0,G.jsxs)(`div`,{className:`file-diff-card-header`,onClick:()=>j(!A),children:[(0,G.jsxs)(`div`,{className:`file-diff-header-left`,children:[(0,G.jsx)(`span`,{className:`file-diff-collapse-indicator`,children:A?(0,G.jsx)(xM,{size:14}):(0,G.jsx)(bM,{size:14})}),(0,G.jsx)(`span`,{className:`file-diff-name`,title:n,children:n}),pe(),he.length>0&&(0,G.jsxs)(`span`,{className:`file-diff-comment-badge`,title:`${he.length} inline comment${he.length===1?``:`s`}`,children:[(0,G.jsx)(RM,{size:10}),he.length]}),E>0&&(0,G.jsxs)(`span`,{className:`file-diff-selection-badge`,"aria-live":`polite`,children:[E,` line`,E===1?``:`s`,` selected`]}),O&&(0,G.jsxs)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:[`Copied `,O]})]}),(0,G.jsxs)(`div`,{className:`file-diff-header-right`,onClick:e=>e.stopPropagation(),children:[ie&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn ${I?`btn-active`:``}`,onClick:()=>L(e=>!e),disabled:ae,title:I?`Hide unchanged context (use original patch render)`:`Load full file so unchanged context becomes expandable`,children:[ae?(0,G.jsx)(IM,{size:11,className:`spin`}):(0,G.jsx)(LM,{size:11}),(0,G.jsx)(`span`,{children:ae?`Loading…`:I?`Hide Context`:`Expand Context`})]}),t.type!==`deleted`&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:fe,disabled:M,title:`Open and edit full file locally`,children:[(0,G.jsx)(WM,{size:11}),(0,G.jsx)(`span`,{children:M?`Opening...`:`Edit File`})]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:()=>{j(!1),F(!0)},title:`Comment on this entire file`,children:[(0,G.jsx)(RM,{size:11}),(0,G.jsx)(`span`,{children:`Add Comment`})]}),(0,G.jsxs)(`label`,{className:`viewed-label ${o?`viewed-checked`:``}`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>y(n,e.target.checked)}),`Viewed`]})]})]}),!A&&t.hunks.length>0&&(0,G.jsxs)(`div`,{className:`file-diff-hunk-actions`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(`span`,{className:`file-diff-hunk-actions-label`,style:{display:`inline-flex`,alignItems:`center`,gap:`4px`},children:`Selective Revert`}),(0,G.jsx)(QT,{content:`Selective Revert lets you preview and undo specific blocks of changes (hunks) in this file using 'git apply --reverse'.`,side:`top`,children:(0,G.jsx)(TM,{size:12,style:{color:`var(--text-muted)`,cursor:`help`}})}),(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:`11px`,margin:`0 4px`},children:`·`}),(0,G.jsxs)(`span`,{style:{color:`var(--text-secondary)`,fontSize:`11px`},children:[t.hunks.length,` block`,t.hunks.length===1?``:`s`,` available`]})]}),(0,G.jsx)(`div`,{className:`file-diff-hunk-actions-buttons`,children:t.hunks.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,className:`file-diff-hunk-revert-btn`,onClick:()=>V(t),disabled:R!==null,title:`Preview and revert hunk #${t+1} (lines @${e.additionStart}+${e.additionLines??e.additionCount})`,children:[R===t?(0,G.jsx)(IM,{size:10,className:`spin`}):(0,G.jsx)(rN,{size:10}),(0,G.jsxs)(`span`,{children:[`Hunk #`,t+1]})]},t))}),ee&&(0,G.jsxs)(`span`,{className:`file-diff-hunk-error`,role:`alert`,children:[(0,G.jsx)(CM,{size:11}),ee]})]}),B!==null&&(()=>{let e=t.hunks[B];if(!e)return null;let r=t.deletionLines.slice(e.deletionLineIndex,e.deletionLineIndex+(e.deletionCount??e.deletionLines??0)),i=t.additionLines.slice(e.additionLineIndex,e.additionLineIndex+(e.additionStart!==void 0&&e.additionLines!==void 0?e.additionLines:e.additionCount??0));return(0,G.jsxs)(IF,{open:B!==null,onClose:()=>V(null),className:`hunk-revert-modal`,ariaLabel:`Selective Revert Preview Hunk #${B+1}`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(rN,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Revert Hunk #`,B+1]})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:()=>V(null),"aria-label":`Close dialog`,children:(0,G.jsx)(aN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-intro`,children:[`Reverting this hunk will restore the deleted (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-danger-text)`,fontWeight:600},children:`red`}),`) lines and remove the added (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-success-text)`,fontWeight:600},children:`green`}),`) lines from `,(0,G.jsx)(`strong`,{children:n.split(`/`).pop()}),`.`]}),(0,G.jsxs)(`div`,{className:`hunk-preview-container`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-header`,children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsxs)(`span`,{children:[`Lines: @-`,e.deletionStart,`,`,e.deletionCount??e.deletionLines??0,` @+`,e.additionStart,`,`,e.additionLines??e.additionCount??0]})]}),(0,G.jsxs)(`div`,{className:`hunk-preview-code`,children:[r.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-deletion`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`-`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`del-${t}`)),i.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-addition`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`+`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`add-${t}`)),r.length===0&&i.length===0&&(0,G.jsx)(`div`,{className:`hunk-preview-line`,style:{fontStyle:`italic`,color:`var(--text-muted)`},children:`No changes in this hunk.`})]})]}),(0,G.jsx)(ZF,{filePath:n,deletionStart:e.deletionStart,deletionCount:e.deletionCount??e.deletionLines??0})]}),(0,G.jsxs)(`div`,{className:`modal-footer`,children:[(0,G.jsx)(`button`,{className:`hunk-revert-btn-secondary`,onClick:()=>V(null),children:`Cancel`}),(0,G.jsx)(`button`,{className:`hunk-revert-btn-primary`,onClick:async()=>{let e=B;V(null),await ne(e,!0)},children:`Revert Changes`})]})]})})(),!A&&(0,G.jsxs)(`div`,{className:`file-diff-card-body`,children:[(me.length>0||P)&&(0,G.jsxs)(`div`,{className:`file-level-comments-section`,style:{margin:`16px 20px`,padding:`12px`,background:`rgba(255,255,255,0.02)`,border:`1px solid var(--border-color)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`13px`,fontWeight:600,color:`var(--text-secondary)`},children:[(0,G.jsx)(RM,{size:14}),(0,G.jsxs)(`span`,{children:[`File-Level Comments (`,me.length,`)`]})]}),me.length>0&&(0,G.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:me.map(e=>(0,G.jsx)(YF,{comment:e.metadata,onDelete:x},e.metadata.id))}),P&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-color)`},children:(0,G.jsx)(qF,{draftKey:`file-comment:${n}`,lineContent:``,onSubmit:e=>{b(n,`additions`,0,``,e),F(!1)},onCancel:()=>F(!1)})})]}),ce?(0,G.jsx)(Yg,{oldFile:{name:le,contents:oe??``},newFile:{name:n,contents:se??``},options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,expandUnchanged:!1,collapsedContextThreshold:_,expansionLineCount:v,onLineSelectionStart:()=>{T(null),D(0)},onLineSelectionChange:e=>{D(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{D(0),e&&(T(e),C({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{k(t),setTimeout(()=>k(null),1600)},()=>{})},theme:{dark:ue.type===`dark`?ue.themeName:`nord`,light:ue.type===`light`?ue.themeName:`github-light`},themeType:ue.type,unsafeCSS:U},selectedLines:w,lineAnnotations:ve,renderHeaderMetadata:()=>null,renderAnnotation:ge,renderGutterUtility:_e}):(0,G.jsx)(Jg,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,onLineSelectionStart:()=>{T(null),D(0)},onLineSelectionChange:e=>{D(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{D(0),e&&(T(e),C({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{k(t),setTimeout(()=>k(null),1600)},()=>{})},theme:{dark:ue.type===`dark`?ue.themeName:`nord`,light:ue.type===`light`?ue.themeName:`github-light`},themeType:ue.type,unsafeCSS:U},selectedLines:w,lineAnnotations:ve,renderHeaderMetadata:()=>null,renderAnnotation:e=>`_pending`in e.metadata?(0,G.jsx)(qF,{draftKey:`new:${n}:${S.side}:${S.startLineNumber||S.lineNumber}:${S.lineNumber}`,lineContent:de(S.side,S.lineNumber,S.startLineNumber),onSubmit:e=>{let t=de(S.side,S.lineNumber,S.startLineNumber);b(n,S.side,S.lineNumber,t,e,S.startLineNumber),C(null),T(null)},onCancel:()=>{C(null),T(null)}}):(0,G.jsx)(YF,{comment:e.metadata,onDelete:x}),renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&C({side:t.side,lineNumber:t.lineNumber})},children:`+`})})]})]})});function ZF({filePath:e,deletionStart:t,deletionCount:n}){let[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(null);if((0,W.useEffect)(()=>{let r=!0;return(async()=>{o(!0),c(null);try{let a=new URLSearchParams({filePath:e,deletionStart:String(t),deletionCount:String(n)}),o=await fetch(`/api/hunk-history?${a}`);if(!o.ok)throw Error(`HTTP ${o.status}`);let s=await o.json();r&&i(s)}catch(e){r&&c(e.message||`Failed to fetch hunk history`)}finally{r&&o(!1)}})(),()=>{r=!1}},[e,t,n]),a)return(0,G.jsxs)(`div`,{className:`hunk-history-loading`,children:[(0,G.jsx)(IM,{size:14,className:`spin`,style:{marginRight:`8px`}}),(0,G.jsx)(`span`,{children:`Loading git history & origin blame…`})]});if(s)return(0,G.jsxs)(`div`,{className:`hunk-history-error`,children:[(0,G.jsx)(CM,{size:14,style:{color:`var(--feedback-danger-text)`,marginRight:`8px`}}),(0,G.jsxs)(`span`,{children:[`Failed to load git history: `,s]})]});if(!r)return null;let l=Array.from(new Map(r.blame.map(e=>[e.commit,e])).values());return(0,G.jsxs)(`div`,{className:`hunk-history-section`,children:[l.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Commit(s) introducing deleted lines`}),(0,G.jsx)(`div`,{className:`hunk-history-commits`,children:l.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-commit-card`,children:[(0,G.jsxs)(`div`,{className:`hunk-history-commit-header`,children:[(0,G.jsx)(`span`,{className:`hunk-history-commit-hash`,children:e.commit}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-author`,children:[(0,G.jsx)(iN,{size:11}),(0,G.jsx)(`span`,{children:e.author})]}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-date`,children:[(0,G.jsx)(EM,{size:11}),(0,G.jsx)(`span`,{children:e.date})]})]}),(0,G.jsx)(`div`,{className:`hunk-history-commit-msg`,children:e.summary})]},e.commit))})]}),r.recentCommits.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Recent File Modification History`}),(0,G.jsx)(`div`,{className:`hunk-history-log`,children:r.recentCommits.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-log-row`,children:[(0,G.jsx)(`span`,{className:`hunk-history-log-hash`,children:e.hash}),(0,G.jsx)(`span`,{className:`hunk-history-log-msg`,title:e.summary,children:e.summary}),(0,G.jsx)(`span`,{className:`hunk-history-log-author`,children:e.author}),(0,G.jsx)(`span`,{className:`hunk-history-log-date`,children:e.date})]},e.hash))})]})]})}function QF(e,t){return`
1965
+ )`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),XN=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Wb,...g}=e,{store:_}=AN(),v=GN(),y=Fb(),b=_.useState(`floatingRootContext`),x=_.useState(`mounted`),S=_.useState(`open`),C=_.useState(`openChangeReason`),w=_.useState(`activeTriggerElement`),T=_.useState(`modal`),E=_.useState(`positionerElement`),D=_.useState(`instantType`),O=_.useState(`transitionStatus`),k=W.useRef(null),A=pw(E,!1,!1),j=RT({anchor:i,floatingRootContext:b,positionMethod:a,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:FT}),M=W.useMemo(()=>{let e={};return S||(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...j.positionerStyles,...e}}},[S,x,j.positionerStyles]),N=W.useMemo(()=>({props:M,...j}),[M,j]),P=b?.select(`domReferenceElement`);Y(()=>{let e=P,t=k.current;if(e&&(k.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return A(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,A,_]);let F=W.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:D}),[S,N.side,N.align,N.anchorHidden,D]),I=W.useCallback(e=>{_.set(`positionerElement`,e)},[_]),L=eS(`div`,e,{state:F,props:[N.props,BT(O),g],ref:[t,I],stateAttributesMapping:vT});return(0,G.jsxs)(qN.Provider,{value:N,children:[x&&T===!0&&C!==`trigger-hover`&&(0,G.jsx)(YN,{ref:_.context.internalBackdropRef,inert:XT(!S),cutout:w}),(0,G.jsx)(Ib,{id:y,children:L})]})}),ZN=`ArrowUp`,QN=`ArrowDown`,$N=`ArrowLeft`,eP=`ArrowRight`,tP=`Home`,nP=new Set([$N,eP]),rP=new Set([ZN,QN]),iP=new Set([...nP,...rP]);new Set([...iP,tP,`End`]);var aP=new Set([ZN,QN,$N,eP,tP,`End`]),oP=W.createContext(void 0);function sP(e){let t=W.useContext(oP);if(t===void 0&&!e)throw Error(A_(69));return t}var cP={...vT,...cT},lP=W.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=AN(),c=JN(),l=sP(!0)!=null,u=AT(),d=s.useState(`open`),f=s.useState(`openMethod`),p=s.useState(`instantType`),m=s.useState(`transitionStatus`),h=s.useState(`popupProps`),g=s.useState(`titleElementId`),_=s.useState(`descriptionElementId`),v=s.useState(`modal`),y=s.useState(`mounted`),b=s.useState(`openChangeReason`),x=s.useState(`popupElement`),S=s.useState(`payload`),C=s.useState(`positionerElement`),w=s.useState(`activeTriggerElement`),T=s.useState(`floatingRootContext`);mw({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}});let E=s.useState(`disabled`),D=s.useState(`openOnHover`),O=s.useState(`closeDelay`);Nw(T,{enabled:D&&!E,closeDelay:O});function k(e){return e===`touch`?s.context.popupRef.current:!0}let A=i===void 0?k:i,j=W.useMemo(()=>({open:d,side:c.side,align:c.align,instant:p,transitionStatus:m}),[d,c.side,c.align,p,m]),M=W.useCallback(e=>{s.set(`popupElement`,e)},[s]);function N(){T.context.events.emit(`measure-layout`)}function P(e,t){T.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}GT({popupElement:x,positionerElement:C,mounted:y,content:S,enabled:W.useCallback(()=>s.context.triggerElements.size>1,[s]),onMeasureLayout:N,onMeasureLayoutComplete:P,side:c.side,direction:u});let F=eS(`div`,e,{state:j,ref:[t,s.context.popupRef,M],props:[h,{"aria-labelledby":g,"aria-describedby":_,onKeyDown(e){l&&aP.has(e.key)&&e.stopPropagation()}},BT(m),o],stateAttributesMapping:cP});return(0,G.jsx)(bS,{context:T,openInteractionType:f,modal:v===`trap-focus`,disabled:!y||b===`trigger-hover`,initialFocus:A,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:K_(w)?w:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:F})});function uP({trigger:e,children:t,open:n,onOpenChange:r,side:i=`bottom`,align:a=`end`,className:o,ariaLabel:s}){return(0,G.jsxs)(LN,{open:n,onOpenChange:r,children:[(0,G.jsx)(UN,{render:e}),(0,G.jsx)(KN,{children:(0,G.jsx)(XN,{className:`ui-popover-positioner`,side:i,align:a,sideOffset:8,children:(0,G.jsx)(lP,{className:`ui-popover ${o??``}`,"aria-label":s,children:t})})})]})}function dP(e){let t=W.useRef(!0);t.current&&(t.current=!1,e())}function fP({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=W.useRef(e!==void 0),[a,o]=W.useState(t);return[i?e:a,W.useCallback(e=>{i||o(e)},[])]}var pP=W.createContext(null),mP=W.createContext(null);function hP(){let e=W.useContext(pP);if(e===null)throw Error(A_(60));return e}function gP(){let e=W.useContext(mP);if(e===null)throw Error(A_(61));return e}var _P=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),vP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},yP={valid(e){return e===null?null:e?{[_P.valid]:``}:{[_P.invalid]:``}}},bP=W.createContext({invalid:void 0,name:void 0,validityData:{state:vP,errors:[],error:``,value:``,initialValue:null},setValidityData:Rb,disabled:void 0,touched:!1,setTouched:Rb,dirty:!1,setDirty:Rb,filled:!1,setFilled:Rb,focused:!1,setFocused:Rb,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Bb)=>e,getInputValidationProps:(e=Bb)=>e,inputRef:{current:null},commit:async()=>{}}});function xP(e=!0){let t=W.useContext(bP);if(t.setValidityData===Rb&&!e)throw Error(A_(28));return t}var SP=W.createContext({controlId:void 0,setControlId:Rb,labelId:void 0,setLabelId:Rb,messageIds:[],setMessageIds:Rb,getDescriptionProps:e=>e});function CP(){return W.useContext(SP)}function wP(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=CP(),o=yT(t);return Y(()=>{if(!(!n&&!t||a===Rb)){if(n){let e=r?.current;G_(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}var TP=(e,t)=>Object.is(e,t);function EP(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function DP(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:EP(e,t,n))}function OP(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:EP(e,t,n))}function kP(e,t,n){return e.filter(e=>!EP(e,t,n))}function AP(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function jP(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function MP(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return AP(e)}function NP(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?AP(e.value):AP(e)}function PP(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??MP(e,n);if(Array.isArray(t)){let r=jP(t)?t.flatMap(e=>e.items):t;if(e==null){let t=r.find(e=>e.value==null);return t&&t.label!=null?t.label:MP(e,n)}if(typeof e!=`object`){let t=r.find(t=>t&&t.value===e);return t&&t.label!=null?t.label:MP(e,n)}if(`value`in e){let t=r.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return MP(e,n)}function FP(e,t){return!Array.isArray(e)||e.length===0?``:e.map(e=>MP(e,t)).join(`, `)}var IP={id:Z(e=>e.id),modal:Z(e=>e.modal),multiple:Z(e=>e.multiple),items:Z(e=>e.items),itemToStringLabel:Z(e=>e.itemToStringLabel),itemToStringValue:Z(e=>e.itemToStringValue),isItemEqualToValue:Z(e=>e.isItemEqualToValue),value:Z(e=>e.value),open:Z(e=>e.open),mounted:Z(e=>e.mounted),forceMount:Z(e=>e.forceMount),transitionStatus:Z(e=>e.transitionStatus),touchModality:Z(e=>e.touchModality),activeIndex:Z(e=>e.activeIndex),selectedIndex:Z(e=>e.selectedIndex),isActive:Z((e,t)=>e.activeIndex===t),isSelected:Z((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>EP(e,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:EP(i,n,r)}),isSelectedByFocus:Z((e,t)=>e.selectedIndex===t),popupProps:Z(e=>e.popupProps),triggerProps:Z(e=>e.triggerProps),triggerElement:Z(e=>e.triggerElement),positionerElement:Z(e=>e.positionerElement),listElement:Z(e=>e.listElement),scrollUpArrowVisible:Z(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Z(e=>e.scrollDownArrowVisible),hasScrollArrows:Z(e=>e.hasScrollArrows),serializedValue:Z(e=>{let{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?``:NP(n,r)})},LP=W.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Rb,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function RP(){return W.useContext(LP)}function zP(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function BP(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=RP(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=xP(),f=X(e.getValue);Y(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),Y(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:zP(u,c),validate(){let e=n;e===void 0&&(e=f()),l.current=!0,iS.flushSync(()=>o(e))}})},[o,a,t,s,f,r,c,l,i,u,n]),Y(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}function VP(e,t){let n=W.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current)},[e,r]),Y(()=>{n.current=e},[e])}function HP(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,disabled:l=!1,readOnly:u=!1,required:d=!1,modal:f=!0,actionsRef:p,inputRef:m,onOpenChangeComplete:h,items:g,multiple:_=!1,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b=TP,highlightItemOnHover:x=!0,children:S}=e,{clearErrors:C}=RP(),{setDirty:w,shouldValidateOnChange:T,validityData:E,setFilled:D,name:O,disabled:k,validation:A}=xP(),{controlId:j}=CP(),M=wP({id:t}),N=k||l,P=O??c,[F,I]=fP({controlled:n,default:_?r??zb:r,name:`Select`,state:`value`}),[L,R]=fP({controlled:a,default:o,name:`Select`,state:`open`}),z=W.useRef([]),ee=W.useRef([]),te=W.useRef(null),B=W.useRef(null),V=W.useRef(0),H=W.useRef(null),ne=W.useRef([]),re=W.useRef(!1),ie=W.useRef(!1),ae=W.useRef(null),oe=W.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),se=W.useRef(!1),{mounted:ce,setMounted:le,transitionStatus:ue}=fw(L),U=P_(()=>new cw({id:M,modal:f,multiple:_,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b,value:F,open:L,mounted:ce,transitionStatus:ue,items:g,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,de=aw(U,IP.activeIndex),fe=aw(U,IP.selectedIndex),pe=aw(U,IP.triggerElement),me=aw(U,IP.positionerElement),he=W.useMemo(()=>_&&Array.isArray(F)&&F.length===0?``:NP(F,y),[_,F,y]),ge=dv(U.state.triggerElement);BP({id:M,commit:A.commit,value:F,controlRef:ge,name:P,getValue:()=>F});let _e=W.useRef(F);Y(()=>{F!==_e.current&&U.set(`forceMount`,!0)},[U,F]),Y(()=>{D(F!==null)},[F,D]),Y(function(){if(L)return;let e=ne.current;if(_){let t=Array.isArray(F)?F:[];if(t.length===0){U.set(`selectedIndex`,null);return}let n=t[t.length-1],r=OP(e,n,b);U.set(`selectedIndex`,r===-1?null:r);return}let t=OP(e,F,b);U.set(`selectedIndex`,t===-1?null:t)},[_,L,F,ne,b,U]),VP(F,()=>{C(P),w(F!==E.initialValue),T()?A.commit(F):A.commit(F,!0)});let ve=X((e,t)=>{if(s?.(e,t),!t.isCanceled&&(R(e),!e&&U.state.activeIndex!==null)){let e=z.current[U.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),ye=X(()=>{le(!1),U.set(`activeIndex`,null),h?.(!1)});mw({enabled:!p,open:L,ref:te,onComplete(){L||ye()}}),W.useImperativeHandle(p,()=>({unmount:ye}),[ye]);let be=X((e,t)=>{i?.(e,t),!t.isCanceled&&I(e)}),xe=X(()=>{let e=U.state.listElement||te.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;U.state.scrollUpArrowVisible!==r&&U.set(`scrollUpArrowVisible`,r),U.state.scrollDownArrowVisible!==i&&U.set(`scrollDownArrowVisible`,i)}),Se=Cw({open:L,onOpenChange:ve,elements:{reference:pe,floating:me}}),{getReferenceProps:Ce,getFloatingProps:we,getItemProps:Te}=Rw([xS(Se,{enabled:!u&&!N,event:`mousedown`}),IC(Se,{bubbles:!1}),qw(Se,{enabled:!u&&!N,listRef:z,activeIndex:de,selectedIndex:fe,disabledIndices:zb,onNavigate(e){e===null&&!L||U.set(`activeIndex`,e)},focusItemOnHover:!1}),Xw(Se,{enabled:!u&&!N&&(L||!_),listRef:ee,activeIndex:de,selectedIndex:fe,onMatch(e){L?U.set(`activeIndex`,e):be(ne.current[e],ax(`none`))},onTypingChange(e){re.current=e}})]);dP(()=>{U.update({popupProps:we(),triggerProps:Ce()})}),Y(()=>{U.update({id:M,modal:f,multiple:_,value:F,open:L,mounted:ce,transitionStatus:ue,popupProps:we(),triggerProps:Ce(),items:g,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b})},[U,M,f,_,F,L,ce,ue,we,Ce,g,v,y,b]);let Ee=W.useMemo(()=>({store:U,name:P,required:d,disabled:N,readOnly:u,multiple:_,itemToStringLabel:v,itemToStringValue:y,highlightItemOnHover:x,setValue:be,setOpen:ve,listRef:z,popupRef:te,scrollHandlerRef:B,handleScrollArrowVisibility:xe,scrollArrowsMountedCountRef:V,getItemProps:Te,events:Se.context.events,valueRef:H,valuesRef:ne,labelsRef:ee,typingRef:re,selectionRef:oe,selectedItemTextRef:ae,validation:A,onOpenChangeComplete:h,keyboardActiveRef:ie,alignItemWithTriggerActiveRef:se,initialValueRef:_e}),[U,P,d,N,u,_,v,y,x,be,ve,Te,Se.context.events,A,h,xe]),De=dx(m,A.inputRef),Oe=_&&Array.isArray(F)&&F.length>0,ke=W.useMemo(()=>!_||!Array.isArray(F)||!P?null:F.map(e=>{let t=NP(e,y);return(0,G.jsx)(`input`,{type:`hidden`,name:P,value:t},t)}),[_,F,P,y]);return(0,G.jsx)(pP.Provider,{value:Ee,children:(0,G.jsxs)(mP.Provider,{value:Se,children:[S,(0,G.jsx)(`input`,{...A.getInputValidationProps({onFocus(){U.state.triggerElement?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=ax(Kb,e.nativeEvent);function r(){if(_)return;let e=ne.current.find(e=>NP(e,y).toLowerCase()===t.toLowerCase());e!=null&&(w(e!==E.initialValue),be(e,n),T()&&A.commit(e))}U.set(`forceMount`,!0),queueMicrotask(r)}}),id:t||j||void 0,name:_?void 0:P,value:he,disabled:N,required:d&&!Oe,readOnly:u,ref:De,style:_x,tabIndex:-1,"aria-hidden":!0}),ke]})})}function UP(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var WP=2,GP={..._T,...yP,value:()=>null},KP=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{setTouched:s,setFocused:c,validationMode:l,state:u,disabled:d}=xP(),{labelId:f}=CP(),{store:p,setOpen:m,selectionRef:h,validation:g,readOnly:_,alignItemWithTriggerActiveRef:v,disabled:y,keyboardActiveRef:b}=hP(),x=d||y||i,S=aw(p,IP.open),C=aw(p,IP.value),w=aw(p,IP.triggerProps),T=aw(p,IP.positionerElement),E=aw(p,IP.listElement),D=aw(p,IP.serializedValue),O=dv(T),k=W.useRef(null),A=z_(),j=z_(),{getButtonProps:M,buttonRef:N}=VN({disabled:x,native:a}),P=dx(t,k,N,X(e=>{p.set(`triggerElement`,e)})),F=z_(),I=z_();W.useEffect(()=>{if(S)return I.start(200,()=>{h.current.allowUnselectedMouseUp=!0,F.start(200,()=>{h.current.allowSelectedMouseUp=!0})}),()=>{F.clear(),I.clear()};h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},j.clear()},[S,h,j,F,I]);let L=W.useMemo(()=>E?.id??Gv(T)?.id,[E,T]),R=Ux(w,{role:`combobox`,"aria-expanded":S?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":S?L:void 0,"aria-labelledby":f,"aria-readonly":_||void 0,tabIndex:x?-1:0,ref:P,onFocus(e){c(!0),S&&v.current&&m(!1,ax(Qb,e.nativeEvent)),A.start(0,()=>{p.set(`forceMount`,!0)})},onBlur(){s(!0),c(!1),l===`onBlur`&&g.commit(C)},onPointerMove({pointerType:e}){b.current=!1,p.set(`touchModality`,e===`touch`)},onPointerDown({pointerType:e}){p.set(`touchModality`,e===`touch`)},onKeyDown(){b.current=!0},onMouseDown(e){if(S)return;let t=Sx(e.currentTarget);function n(e){if(!k.current)return;let t=e.target;if(Lv(k.current,t)||Lv(O.current,t)||t===k.current)return;let n=UP(k.current);e.clientX>=n.left-WP&&e.clientX<=n.right+WP&&e.clientY>=n.top-WP&&e.clientY<=n.bottom+WP||m(!1,ax(tx,e))}j.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},g.getValidationProps,o,M);R.role=`combobox`;let z=W.useMemo(()=>({...u,open:S,disabled:x,value:C,readOnly:_,placeholder:!D}),[u,S,x,C,_,D]);return eS(`button`,e,{ref:[t,k],state:z,stateAttributesMapping:GP,props:R})}),qP={value:()=>null},JP=W.forwardRef(function(e,t){let{className:n,render:r,children:i,...a}=e,{store:o,valueRef:s}=hP(),c=aw(o,IP.value),l=aw(o,IP.items),u=aw(o,IP.itemToStringLabel),d=aw(o,IP.serializedValue),f=W.useMemo(()=>({value:c,placeholder:!d}),[c,d]),p=typeof i==`function`?i(c):i??(Array.isArray(c)?FP(c,u):PP(c,l,u));return eS(`span`,e,{state:f,ref:[t,s],props:[{children:p},a],stateAttributesMapping:qP})}),YP=W.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=hP(),o=aw(a,IP.open);return eS(`span`,e,{state:W.useMemo(()=>({open:o}),[o]),ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:gT})}),XP=W.createContext(void 0),ZP=W.forwardRef(function(e,t){let{store:n}=hP(),r=aw(n,IP.mounted),i=aw(n,IP.forceMount);return r||i?(0,G.jsx)(XP.Provider,{value:!0,children:(0,G.jsx)(lS,{ref:t,...e})}):null}),QP=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function $P(){return W.useContext(QP)}function eF(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),o=W.useRef(0),s=P_(nF).current,c=P_(tF).current,[l,u]=W.useState(0),d=W.useRef(l),f=X((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=X(e=>{c.delete(e),d.current+=1,u(d.current)}),m=W.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(rF).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Y(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),Y(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),Y(()=>()=>{n.current=[]},[n]),Y(()=>()=>{r&&(r.current=[])},[r]);let h=X(e=>(s.add(e),()=>{s.delete(e)}));Y(()=>{s.forEach(e=>e(m))},[s,m]);let g=W.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,G.jsx)(QP.Provider,{value:g,children:t})}function tF(){return new Map}function nF(){return new Set}function rF(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var iF=W.createContext(void 0);function aF(){let e=W.useContext(iF);if(!e)throw Error(A_(59));return e}function oF(e,t){e&&Object.assign(e.style,t)}var sF={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},cF={position:`fixed`},lF=W.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Ub,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=hP(),D=gP(),O=aw(v,IP.open),k=aw(v,IP.mounted),A=aw(v,IP.modal),j=aw(v,IP.value),M=aw(v,IP.touchModality),N=aw(v,IP.positionerElement),P=aw(v,IP.triggerElement),F=aw(v,IP.isItemEqualToValue),I=W.useRef(null),L=W.useRef(null),[R,z]=W.useState(h),ee=k&&R&&!M;!k&&R!==h&&z(h),Y(()=>{k||(IP.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),IP.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),W.useImperativeHandle(x,()=>ee),ON((ee||A)&&O&&!M,P);let te=RT({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??ee,collisionAvoidance:g,keepMounted:!0}),B=ee?`none`:te.side,V=ee?cF:te.positionerStyles,H=W.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...V,...e}}},[O,k,V]),ne=W.useMemo(()=>({open:O,side:B,align:te.align,anchorHidden:te.anchorHidden}),[O,B,te.align,te.anchorHidden]),re=eS(`div`,e,{ref:[t,X(e=>{v.set(`positionerElement`,e)})],state:ne,stateAttributesMapping:vT,props:[H,_]}),ie=W.useRef(0),ae=X(e=>{if(e.size===0&&ie.current===0||C.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=ax(Kb);if(t!==0&&!v.state.multiple&&j!==null&&OP(C.current,j,F)===-1){let e=w.current,t=e!=null&&DP(C.current,e,F)?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=j.filter(e=>DP(C.current,e,F));(e.length!==j.length||e.some(e=>!DP(j,e,F)))&&(E(e,n),e.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&ee){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};oF(N,e),oF(T.current,e)}}),oe=W.useMemo(()=>({...te,side:B,alignItemWithTriggerActive:ee,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[te,B,ee,z]);return(0,G.jsx)(eF,{elementsRef:y,labelsRef:b,onMapChange:ae,children:(0,G.jsxs)(iF.Provider,{value:oe,children:[k&&A&&(0,G.jsx)(YN,{inert:XT(!O),cutout:P}),re]})})});function uF(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var dF=`base-ui-disable-scrollbar`,fF={className:dF,element:(0,G.jsx)(`style`,{href:dF,precedence:`base-ui:low`,children:`.${dF}{scrollbar-width:none}.${dF}::-webkit-scrollbar{display:none}`})},pF={...vT,...cT},mF=W.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a,popupRef:o,onOpenChangeComplete:s,setOpen:c,valueRef:l,selectedItemTextRef:u,keyboardActiveRef:d,multiple:f,handleScrollArrowVisibility:p,scrollHandlerRef:m}=hP(),{side:h,align:g,alignItemWithTriggerActive:_,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:y,scrollUpArrowRef:b}=aF(),x=sP(!0)!=null,S=gP(),C=z_(),w=aw(a,IP.id),T=aw(a,IP.open),E=aw(a,IP.mounted),D=aw(a,IP.popupProps),O=aw(a,IP.transitionStatus),k=aw(a,IP.triggerElement),A=aw(a,IP.positionerElement),j=aw(a,IP.listElement),M=W.useRef(0),N=W.useRef(!1),P=W.useRef(0),F=W.useRef(!1),I=W.useRef({}),L=xx(),R=X(e=>{if(!A||!o.current||!F.current)return;if(N.current||!_){p();return}let t=A.style.top===`0px`,n=A.style.bottom===`0px`,r=A.getBoundingClientRect().height,i=Sx(A),a=getComputedStyle(A),s=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=i.documentElement.clientHeight-s-c,u=e.scrollTop,d=e.scrollHeight-e.clientHeight,f=null,m=null,h=!1;if(t){let e=r+(d-u),t=Math.min(e,l);f=t,t===l?h=!0:m=d}else if(n){let e=u-0,t=r+e,n=Math.min(t,l),i=t-l;f=n,n===l?(h=!0,u<d&&(m=u-(e-i))):m=0}f!=null&&(A.style.height=`${f}px`),m!=null&&(e.scrollTop=m),h&&(N.current=!0),p()});W.useImperativeHandle(m,()=>R,[R]),mw({open:T,ref:o,onComplete(){T&&s?.(!0)}});let z=W.useMemo(()=>({open:T,transitionStatus:O,side:h,align:g}),[T,O,h,g]);Y(()=>{!A||!o.current||Object.keys(I.current).length||(I.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[o,A]),Y(()=>{E||_||(F.current=!1,N.current=!1,M.current=0,P.current=0,oF(A,I.current))},[E,_,A,o]),Y(()=>{let e=o.current;if(!(!E||!k||!A||!e)){if(!_){F.current=!0,L.request(p);return}queueMicrotask(()=>{let t=getComputedStyle(A),n=getComputedStyle(e),r=Sx(k),i=H_(A),a=k.getBoundingClientRect(),o=A.getBoundingClientRect(),s=a.left,c=a.height,d=j||e,f=d.scrollHeight,m=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,_=parseFloat(t.minHeight)||100,y=r.documentElement.clientHeight-h-g,b=r.documentElement.clientWidth,x=y-a.bottom+c,S=u.current,C=l.current,w=0,T=0;if(S&&C){let e=C.getBoundingClientRect(),t=S.getBoundingClientRect(),n=e.left-s,r=t.left-o.left,i=e.top-a.top+e.height/2,c=t.top-o.top+t.height/2;w=n-r,T=c-i}let E=x+T+g+m,D=Math.min(y,E),O=y-h-g,P=E-D,L=Math.max(5,s+w),R=b-5,z=Math.max(0,L+o.width-R);A.style.left=`${L-z}px`,A.style.height=`${D}px`,A.style.maxHeight=`auto`,A.style.marginTop=`${h}px`,A.style.marginBottom=`${g}px`,e.style.height=`100%`;let ee=d.scrollHeight-d.clientHeight,te=P>=ee;te&&(D=Math.min(y,o.height)-(P-ee));let B=a.top<20||a.bottom>y-20||D<Math.min(f,_),V=(i.visualViewport?.scale??1)!==1&&xv;if(B||V){F.current=!0,oF(A,I.current),iS.flushSync(()=>v(!1));return}if(te){let e=Math.max(0,y-E);A.style.top=o.height>=O?`0`:`${e}px`,A.style.height=`${D}px`,d.scrollTop=d.scrollHeight-d.clientHeight,M.current=Math.max(_,D)}else A.style.bottom=`0`,M.current=Math.max(_,D),d.scrollTop=P;M.current===y&&(N.current=!0),p(),setTimeout(()=>{F.current=!0})})}},[a,E,A,k,l,u,o,p,_,v,L,y,b,j]),W.useEffect(()=>{if(!_||!A||!E)return;let e=H_(A);function t(e){c(!1,ax(ix,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[c,_,A,E]);let ee={...j?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":f||void 0,id:`${w}-list`},onKeyDown(e){d.current=!0,x&&aP.has(e.key)&&e.stopPropagation()},onMouseMove(){d.current=!1},onPointerLeave(e){if(uF(e)||e.pointerType===`touch`)return;let t=e.currentTarget;C.start(0,()=>{a.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){j||m.current?.(e.currentTarget)},..._&&{style:j?{height:`100%`}:sF}},te=eS(`div`,e,{ref:[t,o],state:z,stateAttributesMapping:pF,props:[D,ee,BT(O),{className:!j&&_?fF.className:void 0},i]});return(0,G.jsxs)(W.Fragment,{children:[fF.element,(0,G.jsx)(bS,{context:S,modal:!1,disabled:!E,restoreFocus:!0,children:te})]})}),hF=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function gF(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=$P(),f=W.useRef(-1),[p,m]=W.useState(a??(i===hF.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=W.useRef(null),g=W.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return Y(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Y(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),W.useMemo(()=>({ref:g,index:p}),[p,g])}var _F=W.createContext(void 0);function vF(){let e=W.useContext(_F);if(!e)throw Error(A_(57));return e}var yF=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=W.useRef(null),u=gF({label:a,textRef:l,indexGuessBehavior:hF.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=hP(),x=z_(),S=aw(d,IP.isActive,u.index),C=aw(d,IP.isSelected,u.index,i),w=aw(d,IP.isSelectedByFocus,u.index),T=aw(d,IP.isItemEqualToValue),E=u.index,D=E!==-1,O=W.useRef(null),k=dv(E);Y(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),Y(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&EP(t,i,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A=W.useMemo(()=>({disabled:o,selected:C,highlighted:S}),[o,C,S]),j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=W.useRef(null),N=W.useRef(`mouse`),P=W.useRef(!1),{getButtonProps:F,buttonRef:I}=VN({disabled:o,focusableWhenDisabled:!0,native:s});function L(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(C?kP(n,i,T):[...n,i],ax(Zb,e))}else m(i,ax(Zb,e)),p(!1,ax(Zb,e))}let R={role:`option`,"aria-selected":C,"aria-disabled":o||void 0,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||uF(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E)},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,L(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(e){if(o)return;if(P.current){P.current=!1;return}let t=!h.current.allowSelectedMouseUp&&C,n=!h.current.allowUnselectedMouseUp&&!C;t||n||N.current!==`touch`&&!S||L(e.nativeEvent)}},z=eS(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,R,c,F]}),ee=W.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,G.jsx)(_F.Provider,{value:ee,children:z})})),bF=W.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=vF();return n||r?(0,G.jsx)(xF,{...e,ref:t}):null}),xF=W.memo(W.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=vF(),s=W.useRef(null),{transitionStatus:c,setMounted:l}=fw(o),u=W.useMemo(()=>({selected:o,transitionStatus:c}),[o,c]),d=eS(`span`,e,{ref:[t,s],state:u,props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:cT});return mw({open:o,ref:s,onComplete(){o||l(!1)}}),d})),SF=W.memo(W.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=vF(),{selectedItemTextRef:o}=hP(),{className:s,render:c,...l}=e;return eS(`div`,e,{ref:[W.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})}));function CF({value:e,onValueChange:t,options:n,ariaLabel:r,className:i}){return(0,G.jsxs)(HP,{value:e,onValueChange:e=>t(e),modal:!1,children:[(0,G.jsxs)(KP,{className:`ui-select-trigger ${i??``}`,"aria-label":r,children:[(0,G.jsx)(JP,{children:e=>n.find(t=>t.value===e)?.label??e}),(0,G.jsx)(YP,{className:`ui-select-icon`,children:(0,G.jsx)(NM,{size:12})})]}),(0,G.jsx)(ZP,{children:(0,G.jsx)(lF,{className:`ui-select-positioner`,sideOffset:4,align:`end`,side:`bottom`,alignItemWithTrigger:!1,children:(0,G.jsx)(mF,{className:`ui-select-popup`,children:n.map(e=>(0,G.jsxs)(yF,{value:e.value,className:`ui-select-item`,children:[(0,G.jsx)(SF,{children:e.label}),(0,G.jsx)(bF,{className:`ui-select-indicator`,children:(0,G.jsx)(AM,{size:13})})]},e.value))})})})]})}function wF({comments:e,onEditComment:t,onDeleteComment:n,onSend:r,sending:i,agentWaiting:a}){let{haptic:o,sound:s}=gM(),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(``),f=e.length,p=(0,W.useMemo)(()=>[...e].sort((e,t)=>e.createdAt-t.createdAt),[e]);(0,W.useEffect)(()=>{c&&f===0&&l(!1)},[c,f]);let m=async()=>{o(`heavy`),s(`send`),await r(u),d(``),l(!1)};return(0,G.jsx)(uP,{open:c,onOpenChange:l,ariaLabel:`Review comments before sending to agent`,className:`send-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm`,disabled:f===0||i,title:a?`An agent is connected and waiting`:`Review and send comments to a waiting agent`,children:[a&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),i?`Sending…`:`Send to agent (${f})`]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(kM,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Send review to agent`}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[f,` comment`,f===1?``:`s`]})]}),(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:p.map(e=>(0,G.jsx)(TF,{comment:e,onEdit:t,onDelete:n},e.id))}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional)`})]}),(0,G.jsx)(`textarea`,{id:`srp-general-input`,className:`srp-general-input`,value:u,placeholder:`Add an overall note for the agent that applies to the whole review…`,rows:3,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())}})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>l(!1),disabled:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:m,disabled:f===0||i,children:i?`Sending…`:`Send ${f} comment${f===1?``:`s`}`})]})]})})}function TF({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(AM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(bN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(oN,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(hN,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}var EF=[{value:`word`,label:`Word`},{value:`word-alt`,label:`Word (alt)`},{value:`char`,label:`Character`},{value:`none`,label:`None`}],DF=[{value:`classic`,label:`Classic (+/−)`},{value:`bars`,label:`Bars`},{value:`none`,label:`None`}],OF=[{value:`line-info`,label:`Line info + context`},{value:`line-info-basic`,label:`Line info`},{value:`metadata`,label:`Metadata only`},{value:`simple`,label:`Simple`}],kF=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}],AF=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),jF=[2,4,8].map(e=>({value:String(e),label:String(e)})),MF=[{value:``,label:`Default`},{value:`chrome`,label:`Chrome`},{value:`firefox`,label:`Firefox`},{value:`edge`,label:`Edge`},{value:`brave`,label:`Brave`}],NF=[{value:`default`,label:`Default / System`},{value:`vscode`,label:`VS Code`},{value:`zed`,label:`Zed`},{value:`vim`,label:`Vim`},{value:`neovim`,label:`Neovim`}],PF=(0,W.memo)(function({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,planCount:o,pendingPlanCount:s,onOpenPlans:c,diffStyle:l,diffOptions:u,defaultTabSize:d,browser:f,theme:p,editorIDE:m,customMode:h,lineDiffType:g,lineWrap:_,diffIndicators:v,showLineNumbers:y,hunkSeparators:b,lineHoverHighlight:x,fontSize:S,haptics:C,sounds:w,onDiffStyleChange:T,onDiffOptionsChange:E,onDefaultTabSizeChange:D,onBrowserChange:O,onOpenThemeModal:k,onEditorIDEChange:A,onLineDiffTypeChange:j,onLineWrapChange:M,onDiffIndicatorsChange:N,onShowLineNumbersChange:P,onHunkSeparatorsChange:F,onLineHoverHighlightChange:I,onFontSizeChange:L,onHapticsChange:R,onSoundsChange:z,onOpenSearch:ee,onCopyComments:te,onSendToAgent:B,agentWaiting:V,sending:H,comments:ne,onEditComment:re,onDeleteComment:ie}){let[ae,oe]=(0,W.useState)(!1),[se,ce]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`,`&&(e.preventDefault(),ce(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let le=async()=>{await te(),oe(!0),setTimeout(()=>oe(!1),2e3)};return(0,G.jsxs)(`div`,{className:`toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,G.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,G.jsx)(WM,{size:12}),t]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,G.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,G.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-search-btn`,onClick:ee,title:`Search (⌘K)`,children:[(0,G.jsx)(dN,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Search`}),(0,G.jsx)(`kbd`,{className:`toolbar-search-kbd`,children:`⌘K`})]}),o>0&&(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-plans-btn ${s>0?`toolbar-plans-btn-pending`:``}`,onClick:c,title:s>0?`${s} plan${s===1?``:`s`} awaiting your review`:`Review agent plans`,children:[s>0&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),(0,G.jsx)(RM,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Plans`}),s>0&&(0,G.jsx)(`span`,{className:`toolbar-plans-badge`,children:s})]}),(0,G.jsxs)(`div`,{className:`toolbar-toggle`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm ${l===`split`?`btn-active`:``}`,onClick:()=>T(`split`),children:`Split`}),(0,G.jsx)(`button`,{className:`btn btn-sm ${l===`unified`?`btn-active`:``}`,onClick:()=>T(`unified`),children:`Unified`})]}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn flex-1`,title:`Switch Theme`,onClick:k,children:[(0,G.jsx)(nN,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Theme`})]}),(0,G.jsx)(uP,{open:se,onOpenChange:ce,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsx)(`button`,{className:`btn btn-sm settings-btn ${se?`btn-active`:``}`,title:`Settings`,children:(0,G.jsx)(fN,{size:14})}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[!h&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Source`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.staged,onChange:e=>E({...u,staged:e.target.checked})}),`Show staged`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.untracked,onChange:e=>E({...u,untracked:e.target.checked})}),`Show untracked`]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Inline diff`}),(0,G.jsx)(CF,{value:g,onValueChange:e=>j(e),options:EF,ariaLabel:`Inline diff style`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>M(e.target.checked)}),`Wrap long lines`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff indicators`}),(0,G.jsx)(CF,{value:v,onValueChange:e=>N(e),options:DF,ariaLabel:`Diff indicators`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>P(e.target.checked)}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hunk separator`}),(0,G.jsx)(CF,{value:b,onValueChange:e=>F(e),options:OF,ariaLabel:`Hunk separator style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(CF,{value:x,onValueChange:e=>I(e),options:kF,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(CF,{value:String(S),onValueChange:e=>L(Number(e)),options:AF,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(CF,{value:String(d),onValueChange:e=>D(Number(e)),options:jF,ariaLabel:`Default tab size`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`External tools`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Browser`}),(0,G.jsx)(CF,{value:f||``,onValueChange:O,options:MF,ariaLabel:`Browser`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Preferred IDE`}),(0,G.jsx)(CF,{value:m||`default`,onValueChange:A,options:NF,ariaLabel:`Preferred IDE`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Feedback`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:C,onChange:e=>R(e.target.checked)}),`Haptic feedback`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>z(e.target.checked)}),`Sound effects`]})]})}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:le,disabled:a===0,children:ae?`Copied!`:`Copy comments (${a})`}),(0,G.jsx)(wF,{comments:ne,onEditComment:re,onDeleteComment:ie,onSend:B,sending:H,agentWaiting:V})]})]})}),FF=W.createContext(void 0);function IF(e){let t=W.useContext(FF);if(e===!1&&t===void 0)throw Error(A_(27));return t}var LF={...vT,...cT},RF=W.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=IF(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return eS(`div`,e,{state:W.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:LF,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),zF=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),BF=function(e){return e[e.open=lT.open]=`open`,e[e.closed=lT.closed]=`closed`,e[e.startingStyle=lT.startingStyle]=`startingStyle`,e[e.endingStyle=lT.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),VF=W.createContext(void 0);function HF(){let e=W.useContext(VF);if(e===void 0)throw Error(A_(26));return e}var UF={...vT,...cT,nestedDialogOpen(e){return e?{[BF.nestedDialogOpen]:``}:null}},WF=W.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=IF(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);HF(),mw({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=eS(`div`,e,{state:W.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){aP.has(e.key)&&e.stopPropagation()},style:{[zF.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:UF});return(0,G.jsx)(bS,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),GF=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=IF(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,G.jsx)(VF.Provider,{value:n,children:(0,G.jsxs)(lS,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(YN,{ref:i.context.internalBackdropRef,inert:XT(!open)}),e.children]})}):null});function KF(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=FN(i);_w(t);let{forceUnmount:d}=vw(i,t,()=>{u()}),f=X(e=>{let n=ax(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=W.useCallback(()=>{t.setOpen(!1,f(rx))},[t,f]);W.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Tw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=W.useState(0),_=h===0,v=Yw(m),y=IC(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=Rv(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||Lv(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});ON(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=Rw([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),W.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=W.useMemo(()=>b(l),[b,l]),w=W.useMemo(()=>S(l),[S,l]),T=W.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var qF={...Sw,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)},JF=class extends lw{constructor(e){super(YF(e),{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),triggerElements:new yw,onOpenChange:void 0,onOpenChangeComplete:void 0},qF)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function YF(e={}){return{...xw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function XF(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=IF(!0),p=!!f,m=P_(()=>l?.store??new JF({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);KF({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=W.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(FF.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}function ZF({open:e,onClose:t,className:n,ariaLabel:r,initialFocus:i,onKeyDown:a,children:o}){return(0,G.jsx)(XF,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(GF,{children:[(0,G.jsx)(RF,{className:`ui-modal-backdrop`}),(0,G.jsx)(WF,{className:`ui-modal-popup ${n??``}`,"aria-label":r,initialFocus:i,onKeyDown:a,children:o})]})})}async function QF(e,t){let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=${t}`);if(!n.ok){if(n.status===404)return null;throw Error(`HTTP ${n.status} fetching ${t} ${e}`)}let r=await n.json();if(r.missing)return null;if(r.error)throw Error(r.error);return r.content??``}function $F(e,t){let[n,r]=(0,W.useState)({loading:!1,error:null,oldContent:null,newContent:null});return(0,W.useEffect)(()=>{if(!t||!e)return;let n=!1;return r(e=>({...e,loading:!0,error:null})),Promise.all([QF(e,`old`),QF(e,`new`)]).then(([e,t])=>{n||r({loading:!1,error:null,oldContent:e,newContent:t})}).catch(e=>{n||r({loading:!1,error:e.message,oldContent:null,newContent:null})}),()=>{n=!0}},[e,t]),n}var eI=`diffing-draft-`,tI=10080*60*1e3;function nI(...e){return eI+e.join(`:`)}function rI(...e){try{let t=localStorage.getItem(nI(...e));if(!t)return null;let n=JSON.parse(t);return Date.now()-n.timestamp>tI?(localStorage.removeItem(nI(...e)),null):n.body}catch{return null}}var iI={};function aI(e,...t){let n=nI(...t);iI[n]&&clearTimeout(iI[n]),iI[n]=setTimeout(()=>{oI(e,...t),delete iI[n]},500)}function oI(e,...t){let n=nI(...t);try{e.trim()?localStorage.setItem(n,JSON.stringify({body:e,timestamp:Date.now()})):localStorage.removeItem(n)}catch{}}function sI(...e){try{localStorage.removeItem(nI(...e))}catch{}}function cI({initialBody:e,lineContent:t,draftKey:n,onSubmit:r,onCancel:i}){let{haptic:a,sound:o}=gM(),[s,c]=(0,W.useState)(()=>{if(n){let e=rI(n);if(e)return e}return e||``}),[l,u]=(0,W.useState)(`write`),d=(0,W.useRef)(null);(0,W.useEffect)(()=>{l===`write`&&d.current?.focus()},[l]),(0,W.useEffect)(()=>{n&&aI(s,n)},[s,n]);let f=()=>{let e=s.trim();e&&(n&&sI(n),a(`success`),o(`success`),r(e))},p=e=>{if(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f()),e.key===`Escape`){if(s.includes(`
1966
+ `))return;i()}},m=async e=>{let t=e.clipboardData.items,n=null;for(let e=0;e<t.length;e++){let r=t[e];if(r.kind===`file`&&r.type.startsWith(`image/`)){n=r.getAsFile();break}}if(!n)return;e.preventDefault();let r=d.current;if(!r)return;let i=r.selectionStart,a=r.selectionEnd,o=Math.random().toString(36).slice(2,8),s=`![Uploading image… ${o}]()`,l=r.value;c(l.slice(0,i)+s+l.slice(a));try{let e=new FormData;e.append(`file`,n,n.name||`pasted-${o}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);let i=`![pasted image](${r.url})`;c(e=>e.replace(s,i))}catch(e){console.error(`Image upload failed:`,e),c(e=>e.replace(s,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`comment-form`,style:{padding:`16px`},role:`form`,"aria-label":`Comment form`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Comment form mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`write`,"aria-controls":`comment-write-panel`,onClick:()=>u(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),u(`preview`))},className:`comment-form-tab-btn ${l===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`preview`,"aria-controls":`comment-preview-panel`,onClick:()=>u(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),u(`write`))},className:`comment-form-tab-btn ${l===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),l===`write`?(0,G.jsx)(`textarea`,{id:`comment-write-panel`,ref:d,value:s,onChange:e=>c(e.target.value),onKeyDown:p,onPaste:m,placeholder:`Leave a review comment (supports Markdown and Pasting Clipboard Images)...`,rows:4,"aria-label":`Comment body`,style:{minHeight:`100px`}}):(0,G.jsxs)(`div`,{id:`comment-preview-panel`,role:`tabpanel`,"aria-label":`Preview`,style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:[(()=>{let e=!!s.match(/```suggestion\n([\s\S]*?)```/);return s.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0||!e?(0,G.jsx)(`div`,{className:`comment-preview markdown-body`,style:{minHeight:`100px`,padding:`12px 16px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,background:`var(--bg-primary)`,fontSize:`14px`,lineHeight:1.6,color:`var(--text-primary)`,overflowY:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`},dangerouslySetInnerHTML:{__html:s.trim()?mj(s):`<span style="color: var(--text-muted); font-style: italic;">Nothing to preview</span>`}}):null})(),(()=>{let e=s.match(/```suggestion\n([\s\S]*?)```/),n=!!e,r=e?e[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsx)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change Preview`})}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[t&&(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:t})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]}),(0,G.jsxs)(`div`,{className:`comment-form-actions`,style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:f,disabled:!s.trim(),children:e?`Save`:`Comment`})]})]})}function lI({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(kM,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(yN,{size:t,"aria-hidden":`true`})})}function uI({comment:e,onDelete:t}){let[,n]=(0,W.useState)(0),{resolveComment:r,unresolveComment:i,addReply:a,removeReply:o,editReply:s,applySuggestion:c,editComment:l}=jj(),u=e.status===`resolved`,[d,f]=(0,W.useState)(u),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(null),x=(0,W.useRef)(null),S=e.body.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0;(0,W.useEffect)(()=>{f(e.status===`resolved`)},[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]);let C=()=>r(e.id),w=()=>i(e.id),T=e=>{b(e)},E=t=>{o(e.id,t)};return u&&d?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed`,style:{padding:`12px 18px`,margin:`14px 20px`,background:`var(--bg-secondary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-md)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,opacity:.85,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--text-muted)`},children:[(0,G.jsx)(FM,{size:16,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Conversation resolved`}),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`2px 6px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`2px 6px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]}),(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length>0?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{style:{background:`none`,border:`none`,color:`var(--primary)`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},onClick:()=>f(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(!1))},"aria-label":`Show resolved conversation`,children:`Show resolved`})]}):h?(0,G.jsx)(`div`,{className:`comment-bubble-canvas`,id:`comment-${e.id}`,role:`article`,"aria-label":`Edit comment`,children:(0,G.jsxs)(`div`,{className:`comment-node`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(lI,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]})]}),(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(cI,{draftKey:`edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:t=>{l(e.id,t),g(!1)},onCancel:()=>g(!1)})})]})]})}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${u?`comment-bubble-canvas-resolved`:``}`,id:`comment-${e.id}`,role:`article`,"aria-label":e.lineNumber===0?`File-level comment`:`Comment by user on line ${e.lineNumber}`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${u?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(lI,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[dj(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]}),u&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(FM,{size:13}),`Resolved`]}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{ref:x,className:`comment-node-btn`,onClick:()=>g(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(!0))},title:`Edit comment`,"aria-label":`Edit comment`,tabIndex:0,children:(0,G.jsx)(oN,{size:13,"aria-hidden":`true`})}),_?(0,G.jsxs)(`div`,{className:`comment-delete-confirm`,style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>t(e.id),title:`Confirm delete`,"aria-label":`Confirm delete comment`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,borderRadius:`var(--radius-sm)`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`,width:`auto`,height:`auto`},children:[(0,G.jsx)(gN,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>v(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!1))},title:`Cancel delete`,"aria-label":`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>v(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!0))},title:`Delete comment`,"aria-label":`Delete comment`,tabIndex:0,children:(0,G.jsx)(hN,{size:13,"aria-hidden":`true`})})]})]}),S&&(0,G.jsx)(`div`,{className:`comment-node-body markdown-body ${u?`comment-resolved-line`:``}`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(()=>{let t=e.body.match(/```suggestion\n([\s\S]*?)```/),n=!!t&&e.side===`additions`,r=t?t[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{marginTop:`12px`,marginBottom:`4px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:[(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change`}),u?(0,G.jsxs)(`span`,{style:{color:`var(--feedback-success-text)`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(FM,{size:12}),` Applied`]}):(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{try{await c(e.id)}catch(e){alert(e.message)}},style:{fontSize:`11px`,padding:`2px 8px`,borderRadius:`var(--radius-sm)`,height:`24px`},children:`Apply Suggestion`})]}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:e.lineContent})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=y===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${u?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(lI,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:dj(t.createdAt)}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>T(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(t.id))},title:`Edit reply`,"aria-label":`Edit reply`,tabIndex:0,children:(0,G.jsx)(oN,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>E(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),E(t.id))},title:`Delete reply`,"aria-label":`Delete reply`,tabIndex:0,children:(0,G.jsx)(hN,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(cI,{draftKey:`reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:n=>{s(e.id,t.id,n),b(null)},onCancel:()=>b(null)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(t.body)}})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!p&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>m(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(!0))},className:`comment-reply-trigger`,"aria-label":`Write a reply`,tabIndex:0,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(cN,{size:14,"aria-hidden":`true`}),`Reply...`]}),u?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>f(!0),style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Hide resolved conversation`,children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:w,style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Unresolve conversation`,children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:C,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Resolve conversation`,children:`Resolve conversation`})]}),p&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(cI,{draftKey:`reply:${e.id}`,onSubmit:t=>{a(e.id,t),m(!1)},onCancel:()=>{m(!1),x.current?.focus()}})})]})]})}var dI=(0,W.memo)(function({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,theme:s,editorIDE:c,lineDiffType:l,lineWrap:u,diffIndicators:d,showLineNumbers:f,hunkSeparators:p,lineHoverHighlight:m,fontSize:h,expandContextByDefault:g,collapsedContextThreshold:_,expansionLineCount:v,onViewedChange:y,onAddComment:b,onDeleteComment:x}){let[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(null),[E,D]=(0,W.useState)(0),[O,k]=(0,W.useState)(null),[A,j]=(0,W.useState)(o),[M,N]=(0,W.useState)(!1),[P,F]=(0,W.useState)(!1),[I,L]=(0,W.useState)(g),[R,z]=(0,W.useState)(null),[ee,te]=(0,W.useState)(null),[B,V]=(0,W.useState)(null),H=(0,W.useRef)(null),ne=async(e,t=!1)=>{if(R===null&&!(!t&&typeof window<`u`&&!window.confirm(`Revert hunk #${e+1} in ${n}? This rewrites the file via "git apply --reverse".`))){z(e),te(null);try{let t=await fetch(`/api/revert-hunk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,hunkIndex:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}}catch(e){te(e.message)}finally{z(null)}}},re=t.type===`change`||t.type===`rename-changed`,ie=!A&&re,{loading:ae,oldContent:oe,newContent:se}=$F(n,I&&ie),ce=I&&oe!==null&&se!==null,le=t.prevName??n;(0,W.useEffect)(()=>{j(o)},[o]);let ue=pj[s]||pj.nord,U=(0,W.useMemo)(()=>pI(a,h),[a,h]),de=(e,n,r)=>{let i=r&&r!==n?r:n,a=n,o=[];for(let n=i;n<=a;n++){let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,s=e===`additions`?`additionLineIndex`:`deletionLineIndex`,c=!1;for(let e of t.hunks){let t=e[i],l=e[a];if(n>=t&&n<t+l){let i=e[s]+(n-t);o.push(r[i]??``),c=!0;break}}c||o.push(``)}return o.join(`
1967
+ `)},fe=async e=>{if(e.stopPropagation(),t.type!==`deleted`){N(!0);try{await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,editor:c})})}catch(e){console.error(`Failed to open file in IDE editor:`,e)}finally{N(!1)}}},pe=()=>{switch(t.type){case`new`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-new`,children:`Added`});case`deleted`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-deleted`,children:`Deleted`});case`rename-pure`:case`rename-changed`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-renamed`,children:`Renamed`});default:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-modified`,children:`Modified`})}},me=r.filter(e=>e.lineNumber===0),he=r.filter(e=>e.lineNumber>0),ge=e=>`_pending`in e.metadata?(0,G.jsx)(cI,{draftKey:`new:${n}:${S.side}:${S.startLineNumber||S.lineNumber}:${S.lineNumber}`,lineContent:de(S.side,S.lineNumber,S.startLineNumber),onSubmit:e=>{let t=de(S.side,S.lineNumber,S.startLineNumber);b(n,S.side,S.lineNumber,t,e,S.startLineNumber),C(null),T(null)},onCancel:()=>{C(null),T(null)}}):(0,G.jsx)(uI,{comment:e.metadata,onDelete:x}),_e=e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&C({side:t.side,lineNumber:t.lineNumber})},children:`+`}),ve=[...he,...S?[{side:S.side,lineNumber:S.lineNumber,metadata:{_pending:!0}}]:[]];return(0,G.jsxs)(`div`,{ref:H,className:`file-diff-card ${o?`file-diff-viewed`:``} ${A?`file-diff-collapsed`:``}`,id:e,children:[(0,G.jsxs)(`div`,{className:`file-diff-card-header`,onClick:()=>j(!A),children:[(0,G.jsxs)(`div`,{className:`file-diff-header-left`,children:[(0,G.jsx)(`span`,{className:`file-diff-collapse-indicator`,children:A?(0,G.jsx)(MM,{size:14}):(0,G.jsx)(jM,{size:14})}),(0,G.jsx)(`span`,{className:`file-diff-name`,title:n,children:n}),pe(),he.length>0&&(0,G.jsxs)(`span`,{className:`file-diff-comment-badge`,title:`${he.length} inline comment${he.length===1?``:`s`}`,children:[(0,G.jsx)($M,{size:10}),he.length]}),E>0&&(0,G.jsxs)(`span`,{className:`file-diff-selection-badge`,"aria-live":`polite`,children:[E,` line`,E===1?``:`s`,` selected`]}),O&&(0,G.jsxs)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:[`Copied `,O]})]}),(0,G.jsxs)(`div`,{className:`file-diff-header-right`,onClick:e=>e.stopPropagation(),children:[ie&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn ${I?`btn-active`:``}`,onClick:()=>L(e=>!e),disabled:ae,title:I?`Hide unchanged context (use original patch render)`:`Load full file so unchanged context becomes expandable`,children:[ae?(0,G.jsx)(YM,{size:11,className:`spin`}):(0,G.jsx)(XM,{size:11}),(0,G.jsx)(`span`,{children:ae?`Loading…`:I?`Hide Context`:`Expand Context`})]}),t.type!==`deleted`&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:fe,disabled:M,title:`Open and edit full file locally`,children:[(0,G.jsx)(aN,{size:11}),(0,G.jsx)(`span`,{children:M?`Opening...`:`Edit File`})]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:()=>{j(!1),F(!0)},title:`Comment on this entire file`,children:[(0,G.jsx)($M,{size:11}),(0,G.jsx)(`span`,{children:`Add Comment`})]}),(0,G.jsxs)(`label`,{className:`viewed-label ${o?`viewed-checked`:``}`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>y(n,e.target.checked)}),`Viewed`]})]})]}),!A&&t.hunks.length>0&&(0,G.jsxs)(`div`,{className:`file-diff-hunk-actions`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(`span`,{className:`file-diff-hunk-actions-label`,style:{display:`inline-flex`,alignItems:`center`,gap:`4px`},children:`Selective Revert`}),(0,G.jsx)(QT,{content:`Selective Revert lets you preview and undo specific blocks of changes (hunks) in this file using 'git apply --reverse'.`,side:`top`,children:(0,G.jsx)(IM,{size:12,style:{color:`var(--text-muted)`,cursor:`help`}})}),(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:`11px`,margin:`0 4px`},children:`·`}),(0,G.jsxs)(`span`,{style:{color:`var(--text-secondary)`,fontSize:`11px`},children:[t.hunks.length,` block`,t.hunks.length===1?``:`s`,` available`]})]}),(0,G.jsx)(`div`,{className:`file-diff-hunk-actions-buttons`,children:t.hunks.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,className:`file-diff-hunk-revert-btn`,onClick:()=>V(t),disabled:R!==null,title:`Preview and revert hunk #${t+1} (lines @${e.additionStart}+${e.additionLines??e.additionCount})`,children:[R===t?(0,G.jsx)(YM,{size:10,className:`spin`}):(0,G.jsx)(vN,{size:10}),(0,G.jsxs)(`span`,{children:[`Hunk #`,t+1]})]},t))}),ee&&(0,G.jsxs)(`span`,{className:`file-diff-hunk-error`,role:`alert`,children:[(0,G.jsx)(PM,{size:11}),ee]})]}),B!==null&&(()=>{let e=t.hunks[B];if(!e)return null;let r=t.deletionLines.slice(e.deletionLineIndex,e.deletionLineIndex+(e.deletionCount??e.deletionLines??0)),i=t.additionLines.slice(e.additionLineIndex,e.additionLineIndex+(e.additionStart!==void 0&&e.additionLines!==void 0?e.additionLines:e.additionCount??0));return(0,G.jsxs)(ZF,{open:B!==null,onClose:()=>V(null),className:`hunk-revert-modal`,ariaLabel:`Selective Revert Preview Hunk #${B+1}`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(vN,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Revert Hunk #`,B+1]})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:()=>V(null),"aria-label":`Close dialog`,children:(0,G.jsx)(bN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-intro`,children:[`Reverting this hunk will restore the deleted (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-danger-text)`,fontWeight:600},children:`red`}),`) lines and remove the added (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-success-text)`,fontWeight:600},children:`green`}),`) lines from `,(0,G.jsx)(`strong`,{children:n.split(`/`).pop()}),`.`]}),(0,G.jsxs)(`div`,{className:`hunk-preview-container`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-header`,children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsxs)(`span`,{children:[`Lines: @-`,e.deletionStart,`,`,e.deletionCount??e.deletionLines??0,` @+`,e.additionStart,`,`,e.additionLines??e.additionCount??0]})]}),(0,G.jsxs)(`div`,{className:`hunk-preview-code`,children:[r.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-deletion`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`-`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`del-${t}`)),i.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-addition`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`+`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`add-${t}`)),r.length===0&&i.length===0&&(0,G.jsx)(`div`,{className:`hunk-preview-line`,style:{fontStyle:`italic`,color:`var(--text-muted)`},children:`No changes in this hunk.`})]})]}),(0,G.jsx)(fI,{filePath:n,deletionStart:e.deletionStart,deletionCount:e.deletionCount??e.deletionLines??0})]}),(0,G.jsxs)(`div`,{className:`modal-footer`,children:[(0,G.jsx)(`button`,{className:`hunk-revert-btn-secondary`,onClick:()=>V(null),children:`Cancel`}),(0,G.jsx)(`button`,{className:`hunk-revert-btn-primary`,onClick:async()=>{let e=B;V(null),await ne(e,!0)},children:`Revert Changes`})]})]})})(),!A&&(0,G.jsxs)(`div`,{className:`file-diff-card-body`,children:[(me.length>0||P)&&(0,G.jsxs)(`div`,{className:`file-level-comments-section`,style:{margin:`16px 20px`,padding:`12px`,background:`rgba(255,255,255,0.02)`,border:`1px solid var(--border-color)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`13px`,fontWeight:600,color:`var(--text-secondary)`},children:[(0,G.jsx)($M,{size:14}),(0,G.jsxs)(`span`,{children:[`File-Level Comments (`,me.length,`)`]})]}),me.length>0&&(0,G.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:me.map(e=>(0,G.jsx)(uI,{comment:e.metadata,onDelete:x},e.metadata.id))}),P&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-color)`},children:(0,G.jsx)(cI,{draftKey:`file-comment:${n}`,lineContent:``,onSubmit:e=>{b(n,`additions`,0,``,e),F(!1)},onCancel:()=>F(!1)})})]}),ce?(0,G.jsx)(Yg,{oldFile:{name:le,contents:oe??``},newFile:{name:n,contents:se??``},options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,expandUnchanged:!1,collapsedContextThreshold:_,expansionLineCount:v,onLineSelectionStart:()=>{T(null),D(0)},onLineSelectionChange:e=>{D(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{D(0),e&&(T(e),C({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{k(t),setTimeout(()=>k(null),1600)},()=>{})},theme:{dark:ue.type===`dark`?ue.themeName:`nord`,light:ue.type===`light`?ue.themeName:`github-light`},themeType:ue.type,unsafeCSS:U},selectedLines:w,lineAnnotations:ve,renderHeaderMetadata:()=>null,renderAnnotation:ge,renderGutterUtility:_e}):(0,G.jsx)(Jg,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,onLineSelectionStart:()=>{T(null),D(0)},onLineSelectionChange:e=>{D(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{D(0),e&&(T(e),C({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{k(t),setTimeout(()=>k(null),1600)},()=>{})},theme:{dark:ue.type===`dark`?ue.themeName:`nord`,light:ue.type===`light`?ue.themeName:`github-light`},themeType:ue.type,unsafeCSS:U},selectedLines:w,lineAnnotations:ve,renderHeaderMetadata:()=>null,renderAnnotation:e=>`_pending`in e.metadata?(0,G.jsx)(cI,{draftKey:`new:${n}:${S.side}:${S.startLineNumber||S.lineNumber}:${S.lineNumber}`,lineContent:de(S.side,S.lineNumber,S.startLineNumber),onSubmit:e=>{let t=de(S.side,S.lineNumber,S.startLineNumber);b(n,S.side,S.lineNumber,t,e,S.startLineNumber),C(null),T(null)},onCancel:()=>{C(null),T(null)}}):(0,G.jsx)(uI,{comment:e.metadata,onDelete:x}),renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&C({side:t.side,lineNumber:t.lineNumber})},children:`+`})})]})]})});function fI({filePath:e,deletionStart:t,deletionCount:n}){let[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(null);if((0,W.useEffect)(()=>{let r=!0;return(async()=>{o(!0),c(null);try{let a=new URLSearchParams({filePath:e,deletionStart:String(t),deletionCount:String(n)}),o=await fetch(`/api/hunk-history?${a}`);if(!o.ok)throw Error(`HTTP ${o.status}`);let s=await o.json();r&&i(s)}catch(e){r&&c(e.message||`Failed to fetch hunk history`)}finally{r&&o(!1)}})(),()=>{r=!1}},[e,t,n]),a)return(0,G.jsxs)(`div`,{className:`hunk-history-loading`,children:[(0,G.jsx)(YM,{size:14,className:`spin`,style:{marginRight:`8px`}}),(0,G.jsx)(`span`,{children:`Loading git history & origin blame…`})]});if(s)return(0,G.jsxs)(`div`,{className:`hunk-history-error`,children:[(0,G.jsx)(PM,{size:14,style:{color:`var(--feedback-danger-text)`,marginRight:`8px`}}),(0,G.jsxs)(`span`,{children:[`Failed to load git history: `,s]})]});if(!r)return null;let l=Array.from(new Map(r.blame.map(e=>[e.commit,e])).values());return(0,G.jsxs)(`div`,{className:`hunk-history-section`,children:[l.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Commit(s) introducing deleted lines`}),(0,G.jsx)(`div`,{className:`hunk-history-commits`,children:l.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-commit-card`,children:[(0,G.jsxs)(`div`,{className:`hunk-history-commit-header`,children:[(0,G.jsx)(`span`,{className:`hunk-history-commit-hash`,children:e.commit}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-author`,children:[(0,G.jsx)(yN,{size:11}),(0,G.jsx)(`span`,{children:e.author})]}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-date`,children:[(0,G.jsx)(zM,{size:11}),(0,G.jsx)(`span`,{children:e.date})]})]}),(0,G.jsx)(`div`,{className:`hunk-history-commit-msg`,children:e.summary})]},e.commit))})]}),r.recentCommits.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Recent File Modification History`}),(0,G.jsx)(`div`,{className:`hunk-history-log`,children:r.recentCommits.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-log-row`,children:[(0,G.jsx)(`span`,{className:`hunk-history-log-hash`,children:e.hash}),(0,G.jsx)(`span`,{className:`hunk-history-log-msg`,title:e.summary,children:e.summary}),(0,G.jsx)(`span`,{className:`hunk-history-log-author`,children:e.author}),(0,G.jsx)(`span`,{className:`hunk-history-log-date`,children:e.date})]},e.hash))})]})]})}function pI(e,t){return`
1968
1968
  :host {
1969
1969
  --diffs-tab-size: ${e} !important;
1970
1970
  --diffs-font-family: var(--font-mono) !important;
@@ -2001,14 +2001,14 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
2001
2001
  [data-line].selected-line {
2002
2002
  background-color: var(--accent-subtle) !important;
2003
2003
  }
2004
- `}var $F=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.svg`,`.ico`,`.avif`]);function eI(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return $F.has(t)}function tI({filePath:e,info:t,viewed:n,onViewedChange:r}){let i=eI(e);return(0,G.jsxs)(`div`,{className:`file-diff-card ${n?`file-diff-viewed`:``}`,id:`file-${e}`,children:[(0,G.jsxs)(`div`,{className:`binary-diff-header`,children:[(0,G.jsx)(`span`,{className:`binary-diff-name`,children:e}),(0,G.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>r(e,t.target.checked)}),`Viewed`]})]}),!n&&(0,G.jsx)(`div`,{className:`binary-diff-body`,children:i?(0,G.jsx)(nI,{filePath:e,changeType:t.type}):(0,G.jsxs)(`div`,{className:`binary-diff-message`,children:[`Binary file `,t.type===`added`?`added`:t.type===`untracked`?`untracked`:t.type===`deleted`?`deleted`:`changed`]})})]})}function nI({filePath:e,changeType:t}){let n=`/api/file-content?path=${encodeURIComponent(e)}&version=old`,r=`/api/file-content?path=${encodeURIComponent(e)}&version=new`;return t===`added`||t===`untracked`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-added`,children:`Added`}),(0,G.jsx)(`img`,{src:r,alt:e,className:`image-preview-img`})]})}):t===`deleted`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-deleted`,children:`Deleted`}),(0,G.jsx)(`img`,{src:n,alt:e,className:`image-preview-img image-preview-deleted`})]})}):(0,G.jsxs)(`div`,{className:`image-preview image-preview-compare`,children:[(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`Before`}),(0,G.jsx)(`img`,{src:n,alt:`${e} (before)`,className:`image-preview-img`})]}),(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`After`}),(0,G.jsx)(`img`,{src:r,alt:`${e} (after)`,className:`image-preview-img`})]})]})}var rI=[],iI=(0,W.memo)(function({files:e,diffStyle:t,tabSizeMap:n,defaultTabSize:r,viewedFiles:i,binaryFiles:a,theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,expandContextByDefault:h,collapsedContextThreshold:g,expansionLineCount:_,onViewedChange:v,fileAnnotationsMap:y,onAddComment:b,onDeleteComment:x}){let S=(0,W.useMemo)(()=>[...e].sort((e,t)=>{let n=e.name.split(`/`),r=t.name.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=e<n.length-1;if(t!==e<r.length-1)return t?-1:1;let i=n[e].localeCompare(r[e]);if(i!==0)return i}return n.length-r.length}),[e]);return S.length===0?(0,G.jsx)(`div`,{className:`empty-state`,children:(0,G.jsx)(`p`,{children:`No changes found.`})}):(0,G.jsx)(`div`,{className:`diff-viewer`,children:S.map((e,S)=>{let C=e.name,w=a.get(C);return w?(0,G.jsx)(tI,{filePath:C,info:w,viewed:i.has(C),onViewedChange:v},`${C}-${S}`):(0,G.jsx)(XF,{id:`file-${C}`,fileDiff:e,filePath:C,annotations:y.get(C)??rI,diffStyle:t,tabSize:n[C]??r,viewed:i.has(C),theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,expandContextByDefault:h,collapsedContextThreshold:g,expansionLineCount:_,onViewedChange:v,onAddComment:b,onDeleteComment:x},`${C}-${S}`)})})}),aI={current:{label:`Current`,icon:yM,title:`Keep the current/HEAD side`},incoming:{label:`Incoming`,icon:aN,title:`Keep the incoming side`},both:{label:`Both`,icon:KM,title:`Keep both sides (current then incoming)`}},oI=(0,W.memo)(function({filePath:e,theme:t,fontSize:n,tabSize:r,onSaved:i}){let a=pj[t]||pj.nord,[o,s]=(0,W.useState)({loading:!0,error:null,file:null}),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(0),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),[g,_]=(0,W.useState)(!1),v=(0,W.useRef)(null);(0,W.useEffect)(()=>{let t=!1;return s({loading:!0,error:null,file:null}),l(null),d(0),_(!1),h(null),fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`).then(e=>e.json()).then(n=>{if(!t){if(n.error){s({loading:!1,error:n.error,file:null});return}s({loading:!1,error:null,file:{name:e,contents:n.content??``}})}}).catch(e=>{t||s({loading:!1,error:e.message,file:null})}),()=>{t=!0}},[e]);let y=(e,t)=>{let n=v.current;if(!n)return;let r=n.resolveConflict(e,t);r&&r.file&&(l(r.file),d(e=>e+1))};return o.loading?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-loading`,children:[(0,G.jsx)(IM,{size:14,className:`spin`}),(0,G.jsxs)(`span`,{children:[`Loading `,e,`…`]})]}):o.error||!o.file?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-error`,children:[(0,G.jsx)(CM,{size:14}),(0,G.jsxs)(`span`,{children:[`Could not load `,e,`: `,o.error??`unknown error`]})]}):(0,G.jsxs)(`div`,{className:`merge-conflict-card`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-header`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-title`,children:[(0,G.jsx)(NM,{size:14}),(0,G.jsx)(`span`,{className:`merge-conflict-name`,title:e,children:e})]}),(0,G.jsxs)(`div`,{className:`merge-conflict-actions`,children:[u>0&&(0,G.jsxs)(`span`,{className:`merge-conflict-status`,children:[u,` resolution`,u===1?``:`s`,` pending`]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:async()=>{let t=c??o.file;if(t){p(!0),h(null);try{let n=await fetch(`/api/save-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,content:t.contents,gitAdd:!0})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}_(!0),i()}catch(e){h(e.message)}finally{p(!1)}}},disabled:f||g,title:"Write the resolved file to disk and `git add` it",children:[f?(0,G.jsx)(IM,{size:11,className:`spin`}):g?(0,G.jsx)(wM,{size:11}):(0,G.jsx)(YM,{size:11}),(0,G.jsx)(`span`,{children:f?`Saving…`:g?`Saved + staged`:`Save & stage`})]})]})]}),m&&(0,G.jsxs)(`div`,{className:`merge-conflict-card-error`,role:`alert`,children:[(0,G.jsx)(CM,{size:14}),(0,G.jsx)(`span`,{children:m})]}),(0,G.jsx)(O_,{file:c??o.file,options:{disableFileHeader:!0,enableGutterUtility:!1,mergeConflictActionsType:`custom`,theme:{dark:a.type===`dark`?a.themeName:`nord`,light:a.type===`light`?a.themeName:`github-light`},themeType:a.type,unsafeCSS:`
2004
+ `}var mI=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.svg`,`.ico`,`.avif`]);function hI(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return mI.has(t)}function gI({filePath:e,info:t,viewed:n,onViewedChange:r}){let i=hI(e);return(0,G.jsxs)(`div`,{className:`file-diff-card ${n?`file-diff-viewed`:``}`,id:`file-${e}`,children:[(0,G.jsxs)(`div`,{className:`binary-diff-header`,children:[(0,G.jsx)(`span`,{className:`binary-diff-name`,children:e}),(0,G.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>r(e,t.target.checked)}),`Viewed`]})]}),!n&&(0,G.jsx)(`div`,{className:`binary-diff-body`,children:i?(0,G.jsx)(_I,{filePath:e,changeType:t.type}):(0,G.jsxs)(`div`,{className:`binary-diff-message`,children:[`Binary file `,t.type===`added`?`added`:t.type===`untracked`?`untracked`:t.type===`deleted`?`deleted`:`changed`]})})]})}function _I({filePath:e,changeType:t}){let n=`/api/file-content?path=${encodeURIComponent(e)}&version=old`,r=`/api/file-content?path=${encodeURIComponent(e)}&version=new`;return t===`added`||t===`untracked`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-added`,children:`Added`}),(0,G.jsx)(`img`,{src:r,alt:e,className:`image-preview-img`})]})}):t===`deleted`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-deleted`,children:`Deleted`}),(0,G.jsx)(`img`,{src:n,alt:e,className:`image-preview-img image-preview-deleted`})]})}):(0,G.jsxs)(`div`,{className:`image-preview image-preview-compare`,children:[(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`Before`}),(0,G.jsx)(`img`,{src:n,alt:`${e} (before)`,className:`image-preview-img`})]}),(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`After`}),(0,G.jsx)(`img`,{src:r,alt:`${e} (after)`,className:`image-preview-img`})]})]})}var vI=[],yI=(0,W.memo)(function({files:e,diffStyle:t,tabSizeMap:n,defaultTabSize:r,viewedFiles:i,binaryFiles:a,theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,expandContextByDefault:h,collapsedContextThreshold:g,expansionLineCount:_,onViewedChange:v,fileAnnotationsMap:y,onAddComment:b,onDeleteComment:x}){let S=(0,W.useMemo)(()=>[...e].sort((e,t)=>{let n=e.name.split(`/`),r=t.name.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=e<n.length-1;if(t!==e<r.length-1)return t?-1:1;let i=n[e].localeCompare(r[e]);if(i!==0)return i}return n.length-r.length}),[e]);return S.length===0?(0,G.jsx)(`div`,{className:`empty-state`,children:(0,G.jsx)(`p`,{children:`No changes found.`})}):(0,G.jsx)(`div`,{className:`diff-viewer`,children:S.map((e,S)=>{let C=e.name,w=a.get(C);return w?(0,G.jsx)(gI,{filePath:C,info:w,viewed:i.has(C),onViewedChange:v},`${C}-${S}`):(0,G.jsx)(dI,{id:`file-${C}`,fileDiff:e,filePath:C,annotations:y.get(C)??vI,diffStyle:t,tabSize:n[C]??r,viewed:i.has(C),theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,expandContextByDefault:h,collapsedContextThreshold:g,expansionLineCount:_,onViewedChange:v,onAddComment:b,onDeleteComment:x},`${C}-${S}`)})})}),bI={current:{label:`Current`,icon:AM,title:`Keep the current/HEAD side`},incoming:{label:`Incoming`,icon:bN,title:`Keep the incoming side`},both:{label:`Both`,icon:sN,title:`Keep both sides (current then incoming)`}},xI=(0,W.memo)(function({filePath:e,theme:t,fontSize:n,tabSize:r,onSaved:i}){let a=pj[t]||pj.nord,[o,s]=(0,W.useState)({loading:!0,error:null,file:null}),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(0),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),[g,_]=(0,W.useState)(!1),v=(0,W.useRef)(null);(0,W.useEffect)(()=>{let t=!1;return s({loading:!0,error:null,file:null}),l(null),d(0),_(!1),h(null),fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`).then(e=>e.json()).then(n=>{if(!t){if(n.error){s({loading:!1,error:n.error,file:null});return}s({loading:!1,error:null,file:{name:e,contents:n.content??``}})}}).catch(e=>{t||s({loading:!1,error:e.message,file:null})}),()=>{t=!0}},[e]);let y=(e,t)=>{let n=v.current;if(!n)return;let r=n.resolveConflict(e,t);r&&r.file&&(l(r.file),d(e=>e+1))};return o.loading?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-loading`,children:[(0,G.jsx)(YM,{size:14,className:`spin`}),(0,G.jsxs)(`span`,{children:[`Loading `,e,`…`]})]}):o.error||!o.file?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-error`,children:[(0,G.jsx)(PM,{size:14}),(0,G.jsxs)(`span`,{children:[`Could not load `,e,`: `,o.error??`unknown error`]})]}):(0,G.jsxs)(`div`,{className:`merge-conflict-card`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-header`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-title`,children:[(0,G.jsx)(KM,{size:14}),(0,G.jsx)(`span`,{className:`merge-conflict-name`,title:e,children:e})]}),(0,G.jsxs)(`div`,{className:`merge-conflict-actions`,children:[u>0&&(0,G.jsxs)(`span`,{className:`merge-conflict-status`,children:[u,` resolution`,u===1?``:`s`,` pending`]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:async()=>{let t=c??o.file;if(t){p(!0),h(null);try{let n=await fetch(`/api/save-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,content:t.contents,gitAdd:!0})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}_(!0),i()}catch(e){h(e.message)}finally{p(!1)}}},disabled:f||g,title:"Write the resolved file to disk and `git add` it",children:[f?(0,G.jsx)(YM,{size:11,className:`spin`}):g?(0,G.jsx)(FM,{size:11}):(0,G.jsx)(uN,{size:11}),(0,G.jsx)(`span`,{children:f?`Saving…`:g?`Saved + staged`:`Save & stage`})]})]})]}),m&&(0,G.jsxs)(`div`,{className:`merge-conflict-card-error`,role:`alert`,children:[(0,G.jsx)(PM,{size:14}),(0,G.jsx)(`span`,{children:m})]}),(0,G.jsx)(O_,{file:c??o.file,options:{disableFileHeader:!0,enableGutterUtility:!1,mergeConflictActionsType:`custom`,theme:{dark:a.type===`dark`?a.themeName:`nord`,light:a.type===`light`?a.themeName:`github-light`},themeType:a.type,unsafeCSS:`
2005
2005
  :host {
2006
2006
  --diffs-tab-size: ${r} !important;
2007
2007
  --diffs-font-family: var(--font-mono) !important;
2008
2008
  --diffs-font-size: ${n}px !important;
2009
2009
  --diffs-line-height: ${Math.round(n*1.7)}px !important;
2010
2010
  }
2011
- `},renderMergeConflictUtility:(e,t)=>{let n=t();return n&&(v.current=n),(0,G.jsx)(`div`,{className:`merge-conflict-buttons`,children:[`current`,`incoming`,`both`].map(t=>{let{label:n,icon:r,title:i}=aI[t];return(0,G.jsxs)(`button`,{type:`button`,className:`merge-conflict-btn merge-conflict-btn-${t}`,title:i,onClick:()=>y(e.conflictIndex,t),children:[(0,G.jsx)(r,{size:11}),(0,G.jsx)(`span`,{children:n})]},t)})})}})]})}),sI=`file-tree-container`,cI=`data-file-tree-style`,lI=`data-file-tree-unsafe-css`,uI=`data-file-tree-scrollbar-measure`,dI=`data-file-tree-scrollbar-gutter-measured`,fI=`--trees-scrollbar-gutter-measured`,pI=`header`,mI=`context-menu`,hI=`context-menu-trigger`,gI=typeof window>`u`?W.useEffect:W.useLayoutEffect;function _I(e,t,n){let r=e==null?null:(0,G.jsx)(`div`,{slot:pI,children:e}),i=t!=null&&n!=null?(0,G.jsx)(`div`,{slot:mI,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,G.jsxs)(G.Fragment,{children:[r,i]})}function vI(e,t){return typeof window>`u`&&t!=null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,G.jsx)(G.Fragment,{children:e})}function yI(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function bI(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function xI({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(null),u=(0,W.useRef)(n.getComposition()),d=(0,W.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,W.useCallback)(()=>{s(null)},[]),m=(0,W.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,W.useMemo)(()=>bI(h,e,f,p,m),[h,p,m,f,e]),_=(0,W.useCallback)(e=>{l(e)},[]);(0,W.useEffect)(()=>{f||s(null)},[f]),gI(()=>{n.setComposition(g)},[g,n]),gI(()=>{if(c!=null)return r!=null&&yI(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=vI(_I(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,G.jsx)(sI,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var SI=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2011
+ `},renderMergeConflictUtility:(e,t)=>{let n=t();return n&&(v.current=n),(0,G.jsx)(`div`,{className:`merge-conflict-buttons`,children:[`current`,`incoming`,`both`].map(t=>{let{label:n,icon:r,title:i}=bI[t];return(0,G.jsxs)(`button`,{type:`button`,className:`merge-conflict-btn merge-conflict-btn-${t}`,title:i,onClick:()=>y(e.conflictIndex,t),children:[(0,G.jsx)(r,{size:11}),(0,G.jsx)(`span`,{children:n})]},t)})})}})]})}),SI=`file-tree-container`,CI=`data-file-tree-style`,wI=`data-file-tree-unsafe-css`,TI=`data-file-tree-scrollbar-measure`,EI=`data-file-tree-scrollbar-gutter-measured`,DI=`--trees-scrollbar-gutter-measured`,OI=`header`,kI=`context-menu`,AI=`context-menu-trigger`,jI=typeof window>`u`?W.useEffect:W.useLayoutEffect;function MI(e,t,n){let r=e==null?null:(0,G.jsx)(`div`,{slot:OI,children:e}),i=t!=null&&n!=null?(0,G.jsx)(`div`,{slot:kI,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,G.jsxs)(G.Fragment,{children:[r,i]})}function NI(e,t){return typeof window>`u`&&t!=null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,G.jsx)(G.Fragment,{children:e})}function PI(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function FI(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function II({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(null),u=(0,W.useRef)(n.getComposition()),d=(0,W.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,W.useCallback)(()=>{s(null)},[]),m=(0,W.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,W.useMemo)(()=>FI(h,e,f,p,m),[h,p,m,f,e]),_=(0,W.useCallback)(e=>{l(e)},[]);(0,W.useEffect)(()=>{f||s(null)},[f]),jI(()=>{n.setComposition(g)},[g,n]),jI(()=>{if(c!=null)return r!=null&&PI(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=NI(MI(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,G.jsx)(SI,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var LI=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2012
2012
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
2013
2013
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
2014
2014
  </symbol>
@@ -2025,72 +2025,72 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
2025
2025
  <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
2026
2026
  <path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
2027
2027
  </symbol>
2028
- </svg>`,CI=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
2028
+ </svg>`,RI=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
2029
2029
  <path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
2030
2030
  <path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
2031
- </symbol>`,wI=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
2031
+ </symbol>`,zI=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
2032
2032
  <path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
2033
- </symbol>`,TI=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
2033
+ </symbol>`,BI=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
2034
2034
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
2035
2035
  <path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
2036
- </symbol>`,EI=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
2036
+ </symbol>`,VI=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
2037
2037
  <path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
2038
- </symbol>`,DI=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
2038
+ </symbol>`,HI=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
2039
2039
  <path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
2040
2040
  <path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
2041
- </symbol>`,OI=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
2041
+ </symbol>`,UI=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
2042
2042
  <path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
2043
2043
  <path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
2044
2044
  <path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
2045
- </symbol>`,kI=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
2045
+ </symbol>`,WI=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
2046
2046
  <path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
2047
- </symbol>`,AI=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
2047
+ </symbol>`,GI=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
2048
2048
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
2049
- </symbol>`,jI=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
2049
+ </symbol>`,KI=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
2050
2050
  <path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
2051
- </symbol>`,MI=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
2051
+ </symbol>`,qI=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
2052
2052
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
2053
- </symbol>`,NI=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
2053
+ </symbol>`,JI=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
2054
2054
  <path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
2055
2055
  <path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
2056
- </symbol>`,PI=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
2056
+ </symbol>`,YI=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
2057
2057
  <path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
2058
2058
  <path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
2059
2059
  <path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
2060
- </symbol>`,FI=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
2060
+ </symbol>`,XI=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
2061
2061
  <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
2062
2062
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
2063
- </symbol>`,II=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
2063
+ </symbol>`,ZI=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
2064
2064
  <path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
2065
2065
  <path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
2066
- </symbol>`,LI=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
2066
+ </symbol>`,QI=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
2067
2067
  <path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
2068
2068
  <path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
2069
- </symbol>`,RI=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
2069
+ </symbol>`,$I=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
2070
2070
  <path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
2071
- </symbol>`,zI=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
2071
+ </symbol>`,eL=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
2072
2072
  <path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
2073
- </symbol>`,BI=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
2073
+ </symbol>`,tL=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
2074
2074
  <path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
2075
- </symbol>`,VI=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
2075
+ </symbol>`,nL=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
2076
2076
  <path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
2077
- </symbol>`,HI=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
2077
+ </symbol>`,rL=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
2078
2078
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
2079
2079
  <path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
2080
- </symbol>`,UI=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
2080
+ </symbol>`,iL=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
2081
2081
  <path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
2082
2082
  <path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
2083
- </symbol>`,WI=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
2083
+ </symbol>`,aL=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
2084
2084
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
2085
2085
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
2086
- </symbol>`,GI=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
2086
+ </symbol>`,oL=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
2087
2087
  <path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
2088
- </symbol>`,KI=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
2088
+ </symbol>`,sL=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
2089
2089
  <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
2090
- </symbol>`,qI=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
2090
+ </symbol>`,cL=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
2091
2091
  <path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
2092
2092
  <path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
2093
- </symbol>`,JI=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
2093
+ </symbol>`,lL=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
2094
2094
  <defs>
2095
2095
  <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
2096
2096
  <stop stop-color="currentColor"/>
@@ -2100,82 +2100,82 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
2100
2100
  <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
2101
2101
  <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
2102
2102
  <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
2103
- </symbol>`,YI=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
2103
+ </symbol>`,uL=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
2104
2104
  <path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
2105
2105
  <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
2106
- </symbol>`,XI=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
2106
+ </symbol>`,dL=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
2107
2107
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
2108
- </symbol>`,ZI=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
2108
+ </symbol>`,fL=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
2109
2109
  <path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
2110
- </symbol>`,QI=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
2110
+ </symbol>`,pL=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
2111
2111
  <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
2112
2112
  <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
2113
2113
  <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
2114
2114
  <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
2115
- </symbol>`,$I=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
2115
+ </symbol>`,mL=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
2116
2116
  <path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
2117
2117
  <path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
2118
- </symbol>`,eL=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
2118
+ </symbol>`,hL=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
2119
2119
  <path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
2120
2120
  <path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
2121
- </symbol>`,tL=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
2121
+ </symbol>`,gL=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
2122
2122
  <path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
2123
- </symbol>`,nL=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
2123
+ </symbol>`,_L=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
2124
2124
  <path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
2125
- </symbol>`,rL=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
2125
+ </symbol>`,vL=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
2126
2126
  <path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
2127
- </symbol>`,iL=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
2127
+ </symbol>`,yL=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
2128
2128
  <path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
2129
2129
  <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
2130
- </symbol>`,aL=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
2130
+ </symbol>`,bL=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
2131
2131
  <path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
2132
- </symbol>`,oL=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
2132
+ </symbol>`,xL=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
2133
2133
  <path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
2134
2134
  <path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
2135
- </symbol>`,sL=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
2135
+ </symbol>`,SL=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
2136
2136
  <path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
2137
2137
  <path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
2138
- </symbol>`,cL=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
2138
+ </symbol>`,CL=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
2139
2139
  <path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
2140
- </symbol>`,lL=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
2140
+ </symbol>`,wL=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
2141
2141
  <path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
2142
2142
  <path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
2143
- </symbol>`,uL=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
2143
+ </symbol>`,TL=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
2144
2144
  <path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
2145
- </symbol>`,dL=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
2145
+ </symbol>`,EL=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
2146
2146
  <path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
2147
- </symbol>`,fL=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
2147
+ </symbol>`,DL=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
2148
2148
  <path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
2149
2149
  <path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
2150
- </symbol>`,pL=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
2150
+ </symbol>`,OL=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
2151
2151
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
2152
2152
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
2153
- </symbol>`,mL=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
2153
+ </symbol>`,kL=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
2154
2154
  <path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
2155
- </symbol>`,hL=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
2155
+ </symbol>`,AL=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
2156
2156
  <path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
2157
2157
  <path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
2158
2158
  <path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
2159
- </symbol>`,gL=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
2159
+ </symbol>`,jL=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
2160
2160
  <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
2161
2161
  <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
2162
- </symbol>`,_L=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
2162
+ </symbol>`,ML=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
2163
2163
  <path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
2164
2164
  <path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
2165
2165
  <path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
2166
- </symbol>`,vL=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
2166
+ </symbol>`,NL=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
2167
2167
  <path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
2168
2168
  <path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
2169
- </symbol>`,yL=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
2169
+ </symbol>`,PL=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
2170
2170
  <path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
2171
- </symbol>`,bL=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
2171
+ </symbol>`,FL=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
2172
2172
  <path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
2173
2173
  <path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
2174
- </symbol>`,xL=[TI,AI,MI,NI,PI,FI,RI,zI,BI,HI,UI,WI,GI,KI,qI,$I,tL,nL,cL,lL,fL,pL,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
2174
+ </symbol>`,IL=[BI,GI,qI,JI,YI,XI,$I,eL,tL,rL,iL,aL,oL,sL,cL,mL,gL,_L,CL,wL,DL,OL,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
2175
2175
  <path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
2176
2176
  <path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
2177
- </symbol>`],SL=[CI,wI,EI,DI,OI,kI,jI,II,LI,VI,JI,YI,XI,ZI,QI,eL,rL,iL,aL,oL,sL,uL,dL,mL,hL,gL,_L,vL,yL,bL];function CL(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
2178
- `)}\n</svg>`)}var wL=CL(SI,xL),TL={minimal:SI,standard:wL,complete:CL(wL,SL)},EL={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},DL={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},OL={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},kL=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),AL=new Set([`complete`]);function jL(e){return TL[e===`none`?`minimal`:e]}function ML(e){return`file-tree-builtin-${e}`}function NL(e){return e!==`none`&&AL.has(e)}function PL(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=EL[t.toLowerCase()];if(i!=null&&(r||kL.has(i)))return i;for(let e of n){if(r){let t=OL[e];if(t!=null)return t}let t=DL[e];if(t!=null&&(r||kL.has(t)))return t}return`default`}function FL(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function IL(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(FL(e)?`none`:`complete`),colored:e.colored??!0}}var LL={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function RL(e,t){if(typeof e==`number`)return{itemHeight:t??LL.default.itemHeight,factor:e};let n=LL[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var zL=LL.default.itemHeight,BL=`@layer base, theme, unsafe;
2177
+ </symbol>`],LL=[RI,zI,VI,HI,UI,WI,KI,ZI,QI,nL,lL,uL,dL,fL,pL,hL,vL,yL,bL,xL,SL,TL,EL,kL,AL,jL,ML,NL,PL,FL];function RL(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
2178
+ `)}\n</svg>`)}var zL=RL(LI,IL),BL={minimal:LI,standard:zL,complete:RL(zL,LL)},VL={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},HL={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},UL={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},WL=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),GL=new Set([`complete`]);function KL(e){return BL[e===`none`?`minimal`:e]}function qL(e){return`file-tree-builtin-${e}`}function JL(e){return e!==`none`&&GL.has(e)}function YL(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=VL[t.toLowerCase()];if(i!=null&&(r||WL.has(i)))return i;for(let e of n){if(r){let t=UL[e];if(t!=null)return t}let t=HL[e];if(t!=null&&(r||WL.has(t)))return t}return`default`}function XL(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function ZL(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(XL(e)?`none`:`complete`),colored:e.colored??!0}}var QL={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function $L(e,t){if(typeof e==`number`)return{itemHeight:t??QL.default.itemHeight,factor:e};let n=QL[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var eR=QL.default.itemHeight,tR=`@layer base, theme, unsafe;
2179
2179
 
2180
2180
  @layer base {
2181
2181
  :host {
@@ -3839,18 +3839,49 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
3839
3839
  }
3840
3840
  }
3841
3841
  }
3842
- `,VL=`@layer base, unsafe;`;function HL(e){return`${VL}
3842
+ `,nR=`@layer base, unsafe;`;function rR(e){return`${nR}
3843
3843
  @layer base {
3844
3844
  ${e}
3845
- }`}function UL(e){return`${VL}
3845
+ }`}function iR(e){return`${nR}
3846
3846
  @layer unsafe {
3847
3847
  ${e}
3848
- }`}var WL=new WeakMap;function GL(e){let t=WL.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(uI,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),WL.set(e,i),i}function KL(e,t){if(!e.isConnected)return;let n=GL(t);if(n==null)return;let r=t.querySelector(`style[${dI}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(dI,``),t.appendChild(i)),i.textContent=`:host { ${fI}: ${n}px; }`}var qL;function JL(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){qL??(qL=new CSSStyleSheet,qL.replaceSync(HL(BL)));let t=!1;try{e.adoptedStyleSheets=[qL],t=!0}catch{}if(t){e.querySelector(`style[${cI}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(cI,``),t.textContent=HL(BL),e.prepend(t)}}function YL(e,t){XL(e,t),JL(t),KL(e,t)}function XL(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});YL(this,e)}}if(customElements.define(sI,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(sI)))e instanceof HTMLElement&&YL(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var ZL=5,QL=1<<ZL,$L=QL*4;function eR(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function tR(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function nR(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function rR(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function iR(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function aR(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function oR(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,uR(e,t)}function sR(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=rR(e).get(t);if(i===void 0)return;let a=i>>ZL;e.childVisibleChunkSums[a]+=r}function cR(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=dR(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=QL}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function lR(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>ZL;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<ZL}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function uR(e,t){if(t.childIds.length<$L){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/QL),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>ZL]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function dR(e,t,n,r){let i=Math.min(t.childIds.length,n+QL),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var fR=7,pR=3,mR=1<<pR,hR=4;function gR(e,t,n=0){return e<<hR|n<<pR|t}function _R(e){return e.depthAndFlags>>>hR}function vR(e){return(e.depthAndFlags&mR)>>pR}function yR(e){return(e.depthAndFlags&mR)!==0}function bR(e){return e.depthAndFlags&fR}function xR(e,t){return(bR(e)&t)!==0}function SR(e,t){e.depthAndFlags|=t}function CR(e,t){e.depthAndFlags=gR(t,bR(e),vR(e))}var wR=Symbol(`benchmarkInstrumentation`);function TR(e,t){return t==null||Object.defineProperty(e,wR,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function ER(e){return e==null?null:e[wR]??null}function Q(e,t,n){return e==null?n():e.measurePhase(t,n)}function DR(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function OR(e){return e>=48&&e<=57}function kR(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!OR(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&OR(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function AR(e){let t=e.toLowerCase();return{lowerValue:t,tokens:kR(t)}}function jR(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function MR(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=jR(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function NR(e,t,n){let r=MR(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function PR(e,t){return NR(e,t,AR)}function FR(e,t){return t===e.segments.length-1?e.isDirectory?1:0:1}function IR(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=FR(e,r);return a===FR(t,r)?PR(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function LR(e,t){return IR(e,t)}function RR(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=AR(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=FR(e,n);return o===FR(t,n)?NR(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function zR(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=AR(r);return e.sortKeyById[t]=i,i}function BR(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function VR(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function HR(e){let{hasTrailingSlash:t,segments:n}=VR(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function UR(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=VR(e);return{requiresDirectory:t,segments:n}}var WR=``;function GR(){let e=new Map;return e.set(WR,0),{idByValue:e,valueById:[WR],sortKeyById:[AR(WR)]}}function KR(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function qR(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var JR=Symbol(`pathStorePreparedInputKind`);function YR(e,t){return e[JR]=t,e}function XR(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function ZR(e,t,n){return n===`default`?LR(e,t):n(XR(e),XR(t))}function QR(){return{depthAndFlags:gR(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function $R(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function ez(e){return e.isDirectory?e.segments.length:e.segments.length-1}function tz(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function nz(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function rz(e,t={}){return lz(e,t).map(e=>e.path)}function iz(e,t={}){let n=lz(e,t);return YR({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function az(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return YR({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function oz(e){let t=e,n=t.preparedPaths;if(t[JR]===`prepared`&&n!=null)return n;if(!tz(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function sz(e){let t=e;return t[JR]===`presorted`&&t.presortedPaths!=null||nz(t.presortedPaths)?t.presortedPaths:null}function cz(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function lz(e,t={}){let n=BR(t),r=ER(t);DR(r,`workload.inputFiles`,e.length);let i=Q(r,`store.preparePathEntries.parse`,()=>e.map(e=>HR(e)));return Q(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>ZR(e,t,n.sort))),i}var uz=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[QR()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=GR();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=ER(e),this.options=BR(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,eR())}appendPaths(e){return Q(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>HR(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Q(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Q(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:gR(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:gR(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:gR(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=HR(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:gR(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:gR(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=HR(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Q(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Q(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?RR(this.lastPreparedPath,e,this.segmentSortKeyCache):ZR(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=ez(e),i=n==null?0:ez(n),a=n==null?0:$R(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=KR(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:gR(_R(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),iR(i,s),s}createFileChildUnchecked(e,t){let n=KR(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:gR(_R(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),iR(r,a),a}getOrCreateDirectoryChild(e,t){let n=KR(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!yR(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:gR(_R(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),iR(r,a),this.directories.set(a,eR()),a}createDirectoryChild(e,t){let n=KR(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:gR(_R(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),iR(r,a),this.directories.set(a,eR()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!yR(n))throw Error(`Path is not a directory: "${t}"`);if(xR(n,1))throw Error(`Duplicate path: "${t}"`);SR(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,tR());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(yR(a)){let t=tR();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;yR(n)&&this.directories.set(t,eR());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),iR(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!yR(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return oR(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function dz(e,t=`closed`,n=null){let r=pz(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function fz(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function pz(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function mz(e,t){return xR(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:_R(t)<=e.defaultExpansion}function hz(e,t,n=e.snapshot.nodes[t]){return n==null||!yR(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:mz(e,n)}function gz(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!yR(r))return;let i=mz(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function _z(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function vz(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function yz(e,t){let n=_z(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function bz(e,t){let n=_z(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function xz(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Sz(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Cz(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function wz(e,t){e.directoryLoadInfoById.delete(t)}function Tz(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Ez(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Dz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Oz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function kz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Az(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function jz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Mz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Nz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Pz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Fz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Iz(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Lz(e,t,n){return{...n,visibleCountDelta:Jz(e)-t}}function Rz(e,t){let n=Jz(e),r=fz();e.transactionStack.push(r);try{t()}catch(t){throw Vz(e,r,!1),t}Vz(e,r,!0,Jz(e)-n)}function zz(e,t){let n=e.instrumentation;if(n==null){Bz(e,t);return}Q(n,`store.events.record`,()=>Bz(e,t))}function Bz(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Kz(e,t);return}n.events.push(t),Gz(n,t)}function Vz(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?Wz(i,t):Q(n,`store.events.batch.merge`,()=>Wz(i,t));return}let a=Hz(t,r),o=e.instrumentation;if(o==null){Kz(e,a);return}Q(o,`store.events.batch.commit`,()=>Kz(e,a))}function Hz(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function Uz(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Wz(e,t){for(let n of t.events)e.events.push(n);Uz(e,t)}function Gz(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Kz(e,t){let n=e.instrumentation;if(n==null){qz(e,t);return}Q(n,`store.events.emit`,()=>qz(e,t))}function qz(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Jz(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Yz(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!yR(n)||xR(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!yR(a)?null:i}function Xz(e,t){let n=t;for(;;){let t=Yz(e,n);if(t==null)return n;n=t}}function Zz(e,t){let n=[t],r=t;for(;;){let t=Yz(e,r);if(t==null)return n;n.push(t),r=t}}function Qz(e,t){let n=t==null?e.snapshot.rootId:cB(e,t);return n==null?[]:fB(e,n)}function $z(e,t){let n=HR(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=DB(e,EB(e,r)),{createdNodeIds:a,directoryId:o}=pB(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=dB(e,o);if(xR(n,1))throw Error(`Path already exists: "${t}"`);SR(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=hB(e,o,n.basename),s.add(c);aB(e,o);let l=DB(e,o);return Ez({affectedAncestorIds:sB(e,c),affectedNodeIds:[...s],path:t,projectionChanged:OB(i,l)})}function eB(e,t,n){let r=cB(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=dB(e,r);if(xR(i,2))throw Error(`The root node cannot be removed`);if(yR(i)&&uB(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=DB(e,a),s=wB(e,r);vB(e,a,r,i.nameId),TB(e,a),aB(e,a);let c=DB(e,a);return Dz({affectedAncestorIds:sB(e,a),affectedNodeIds:s,path:t,projectionChanged:OB(o,c),recursive:n.recursive===!0})}function tB(e,t,n,r){let i=cB(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=dB(e,i);if(xR(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=SB(e,i,n),c=DB(e,a.parentId),l=DB(e,s.parentId),u=qR(e.snapshot.segmentTable,a.nameId),d=KR(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(yR(a)&&MB(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=nR(e.snapshot.nodes,uB(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&CB(e,p,o,vR(a))===`skip`)return null;let m=a.parentId;vB(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),jB(e,i),_B(e,s.parentId,i),TB(e,m),e.pathCacheVersion++,aB(e,m),s.parentId!==m&&aB(e,s.parentId);let h=DB(e,m),g=DB(e,s.parentId);return Oz({affectedAncestorIds:[...new Set([...sB(e,m),...sB(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:kB([c,l],[h,g]),to:iB(e,i)})}function nB(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function rB(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function iB(e,t){let n=dB(e,t),r=nB(e,t);if(r!=null)return r;if(xR(n,2))return rB(e,t,``);let i=iB(e,n.parentId),a=qR(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return rB(e,t,yR(n)?`${o}/`:o)}function aB(e,t){let n=e.instrumentation;if(n==null){PB(e,t);return}Q(n,`store.recomputeCountsUpwardFrom`,()=>PB(e,t))}function oB(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!yR(o)){NB(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){NB(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function sB(e,t){let n=[],r=t;for(;r!=null;){let t=dB(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function cB(e,t){if(t.length===0)return e.snapshot.rootId;let n=UR(t);return lB(e,n.segments,n.requiresDirectory)}function lB(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=uB(e,r),a=nR(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=dB(e,r);return n&&!yR(i)?null:r}function uB(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function dB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||xR(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function fB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||xR(n,4))return[];if(!yR(n))return[iB(e,t)];if(uB(e,t).childIds.length===0)return xR(n,1)&&!xR(n,2)?[iB(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||xR(n,4)){i.pop();continue}if(!yR(n)){r.push(iB(e,t.nodeId)),i.pop();continue}let a=uB(e,t.nodeId);if(a.childIds.length===0){xR(n,1)&&!xR(n,2)&&r.push(iB(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function pB(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=KR(e.snapshot.segmentTable,i),a=uB(e,r),o=nR(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!yR(dB(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=mB(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function mB(e,t,n){let r=dB(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:gR(_R(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,eR()),_B(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function hB(e,t,n){let r=KR(e.snapshot.segmentTable,n),i=uB(e,t);if(nR(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${IB(e,t,n)}"`);let a=dB(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:gR(_R(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),_B(e,t,o),e.activeNodeCount++,o}function gB(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}yB(e,n,o)<0?i=a:r=a+1}return r}function _B(e,t,n){let r=uB(e,t),i=dB(e,n);nR(e.snapshot.nodes,r).set(i.nameId,n),sR(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=gB(e,r,n);r.childIds.splice(a,0,n),aR(r,a),uR(e.snapshot.nodes,r)}function vB(e,t,n,r){let i=uB(e,t),a=rR(i),o=a.get(n)??-1;nR(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&sR(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),aR(i,o),uR(e.snapshot.nodes,i))}function yB(e,t,n){let r=e.snapshot.options.sort;return r===`default`?bB(e,t,n):r(xB(e,t),xB(e,n))}function bB(e,t,n){let r=dB(e,t),i=dB(e,n),a=yR(r);if(a!==yR(i))return a?-1:1;let o=MR(zR(e.snapshot.segmentTable,r.nameId),zR(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=qR(e.snapshot.segmentTable,r.nameId),c=qR(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function xB(e,t){let n=dB(e,t),r=iB(e,t),i=yR(n),a=i?r.slice(0,-1):r;return{basename:qR(e.snapshot.segmentTable,n.nameId),depth:_R(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function SB(e,t,n){let r=dB(e,t),i=cB(e,n);if(i!=null){let t=dB(e,i);if(yR(t))return{basename:qR(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=UR(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=UR(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:lB(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function CB(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${iB(e,t)}"`);let i=dB(e,t);if(vR(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(yR(i)&&uB(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return wB(e,t),vB(e,a,t,o),TB(e,a),aB(e,a),`handled`}function wB(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=dB(e,t.nodeId);if(t.visitedChildren||!yR(i)){yR(i)&&e.snapshot.directories.delete(t.nodeId),SR(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),wz(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=uB(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function TB(e,t){let n=t;for(;n!=null;){let t=dB(e,n);if(!yR(t)||xR(t,2)||uB(e,n).childIds.length>0)return;SR(t,1),n=t.parentId===n?null:t.parentId}}function EB(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=nR(e.snapshot.nodes,uB(e,n)).get(t);if(i==null||!yR(dB(e,i)))break;n=i}return n}function DB(e,t){let n=AB(e,t);if(n==null)return null;let r=Xz(e,n),i=dB(e,r),a=n===r?null:Zz(e,n).map(t=>iB(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:uB(e,r).childIds.length>0,path:iB(e,r),terminalKind:vR(i)})}function OB(e,t){return kB([e],[t])}function kB(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function AB(e,t){let n=t;for(;n!=null;){let t=dB(e,n);if(!yR(t)||xR(t,2))return null;if(!hz(e,n,t))return n;n=t.parentId}return null}function jB(e,t){let n=dB(e,t);if(CR(n,(t===e.snapshot.rootId?-1:_R(dB(e,n.parentId)))+1),!yR(n))return;let r=uB(e,t);for(let t of r.childIds)jB(e,t)}function MB(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=dB(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function NB(e,t,n=dB(e,t),r=!1){let i=e.instrumentation;if(i==null){FB(e,t,n,r);return}Q(i,`store.recomputeNodeCounts`,()=>FB(e,t,n,r))}function PB(e,t){let n=t;for(;n!=null;){let t=dB(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(NB(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&sR(uB(e,s),n,a,o),n=s}}function FB(e,t,n,r){if(!yR(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=uB(e,t);if(r){let t=e.instrumentation;t==null?oR(e.snapshot.nodes,i):Q(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>oR(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,xR(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Yz(e,t)==null?hz(e,t,n)?1+o:1:o}function IB(e,t,n){let r=iB(e,t);return r.length===0?n:`${r}${n}`}function LB(e){return e!=null&&!xR(e,4)}function RB(e,t){let n=e.snapshot.nodes[t];return!LB(n)||!yR(n)||xR(n,2)?null:n}function zB(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&LB(e.snapshot.nodes[n])&&(t+=1);return t}function BB(e){return Math.max(0,e.valueById.length-1)}function VB(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:zB(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:BB(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function HB(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function UB(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)RB(e,n)!=null&&t.push(iB(e,n));for(let t of e.expandedDirectoryIds)RB(e,t)!=null&&n.push(iB(e,t));return{collapsedPaths:t,expandedPaths:n}}function WB(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)RB(e,n)==null||vz(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:iB(e,n)});return t}function GB(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=cB(e,n);t!=null&&gz(e,t,!0,dB(e,t))}for(let n of t.collapsedPaths){let t=cB(e,n);t!=null&&gz(e,t,!1,dB(e,t))}}function KB(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=cB(e,n.path);t!=null&&RB(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function qB(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function JB(e){let t=e.snapshot.segmentTable,n=GR();for(let r of e.snapshot.nodes)if(LB(r)){if(xR(r,2)){r.nameId=0;continue}r.nameId=KR(n,qR(t,r.nameId))}e.snapshot.segmentTable=n}function YB(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!LB(r)||!yR(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return LB(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[dB(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),oR(e.snapshot.nodes,n)}}function XB(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(LB(n))break;--t}e.snapshot.nodes.length=t+1}function ZB(e){let t=UB(e),n=WB(e);Q(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>qB(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>JB(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>YB(e)),Q(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>XB(e)),Q(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>GB(e,t)),Q(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>KB(e,n)),Q(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>oB(e,e.snapshot.rootId))}function QB(e){let t=UB(e),n=WB(e),r=Q(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Qz(e)),i=TR({...e.snapshot.options},e.instrumentation),a=Q(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new uz(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,Q(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>GB(e,t)),Q(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>KB(e,n)),Q(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>oB(e,e.snapshot.rootId))}function $B(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function eV(e,t){let n=VB(e);t===`stable`?Q(e.instrumentation,`store.cleanup.stable`,()=>ZB(e)):Q(e.instrumentation,`store.cleanup.aggressive`,()=>QB(e));let r=VB(e);return HB(t,t===`stable`,n,r)}var tV=64;function nV(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function rV(e){return dB(e,e.snapshot.rootId).visibleSubtreeCount}function iV(e,t,n,r){let i=dB(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function aV(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:wV(e,t.cursor),setSize:t.setSize,subtreeEndIndex:iV(e,t.cursor,t.index,n)}}function oV(e,t,n,r,i,a){let o=uB(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=cR(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return sV(e,u,l,r+c,i+1,s,o.childIds.length,a)}function sV(e,t,n,r,i,a,o,s){if(!yR(dB(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=vV(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=dB(e,c.terminalNodeId);if(!yR(l)||!hz(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return oV(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function cV(e,t){let n=rV(e);if(t<0||t>=n)return null;let r=oV(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>iB(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=aV(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:wV(e,r.cursor),setSize:r.setSize,subtreeEndIndex:iV(e,r.cursor,r.index,n)}}function lV(e,t,n){let r=e.instrumentation,i=rV(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return CV(e,o+1);let t=[],n=hV(e,a);for(let r=a;r<=o&&n!=null;r++){let r=wV(e,n);t.push(r),n=bV(e,n)}return t}let s=[],c=0,l=0,u=Q(r,`store.getVisibleSlice.selectFirstRow`,()=>hV(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Q(r,`store.getVisibleSlice.materializeRow`,()=>wV(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Q(r,`store.getVisibleSlice.advanceCursor`,()=>bV(e,u))}return DR(r,`workload.visibleRowsRead`,s.length),DR(r,`workload.flattenedRowsRead`,c),DR(r,`workload.flattenedSegmentsRead`,l),s}function uV(e,t=rV(e)){let n=e.instrumentation;return n==null?SV(e,t):Q(n,`store.getVisibleTreeProjection`,()=>SV(e,t))}function dV(e){return xV(uV(e))}function fV(e,t){let n=cB(e,t);if(n==null||n===e.snapshot.rootId||yR(dB(e,n))&&Xz(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=dB(e,i).parentId,n=uB(e,t),s=rR(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=lR(a,n,s),t!==o){let n=dB(e,t),a=Yz(e,t);if(!hz(e,t,n)&&a!==i)return null;Xz(e,t)===t&&(r+=1)}i=t}return r}function pV(e,t){let n=cB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=dB(e,n);if(!yR(r))throw Error(`Path is not a directory: "${t}"`);return hz(e,n,r)?null:(gz(e,n,!0,r),aB(e,n),kz({affectedAncestorIds:sB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function mV(e,t){let n=cB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=dB(e,n);if(!yR(r))throw Error(`Path is not a directory: "${t}"`);return hz(e,n,r)?(gz(e,n,!1,r),aB(e,n),Az({affectedAncestorIds:sB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function hV(e,t){return t<0||t>=rV(e)?null:gV(e,e.snapshot.rootId,t,-1)}function gV(e,t,n,r){let i=uB(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?cR(e.snapshot.nodes,i,n):Q(a,`store.getVisibleSlice.selectChildIndex`,()=>cR(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return _V(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function _V(e,t,n,r){if(!yR(dB(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=vV(e,t,r);if(n===0)return i;let a=dB(e,i.terminalNodeId);if(!yR(a)||!hz(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return gV(e,i.terminalNodeId,n-1,i.visibleDepth)}function vV(e,t,n){return yR(dB(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Xz(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Q(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Xz(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function yV(e,t){let n=dB(e,t);if(!yR(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:Yz(e,r)!==t}function bV(e,t){let n=dB(e,t.terminalNodeId);if(yR(n)){let r=uB(e,t.terminalNodeId);if(hz(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:_V(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=dB(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=uB(e,n),o=rR(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return _V(e,s,0,i);yV(e,r)&&i--,r=n}}function xV(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function SV(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(tV);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=nV(o,y);let x,S=_;if(yR(v))S=f?Xz(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:iB(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&yR(C)&&hz(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function CV(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!yR(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:iB(e,f)};continue}let h=l?Xz(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=wV(e,g);let _=i[h];_!=null&&yR(_)&&hz(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function wV(e,t){let n=dB(e,t.terminalNodeId),r=yR(n)?TV(e,t):null,i=iB(e,t.terminalNodeId),a=qR(e.snapshot.segmentTable,n.nameId),o=yR(n)&&uB(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?Zz(e,t.headNodeId).map(n=>{let r=dB(e,n);return{isTerminal:n===t.terminalNodeId,name:qR(e.snapshot.segmentTable,r.nameId),nodeId:n,path:iB(e,n)}}):Q(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Zz(e,t.headNodeId).map(n=>{let r=dB(e,n);return{isTerminal:n===t.terminalNodeId,name:qR(e.snapshot.segmentTable,r.nameId),nodeId:n,path:iB(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:yR(n)&&hz(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:yR(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function TV(e,t){if(t.headNodeId===t.terminalNodeId)return vz(e,t.terminalNodeId);let n=Zz(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=vz(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function EV(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!yR(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&uR(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&yR(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,uR(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function DV(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var OV=class e{#e;constructor(e={}){let t=ER(e),n=Q(t,`store.builder.create`,()=>new uz(e));if(e.preparedInput!=null){let t=sz(e.preparedInput);t==null?n.appendPreparedPaths(oz(e.preparedInput),!1):n.appendPresortedPaths(t,cz(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Q(t,`store.preparePathEntries`,()=>lz(r,e)))}let r=Q(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Q(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Q(t,`store.state.create`,()=>dz(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Q(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||DV(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Q(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?Q(t,`store.state.initializeOpenVisibleCounts`,()=>EV(this.#e)):Q(t,`store.state.recomputeCounts`,()=>oB(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return rz(e,t)}static prepareInput(e,t={}){return iz(e,t)}static preparePresortedInput(e){return az(e)}list(e){return Q(this.#e.instrumentation,`store.list`,()=>Qz(this.#e,e))}add(e){Q(this.#e.instrumentation,`store.add`,()=>{let t=rV(this.#e);zz(this.#e,Lz(this.#e,t,$z(this.#e,e)))})}remove(e,t={}){Q(this.#e.instrumentation,`store.remove`,()=>{let n=rV(this.#e);zz(this.#e,Lz(this.#e,n,eB(this.#e,e,t)))})}move(e,t,n={}){Q(this.#e.instrumentation,`store.move`,()=>{let r=rV(this.#e),i=tB(this.#e,e,t,n);i!=null&&zz(this.#e,Lz(this.#e,r,i))})}batch(e){Rz(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return Q(this.#e.instrumentation,`store.getVisibleCount`,()=>rV(this.#e))}getVisibleSlice(e,t){return Q(this.#e.instrumentation,`store.getVisibleSlice`,()=>lV(this.#e,e,t))}getVisibleRowContext(e){return Q(this.#e.instrumentation,`store.getVisibleRowContext`,()=>cV(this.#e,e))}getVisibleTreeProjection(){return dV(this.#e)}getVisibleTreeProjectionData(e){return uV(this.#e,e)}getVisibleIndex(e){return Q(this.#e.instrumentation,`store.getVisibleIndex`,()=>fV(this.#e,e))}getPathInfo(e){return Q(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=cB(this.#e,e);if(t==null)return null;let n=dB(this.#e,t);return{depth:_R(n),kind:yR(n)?`directory`:`file`,path:iB(this.#e,t)}})}isExpanded(e){return Q(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=dB(this.#e,t);return hz(this.#e,t,n)})}expand(e){Q(this.#e.instrumentation,`store.expand`,()=>{let t=rV(this.#e),n=pV(this.#e,e);n!=null&&zz(this.#e,Lz(this.#e,t,n))})}collapse(e){Q(this.#e.instrumentation,`store.collapse`,()=>{let t=rV(this.#e),n=mV(this.#e,e);n!=null&&zz(this.#e,Lz(this.#e,t,n))})}on(e,t){return Tz(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return vz(this.#e,t)}markDirectoryUnloaded(e){Q(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(uB(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=rV(this.#e);bz(this.#e,t),zz(this.#e,Lz(this.#e,n,jz({affectedAncestorIds:sB(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Q(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=rV(this.#e),r=yz(this.#e,t);return zz(this.#e,Lz(this.#e,n,Mz({affectedAncestorIds:sB(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Q(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||vz(this.#e,n)!==`loading`||!Sz(this.#e,n,e.attemptId))return!1;let r=iB(this.#e,n);this.validateChildPatch(r,t);let i=rV(this.#e),a=[];for(let e of t.operations){kV(r,e);let t=rV(this.#e);switch(e.type){case`add`:a.push(Lz(this.#e,t,$z(this.#e,e.path)));break;case`remove`:a.push(Lz(this.#e,t,eB(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=tB(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Lz(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return zz(this.#e,Lz(this.#e,i,Nz({affectedAncestorIds:sB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:iB(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Q(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=rV(this.#e),r=xz(this.#e,t,e.attemptId);return zz(this.#e,Lz(this.#e,n,Pz({affectedAncestorIds:sB(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:iB(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Q(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=rV(this.#e),i=Cz(this.#e,n,e.attemptId,t);return zz(this.#e,Lz(this.#e,r,Fz({affectedAncestorIds:sB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:iB(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Q(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if($B(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=rV(this.#e),n=eV(this.#e,e.mode??`stable`);return zz(this.#e,Lz(this.#e,t,Iz({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=uB(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??AR(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=MR(zR(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!yR(dB(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=dB(this.#e,n);hz(this.#e,n,i)||(gz(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=dB(this.#e,e);if(!hz(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=cB(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!yR(dB(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!yR(dB(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=dB(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=dB(this.#e,e),r=Yz(this.#e,e);if(!hz(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function kV(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var AV=e=>e.startsWith(`f::`)?e.slice(3):e;function jV(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function MV(e,t){return e===``?t:`${e}/${t}`}function NV({files:e,path:t,isFolder:n,nextBasename:r}){let i=AV(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=jV(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=MV(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function PV(e){return e.endsWith(`/`)}function FV(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function IV(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function LV(e,t){return t.includes(e)?IV(t):[e]}function RV(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function zV(e,t){return{draggedPaths:e,target:t}}function BV(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(PV(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function VV(e,t){return t.kind===`root`||t.directoryPath==null?FV(e):t.directoryPath}function HV(e,t){let n=e.map(e=>{let n=VV(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function UV(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function WV(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!UV(OV.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function GV(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function KV(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function qV(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function JV(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return qV(e,t.path)?n?e:null:e;case`move`:return KV(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=JV(r,e,n),r==null)return null;return r}}}function YV(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function XV(e){switch(e.operation){case`add`:return{...YV(e),operation:`add`,path:e.path};case`remove`:return{...YV(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...YV(e),from:e.from,operation:`move`,to:e.to}}}function ZV(e){return{...YV(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>XV(e)),operation:`batch`}}function QV(e){switch(e.operation){case`add`:case`remove`:case`move`:return XV(e);case`batch`:return ZV(e);default:return null}}function $V(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function eH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function tH(e){return eH(e).at(-1)??null}function nH(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function rH(e){return e.endsWith(`/`)}var iH=e=>e.toLowerCase();function aH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function oH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function sH(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var cH=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},lH=Symbol(`FILE_TREE_RENAME_VIEW`),uH=512,dH=512;function fH(e){return e===`top`||e===`center`?e:`nearest`}function pH(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=eH(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function mH(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:pH(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var hH=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=WV({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=tH(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:fH(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=dH){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=LV(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=zV(t.draggedPaths,n);(BV(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}RV(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=zV(e.draggedPaths,t);if(BV(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=HV(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=rH(r),a=oH(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of eH(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=aH(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[lH](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,rH(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,rH(e)?{recursive:!0}:void 0);return}let t=rH(e),n=NV({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:oH(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(sH(n.sourcePath,t),sH(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=WV({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!$V(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=tH(e),n=nH(e,t),r=null,i=null;for(let e of this.#be()){if(tH(e)!==t)continue;let a=nH(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=eH(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!$V(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new OV({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of eH(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(iH),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(iH),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of eH(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:cH(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of eH(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of eH(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=mH(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,uH)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=JV(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=JV(this.#c,e,!0),r=[...this.#B].map(t=>JV(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=JV(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return $V(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&GV(e)&&(this.#i=null);let t=GV(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=QV(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},gH=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function _H(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function vH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function yH(e,t){return t?`${e}/`:e}function bH(e,t=null){let n=gH(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=_H(t.path);if(e==null)continue;let n=yH(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of vH(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var xH=e=>e.trim().toLowerCase(),SH=e=>e.split(`/`).at(-1)??e,CH=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function wH(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function TH(e){let t=IL(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(xH(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=SH(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return wH(c,e);for(let[t,n]of a)if(s.includes(t))return wH(n,e);let l=CH(n);for(let t of l){let n=i.get(t);if(n!=null)return wH(n,e)}let u=PL(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:ML(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:wH(s,e)}}}var EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH={},LH=[],RH=Array.isArray,zH=LH.slice,BH=Object.assign;function VH(e){e&&e.parentNode&&e.remove()}function HH(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?zH.call(arguments,2):n),UH(e,o,r,i,null)}function UH(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++DH,__i:-1,__u:0};return i==null&&EH.vnode!=null&&EH.vnode(a),a}function WH(e){return e.children}function GH(e,t){this.props=e,this.context=t,this.__g=0}function KH(e,t){if(t==null)return e.__?KH(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?KH(e):null}function qH(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return qH(e)}}function JH(e){(8&e.__g||!(e.__g|=8)||!OH.push(e)||AH++)&&kH==EH.debounceRendering||((kH=EH.debounceRendering)||queueMicrotask)(YH)}function YH(){for(var e,t,n,r,i,a,o,s,c=1;OH.length;)OH.length>c&&OH.sort(jH),e=OH.shift(),c=OH.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=BH({},r)).__v=r.__v+1,EH.vnode&&EH.vnode(n),rU(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??KH(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,aU(a,n,o),n.__e!=i&&qH(n)));AH=0}function XH(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||LH,b=t.length;for(c=ZH(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?IH:y[m.__i]||IH,m.__i=f,_=rU(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&cU(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=QH(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function ZH(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?UH(null,o,null,null,null):RH(o)?UH(WH,{children:o},null,null,null):o.constructor==null&&o.__b>0?UH(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=$H(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=KH(s)),lU(s,s));return r}function QH(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=QH(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=KH(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function $H(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function eU(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function tU(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||eU(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||eU(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(MH,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=NH,e.addEventListener(t,a?FH:PH,a)):e.removeEventListener(t,a?FH:PH,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function nU(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=NH++;else if(t.u<n.l)return;return n(EH.event?EH.event(t):t)}}}function rU(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=EH.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new GH(v,x),f.constructor=M,f.render=uU),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=BH({},f.__s)),BH(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=EH.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=BH({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===WH&&d.key==null&&(E=oU(d.props.children)),s=XH(e,RH(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)VH(a[j]);iU(t)}else t.__e=n.__e,t.__k=n.__k,e.then||iU(t);EH.__e(e,t,n)}else s=t.__e=sU(n.__e,t,n,r,i,a,o,c,l,u);return(d=EH.diffed)&&d(t),128&t.__u?void 0:s}function iU(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(iU)}function aU(e,t,n){for(var r=0;r<n.length;r++)cU(n[r],n[++r],n[++r]);EH.__c&&EH.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){EH.__e(e,t.__v)}})}function oU(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:RH(e)?e.map(oU):BH({},e)}function sU(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(EH.__m&&EH.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=zH.call(e.childNodes),v=n.props||IH,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;tU(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||tU(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),XH(b==`template`?e.content:e,RH(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&KH(n,0),s,c,l),a!=null)for(u=a.length;u--;)VH(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||tU(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&tU(e,u,g,v[u],i))}return e}function cU(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){EH.__e(e,n)}}function lU(e,t,n){var r,i;if(EH.unmount&&EH.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||cU(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){EH.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&lU(r[i],t,n||typeof e.type!=`function`);n||VH(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function uU(e,t,n){return this.constructor(e,n)}function dU(e,t){var n,r,i,a;t==document&&(t=document.documentElement),EH.__&&EH.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=HH(WH,null,[e]),i=[],a=[],rU(t,e,r||IH,IH,t.namespaceURI,r?null:t.firstChild?zH.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),aU(i,e,a)}function fU(e,t){e.__u|=32,dU(e,t)}EH={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw AH=0,e}},DH=0,GH.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=BH({},this.state);typeof e==`function`&&(e=e(BH({},n),this.props)),e&&BH(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),JH(this))},GH.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),JH(this))},GH.prototype.render=WH,OH=[],AH=0,jH=function(e,t){return e.__v.__b-t.__v.__b},MH=/(PointerCapture)$|Capture$/i,NH=0,PH=nU(!1),FH=nU(!0);var pU=0;Array.isArray;function $(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--pU,__i:-1,__u:0,__source:i,__self:a};return EH.vnode&&EH.vnode(l),l}var mU=16,hU=16,gU={};function _U({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=gU[e]??{width:mU,height:hU},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`,h=o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`};return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...h,viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var vU=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},yU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},bU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},xU=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},SU=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},CU=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function wU({children:e,marker:t,variant:n=`default`}){"use no memo";let r=n===`fade`;return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):r?$(`span`,{"data-truncate-fade":!0}):t})})}function TU(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function EU({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(TU,{mode:t,children:e},`content`),o=$(wU,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function DU({children:e,...t}){"use no memo";return $(EU,{mode:`truncate`,...t,children:e})}function OU({children:e,...t}){"use no memo";return $(EU,{mode:`fruncate`,...t,children:e})}function kU({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=$(DU,{...s,children:t[0]}),l=$(OU,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?OU:DU,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=vU:r===`extension`?t=yU:r===`leaf-path`&&(t=bU);else if(typeof r==`number`)t=xU,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=SU:e===`first`&&(t=CU)}else typeof r==`function`&&(t=r);t??=vU;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=$(DU,{...s,..._,children:f}),l=$(OU,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var AU={endIndex:-1,startIndex:-1};function jU(e,t,n){return Math.min(Math.max(e,t),n)}function MU(e,t){return e<0||t<e?AU:{endIndex:t,startIndex:e}}function NU(e){return e.startIndex<0||e.endIndex<e.startIndex}function PU(e,t){return NU(e)?0:(e.endIndex-e.startIndex+1)*t}function FU(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function IU(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function LU(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function RU(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function zU(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function BU(e,t,n){if(e.length===0||t<=0)return[];let r=zU(e),i=LU(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=RU(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function VU(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=jU(t.scrollTop,0,o),c=t.stickyRows??BU(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=FU(s,n,t.itemHeight),m=FU(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?AU:MU(m,IU(u+d,n,t.itemHeight)),y=g+1,b=NU(v)?AU:MU(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=PU(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:NU(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var HU={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},UU={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},WU=`Contains git status items`;function GU(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function KU(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return GU({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function qU(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function JU(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function YU(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function XU(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function ZU(e,t){return e!=null&&e>0?e:t}function QU(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function $U(e,t,n,r,i=0){let a=GU({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function eW(e,t,n,r,i,a,o=0){let s=KU({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function tW(e,t,n,r,i,a){let o=qU({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function nW(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function rW(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function iW({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function aW(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function oW(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var sW,cW,lW,uW,dW=Object.is,fW=0,pW=[],mW=EH,hW=mW.__b,gW=mW.__r,_W=mW.diffed,vW=mW.__c,yW=mW.unmount,bW=mW.__;function xW(e,t){mW.__h&&mW.__h(cW,e,fW||t),fW=0;var n=cW.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function SW(e){return fW=1,CW(FW,e)}function CW(e,t,n){var r=xW(sW++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):FW(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);dW(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=cW,!cW.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,dW(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};cW.__f=!0;var a=cW.shouldComponentUpdate,o=cW.componentWillUpdate;cW.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},cW.shouldComponentUpdate=i}return r.__N||r.__}function wW(e,t){var n=xW(sW++,3);!mW.__s&&PW(n.__H,t)&&(n.__=e,n.u=t,cW.__H.__h.push(n))}function TW(e,t){var n=xW(sW++,4);!mW.__s&&PW(n.__H,t)&&(n.__=e,n.u=t,cW.__h.push(n))}function EW(e){return fW=5,DW(function(){return{current:e}},[])}function DW(e,t){var n=xW(sW++,7);return PW(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function OW(e,t){return fW=8,DW(function(){return e},t)}function kW(){for(var e;e=pW.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(MW),e.__H.__h.forEach(NW),e.__H.__h=[]}catch(t){e.__H.__h=[],mW.__e(t,e.__v)}}mW.__b=function(e){cW=null,hW&&hW(e)},mW.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),bW&&bW(e,t)},mW.__r=function(e){gW&&gW(e),sW=0;var t=(cW=e.__c).__H;t&&(lW===cW?(t.__h=[],cW.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(MW),t.__h.forEach(NW),t.__h=[],sW=0)),lW=cW},mW.diffed=function(e){_W&&_W(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pW.push(t)!==1&&uW===mW.requestAnimationFrame||((uW=mW.requestAnimationFrame)||jW)(kW)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),lW=cW=null},mW.__c=function(e,t){t.some(function(e){try{e.__h.forEach(MW),e.__h=e.__h.filter(function(e){return!e.__||NW(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],mW.__e(n,e.__v)}}),vW&&vW(e,t)},mW.unmount=function(e){yW&&yW(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{MW(e)}catch(e){t=e}}),n.__H=void 0,t&&mW.__e(t,n.__v))};var AW=typeof requestAnimationFrame==`function`;function jW(e){var t,n=function(){clearTimeout(r),AW&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);AW&&(t=requestAnimationFrame(n))}function MW(e){var t=cW,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),cW=t}function NW(e){var t=cW;e.__c=e.__(),cW=t}function PW(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!dW(t,e[n])})}function FW(e,t){return typeof t==`function`?t(e):t}function IW(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $(WH,{children:[$(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:$(DU,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function LW(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function RW(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function zW(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function BW({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=VU(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:zW(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?zW(u,1,t,o):i&&r<=0&&c.length>0?BU(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var VW=400,HW=10,UW=40,WW=18;function GW(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?KW(e,t,n):a instanceof HTMLElement?a:null}function KW(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function qW(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function JW(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function YW(){return navigator.vendor!==`Apple Computer, Inc.`}function XW(e,t){let n=e-t.top;if(n<UW)return-Math.ceil((UW-Math.max(0,n))/UW*WW);let r=t.bottom-e;return r<UW?Math.ceil((UW-Math.max(0,r))/UW*WW):0}function ZW(e,t){if(e!=null){let t=HU[e];return t==null?null:{text:t,title:UU[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:WU}:null}function QW(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function $W(e){return e!=null&&`toggle`in e}function eG(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function tG(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function nG(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function rG(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function iG(e,t){return t&&rG(e)||(e.ctrlKey||e.metaKey)&&eG(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var aG=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function oG(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function sG(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function cG(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function lG(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function uG(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function dG(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function fG(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function pG(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function mG(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=pG(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function hG(e,t){return{kind:e.kind,name:RW(e),path:t}}function gG(e){return e==null?void 0:`${e}__tree`}function _G(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function vG(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function yG(e,t){if(e==null)return null;if(`text`in e)return $(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?vG(e.icon)?t(e.icon):{name:e.icon}:vG(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(_U,{...n})})}function bG(e){e!=null&&JU(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function xG(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=LW(e);return $(WH,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(_U,{...t(`file-tree-icon-chevron`)}):$(_U,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?IW(e,c,a):c??$(kU,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:yG(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:yG(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(_U,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function SG(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=LW(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??QW(t.ancestorPaths,v,y),ee=t.kind===`directory`&&(b?.has(P)??!1),te=A(t,P),B=ZW(z,ee),V=S&&w,H=te!=null||x||V,ne=V&&T===`always`,re=a.getPath()===P,ie=re?a.getValue():``,ae=R||!re?null:$(iW,{ref:D,ariaLabel:`Rename ${RW(t)}`,isFlattened:t.isFlattened,value:ie,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),oe=xG(t,k,{actionLaneEnabled:V,customDecoration:te,decorationLaneEnabled:H,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:B,gitLaneActive:x,renameInput:ae,showDecorativeActionAffordance:ne}),se={...aW({ariaLabel:RW(t),domId:t.isFocused?_G(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:V,contextMenuButtonVisibility:V?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ee,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:cG(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&re?$(`div`,{...se,children:oe}):$(`button`,{...se,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:oe})}function CG(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(LW(e))).map((n,r)=>SG(e,n,t.start+r))}function wG({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=zL,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=EW(null),v=EW(null),y=EW(!1),b=EW(null),x=EW(null),S=EW(null),C=EW(null),w=EW(null),T=EW(new Map),E=EW(new Map),D=EW(()=>{}),O=EW(null),k=EW(0),A=EW(!1),j=EW(null);j.current!==t&&(A.current=!1,j.current=t);let M=EW(!1),N=EW(null),P=EW(null),F=EW(!1),I=EW(null),L=EW(null),R=EW(null),z=EW(null),ee=EW(null),te=EW(null),B=EW(null),V=EW(null),H=EW(!1),ne=EW(null),re=EW(null),ie=EW(null),ae=EW(null),oe=DW(()=>new Map,[]),[,se]=SW(0),[ce,le]=SW(null),[ue,U]=SW(null),[de,fe]=SW(null),[pe,me]=SW(null),[he,ge]=SW(0),[_e,ve]=SW(null),ye=EW(_e);ye.current=_e;let be=EW(null),xe=EW(null),Se=EW(null),Ce=EW(null),we=EW(null),Te=EW(!1),Ee=()=>{xe.current=null,Se.current=null,Ce.current=null},De=(e,t)=>{xe.current=e,Se.current=null,Ce.current=t==null?null:{path:e,scrollTop:t}},Oe=(e,t)=>{xe.current=null,Se.current={path:e,viewportOffset:t},Ce.current=null},ke=EW(d===`retain`&&t.isSearchOpen()),[Ae,je]=SW(p);wW(()=>{p||je(!1)},[p]);let Me=EW(!1),Ne=OW(()=>{Me.current=!0,je(e=>e&&!1)},[]),[Pe,Fe]=SW(()=>BW({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ie,Le]=SW(!1);wW(()=>{Le(!0)},[]);let Re=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,ze=e?.contextMenu?.triggerMode??(Re?`right-click`:`both`),W=ze===`both`||ze===`button`,G=e?.contextMenu?.buttonVisibility??`when-needed`,Be=ze===`both`||ze===`right-click`;TW(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;we.current=t,U(t),me(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Te.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ve=OW((e,t)=>{uG(T.current,e,t)},[]),He=OW((e,t)=>{uG(E.current,e,t)},[]),Ue=OW(e=>{x.current=e},[]),We=OW(e=>dG(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=DW(()=>TH(a),[a]),qe=t[lH](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=DW(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=gG(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Pe,dt=lt.physical.viewportHeight,ft=DW(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,_t=DW(()=>new Set(mt.map(e=>LW(e.row))),[mt]),vt=$e>=0&&$e>=ft.start&&$e<=ft.end,yt=OW((e,t)=>u?.({item:hG(e,t),row:e})??null,[u]),bt=OW(e=>JU(e==null?null:T.current.get(e)??null)?!0:JU(S.current),[]),xt=OW(e=>{bt(t.focusNearestPath(e))},[t,bt]),St=EW(xt);St.current=xt;let Ct=EW(!0),wt=EW(()=>{}),Tt=OW((t=!0)=>{let n=ye.current;n!=null&&(Ct.current=Ct.current&&t,ve(null),e?.contextMenu?.onClose?.(),Ct.current&&xt(n.path))},[e?.contextMenu,xt]);wt.current=Tt;let Et=OW(e=>{let t=e==null?null:lG(S.current,e);fe(e=>e===t?e:t)},[]),Dt=OW((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;De(n,e?.scrollTop??null),M.current=!0,le(e=>e===n?e:n)}i.focus(),Et(a),Ct.current=!0,ve({anchorRect:r?.anchorRect??null,item:hG(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Et]),Ot=OW(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=XU(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(me(`focus`),se(e=>e+1))}},[t,$e,s,l,dt]),kt=OW((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=XU(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:BW({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,tW(i,a,s,l,u,d),D.current(),be.current=n?e:null,!0},[t,s,c,dt,h]),At=()=>y.current===!0||ae.current!=null||H.current===!0,jt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Mt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Nt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},K=()=>{te.current?.remove(),te.current=null},Pt=()=>{Mt(L.current),L.current=null,ee.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{V.current?.(),V.current=null,ae.current!=null&&(clearTimeout(ae.current),ae.current=null),H.current=!1,ne.current=null,ie.current=null,re.current!=null&&(re.current.setAttribute(`draggable`,`true`),re.current.style.removeProperty(`touch-action`),re.current=null),K(),Nt(),Pt(),B.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=qW(GW(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Nt();return}let r=t.getItem(e.directoryPath),i=$W(r)?r:null;if(i==null||i.isExpanded()){Nt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Nt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},zt=()=>{L.current=null;let e=ee.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=XW(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Rt(Lt(e.clientX,e.clientY)),L.current=jt(zt)},Bt=(e,t)=>{ee.current={clientX:e,clientY:t},L.current??=jt(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),K(),Nt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(B.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),YW())){let t=JW(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),te.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{K(),Nt(),Pt(),B.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(ae.current!=null||H.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ie.current={clientX:i.clientX,clientY:i.clientY},re.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!H.current;ae.current!=null&&(clearTimeout(ae.current),ae.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),V.current===o&&(V.current=null),t&&(a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null)},s=e=>{let t=e.touches[0],n=ie.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=HW*HW||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),V.current=o,ae.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null;return}H.current=!0,re.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),B.current=n;let e=a.getBoundingClientRect(),s=JW(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Ft(s),te.current=s,ne.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=ne.current;n!=null&&te.current!=null&&(te.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};V.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},VW)},Wt=e=>{if(_e!=null){if(e.key===`Escape`){Tt(),e.preventDefault(),e.stopPropagation();return}aG.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ot(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=XU(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&tG(e)){t.openSearch(e.key),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Re&&rG(e),r=iG(e,Re),i=r&&S.current!=null?YU(S.current):null,a=r?new Set(fG(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;De(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=$W(p)?p:null,h=u!=null&&(_t.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=dG(u,E.current,T.current);e==null||n==null?y=!1:Dt(e,u)}else if((e.ctrlKey||e.metaKey)&&eG(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;me(`focus`);let b=t.getFocusedPath(),x=b!=null&&(_t.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))De(b,v?.scrollTop??null),M.current=!0,le(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Oe(b,mG(S.current,v,i,u,s,gt,dt)),M.current=!0,le(e=>e===b?e:b)):Ee()}se(e=>e+1),e.preventDefault(),e.stopPropagation()};TW(()=>{if(!(!f||!Xe)){if(ke.current){ke.current=!1;return}JU(w.current)}},[Xe,f]),TW(()=>{let e=x.current;switch(rW({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&kt(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(be.current=null,P.current=Je,JU(e),e.select());return}},[ft.end,ft.start,Je,kt,_t]),TW(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=YU(e)?.dataset.itemPath??null;le(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,YU(e)!=null){r();return}M.current=!1,le(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,le(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;le(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),TW(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),TW(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=XU(n,g);let a=()=>{let e=t.getVisibleCount(),r=ZU(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Fe(BW({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=ZU(O.current,g),i=t.getVisibleRows(e,e)[0]??null;$U(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?se(e=>e+1):o=!0,a()}),u=()=>{Te.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,ge(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Te.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ye.current!=null&&y.current&&wt.current(),Te.current===!0){y.current=!1;return}U(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:QU(e[0]))??XU(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),TW(()=>{Re||_e==null||Tt(!1)},[Tt,Re,_e]);let Gt=DW(()=>_e==null?null:`${_e.path}::${_e.source}`,[_e]);TW(()=>{if(Gt==null){m?.clearSlotContent(mI);return}let t=ye.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??sG(n.getBoundingClientRect()),close:e=>{wt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Ct.current&&St.current(ye.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(mI,i),e?.contextMenu?.onOpen?.(t.item,r),bG(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&bG(i)}),()=>{m?.clearSlotContent(mI)}},[Gt,e?.contextMenu,m]),TW(()=>{_e!=null&&t.getItem(_e.path)==null&&Tt()},[Tt,_e,t]),TW(()=>{if(_e==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(oG(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Tt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Tt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Tt,_e]),TW(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=YU(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=be.current,p=xe.current,m=Se.current,g=Ce.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,dt-s))):gt;E=!0,O=eW(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&tW(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&tW(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&tW(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&$U(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(tW(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(JU(r),d===Qe&&(be.current=null),p===Qe&&(xe.current=null),m?.path===Qe&&(Se.current=null),g?.path===Qe&&(Ce.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,vt,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>LW(e.row)===Qe),Jt=Kt||qt,Yt=W&&M.current===!0&&Jt?Qe:null,Xt=pe===`pointer`?ue:null,Zt=_e?.path??we.current??Xt??Yt??ue,Qt=_e?.source===`right-click`;TW(()=>{y.current&&_e==null||Et(We(Zt))},[_e,We,ft,dt,he,pt,Zt,Et,ut]);let $t=OW(e=>{if(y.current||oG(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&me(e=>e===`pointer`?e:`pointer`),U(e=>e===i?e:i)},[]),en=OW(()=>{U(null)},[]);TW(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let tn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=qW(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},nn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Nt(),Pt(),t.setDragTarget(null))},rn=e=>{!tt||t.getDragSession()==null||H.current||(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),K(),Nt(),Pt(),B.current=null)},an=lt.window.height,on=lt.window.offsetTop,sn=Math.min(0,dt-an),cn=Math.min(0,dt-an-gt),ln=ce===Qe||F.current,un=Qe!=null&&ln&&!vt&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,dn=un==null?null:nW($e,s,ft,an),fn=B.current,pn=at!=null&&fn!=null&&fn.path===at&&fn.index>=ft.start&&fn.index<=ft.end,mn=at!=null&&fn!=null&&fn.path===at&&!pn&&fn.path!==un?.path?fn:null,hn=mn==null?null:nW(mn.index,s,ft,an),gn=nG(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),_n=Xe&&Qe!=null?_G(o,Qe,!vt):void 0,vn=_e?.path??(Xe?Qe:ce),yn=_e?.path??ue,bn=We(Zt),xn=Re&&W&&!Qt&&!Ye&&bn!=null&&de!=null&&Zt!=null,Sn=Re&&(xn||_e!=null),Cn=_e?.anchorRect,wn=Cn==null&&bn!=null&&de!=null&&(_e!=null||xn)?de:null,Tn=Cn==null?wn==null?void 0:{top:`${wn}px`}:{left:`${Cn.left}px`,position:`fixed`,right:`auto`,top:`${Cn.top}px`},En=Qt?{opacity:`0`}:void 0,Dn=OW((e,n,r,i)=>{let a=oW({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,le(e=>e===c?e:c),me(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&kt(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,kt]),On=()=>{if(y.current||!W||Zt==null||bn==null)return;let e=t.getItem(Zt);e!=null&&(Et(bn),Ct.current=!0,ve({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:bn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},kn={contextHoverPath:yn,contextMenuButtonTriggerEnabled:W,contextMenuButtonVisibility:G,contextMenuEnabled:Re,contextMenuRightClickEnabled:Be,contextMenuTriggerMode:ze,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:oe,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:Dn,openContextMenuForRow:Dt,registerButton:Ve,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:yt,resolveIcon:Ke,shouldSuppressContextMenu:At,visualFocusPath:vn},An={...kn,registerButton:He};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Re&&W?G:void 0,"data-file-tree-context-menu-trigger-mode":Re?ze:void 0,"data-file-tree-has-context-menu-action-lane":Re&&W?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?nn:void 0,onDragOver:tt?tn:void 0,onDrop:tt?rn:void 0,onKeyDown:Wt,onPointerLeave:Re?en:void 0,onPointerOver:Re?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:gn}}),$(`slot`,{name:pI,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":_n,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ae?`true`:void 0,value:Ze,onBlur:()=>{d===`retain`&&!Me.current||t.closeSearch()},onFocus:Ne,onPointerDown:Ne,onInput:e=>{Ne();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ie&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>SG(An,e.row,`sticky:${LW(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${on}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${an}px`,top:`${sn}px`,bottom:`${cn}px`},children:[CG(kn,ft,_t),un!=null&&dn!=null?SG(kn,un,`parked:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===un.path?`none`:void 0,position:`absolute`,right:`0`,top:`${dn}px`}}):null,mn!=null&&hn!=null?SG(kn,mn,`parked-drag:${mn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${hn}px`}}):null]})]})]}),Re?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Sn?`true`:`false`,style:Tn,children:[$(`button`,{ref:v,type:`button`,"data-type":hI,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":_e==null?`false`:`true`,"data-visible":xn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),_e!=null){Tt();return}On()},tabIndex:-1,style:En,children:$(_U,{...Ke(`file-tree-icon-ellipsis`)})}),_e==null?null:$(`slot`,{name:mI})]}):null,_e==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Tt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Tt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var TG={hydrateRoot:(e,t)=>{fU(HH(wG,t),e)},renderRoot:(e,t)=>{dU(HH(wG,t),e)},unmountRoot:e=>{dU(null,e)}};function EG(e,t){TG.renderRoot(e,t)}function DG(e,t){TG.hydrateRoot(e,t)}function OG(e){TG.unmountRoot(e)}var kG=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},AG=`__c`,jG=`__k`,MG=`__d`,NG=`__s`,PG=/[\s\n\\/='"\0<>]/,FG=/^(xlink|xmlns|xml)([A-Z])/,IG=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,LG=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,RG=new Set([`draggable`,`spellcheck`]);function zG(e){e.__g===void 0?e[MG]=!0:e.__g|=8}function BG(e){e.__g===void 0?e[MG]=!1:e.__g&=-9}function VG(e){return e.__g===void 0?!0===e[MG]:!!(8&e.__g)}var HG=/["&<]/;function UG(e){if(e.length===0||!1===HG.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var WG={},GG=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),KG=/[A-Z]/g;function qG(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:WG[n]||(WG[n]=n.replace(KG,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||GG.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function JG(){this.__d=!0}function YG(e,t){return{__v:e,context:t,props:e.props,setState:JG,forceUpdate:JG,__d:!0,__h:[]}}function XG(e,t,n){if(!e.s){if(n instanceof ZG){if(!n.s)return void(n.o=XG.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(XG.bind(null,e,t),XG.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var ZG=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{XG(r,1,a(this.v))}catch(e){XG(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?XG(r,1,t?t(i):i):n?XG(r,1,n(i)):XG(r,2,i)}catch(e){XG(r,2,e)}},r},e}(),QG,$G,eK,tK,nK={},rK=Array.isArray,iK=Object.assign,aK=``,oK=`<!--$s-->`,sK=`<!--/$s-->`;function cK(e,t){var n,r=e.type,i=!0;return e[AG]?(i=!1,(n=e[AG]).state=n[NG]):n=new r(e.props,t),e[AG]=n,n.__v=e,n.props=e.props,n.context=t,zG(n),n.state??=nK,n[NG]??(n[NG]=n.state),r.getDerivedStateFromProps?n.state=iK({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[NG]===n.state?n.state:n[NG]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),eK&&eK(e),n.render(n.props,n.state,t)}function lK(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===aK)return aK;var s=typeof e;if(s!=`object`)return s==`function`?aK:s==`string`?UG(e):e+aK;if(rK(e)){var c,l=aK;i[jG]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=lK(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=aK,rK(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return aK;e.__=i,QG&&QG(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===WH){if(`tpl`in g){for(var x=aK,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!rK(C)?x+=C:x+=lK(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+UG(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=cK(e,b),y=e[AG];else{e[AG]=y=YG(e,b);for(var E=0;VG(y)&&E++<25;){BG(y),eK&&eK(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}zG(y)}if(y.getChildContext!=null&&(t=iK({},t,y.getChildContext())),T&&EH.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===WH&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return lK(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[NG]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,nK),VG(y)?(v=cK(e,t),(y=e[AG]).getChildContext!=null&&(t=iK({},t,y.getChildContext())),lK(v=v!=null&&v.type===WH&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):aK}finally{$G&&$G(e),tK&&tK(e)}}}v=v!=null&&v.type===WH&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=lK(v,t,n,r,e,a,o);return $G&&$G(e),EH.unmount&&EH.unmount(e),e._suspended?typeof D==`string`?oK+D+sK:rK(D)?(D.unshift(oK),D.push(sK),D):D.then(function(e){return oK+e+sK}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return lK(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=EH.__e;return k&&k(i,e),aK}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=lK(v,t,n,r,e,a,o);return e._suspended?oK+s+sK:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=aK;for(var N in g){var P=g[N];if(typeof(P=dK(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=qG(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(FG.test(N))N=N.replace(FG,`$1:$2`).toLowerCase();else{if(PG.test(N))continue;N[4]!==`-`&&!RG.has(N)||P==null?n?LG.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):IG.test(N)&&(N=N.toLowerCase()):P+=aK}}P!=null&&!1!==P&&(j=!0===P||P===aK?j+` `+N:j+` `+N+`="`+(typeof P==`string`?UG(P):P+aK)+`"`)}}if(PG.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=UG(A):A!=null&&!1!==A&&!0!==A&&(M=lK(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),$G&&$G(e),tK&&tK(e),!M&&uK.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return rK(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var uK=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function dK(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var fK=0;function pK(e){return e!=null&&e.length>0?e:(fK+=1,`pst_ft_${fK}`)}function mK({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??zL)}function hK(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function gK(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function _K(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var vK=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new kG;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=pK(a),this.#p=bH(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=RL(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new hH({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(OG(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),EG(t.wrapper,this.#w()))}setGitStatus(e){this.#p=bH(e,this.#p);let t=this.#T();t!=null&&EG(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),EG(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),DG(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),EG(r,this.#w())}#C(){return{initialViewportHeight:mK({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(pI,e());return}this.#l.setSlotHtml(pI,this.#e?.header?.html??null)}#k(e){let t=_K(e).find(e=>gK(e)),n=hK(jL(IL(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=_K(e),n=t.find(e=>gK(e)),r=t.filter(e=>e!==n),i=IL(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=hK(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=IL(this.#m);t.colored&&NL(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${lI}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(lI,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=UL(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return YL(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function yK(e){let[t]=(0,W.useState)(()=>new vK(e)),n=(0,W.useRef)({timeout:null,model:t});return(0,W.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var bK=(0,W.memo)(function({files:e,activeFile:t,commentCounts:n,viewedFiles:r,untrackedFiles:i,onFileClick:a,collapsed:o,onToggleCollapse:s}){let[c,l]=(0,W.useState)(``),u=(0,W.useMemo)(()=>e.map(e=>e.name),[e]),d=(0,W.useMemo)(()=>{let e=new Set;return u.forEach(t=>{let n=t.split(`/`);for(let t=1;t<n.length;t++)e.add(n.slice(0,t).join(`/`))}),Array.from(e)},[u]),f=(0,W.useMemo)(()=>e.map(e=>{let t=`modified`;if(i.has(e.name))t=`untracked`;else if(e.prevName)t=`renamed`;else{let n=e.prevObjectId,r=e.newObjectId;n===`0000000`||n===`0000000000000000000000000000000000000000`?t=`added`:(r===`0000000`||r===`0000000000000000000000000000000000000000`)&&(t=`deleted`)}return{path:e.name,status:t}}),[e,i]),p=(0,W.useRef)({commentCounts:n,viewedFiles:r});p.current={commentCounts:n,viewedFiles:r};let{model:m}=yK({paths:u,fileTreeSearchMode:`hide-non-matches`,gitStatus:f,renderRowDecoration:(0,W.useCallback)(e=>{let t=e.item.path,{commentCounts:n,viewedFiles:r}=p.current,i=r.has(t),a=n[t]??0;return i&&a>0?{text:`✓ 💬 ${a}`,title:`Viewed, ${a} comment${a>1?`s`:``}`}:i?{text:`✓`,title:`Viewed`}:a>0?{text:`💬 ${a}`,title:`${a} comment${a>1?`s`:``}`}:null},[]),initialSelectedPaths:t?[t]:[],initialExpandedPaths:d,onSelectionChange:e=>{e.length>0&&e[0]!==t&&a(e[0])}});return(0,W.useEffect)(()=>{m.resetPaths(u,{initialExpandedPaths:d})},[u,d,m]),(0,W.useEffect)(()=>{m.setGitStatus(f)},[f,n,r,m]),(0,W.useEffect)(()=>{if(t)try{m.focusPath(t),m.scrollToPath(t,{focus:!0,offset:`nearest`})}catch(e){console.error(`Failed to scroll to active file:`,e)}},[t,m]),(0,W.useEffect)(()=>{m.setSearch(c||null)},[c,m]),o?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:s&&(0,G.jsx)(QT,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Expand sidebar`,children:(0,G.jsx)(UM,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[s&&(0,G.jsx)(QT,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(HM,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(XM,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:c,onChange:e=>l(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,G.jsx)(xI,{model:m,className:`ft-pierre-tree`})})]})});function xK(e){return e.status===`resolved`?`resolved`:e.replies?.length?`replied`:`open`}var SK=[{key:`all`,label:`All`},{key:`open`,label:`Open`},{key:`replied`,label:`Replied`},{key:`resolved`,label:`Resolved`}];function CK({comments:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let[c,l]=(0,W.useState)(`all`),u=(0,W.useMemo)(()=>{let t={all:e.length,open:0,replied:0,resolved:0};for(let n of e)t[xK(n)]++;return t},[e]),d=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),f=(0,W.useMemo)(()=>c===`all`?d:d.filter(e=>xK(e)===c),[d,c]);return e.length===0?null:(0,G.jsxs)(`div`,{className:`cmt`,role:`complementary`,"aria-label":`Review comments`,children:[(0,G.jsxs)(`div`,{className:`cmt-head`,children:[(0,G.jsxs)(`div`,{className:`cmt-title`,children:[(0,G.jsx)(RM,{size:14,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Comments`}),(0,G.jsx)(`span`,{className:`cmt-total`,children:e.length})]}),(0,G.jsx)(`div`,{className:`cmt-filters`,role:`tablist`,"aria-label":`Filter comments`,children:SK.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":c===e.key,className:`cmt-filter ${c===e.key?`cmt-filter-active`:``}`,onClick:()=>l(e.key),disabled:e.key!==`all`&&u[e.key]===0,children:[e.label,(0,G.jsx)(`span`,{className:`cmt-filter-count`,children:u[e.key]})]},e.key))})]}),(0,G.jsx)(`ul`,{className:`cmt-list`,"aria-label":`Comment threads`,children:f.length===0?(0,G.jsxs)(`li`,{className:`cmt-empty`,children:[`No `,c,` comments`]}):f.map(e=>(0,G.jsx)(wK,{comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s},e.id))})]})}function wK({comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let c=xK(e),l=e.status===`resolved`,u=e.replies?.length??0,{haptic:d,sound:f}=oM(),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(!1),x=(0,W.useCallback)(()=>{e.lineNumber>0?vj(e.filePath,e.lineNumber,e.side):document.getElementById(`file-${e.filePath}`)?.scrollIntoView({block:`start`})},[e.filePath,e.lineNumber,e.side]),S=e.lineNumber>0?`:${e.lineNumber}`:` · file`;return(0,G.jsxs)(`li`,{className:`cmt-card cmt-card-${c} ${l?`cmt-card-resolved`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-card-top`,children:[(0,G.jsx)(`span`,{className:`cmt-dot cmt-dot-${c}`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{className:`cmt-loc`,onClick:x,title:`Jump to ${e.filePath}${S}`,children:[(0,G.jsx)(`span`,{className:`cmt-loc-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`cmt-loc-line`,children:S})]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)})]}),e.lineContent?.trim()&&(0,G.jsx)(`button`,{className:`cmt-codeline`,onClick:x,title:`Jump to line`,children:(0,G.jsx)(`code`,{children:e.lineContent.trim().slice(0,160)})}),_?(0,G.jsx)(qF,{draftKey:`tracker-edit:${e.id}`,initialBody:e.body,onCancel:()=>v(!1),onSubmit:t=>{a(e.id,t),v(!1)}}):(0,G.jsx)(`div`,{className:`cmt-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(0,G.jsxs)(`div`,{className:`cmt-actions`,children:[(0,G.jsxs)(`button`,{className:`cmt-act`,onClick:()=>{g(e=>!e),m(!0)},title:`Reply`,children:[(0,G.jsx)(OM,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Reply`})]}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>v(e=>!e),title:`Edit comment`,children:(0,G.jsx)(GM,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-act ${l?`cmt-act-resolved`:``}`,onClick:()=>{l?(n(e.id),d(`light`),f(`toggle`)):(t(e.id),d(`success`),f(`resolve`))},title:l?`Reopen`:`Resolve`,children:l?(0,G.jsx)(JM,{size:13,"aria-hidden":`true`}):(0,G.jsx)(yM,{size:13,"aria-hidden":`true`})}),y?(0,G.jsxs)(`span`,{className:`cmt-confirm`,children:[(0,G.jsx)(`button`,{className:`cmt-act cmt-act-danger`,onClick:()=>{r(e.id),d(`medium`),f(`remove`)},title:`Confirm delete`,children:`Delete?`}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>b(!1),title:`Cancel`,children:(0,G.jsx)(aN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`cmt-act cmt-act-del`,onClick:()=>b(!0),title:`Delete comment`,children:(0,G.jsx)(eN,{size:13,"aria-hidden":`true`})})]}),u>0&&(0,G.jsxs)(`button`,{className:`cmt-thread-toggle`,onClick:()=>m(e=>!e),"aria-expanded":p,children:[(0,G.jsx)(xM,{size:12,className:`cmt-chev ${p?`cmt-chev-open`:``}`,"aria-hidden":`true`}),u,` `,u===1?`reply`:`replies`]}),p&&u>0&&(0,G.jsx)(`ul`,{className:`cmt-replies`,children:e.replies.map(t=>(0,G.jsx)(TK,{reply:t,onEdit:n=>o(e.id,t.id,n),onRemove:()=>s(e.id,t.id)},t.id))}),h&&(0,G.jsx)(qF,{draftKey:`reply:${e.id}`,onCancel:()=>g(!1),onSubmit:t=>{i(e.id,t),d(`light`),f(`success`),g(!1),m(!0)}})]})}function TK({reply:e,onEdit:t,onRemove:n}){let r=e.role===`agent`||e.role==null&&!!e.model,[i,a]=(0,W.useState)(!1);return(0,G.jsxs)(`li`,{className:`cmt-reply ${r?`cmt-reply-agent`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-reply-head`,children:[(0,G.jsxs)(`span`,{className:`cmt-reply-who ${r?`cmt-reply-who-agent`:``}`,children:[r?(0,G.jsx)(vM,{size:11,"aria-hidden":`true`}):null,r?e.model||`Agent`:`You`]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)}),!r&&(0,G.jsx)(`button`,{className:`cmt-reply-act`,onClick:()=>a(e=>!e),title:`Edit reply`,children:(0,G.jsx)(GM,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-reply-act cmt-act-del`,onClick:n,title:`Delete reply`,children:(0,G.jsx)(eN,{size:11,"aria-hidden":`true`})})]}),i?(0,G.jsx)(qF,{draftKey:`tracker-reply-edit:${e.id}`,initialBody:e.body,onCancel:()=>a(!1),onSubmit:e=>{t(e),a(!1)}}):(0,G.jsx)(`div`,{className:`cmt-reply-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}})]})}function EK(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function DK(e){return e===`symbols`?2:e===`text`?1:0}function OK({scope:e,query:t,regex:n,changedOnly:r,changedPaths:i,open:a}){let o=EK(t,130).trim(),s=a&&o.length>=DK(e);return{...nt({queryKey:[`search`,e,o,e===`text`?n:!1,r,r?i:null],enabled:s,placeholderData:V,staleTime:5e3,queryFn:async({signal:t})=>{let a=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:t,body:JSON.stringify({scope:e,query:o,regex:e===`text`?n:!1,changedPaths:r?i:void 0})});if(!a.ok)throw Error(`Search request failed (${a.status})`);return await a.json()}}),enabled:s,pending:t.trim()!==o,minLength:DK(e)}}function kK(e,t){fetch(`/api/search/track`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:e,path:t})}).catch(()=>{})}function AK(e){return nt({queryKey:[`file-text`,e],enabled:!!e,staleTime:300*1e3,queryFn:async({signal:t})=>{let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`,{signal:t});if(n.status===415)return{content:null,missing:!1,binary:!0};if(!n.ok)throw Error(`Failed to load file (${n.status})`);let r=await n.json();if(r.error){if(/binary/i.test(r.error))return{content:null,missing:!1,binary:!0};throw Error(r.error)}return r.missing?{content:null,missing:!0,binary:!1}:{content:r.content??``,missing:!1,binary:!1}}})}var jK=[{pattern:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s+)?function/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?class\s+(\w[\w$]*)/i,kind:`class`,nameGroup:1},{pattern:/^\s*(?:export\s+)?interface\s+(\w[\w$]*)/i,kind:`interface`,nameGroup:1},{pattern:/^\s*(?:export\s+)?type\s+(\w[\w$]*)\s*=/i,kind:`type`,nameGroup:1},{pattern:/^\s*(?:export\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=/i,kind:`variable`,nameGroup:1},{pattern:/^\s*def\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?fn\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?struct\s+(\w[\w$]*)/i,kind:`struct`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?impl\s+(\w[\w$]*)/i,kind:`impl`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?trait\s+(\w[\w$]*)/i,kind:`trait`,nameGroup:1},{pattern:/^\s*func\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:func\s+)?\((\w[\w$]*)\s+\*?\w+\)\s+(\w[\w$]*)\s*\(/i,kind:`method`,nameGroup:2}];function MK(e){for(let{pattern:t,kind:n,nameGroup:r}of jK){let i=t.exec(e);if(i){let e=i[r];if(e)return{name:e,kind:n}}}return null}function NK(e){return new Set(e.map(e=>e.name))}function PK(e){let t=new Set;for(let n of e)n.side===`additions`&&t.add(`${n.filePath}:${n.lineNumber}`);return t}function FK(e,t){return e.kind===`file`?t.diffFileSet.has(e.path)?{type:`scrollFile`,path:e.path}:{type:`preview`,path:e.path}:t.diffFileSet.has(e.path)?{type:`scrollLine`,path:e.path,line:e.line,side:`additions`,match:e.match}:{type:`preview`,path:e.path,line:e.line,match:e.match}}function IK(e,t){if(!t||t.length===0)return null;let n=!0;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127){n=!1;break}let r=n?e.length:RK(e),i=null;if(!n){i=Array(r+1).fill(-1);let t=0;for(let n=0;n<e.length;){i[t]=n;let r=e.codePointAt(n);n+=r>65535?2:1,t+=LK(r)}i[r]=e.length}let a=[];for(let e of t){let[t,o]=e;if(!(t==null||o==null||o<=t||t<0||o>r))if(n)a.push([t,o]);else{let e=i[t],n=i[o];e>=0&&n>=0&&a.push([e,n])}}return a.length?a:null}function LK(e){return e<=127?1:e<=2047?2:e<=65535?3:4}function RK(e){let t=0;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=LK(r),n+=r>65535?2:1}return t}function zK(e,t,n){let r=((t?IK(e,t):null)??BK(e,n)).map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]),i=[];for(let[e,t]of r){let n=i[i.length-1];n&&e<=n[1]?n[1]=Math.max(n[1],t):i.push([e,t])}return i}function BK(e,t){let n=t.trim();if(!n)return[];let r=[],i=e.toLowerCase(),a=n.toLowerCase(),o=0;for(;r.length<50;){let e=i.indexOf(a,o);if(e===-1)break;r.push([e,e+a.length]),o=e+a.length}return r}function VK(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(!r)return 0;let i=0,a=0,o=-1;for(let e=0;e<n.length&&i<r.length;e++)n[e]===r[i]&&(a+=o>=0&&e-o===1?5:1,o=e,i++);return i===r.length?a-e.length*.01:null}function HK(e){let t=[],n=new Set;for(let r of e){if(r.side!==`additions`)continue;let e=MK(r.content);if(e){let i=`${r.filePath}:${r.lineNumber}:${e.name}`;if(n.has(i))continue;n.add(i);let a=r.content.indexOf(e.name),o=a>=0?[[a,a+e.name.length]]:[];t.push({name:e.name,kind:e.kind,path:r.filePath,fileName:r.filePath.split(`/`).pop()||``,line:r.lineNumber,content:r.content,matchRanges:o,gitStatus:``})}}return t}var UK=[{key:`all`,label:`All`,Icon:FM},{key:`files`,label:`Files`,Icon:AM},{key:`text`,label:`Text`,Icon:nN},{key:`symbols`,label:`Symbols`,Icon:DM}],WK={function:`ƒ`,method:`m`,class:`C`,variable:`v`,interface:`I`,type:`T`,enum:`E`,struct:`S`,impl:`i`,trait:`t`};function GK(e){switch(e){case`modified`:return{label:`M`,title:`modified`};case`untracked`:return{label:`U`,title:`untracked`};case`staged_new`:case`added`:return{label:`A`,title:`added`};case`deleted`:return{label:`D`,title:`deleted`};case`renamed`:return{label:`R`,title:`renamed`};case``:case`clean`:return null;default:return{label:e.charAt(0).toUpperCase(),title:e}}}function KK({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`searchpalette-mark`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}function qK(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}var JK=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)};function YK(e,t){let n=e.length-e.trimStart().length,r=e.slice(n),i=n;if(r.length>400){let e=t.find(e=>e[0]>=n),a=e?Math.max(0,e[0]-n-24):0,o=a>0?`…`:``;r=o+r.slice(a,a+400),i=n+a-o.length}let a=t.map(([e,t])=>[e-i,t-i]).filter(([e,t])=>t>0&&e<r.length).map(([e,t])=>[Math.max(0,e),Math.min(r.length,t)]);return{text:r,ranges:a}}function XK({isOpen:e,onClose:t,initialScope:n,files:r,changedEntries:i,customMode:a,staged:o,onNavigateFile:s,theme:c,fontSize:l,defaultTabSize:u,lineWrap:d,showLineNumbers:f,lineHoverHighlight:p}){let[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(n),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(!1),[S,C]=(0,W.useState)(0),[w,T]=(0,W.useState)(null),E=(0,W.useRef)(null),D=(0,W.useRef)(null),O=(0,W.useMemo)(()=>NK(r),[r]),k=(0,W.useMemo)(()=>PK(i),[i]),A=OK({scope:g,query:m,regex:v,changedOnly:b,changedPaths:(0,W.useMemo)(()=>[...O],[O]),open:e}),j=A.data&&A.data.scope===g?A.data:void 0,M=j?.error,N=nt({queryKey:[`repo-files-fallback`],enabled:e&&g===`files`&&!!M,staleTime:6e4,queryFn:async()=>(await(await fetch(`/api/repo-files`)).json()).files??[]});(0,W.useEffect)(()=>{e&&(h(``),_(n),y(!1),x(!1),C(0),T(null))},[e,n]),(0,W.useEffect)(()=>{e&&E.current?.focus()},[e]),(0,W.useEffect)(()=>{C(0),T(null)},[m,g]);let P=(0,W.useMemo)(()=>{let e=m.trim(),t=e.toLowerCase(),n=[];if(g===`files`&&M&&N.data)n=N.data.map(e=>({path:e,score:t?VK(e,t):0})).filter(e=>e.score!==null).sort((e,t)=>t.score-e.score).slice(0,60).map(({path:e})=>({kind:`file`,key:e,hit:{path:e,fileName:fj(e),gitStatus:``,matchType:``,exact:!1},inDiff:O.has(e)}));else if(j)j.scope===`files`?n=j.items.map(e=>({kind:`file`,key:e.path,hit:e,inDiff:O.has(e.path)})):j.scope===`text`?n=j.items.map(e=>({kind:`text`,key:`${e.path}:${e.line}:${e.col}`,hit:e,inDiff:O.has(e.path)})):j.scope===`symbols`?n=j.items.map(e=>({kind:`symbol`,key:`${e.path}:${e.line}:${e.name}`,hit:e,inDiff:O.has(e.path)})):j.scope===`all`&&(n=j.items.map(e=>e.kind===`file`?{kind:`file`,key:`all:${e.hit.path}`,hit:e.hit,inDiff:O.has(e.hit.path)}:e.kind===`text`?{kind:`text`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.col}`,hit:e.hit,inDiff:O.has(e.hit.path)}:{kind:`symbol`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.name}`,hit:e.hit,inDiff:O.has(e.hit.path)}));else if(g===`symbols`&&e.length<2){let e=HK(i);n=(t?e.filter(e=>e.name.toLowerCase().includes(t)):e).map(e=>({kind:`symbol`,key:`local:${e.path}:${e.line}:${e.name}`,hit:e,inDiff:!0}))}let r=n.filter(e=>e.inDiff),a=n.filter(e=>!e.inDiff);return[...r,...a]},[j,M,N.data,g,O,m,i]);(0,W.useEffect)(()=>{S>=P.length&&C(0)},[P.length,S]),(0,W.useEffect)(()=>{(D.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[S,P]);let F=(0,W.useMemo)(()=>({diffFileSet:O,changedKeys:k,customMode:a,staged:o}),[O,k,a,o]),I=(0,W.useCallback)((e,n)=>{let r=P[e];if(!r)return;let i=r.hit.path,a=m.trim();if(kK(a,i),r.kind===`file`){if(n){T({path:i});return}FK({kind:`file`,path:i},F).type===`scrollFile`?(t(),requestAnimationFrame(()=>s(i))):T({path:i});return}let o=r.hit.line,c=r.kind===`symbol`?r.hit.name:a;if(n){T({path:i,line:o,match:c});return}let l=FK({kind:`line`,path:i,line:o,match:c},F);l.type===`scrollLine`?(t(),requestAnimationFrame(()=>vj(i,l.line,l.side,l.match))):T({path:i,line:o,match:c})},[P,m,F,t,s]),L=(0,W.useCallback)(e=>{_(t=>UK[(UK.findIndex(e=>e.key===t)+e+UK.length)%UK.length].key)},[]),R=(0,W.useCallback)(e=>{if(e.key===`PageDown`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:150,behavior:`auto`});return}if(e.key===`PageUp`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-150,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.key===`Tab`){e.preventDefault(),L(e.shiftKey?-1:1);return}let t=e=>{P.length!==0&&C(t=>(t+e+P.length)%P.length)};e.key===`ArrowDown`||e.ctrlKey&&(e.key===`n`||e.key===`j`)?(e.preventDefault(),t(1)):e.key===`ArrowUp`||e.ctrlKey&&(e.key===`p`||e.key===`k`)?(e.preventDefault(),t(-1)):e.ctrlKey&&e.key===`d`?(e.preventDefault(),t(8)):e.ctrlKey&&e.key===`u`?(e.preventDefault(),t(-8)):e.key===`Enter`&&(e.preventDefault(),I(S,e.metaKey||e.ctrlKey))},[L,P.length,I,S]),z=(0,W.useCallback)(()=>{w?T(null):t()},[w,t]),ee=j?.total??P.length,te=(A.isFetching||A.pending)&&A.enabled,B=j?.indexing;return(0,G.jsxs)(IF,{open:e,onClose:z,className:`searchpalette ui-modal--palette ${w?`searchpalette--split`:``}`,ariaLabel:`Search files, text and symbols`,initialFocus:E,onKeyDown:R,children:[(0,G.jsxs)(`div`,{className:`searchpalette-header`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-input-row`,children:[(0,G.jsx)(XM,{size:15,className:`searchpalette-search-icon`}),(0,G.jsx)(`input`,{ref:E,type:`text`,className:`searchpalette-input`,placeholder:g===`all`?`Search files, text and symbols…`:g===`files`?`Search files in the repo…`:g===`text`?v?`Search by regular expression…`:`Search file contents…`:`Search symbol definitions…`,value:m,onChange:e=>h(e.target.value),role:`combobox`,"aria-expanded":P.length>0,"aria-controls":`searchpalette-list`,"aria-activedescendant":P[S]?`sp-row-${S}`:void 0,spellCheck:!1,autoComplete:`off`}),te&&(0,G.jsx)(IM,{size:14,className:`searchpalette-spinner spin`}),m&&(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:()=>h(``),"aria-label":`Clear search`,children:(0,G.jsx)(aN,{size:14})}),(0,G.jsx)(`span`,{className:`searchpalette-count`,children:B?`indexing…`:j?`${P.length} of ${ee}`:``})]}),(0,G.jsxs)(`div`,{className:`searchpalette-controls`,children:[(0,G.jsx)(`div`,{className:`searchpalette-scopes`,role:`tablist`,"aria-label":`Search scope`,children:UK.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":g===e.key,className:`searchpalette-scope ${g===e.key?`is-active`:``}`,onClick:()=>_(e.key),children:[(0,G.jsx)(e.Icon,{size:12}),e.label]},e.key))}),(0,G.jsxs)(`div`,{className:`searchpalette-toggles`,children:[g===`text`&&(0,G.jsx)(`button`,{className:`searchpalette-toggle ${v?`is-active`:``}`,onClick:()=>y(e=>!e),title:`Regular expression`,"aria-pressed":v,children:`.*`}),(0,G.jsxs)(`button`,{className:`searchpalette-toggle ${b?`is-active`:``}`,onClick:()=>x(e=>!e),title:`Limit to files in the current diff`,"aria-pressed":b,children:[(0,G.jsx)(MM,{size:12}),`Changed`]})]})]}),j?.regexError&&(0,G.jsx)(`div`,{className:`searchpalette-note`,children:`Invalid regex — showing literal matches`})]}),(0,G.jsxs)(`div`,{className:`searchpalette-body`,children:[(0,G.jsx)(`div`,{className:`searchpalette-list`,id:`searchpalette-list`,role:`listbox`,ref:D,children:(0,G.jsx)(ZK,{rows:P,scope:g,query:m,focusedIndex:S,engineError:M,isFetching:A.isFetching,enabled:A.enabled,minLength:A.minLength,regex:v,changedOnly:b,onHover:C,onActivate:(e,t)=>I(e,t?t.metaKey||t.ctrlKey:!1),onRetry:()=>A.refetch()})}),w&&(0,G.jsx)(rq,{preview:w,theme:c,fontSize:l,defaultTabSize:u,lineWrap:d,showLineNumbers:f,lineHoverHighlight:p,onClose:()=>T(null),inDiff:O.has(w.path),onGoToDiff:()=>{t(),w.line?requestAnimationFrame(()=>vj(w.path,w.line,`additions`,w.match)):requestAnimationFrame(()=>s(w.path))}},w.path)]}),(0,G.jsxs)(`div`,{className:`searchpalette-foot`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`Tab`}),` scope`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↑↓`}),` move`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↵`}),` `,w&&O.has(w.path)?`view in diff`:`open`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌘↵`}),` peek`]}),w&&(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌥↑↓`}),` / `,(0,G.jsx)(`kbd`,{children:`⇧↑↓`}),` scroll preview`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`esc`}),` `,w?`back`:`close`]})]})]})}function ZK({rows:e,scope:t,query:n,focusedIndex:r,engineError:i,isFetching:a,enabled:o,minLength:s,regex:c,changedOnly:l,onHover:u,onActivate:d,onRetry:f}){return i&&t!==`files`?(0,G.jsxs)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:[(0,G.jsx)(`p`,{children:`Search engine unavailable`}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:i}),(0,G.jsx)(`button`,{className:`searchpalette-retry`,onClick:f,children:`Retry`})]}):e.length>0?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(QK,{row:e,index:t,query:n,focused:t===r,onHover:u,onActivate:d},e.key))}):o?a?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(IM,{size:15,className:`spin`}),` Searching…`]}):(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsxs)(`p`,{children:[`No matches`,n.trim()?` for “${n.trim()}”`:``]}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:l?`Searching only changed files — turn off Changed to search the whole repo`:t===`text`&&!c?`Try Tab to switch scope, or enable .* for regex`:`Try Tab to switch scope`})]}):(0,G.jsx)(`div`,{className:`searchpalette-state`,children:t===`symbols`?n.trim()?`No matching symbols in the current diff. Type at least 2 characters to search the whole repository.`:`No symbols found in the current diff. Type at least 2 characters to search the whole repository.`:t===`text`?`Type to search file contents`:`Type to filter — or browse all files`})}function QK({row:e,index:t,query:n,focused:r,onHover:i,onActivate:a}){let o=GK(e.hit.gitStatus);return(0,G.jsxs)(`div`,{id:`sp-row-${t}`,role:`option`,"aria-selected":r,"data-focused":r,className:`searchpalette-row ${r?`is-focused`:``} ${e.inDiff?`is-indiff`:``}`,onMouseEnter:()=>i(t),onClick:e=>a(t,e),children:[e.kind===`file`&&(0,G.jsx)($K,{hit:e.hit,query:n}),e.kind===`text`&&(0,G.jsx)(eq,{hit:e.hit,query:n}),e.kind===`symbol`&&(0,G.jsx)(tq,{hit:e.hit}),(0,G.jsxs)(`div`,{className:`searchpalette-rail`,children:[e.inDiff&&(0,G.jsx)(`span`,{className:`searchpalette-pill searchpalette-pill--diff`,children:`diff`}),o&&(0,G.jsx)(`span`,{className:`searchpalette-git searchpalette-git--${o.title}`,title:o.title,children:o.label})]})]})}function $K({hit:e,query:t}){let n=e.fileName,r=qK(n,t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--file`,children:(0,G.jsx)(AM,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary`,children:(0,G.jsx)(KK,{text:n,ranges:r})}),(0,G.jsx)(`span`,{className:`searchpalette-secondary`,children:JK(e.path)||`./`})]})]})}function eq({hit:e,query:t}){let n=zK(e.content,e.matchRanges,t),{text:r,ranges:i}=YK(e.content,n);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--text`,children:(0,G.jsx)(nN,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary searchpalette-code`,children:(0,G.jsx)(KK,{text:r,ranges:i})}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:JK(e.path)})]})]})]})}function tq({hit:e}){let t=e.content.indexOf(e.name),n=t>=0?e.content.slice(t+e.name.length).trimEnd():``,r=zK(e.name,e.matchRanges.length?nq(e):void 0,e.name);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--symbol`,title:e.kind,children:WK[e.kind]??`?`}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsxs)(`span`,{className:`searchpalette-primary`,children:[(0,G.jsx)(KK,{text:e.name,ranges:r}),n&&(0,G.jsx)(`span`,{className:`searchpalette-sigtail`,children:n.slice(0,60)})]}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:JK(e.path)})]})]}),(0,G.jsx)(`span`,{className:`searchpalette-kind-badge`,children:e.kind})]})}function nq(e){let t=e.content.indexOf(e.name);if(t<0)return;let n=[];for(let[r,i]of e.matchRanges){let a=r-t,o=i-t;o>0&&a<e.name.length&&n.push([Math.max(0,a),Math.min(e.name.length,o)])}return n.length?n:void 0}function rq({preview:e,theme:t,fontSize:n,defaultTabSize:r,lineWrap:i,showLineNumbers:a,lineHoverHighlight:o,onClose:s,inDiff:c,onGoToDiff:l}){let u=pj[t]||pj.nord,{data:d,isLoading:f,error:p}=AK(e.path),m=(0,W.useRef)(null);return(0,W.useEffect)(()=>{!d?.content||!e.line||!m.current||_j(m.current,e.line,e.match)},[d?.content,e.line,e.match]),(0,G.jsxs)(`div`,{className:`searchpalette-preview`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-preview-head`,children:[(0,G.jsx)(AM,{size:12}),(0,G.jsx)(`span`,{className:`searchpalette-preview-path`,children:e.path}),c&&(0,G.jsxs)(`button`,{className:`searchpalette-preview-diff-btn`,onClick:l,title:`Open this file and line in the main diff viewer (Enter)`,style:{padding:`2.5px 8px`,fontSize:`10.5px`,background:`var(--accent-subtle)`,border:`1px solid var(--accent)`,borderRadius:`4px`,color:`var(--text-primary)`,cursor:`pointer`,fontWeight:600,marginRight:`8px`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(MM,{size:11}),`View in Diff`]}),(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:s,"aria-label":`Close preview`,children:(0,G.jsx)(aN,{size:14})})]}),(0,G.jsx)(`div`,{className:`searchpalette-preview-body`,ref:m,children:f?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(IM,{size:15,className:`spin`}),` Loading `,e.path,`…`]}):p?(0,G.jsx)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:p.message}):d?.binary?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`Binary file — no preview`}):d?.missing?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`File not present in the working tree`}):d?(0,G.jsx)(zh,{file:{name:e.path,contents:d.content??``},options:{disableFileHeader:!0,overflow:i?`wrap`:`scroll`,disableLineNumbers:!a,lineHoverHighlight:o,theme:{dark:u.type===`dark`?u.themeName:`nord`,light:u.type===`light`?u.themeName:`github-light`},themeType:u.type,unsafeCSS:`
3848
+ }`}var aR=new WeakMap;function oR(e){let t=aR.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(TI,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),aR.set(e,i),i}function sR(e,t){if(!e.isConnected)return;let n=oR(t);if(n==null)return;let r=t.querySelector(`style[${EI}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(EI,``),t.appendChild(i)),i.textContent=`:host { ${DI}: ${n}px; }`}var cR;function lR(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){cR??(cR=new CSSStyleSheet,cR.replaceSync(rR(tR)));let t=!1;try{e.adoptedStyleSheets=[cR],t=!0}catch{}if(t){e.querySelector(`style[${CI}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(CI,``),t.textContent=rR(tR),e.prepend(t)}}function uR(e,t){dR(e,t),lR(t),sR(e,t)}function dR(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});uR(this,e)}}if(customElements.define(SI,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(SI)))e instanceof HTMLElement&&uR(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var fR=5,pR=1<<fR,mR=pR*4;function hR(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function gR(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function _R(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function vR(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function yR(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function bR(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function xR(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,TR(e,t)}function SR(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=vR(e).get(t);if(i===void 0)return;let a=i>>fR;e.childVisibleChunkSums[a]+=r}function CR(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=ER(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=pR}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function wR(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>fR;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<fR}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function TR(e,t){if(t.childIds.length<mR){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/pR),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>fR]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function ER(e,t,n,r){let i=Math.min(t.childIds.length,n+pR),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var DR=7,OR=3,kR=1<<OR,AR=4;function jR(e,t,n=0){return e<<AR|n<<OR|t}function MR(e){return e.depthAndFlags>>>AR}function NR(e){return(e.depthAndFlags&kR)>>OR}function PR(e){return(e.depthAndFlags&kR)!==0}function FR(e){return e.depthAndFlags&DR}function IR(e,t){return(FR(e)&t)!==0}function LR(e,t){e.depthAndFlags|=t}function RR(e,t){e.depthAndFlags=jR(t,FR(e),NR(e))}var zR=Symbol(`benchmarkInstrumentation`);function BR(e,t){return t==null||Object.defineProperty(e,zR,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function VR(e){return e==null?null:e[zR]??null}function Q(e,t,n){return e==null?n():e.measurePhase(t,n)}function HR(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function UR(e){return e>=48&&e<=57}function WR(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!UR(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&UR(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function GR(e){let t=e.toLowerCase();return{lowerValue:t,tokens:WR(t)}}function KR(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function qR(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=KR(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function JR(e,t,n){let r=qR(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function YR(e,t){return JR(e,t,GR)}function XR(e,t){return t===e.segments.length-1?e.isDirectory?1:0:1}function ZR(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=XR(e,r);return a===XR(t,r)?YR(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function QR(e,t){return ZR(e,t)}function $R(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=GR(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=XR(e,n);return o===XR(t,n)?JR(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function ez(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=GR(r);return e.sortKeyById[t]=i,i}function tz(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function nz(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function rz(e){let{hasTrailingSlash:t,segments:n}=nz(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function iz(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=nz(e);return{requiresDirectory:t,segments:n}}var az=``;function oz(){let e=new Map;return e.set(az,0),{idByValue:e,valueById:[az],sortKeyById:[GR(az)]}}function sz(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function cz(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var lz=Symbol(`pathStorePreparedInputKind`);function uz(e,t){return e[lz]=t,e}function dz(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function fz(e,t,n){return n===`default`?QR(e,t):n(dz(e),dz(t))}function pz(){return{depthAndFlags:jR(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function mz(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function hz(e){return e.isDirectory?e.segments.length:e.segments.length-1}function gz(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function _z(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function vz(e,t={}){return wz(e,t).map(e=>e.path)}function yz(e,t={}){let n=wz(e,t);return uz({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function bz(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return uz({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function xz(e){let t=e,n=t.preparedPaths;if(t[lz]===`prepared`&&n!=null)return n;if(!gz(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function Sz(e){let t=e;return t[lz]===`presorted`&&t.presortedPaths!=null||_z(t.presortedPaths)?t.presortedPaths:null}function Cz(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function wz(e,t={}){let n=tz(t),r=VR(t);HR(r,`workload.inputFiles`,e.length);let i=Q(r,`store.preparePathEntries.parse`,()=>e.map(e=>rz(e)));return Q(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>fz(e,t,n.sort))),i}var Tz=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[pz()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=oz();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=VR(e),this.options=tz(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,hR())}appendPaths(e){return Q(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>rz(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Q(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Q(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:jR(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:jR(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:jR(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=rz(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:jR(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:jR(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=rz(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Q(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Q(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?$R(this.lastPreparedPath,e,this.segmentSortKeyCache):fz(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=hz(e),i=n==null?0:hz(n),a=n==null?0:mz(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=sz(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:jR(MR(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),yR(i,s),s}createFileChildUnchecked(e,t){let n=sz(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:jR(MR(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),yR(r,a),a}getOrCreateDirectoryChild(e,t){let n=sz(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!PR(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:jR(MR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),yR(r,a),this.directories.set(a,hR()),a}createDirectoryChild(e,t){let n=sz(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:jR(MR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),yR(r,a),this.directories.set(a,hR()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!PR(n))throw Error(`Path is not a directory: "${t}"`);if(IR(n,1))throw Error(`Duplicate path: "${t}"`);LR(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,gR());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(PR(a)){let t=gR();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;PR(n)&&this.directories.set(t,hR());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),yR(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!PR(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return xR(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Ez(e,t=`closed`,n=null){let r=Oz(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Dz(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Oz(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function kz(e,t){return IR(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:MR(t)<=e.defaultExpansion}function Az(e,t,n=e.snapshot.nodes[t]){return n==null||!PR(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:kz(e,n)}function jz(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!PR(r))return;let i=kz(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function Mz(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Nz(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Pz(e,t){let n=Mz(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Fz(e,t){let n=Mz(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Iz(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Lz(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Rz(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function zz(e,t){e.directoryLoadInfoById.delete(t)}function Bz(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Vz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Hz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Uz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Wz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Gz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Kz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function qz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Jz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Yz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Xz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Zz(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Qz(e,t,n){return{...n,visibleCountDelta:lB(e)-t}}function $z(e,t){let n=lB(e),r=Dz();e.transactionStack.push(r);try{t()}catch(t){throw nB(e,r,!1),t}nB(e,r,!0,lB(e)-n)}function eB(e,t){let n=e.instrumentation;if(n==null){tB(e,t);return}Q(n,`store.events.record`,()=>tB(e,t))}function tB(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){sB(e,t);return}n.events.push(t),oB(n,t)}function nB(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?aB(i,t):Q(n,`store.events.batch.merge`,()=>aB(i,t));return}let a=rB(t,r),o=e.instrumentation;if(o==null){sB(e,a);return}Q(o,`store.events.batch.commit`,()=>sB(e,a))}function rB(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function iB(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function aB(e,t){for(let n of t.events)e.events.push(n);iB(e,t)}function oB(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function sB(e,t){let n=e.instrumentation;if(n==null){cB(e,t);return}Q(n,`store.events.emit`,()=>cB(e,t))}function cB(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function lB(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function uB(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!PR(n)||IR(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!PR(a)?null:i}function dB(e,t){let n=t;for(;;){let t=uB(e,n);if(t==null)return n;n=t}}function fB(e,t){let n=[t],r=t;for(;;){let t=uB(e,r);if(t==null)return n;n.push(t),r=t}}function pB(e,t){let n=t==null?e.snapshot.rootId:CB(e,t);return n==null?[]:DB(e,n)}function mB(e,t){let n=rz(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=HB(e,VB(e,r)),{createdNodeIds:a,directoryId:o}=OB(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=EB(e,o);if(IR(n,1))throw Error(`Path already exists: "${t}"`);LR(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=AB(e,o,n.basename),s.add(c);bB(e,o);let l=HB(e,o);return Vz({affectedAncestorIds:SB(e,c),affectedNodeIds:[...s],path:t,projectionChanged:UB(i,l)})}function hB(e,t,n){let r=CB(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=EB(e,r);if(IR(i,2))throw Error(`The root node cannot be removed`);if(PR(i)&&TB(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=HB(e,a),s=zB(e,r);NB(e,a,r,i.nameId),BB(e,a),bB(e,a);let c=HB(e,a);return Hz({affectedAncestorIds:SB(e,a),affectedNodeIds:s,path:t,projectionChanged:UB(o,c),recursive:n.recursive===!0})}function gB(e,t,n,r){let i=CB(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=EB(e,i);if(IR(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=LB(e,i,n),c=HB(e,a.parentId),l=HB(e,s.parentId),u=cz(e.snapshot.segmentTable,a.nameId),d=sz(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(PR(a)&&qB(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=_R(e.snapshot.nodes,TB(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&RB(e,p,o,NR(a))===`skip`)return null;let m=a.parentId;NB(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),KB(e,i),MB(e,s.parentId,i),BB(e,m),e.pathCacheVersion++,bB(e,m),s.parentId!==m&&bB(e,s.parentId);let h=HB(e,m),g=HB(e,s.parentId);return Uz({affectedAncestorIds:[...new Set([...SB(e,m),...SB(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:WB([c,l],[h,g]),to:yB(e,i)})}function _B(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function vB(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function yB(e,t){let n=EB(e,t),r=_B(e,t);if(r!=null)return r;if(IR(n,2))return vB(e,t,``);let i=yB(e,n.parentId),a=cz(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return vB(e,t,PR(n)?`${o}/`:o)}function bB(e,t){let n=e.instrumentation;if(n==null){YB(e,t);return}Q(n,`store.recomputeCountsUpwardFrom`,()=>YB(e,t))}function xB(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!PR(o)){JB(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){JB(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function SB(e,t){let n=[],r=t;for(;r!=null;){let t=EB(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function CB(e,t){if(t.length===0)return e.snapshot.rootId;let n=iz(t);return wB(e,n.segments,n.requiresDirectory)}function wB(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=TB(e,r),a=_R(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=EB(e,r);return n&&!PR(i)?null:r}function TB(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function EB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||IR(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function DB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||IR(n,4))return[];if(!PR(n))return[yB(e,t)];if(TB(e,t).childIds.length===0)return IR(n,1)&&!IR(n,2)?[yB(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||IR(n,4)){i.pop();continue}if(!PR(n)){r.push(yB(e,t.nodeId)),i.pop();continue}let a=TB(e,t.nodeId);if(a.childIds.length===0){IR(n,1)&&!IR(n,2)&&r.push(yB(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function OB(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=sz(e.snapshot.segmentTable,i),a=TB(e,r),o=_R(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!PR(EB(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=kB(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function kB(e,t,n){let r=EB(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:jR(MR(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,hR()),MB(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function AB(e,t,n){let r=sz(e.snapshot.segmentTable,n),i=TB(e,t);if(_R(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${ZB(e,t,n)}"`);let a=EB(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:jR(MR(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),MB(e,t,o),e.activeNodeCount++,o}function jB(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}PB(e,n,o)<0?i=a:r=a+1}return r}function MB(e,t,n){let r=TB(e,t),i=EB(e,n);_R(e.snapshot.nodes,r).set(i.nameId,n),SR(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=jB(e,r,n);r.childIds.splice(a,0,n),bR(r,a),TR(e.snapshot.nodes,r)}function NB(e,t,n,r){let i=TB(e,t),a=vR(i),o=a.get(n)??-1;_R(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&SR(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),bR(i,o),TR(e.snapshot.nodes,i))}function PB(e,t,n){let r=e.snapshot.options.sort;return r===`default`?FB(e,t,n):r(IB(e,t),IB(e,n))}function FB(e,t,n){let r=EB(e,t),i=EB(e,n),a=PR(r);if(a!==PR(i))return a?-1:1;let o=qR(ez(e.snapshot.segmentTable,r.nameId),ez(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=cz(e.snapshot.segmentTable,r.nameId),c=cz(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function IB(e,t){let n=EB(e,t),r=yB(e,t),i=PR(n),a=i?r.slice(0,-1):r;return{basename:cz(e.snapshot.segmentTable,n.nameId),depth:MR(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function LB(e,t,n){let r=EB(e,t),i=CB(e,n);if(i!=null){let t=EB(e,i);if(PR(t))return{basename:cz(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=iz(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=iz(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:wB(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function RB(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${yB(e,t)}"`);let i=EB(e,t);if(NR(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(PR(i)&&TB(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return zB(e,t),NB(e,a,t,o),BB(e,a),bB(e,a),`handled`}function zB(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=EB(e,t.nodeId);if(t.visitedChildren||!PR(i)){PR(i)&&e.snapshot.directories.delete(t.nodeId),LR(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),zz(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=TB(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function BB(e,t){let n=t;for(;n!=null;){let t=EB(e,n);if(!PR(t)||IR(t,2)||TB(e,n).childIds.length>0)return;LR(t,1),n=t.parentId===n?null:t.parentId}}function VB(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=_R(e.snapshot.nodes,TB(e,n)).get(t);if(i==null||!PR(EB(e,i)))break;n=i}return n}function HB(e,t){let n=GB(e,t);if(n==null)return null;let r=dB(e,n),i=EB(e,r),a=n===r?null:fB(e,n).map(t=>yB(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:TB(e,r).childIds.length>0,path:yB(e,r),terminalKind:NR(i)})}function UB(e,t){return WB([e],[t])}function WB(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function GB(e,t){let n=t;for(;n!=null;){let t=EB(e,n);if(!PR(t)||IR(t,2))return null;if(!Az(e,n,t))return n;n=t.parentId}return null}function KB(e,t){let n=EB(e,t);if(RR(n,(t===e.snapshot.rootId?-1:MR(EB(e,n.parentId)))+1),!PR(n))return;let r=TB(e,t);for(let t of r.childIds)KB(e,t)}function qB(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=EB(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function JB(e,t,n=EB(e,t),r=!1){let i=e.instrumentation;if(i==null){XB(e,t,n,r);return}Q(i,`store.recomputeNodeCounts`,()=>XB(e,t,n,r))}function YB(e,t){let n=t;for(;n!=null;){let t=EB(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(JB(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&SR(TB(e,s),n,a,o),n=s}}function XB(e,t,n,r){if(!PR(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=TB(e,t);if(r){let t=e.instrumentation;t==null?xR(e.snapshot.nodes,i):Q(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>xR(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,IR(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=uB(e,t)==null?Az(e,t,n)?1+o:1:o}function ZB(e,t,n){let r=yB(e,t);return r.length===0?n:`${r}${n}`}function QB(e){return e!=null&&!IR(e,4)}function $B(e,t){let n=e.snapshot.nodes[t];return!QB(n)||!PR(n)||IR(n,2)?null:n}function eV(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&QB(e.snapshot.nodes[n])&&(t+=1);return t}function tV(e){return Math.max(0,e.valueById.length-1)}function nV(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:eV(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:tV(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function rV(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function iV(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)$B(e,n)!=null&&t.push(yB(e,n));for(let t of e.expandedDirectoryIds)$B(e,t)!=null&&n.push(yB(e,t));return{collapsedPaths:t,expandedPaths:n}}function aV(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)$B(e,n)==null||Nz(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:yB(e,n)});return t}function oV(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=CB(e,n);t!=null&&jz(e,t,!0,EB(e,t))}for(let n of t.collapsedPaths){let t=CB(e,n);t!=null&&jz(e,t,!1,EB(e,t))}}function sV(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=CB(e,n.path);t!=null&&$B(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function cV(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function lV(e){let t=e.snapshot.segmentTable,n=oz();for(let r of e.snapshot.nodes)if(QB(r)){if(IR(r,2)){r.nameId=0;continue}r.nameId=sz(n,cz(t,r.nameId))}e.snapshot.segmentTable=n}function uV(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!QB(r)||!PR(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return QB(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[EB(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),xR(e.snapshot.nodes,n)}}function dV(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(QB(n))break;--t}e.snapshot.nodes.length=t+1}function fV(e){let t=iV(e),n=aV(e);Q(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>cV(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>lV(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>uV(e)),Q(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>dV(e)),Q(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>oV(e,t)),Q(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>sV(e,n)),Q(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>xB(e,e.snapshot.rootId))}function pV(e){let t=iV(e),n=aV(e),r=Q(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>pB(e)),i=BR({...e.snapshot.options},e.instrumentation),a=Q(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Tz(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,Q(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>oV(e,t)),Q(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>sV(e,n)),Q(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>xB(e,e.snapshot.rootId))}function mV(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function hV(e,t){let n=nV(e);t===`stable`?Q(e.instrumentation,`store.cleanup.stable`,()=>fV(e)):Q(e.instrumentation,`store.cleanup.aggressive`,()=>pV(e));let r=nV(e);return rV(t,t===`stable`,n,r)}var gV=64;function _V(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function vV(e){return EB(e,e.snapshot.rootId).visibleSubtreeCount}function yV(e,t,n,r){let i=EB(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function bV(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:zV(e,t.cursor),setSize:t.setSize,subtreeEndIndex:yV(e,t.cursor,t.index,n)}}function xV(e,t,n,r,i,a){let o=TB(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=CR(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return SV(e,u,l,r+c,i+1,s,o.childIds.length,a)}function SV(e,t,n,r,i,a,o,s){if(!PR(EB(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=NV(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=EB(e,c.terminalNodeId);if(!PR(l)||!Az(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return xV(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function CV(e,t){let n=vV(e);if(t<0||t>=n)return null;let r=xV(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>yB(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=bV(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:zV(e,r.cursor),setSize:r.setSize,subtreeEndIndex:yV(e,r.cursor,r.index,n)}}function wV(e,t,n){let r=e.instrumentation,i=vV(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return RV(e,o+1);let t=[],n=AV(e,a);for(let r=a;r<=o&&n!=null;r++){let r=zV(e,n);t.push(r),n=FV(e,n)}return t}let s=[],c=0,l=0,u=Q(r,`store.getVisibleSlice.selectFirstRow`,()=>AV(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Q(r,`store.getVisibleSlice.materializeRow`,()=>zV(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Q(r,`store.getVisibleSlice.advanceCursor`,()=>FV(e,u))}return HR(r,`workload.visibleRowsRead`,s.length),HR(r,`workload.flattenedRowsRead`,c),HR(r,`workload.flattenedSegmentsRead`,l),s}function TV(e,t=vV(e)){let n=e.instrumentation;return n==null?LV(e,t):Q(n,`store.getVisibleTreeProjection`,()=>LV(e,t))}function EV(e){return IV(TV(e))}function DV(e,t){let n=CB(e,t);if(n==null||n===e.snapshot.rootId||PR(EB(e,n))&&dB(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=EB(e,i).parentId,n=TB(e,t),s=vR(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=wR(a,n,s),t!==o){let n=EB(e,t),a=uB(e,t);if(!Az(e,t,n)&&a!==i)return null;dB(e,t)===t&&(r+=1)}i=t}return r}function OV(e,t){let n=CB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=EB(e,n);if(!PR(r))throw Error(`Path is not a directory: "${t}"`);return Az(e,n,r)?null:(jz(e,n,!0,r),bB(e,n),Wz({affectedAncestorIds:SB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function kV(e,t){let n=CB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=EB(e,n);if(!PR(r))throw Error(`Path is not a directory: "${t}"`);return Az(e,n,r)?(jz(e,n,!1,r),bB(e,n),Gz({affectedAncestorIds:SB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function AV(e,t){return t<0||t>=vV(e)?null:jV(e,e.snapshot.rootId,t,-1)}function jV(e,t,n,r){let i=TB(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?CR(e.snapshot.nodes,i,n):Q(a,`store.getVisibleSlice.selectChildIndex`,()=>CR(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return MV(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function MV(e,t,n,r){if(!PR(EB(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=NV(e,t,r);if(n===0)return i;let a=EB(e,i.terminalNodeId);if(!PR(a)||!Az(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return jV(e,i.terminalNodeId,n-1,i.visibleDepth)}function NV(e,t,n){return PR(EB(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:dB(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Q(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>dB(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function PV(e,t){let n=EB(e,t);if(!PR(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:uB(e,r)!==t}function FV(e,t){let n=EB(e,t.terminalNodeId);if(PR(n)){let r=TB(e,t.terminalNodeId);if(Az(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:MV(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=EB(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=TB(e,n),o=vR(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return MV(e,s,0,i);PV(e,r)&&i--,r=n}}function IV(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function LV(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(gV);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=_V(o,y);let x,S=_;if(PR(v))S=f?dB(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:yB(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&PR(C)&&Az(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function RV(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!PR(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:yB(e,f)};continue}let h=l?dB(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=zV(e,g);let _=i[h];_!=null&&PR(_)&&Az(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function zV(e,t){let n=EB(e,t.terminalNodeId),r=PR(n)?BV(e,t):null,i=yB(e,t.terminalNodeId),a=cz(e.snapshot.segmentTable,n.nameId),o=PR(n)&&TB(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?fB(e,t.headNodeId).map(n=>{let r=EB(e,n);return{isTerminal:n===t.terminalNodeId,name:cz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:yB(e,n)}}):Q(c,`store.getVisibleSlice.flatten.collectSegments`,()=>fB(e,t.headNodeId).map(n=>{let r=EB(e,n);return{isTerminal:n===t.terminalNodeId,name:cz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:yB(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:PR(n)&&Az(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:PR(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function BV(e,t){if(t.headNodeId===t.terminalNodeId)return Nz(e,t.terminalNodeId);let n=fB(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Nz(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function VV(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!PR(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&TR(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&PR(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,TR(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function HV(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var UV=class e{#e;constructor(e={}){let t=VR(e),n=Q(t,`store.builder.create`,()=>new Tz(e));if(e.preparedInput!=null){let t=Sz(e.preparedInput);t==null?n.appendPreparedPaths(xz(e.preparedInput),!1):n.appendPresortedPaths(t,Cz(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Q(t,`store.preparePathEntries`,()=>wz(r,e)))}let r=Q(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Q(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Q(t,`store.state.create`,()=>Ez(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Q(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||HV(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Q(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?Q(t,`store.state.initializeOpenVisibleCounts`,()=>VV(this.#e)):Q(t,`store.state.recomputeCounts`,()=>xB(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return vz(e,t)}static prepareInput(e,t={}){return yz(e,t)}static preparePresortedInput(e){return bz(e)}list(e){return Q(this.#e.instrumentation,`store.list`,()=>pB(this.#e,e))}add(e){Q(this.#e.instrumentation,`store.add`,()=>{let t=vV(this.#e);eB(this.#e,Qz(this.#e,t,mB(this.#e,e)))})}remove(e,t={}){Q(this.#e.instrumentation,`store.remove`,()=>{let n=vV(this.#e);eB(this.#e,Qz(this.#e,n,hB(this.#e,e,t)))})}move(e,t,n={}){Q(this.#e.instrumentation,`store.move`,()=>{let r=vV(this.#e),i=gB(this.#e,e,t,n);i!=null&&eB(this.#e,Qz(this.#e,r,i))})}batch(e){$z(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return Q(this.#e.instrumentation,`store.getVisibleCount`,()=>vV(this.#e))}getVisibleSlice(e,t){return Q(this.#e.instrumentation,`store.getVisibleSlice`,()=>wV(this.#e,e,t))}getVisibleRowContext(e){return Q(this.#e.instrumentation,`store.getVisibleRowContext`,()=>CV(this.#e,e))}getVisibleTreeProjection(){return EV(this.#e)}getVisibleTreeProjectionData(e){return TV(this.#e,e)}getVisibleIndex(e){return Q(this.#e.instrumentation,`store.getVisibleIndex`,()=>DV(this.#e,e))}getPathInfo(e){return Q(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=CB(this.#e,e);if(t==null)return null;let n=EB(this.#e,t);return{depth:MR(n),kind:PR(n)?`directory`:`file`,path:yB(this.#e,t)}})}isExpanded(e){return Q(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=EB(this.#e,t);return Az(this.#e,t,n)})}expand(e){Q(this.#e.instrumentation,`store.expand`,()=>{let t=vV(this.#e),n=OV(this.#e,e);n!=null&&eB(this.#e,Qz(this.#e,t,n))})}collapse(e){Q(this.#e.instrumentation,`store.collapse`,()=>{let t=vV(this.#e),n=kV(this.#e,e);n!=null&&eB(this.#e,Qz(this.#e,t,n))})}on(e,t){return Bz(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Nz(this.#e,t)}markDirectoryUnloaded(e){Q(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(TB(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=vV(this.#e);Fz(this.#e,t),eB(this.#e,Qz(this.#e,n,Kz({affectedAncestorIds:SB(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Q(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=vV(this.#e),r=Pz(this.#e,t);return eB(this.#e,Qz(this.#e,n,qz({affectedAncestorIds:SB(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Q(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Nz(this.#e,n)!==`loading`||!Lz(this.#e,n,e.attemptId))return!1;let r=yB(this.#e,n);this.validateChildPatch(r,t);let i=vV(this.#e),a=[];for(let e of t.operations){WV(r,e);let t=vV(this.#e);switch(e.type){case`add`:a.push(Qz(this.#e,t,mB(this.#e,e.path)));break;case`remove`:a.push(Qz(this.#e,t,hB(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=gB(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Qz(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return eB(this.#e,Qz(this.#e,i,Jz({affectedAncestorIds:SB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:yB(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Q(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=vV(this.#e),r=Iz(this.#e,t,e.attemptId);return eB(this.#e,Qz(this.#e,n,Yz({affectedAncestorIds:SB(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:yB(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Q(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=vV(this.#e),i=Rz(this.#e,n,e.attemptId,t);return eB(this.#e,Qz(this.#e,r,Xz({affectedAncestorIds:SB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:yB(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Q(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(mV(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=vV(this.#e),n=hV(this.#e,e.mode??`stable`);return eB(this.#e,Qz(this.#e,t,Zz({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=TB(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??GR(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=qR(ez(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!PR(EB(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=EB(this.#e,n);Az(this.#e,n,i)||(jz(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=EB(this.#e,e);if(!Az(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=CB(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!PR(EB(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!PR(EB(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=EB(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=EB(this.#e,e),r=uB(this.#e,e);if(!Az(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function WV(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var GV=e=>e.startsWith(`f::`)?e.slice(3):e;function KV(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function qV(e,t){return e===``?t:`${e}/${t}`}function JV({files:e,path:t,isFolder:n,nextBasename:r}){let i=GV(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=KV(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=qV(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function YV(e){return e.endsWith(`/`)}function XV(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function ZV(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function QV(e,t){return t.includes(e)?ZV(t):[e]}function $V(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function eH(e,t){return{draggedPaths:e,target:t}}function tH(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(YV(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function nH(e,t){return t.kind===`root`||t.directoryPath==null?XV(e):t.directoryPath}function rH(e,t){let n=e.map(e=>{let n=nH(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function iH(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function aH(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!iH(UV.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function oH(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function sH(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function cH(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function lH(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return cH(e,t.path)?n?e:null:e;case`move`:return sH(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=lH(r,e,n),r==null)return null;return r}}}function uH(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function dH(e){switch(e.operation){case`add`:return{...uH(e),operation:`add`,path:e.path};case`remove`:return{...uH(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...uH(e),from:e.from,operation:`move`,to:e.to}}}function fH(e){return{...uH(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>dH(e)),operation:`batch`}}function pH(e){switch(e.operation){case`add`:case`remove`:case`move`:return dH(e);case`batch`:return fH(e);default:return null}}function mH(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function hH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function gH(e){return hH(e).at(-1)??null}function _H(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function vH(e){return e.endsWith(`/`)}var yH=e=>e.toLowerCase();function bH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function xH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function SH(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var CH=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},wH=Symbol(`FILE_TREE_RENAME_VIEW`),TH=512,EH=512;function DH(e){return e===`top`||e===`center`?e:`nearest`}function OH(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=hH(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function kH(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:OH(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var AH=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=aH({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=gH(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:DH(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=EH){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=QV(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=eH(t.draggedPaths,n);(tH(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}$V(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=eH(e.draggedPaths,t);if(tH(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=rH(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=vH(r),a=xH(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of hH(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=bH(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[wH](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,vH(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,vH(e)?{recursive:!0}:void 0);return}let t=vH(e),n=JV({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:xH(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(SH(n.sourcePath,t),SH(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=aH({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!mH(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=gH(e),n=_H(e,t),r=null,i=null;for(let e of this.#be()){if(gH(e)!==t)continue;let a=_H(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=hH(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!mH(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new UV({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of hH(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(yH),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(yH),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of hH(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:CH(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of hH(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of hH(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=kH(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,TH)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=lH(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=lH(this.#c,e,!0),r=[...this.#B].map(t=>lH(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=lH(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return mH(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&oH(e)&&(this.#i=null);let t=oH(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=pH(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},jH=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function MH(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function NH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function PH(e,t){return t?`${e}/`:e}function FH(e,t=null){let n=jH(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=MH(t.path);if(e==null)continue;let n=PH(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of NH(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var IH=e=>e.trim().toLowerCase(),LH=e=>e.split(`/`).at(-1)??e,RH=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function zH(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function BH(e){let t=ZL(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(IH(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=LH(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return zH(c,e);for(let[t,n]of a)if(s.includes(t))return zH(n,e);let l=RH(n);for(let t of l){let n=i.get(t);if(n!=null)return zH(n,e)}let u=YL(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:qL(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:zH(s,e)}}}var VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH={},QH=[],$H=Array.isArray,eU=QH.slice,tU=Object.assign;function nU(e){e&&e.parentNode&&e.remove()}function rU(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?eU.call(arguments,2):n),iU(e,o,r,i,null)}function iU(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++HH,__i:-1,__u:0};return i==null&&VH.vnode!=null&&VH.vnode(a),a}function aU(e){return e.children}function oU(e,t){this.props=e,this.context=t,this.__g=0}function sU(e,t){if(t==null)return e.__?sU(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?sU(e):null}function cU(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return cU(e)}}function lU(e){(8&e.__g||!(e.__g|=8)||!UH.push(e)||GH++)&&WH==VH.debounceRendering||((WH=VH.debounceRendering)||queueMicrotask)(uU)}function uU(){for(var e,t,n,r,i,a,o,s,c=1;UH.length;)UH.length>c&&UH.sort(KH),e=UH.shift(),c=UH.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=tU({},r)).__v=r.__v+1,VH.vnode&&VH.vnode(n),vU(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??sU(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,bU(a,n,o),n.__e!=i&&cU(n)));GH=0}function dU(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||QH,b=t.length;for(c=fU(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?ZH:y[m.__i]||ZH,m.__i=f,_=vU(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&CU(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=pU(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function fU(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?iU(null,o,null,null,null):$H(o)?iU(aU,{children:o},null,null,null):o.constructor==null&&o.__b>0?iU(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=mU(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=sU(s)),wU(s,s));return r}function pU(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=pU(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=sU(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function mU(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function hU(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function gU(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||hU(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||hU(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(qH,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=JH,e.addEventListener(t,a?XH:YH,a)):e.removeEventListener(t,a?XH:YH,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function _U(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=JH++;else if(t.u<n.l)return;return n(VH.event?VH.event(t):t)}}}function vU(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=VH.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new oU(v,x),f.constructor=M,f.render=TU),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=tU({},f.__s)),tU(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=VH.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=tU({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===aU&&d.key==null&&(E=xU(d.props.children)),s=dU(e,$H(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)nU(a[j]);yU(t)}else t.__e=n.__e,t.__k=n.__k,e.then||yU(t);VH.__e(e,t,n)}else s=t.__e=SU(n.__e,t,n,r,i,a,o,c,l,u);return(d=VH.diffed)&&d(t),128&t.__u?void 0:s}function yU(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(yU)}function bU(e,t,n){for(var r=0;r<n.length;r++)CU(n[r],n[++r],n[++r]);VH.__c&&VH.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){VH.__e(e,t.__v)}})}function xU(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:$H(e)?e.map(xU):tU({},e)}function SU(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(VH.__m&&VH.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=eU.call(e.childNodes),v=n.props||ZH,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;gU(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||gU(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),dU(b==`template`?e.content:e,$H(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&sU(n,0),s,c,l),a!=null)for(u=a.length;u--;)nU(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||gU(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&gU(e,u,g,v[u],i))}return e}function CU(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){VH.__e(e,n)}}function wU(e,t,n){var r,i;if(VH.unmount&&VH.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||CU(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){VH.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&wU(r[i],t,n||typeof e.type!=`function`);n||nU(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function TU(e,t,n){return this.constructor(e,n)}function EU(e,t){var n,r,i,a;t==document&&(t=document.documentElement),VH.__&&VH.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=rU(aU,null,[e]),i=[],a=[],vU(t,e,r||ZH,ZH,t.namespaceURI,r?null:t.firstChild?eU.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),bU(i,e,a)}function DU(e,t){e.__u|=32,EU(e,t)}VH={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw GH=0,e}},HH=0,oU.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=tU({},this.state);typeof e==`function`&&(e=e(tU({},n),this.props)),e&&tU(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),lU(this))},oU.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),lU(this))},oU.prototype.render=aU,UH=[],GH=0,KH=function(e,t){return e.__v.__b-t.__v.__b},qH=/(PointerCapture)$|Capture$/i,JH=0,YH=_U(!1),XH=_U(!0);var OU=0;Array.isArray;function $(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--OU,__i:-1,__u:0,__source:i,__self:a};return VH.vnode&&VH.vnode(l),l}var kU=16,AU=16,jU={};function MU({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=jU[e]??{width:kU,height:AU},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`,h=o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`};return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...h,viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var NU=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},PU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},FU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},IU=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},LU=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},RU=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function zU({children:e,marker:t,variant:n=`default`}){"use no memo";let r=n===`fade`;return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):r?$(`span`,{"data-truncate-fade":!0}):t})})}function BU(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function VU({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(BU,{mode:t,children:e},`content`),o=$(zU,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function HU({children:e,...t}){"use no memo";return $(VU,{mode:`truncate`,...t,children:e})}function UU({children:e,...t}){"use no memo";return $(VU,{mode:`fruncate`,...t,children:e})}function WU({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=$(HU,{...s,children:t[0]}),l=$(UU,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?UU:HU,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=NU:r===`extension`?t=PU:r===`leaf-path`&&(t=FU);else if(typeof r==`number`)t=IU,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=LU:e===`first`&&(t=RU)}else typeof r==`function`&&(t=r);t??=NU;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=$(HU,{...s,..._,children:f}),l=$(UU,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var GU={endIndex:-1,startIndex:-1};function KU(e,t,n){return Math.min(Math.max(e,t),n)}function qU(e,t){return e<0||t<e?GU:{endIndex:t,startIndex:e}}function JU(e){return e.startIndex<0||e.endIndex<e.startIndex}function YU(e,t){return JU(e)?0:(e.endIndex-e.startIndex+1)*t}function XU(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function ZU(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function QU(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function $U(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function eW(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function tW(e,t,n){if(e.length===0||t<=0)return[];let r=eW(e),i=QU(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=$U(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function nW(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=KU(t.scrollTop,0,o),c=t.stickyRows??tW(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=XU(s,n,t.itemHeight),m=XU(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?GU:qU(m,ZU(u+d,n,t.itemHeight)),y=g+1,b=JU(v)?GU:qU(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=YU(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:JU(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var rW={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},iW={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},aW=`Contains git status items`;function oW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function sW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return oW({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function cW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function lW(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function uW(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function dW(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function fW(e,t){return e!=null&&e>0?e:t}function pW(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function mW(e,t,n,r,i=0){let a=oW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function hW(e,t,n,r,i,a,o=0){let s=sW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function gW(e,t,n,r,i,a){let o=cW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function _W(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function vW(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function yW({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function bW(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function xW(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var SW,CW,wW,TW,EW=Object.is,DW=0,OW=[],kW=VH,AW=kW.__b,jW=kW.__r,MW=kW.diffed,NW=kW.__c,PW=kW.unmount,FW=kW.__;function IW(e,t){kW.__h&&kW.__h(CW,e,DW||t),DW=0;var n=CW.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function LW(e){return DW=1,RW(XW,e)}function RW(e,t,n){var r=IW(SW++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):XW(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);EW(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=CW,!CW.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,EW(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};CW.__f=!0;var a=CW.shouldComponentUpdate,o=CW.componentWillUpdate;CW.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},CW.shouldComponentUpdate=i}return r.__N||r.__}function zW(e,t){var n=IW(SW++,3);!kW.__s&&YW(n.__H,t)&&(n.__=e,n.u=t,CW.__H.__h.push(n))}function BW(e,t){var n=IW(SW++,4);!kW.__s&&YW(n.__H,t)&&(n.__=e,n.u=t,CW.__h.push(n))}function VW(e){return DW=5,HW(function(){return{current:e}},[])}function HW(e,t){var n=IW(SW++,7);return YW(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function UW(e,t){return DW=8,HW(function(){return e},t)}function WW(){for(var e;e=OW.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(qW),e.__H.__h.forEach(JW),e.__H.__h=[]}catch(t){e.__H.__h=[],kW.__e(t,e.__v)}}kW.__b=function(e){CW=null,AW&&AW(e)},kW.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),FW&&FW(e,t)},kW.__r=function(e){jW&&jW(e),SW=0;var t=(CW=e.__c).__H;t&&(wW===CW?(t.__h=[],CW.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(qW),t.__h.forEach(JW),t.__h=[],SW=0)),wW=CW},kW.diffed=function(e){MW&&MW(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(OW.push(t)!==1&&TW===kW.requestAnimationFrame||((TW=kW.requestAnimationFrame)||KW)(WW)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),wW=CW=null},kW.__c=function(e,t){t.some(function(e){try{e.__h.forEach(qW),e.__h=e.__h.filter(function(e){return!e.__||JW(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],kW.__e(n,e.__v)}}),NW&&NW(e,t)},kW.unmount=function(e){PW&&PW(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{qW(e)}catch(e){t=e}}),n.__H=void 0,t&&kW.__e(t,n.__v))};var GW=typeof requestAnimationFrame==`function`;function KW(e){var t,n=function(){clearTimeout(r),GW&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);GW&&(t=requestAnimationFrame(n))}function qW(e){var t=CW,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),CW=t}function JW(e){var t=CW;e.__c=e.__(),CW=t}function YW(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!EW(t,e[n])})}function XW(e,t){return typeof t==`function`?t(e):t}function ZW(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $(aU,{children:[$(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:$(HU,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function QW(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function $W(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function eG(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function tG({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=nW(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:eG(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?eG(u,1,t,o):i&&r<=0&&c.length>0?tW(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var nG=400,rG=10,iG=40,aG=18;function oG(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?sG(e,t,n):a instanceof HTMLElement?a:null}function sG(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function cG(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function lG(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function uG(){return navigator.vendor!==`Apple Computer, Inc.`}function dG(e,t){let n=e-t.top;if(n<iG)return-Math.ceil((iG-Math.max(0,n))/iG*aG);let r=t.bottom-e;return r<iG?Math.ceil((iG-Math.max(0,r))/iG*aG):0}function fG(e,t){if(e!=null){let t=rW[e];return t==null?null:{text:t,title:iW[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:aW}:null}function pG(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function mG(e){return e!=null&&`toggle`in e}function hG(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function gG(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function _G(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function vG(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function yG(e,t){return t&&vG(e)||(e.ctrlKey||e.metaKey)&&hG(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var bG=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function xG(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function SG(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function CG(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function wG(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function TG(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function EG(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function DG(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function OG(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function kG(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=OG(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function AG(e,t){return{kind:e.kind,name:$W(e),path:t}}function jG(e){return e==null?void 0:`${e}__tree`}function MG(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function NG(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function PG(e,t){if(e==null)return null;if(`text`in e)return $(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?NG(e.icon)?t(e.icon):{name:e.icon}:NG(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(MU,{...n})})}function FG(e){e!=null&&lW(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function IG(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=QW(e);return $(aU,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(MU,{...t(`file-tree-icon-chevron`)}):$(MU,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?ZW(e,c,a):c??$(WU,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:PG(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:PG(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(MU,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function LG(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=QW(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??pG(t.ancestorPaths,v,y),ee=t.kind===`directory`&&(b?.has(P)??!1),te=A(t,P),B=fG(z,ee),V=S&&w,H=te!=null||x||V,ne=V&&T===`always`,re=a.getPath()===P,ie=re?a.getValue():``,ae=R||!re?null:$(yW,{ref:D,ariaLabel:`Rename ${$W(t)}`,isFlattened:t.isFlattened,value:ie,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),oe=IG(t,k,{actionLaneEnabled:V,customDecoration:te,decorationLaneEnabled:H,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:B,gitLaneActive:x,renameInput:ae,showDecorativeActionAffordance:ne}),se={...bW({ariaLabel:$W(t),domId:t.isFocused?MG(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:V,contextMenuButtonVisibility:V?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ee,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:CG(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&re?$(`div`,{...se,children:oe}):$(`button`,{...se,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:oe})}function RG(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(QW(e))).map((n,r)=>LG(e,n,t.start+r))}function zG({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=eR,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=VW(null),v=VW(null),y=VW(!1),b=VW(null),x=VW(null),S=VW(null),C=VW(null),w=VW(null),T=VW(new Map),E=VW(new Map),D=VW(()=>{}),O=VW(null),k=VW(0),A=VW(!1),j=VW(null);j.current!==t&&(A.current=!1,j.current=t);let M=VW(!1),N=VW(null),P=VW(null),F=VW(!1),I=VW(null),L=VW(null),R=VW(null),z=VW(null),ee=VW(null),te=VW(null),B=VW(null),V=VW(null),H=VW(!1),ne=VW(null),re=VW(null),ie=VW(null),ae=VW(null),oe=HW(()=>new Map,[]),[,se]=LW(0),[ce,le]=LW(null),[ue,U]=LW(null),[de,fe]=LW(null),[pe,me]=LW(null),[he,ge]=LW(0),[_e,ve]=LW(null),ye=VW(_e);ye.current=_e;let be=VW(null),xe=VW(null),Se=VW(null),Ce=VW(null),we=VW(null),Te=VW(!1),Ee=()=>{xe.current=null,Se.current=null,Ce.current=null},De=(e,t)=>{xe.current=e,Se.current=null,Ce.current=t==null?null:{path:e,scrollTop:t}},Oe=(e,t)=>{xe.current=null,Se.current={path:e,viewportOffset:t},Ce.current=null},ke=VW(d===`retain`&&t.isSearchOpen()),[Ae,je]=LW(p);zW(()=>{p||je(!1)},[p]);let Me=VW(!1),Ne=UW(()=>{Me.current=!0,je(e=>e&&!1)},[]),[Pe,Fe]=LW(()=>tG({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ie,Le]=LW(!1);zW(()=>{Le(!0)},[]);let Re=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,ze=e?.contextMenu?.triggerMode??(Re?`right-click`:`both`),W=ze===`both`||ze===`button`,G=e?.contextMenu?.buttonVisibility??`when-needed`,Be=ze===`both`||ze===`right-click`;BW(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;we.current=t,U(t),me(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Te.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ve=UW((e,t)=>{TG(T.current,e,t)},[]),He=UW((e,t)=>{TG(E.current,e,t)},[]),Ue=UW(e=>{x.current=e},[]),We=UW(e=>EG(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=HW(()=>BH(a),[a]),qe=t[wH](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=HW(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=jG(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Pe,dt=lt.physical.viewportHeight,ft=HW(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,_t=HW(()=>new Set(mt.map(e=>QW(e.row))),[mt]),vt=$e>=0&&$e>=ft.start&&$e<=ft.end,yt=UW((e,t)=>u?.({item:AG(e,t),row:e})??null,[u]),bt=UW(e=>lW(e==null?null:T.current.get(e)??null)?!0:lW(S.current),[]),xt=UW(e=>{bt(t.focusNearestPath(e))},[t,bt]),St=VW(xt);St.current=xt;let Ct=VW(!0),wt=VW(()=>{}),Tt=UW((t=!0)=>{let n=ye.current;n!=null&&(Ct.current=Ct.current&&t,ve(null),e?.contextMenu?.onClose?.(),Ct.current&&xt(n.path))},[e?.contextMenu,xt]);wt.current=Tt;let Et=UW(e=>{let t=e==null?null:wG(S.current,e);fe(e=>e===t?e:t)},[]),Dt=UW((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;De(n,e?.scrollTop??null),M.current=!0,le(e=>e===n?e:n)}i.focus(),Et(a),Ct.current=!0,ve({anchorRect:r?.anchorRect??null,item:AG(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Et]),Ot=UW(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=dW(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(me(`focus`),se(e=>e+1))}},[t,$e,s,l,dt]),kt=UW((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=dW(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:tG({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,gW(i,a,s,l,u,d),D.current(),be.current=n?e:null,!0},[t,s,c,dt,h]),At=()=>y.current===!0||ae.current!=null||H.current===!0,jt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Mt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Nt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},K=()=>{te.current?.remove(),te.current=null},Pt=()=>{Mt(L.current),L.current=null,ee.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{V.current?.(),V.current=null,ae.current!=null&&(clearTimeout(ae.current),ae.current=null),H.current=!1,ne.current=null,ie.current=null,re.current!=null&&(re.current.setAttribute(`draggable`,`true`),re.current.style.removeProperty(`touch-action`),re.current=null),K(),Nt(),Pt(),B.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=cG(oG(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Nt();return}let r=t.getItem(e.directoryPath),i=mG(r)?r:null;if(i==null||i.isExpanded()){Nt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Nt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},zt=()=>{L.current=null;let e=ee.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=dG(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Rt(Lt(e.clientX,e.clientY)),L.current=jt(zt)},Bt=(e,t)=>{ee.current={clientX:e,clientY:t},L.current??=jt(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),K(),Nt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(B.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),uG())){let t=lG(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),te.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{K(),Nt(),Pt(),B.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(ae.current!=null||H.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ie.current={clientX:i.clientX,clientY:i.clientY},re.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!H.current;ae.current!=null&&(clearTimeout(ae.current),ae.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),V.current===o&&(V.current=null),t&&(a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null)},s=e=>{let t=e.touches[0],n=ie.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=rG*rG||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),V.current=o,ae.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null;return}H.current=!0,re.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),B.current=n;let e=a.getBoundingClientRect(),s=lG(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Ft(s),te.current=s,ne.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=ne.current;n!=null&&te.current!=null&&(te.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};V.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},nG)},Wt=e=>{if(_e!=null){if(e.key===`Escape`){Tt(),e.preventDefault(),e.stopPropagation();return}bG.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ot(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=dW(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&gG(e)){t.openSearch(e.key),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Re&&vG(e),r=yG(e,Re),i=r&&S.current!=null?uW(S.current):null,a=r?new Set(DG(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;De(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=mG(p)?p:null,h=u!=null&&(_t.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=EG(u,E.current,T.current);e==null||n==null?y=!1:Dt(e,u)}else if((e.ctrlKey||e.metaKey)&&hG(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;me(`focus`);let b=t.getFocusedPath(),x=b!=null&&(_t.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))De(b,v?.scrollTop??null),M.current=!0,le(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Oe(b,kG(S.current,v,i,u,s,gt,dt)),M.current=!0,le(e=>e===b?e:b)):Ee()}se(e=>e+1),e.preventDefault(),e.stopPropagation()};BW(()=>{if(!(!f||!Xe)){if(ke.current){ke.current=!1;return}lW(w.current)}},[Xe,f]),BW(()=>{let e=x.current;switch(vW({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&kt(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(be.current=null,P.current=Je,lW(e),e.select());return}},[ft.end,ft.start,Je,kt,_t]),BW(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=uW(e)?.dataset.itemPath??null;le(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,uW(e)!=null){r();return}M.current=!1,le(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,le(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;le(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),BW(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),BW(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=dW(n,g);let a=()=>{let e=t.getVisibleCount(),r=fW(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Fe(tG({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=fW(O.current,g),i=t.getVisibleRows(e,e)[0]??null;mW(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?se(e=>e+1):o=!0,a()}),u=()=>{Te.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,ge(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Te.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ye.current!=null&&y.current&&wt.current(),Te.current===!0){y.current=!1;return}U(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:pW(e[0]))??dW(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),BW(()=>{Re||_e==null||Tt(!1)},[Tt,Re,_e]);let Gt=HW(()=>_e==null?null:`${_e.path}::${_e.source}`,[_e]);BW(()=>{if(Gt==null){m?.clearSlotContent(kI);return}let t=ye.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??SG(n.getBoundingClientRect()),close:e=>{wt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Ct.current&&St.current(ye.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(kI,i),e?.contextMenu?.onOpen?.(t.item,r),FG(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&FG(i)}),()=>{m?.clearSlotContent(kI)}},[Gt,e?.contextMenu,m]),BW(()=>{_e!=null&&t.getItem(_e.path)==null&&Tt()},[Tt,_e,t]),BW(()=>{if(_e==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(xG(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Tt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Tt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Tt,_e]),BW(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=uW(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=be.current,p=xe.current,m=Se.current,g=Ce.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,dt-s))):gt;E=!0,O=hW(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&gW(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&gW(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&gW(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&mW(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(gW(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(lW(r),d===Qe&&(be.current=null),p===Qe&&(xe.current=null),m?.path===Qe&&(Se.current=null),g?.path===Qe&&(Ce.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,vt,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>QW(e.row)===Qe),Jt=Kt||qt,Yt=W&&M.current===!0&&Jt?Qe:null,Xt=pe===`pointer`?ue:null,Zt=_e?.path??we.current??Xt??Yt??ue,Qt=_e?.source===`right-click`;BW(()=>{y.current&&_e==null||Et(We(Zt))},[_e,We,ft,dt,he,pt,Zt,Et,ut]);let $t=UW(e=>{if(y.current||xG(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&me(e=>e===`pointer`?e:`pointer`),U(e=>e===i?e:i)},[]),en=UW(()=>{U(null)},[]);BW(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let tn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=cG(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},nn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Nt(),Pt(),t.setDragTarget(null))},rn=e=>{!tt||t.getDragSession()==null||H.current||(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),K(),Nt(),Pt(),B.current=null)},an=lt.window.height,on=lt.window.offsetTop,sn=Math.min(0,dt-an),cn=Math.min(0,dt-an-gt),ln=ce===Qe||F.current,un=Qe!=null&&ln&&!vt&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,dn=un==null?null:_W($e,s,ft,an),fn=B.current,pn=at!=null&&fn!=null&&fn.path===at&&fn.index>=ft.start&&fn.index<=ft.end,mn=at!=null&&fn!=null&&fn.path===at&&!pn&&fn.path!==un?.path?fn:null,hn=mn==null?null:_W(mn.index,s,ft,an),gn=_G(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),_n=Xe&&Qe!=null?MG(o,Qe,!vt):void 0,vn=_e?.path??(Xe?Qe:ce),yn=_e?.path??ue,bn=We(Zt),xn=Re&&W&&!Qt&&!Ye&&bn!=null&&de!=null&&Zt!=null,Sn=Re&&(xn||_e!=null),Cn=_e?.anchorRect,wn=Cn==null&&bn!=null&&de!=null&&(_e!=null||xn)?de:null,Tn=Cn==null?wn==null?void 0:{top:`${wn}px`}:{left:`${Cn.left}px`,position:`fixed`,right:`auto`,top:`${Cn.top}px`},En=Qt?{opacity:`0`}:void 0,Dn=UW((e,n,r,i)=>{let a=xW({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,le(e=>e===c?e:c),me(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&kt(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,kt]),On=()=>{if(y.current||!W||Zt==null||bn==null)return;let e=t.getItem(Zt);e!=null&&(Et(bn),Ct.current=!0,ve({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:bn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},kn={contextHoverPath:yn,contextMenuButtonTriggerEnabled:W,contextMenuButtonVisibility:G,contextMenuEnabled:Re,contextMenuRightClickEnabled:Be,contextMenuTriggerMode:ze,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:oe,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:Dn,openContextMenuForRow:Dt,registerButton:Ve,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:yt,resolveIcon:Ke,shouldSuppressContextMenu:At,visualFocusPath:vn},An={...kn,registerButton:He};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Re&&W?G:void 0,"data-file-tree-context-menu-trigger-mode":Re?ze:void 0,"data-file-tree-has-context-menu-action-lane":Re&&W?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?nn:void 0,onDragOver:tt?tn:void 0,onDrop:tt?rn:void 0,onKeyDown:Wt,onPointerLeave:Re?en:void 0,onPointerOver:Re?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:gn}}),$(`slot`,{name:OI,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":_n,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ae?`true`:void 0,value:Ze,onBlur:()=>{d===`retain`&&!Me.current||t.closeSearch()},onFocus:Ne,onPointerDown:Ne,onInput:e=>{Ne();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ie&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>LG(An,e.row,`sticky:${QW(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${on}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${an}px`,top:`${sn}px`,bottom:`${cn}px`},children:[RG(kn,ft,_t),un!=null&&dn!=null?LG(kn,un,`parked:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===un.path?`none`:void 0,position:`absolute`,right:`0`,top:`${dn}px`}}):null,mn!=null&&hn!=null?LG(kn,mn,`parked-drag:${mn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${hn}px`}}):null]})]})]}),Re?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Sn?`true`:`false`,style:Tn,children:[$(`button`,{ref:v,type:`button`,"data-type":AI,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":_e==null?`false`:`true`,"data-visible":xn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),_e!=null){Tt();return}On()},tabIndex:-1,style:En,children:$(MU,{...Ke(`file-tree-icon-ellipsis`)})}),_e==null?null:$(`slot`,{name:kI})]}):null,_e==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Tt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Tt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var BG={hydrateRoot:(e,t)=>{DU(rU(zG,t),e)},renderRoot:(e,t)=>{EU(rU(zG,t),e)},unmountRoot:e=>{EU(null,e)}};function VG(e,t){BG.renderRoot(e,t)}function HG(e,t){BG.hydrateRoot(e,t)}function UG(e){BG.unmountRoot(e)}var WG=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},GG=`__c`,KG=`__k`,qG=`__d`,JG=`__s`,YG=/[\s\n\\/='"\0<>]/,XG=/^(xlink|xmlns|xml)([A-Z])/,ZG=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,QG=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,$G=new Set([`draggable`,`spellcheck`]);function eK(e){e.__g===void 0?e[qG]=!0:e.__g|=8}function tK(e){e.__g===void 0?e[qG]=!1:e.__g&=-9}function nK(e){return e.__g===void 0?!0===e[qG]:!!(8&e.__g)}var rK=/["&<]/;function iK(e){if(e.length===0||!1===rK.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var aK={},oK=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),sK=/[A-Z]/g;function cK(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:aK[n]||(aK[n]=n.replace(sK,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||oK.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function lK(){this.__d=!0}function uK(e,t){return{__v:e,context:t,props:e.props,setState:lK,forceUpdate:lK,__d:!0,__h:[]}}function dK(e,t,n){if(!e.s){if(n instanceof fK){if(!n.s)return void(n.o=dK.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(dK.bind(null,e,t),dK.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var fK=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{dK(r,1,a(this.v))}catch(e){dK(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?dK(r,1,t?t(i):i):n?dK(r,1,n(i)):dK(r,2,i)}catch(e){dK(r,2,e)}},r},e}(),pK,mK,hK,gK,_K={},vK=Array.isArray,yK=Object.assign,bK=``,xK=`<!--$s-->`,SK=`<!--/$s-->`;function CK(e,t){var n,r=e.type,i=!0;return e[GG]?(i=!1,(n=e[GG]).state=n[JG]):n=new r(e.props,t),e[GG]=n,n.__v=e,n.props=e.props,n.context=t,eK(n),n.state??=_K,n[JG]??(n[JG]=n.state),r.getDerivedStateFromProps?n.state=yK({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[JG]===n.state?n.state:n[JG]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),hK&&hK(e),n.render(n.props,n.state,t)}function wK(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===bK)return bK;var s=typeof e;if(s!=`object`)return s==`function`?bK:s==`string`?iK(e):e+bK;if(vK(e)){var c,l=bK;i[KG]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=wK(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=bK,vK(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return bK;e.__=i,pK&&pK(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===aU){if(`tpl`in g){for(var x=bK,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!vK(C)?x+=C:x+=wK(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+iK(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=CK(e,b),y=e[GG];else{e[GG]=y=uK(e,b);for(var E=0;nK(y)&&E++<25;){tK(y),hK&&hK(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}eK(y)}if(y.getChildContext!=null&&(t=yK({},t,y.getChildContext())),T&&VH.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===aU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return wK(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[JG]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,_K),nK(y)?(v=CK(e,t),(y=e[GG]).getChildContext!=null&&(t=yK({},t,y.getChildContext())),wK(v=v!=null&&v.type===aU&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):bK}finally{mK&&mK(e),gK&&gK(e)}}}v=v!=null&&v.type===aU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=wK(v,t,n,r,e,a,o);return mK&&mK(e),VH.unmount&&VH.unmount(e),e._suspended?typeof D==`string`?xK+D+SK:vK(D)?(D.unshift(xK),D.push(SK),D):D.then(function(e){return xK+e+SK}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return wK(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=VH.__e;return k&&k(i,e),bK}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=wK(v,t,n,r,e,a,o);return e._suspended?xK+s+SK:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=bK;for(var N in g){var P=g[N];if(typeof(P=EK(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=cK(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(XG.test(N))N=N.replace(XG,`$1:$2`).toLowerCase();else{if(YG.test(N))continue;N[4]!==`-`&&!$G.has(N)||P==null?n?QG.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):ZG.test(N)&&(N=N.toLowerCase()):P+=bK}}P!=null&&!1!==P&&(j=!0===P||P===bK?j+` `+N:j+` `+N+`="`+(typeof P==`string`?iK(P):P+bK)+`"`)}}if(YG.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=iK(A):A!=null&&!1!==A&&!0!==A&&(M=wK(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),mK&&mK(e),gK&&gK(e),!M&&TK.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return vK(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var TK=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function EK(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var DK=0;function OK(e){return e!=null&&e.length>0?e:(DK+=1,`pst_ft_${DK}`)}function kK({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??eR)}function AK(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function jK(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function MK(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var NK=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new WG;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=OK(a),this.#p=FH(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=$L(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new AH({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(UG(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),VG(t.wrapper,this.#w()))}setGitStatus(e){this.#p=FH(e,this.#p);let t=this.#T();t!=null&&VG(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),VG(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),HG(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),VG(r,this.#w())}#C(){return{initialViewportHeight:kK({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(OI,e());return}this.#l.setSlotHtml(OI,this.#e?.header?.html??null)}#k(e){let t=MK(e).find(e=>jK(e)),n=AK(KL(ZL(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=MK(e),n=t.find(e=>jK(e)),r=t.filter(e=>e!==n),i=ZL(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=AK(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=ZL(this.#m);t.colored&&JL(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${wI}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(wI,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=iR(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return uR(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function PK(e){let[t]=(0,W.useState)(()=>new NK(e)),n=(0,W.useRef)({timeout:null,model:t});return(0,W.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var FK=(0,W.memo)(function({files:e,activeFile:t,commentCounts:n,viewedFiles:r,untrackedFiles:i,onFileClick:a,collapsed:o,onToggleCollapse:s}){let[c,l]=(0,W.useState)(``),u=(0,W.useMemo)(()=>e.map(e=>e.name),[e]),d=(0,W.useMemo)(()=>{let e=new Set;return u.forEach(t=>{let n=t.split(`/`);for(let t=1;t<n.length;t++)e.add(n.slice(0,t).join(`/`))}),Array.from(e)},[u]),f=(0,W.useMemo)(()=>e.map(e=>{let t=`modified`;if(i.has(e.name))t=`untracked`;else if(e.prevName)t=`renamed`;else{let n=e.prevObjectId,r=e.newObjectId;n===`0000000`||n===`0000000000000000000000000000000000000000`?t=`added`:(r===`0000000`||r===`0000000000000000000000000000000000000000`)&&(t=`deleted`)}return{path:e.name,status:t}}),[e,i]),p=(0,W.useRef)({commentCounts:n,viewedFiles:r});p.current={commentCounts:n,viewedFiles:r};let{model:m}=PK({paths:u,fileTreeSearchMode:`hide-non-matches`,gitStatus:f,renderRowDecoration:(0,W.useCallback)(e=>{let t=e.item.path,{commentCounts:n,viewedFiles:r}=p.current,i=r.has(t),a=n[t]??0;return i&&a>0?{text:`✓ 💬 ${a}`,title:`Viewed, ${a} comment${a>1?`s`:``}`}:i?{text:`✓`,title:`Viewed`}:a>0?{text:`💬 ${a}`,title:`${a} comment${a>1?`s`:``}`}:null},[]),initialSelectedPaths:t?[t]:[],initialExpandedPaths:d,onSelectionChange:e=>{e.length>0&&e[0]!==t&&a(e[0])}});return(0,W.useEffect)(()=>{m.resetPaths(u,{initialExpandedPaths:d})},[u,d,m]),(0,W.useEffect)(()=>{m.setGitStatus(f)},[f,n,r,m]),(0,W.useEffect)(()=>{if(t)try{m.focusPath(t),m.scrollToPath(t,{focus:!0,offset:`nearest`})}catch(e){console.error(`Failed to scroll to active file:`,e)}},[t,m]),(0,W.useEffect)(()=>{m.setSearch(c||null)},[c,m]),o?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:s&&(0,G.jsx)(QT,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Expand sidebar`,children:(0,G.jsx)(iN,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[s&&(0,G.jsx)(QT,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(rN,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(dN,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:c,onChange:e=>l(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,G.jsx)(II,{model:m,className:`ft-pierre-tree`})})]})});function IK(e){return e.status===`resolved`?`resolved`:e.replies?.length?`replied`:`open`}var LK=[{key:`all`,label:`All`},{key:`open`,label:`Open`},{key:`replied`,label:`Replied`},{key:`resolved`,label:`Resolved`}];function RK({comments:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let[c,l]=(0,W.useState)(`all`),u=(0,W.useMemo)(()=>{let t={all:e.length,open:0,replied:0,resolved:0};for(let n of e)t[IK(n)]++;return t},[e]),d=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),f=(0,W.useMemo)(()=>c===`all`?d:d.filter(e=>IK(e)===c),[d,c]);return e.length===0?null:(0,G.jsxs)(`div`,{className:`cmt`,role:`complementary`,"aria-label":`Review comments`,children:[(0,G.jsxs)(`div`,{className:`cmt-head`,children:[(0,G.jsxs)(`div`,{className:`cmt-title`,children:[(0,G.jsx)($M,{size:14,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Comments`}),(0,G.jsx)(`span`,{className:`cmt-total`,children:e.length})]}),(0,G.jsx)(`div`,{className:`cmt-filters`,role:`tablist`,"aria-label":`Filter comments`,children:LK.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":c===e.key,className:`cmt-filter ${c===e.key?`cmt-filter-active`:``}`,onClick:()=>l(e.key),disabled:e.key!==`all`&&u[e.key]===0,children:[e.label,(0,G.jsx)(`span`,{className:`cmt-filter-count`,children:u[e.key]})]},e.key))})]}),(0,G.jsx)(`ul`,{className:`cmt-list`,"aria-label":`Comment threads`,children:f.length===0?(0,G.jsxs)(`li`,{className:`cmt-empty`,children:[`No `,c,` comments`]}):f.map(e=>(0,G.jsx)(zK,{comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s},e.id))})]})}function zK({comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let c=IK(e),l=e.status===`resolved`,u=e.replies?.length??0,{haptic:d,sound:f}=gM(),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(!1),x=(0,W.useCallback)(()=>{e.lineNumber>0?vj(e.filePath,e.lineNumber,e.side):document.getElementById(`file-${e.filePath}`)?.scrollIntoView({block:`start`})},[e.filePath,e.lineNumber,e.side]),S=e.lineNumber>0?`:${e.lineNumber}`:` · file`;return(0,G.jsxs)(`li`,{className:`cmt-card cmt-card-${c} ${l?`cmt-card-resolved`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-card-top`,children:[(0,G.jsx)(`span`,{className:`cmt-dot cmt-dot-${c}`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{className:`cmt-loc`,onClick:x,title:`Jump to ${e.filePath}${S}`,children:[(0,G.jsx)(`span`,{className:`cmt-loc-file`,children:fj(e.filePath)}),(0,G.jsx)(`span`,{className:`cmt-loc-line`,children:S})]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)})]}),e.lineContent?.trim()&&(0,G.jsx)(`button`,{className:`cmt-codeline`,onClick:x,title:`Jump to line`,children:(0,G.jsx)(`code`,{children:e.lineContent.trim().slice(0,160)})}),_?(0,G.jsx)(cI,{draftKey:`tracker-edit:${e.id}`,initialBody:e.body,onCancel:()=>v(!1),onSubmit:t=>{a(e.id,t),v(!1)}}):(0,G.jsx)(`div`,{className:`cmt-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}}),(0,G.jsxs)(`div`,{className:`cmt-actions`,children:[(0,G.jsxs)(`button`,{className:`cmt-act`,onClick:()=>{g(e=>!e),m(!0)},title:`Reply`,children:[(0,G.jsx)(VM,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Reply`})]}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>v(e=>!e),title:`Edit comment`,children:(0,G.jsx)(oN,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-act ${l?`cmt-act-resolved`:``}`,onClick:()=>{l?(n(e.id),d(`light`),f(`toggle`)):(t(e.id),d(`success`),f(`resolve`))},title:l?`Reopen`:`Resolve`,children:l?(0,G.jsx)(lN,{size:13,"aria-hidden":`true`}):(0,G.jsx)(AM,{size:13,"aria-hidden":`true`})}),y?(0,G.jsxs)(`span`,{className:`cmt-confirm`,children:[(0,G.jsx)(`button`,{className:`cmt-act cmt-act-danger`,onClick:()=>{r(e.id),d(`medium`),f(`remove`)},title:`Confirm delete`,children:`Delete?`}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>b(!1),title:`Cancel`,children:(0,G.jsx)(bN,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`cmt-act cmt-act-del`,onClick:()=>b(!0),title:`Delete comment`,children:(0,G.jsx)(hN,{size:13,"aria-hidden":`true`})})]}),u>0&&(0,G.jsxs)(`button`,{className:`cmt-thread-toggle`,onClick:()=>m(e=>!e),"aria-expanded":p,children:[(0,G.jsx)(MM,{size:12,className:`cmt-chev ${p?`cmt-chev-open`:``}`,"aria-hidden":`true`}),u,` `,u===1?`reply`:`replies`]}),p&&u>0&&(0,G.jsx)(`ul`,{className:`cmt-replies`,children:e.replies.map(t=>(0,G.jsx)(BK,{reply:t,onEdit:n=>o(e.id,t.id,n),onRemove:()=>s(e.id,t.id)},t.id))}),h&&(0,G.jsx)(cI,{draftKey:`reply:${e.id}`,onCancel:()=>g(!1),onSubmit:t=>{i(e.id,t),d(`light`),f(`success`),g(!1),m(!0)}})]})}function BK({reply:e,onEdit:t,onRemove:n}){let r=e.role===`agent`||e.role==null&&!!e.model,[i,a]=(0,W.useState)(!1);return(0,G.jsxs)(`li`,{className:`cmt-reply ${r?`cmt-reply-agent`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-reply-head`,children:[(0,G.jsxs)(`span`,{className:`cmt-reply-who ${r?`cmt-reply-who-agent`:``}`,children:[r?(0,G.jsx)(kM,{size:11,"aria-hidden":`true`}):null,r?e.model||`Agent`:`You`]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:dj(e.createdAt)}),!r&&(0,G.jsx)(`button`,{className:`cmt-reply-act`,onClick:()=>a(e=>!e),title:`Edit reply`,children:(0,G.jsx)(oN,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-reply-act cmt-act-del`,onClick:n,title:`Delete reply`,children:(0,G.jsx)(hN,{size:11,"aria-hidden":`true`})})]}),i?(0,G.jsx)(cI,{draftKey:`tracker-reply-edit:${e.id}`,initialBody:e.body,onCancel:()=>a(!1),onSubmit:e=>{t(e),a(!1)}}):(0,G.jsx)(`div`,{className:`cmt-reply-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(e.body)}})]})}function VK(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function HK(e){return e===`symbols`?2:e===`text`?1:0}function UK({scope:e,query:t,regex:n,changedOnly:r,changedPaths:i,open:a}){let o=VK(t,130).trim(),s=a&&o.length>=HK(e);return{...nt({queryKey:[`search`,e,o,e===`text`?n:!1,r,r?i:null],enabled:s,placeholderData:V,staleTime:5e3,queryFn:async({signal:t})=>{let a=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:t,body:JSON.stringify({scope:e,query:o,regex:e===`text`?n:!1,changedPaths:r?i:void 0})});if(!a.ok)throw Error(`Search request failed (${a.status})`);return await a.json()}}),enabled:s,pending:t.trim()!==o,minLength:HK(e)}}function WK(e,t){fetch(`/api/search/track`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:e,path:t})}).catch(()=>{})}function GK(e){return nt({queryKey:[`file-text`,e],enabled:!!e,staleTime:300*1e3,queryFn:async({signal:t})=>{let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`,{signal:t});if(n.status===415)return{content:null,missing:!1,binary:!0};if(!n.ok)throw Error(`Failed to load file (${n.status})`);let r=await n.json();if(r.error){if(/binary/i.test(r.error))return{content:null,missing:!1,binary:!0};throw Error(r.error)}return r.missing?{content:null,missing:!0,binary:!1}:{content:r.content??``,missing:!1,binary:!1}}})}var KK=[{pattern:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s+)?function/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?class\s+(\w[\w$]*)/i,kind:`class`,nameGroup:1},{pattern:/^\s*(?:export\s+)?interface\s+(\w[\w$]*)/i,kind:`interface`,nameGroup:1},{pattern:/^\s*(?:export\s+)?type\s+(\w[\w$]*)\s*=/i,kind:`type`,nameGroup:1},{pattern:/^\s*(?:export\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=/i,kind:`variable`,nameGroup:1},{pattern:/^\s*def\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?fn\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?struct\s+(\w[\w$]*)/i,kind:`struct`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?impl\s+(\w[\w$]*)/i,kind:`impl`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?trait\s+(\w[\w$]*)/i,kind:`trait`,nameGroup:1},{pattern:/^\s*func\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:func\s+)?\((\w[\w$]*)\s+\*?\w+\)\s+(\w[\w$]*)\s*\(/i,kind:`method`,nameGroup:2}];function qK(e){for(let{pattern:t,kind:n,nameGroup:r}of KK){let i=t.exec(e);if(i){let e=i[r];if(e)return{name:e,kind:n}}}return null}function JK(e){return new Set(e.map(e=>e.name))}function YK(e){let t=new Set;for(let n of e)n.side===`additions`&&t.add(`${n.filePath}:${n.lineNumber}`);return t}function XK(e,t){return e.kind===`file`?t.diffFileSet.has(e.path)?{type:`scrollFile`,path:e.path}:{type:`preview`,path:e.path}:t.diffFileSet.has(e.path)?{type:`scrollLine`,path:e.path,line:e.line,side:`additions`,match:e.match}:{type:`preview`,path:e.path,line:e.line,match:e.match}}function ZK(e,t){if(!t||t.length===0)return null;let n=!0;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127){n=!1;break}let r=n?e.length:$K(e),i=null;if(!n){i=Array(r+1).fill(-1);let t=0;for(let n=0;n<e.length;){i[t]=n;let r=e.codePointAt(n);n+=r>65535?2:1,t+=QK(r)}i[r]=e.length}let a=[];for(let e of t){let[t,o]=e;if(!(t==null||o==null||o<=t||t<0||o>r))if(n)a.push([t,o]);else{let e=i[t],n=i[o];e>=0&&n>=0&&a.push([e,n])}}return a.length?a:null}function QK(e){return e<=127?1:e<=2047?2:e<=65535?3:4}function $K(e){let t=0;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=QK(r),n+=r>65535?2:1}return t}function eq(e,t,n){let r=((t?ZK(e,t):null)??tq(e,n)).map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]),i=[];for(let[e,t]of r){let n=i[i.length-1];n&&e<=n[1]?n[1]=Math.max(n[1],t):i.push([e,t])}return i}function tq(e,t){let n=t.trim();if(!n)return[];let r=[],i=e.toLowerCase(),a=n.toLowerCase(),o=0;for(;r.length<50;){let e=i.indexOf(a,o);if(e===-1)break;r.push([e,e+a.length]),o=e+a.length}return r}function nq(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(!r)return 0;let i=0,a=0,o=-1;for(let e=0;e<n.length&&i<r.length;e++)n[e]===r[i]&&(a+=o>=0&&e-o===1?5:1,o=e,i++);return i===r.length?a-e.length*.01:null}function rq(e){let t=[],n=new Set;for(let r of e){if(r.side!==`additions`)continue;let e=qK(r.content);if(e){let i=`${r.filePath}:${r.lineNumber}:${e.name}`;if(n.has(i))continue;n.add(i);let a=r.content.indexOf(e.name),o=a>=0?[[a,a+e.name.length]]:[];t.push({name:e.name,kind:e.kind,path:r.filePath,fileName:r.filePath.split(`/`).pop()||``,line:r.lineNumber,content:r.content,matchRanges:o,gitStatus:``})}}return t}var iq=[{key:`all`,label:`All`,Icon:JM},{key:`files`,label:`Files`,Icon:UM},{key:`text`,label:`Text`,Icon:_N},{key:`symbols`,label:`Symbols`,Icon:BM}],aq={function:`ƒ`,method:`m`,class:`C`,variable:`v`,interface:`I`,type:`T`,enum:`E`,struct:`S`,impl:`i`,trait:`t`};function oq(e){switch(e){case`modified`:return{label:`M`,title:`modified`};case`untracked`:return{label:`U`,title:`untracked`};case`staged_new`:case`added`:return{label:`A`,title:`added`};case`deleted`:return{label:`D`,title:`deleted`};case`renamed`:return{label:`R`,title:`renamed`};case``:case`clean`:return null;default:return{label:e.charAt(0).toUpperCase(),title:e}}}function sq({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`searchpalette-mark`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}function cq(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}var lq=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)};function uq(e,t){let n=e.length-e.trimStart().length,r=e.slice(n),i=n;if(r.length>400){let e=t.find(e=>e[0]>=n),a=e?Math.max(0,e[0]-n-24):0,o=a>0?`…`:``;r=o+r.slice(a,a+400),i=n+a-o.length}let a=t.map(([e,t])=>[e-i,t-i]).filter(([e,t])=>t>0&&e<r.length).map(([e,t])=>[Math.max(0,e),Math.min(r.length,t)]);return{text:r,ranges:a}}function dq({isOpen:e,onClose:t,initialScope:n,files:r,changedEntries:i,customMode:a,staged:o,onNavigateFile:s,theme:c,fontSize:l,defaultTabSize:u,lineWrap:d,showLineNumbers:f,lineHoverHighlight:p}){let[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(n),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(!1),[S,C]=(0,W.useState)(0),[w,T]=(0,W.useState)(null),E=(0,W.useRef)(null),D=(0,W.useRef)(null),O=(0,W.useMemo)(()=>JK(r),[r]),k=(0,W.useMemo)(()=>YK(i),[i]),A=UK({scope:g,query:m,regex:v,changedOnly:b,changedPaths:(0,W.useMemo)(()=>[...O],[O]),open:e}),j=A.data&&A.data.scope===g?A.data:void 0,M=j?.error,N=nt({queryKey:[`repo-files-fallback`],enabled:e&&g===`files`&&!!M,staleTime:6e4,queryFn:async()=>(await(await fetch(`/api/repo-files`)).json()).files??[]});(0,W.useEffect)(()=>{e&&(h(``),_(n),y(!1),x(!1),C(0),T(null))},[e,n]),(0,W.useEffect)(()=>{e&&E.current?.focus()},[e]),(0,W.useEffect)(()=>{C(0),T(null)},[m,g]);let P=(0,W.useMemo)(()=>{let e=m.trim(),t=e.toLowerCase(),n=[];if(g===`files`&&M&&N.data)n=N.data.map(e=>({path:e,score:t?nq(e,t):0})).filter(e=>e.score!==null).sort((e,t)=>t.score-e.score).slice(0,60).map(({path:e})=>({kind:`file`,key:e,hit:{path:e,fileName:fj(e),gitStatus:``,matchType:``,exact:!1},inDiff:O.has(e)}));else if(j)j.scope===`files`?n=j.items.map(e=>({kind:`file`,key:e.path,hit:e,inDiff:O.has(e.path)})):j.scope===`text`?n=j.items.map(e=>({kind:`text`,key:`${e.path}:${e.line}:${e.col}`,hit:e,inDiff:O.has(e.path)})):j.scope===`symbols`?n=j.items.map(e=>({kind:`symbol`,key:`${e.path}:${e.line}:${e.name}`,hit:e,inDiff:O.has(e.path)})):j.scope===`all`&&(n=j.items.map(e=>e.kind===`file`?{kind:`file`,key:`all:${e.hit.path}`,hit:e.hit,inDiff:O.has(e.hit.path)}:e.kind===`text`?{kind:`text`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.col}`,hit:e.hit,inDiff:O.has(e.hit.path)}:{kind:`symbol`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.name}`,hit:e.hit,inDiff:O.has(e.hit.path)}));else if(g===`symbols`&&e.length<2){let e=rq(i);n=(t?e.filter(e=>e.name.toLowerCase().includes(t)):e).map(e=>({kind:`symbol`,key:`local:${e.path}:${e.line}:${e.name}`,hit:e,inDiff:!0}))}let r=n.filter(e=>e.inDiff),a=n.filter(e=>!e.inDiff);return[...r,...a]},[j,M,N.data,g,O,m,i]);(0,W.useEffect)(()=>{S>=P.length&&C(0)},[P.length,S]),(0,W.useEffect)(()=>{(D.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[S,P]);let F=(0,W.useMemo)(()=>({diffFileSet:O,changedKeys:k,customMode:a,staged:o}),[O,k,a,o]),I=(0,W.useCallback)((e,n)=>{let r=P[e];if(!r)return;let i=r.hit.path,a=m.trim();if(WK(a,i),r.kind===`file`){if(n){T({path:i});return}XK({kind:`file`,path:i},F).type===`scrollFile`?(t(),requestAnimationFrame(()=>s(i))):T({path:i});return}let o=r.hit.line,c=r.kind===`symbol`?r.hit.name:a;if(n){T({path:i,line:o,match:c});return}let l=XK({kind:`line`,path:i,line:o,match:c},F);l.type===`scrollLine`?(t(),requestAnimationFrame(()=>vj(i,l.line,l.side,l.match))):T({path:i,line:o,match:c})},[P,m,F,t,s]),L=(0,W.useCallback)(e=>{_(t=>iq[(iq.findIndex(e=>e.key===t)+e+iq.length)%iq.length].key)},[]),R=(0,W.useCallback)(e=>{if(e.key===`PageDown`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:150,behavior:`auto`});return}if(e.key===`PageUp`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-150,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.key===`Tab`){e.preventDefault(),L(e.shiftKey?-1:1);return}let t=e=>{P.length!==0&&C(t=>(t+e+P.length)%P.length)};e.key===`ArrowDown`||e.ctrlKey&&(e.key===`n`||e.key===`j`)?(e.preventDefault(),t(1)):e.key===`ArrowUp`||e.ctrlKey&&(e.key===`p`||e.key===`k`)?(e.preventDefault(),t(-1)):e.ctrlKey&&e.key===`d`?(e.preventDefault(),t(8)):e.ctrlKey&&e.key===`u`?(e.preventDefault(),t(-8)):e.key===`Enter`&&(e.preventDefault(),I(S,e.metaKey||e.ctrlKey))},[L,P.length,I,S]),z=(0,W.useCallback)(()=>{w?T(null):t()},[w,t]),ee=j?.total??P.length,te=(A.isFetching||A.pending)&&A.enabled,B=j?.indexing;return(0,G.jsxs)(ZF,{open:e,onClose:z,className:`searchpalette ui-modal--palette ${w?`searchpalette--split`:``}`,ariaLabel:`Search files, text and symbols`,initialFocus:E,onKeyDown:R,children:[(0,G.jsxs)(`div`,{className:`searchpalette-header`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-input-row`,children:[(0,G.jsx)(dN,{size:15,className:`searchpalette-search-icon`}),(0,G.jsx)(`input`,{ref:E,type:`text`,className:`searchpalette-input`,placeholder:g===`all`?`Search files, text and symbols…`:g===`files`?`Search files in the repo…`:g===`text`?v?`Search by regular expression…`:`Search file contents…`:`Search symbol definitions…`,value:m,onChange:e=>h(e.target.value),role:`combobox`,"aria-expanded":P.length>0,"aria-controls":`searchpalette-list`,"aria-activedescendant":P[S]?`sp-row-${S}`:void 0,spellCheck:!1,autoComplete:`off`}),te&&(0,G.jsx)(YM,{size:14,className:`searchpalette-spinner spin`}),m&&(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:()=>h(``),"aria-label":`Clear search`,children:(0,G.jsx)(bN,{size:14})}),(0,G.jsx)(`span`,{className:`searchpalette-count`,children:B?`indexing…`:j?`${P.length} of ${ee}`:``})]}),(0,G.jsxs)(`div`,{className:`searchpalette-controls`,children:[(0,G.jsx)(`div`,{className:`searchpalette-scopes`,role:`tablist`,"aria-label":`Search scope`,children:iq.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":g===e.key,className:`searchpalette-scope ${g===e.key?`is-active`:``}`,onClick:()=>_(e.key),children:[(0,G.jsx)(e.Icon,{size:12}),e.label]},e.key))}),(0,G.jsxs)(`div`,{className:`searchpalette-toggles`,children:[g===`text`&&(0,G.jsx)(`button`,{className:`searchpalette-toggle ${v?`is-active`:``}`,onClick:()=>y(e=>!e),title:`Regular expression`,"aria-pressed":v,children:`.*`}),(0,G.jsxs)(`button`,{className:`searchpalette-toggle ${b?`is-active`:``}`,onClick:()=>x(e=>!e),title:`Limit to files in the current diff`,"aria-pressed":b,children:[(0,G.jsx)(GM,{size:12}),`Changed`]})]})]}),j?.regexError&&(0,G.jsx)(`div`,{className:`searchpalette-note`,children:`Invalid regex — showing literal matches`})]}),(0,G.jsxs)(`div`,{className:`searchpalette-body`,children:[(0,G.jsx)(`div`,{className:`searchpalette-list`,id:`searchpalette-list`,role:`listbox`,ref:D,children:(0,G.jsx)(fq,{rows:P,scope:g,query:m,focusedIndex:S,engineError:M,isFetching:A.isFetching,enabled:A.enabled,minLength:A.minLength,regex:v,changedOnly:b,onHover:C,onActivate:(e,t)=>I(e,t?t.metaKey||t.ctrlKey:!1),onRetry:()=>A.refetch()})}),w&&(0,G.jsx)(vq,{preview:w,theme:c,fontSize:l,defaultTabSize:u,lineWrap:d,showLineNumbers:f,lineHoverHighlight:p,onClose:()=>T(null),inDiff:O.has(w.path),onGoToDiff:()=>{t(),w.line?requestAnimationFrame(()=>vj(w.path,w.line,`additions`,w.match)):requestAnimationFrame(()=>s(w.path))}},w.path)]}),(0,G.jsxs)(`div`,{className:`searchpalette-foot`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`Tab`}),` scope`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↑↓`}),` move`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↵`}),` `,w&&O.has(w.path)?`view in diff`:`open`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌘↵`}),` peek`]}),w&&(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌥↑↓`}),` / `,(0,G.jsx)(`kbd`,{children:`⇧↑↓`}),` scroll preview`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`esc`}),` `,w?`back`:`close`]})]})]})}function fq({rows:e,scope:t,query:n,focusedIndex:r,engineError:i,isFetching:a,enabled:o,minLength:s,regex:c,changedOnly:l,onHover:u,onActivate:d,onRetry:f}){return i&&t!==`files`?(0,G.jsxs)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:[(0,G.jsx)(`p`,{children:`Search engine unavailable`}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:i}),(0,G.jsx)(`button`,{className:`searchpalette-retry`,onClick:f,children:`Retry`})]}):e.length>0?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(pq,{row:e,index:t,query:n,focused:t===r,onHover:u,onActivate:d},e.key))}):o?a?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(YM,{size:15,className:`spin`}),` Searching…`]}):(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsxs)(`p`,{children:[`No matches`,n.trim()?` for “${n.trim()}”`:``]}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:l?`Searching only changed files — turn off Changed to search the whole repo`:t===`text`&&!c?`Try Tab to switch scope, or enable .* for regex`:`Try Tab to switch scope`})]}):(0,G.jsx)(`div`,{className:`searchpalette-state`,children:t===`symbols`?n.trim()?`No matching symbols in the current diff. Type at least 2 characters to search the whole repository.`:`No symbols found in the current diff. Type at least 2 characters to search the whole repository.`:t===`text`?`Type to search file contents`:`Type to filter — or browse all files`})}function pq({row:e,index:t,query:n,focused:r,onHover:i,onActivate:a}){let o=oq(e.hit.gitStatus);return(0,G.jsxs)(`div`,{id:`sp-row-${t}`,role:`option`,"aria-selected":r,"data-focused":r,className:`searchpalette-row ${r?`is-focused`:``} ${e.inDiff?`is-indiff`:``}`,onMouseEnter:()=>i(t),onClick:e=>a(t,e),children:[e.kind===`file`&&(0,G.jsx)(mq,{hit:e.hit,query:n}),e.kind===`text`&&(0,G.jsx)(hq,{hit:e.hit,query:n}),e.kind===`symbol`&&(0,G.jsx)(gq,{hit:e.hit}),(0,G.jsxs)(`div`,{className:`searchpalette-rail`,children:[e.inDiff&&(0,G.jsx)(`span`,{className:`searchpalette-pill searchpalette-pill--diff`,children:`diff`}),o&&(0,G.jsx)(`span`,{className:`searchpalette-git searchpalette-git--${o.title}`,title:o.title,children:o.label})]})]})}function mq({hit:e,query:t}){let n=e.fileName,r=cq(n,t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--file`,children:(0,G.jsx)(UM,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary`,children:(0,G.jsx)(sq,{text:n,ranges:r})}),(0,G.jsx)(`span`,{className:`searchpalette-secondary`,children:lq(e.path)||`./`})]})]})}function hq({hit:e,query:t}){let n=eq(e.content,e.matchRanges,t),{text:r,ranges:i}=uq(e.content,n);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--text`,children:(0,G.jsx)(_N,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary searchpalette-code`,children:(0,G.jsx)(sq,{text:r,ranges:i})}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:lq(e.path)})]})]})]})}function gq({hit:e}){let t=e.content.indexOf(e.name),n=t>=0?e.content.slice(t+e.name.length).trimEnd():``,r=eq(e.name,e.matchRanges.length?_q(e):void 0,e.name);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--symbol`,title:e.kind,children:aq[e.kind]??`?`}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsxs)(`span`,{className:`searchpalette-primary`,children:[(0,G.jsx)(sq,{text:e.name,ranges:r}),n&&(0,G.jsx)(`span`,{className:`searchpalette-sigtail`,children:n.slice(0,60)})]}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:lq(e.path)})]})]}),(0,G.jsx)(`span`,{className:`searchpalette-kind-badge`,children:e.kind})]})}function _q(e){let t=e.content.indexOf(e.name);if(t<0)return;let n=[];for(let[r,i]of e.matchRanges){let a=r-t,o=i-t;o>0&&a<e.name.length&&n.push([Math.max(0,a),Math.min(e.name.length,o)])}return n.length?n:void 0}function vq({preview:e,theme:t,fontSize:n,defaultTabSize:r,lineWrap:i,showLineNumbers:a,lineHoverHighlight:o,onClose:s,inDiff:c,onGoToDiff:l}){let u=pj[t]||pj.nord,{data:d,isLoading:f,error:p}=GK(e.path),m=(0,W.useRef)(null);return(0,W.useEffect)(()=>{!d?.content||!e.line||!m.current||_j(m.current,e.line,e.match)},[d?.content,e.line,e.match]),(0,G.jsxs)(`div`,{className:`searchpalette-preview`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-preview-head`,children:[(0,G.jsx)(UM,{size:12}),(0,G.jsx)(`span`,{className:`searchpalette-preview-path`,children:e.path}),c&&(0,G.jsxs)(`button`,{className:`searchpalette-preview-diff-btn`,onClick:l,title:`Open this file and line in the main diff viewer (Enter)`,style:{padding:`2.5px 8px`,fontSize:`10.5px`,background:`var(--accent-subtle)`,border:`1px solid var(--accent)`,borderRadius:`4px`,color:`var(--text-primary)`,cursor:`pointer`,fontWeight:600,marginRight:`8px`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(GM,{size:11}),`View in Diff`]}),(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:s,"aria-label":`Close preview`,children:(0,G.jsx)(bN,{size:14})})]}),(0,G.jsx)(`div`,{className:`searchpalette-preview-body`,ref:m,children:f?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(YM,{size:15,className:`spin`}),` Loading `,e.path,`…`]}):p?(0,G.jsx)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:p.message}):d?.binary?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`Binary file — no preview`}):d?.missing?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`File not present in the working tree`}):d?(0,G.jsx)(zh,{file:{name:e.path,contents:d.content??``},options:{disableFileHeader:!0,overflow:i?`wrap`:`scroll`,disableLineNumbers:!a,lineHoverHighlight:o,theme:{dark:u.type===`dark`?u.themeName:`nord`,light:u.type===`light`?u.themeName:`github-light`},themeType:u.type,unsafeCSS:`
3849
3849
  :host {
3850
3850
  --diffs-tab-size: ${r} !important;
3851
3851
  --diffs-font-family: var(--font-mono) !important;
3852
3852
  --diffs-font-size: ${n}px !important;
3853
3853
  --diffs-line-height: ${Math.round(n*1.7)}px !important;
3854
3854
  }
3855
- `}}):null})]})}var iq=(0,W.memo)(function({activeFile:e,onShowHelp:t}){let[n,r]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=()=>{let e=document.activeElement;if(e){let t=e.tagName.toLowerCase();r(t===`input`||t===`textarea`||e.hasAttribute(`contenteditable`))}else r(!1)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,e);let t=setInterval(e,400);return()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,e),clearInterval(t)}},[]);let i=e?e.split(`/`).pop():null,a=e&&e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`)+`/`:``;return(0,G.jsxs)(`div`,{className:`vim-status-bar`,children:[(0,G.jsx)(`div`,{className:`vim-mode-badge ${n?`vim-mode-insert`:`vim-mode-normal`}`,children:n?`INSERT`:`NORMAL`}),(0,G.jsxs)(`div`,{className:`vim-status-content`,children:[(0,G.jsx)($M,{size:12,className:`vim-status-icon`}),e?(0,G.jsxs)(`span`,{className:`vim-status-file`,title:e,children:[(0,G.jsx)(`span`,{className:`vim-file-dir`,children:a}),(0,G.jsx)(`strong`,{className:`vim-file-name`,children:i})]}):(0,G.jsx)(`span`,{className:`vim-status-placeholder`,children:`No active file (J/K to jump)`})]}),(0,G.jsxs)(`button`,{className:`vim-status-help-btn`,onClick:t,title:`View Keyboard Shortcuts (?)`,children:[(0,G.jsx)(TM,{size:13}),(0,G.jsx)(`span`,{children:`Shortcuts`}),(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`})]})]})}),aq=(0,W.memo)(function({isOpen:e,onClose:t}){let n=[{title:`Scrolling & Diffs`,icon:(0,G.jsx)(BM,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of diffs`},{keys:[`G`],description:`Scroll to Bottom of diffs`}]},{title:`File Navigation`,icon:(0,G.jsx)(PM,{size:15}),items:[{keys:[`J`],description:`Jump to Next File Diff`},{keys:[`K`],description:`Jump to Previous File Diff`},{keys:[`v`],description:`Toggle Viewed state for Active File`},{keys:[`b`],description:`Toggle Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(kM,{size:15}),items:[{keys:[`⌘`,`K`],description:`Open Search Palette (files · text · symbols)`},{keys:[`/`],description:`Search file contents (Text scope)`},{keys:[`g`,`f`],description:`Search files (Files scope)`},{keys:[`s`],description:`Search symbols (or "g s")`},{keys:[`g`,`v`],description:`Browse any file in the repo`},{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`Tab`],description:`Cycle search scope while open`},{keys:[`⌘`,`↵`],description:`Peek a result in the preview pane`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(RM,{size:15}),items:[{keys:[`m`],description:`Toggle Diff Style (Split / Unified)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`i`],description:`Cycle Diff Indicator Style (+/− → bars → none)`},{keys:[`Shift`,`I`],description:`Cycle Inline Diff Style (word → char → none)`}]}];return(0,G.jsxs)(IF,{open:e,onClose:t,className:`shortcuts-modal`,ariaLabel:`Keyboard shortcuts`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(PM,{size:18,className:`shortcuts-icon`}),(0,G.jsx)(`h2`,{children:`Developer Keyboard Shortcuts`})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:t,"aria-label":`Close dialog`,children:(0,G.jsx)(aN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsx)(`div`,{className:`shortcuts-intro`,children:`Vim-style keybindings are enabled! Hover, select, and review code entirely from your home keys.`}),(0,G.jsx)(`div`,{className:`shortcuts-grid`,children:n.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-section`,children:[(0,G.jsxs)(`h3`,{className:`shortcuts-section-title`,children:[e.icon,(0,G.jsx)(`span`,{children:e.title})]}),(0,G.jsx)(`div`,{className:`shortcuts-list`,children:e.items.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-row`,children:[(0,G.jsx)(`span`,{className:`shortcuts-desc`,children:e.description}),(0,G.jsx)(`div`,{className:`shortcuts-keys`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`vim-kbd`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`kbd-plus`,children:`+`})]},n))})]},t))})]},t))})]}),(0,G.jsxs)(`div`,{className:`shortcuts-footer`,children:[`Press `,(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`}),` to dismiss this menu at any time.`]})]})});function oq({activity:e,onDismiss:t,onJump:n}){if((0,W.useEffect)(()=>{if(!e)return;let n=setTimeout(t,8e3);return()=>clearTimeout(n)},[e,t]),!e)return null;let r=e.body.length>120?`${e.body.slice(0,120)}…`:e.body;return(0,G.jsxs)(`div`,{className:`agent-toast`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`button`,{className:`agent-toast-body`,onClick:()=>{n(e.filePath),t()},title:`Jump to the file`,children:[(0,G.jsx)(`span`,{className:`agent-toast-icon`,children:(0,G.jsx)(vM,{size:16})}),(0,G.jsxs)(`span`,{className:`agent-toast-text`,children:[(0,G.jsxs)(`span`,{className:`agent-toast-title`,children:[`Agent replied`,e.model?` · ${e.model}`:``]}),(0,G.jsx)(`span`,{className:`agent-toast-file`,children:e.filePath}),(0,G.jsx)(`span`,{className:`agent-toast-preview`,children:r})]})]}),(0,G.jsx)(`button`,{className:`agent-toast-close`,onClick:t,"aria-label":`Dismiss`,children:(0,G.jsx)(aN,{size:14})})]})}var sq=[{id:`nord`,name:`Nord (Main)`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#242933`,accent:`#88c0d0`}},{id:`github-dark`,name:`GitHub Dark`,type:`dark`,colors:{bg:`#0d1117`,secondary:`#161b22`,accent:`#58a6ff`}},{id:`github-dark-dimmed`,name:`GitHub Dark Dimmed`,type:`dark`,colors:{bg:`#22272e`,secondary:`#1c2128`,accent:`#539bf5`}},{id:`github-dark-high-contrast`,name:`GitHub Dark HC`,type:`dark`,colors:{bg:`#0a0c10`,secondary:`#010409`,accent:`#409eff`}},{id:`github-light`,name:`GitHub Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`github-light-high-contrast`,name:`GitHub Light HC`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`dracula`,name:`Dracula`,type:`dark`,colors:{bg:`#282a36`,secondary:`#1e1f29`,accent:`#bd93f9`}},{id:`one-dark`,name:`One Dark`,type:`dark`,colors:{bg:`#282c34`,secondary:`#21252b`,accent:`#61afef`}},{id:`synthwave-84`,name:`Synthwave '84`,type:`dark`,colors:{bg:`#2b213a`,secondary:`#241b2f`,accent:`#f92aad`}},{id:`tokyo-night`,name:`Tokyo Night`,type:`dark`,colors:{bg:`#1a1b26`,secondary:`#16161e`,accent:`#7aa2f7`}},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,type:`dark`,colors:{bg:`#1e1e2e`,secondary:`#181825`,accent:`#cba6f7`}},{id:`catppuccin-frappe`,name:`Catppuccin Frappé`,type:`dark`,colors:{bg:`#303446`,secondary:`#292c3c`,accent:`#ca9ee6`}},{id:`catppuccin-macchiato`,name:`Catppuccin Macchiato`,type:`dark`,colors:{bg:`#24273a`,secondary:`#1e2030`,accent:`#c6a0f6`}},{id:`catppuccin-latte`,name:`Catppuccin Latte`,type:`light`,colors:{bg:`#eff1f5`,secondary:`#e6e9ef`,accent:`#8839ef`}},{id:`solarized-dark`,name:`Solarized Dark`,type:`dark`,colors:{bg:`#002b36`,secondary:`#073642`,accent:`#268bd2`}},{id:`solarized-light`,name:`Solarized Light`,type:`light`,colors:{bg:`#fdf6e3`,secondary:`#eee8d5`,accent:`#268bd2`}},{id:`monokai`,name:`Monokai`,type:`dark`,colors:{bg:`#272822`,secondary:`#1d1e19`,accent:`#f92672`}},{id:`ayu-dark`,name:`Ayu Dark`,type:`dark`,colors:{bg:`#0a0e14`,secondary:`#0d1117`,accent:`#e6b450`}},{id:`ayu-light`,name:`Ayu Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f3f3f3`,accent:`#ff9900`}},{id:`nightfox`,name:`Nightfox`,type:`dark`,colors:{bg:`#192330`,secondary:`#131a24`,accent:`#719cd6`}},{id:`nordfox`,name:`Nordfox`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#232831`,accent:`#81a1c1`}},{id:`duskfox`,name:`Duskfox`,type:`dark`,colors:{bg:`#232136`,secondary:`#1d1b2d`,accent:`#86b3b3`}},{id:`terafox`,name:`Terafox`,type:`dark`,colors:{bg:`#152528`,secondary:`#0f1c1e`,accent:`#5a93aa`}},{id:`carbonfox`,name:`Carbonfox`,type:`dark`,colors:{bg:`#161616`,secondary:`#111111`,accent:`#78a9ff`}},{id:`dayfox`,name:`Dayfox`,type:`light`,colors:{bg:`#f6f2ee`,secondary:`#ebe5df`,accent:`#2848a9`}},{id:`dawnfox`,name:`Dawnfox`,type:`light`,colors:{bg:`#eae5e5`,secondary:`#e0d8d8`,accent:`#614d85`}},{id:`andromeeda`,name:`Andromeeda`,type:`dark`,colors:{bg:`#090b10`,secondary:`#0e1117`,accent:`#00e8c6`}},{id:`aurora-x`,name:`Aurora X`,type:`dark`,colors:{bg:`#07090f`,secondary:`#0c0e15`,accent:`#2eb5e5`}},{id:`dark-plus`,name:`Dark+ (VS Code)`,type:`dark`,colors:{bg:`#1e1e1e`,secondary:`#252526`,accent:`#0e639c`}},{id:`light-plus`,name:`Light+ (VS Code)`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f3f3f3`,accent:`#007acc`}},{id:`houston`,name:`Houston (Astro)`,type:`dark`,colors:{bg:`#131415`,secondary:`#17191e`,accent:`#ff5d01`}},{id:`laserwave`,name:`Laserwave`,type:`dark`,colors:{bg:`#1b1d28`,secondary:`#181a23`,accent:`#ffe261`}},{id:`material-theme`,name:`Material Theme`,type:`dark`,colors:{bg:`#263238`,secondary:`#1e272c`,accent:`#80cbd8`}},{id:`material-theme-darker`,name:`Material Darker`,type:`dark`,colors:{bg:`#212121`,secondary:`#1a1a1a`,accent:`#80cbd8`}},{id:`material-theme-lighter`,name:`Material Lighter`,type:`light`,colors:{bg:`#fafafa`,secondary:`#eeeded`,accent:`#80cbd8`}},{id:`material-theme-ocean`,name:`Material Ocean`,type:`dark`,colors:{bg:`#0f111a`,secondary:`#090b10`,accent:`#80cbd8`}},{id:`material-theme-palenight`,name:`Material Palenight`,type:`dark`,colors:{bg:`#292d3e`,secondary:`#202331`,accent:`#80cbd8`}},{id:`min-dark`,name:`Min Dark`,type:`dark`,colors:{bg:`#1f1f1f`,secondary:`#181818`,accent:`#ffffff`}},{id:`min-light`,name:`Min Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f5f5f5`,accent:`#111111`}},{id:`night-owl`,name:`Night Owl`,type:`dark`,colors:{bg:`#011627`,secondary:`#0b2942`,accent:`#7fdbca`}},{id:`one-light`,name:`One Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f0f0f0`,accent:`#40a9ff`}},{id:`plastic`,name:`Plastic`,type:`dark`,colors:{bg:`#21252b`,secondary:`#1b1d23`,accent:`#61afef`}},{id:`poimandres`,name:`Poimandres`,type:`dark`,colors:{bg:`#1b1e28`,secondary:`#171922`,accent:`#50cad2`}},{id:`rose-pine`,name:`Rosé Pine`,type:`dark`,colors:{bg:`#191724`,secondary:`#1f1d2e`,accent:`#c4a7e7`}},{id:`rose-pine-moon`,name:`Rosé Pine Moon`,type:`dark`,colors:{bg:`#232136`,secondary:`#2a283e`,accent:`#c4a7e7`}},{id:`rose-pine-dawn`,name:`Rosé Pine Dawn`,type:`light`,colors:{bg:`#faf4ed`,secondary:`#f2e9e1`,accent:`#907aa9`}},{id:`slack-dark`,name:`Slack Dark`,type:`dark`,colors:{bg:`#1a1d21`,secondary:`#222529`,accent:`#36c5f0`}},{id:`slack-ochre`,name:`Slack Ochre`,type:`dark`,colors:{bg:`#222222`,secondary:`#2b2b2b`,accent:`#e8912d`}},{id:`vesper`,name:`Vesper`,type:`dark`,colors:{bg:`#101010`,secondary:`#161616`,accent:`#ffc600`}},{id:`vitesse-black`,name:`Vitesse Black`,type:`dark`,colors:{bg:`#000000`,secondary:`#0b0b0b`,accent:`#4d9375`}},{id:`vitesse-dark`,name:`Vitesse Dark`,type:`dark`,colors:{bg:`#121212`,secondary:`#181818`,accent:`#4d9375`}},{id:`vitesse-light`,name:`Vitesse Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#fafafa`,accent:`#1b655f`}}];function cq({open:e,activeTheme:t,onThemeChange:n,onClose:r}){let[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(`all`),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(a(``),s(`all`),l(0),setTimeout(()=>{u.current?.focus()},50))},[e]);let p=(0,W.useMemo)(()=>{let e=i.toLowerCase().trim();return sq.filter(t=>{let n=t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e),r=o===`all`||t.type===o;return n&&r})},[i,o]);return(0,W.useEffect)(()=>{c>=p.length&&l(Math.max(0,p.length-1))},[p,c]),(0,W.useEffect)(()=>{e&&f.current[c]&&f.current[c]?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[c,e]),(0,G.jsx)(IF,{open:e,onClose:r,className:`theme-modal`,ariaLabel:`Theme Selector Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:e=>{let t=p.length;if(e.key===`Escape`){e.preventDefault(),r();return}if(t!==0)switch(e.key){case`ArrowRight`:e.preventDefault(),l(e=>Math.min(e+1,t-1));break;case`ArrowLeft`:e.preventDefault(),l(e=>Math.max(e-1,0));break;case`ArrowDown`:e.preventDefault(),c+2<t?l(c+2):l(t-1);break;case`ArrowUp`:e.preventDefault(),c-2>=0&&l(c-2);break;case`Enter`:e.preventDefault(),p[c]&&(n(p[c].id),r());break;default:break}},children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:`Select Color Theme`}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:r,"aria-label":`Close`,children:(0,G.jsx)(aN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(XM,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:u,type:`text`,className:`theme-modal-search-input`,placeholder:`Search themes... (e.g. nordfox, github)`,value:i,onChange:e=>{a(e.target.value),l(0)}}),i&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{a(``),l(0),u.current?.focus()},children:(0,G.jsx)(aN,{size:14})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-filters`,children:[(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`all`?`active`:``}`,onClick:()=>{s(`all`),l(0),u.current?.focus()},children:[`All Themes (`,sq.length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`dark`?`active`:``}`,onClick:()=>{s(`dark`),l(0),u.current?.focus()},children:[(0,G.jsx)(zM,{size:12,style:{marginRight:`6px`}}),`Dark (`,sq.filter(e=>e.type===`dark`).length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`light`?`active`:``}`,onClick:()=>{s(`light`),l(0),u.current?.focus()},children:[(0,G.jsx)(QM,{size:12,style:{marginRight:`6px`}}),`Light (`,sq.filter(e=>e.type===`light`).length,`)`]})]})]}),(0,G.jsx)(`div`,{ref:d,className:`theme-modal-list`,children:p.length===0?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No themes matching "`,i,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{a(``),s(`all`),l(0),u.current?.focus()},children:`Reset Search`})]}):(0,G.jsx)(`div`,{className:`theme-modal-grid`,children:p.map((e,i)=>{let a=t===e.id;return(0,G.jsxs)(`button`,{ref:e=>{f.current[i]=e},type:`button`,className:`theme-modal-card ${a?`active`:``} ${c===i?`focused`:``}`,onClick:()=>{n(e.id),r()},onMouseEnter:()=>l(i),children:[(0,G.jsxs)(`div`,{className:`theme-card-info`,children:[(0,G.jsx)(`span`,{className:`theme-card-name`,children:e.name}),(0,G.jsx)(`span`,{className:`theme-card-meta`,children:e.type===`dark`?(0,G.jsx)(`span`,{className:`theme-meta-tag dark-tag`,children:`Dark`}):(0,G.jsx)(`span`,{className:`theme-meta-tag light-tag`,children:`Light`})})]}),(0,G.jsxs)(`div`,{className:`theme-card-right`,children:[(0,G.jsxs)(`span`,{className:`theme-swatches`,children:[(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.bg},title:`Background`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.secondary},title:`Secondary`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.accent},title:`Accent`})]}),(0,G.jsx)(`span`,{className:`theme-card-status`,children:a&&(0,G.jsx)(yM,{size:14,className:`theme-check-icon`})})]})]},e.id)})})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` `,(0,G.jsx)(`kbd`,{children:`←`}),` `,(0,G.jsx)(`kbd`,{children:`→`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}function lq(){let e=km(),{settings:t,loaded:n,updateSettings:r}=Pj(),[,i]=(0,W.useTransition)(),{patch:a,repoName:o,branch:s,customMode:c,binaryFiles:l,tabSizeMap:u,untrackedFiles:d,loading:f,refreshing:p,error:m}=Dj({staged:t.staged,untracked:t.untracked},!0),{comments:h,addComment:g,removeComment:_,resolveComment:v,unresolveComment:y,addReply:b,editComment:x,editReply:S,removeReply:C,copyAllComments:w,agentActivity:T,clearAgentActivity:E,sendToAgent:D,sending:O,agentWaiting:k}=jj(),{status:A,refresh:j}=Mj(a),[M,N]=(0,W.useState)(null),[P,F]=(0,W.useState)(()=>{try{return localStorage.getItem(`diffing-sidebar-collapsed`)===`true`}catch{return!1}}),[I,L]=(0,W.useState)(()=>{try{let e=localStorage.getItem(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),R=(0,W.useRef)(I);R.current=I;let z=(0,W.useRef)(null),ee=(0,W.useRef)(null),te=(0,W.useRef)(null),B=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=R.current,r=ee.current,i=te.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),L(o);try{localStorage.setItem(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),[V,H]=(0,W.useState)({open:!1,scope:`files`}),ne=(0,W.useCallback)(e=>H({open:!0,scope:e}),[]),re=(0,W.useCallback)(()=>H(e=>({...e,open:!1})),[]),[ie,ae]=(0,W.useState)(!1),[oe,se]=(0,W.useState)(!1),[ce,le]=(0,W.useState)(()=>{try{let e=localStorage.getItem(`diffing-comment-panel-height`);return e?Number(e):220}catch{return 220}}),ue=(0,W.useRef)(ce);ue.current=ce;let U=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=ue.current,r=z.current,i=n,a=0,o=()=>{a=0,r?.style.setProperty(`--comment-panel-height`,`${i}px`)},s=e=>{let r=t-e.clientY;i=Math.max(100,Math.min(600,n+r)),a||=requestAnimationFrame(o)},c=()=>{a&&cancelAnimationFrame(a),le(i);try{localStorage.setItem(`diffing-comment-panel-height`,String(i))}catch{}document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c),document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`},[]);(0,W.useEffect)(()=>{try{localStorage.setItem(`diffing-comment-panel-height`,String(ce))}catch{}},[ce]);let{viewedFiles:de,setViewed:fe}=Lj(),pe=(0,W.useRef)(null);un([`G`,`S`],()=>ne(`symbols`)),un([`G`,`F`],()=>ne(`all`)),un([`G`,`V`],()=>ne(`files`)),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`k`||e.key===`K`)&&(e.preventDefault(),H(e=>e.open?{...e,open:!1}:{open:!0,scope:`all`}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{try{localStorage.setItem(`diffing-sidebar-collapsed`,String(P))}catch{}},[P]);let me=(0,W.useMemo)(()=>new Set(d),[d]),he=(0,W.useRef)([]),ge=(0,W.useMemo)(()=>{if(!a)return[];try{let e=Ng(a).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of l)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`||n.type===`untracked`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}let n=e.map(e=>{let t=he.current.find(t=>t.name===e.name);return t&&t.type===e.type&&t.isPartial===e.isPartial&&t.deletionLines.length===e.deletionLines.length&&t.additionLines.length===e.additionLines.length&&JSON.stringify(t.hunks)===JSON.stringify(e.hunks)?t:e});return he.current=n,n}catch{return[]}},[a,l]),_e=sM(ge),ve=(0,W.useMemo)(()=>{if(!a)return{additions:0,deletions:0};let e=0,t=0,n=0,r=a.length;for(;n<r;){let i=a.indexOf(`
3856
- `,n);i===-1&&(i=r);let o=a.charCodeAt(n);o===43?n+2<r&&a.charCodeAt(n+1)===43&&a.charCodeAt(n+2)===43||e++:o===45&&(n+2<r&&a.charCodeAt(n+1)===45&&a.charCodeAt(n+2)===45||t++),n=i+1}return{additions:e,deletions:t}},[a]),ye=(0,W.useMemo)(()=>{let e=new Map;for(let t of l)e.set(t.path,t);return e},[l]),be=(0,W.useMemo)(()=>{let e={};for(let t of h)e[t.filePath]=(e[t.filePath]??0)+1;return e},[h]),xe=(0,W.useRef)(new Map),Se=(0,W.useMemo)(()=>{let e=new Map,t=new Map;for(let e of h){let n=t.get(e.filePath);n||(n=[],t.set(e.filePath,n)),n.push(e)}for(let[n,r]of t){let t=r.map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),i=xe.current.get(n);i&&JSON.stringify(i)===JSON.stringify(t)?e.set(n,i):e.set(n,t)}return xe.current=e,e},[h]),Ce=(0,W.useCallback)(e=>{N(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),we=(0,W.useCallback)((e,t)=>{fe(e,t)},[fe]),Te=(0,W.useCallback)(e=>{i(()=>{r({diffStyle:e})})},[r]),Ee=(0,W.useCallback)(e=>{i(()=>{r(e)})},[r]),De=(0,W.useCallback)(e=>{i(()=>{r({defaultTabSize:e})})},[r]),Oe=(0,W.useCallback)(e=>{i(()=>{r({browser:e})})},[r]),ke=(0,W.useCallback)(e=>{i(()=>{r({theme:e})})},[r]),Ae=(0,W.useCallback)(e=>{i(()=>{r({editorIDE:e})})},[r]),je=(0,W.useCallback)(e=>{i(()=>{r({lineDiffType:e})})},[r]),Me=(0,W.useCallback)(e=>{i(()=>{r({lineWrap:e})})},[r]),Ne=(0,W.useCallback)(e=>{i(()=>{r({diffIndicators:e})})},[r]),Pe=(0,W.useCallback)(e=>{i(()=>{r({showLineNumbers:e})})},[r]),Fe=(0,W.useCallback)(e=>{i(()=>{r({hunkSeparators:e})})},[r]),Ie=(0,W.useCallback)(e=>{i(()=>{r({lineHoverHighlight:e})})},[r]),Le=(0,W.useCallback)(e=>{i(()=>{r({fontSize:e})})},[r]),Re=(0,W.useCallback)(e=>{r({haptics:e})},[r]),ze=(0,W.useCallback)(e=>{r({sounds:e})},[r]),Be=(0,W.useCallback)(()=>{Me(!t.lineWrap)},[t.lineWrap,Me]),Ve=(0,W.useCallback)(()=>{Pe(!t.showLineNumbers)},[t.showLineNumbers,Pe]),He=(0,W.useCallback)(()=>{let e=[`classic`,`bars`,`none`],n=t.diffIndicators||`classic`,r=e[(e.indexOf(n)+1)%e.length];Ne(r)},[t.diffIndicators,Ne]),Ue=(0,W.useCallback)(()=>{let e=[`word`,`word-alt`,`char`,`none`],n=t.lineDiffType||`word`,r=e[(e.indexOf(n)+1)%e.length];je(r)},[t.lineDiffType,je]),We=(0,W.useCallback)(()=>{F(e=>!e)},[]),Ge=(0,W.useCallback)(e=>{if(ge.length===0)return;let t=0;if(M){let n=ge.findIndex(e=>e.name===M);n!==-1&&(t=e===`next`?Math.min(n+1,ge.length-1):Math.max(n-1,0))}let n=ge[t].name;N(n);let r=document.getElementById(`file-${n}`);r&&r.scrollIntoView({block:`start`})},[ge,M,N]),Ke=(0,W.useCallback)(()=>{M&&fe(M,!de.has(M))},[M,de,fe]),qe=(0,W.useCallback)(()=>{Te(t.diffStyle===`split`?`unified`:`split`)},[t.diffStyle,Te]),Je=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;De(e[(e.indexOf(n)+1)%e.length])},[t.defaultTabSize,De]),Ye=(0,W.useCallback)(()=>{We()},[We]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),iM(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),iM(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(nM(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(nM(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),iM(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),iM(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),Ge(`next`),iM(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),Ge(`prev`),iM(`selection`,`navigate`),e=``):e===`v`?(r.preventDefault(),Ke(),iM(`selection`,`toggle`),e=``):e===`m`?(r.preventDefault(),qe(),iM(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),Je(),iM(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),Ye(),iM(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),Be(),iM(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),Ve(),iM(`selection`,`toggle`),e=``):e===`i`?(r.preventDefault(),He(),iM(`selection`,`toggle`),e=``):e===`I`?(r.preventDefault(),Ue(),iM(`selection`,`toggle`),e=``):e===`/`?(r.preventDefault(),ne(`text`),iM(`medium`,`open`),e=``):e===`s`?(r.preventDefault(),ne(`symbols`),iM(`medium`,`open`),e=``):e===`gv`?(r.preventDefault(),ne(`files`),iM(`medium`,`open`),e=``):e===`gt`?(r.preventDefault(),se(!0),iM(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),ae(!0),iM(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),clearTimeout(t)}},[ge,M,de,t.diffStyle,t.defaultTabSize,Ge,Ke,qe,Je,Ye,Be,Ve,He,Ue,se]);let Xe=(0,W.useMemo)(()=>({staged:t.staged,untracked:t.untracked}),[t.staged,t.untracked]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]);let Ze=(0,W.useMemo)(()=>pj[t.theme||`nord`]||pj.nord,[t.theme]);return(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:Ze.type===`dark`?Ze.themeName:`nord`,light:Ze.type===`light`?Ze.themeName:`github-light`}}).catch(e=>{console.error(`Failed to set worker pool render options:`,e)})},[e,Ze]),(0,W.useEffect)(()=>{let e=Ze.type===`dark`?Ze.themeName:`nord`,t=Ze.type===`light`?Ze.themeName:`github-light`;Hf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[Ze]),f?(0,G.jsxs)(`div`,{className:`app skeleton-app`,children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{className:`sidebar skeleton-sidebar`,children:[(0,G.jsx)(`div`,{className:`skeleton-search`}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:8}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`${t%3*16+16}px`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${60+t*12%60}px`}})]},t))})]}),(0,G.jsx)(`main`,{className:`main skeleton-main`,children:(0,G.jsx)(`div`,{className:`diff-viewer`,children:Array.from({length:3}).map((e,t)=>(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`${120+t*45%150}px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`})]}),(0,G.jsx)(`div`,{className:`skeleton-card-body`,children:Array.from({length:5}).map((e,t)=>(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`${50+t*15%45}%`}},t))})]},t))})})]})]}):m?(0,G.jsx)(`div`,{className:`error`,children:(0,G.jsxs)(`p`,{children:[`Error: `,m]})}):(0,G.jsx)(aM,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app`,ref:z,style:{"--sidebar-width":`${I}px`,"--comment-panel-height":`${ce}px`},children:[p&&(0,G.jsx)(`div`,{className:`refresh-bar`,role:`status`,"aria-label":`Refreshing diff`}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:te,"aria-hidden":`true`}),(0,G.jsx)(yF,{repoName:o,branch:s,fileCount:ge.length,additions:ve.additions,deletions:ve.deletions,commentCount:h.length,diffStyle:t.diffStyle,diffOptions:Xe,defaultTabSize:t.defaultTabSize,browser:t.browser,theme:t.theme||`nord`,editorIDE:t.editorIDE,customMode:c,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,haptics:t.haptics??!0,sounds:t.sounds??!0,onDiffStyleChange:Te,onDiffOptionsChange:Ee,onDefaultTabSizeChange:De,onBrowserChange:Oe,onOpenThemeModal:()=>se(!0),onEditorIDEChange:Ae,onLineDiffTypeChange:je,onLineWrapChange:Me,onDiffIndicatorsChange:Ne,onShowLineNumbersChange:Pe,onHunkSeparatorsChange:Fe,onLineHoverHighlightChange:Ie,onFontSizeChange:Le,onHapticsChange:Re,onSoundsChange:ze,onOpenSearch:()=>ne(`all`),onCopyComments:w,onSendToAgent:D,agentWaiting:k,sending:O,comments:h,onEditComment:x,onDeleteComment:_}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{ref:ee,className:`sidebar ${P?`sidebar-collapsed`:``}`,children:[(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(bK,{files:ge,activeFile:M,commentCounts:be,viewedFiles:de,untrackedFiles:me,onFileClick:Ce,collapsed:P,onToggleCollapse:We})}),!P&&h.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`ct-resize-handle`,onMouseDown:U,role:`separator`,"aria-label":`Resize comments panel`,"aria-orientation":`horizontal`,tabIndex:0}),(0,G.jsx)(`div`,{className:`ct-wrapper`,style:{flexShrink:0},children:(0,G.jsx)(CK,{comments:h,resolveComment:v,unresolveComment:y,removeComment:_,addReply:b,editComment:x,editReply:S,removeReply:C})})]})]}),!P&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:B,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsxs)(`main`,{className:`main`,ref:pe,children:[A.inMerge&&A.conflicts.length>0&&(0,G.jsxs)(`div`,{className:`merge-conflict-banner`,children:[(0,G.jsx)(`strong`,{children:`Merge in progress`}),(0,G.jsxs)(`span`,{children:[A.conflicts.length,` unresolved file`,A.conflicts.length===1?``:`s`,` below. Use the inline buttons to accept current/incoming/both, then "Save & stage".`]})]}),A.conflicts.map(e=>(0,G.jsx)(oI,{filePath:e,theme:t.theme||`nord`,fontSize:t.fontSize,tabSize:u[e]??t.defaultTabSize,onSaved:()=>{j()}},e)),(0,G.jsx)(iI,{files:ge,diffStyle:t.diffStyle,tabSizeMap:u,defaultTabSize:t.defaultTabSize,viewedFiles:de,binaryFiles:ye,theme:t.theme||`nord`,editorIDE:t.editorIDE,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,expandContextByDefault:t.expandContextByDefault,collapsedContextThreshold:t.collapsedContextThreshold,expansionLineCount:t.expansionLineCount,onViewedChange:we,fileAnnotationsMap:Se,onAddComment:g,onDeleteComment:_})]})]}),(0,G.jsx)(XK,{isOpen:V.open,onClose:re,initialScope:V.scope,files:ge,changedEntries:_e,customMode:c,staged:t.staged,onNavigateFile:Ce,theme:t.theme||`nord`,fontSize:t.fontSize,defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight}),(0,G.jsx)(iq,{activeFile:M,onShowHelp:()=>ae(!0)}),(0,G.jsx)(aq,{isOpen:ie,onClose:()=>ae(!1)}),(0,G.jsx)(cq,{open:oe,activeTheme:t.theme||`nord`,onThemeChange:ke,onClose:()=>se(!1)}),(0,G.jsx)(oq,{activity:T,onDismiss:E,onJump:Ce})]})})}var uq=new Le;(0,mn.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(He,{client:uq,children:(0,G.jsx)(ot,{children:(0,G.jsx)(Om,{poolOptions:{workerFactory:()=>new k_,poolSize:Math.max(1,Math.min(4,navigator.hardwareConcurrency||2))},highlighterOptions:{theme:{dark:`nord`,light:`github-light`}},children:(0,G.jsx)(ZT,{children:(0,G.jsx)(lq,{})})})})}));export{s as t};
3855
+ `}}):null})]})}var yq=(0,W.memo)(function({activeFile:e,onShowHelp:t}){let[n,r]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=()=>{let e=document.activeElement;if(e){let t=e.tagName.toLowerCase();r(t===`input`||t===`textarea`||e.hasAttribute(`contenteditable`))}else r(!1)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,e);let t=setInterval(e,400);return()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,e),clearInterval(t)}},[]);let i=e?e.split(`/`).pop():null,a=e&&e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`)+`/`:``;return(0,G.jsxs)(`div`,{className:`vim-status-bar`,children:[(0,G.jsx)(`div`,{className:`vim-mode-badge ${n?`vim-mode-insert`:`vim-mode-normal`}`,children:n?`INSERT`:`NORMAL`}),(0,G.jsxs)(`div`,{className:`vim-status-content`,children:[(0,G.jsx)(mN,{size:12,className:`vim-status-icon`}),e?(0,G.jsxs)(`span`,{className:`vim-status-file`,title:e,children:[(0,G.jsx)(`span`,{className:`vim-file-dir`,children:a}),(0,G.jsx)(`strong`,{className:`vim-file-name`,children:i})]}):(0,G.jsx)(`span`,{className:`vim-status-placeholder`,children:`No active file (J/K to jump)`})]}),(0,G.jsxs)(`button`,{className:`vim-status-help-btn`,onClick:t,title:`View Keyboard Shortcuts (?)`,children:[(0,G.jsx)(IM,{size:13}),(0,G.jsx)(`span`,{children:`Shortcuts`}),(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`})]})]})}),bq=(0,W.memo)(function({isOpen:e,onClose:t}){let n=[{title:`Scrolling & Diffs`,icon:(0,G.jsx)(tN,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of diffs`},{keys:[`G`],description:`Scroll to Bottom of diffs`}]},{title:`File Navigation`,icon:(0,G.jsx)(qM,{size:15}),items:[{keys:[`J`],description:`Jump to Next File Diff`},{keys:[`K`],description:`Jump to Previous File Diff`},{keys:[`v`],description:`Toggle Viewed state for Active File`},{keys:[`b`],description:`Toggle Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(HM,{size:15}),items:[{keys:[`⌘`,`K`],description:`Open Search Palette (files · text · symbols)`},{keys:[`/`],description:`Search file contents (Text scope)`},{keys:[`g`,`f`],description:`Search files (Files scope)`},{keys:[`s`],description:`Search symbols (or "g s")`},{keys:[`g`,`v`],description:`Browse any file in the repo`},{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`Tab`],description:`Cycle search scope while open`},{keys:[`⌘`,`↵`],description:`Peek a result in the preview pane`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)($M,{size:15}),items:[{keys:[`m`],description:`Toggle Diff Style (Split / Unified)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`i`],description:`Cycle Diff Indicator Style (+/− → bars → none)`},{keys:[`Shift`,`I`],description:`Cycle Inline Diff Style (word → char → none)`}]}];return(0,G.jsxs)(ZF,{open:e,onClose:t,className:`shortcuts-modal`,ariaLabel:`Keyboard shortcuts`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(qM,{size:18,className:`shortcuts-icon`}),(0,G.jsx)(`h2`,{children:`Developer Keyboard Shortcuts`})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:t,"aria-label":`Close dialog`,children:(0,G.jsx)(bN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsx)(`div`,{className:`shortcuts-intro`,children:`Vim-style keybindings are enabled! Hover, select, and review code entirely from your home keys.`}),(0,G.jsx)(`div`,{className:`shortcuts-grid`,children:n.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-section`,children:[(0,G.jsxs)(`h3`,{className:`shortcuts-section-title`,children:[e.icon,(0,G.jsx)(`span`,{children:e.title})]}),(0,G.jsx)(`div`,{className:`shortcuts-list`,children:e.items.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-row`,children:[(0,G.jsx)(`span`,{className:`shortcuts-desc`,children:e.description}),(0,G.jsx)(`div`,{className:`shortcuts-keys`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`vim-kbd`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`kbd-plus`,children:`+`})]},n))})]},t))})]},t))})]}),(0,G.jsxs)(`div`,{className:`shortcuts-footer`,children:[`Press `,(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`}),` to dismiss this menu at any time.`]})]})});function xq({activity:e,onDismiss:t,onJump:n}){if((0,W.useEffect)(()=>{if(!e)return;let n=setTimeout(t,8e3);return()=>clearTimeout(n)},[e,t]),!e)return null;let r=e.body.length>120?`${e.body.slice(0,120)}…`:e.body;return(0,G.jsxs)(`div`,{className:`agent-toast`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`button`,{className:`agent-toast-body`,onClick:()=>{n(e.filePath),t()},title:`Jump to the file`,children:[(0,G.jsx)(`span`,{className:`agent-toast-icon`,children:(0,G.jsx)(kM,{size:16})}),(0,G.jsxs)(`span`,{className:`agent-toast-text`,children:[(0,G.jsxs)(`span`,{className:`agent-toast-title`,children:[`Agent replied`,e.model?` · ${e.model}`:``]}),(0,G.jsx)(`span`,{className:`agent-toast-file`,children:e.filePath}),(0,G.jsx)(`span`,{className:`agent-toast-preview`,children:r})]})]}),(0,G.jsx)(`button`,{className:`agent-toast-close`,onClick:t,"aria-label":`Dismiss`,children:(0,G.jsx)(bN,{size:14})})]})}var Sq=[{id:`nord`,name:`Nord (Main)`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#242933`,accent:`#88c0d0`}},{id:`github-dark`,name:`GitHub Dark`,type:`dark`,colors:{bg:`#0d1117`,secondary:`#161b22`,accent:`#58a6ff`}},{id:`github-dark-dimmed`,name:`GitHub Dark Dimmed`,type:`dark`,colors:{bg:`#22272e`,secondary:`#1c2128`,accent:`#539bf5`}},{id:`github-dark-high-contrast`,name:`GitHub Dark HC`,type:`dark`,colors:{bg:`#0a0c10`,secondary:`#010409`,accent:`#409eff`}},{id:`github-light`,name:`GitHub Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`github-light-high-contrast`,name:`GitHub Light HC`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`dracula`,name:`Dracula`,type:`dark`,colors:{bg:`#282a36`,secondary:`#1e1f29`,accent:`#bd93f9`}},{id:`one-dark`,name:`One Dark`,type:`dark`,colors:{bg:`#282c34`,secondary:`#21252b`,accent:`#61afef`}},{id:`synthwave-84`,name:`Synthwave '84`,type:`dark`,colors:{bg:`#2b213a`,secondary:`#241b2f`,accent:`#f92aad`}},{id:`tokyo-night`,name:`Tokyo Night`,type:`dark`,colors:{bg:`#1a1b26`,secondary:`#16161e`,accent:`#7aa2f7`}},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,type:`dark`,colors:{bg:`#1e1e2e`,secondary:`#181825`,accent:`#cba6f7`}},{id:`catppuccin-frappe`,name:`Catppuccin Frappé`,type:`dark`,colors:{bg:`#303446`,secondary:`#292c3c`,accent:`#ca9ee6`}},{id:`catppuccin-macchiato`,name:`Catppuccin Macchiato`,type:`dark`,colors:{bg:`#24273a`,secondary:`#1e2030`,accent:`#c6a0f6`}},{id:`catppuccin-latte`,name:`Catppuccin Latte`,type:`light`,colors:{bg:`#eff1f5`,secondary:`#e6e9ef`,accent:`#8839ef`}},{id:`solarized-dark`,name:`Solarized Dark`,type:`dark`,colors:{bg:`#002b36`,secondary:`#073642`,accent:`#268bd2`}},{id:`solarized-light`,name:`Solarized Light`,type:`light`,colors:{bg:`#fdf6e3`,secondary:`#eee8d5`,accent:`#268bd2`}},{id:`monokai`,name:`Monokai`,type:`dark`,colors:{bg:`#272822`,secondary:`#1d1e19`,accent:`#f92672`}},{id:`ayu-dark`,name:`Ayu Dark`,type:`dark`,colors:{bg:`#0a0e14`,secondary:`#0d1117`,accent:`#e6b450`}},{id:`ayu-light`,name:`Ayu Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f3f3f3`,accent:`#ff9900`}},{id:`nightfox`,name:`Nightfox`,type:`dark`,colors:{bg:`#192330`,secondary:`#131a24`,accent:`#719cd6`}},{id:`nordfox`,name:`Nordfox`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#232831`,accent:`#81a1c1`}},{id:`duskfox`,name:`Duskfox`,type:`dark`,colors:{bg:`#232136`,secondary:`#1d1b2d`,accent:`#86b3b3`}},{id:`terafox`,name:`Terafox`,type:`dark`,colors:{bg:`#152528`,secondary:`#0f1c1e`,accent:`#5a93aa`}},{id:`carbonfox`,name:`Carbonfox`,type:`dark`,colors:{bg:`#161616`,secondary:`#111111`,accent:`#78a9ff`}},{id:`dayfox`,name:`Dayfox`,type:`light`,colors:{bg:`#f6f2ee`,secondary:`#ebe5df`,accent:`#2848a9`}},{id:`dawnfox`,name:`Dawnfox`,type:`light`,colors:{bg:`#eae5e5`,secondary:`#e0d8d8`,accent:`#614d85`}},{id:`andromeeda`,name:`Andromeeda`,type:`dark`,colors:{bg:`#090b10`,secondary:`#0e1117`,accent:`#00e8c6`}},{id:`aurora-x`,name:`Aurora X`,type:`dark`,colors:{bg:`#07090f`,secondary:`#0c0e15`,accent:`#2eb5e5`}},{id:`dark-plus`,name:`Dark+ (VS Code)`,type:`dark`,colors:{bg:`#1e1e1e`,secondary:`#252526`,accent:`#0e639c`}},{id:`light-plus`,name:`Light+ (VS Code)`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f3f3f3`,accent:`#007acc`}},{id:`houston`,name:`Houston (Astro)`,type:`dark`,colors:{bg:`#131415`,secondary:`#17191e`,accent:`#ff5d01`}},{id:`laserwave`,name:`Laserwave`,type:`dark`,colors:{bg:`#1b1d28`,secondary:`#181a23`,accent:`#ffe261`}},{id:`material-theme`,name:`Material Theme`,type:`dark`,colors:{bg:`#263238`,secondary:`#1e272c`,accent:`#80cbd8`}},{id:`material-theme-darker`,name:`Material Darker`,type:`dark`,colors:{bg:`#212121`,secondary:`#1a1a1a`,accent:`#80cbd8`}},{id:`material-theme-lighter`,name:`Material Lighter`,type:`light`,colors:{bg:`#fafafa`,secondary:`#eeeded`,accent:`#80cbd8`}},{id:`material-theme-ocean`,name:`Material Ocean`,type:`dark`,colors:{bg:`#0f111a`,secondary:`#090b10`,accent:`#80cbd8`}},{id:`material-theme-palenight`,name:`Material Palenight`,type:`dark`,colors:{bg:`#292d3e`,secondary:`#202331`,accent:`#80cbd8`}},{id:`min-dark`,name:`Min Dark`,type:`dark`,colors:{bg:`#1f1f1f`,secondary:`#181818`,accent:`#ffffff`}},{id:`min-light`,name:`Min Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f5f5f5`,accent:`#111111`}},{id:`night-owl`,name:`Night Owl`,type:`dark`,colors:{bg:`#011627`,secondary:`#0b2942`,accent:`#7fdbca`}},{id:`one-light`,name:`One Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f0f0f0`,accent:`#40a9ff`}},{id:`plastic`,name:`Plastic`,type:`dark`,colors:{bg:`#21252b`,secondary:`#1b1d23`,accent:`#61afef`}},{id:`poimandres`,name:`Poimandres`,type:`dark`,colors:{bg:`#1b1e28`,secondary:`#171922`,accent:`#50cad2`}},{id:`rose-pine`,name:`Rosé Pine`,type:`dark`,colors:{bg:`#191724`,secondary:`#1f1d2e`,accent:`#c4a7e7`}},{id:`rose-pine-moon`,name:`Rosé Pine Moon`,type:`dark`,colors:{bg:`#232136`,secondary:`#2a283e`,accent:`#c4a7e7`}},{id:`rose-pine-dawn`,name:`Rosé Pine Dawn`,type:`light`,colors:{bg:`#faf4ed`,secondary:`#f2e9e1`,accent:`#907aa9`}},{id:`slack-dark`,name:`Slack Dark`,type:`dark`,colors:{bg:`#1a1d21`,secondary:`#222529`,accent:`#36c5f0`}},{id:`slack-ochre`,name:`Slack Ochre`,type:`dark`,colors:{bg:`#222222`,secondary:`#2b2b2b`,accent:`#e8912d`}},{id:`vesper`,name:`Vesper`,type:`dark`,colors:{bg:`#101010`,secondary:`#161616`,accent:`#ffc600`}},{id:`vitesse-black`,name:`Vitesse Black`,type:`dark`,colors:{bg:`#000000`,secondary:`#0b0b0b`,accent:`#4d9375`}},{id:`vitesse-dark`,name:`Vitesse Dark`,type:`dark`,colors:{bg:`#121212`,secondary:`#181818`,accent:`#4d9375`}},{id:`vitesse-light`,name:`Vitesse Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#fafafa`,accent:`#1b655f`}}];function Cq({open:e,activeTheme:t,onThemeChange:n,onClose:r}){let[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(`all`),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(a(``),s(`all`),l(0),setTimeout(()=>{u.current?.focus()},50))},[e]);let p=(0,W.useMemo)(()=>{let e=i.toLowerCase().trim();return Sq.filter(t=>{let n=t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e),r=o===`all`||t.type===o;return n&&r})},[i,o]);return(0,W.useEffect)(()=>{c>=p.length&&l(Math.max(0,p.length-1))},[p,c]),(0,W.useEffect)(()=>{e&&f.current[c]&&f.current[c]?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[c,e]),(0,G.jsx)(ZF,{open:e,onClose:r,className:`theme-modal`,ariaLabel:`Theme Selector Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:e=>{let t=p.length;if(e.key===`Escape`){e.preventDefault(),r();return}if(t!==0)switch(e.key){case`ArrowRight`:e.preventDefault(),l(e=>Math.min(e+1,t-1));break;case`ArrowLeft`:e.preventDefault(),l(e=>Math.max(e-1,0));break;case`ArrowDown`:e.preventDefault(),c+2<t?l(c+2):l(t-1);break;case`ArrowUp`:e.preventDefault(),c-2>=0&&l(c-2);break;case`Enter`:e.preventDefault(),p[c]&&(n(p[c].id),r());break;default:break}},children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:`Select Color Theme`}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:r,"aria-label":`Close`,children:(0,G.jsx)(bN,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(dN,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:u,type:`text`,className:`theme-modal-search-input`,placeholder:`Search themes... (e.g. nordfox, github)`,value:i,onChange:e=>{a(e.target.value),l(0)}}),i&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{a(``),l(0),u.current?.focus()},children:(0,G.jsx)(bN,{size:14})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-filters`,children:[(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`all`?`active`:``}`,onClick:()=>{s(`all`),l(0),u.current?.focus()},children:[`All Themes (`,Sq.length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`dark`?`active`:``}`,onClick:()=>{s(`dark`),l(0),u.current?.focus()},children:[(0,G.jsx)(eN,{size:12,style:{marginRight:`6px`}}),`Dark (`,Sq.filter(e=>e.type===`dark`).length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`light`?`active`:``}`,onClick:()=>{s(`light`),l(0),u.current?.focus()},children:[(0,G.jsx)(pN,{size:12,style:{marginRight:`6px`}}),`Light (`,Sq.filter(e=>e.type===`light`).length,`)`]})]})]}),(0,G.jsx)(`div`,{ref:d,className:`theme-modal-list`,children:p.length===0?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No themes matching "`,i,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{a(``),s(`all`),l(0),u.current?.focus()},children:`Reset Search`})]}):(0,G.jsx)(`div`,{className:`theme-modal-grid`,children:p.map((e,i)=>{let a=t===e.id;return(0,G.jsxs)(`button`,{ref:e=>{f.current[i]=e},type:`button`,className:`theme-modal-card ${a?`active`:``} ${c===i?`focused`:``}`,onClick:()=>{n(e.id),r()},onMouseEnter:()=>l(i),children:[(0,G.jsxs)(`div`,{className:`theme-card-info`,children:[(0,G.jsx)(`span`,{className:`theme-card-name`,children:e.name}),(0,G.jsx)(`span`,{className:`theme-card-meta`,children:e.type===`dark`?(0,G.jsx)(`span`,{className:`theme-meta-tag dark-tag`,children:`Dark`}):(0,G.jsx)(`span`,{className:`theme-meta-tag light-tag`,children:`Light`})})]}),(0,G.jsxs)(`div`,{className:`theme-card-right`,children:[(0,G.jsxs)(`span`,{className:`theme-swatches`,children:[(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.bg},title:`Background`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.secondary},title:`Secondary`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.accent},title:`Accent`})]}),(0,G.jsx)(`span`,{className:`theme-card-status`,children:a&&(0,G.jsx)(AM,{size:14,className:`theme-check-icon`})})]})]},e.id)})})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` `,(0,G.jsx)(`kbd`,{children:`←`}),` `,(0,G.jsx)(`kbd`,{children:`→`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}function wq(){let e=km(),{settings:t,loaded:n,updateSettings:r}=Wj(),[,i]=(0,W.useTransition)(),{patch:a,repoName:o,branch:s,customMode:c,binaryFiles:l,tabSizeMap:u,untrackedFiles:d,loading:f,refreshing:p,error:m}=Dj({staged:t.staged,untracked:t.untracked},!0),{comments:h,addComment:g,removeComment:_,resolveComment:v,unresolveComment:y,addReply:b,editComment:x,editReply:S,removeReply:C,copyAllComments:w,agentActivity:T,clearAgentActivity:E,sendToAgent:D,sending:O,agentWaiting:k}=jj(),{plans:A}=Pj(),j=(0,W.useMemo)(()=>A.filter(e=>e.decision===`pending`).length,[A]),{status:M,refresh:N}=Hj(a),[P,F]=(0,W.useState)(null),[I,L]=(0,W.useState)(()=>{try{return localStorage.getItem(`diffing-sidebar-collapsed`)===`true`}catch{return!1}}),[R,z]=(0,W.useState)(()=>{try{let e=localStorage.getItem(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),ee=(0,W.useRef)(R);ee.current=R;let te=(0,W.useRef)(null),B=(0,W.useRef)(null),V=(0,W.useRef)(null),H=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=ee.current,r=B.current,i=V.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),z(o);try{localStorage.setItem(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),[ne,re]=(0,W.useState)({open:!1,scope:`files`}),ie=(0,W.useCallback)(e=>re({open:!0,scope:e}),[]),ae=(0,W.useCallback)(()=>re(e=>({...e,open:!1})),[]),[oe,se]=(0,W.useState)(!1),[ce,le]=(0,W.useState)(!1),[ue,U]=(0,W.useState)(()=>{try{let e=localStorage.getItem(`diffing-comment-panel-height`);return e?Number(e):220}catch{return 220}}),de=(0,W.useRef)(ue);de.current=ue;let fe=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=de.current,r=te.current,i=n,a=0,o=()=>{a=0,r?.style.setProperty(`--comment-panel-height`,`${i}px`)},s=e=>{let r=t-e.clientY;i=Math.max(100,Math.min(600,n+r)),a||=requestAnimationFrame(o)},c=()=>{a&&cancelAnimationFrame(a),U(i);try{localStorage.setItem(`diffing-comment-panel-height`,String(i))}catch{}document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c),document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`},[]);(0,W.useEffect)(()=>{try{localStorage.setItem(`diffing-comment-panel-height`,String(ue))}catch{}},[ue]);let{viewedFiles:pe,setViewed:me}=qj(),he=(0,W.useRef)(null);un([`G`,`S`],()=>ie(`symbols`)),un([`G`,`F`],()=>ie(`all`)),un([`G`,`V`],()=>ie(`files`)),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`k`||e.key===`K`)&&(e.preventDefault(),re(e=>e.open?{...e,open:!1}:{open:!0,scope:`all`}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{try{localStorage.setItem(`diffing-sidebar-collapsed`,String(I))}catch{}},[I]);let ge=(0,W.useMemo)(()=>new Set(d),[d]),_e=(0,W.useRef)([]),ve=(0,W.useMemo)(()=>{if(!a)return[];try{let e=Ng(a).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of l)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`||n.type===`untracked`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}let n=e.map(e=>{let t=_e.current.find(t=>t.name===e.name);return t&&t.type===e.type&&t.isPartial===e.isPartial&&t.deletionLines.length===e.deletionLines.length&&t.additionLines.length===e.additionLines.length&&JSON.stringify(t.hunks)===JSON.stringify(e.hunks)?t:e});return _e.current=n,n}catch{return[]}},[a,l]),ye=_M(ve),be=(0,W.useMemo)(()=>{if(!a)return{additions:0,deletions:0};let e=0,t=0,n=0,r=a.length;for(;n<r;){let i=a.indexOf(`
3856
+ `,n);i===-1&&(i=r);let o=a.charCodeAt(n);o===43?n+2<r&&a.charCodeAt(n+1)===43&&a.charCodeAt(n+2)===43||e++:o===45&&(n+2<r&&a.charCodeAt(n+1)===45&&a.charCodeAt(n+2)===45||t++),n=i+1}return{additions:e,deletions:t}},[a]),xe=(0,W.useMemo)(()=>{let e=new Map;for(let t of l)e.set(t.path,t);return e},[l]),Se=(0,W.useMemo)(()=>{let e={};for(let t of h)e[t.filePath]=(e[t.filePath]??0)+1;return e},[h]),Ce=(0,W.useRef)(new Map),we=(0,W.useMemo)(()=>{let e=new Map,t=new Map;for(let e of h){let n=t.get(e.filePath);n||(n=[],t.set(e.filePath,n)),n.push(e)}for(let[n,r]of t){let t=r.map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),i=Ce.current.get(n);i&&JSON.stringify(i)===JSON.stringify(t)?e.set(n,i):e.set(n,t)}return Ce.current=e,e},[h]),Te=(0,W.useCallback)(e=>{F(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),Ee=(0,W.useCallback)((e,t)=>{me(e,t)},[me]),De=(0,W.useCallback)(e=>{i(()=>{r({diffStyle:e})})},[r]),Oe=(0,W.useCallback)(e=>{i(()=>{r(e)})},[r]),ke=(0,W.useCallback)(e=>{i(()=>{r({defaultTabSize:e})})},[r]),Ae=(0,W.useCallback)(e=>{i(()=>{r({browser:e})})},[r]),je=(0,W.useCallback)(e=>{i(()=>{r({theme:e})})},[r]),Me=(0,W.useCallback)(e=>{i(()=>{r({editorIDE:e})})},[r]),Ne=(0,W.useCallback)(e=>{i(()=>{r({lineDiffType:e})})},[r]),Pe=(0,W.useCallback)(e=>{i(()=>{r({lineWrap:e})})},[r]),Fe=(0,W.useCallback)(e=>{i(()=>{r({diffIndicators:e})})},[r]),Ie=(0,W.useCallback)(e=>{i(()=>{r({showLineNumbers:e})})},[r]),Le=(0,W.useCallback)(e=>{i(()=>{r({hunkSeparators:e})})},[r]),Re=(0,W.useCallback)(e=>{i(()=>{r({lineHoverHighlight:e})})},[r]),ze=(0,W.useCallback)(e=>{i(()=>{r({fontSize:e})})},[r]),Be=(0,W.useCallback)(e=>{r({haptics:e})},[r]),Ve=(0,W.useCallback)(e=>{r({sounds:e})},[r]),He=(0,W.useCallback)(()=>{Pe(!t.lineWrap)},[t.lineWrap,Pe]),Ue=(0,W.useCallback)(()=>{Ie(!t.showLineNumbers)},[t.showLineNumbers,Ie]),We=(0,W.useCallback)(()=>{let e=[`classic`,`bars`,`none`],n=t.diffIndicators||`classic`,r=e[(e.indexOf(n)+1)%e.length];Fe(r)},[t.diffIndicators,Fe]),Ge=(0,W.useCallback)(()=>{let e=[`word`,`word-alt`,`char`,`none`],n=t.lineDiffType||`word`,r=e[(e.indexOf(n)+1)%e.length];Ne(r)},[t.lineDiffType,Ne]),Ke=(0,W.useCallback)(()=>{L(e=>!e)},[]),qe=(0,W.useCallback)(e=>{if(ve.length===0)return;let t=0;if(P){let n=ve.findIndex(e=>e.name===P);n!==-1&&(t=e===`next`?Math.min(n+1,ve.length-1):Math.max(n-1,0))}let n=ve[t].name;F(n);let r=document.getElementById(`file-${n}`);r&&r.scrollIntoView({block:`start`})},[ve,P,F]),Je=(0,W.useCallback)(()=>{P&&me(P,!pe.has(P))},[P,pe,me]),Ye=(0,W.useCallback)(()=>{De(t.diffStyle===`split`?`unified`:`split`)},[t.diffStyle,De]),Xe=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;ke(e[(e.indexOf(n)+1)%e.length])},[t.defaultTabSize,ke]),Ze=(0,W.useCallback)(()=>{Ke()},[Ke]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),mM(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),mM(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(fM(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(fM(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),mM(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),mM(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),qe(`next`),mM(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),qe(`prev`),mM(`selection`,`navigate`),e=``):e===`v`?(r.preventDefault(),Je(),mM(`selection`,`toggle`),e=``):e===`m`?(r.preventDefault(),Ye(),mM(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),Xe(),mM(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),Ze(),mM(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),He(),mM(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),Ue(),mM(`selection`,`toggle`),e=``):e===`i`?(r.preventDefault(),We(),mM(`selection`,`toggle`),e=``):e===`I`?(r.preventDefault(),Ge(),mM(`selection`,`toggle`),e=``):e===`/`?(r.preventDefault(),ie(`text`),mM(`medium`,`open`),e=``):e===`s`?(r.preventDefault(),ie(`symbols`),mM(`medium`,`open`),e=``):e===`gv`?(r.preventDefault(),ie(`files`),mM(`medium`,`open`),e=``):e===`gt`?(r.preventDefault(),le(!0),mM(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),se(!0),mM(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),clearTimeout(t)}},[ve,P,pe,t.diffStyle,t.defaultTabSize,qe,Je,Ye,Xe,Ze,He,Ue,We,Ge,le]);let Qe=(0,W.useMemo)(()=>({staged:t.staged,untracked:t.untracked}),[t.staged,t.untracked]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]);let $e=(0,W.useMemo)(()=>pj[t.theme||`nord`]||pj.nord,[t.theme]);return(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:$e.type===`dark`?$e.themeName:`nord`,light:$e.type===`light`?$e.themeName:`github-light`}}).catch(e=>{console.error(`Failed to set worker pool render options:`,e)})},[e,$e]),(0,W.useEffect)(()=>{let e=$e.type===`dark`?$e.themeName:`nord`,t=$e.type===`light`?$e.themeName:`github-light`;Hf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[$e]),f?(0,G.jsxs)(`div`,{className:`app skeleton-app`,children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{className:`sidebar skeleton-sidebar`,children:[(0,G.jsx)(`div`,{className:`skeleton-search`}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:8}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`${t%3*16+16}px`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${60+t*12%60}px`}})]},t))})]}),(0,G.jsx)(`main`,{className:`main skeleton-main`,children:(0,G.jsx)(`div`,{className:`diff-viewer`,children:Array.from({length:3}).map((e,t)=>(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`${120+t*45%150}px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`})]}),(0,G.jsx)(`div`,{className:`skeleton-card-body`,children:Array.from({length:5}).map((e,t)=>(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`${50+t*15%45}%`}},t))})]},t))})})]})]}):m?(0,G.jsx)(`div`,{className:`error`,children:(0,G.jsxs)(`p`,{children:[`Error: `,m]})}):(0,G.jsx)(hM,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app`,ref:te,style:{"--sidebar-width":`${R}px`,"--comment-panel-height":`${ue}px`},children:[p&&(0,G.jsx)(`div`,{className:`refresh-bar`,role:`status`,"aria-label":`Refreshing diff`}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:V,"aria-hidden":`true`}),(0,G.jsx)(PF,{repoName:o,branch:s,fileCount:ve.length,additions:be.additions,deletions:be.deletions,commentCount:h.length,planCount:A.length,pendingPlanCount:j,onOpenPlans:()=>Lj(`/plan`),diffStyle:t.diffStyle,diffOptions:Qe,defaultTabSize:t.defaultTabSize,browser:t.browser,theme:t.theme||`nord`,editorIDE:t.editorIDE,customMode:c,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,haptics:t.haptics??!0,sounds:t.sounds??!0,onDiffStyleChange:De,onDiffOptionsChange:Oe,onDefaultTabSizeChange:ke,onBrowserChange:Ae,onOpenThemeModal:()=>le(!0),onEditorIDEChange:Me,onLineDiffTypeChange:Ne,onLineWrapChange:Pe,onDiffIndicatorsChange:Fe,onShowLineNumbersChange:Ie,onHunkSeparatorsChange:Le,onLineHoverHighlightChange:Re,onFontSizeChange:ze,onHapticsChange:Be,onSoundsChange:Ve,onOpenSearch:()=>ie(`all`),onCopyComments:w,onSendToAgent:D,agentWaiting:k,sending:O,comments:h,onEditComment:x,onDeleteComment:_}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{ref:B,className:`sidebar ${I?`sidebar-collapsed`:``}`,children:[(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(FK,{files:ve,activeFile:P,commentCounts:Se,viewedFiles:pe,untrackedFiles:ge,onFileClick:Te,collapsed:I,onToggleCollapse:Ke})}),!I&&h.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`ct-resize-handle`,onMouseDown:fe,role:`separator`,"aria-label":`Resize comments panel`,"aria-orientation":`horizontal`,tabIndex:0}),(0,G.jsx)(`div`,{className:`ct-wrapper`,style:{flexShrink:0},children:(0,G.jsx)(RK,{comments:h,resolveComment:v,unresolveComment:y,removeComment:_,addReply:b,editComment:x,editReply:S,removeReply:C})})]})]}),!I&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:H,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsxs)(`main`,{className:`main`,ref:he,children:[M.inMerge&&M.conflicts.length>0&&(0,G.jsxs)(`div`,{className:`merge-conflict-banner`,children:[(0,G.jsx)(`strong`,{children:`Merge in progress`}),(0,G.jsxs)(`span`,{children:[M.conflicts.length,` unresolved file`,M.conflicts.length===1?``:`s`,` below. Use the inline buttons to accept current/incoming/both, then "Save & stage".`]})]}),M.conflicts.map(e=>(0,G.jsx)(xI,{filePath:e,theme:t.theme||`nord`,fontSize:t.fontSize,tabSize:u[e]??t.defaultTabSize,onSaved:()=>{N()}},e)),(0,G.jsx)(yI,{files:ve,diffStyle:t.diffStyle,tabSizeMap:u,defaultTabSize:t.defaultTabSize,viewedFiles:pe,binaryFiles:xe,theme:t.theme||`nord`,editorIDE:t.editorIDE,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,expandContextByDefault:t.expandContextByDefault,collapsedContextThreshold:t.collapsedContextThreshold,expansionLineCount:t.expansionLineCount,onViewedChange:Ee,fileAnnotationsMap:we,onAddComment:g,onDeleteComment:_})]})]}),(0,G.jsx)(dq,{isOpen:ne.open,onClose:ae,initialScope:ne.scope,files:ve,changedEntries:ye,customMode:c,staged:t.staged,onNavigateFile:Te,theme:t.theme||`nord`,fontSize:t.fontSize,defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight}),(0,G.jsx)(yq,{activeFile:P,onShowHelp:()=>se(!0)}),(0,G.jsx)(bq,{isOpen:oe,onClose:()=>se(!1)}),(0,G.jsx)(Cq,{open:ce,activeTheme:t.theme||`nord`,onThemeChange:je,onClose:()=>le(!1)}),(0,G.jsx)(xq,{activity:T,onDismiss:E,onJump:Te})]})})}function Tq(e,t){if(t<1)return;let n=e.split(`
3857
+ `),r=Math.min(t,n.length);for(let e=r-1;e>=0;e--){let t=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(n[e]);if(t)return t[2].trim()}}function Eq(e,t,n){if(t<1)return``;let r=e.split(`
3858
+ `),i=Math.max(1,t),a=Math.min(n,r.length);return a<i?``:r.slice(i-1,a).join(`
3859
+ `)}function Dq({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(kM,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(yN,{size:t,"aria-hidden":`true`})})}function Oq({comment:e,onResolve:t,onUnresolve:n,onDelete:r,onEdit:i,onReply:a,onEditReply:o,onDeleteReply:s}){let[,c]=(0,W.useState)(0),l=e.status===`resolved`,[u,d]=(0,W.useState)(l),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(null);(0,W.useEffect)(()=>d(e.status===`resolved`),[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>c(e=>e+1),3e4);return()=>clearInterval(e)},[]);let b=e.lineNumber===0,x=e.startLineNumber&&e.startLineNumber!==e.lineNumber,S=(0,G.jsxs)(G.Fragment,{children:[e.sectionTitle&&(0,G.jsxs)(`span`,{className:`plan-comment-section-chip`,title:`Section: ${e.sectionTitle}`,children:[`§\xA0`,e.sectionTitle]}),b?(0,G.jsx)(`span`,{className:`plan-comment-line-chip plan-comment-line-chip-general`,children:`Whole plan`}):(0,G.jsx)(`span`,{className:`plan-comment-line-chip`,children:x?`L${e.startLineNumber}-${e.lineNumber}`:`L${e.lineNumber}`})]});return l&&u?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed plan-comment-resolved-collapsed`,children:[(0,G.jsxs)(`div`,{className:`plan-comment-resolved-left`,children:[(0,G.jsx)(FM,{size:15,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Resolved`}),S,(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{className:`plan-comment-show-resolved`,onClick:()=>d(!1),children:`Show`})]}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${l?`comment-bubble-canvas-resolved`:``}`,id:`plan-comment-${e.id}`,role:`article`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${l?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(Dq,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[dj(e.createdAt),S]}),l&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(FM,{size:13}),`Resolved`]}),!l&&!m&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>h(!0),title:`Edit comment`,"aria-label":`Edit comment`,children:(0,G.jsx)(oN,{size:13,"aria-hidden":`true`})}),g?(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:r,title:`Confirm delete`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,width:`auto`,height:`auto`,display:`flex`,alignItems:`center`,gap:`2px`},children:[(0,G.jsx)(gN,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>_(!1),title:`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>_(!0),title:`Delete comment`,"aria-label":`Delete comment`,children:(0,G.jsx)(hN,{size:13,"aria-hidden":`true`})})]})]}),m?(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(cI,{draftKey:`plan-edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:e=>{i(e),h(!1)},onCancel:()=>h(!1)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body ${l?`comment-resolved-line`:``}`,dangerouslySetInnerHTML:{__html:mj(e.body)}})]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=v===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${l?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(Dq,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:dj(t.createdAt)}),!l&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>y(t.id),title:`Edit reply`,"aria-label":`Edit reply`,children:(0,G.jsx)(oN,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>s(t.id),title:`Delete reply`,"aria-label":`Delete reply`,children:(0,G.jsx)(hN,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(cI,{draftKey:`plan-reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:e=>{o(t.id,e),y(null)},onCancel:()=>y(null)})}):(0,G.jsx)(`div`,{className:`comment-node-body markdown-body`,dangerouslySetInnerHTML:{__html:mj(t.body)}})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!f&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>p(!0),className:`comment-reply-trigger`,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(cN,{size:14,"aria-hidden":`true`}),`Reply...`]}),l?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>d(!0),style:{fontSize:`12px`,padding:`4px 10px`},children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:n,style:{fontSize:`12px`,padding:`4px 10px`},children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:t,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},children:`Resolve`})]}),f&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(cI,{draftKey:`plan-reply:${e.id}`,onSubmit:e=>{a(e),p(!1)},onCancel:()=>p(!1)})})]})]})}var kq=[{value:`approved`,label:`Approve`,description:`The plan looks good — the agent should proceed.`,icon:AM,className:`plan-verdict-approve`},{value:`changes-requested`,label:`Request changes`,description:`The agent should revise the plan and resubmit it.`,icon:QM,className:`plan-verdict-changes`},{value:`rejected`,label:`Reject`,description:`Don't proceed — the approach needs rethinking.`,icon:bN,className:`plan-verdict-reject`}];function Aq({openCommentCount:e,onSubmit:t,submitting:n,agentWaiting:r,currentDecision:i}){let{haptic:a,sound:o}=gM(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(``),p=async()=>{l&&(a(`heavy`),o(`send`),await t(l,d),f(``),u(null),c(!1))},m=i!==`pending`;return(0,G.jsx)(uP,{open:s,onOpenChange:c,ariaLabel:`Submit plan review`,className:`submit-plan-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm`,disabled:n,title:r?`An agent is connected and waiting for your verdict`:`Submit your verdict on this plan`,children:[r&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),n?`Submitting…`:m?`Update review`:`Submit review`]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(LM,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Submit plan review`}),e>0&&(0,G.jsxs)(`span`,{className:`srp-count`,children:[e,` open comment`,e===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:kq.map(e=>{let t=e.icon,n=l===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>u(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`plan-decision-comment`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional)`})]}),(0,G.jsx)(`textarea`,{id:`plan-decision-comment`,className:`srp-general-input`,value:d,placeholder:`Add an overall note for the agent that applies to the whole plan…`,rows:3,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),p())}})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>c(!1),disabled:n,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:p,disabled:!l||n,children:n?`Submitting…`:`Submit review`})]})]})})}var jq={pending:{label:`Pending review`,className:`plan-badge-pending`,icon:zM},approved:{label:`Approved`,className:`plan-badge-approved`,icon:AM},"changes-requested":{label:`Changes requested`,className:`plan-badge-changes`,icon:QM},rejected:{label:`Rejected`,className:`plan-badge-rejected`,icon:bN}};function Mq({plan:e,theme:t,fontSize:n,defaultTabSize:r,lineWrap:i,showLineNumbers:a,lineHoverHighlight:o}){let{addPlanComment:s,editPlanComment:c,resolvePlanComment:l,unresolvePlanComment:u,removePlanComment:d,addPlanReply:f,editPlanReply:p,removePlanReply:m,submitDecision:h,submitting:g,agentWaiting:_}=Pj(),[v,y]=(0,W.useState)(`source`),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(0),[E,D]=(0,W.useState)(!1),O=pj[t]||pj.nord,k=(0,W.useMemo)(()=>Nq(r,n),[r,n]),A=e.comments??[],j=A.filter(e=>e.lineNumber>0),M=A.filter(e=>e.lineNumber===0),N=A.filter(e=>e.status===`open`).length,P=(t,n)=>Eq(e.body,t??n,n),F=(t,n)=>{s({planId:e.id,lineNumber:t.lineNumber,startLineNumber:t.startLineNumber,lineContent:P(t.startLineNumber,t.lineNumber),sectionTitle:Tq(e.body,t.startLineNumber??t.lineNumber),body:n}),x(null),C(null)},I=(0,W.useMemo)(()=>{let e=j.map(e=>({lineNumber:e.lineNumber,metadata:e}));return b&&e.push({lineNumber:b.lineNumber,metadata:{_pending:!0}}),e},[j,b]),L=t=>{let n=t.metadata;if(!n)return null;if(`_pending`in n){let t=b;return(0,G.jsx)(cI,{draftKey:`plan-new:${e.id}:${t.startLineNumber??t.lineNumber}:${t.lineNumber}`,lineContent:P(t.startLineNumber,t.lineNumber),onSubmit:e=>F(t,e),onCancel:()=>{x(null),C(null)}})}let r=n;return(0,G.jsx)(Oq,{comment:r,onResolve:()=>l(e.id,r.id),onUnresolve:()=>u(e.id,r.id),onDelete:()=>d(e.id,r.id),onEdit:t=>c(e.id,r.id,t),onReply:t=>f(e.id,r.id,t),onEditReply:(t,n)=>p(e.id,r.id,t,n),onDeleteReply:t=>m(e.id,r.id,t)})},R=jq[e.decision],z=R.icon;return(0,G.jsxs)(`div`,{className:`plan-review`,children:[(0,G.jsxs)(`div`,{className:`plan-review-head`,children:[(0,G.jsxs)(`div`,{className:`plan-review-head-main`,children:[(0,G.jsx)(`h2`,{className:`plan-review-title`,title:e.title,children:e.title}),(0,G.jsxs)(`div`,{className:`plan-review-meta`,children:[(0,G.jsxs)(`span`,{className:`plan-badge ${R.className}`,children:[(0,G.jsx)(z,{size:12,"aria-hidden":`true`}),R.label]}),(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[`v`,e.version]}),e.source&&(0,G.jsx)(`span`,{className:`plan-review-chip`,children:e.source}),e.model&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-model`,children:[(0,G.jsx)(kM,{size:11,"aria-hidden":`true`}),e.model]}),j.length+M.length>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[A.length,` comment`,A.length===1?``:`s`]}),w>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-selection`,"aria-live":`polite`,children:[w,` line`,w===1?``:`s`,` selected`]})]})]}),(0,G.jsxs)(`div`,{className:`plan-review-head-actions`,children:[(0,G.jsxs)(`div`,{className:`plan-view-toggle`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm ${v===`source`?`btn-active`:``}`,onClick:()=>y(`source`),title:`Source view — comment on specific lines`,children:[(0,G.jsx)(BM,{size:13,style:{marginRight:`4px`}}),`Source`]}),(0,G.jsxs)(`button`,{className:`btn btn-sm ${v===`rendered`?`btn-active`:``}`,onClick:()=>y(`rendered`),title:`Rendered markdown preview`,children:[(0,G.jsx)(UM,{size:13,style:{marginRight:`4px`}}),`Rendered`]})]}),(0,G.jsxs)(`button`,{className:`btn btn-sm`,onClick:()=>D(e=>!e),title:`Comment on the whole plan`,children:[(0,G.jsx)(ZM,{size:13,style:{marginRight:`4px`}}),`General comment`]}),(0,G.jsx)(Aq,{openCommentCount:N,onSubmit:(t,n)=>h(e.id,t,n),submitting:g,agentWaiting:_,currentDecision:e.decision})]})]}),e.decision!==`pending`&&(0,G.jsxs)(`div`,{className:`plan-decision-banner ${R.className}`,children:[(0,G.jsx)(z,{size:15,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`plan-decision-banner-text`,children:[(0,G.jsx)(`strong`,{children:R.label}),e.decisionComment&&(0,G.jsx)(`span`,{className:`plan-decision-banner-note`,children:e.decisionComment})]})]}),(M.length>0||E)&&(0,G.jsxs)(`div`,{className:`plan-general-section`,children:[(0,G.jsxs)(`div`,{className:`plan-general-header`,children:[(0,G.jsx)(ZM,{size:14}),(0,G.jsxs)(`span`,{children:[`General comments (`,M.length,`)`]})]}),M.map(t=>(0,G.jsx)(Oq,{comment:t,onResolve:()=>l(e.id,t.id),onUnresolve:()=>u(e.id,t.id),onDelete:()=>d(e.id,t.id),onEdit:n=>c(e.id,t.id,n),onReply:n=>f(e.id,t.id,n),onEditReply:(n,r)=>p(e.id,t.id,n,r),onDeleteReply:n=>m(e.id,t.id,n)},t.id)),E&&(0,G.jsx)(`div`,{className:`plan-general-form`,children:(0,G.jsx)(cI,{draftKey:`plan-general:${e.id}`,lineContent:``,onSubmit:t=>{s({planId:e.id,lineNumber:0,lineContent:``,body:t}),D(!1)},onCancel:()=>D(!1)})})]}),v===`rendered`?(0,G.jsx)(`div`,{className:`markdown-body plan-rendered`,dangerouslySetInnerHTML:{__html:mj(e.body)}}):(0,G.jsx)(`div`,{className:`plan-file`,children:(0,G.jsx)(zh,{file:{name:`PLAN.md`,contents:e.body,lang:`markdown`},options:{disableFileHeader:!0,enableGutterUtility:!0,enableLineSelection:!0,overflow:i?`wrap`:`scroll`,disableLineNumbers:!a,lineHoverHighlight:o,onLineSelectionStart:()=>{C(null),T(0)},onLineSelectionChange:e=>{T(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{T(0),e&&(C(e),x({lineNumber:e.end,startLineNumber:e.start}))},theme:{dark:O.type===`dark`?O.themeName:`nord`,light:O.type===`light`?O.themeName:`github-light`},themeType:O.type,unsafeCSS:k},selectedLines:S,lineAnnotations:I,renderAnnotation:L,renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&x({lineNumber:t.lineNumber})},children:`+`})})})]})}function Nq(e,t){return`
3860
+ :host {
3861
+ --diffs-tab-size: ${e} !important;
3862
+ --diffs-font-family: var(--font-mono) !important;
3863
+ --diffs-font-size: ${t}px !important;
3864
+ --diffs-border: var(--border-normal) !important;
3865
+ --diffs-bg: var(--bg-secondary) !important;
3866
+ --diffs-line-height: ${Math.round(t*1.7)}px !important;
3867
+ }
3868
+ [data-column-number], [data-line] {
3869
+ font-family: var(--font-mono) !important;
3870
+ font-size: ${t}px !important;
3871
+ font-variant-ligatures: common-ligatures !important;
3872
+ font-feature-settings: "liga" on, "calt" on !important;
3873
+ }
3874
+ [data-column-number] {
3875
+ color: var(--text-muted) !important;
3876
+ opacity: 0.65 !important;
3877
+ user-select: none !important;
3878
+ padding-right: 12px !important;
3879
+ }
3880
+ [data-line]:hover [data-column-number] {
3881
+ opacity: 1 !important;
3882
+ color: var(--primary) !important;
3883
+ }
3884
+ [data-line].selected-line {
3885
+ background-color: var(--accent-subtle) !important;
3886
+ }
3887
+ `}var Pq={pending:{icon:zM,className:`plan-badge-pending`,label:`Pending`},approved:{icon:AM,className:`plan-badge-approved`,label:`Approved`},"changes-requested":{icon:QM,className:`plan-badge-changes`,label:`Changes`},rejected:{icon:bN,className:`plan-badge-rejected`,label:`Rejected`}};function Fq({plans:e,activeId:t,onSelect:n,onDelete:r}){let i=[...e].sort((e,t)=>t.createdAt-e.createdAt);return(0,G.jsxs)(`div`,{className:`plan-list`,children:[(0,G.jsxs)(`div`,{className:`plan-list-header`,children:[`Plans (`,e.length,`)`]}),i.length===0&&(0,G.jsx)(`div`,{className:`plan-list-empty`,children:`No plans submitted yet.`}),i.map(e=>{let i=Pq[e.decision],a=i.icon,o=(e.comments??[]).filter(e=>e.status===`open`).length;return(0,G.jsxs)(`div`,{className:`plan-list-item ${e.id===t?`plan-list-item-active`:``}`,onClick:()=>n(e.id),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id))},children:[(0,G.jsxs)(`div`,{className:`plan-list-item-top`,children:[(0,G.jsx)(`span`,{className:`plan-badge plan-badge-dot ${i.className}`,title:i.label,children:(0,G.jsx)(a,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`plan-list-item-title`,title:e.title,children:e.title}),(0,G.jsx)(`button`,{className:`plan-list-delete`,title:`Delete plan`,onClick:t=>{t.stopPropagation(),r(e.id)},children:(0,G.jsx)(hN,{size:12,"aria-hidden":`true`})})]}),(0,G.jsxs)(`div`,{className:`plan-list-item-sub`,children:[(0,G.jsxs)(`span`,{children:[`v`,e.version]}),o>0&&(0,G.jsxs)(`span`,{children:[`· `,o,` open`]}),e.model&&(0,G.jsxs)(`span`,{className:`plan-list-item-model`,children:[`· `,(0,G.jsx)(kM,{size:10,"aria-hidden":`true`}),` `,e.model]}),(0,G.jsxs)(`span`,{className:`plan-list-item-time`,children:[`· `,dj(e.createdAt)]})]})]},e.id)})]})}function Iq(){let e=km(),{settings:t,updateSettings:n}=Wj(),{plans:r,getPlan:i,removePlan:a,agentActivity:o,clearAgentActivity:s}=Pj(),c=Vj(),[l,u]=(0,W.useState)(!1),d=(0,W.useMemo)(()=>{let e=/^\/plan\/([^/]+)/.exec(c);return e?decodeURIComponent(e[1]):null},[c]),f=(0,W.useMemo)(()=>d?i(d):r.length===0?null:[...r].reverse().find(e=>e.decision===`pending`)??r[r.length-1],[d,r,i]),p=(0,W.useMemo)(()=>pj[t.theme||`nord`]||pj.nord,[t.theme]);return(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]),(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:p.type===`dark`?p.themeName:`nord`,light:p.type===`light`?p.themeName:`github-light`}}).catch(e=>console.error(`Failed to set worker pool render options:`,e))},[e,p]),(0,W.useEffect)(()=>{let e=p.type===`dark`?p.themeName:`nord`,t=p.type===`light`?p.themeName:`github-light`;Hf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[p]),(0,G.jsx)(hM,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app plan-app`,children:[(0,G.jsxs)(`div`,{className:`toolbar plan-app-toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm`,onClick:()=>Lj(`/`),title:`Back to the diff review`,children:[(0,G.jsx)(OM,{size:14,style:{marginRight:`6px`}}),`Diff`]}),(0,G.jsxs)(`h1`,{className:`toolbar-title plan-app-title`,children:[(0,G.jsx)(RM,{size:16,style:{marginRight:`6px`}}),`Plan review`]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[r.length,` plan`,r.length===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`toolbar-right`,children:(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,title:`Switch theme`,onClick:()=>u(!0),children:[(0,G.jsx)(nN,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Theme`})]})})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{className:`sidebar plan-sidebar`,children:(0,G.jsx)(Fq,{plans:r,activeId:f?.id??null,onSelect:e=>Lj(`/plan/${e}`),onDelete:e=>{a(e),f?.id===e&&Lj(`/plan`)}})}),(0,G.jsx)(`main`,{className:`main plan-main`,children:f?(0,G.jsx)(Mq,{plan:f,theme:t.theme||`nord`,fontSize:t.fontSize,defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight},f.id):(0,G.jsx)(Lq,{hasPlans:r.length>0,notFound:!!d})})]}),(0,G.jsx)(Cq,{open:l,activeTheme:t.theme||`nord`,onThemeChange:e=>n({theme:e}),onClose:()=>u(!1)}),(0,G.jsx)(xq,{activity:o?{at:o.at,commentId:o.commentId,filePath:`plan comment`,model:o.model,body:o.body}:null,onDismiss:s,onJump:()=>{o&&Lj(`/plan/${o.planId}`)}})]})})}function Lq({hasPlans:e,notFound:t}){return(0,G.jsxs)(`div`,{className:`plan-empty-state`,children:[(0,G.jsx)(RM,{size:40,style:{opacity:.4}}),t?(0,G.jsx)(`p`,{children:`That plan no longer exists. Pick one from the list, or submit a new plan.`}):e?(0,G.jsx)(`p`,{children:`Select a plan from the list to review it.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{children:`No plans have been submitted for review yet.`}),(0,G.jsxs)(`p`,{className:`plan-empty-hint`,children:[`An agent can submit one with`,` `,(0,G.jsx)(`code`,{children:`diffing plan submit PLAN.md`}),` (or the `,(0,G.jsx)(`code`,{children:`submit_plan`}),` MCP tool), then block on`,` `,(0,G.jsx)(`code`,{children:`diffing plan await`}),` until you approve, reject, or request changes here.`]})]})]})}function Rq(){let e=Vj();return e===`/plan`||e.startsWith(`/plan/`)?(0,G.jsx)(Iq,{}):(0,G.jsx)(wq,{})}var zq=new Le;(0,mn.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(He,{client:zq,children:(0,G.jsx)(ot,{children:(0,G.jsx)(Om,{poolOptions:{workerFactory:()=>new k_,poolSize:Math.max(1,Math.min(4,navigator.hardwareConcurrency||2))},highlighterOptions:{theme:{dark:`nord`,light:`github-light`}},children:(0,G.jsx)(ZT,{children:(0,G.jsx)(Rq,{})})})})}));export{s as t};