bb-app 0.0.7 → 0.0.9

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 (102) hide show
  1. package/app/dist/assets/{AppSettingsView-6Zzy6BfL.js → AppSettingsView-3xuBYGm-.js} +1 -1
  2. package/app/dist/assets/InternalReplayListView-D4BuZuhX.js +1 -0
  3. package/app/dist/assets/{ProjectArchivedThreadsView-65_OMZ83.js → ProjectArchivedThreadsView-CQ79aEPs.js} +1 -1
  4. package/app/dist/assets/ProjectSettingsView-D0t1s9Kc.js +1 -0
  5. package/app/dist/assets/ThreadDetailRoute-S7gHiq2R.js +2871 -0
  6. package/app/dist/assets/ThreadUnarchiveButton-ae8m78ng.js +1 -0
  7. package/app/dist/assets/{angular-html-BnZNhOVu.js → angular-html-CsQHuPoy.js} +1 -1
  8. package/app/dist/assets/{angular-ts-DErpwNhE.js → angular-ts-B9caFRUl.js} +1 -1
  9. package/app/dist/assets/{apl-jktjMWm9.js → apl-BaFDIJAy.js} +1 -1
  10. package/app/dist/assets/{astro-OyfDR1ll.js → astro-CB3F_OsY.js} +1 -1
  11. package/app/dist/assets/{blade-l0Ufqsdo.js → blade-CjgH6QoP.js} +1 -1
  12. package/app/dist/assets/{c-Zl_aQ3ky.js → c-Bknf8flU.js} +1 -1
  13. package/app/dist/assets/{chunk-JZWAC4HX-CIhf07b6.js → chunk-JZWAC4HX-C0wcTaAp.js} +1 -1
  14. package/app/dist/assets/{cobol-_uRe_arD.js → cobol-s_WYmRkb.js} +1 -1
  15. package/app/dist/assets/{coffee-CfM2Lk3K.js → coffee-B4wogQNr.js} +1 -1
  16. package/app/dist/assets/{cpp-BARm9yzN.js → cpp-DBcUjMMg.js} +1 -1
  17. package/app/dist/assets/{crystal-DPHSLUHj.js → crystal-BEUw9aly.js} +1 -1
  18. package/app/dist/assets/{css-CaJEL4gr.js → css-Tyi5cHoy.js} +1 -1
  19. package/app/dist/assets/{dialog-CuU6GHxh.js → dialog-yU2jYzlX.js} +1 -1
  20. package/app/dist/assets/{edge-Dv3pZ6l2.js → edge-DBVUn5K4.js} +1 -1
  21. package/app/dist/assets/{effective-hosts-DNH4ZZMO.js → effective-hosts-L1PAD_aI.js} +4 -4
  22. package/app/dist/assets/{elixir-5FXX4Nj9.js → elixir-DScCko2H.js} +1 -1
  23. package/app/dist/assets/{elm-Dt58k6O0.js → elm-C4qaS622.js} +1 -1
  24. package/app/dist/assets/{erb-CVKj_0yX.js → erb-CZnOXF4N.js} +1 -1
  25. package/app/dist/assets/{git-rebase-vj4pqTZR.js → git-rebase-QEKpMjJZ.js} +1 -1
  26. package/app/dist/assets/{glimmer-js-D-OzgliZ.js → glimmer-js-BNOZF2qI.js} +1 -1
  27. package/app/dist/assets/{glimmer-ts-DmVVrzIL.js → glimmer-ts-apIdP2bg.js} +1 -1
  28. package/app/dist/assets/{glsl-B1HRIf6W.js → glsl-Dg2m4Gqj.js} +1 -1
  29. package/app/dist/assets/{graphql-CRBPsUaz.js → graphql-DFhF_r-2.js} +1 -1
  30. package/app/dist/assets/{hack-BArcdkL7.js → hack-Bhx0ZE7U.js} +1 -1
  31. package/app/dist/assets/{haml-De5cSl4E.js → haml-DI6_Yg2F.js} +1 -1
  32. package/app/dist/assets/{handlebars-8Zy2Vs3a.js → handlebars-BnNY7a5K.js} +1 -1
  33. package/app/dist/assets/{html-YVJdK98d.js → html-BOXTZS1i.js} +1 -1
  34. package/app/dist/assets/{html-derivative-BT0t4I9A.js → html-derivative-v40-23QP.js} +1 -1
  35. package/app/dist/assets/{http-DC0GH0Bs.js → http-BjNdwlfX.js} +1 -1
  36. package/app/dist/assets/{hurl-D2fUFTSB.js → hurl-FLqiDEN1.js} +1 -1
  37. package/app/dist/assets/{index-BRo1YnbF.js → index-aLeXFWbZ.js} +27 -27
  38. package/app/dist/assets/{java-BQoJICeR.js → java-BK7M4QRN.js} +1 -1
  39. package/app/dist/assets/{javascript-Ct_DN1X8.js → javascript-CIysJabp.js} +1 -1
  40. package/app/dist/assets/{jinja-C1ngEoTP.js → jinja-D22cUMUY.js} +1 -1
  41. package/app/dist/assets/{jison-C5ZNVS2c.js → jison-D5ZXfQQd.js} +1 -1
  42. package/app/dist/assets/{json-DVa2wY6T.js → json-DEUxBxBS.js} +1 -1
  43. package/app/dist/assets/{jsx-BJqlX6qV.js → jsx-cxjRg4Z9.js} +1 -1
  44. package/app/dist/assets/{julia-Btw_zR3T.js → julia-DfQvji8F.js} +1 -1
  45. package/app/dist/assets/{just-CbiU0D8M.js → just-7mfnOEVc.js} +1 -1
  46. package/app/dist/assets/{latex-VgwkhkD-.js → latex-CmEGWjs7.js} +1 -1
  47. package/app/dist/assets/{liquid-D6T8WtC6.js → liquid-Cmbkwo5G.js} +1 -1
  48. package/app/dist/assets/localhost-badge-CmIXXpKJ.js +22 -0
  49. package/app/dist/assets/{lua-CuA24JSE.js → lua-DJijm0YV.js} +1 -1
  50. package/app/dist/assets/{marko-CdDxo3xN.js → marko-TMTUEuNL.js} +1 -1
  51. package/app/dist/assets/{mdc-BJBOg0pF.js → mdc-DT_H0tm2.js} +1 -1
  52. package/app/dist/assets/{mutation-cache-effects-xpqBLSkL.js → mutation-cache-effects-CDggZqqz.js} +1 -1
  53. package/app/dist/assets/{nginx-tsneJbc1.js → nginx-DfhY1ECI.js} +1 -1
  54. package/app/dist/assets/{nim-Uh4_TEhl.js → nim-CY6yBY6c.js} +1 -1
  55. package/app/dist/assets/{page-shell-BdV9dDbP.js → page-shell-BWng2QUG.js} +1 -1
  56. package/app/dist/assets/{perl-Cvf95oTY.js → perl-BRRcO43t.js} +1 -1
  57. package/app/dist/assets/{php-B83K9nvD.js → php-DoQeKnTv.js} +1 -1
  58. package/app/dist/assets/{pill-T3MuOnWq.js → pill-CoTRlxZ6.js} +1 -1
  59. package/app/dist/assets/{pug-DgUV-atw.js → pug-BusbjPKV.js} +1 -1
  60. package/app/dist/assets/{qml-DSVs6hjq.js → qml-D4hm6vUS.js} +1 -1
  61. package/app/dist/assets/{r-SJZNyiX3.js → r-C3JOt0ks.js} +1 -1
  62. package/app/dist/assets/{razor-CT_zg6et.js → razor-MHFIGhr-.js} +1 -1
  63. package/app/dist/assets/{regexp-CPrDWy5-.js → regexp-DmDmHqK0.js} +1 -1
  64. package/app/dist/assets/{rst-B9Z3vumO.js → rst-D5K5OvKu.js} +1 -1
  65. package/app/dist/assets/{ruby-C4G9wCRV.js → ruby-qXw_ViMa.js} +1 -1
  66. package/app/dist/assets/{sas-DtD9kPDC.js → sas-SiqJsOSW.js} +1 -1
  67. package/app/dist/assets/{scss-DcJY8Ckr.js → scss-B9bBsqJt.js} +1 -1
  68. package/app/dist/assets/{settings-section-CckkqJNV.js → settings-section-B0JkCbim.js} +1 -1
  69. package/app/dist/assets/{shellscript-CpA00qMx.js → shellscript-B0hF8Ck_.js} +1 -1
  70. package/app/dist/assets/{shellsession-DFkHMqry.js → shellsession-kbvqTqYV.js} +1 -1
  71. package/app/dist/assets/{soy-DEEx3Rib.js → soy-DED6zzHR.js} +1 -1
  72. package/app/dist/assets/split-button-D4kqBiFb.js +1 -0
  73. package/app/dist/assets/{sql-CnuL_wU6.js → sql-kJQbrAD6.js} +1 -1
  74. package/app/dist/assets/{stata-TDxB0qbw.js → stata-Bsjpyopz.js} +1 -1
  75. package/app/dist/assets/{surrealql-GfZLB7-R.js → surrealql-CV66KZgA.js} +1 -1
  76. package/app/dist/assets/{svelte-C1vkmr9X.js → svelte-DQTF70EG.js} +1 -1
  77. package/app/dist/assets/{templ-i1836R3s.js → templ-5jXq5O2y.js} +1 -1
  78. package/app/dist/assets/{tex-DHz9nFDC.js → tex-BKPWc06x.js} +1 -1
  79. package/app/dist/assets/thread-queries-fJ7WqAPD.js +1 -0
  80. package/app/dist/assets/{ts-tags-CsR619BC.js → ts-tags-DHR5Sjbn.js} +1 -1
  81. package/app/dist/assets/{tsx-CXRf_lPc.js → tsx-BikICA1y.js} +1 -1
  82. package/app/dist/assets/{twig-B_nSkJZb.js → twig-D00gH1GT.js} +1 -1
  83. package/app/dist/assets/{typescript-Cu2naiFK.js → typescript-B9SUz1Ri.js} +1 -1
  84. package/app/dist/assets/{vue-html-Dv_PI5xi.js → vue-html-CxTWudeN.js} +1 -1
  85. package/app/dist/assets/{vue-D3uT4E2F.js → vue-nmyY5t9g.js} +1 -1
  86. package/app/dist/assets/{vue-vine-CTHIuOTa.js → vue-vine-DKOrFY9Z.js} +1 -1
  87. package/app/dist/assets/{xml-CWWC84Is.js → xml-vPV5v5Ih.js} +1 -1
  88. package/app/dist/assets/{xsl-CXHXpU_z.js → xsl-FiPzBrgC.js} +1 -1
  89. package/app/dist/assets/{yaml-MdGg4yLc.js → yaml-CYAqjA7C.js} +1 -1
  90. package/app/dist/index.html +8 -8
  91. package/dist/bb-app.js +77 -15
  92. package/dist/bb-host-daemon.js +57 -5
  93. package/host-daemon/dist/daemon-bundle.mjs +215 -215
  94. package/package.json +1 -1
  95. package/server/dist/index.js +1886 -1666
  96. package/app/dist/assets/InternalReplayListView-Cxndg0Hg.js +0 -1
  97. package/app/dist/assets/ProjectSettingsView-GUrHZAv8.js +0 -1
  98. package/app/dist/assets/ThreadDetailRoute-DpnTShJQ.js +0 -2871
  99. package/app/dist/assets/ThreadUnarchiveButton-D_xRAhIX.js +0 -1
  100. package/app/dist/assets/localhost-badge-CSYdoqAD.js +0 -22
  101. package/app/dist/assets/split-button-CDmbOtUR.js +0 -1
  102. package/app/dist/assets/thread-queries-DBgy7tqz.js +0 -1
@@ -1,2871 +0,0 @@
1
- import{$r as e,$t as t,B as n,Dn as r,Fi as i,Fn as a,I as o,Mn as s,Mr as c,Mt as l,N as u,Nt as d,Ot as f,P as p,Pi as m,Qt as h,R as g,Rr as _,Rt as v,Si as y,Ut as b,V as x,Xn as S,Xt as C,Yt as w,Zn as T,Zt as E,aa as D,ai as O,ar as k,bi as A,cr as j,ei as M,en as N,fi as P,fn as F,ia as I,ii as L,ir as R,lr as ee,n as te,ni as ne,or as re,ri as z,rr as B,si as V,t as ie,ua as ae,xi as oe,yi as H,zr as se}from"./page-shell-BdV9dDbP.js";import{Ct as ce,Ft as le,It as ue,Rt as de,_t as fe,c as pe,d as me,h as U,o as he,p as ge,t as W,u as _e}from"./effective-hosts-DNH4ZZMO.js";import{E as ve,S as ye,T as be,_ as xe,a as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe,v as Ie,w as Le,y as Re}from"./thread-queries-DBgy7tqz.js";import{c as ze,d as Be,n as Ve,p as He,r as Ue,s as We,u as Ge}from"./chunk-JZWAC4HX-CIhf07b6.js";import{a as Ke,g as qe,h as Je,i as Ye,o as G,r as Xe,s as Ze,t as Qe,u as $e,v as et,y as tt}from"./dialog-CuU6GHxh.js";import{A as nt,S as rt,_ as it,a as K,b as at,g as ot,h as st,k as ct,m as lt,p as ut,t as dt,v as ft,y as pt}from"./localhost-badge-CSYdoqAD.js";import{f as mt}from"./mutation-cache-effects-xpqBLSkL.js";import{$ as ht,$t as gt,A as _t,At as vt,B as yt,Bt as bt,C as xt,Ct as St,D as Ct,Dt as wt,E as Tt,Et,F as Dt,Ft as Ot,G as kt,Gt as At,H as jt,I as Mt,It as Nt,J as Pt,Jt as Ft,K as It,Kt as Lt,L as Rt,Lt as zt,M as Bt,Mt as Vt,N as Ht,Nt as Ut,O as Wt,Ot as Gt,Pt as Kt,Q as qt,Qt as Jt,R as Yt,Rt as Xt,S as Zt,St as Qt,Tt as $t,U as en,Ut as tn,V as nn,Vt as rn,W as an,Wt as on,X as sn,Xt as cn,Y as ln,Z as un,Zt as dn,_ as fn,_t as pn,a as mn,at as hn,b as gn,bt as _n,c as vn,ct as yn,d as bn,dn as xn,dt as Sn,en as Cn,et as wn,f as Tn,fn as En,ft as Dn,g as On,gn as kn,gt as An,h as jn,hn as Mn,ht as Nn,i as Pn,it as Fn,j as In,jt as Ln,k as Rn,kt as zn,l as Bn,lt as Vn,m as Hn,mt as Un,n as Wn,nn as Gn,nt as Kn,o as qn,on as Jn,ot as Yn,p as Xn,pt as Zn,q as Qn,r as $n,rn as er,rt as tr,s as nr,sn as rr,st as ir,t as ar,tn as or,tt as sr,u as cr,ut as lr,v as ur,vt as dr,w as fr,wt as pr,x as mr,xt as hr,y as gr,yt as _r,z as vr,zt as yr}from"./index-BRo1YnbF.js";import{t as br}from"./pill-T3MuOnWq.js";import{t as xr}from"./split-button-CDmbOtUR.js";import{t as Sr}from"./ThreadUnarchiveButton-D_xRAhIX.js";var q=ae(I(),1);function Cr(e,t){return nt((0,q.useMemo)(()=>tt(null,(t,n,...r)=>e(t,n,...r)),[e]),t)}var wr=class{highlighter;renderCache;computedLang=`text`;lineAnnotations={};constructor(e={theme:yr},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Gt(e.theme??yr)?vt():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&this.mergeOptions({themeType:e})}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.renderCache=void 0,this.highlighter=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}hydrate(e){let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getFileResultCache(e);n!=null&&!Tr(t,n.options)&&(n=void 0),this.renderCache??={file:e,options:t,highlighted:!0,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightFileAST(this,e):this.asyncHighlight(e).then(({result:t,options:n})=>{this.onHighlightSuccess(e,t,n)})}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();let{theme:e=yr,tokenizeMaxLineLength:t=1e3}=this.options;return{theme:e,tokenizeMaxLineLength:t}})(),{renderCache:n}=this;return n?.result==null||e!==n.file||!Tr(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderFile(e=this.renderCache?.file){if(e==null)return;let t=this.workerManager?.getFileResultCache(e);t!=null&&this.renderCache==null&&(this.renderCache={file:e,highlighted:!0,...t});let{options:n,forceRender:r}=this.getRenderOptions(e);if(this.renderCache??={file:e,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainFileAST(e),(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??hr(e.name);let t=this.highlighter!=null&&Gt(n.theme),i=this.highlighter!=null&&Ut(this.computedLang);if(this.highlighter!=null&&t&&(r||!this.renderCache.highlighted&&i||this.renderCache.result==null)){let{result:t,options:n}=this.renderFileWithHighlighter(e,this.highlighter,!i);this.renderCache={file:e,options:n,highlighted:i,result:t}}(!t||!i)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.onHighlightSuccess(e,t,n)})}return this.renderCache.result==null?void 0:this.processFileResult(this.renderCache.file,this.renderCache.result)}async asyncRender(e){let{result:t}=await this.asyncHighlight(e);return this.processFileResult(e,t)}async asyncHighlight(e){this.computedLang=e.lang??hr(e.name);let t=this.highlighter!=null&&wt(zn(this.options.theme)),n=this.highlighter!=null&&Ut(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter)}renderFileWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e);return{result:dr(e,t,r,n),options:r}}processFileResult(e,t){let{disableFileHeader:n=!1}=this.options,r=[],i=1;for(let e of t.code){r.push(e);let t=this.lineAnnotations[i];t!=null&&r.push(pr({type:`annotation`,hunkIndex:0,lineIndex:i,annotations:t.map(e=>_r(e))})),i++}return{codeAST:r,preAST:this.createPreElement(t.code.length,t.themeStyles,t.baseThemeType),headerAST:n?void 0:this.renderHeader(e,t.themeStyles,t.baseThemeType),totalLines:t.code.length,themeStyles:t.themeStyles,baseThemeType:t.baseThemeType,css:``}}renderHeader(e,t,n){let{themeType:r=`system`}=this.options;return St({fileOrDiff:e,themeStyles:t,themeType:n??r})}renderFullHTML(e){return Vt(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push($t({tagName:`code`,children:e.codeAST,properties:{"data-code":``}})),{...e.preAST,children:t}}renderPartialHTML(e,t=!1){return Vt(t?$t({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await Ln(_n(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;let r=this.renderCache.file!==e||!this.renderCache.highlighted||!Tr(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:!0,result:t},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}createPreElement(e,t,n){let{disableLineNumbers:r=!1,overflow:i=`scroll`,themeType:a=`system`}=this.options;return Qt({diffIndicators:`none`,disableBackground:!0,disableLineNumbers:r,overflow:i,themeStyles:t,themeType:n??a,split:!1,totalLines:e})}};function Tr(e,t){return Et(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}var Er=-1,Dr=class{static LoadedCustomComponent=!0;__id=++Er;fileContainer;spriteSVG;pre;code;unsafeCSSStyle;hoverContent;errorWrapper;headerElement;headerMetadata;fileRenderer;resizeManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];file;constructor(e={theme:yr},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new wr(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new Kt,this.mouseEventManager=new Ot(`file`,Nt(e)),this.lineSelectionManager=new zt(Xt(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){this.file!=null&&this.render({file:this.file,forceRender:!0})}setOptions(e){e!=null&&(this.options=e,this.mouseEventManager.setOptions(Nt(e)),this.lineSelectionManager.setOptions(Xt(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.fileRenderer.setThemeType(e),this.headerElement!=null&&(e===`system`?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=e),this.pre!=null))switch(e){case`system`:delete this.pre.dataset.themeType;break;case`light`:case`dark`:this.pre.dataset.themeType=e;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.lineSelectionManager.setSelection(e)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=``),this.fileContainer=void 0,this.pre=void 0,this.headerElement=void 0,this.errorWrapper=void 0,this.unsafeCSSStyle=void 0}hydrate(e){let{fileContainer:t,prerenderedHTML:n}=e;lr(t,n);for(let e of Array.from(t.shadowRoot?.children??[])){if(e instanceof SVGElement){this.spriteSVG=e;continue}if(e instanceof HTMLElement){if(e instanceof HTMLPreElement){this.pre=e;continue}if(e instanceof HTMLStyleElement&&e.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=e;continue}if(`diffsHeader`in e.dataset){this.headerElement=e;continue}}}if(this.pre==null)this.render(e);else{let{file:n,lineAnnotations:r}=e;this.fileContainer=t,delete this.pre.dataset.dehydrated,this.lineAnnotations=r??this.lineAnnotations,this.file=n,this.fileRenderer.hydrate(n),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??`scroll`)===`scroll`&&this.resizeManager.setup(this.pre)}}render({file:e,fileContainer:t,forceRender:n=!1,containerWrapper:r,lineAnnotations:i}){let a=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(!n&&An(this.file,e)&&!a)return;this.file=e,this.fileRenderer.setOptions(this.options),i!=null&&this.setLineAnnotations(i),this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableFileHeader:o=!1,disableErrorHandling:s=!1}=this.options;o&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),t=this.getOrCreateFileContainerNode(t,r);try{let n=this.fileRenderer.renderFile(e);if(n==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}n.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t);let r=this.getOrCreatePreNode(t);this.applyHunksToDOM(n,r),this.renderAnnotations(),this.renderHoverUtility()}catch(e){if(s)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(let e of this.annotationElements)e.parentNode?.removeChild(e);this.annotationElements.length=0;let{renderAnnotation:e}=this.options;if(e!=null&&this.lineAnnotations.length>0)for(let t of this.lineAnnotations){let n=e(t);if(n==null)continue;let r=Nn(_r(t));r.appendChild(n),this.annotationElements.push(r),this.fileContainer.appendChild(r)}}renderHoverUtility(){let{renderHoverUtility:e}=this.options;if(this.fileContainer==null||e==null)return;this.hoverContent??(this.hoverContent=Zn(),this.fileContainer.appendChild(this.hoverContent));let t=e(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML=``,t!=null&&this.hoverContent.appendChild(t)}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;let{unsafeCSS:e}=this.options;if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.parentNode?.removeChild(this.unsafeCSSStyle),this.unsafeCSSStyle=void 0);return}this.unsafeCSSStyle??(this.unsafeCSSStyle=Dn(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Sn(e)}applyHunksToDOM(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),t.innerHTML=``,this.code=Un(),this.code.innerHTML=this.fileRenderer.renderPartialHTML(e.codeAST),t.appendChild(this.code),this.injectUnsafeCSS(),this.mouseEventManager.setup(t),this.lineSelectionManager.setup(t),this.lineSelectionManager.setDirty(),(this.options.overflow??`scroll`)===`scroll`?this.resizeManager.setup(t):this.resizeManager.cleanUp()}applyHeaderToDOM(e,t){let{file:n}=this;if(n==null)return;this.cleanupErrorWrapper();let r=document.createElement(`div`);r.innerHTML=Vt(e);let i=r.firstElementChild;if(!(i instanceof HTMLElement)||(this.headerElement==null?t.shadowRoot?.prepend(i):t.shadowRoot?.replaceChild(i,this.headerElement),this.headerElement=i,this.isContainerManaged))return;let{renderCustomMetadata:a}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);let o=a?.(n)??void 0;o!=null&&(this.headerMetadata=document.createElement(`div`),this.headerMetadata.slot=rn,o instanceof Element?this.headerMetadata.appendChild(o):this.headerMetadata.innerText=`${o}`,t.appendChild(this.headerMetadata))}getOrCreateFileContainerNode(e,t){if(this.fileContainer=e??this.fileContainer??document.createElement(`diffs-container`),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=pn;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(e){return this.pre==null?(this.pre=document.createElement(`pre`),e.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==e&&e.shadowRoot?.appendChild(this.pre),this.pre}applyPreNodeAttributes(e,{totalLines:t,themeStyles:n,baseThemeType:r}){let{overflow:i=`scroll`,themeType:a=`system`,disableLineNumbers:o=!1}=this.options;Vn({pre:e,split:!1,themeStyles:n,overflow:i,disableLineNumbers:o,themeType:r??a,diffIndicators:`none`,disableBackground:!0,totalLines:t})}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML=``,n.parentNode?.removeChild(n),this.pre=void 0;let r=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.innerHTML=``,r.appendChild(this.errorWrapper);let i=document.createElement(`div`);i.dataset.errorMessage=``,i.innerText=e.message,this.errorWrapper.appendChild(i);let a=document.createElement(`pre`);a.dataset.errorStack=``,a.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}},J=i();function Or({file:e,renderHeaderMetadata:t,renderAnnotation:n,lineAnnotations:r,renderHoverUtility:i,getHoveredLine:a}){let o=t?.(e);return(0,J.jsxs)(J.Fragment,{children:[o!=null&&(0,J.jsx)(`div`,{slot:`header-metadata`,children:o}),n!=null&&r?.map((e,t)=>(0,J.jsx)(`div`,{slot:_r(e),children:n(e)},t)),i!=null&&(0,J.jsx)(`div`,{slot:`hover-slot`,style:ir,children:i(a)})]})}var kr=typeof window>`u`?q.useEffect:q.useLayoutEffect;function Ar({file:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i}){let a=(0,q.useContext)(Fn),o=(0,q.useRef)(null),s=tr(r=>{if(r!=null){if(o.current!=null)throw Error(`File: An instance should not already exist when a node is created`);o.current=new Dr(t,a,!0),o.current.hydrate({file:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(o.current==null)throw Error(`File: A File instance should exist when unmounting`);o.current.cleanUp(),o.current=null}});return kr(()=>{if(o.current==null)return;let i=!yn(o.current.options,t);o.current.setOptions(t),o.current.render({file:e,lineAnnotations:n,forceRender:i}),r!==void 0&&o.current.setSelectedLines(r)}),{ref:s,getHoveredLine:(0,q.useCallback)(()=>o.current?.getHoveredLine(),[])}}function jr({file:e,lineAnnotations:t,selectedLines:n,options:r,className:i,style:a,renderAnnotation:o,renderHeaderMetadata:s,prerenderedHTML:c,renderHoverUtility:l}){let{ref:u,getHoveredLine:d}=Ar({file:e,options:r,lineAnnotations:t,selectedLines:n,prerenderedHTML:c});return(0,J.jsx)(bt,{ref:u,className:i,style:a,children:Yn(Or({file:e,renderAnnotation:o,renderHeaderMetadata:s,renderHoverUtility:l,lineAnnotations:t,getHoveredLine:d}),c)})}var Mr=8,Nr=1;function Pr(){let e=typeof navigator<`u`?navigator.hardwareConcurrency:void 0;return e===void 0||e<=2?Nr:Math.max(Nr,Math.min(Mr,e-1))}function Fr(){return new Worker(new URL(`/assets/worker-portable-CA4_6zkQ.js`,``+import.meta.url),{name:`pierre-diffs-worker`})}var Ir=`bb.thread.terminalPanelState`,Lr=336*60*60*1e3,Rr=O({version:z(1),isOpen:M(),activeTerminalId:V().min(1).nullable(),panelHeightPercent:L().int().min(18).max(70),lastUsedAt:L().int().nonnegative()}).strict();function zr(){return typeof window>`u`?null:window.localStorage}function Br(e){return encodeURIComponent(e.trim())}function Vr(e={}){return{version:1,isOpen:e.isOpen??!1,activeTerminalId:e.activeTerminalId??null,panelHeightPercent:e.panelHeightPercent??32,lastUsedAt:e.lastUsedAt??0}}var Hr=Vr();function Ur({threadId:e}){return`${Ir}-${Br(e)}-1`}function Wr(e){return e.startsWith(`bb.thread.terminalPanelState-`)&&e.endsWith(`-1`)}function Gr({now:e,state:t}){return e-t.lastUsedAt>Lr}function Kr({initialValue:e,now:t,storedValue:n}){return qr({initialValue:e,now:t,storedValue:n}).state}function qr({initialValue:e,now:t,storedValue:n}){if(n===null)return{shouldPrune:!1,state:e};let r;try{r=JSON.parse(n)}catch{return{shouldPrune:!0,state:e}}let i=Rr.safeParse(r);return!i.success||Gr({now:t,state:i.data})?{shouldPrune:!0,state:e}:{shouldPrune:!1,state:i.data}}function Jr({state:e}){return JSON.stringify(e)}function Yr({now:e}){let t=zr();if(!t)return;let n=[];for(let e=0;e<t.length;e+=1){let r=t.key(e);r&&Wr(r)&&n.push(r)}for(let r of n)qr({initialValue:Hr,now:e,storedValue:t.getItem(r)}).shouldPrune&&t.removeItem(r)}function Xr(e){return e!=null&&e.length>0}function Zr(e,t){return{...e,lastUsedAt:t}}var Qr=$e({parse:(e,t)=>Kr({initialValue:t,now:Date.now(),storedValue:e}),serialize:e=>Jr({state:e})}),$r=tt(Hr),ei=Je(e=>et(Ur({threadId:e}),Hr,Qr,{getOnInit:!0}));function ti(e){return Xr(e)?ei(e):$r}function ni(e){return t=>t.isOpen===e?t:{...t,isOpen:e}}function ri(e){(0,q.useEffect)(()=>{Yr({now:Date.now()})},[e])}function ii(e){return ct(ti(e))}function ai(e){let t=nt(ti(e));return(0,q.useCallback)(n=>{if(!Xr(e))return;let r=Date.now();t(e=>{let t=n(e);return t===e?e:Zr(t,r)})},[t,e])}function oi(e){let t=ai(e);return(0,q.useCallback)(e=>{t(ni(e))},[t])}function si(e){let t=ai(e);return(0,q.useCallback)(()=>{t(e=>({...e,isOpen:!e.isOpen}))},[t])}var ci=1e4,li=3e4;function ui(e,t){if(!e)throw Error(`${t}: environmentId is required when query is enabled`);return e}function di(e){if(!e)throw Error(`useEnvironmentFilePreview: path is required when query is enabled`);return e}function fi(e){if(!e)throw Error(`useEnvironmentFilePreview: source is required when query is enabled`);return e}function pi(e){if(!e)throw Error(`useEnvironmentGitDiff: target is required when query is enabled`);return e}function mi(e,t){return y({queryKey:n(e),queryFn:()=>w(ui(e,`useEnvironment`)),enabled:(t?.enabled??!0)&&!!e,staleTime:t?.staleTime})}function hi(e,t,n){return y({queryKey:x(e,t??null),queryFn:()=>N(ui(e,`useEnvironmentWorkStatus`),t),enabled:(n?.enabled??!0)&&!!e,refetchOnWindowFocus:!1,staleTime:ci,placeholderData:(t,n)=>e?Re(t,n?.queryKey,e):void 0})}function gi(e,t){return y({queryKey:g(e),queryFn:()=>E(e),enabled:(t?.enabled??!0)&&!!e,refetchOnWindowFocus:!1,staleTime:li})}function _i(e,n,r,i){return y({queryKey:p(e,n,r),queryFn:({signal:i})=>t({id:ui(e,`useEnvironmentFilePreview`),path:di(n),source:fi(r),signal:i}),enabled:(i?.enabled??!0)&&!!e&&!!n&&r!==null,refetchOnWindowFocus:!1})}function vi(e,t){let n=t.target,r=n?.type===`commit`?n.sha:n?.type===`all`||n?.type===`branch_committed`?n.mergeBaseBranch:null;return y({queryKey:o(e,n?.type??null,r),queryFn:()=>C(e,pi(n)),enabled:(t.enabled??!0)&&!!e&&n!==void 0,placeholderData:(t,n)=>Ie(t,n?.queryKey,e),refetchOnWindowFocus:!1,staleTime:5e3})}function yi(e){return{filesCount:e.files.length,insertions:e.insertions,deletions:e.deletions}}function bi(e){return`${e} file${e===1?``:`s`}`}function xi(e){if(e.filesCount===0&&e.insertions===0&&e.deletions===0)return`No changes`;let t=bi(e.filesCount);return e.insertions===0&&e.deletions===0?t:`${t}, ${or({added:e.insertions,removed:e.deletions})}`}function Si(e){if(e.filesCount===0&&e.insertions===0&&e.deletions===0)return`No changes`;let t=bi(e.filesCount);return e.insertions===0&&e.deletions===0?t:(0,J.jsxs)(J.Fragment,{children:[t,`,`,` `,(0,J.jsx)(At,{insertions:e.insertions,deletions:e.deletions})]})}function Ci(e){if(!e)return[];let t=[],n=e.workingTree;if(n.files.length>0){let e=n.state===`untracked`;t.push({kind:e?`untracked`:`uncommitted`,label:e?`Untracked`:`Uncommitted`,files:n.files,mergeBaseRef:null,stats:n})}let r=e.mergeBase;return r&&r.files.length>0&&t.push({kind:`committed`,label:`Committed`,files:r.files,mergeBaseRef:r.baseRef,stats:r}),t}function wi(e){return Ci(e)[0]??null}function Ti(e){return e===`??`?`A?`:e}function Ei({files:e,className:t=`max-h-32`,emptyMessage:n=`No changed files detected.`,onFileClick:r}){return!e||e.length===0?(0,J.jsx)(En,{message:n}):(0,J.jsx)(`ul`,{className:A(`space-y-1 overflow-auto`,t),children:e.map(e=>(0,J.jsxs)(`li`,{className:`grid grid-cols-[1.5rem_minmax(0,1fr)_auto] items-start gap-x-3`,children:[(0,J.jsx)(`span`,{className:`text-xs leading-5 text-muted-foreground`,children:Ti(e.status)}),(0,J.jsx)(wn,{path:e.path,onClick:r?()=>r(e):void 0}),e.insertions!==null&&e.deletions!==null?(0,J.jsx)(At,{insertions:e.insertions,deletions:e.deletions,hideZero:!0,className:`text-xs leading-5`}):null]},`${e.status}:${e.path}`))})}function Di({sections:e,onFileClick:t,listClassName:n,rowClassName:r,rowValueClassName:i}){let[a,o]=(0,q.useState)(null);if(e.length===0)return null;let s=e.find(e=>e.kind===a)??e[0],c=yi(s.stats),l=e.length>1,u=(0,J.jsx)(`span`,{className:`truncate text-muted-foreground`,children:Si(c)});return(0,J.jsx)(Wt,{label:l?(0,J.jsxs)(`span`,{className:`flex items-baseline gap-x-3`,children:[(0,J.jsx)(`span`,{className:`flex min-w-[var(--detail-label-width,96px)] items-baseline`,children:(0,J.jsxs)(he,{children:[(0,J.jsx)(ge,{asChild:!0,children:(0,J.jsxs)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-5 w-auto min-w-0 justify-between gap-1 rounded-sm px-0 text-xs font-normal shadow-none hover:bg-transparent data-[state=open]:bg-transparent data-[state=open]:hover:bg-transparent`,title:s.label,"aria-label":`Switch changed files bucket`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:s.label}),(0,J.jsx)(H,{name:`ChevronDown`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,J.jsx)(pe,{align:`start`,children:e.map(e=>(0,J.jsxs)(_e,{onSelect:()=>o(e.kind),className:`flex items-center justify-between gap-2`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:e.label}),(0,J.jsx)(H,{name:`Check`,className:A(`size-3.5 shrink-0`,e.kind===s.kind?`opacity-100`:`opacity-0`)})]},e.kind))})]})}),u]}):(0,J.jsxs)(`span`,{className:`flex items-baseline gap-x-3`,children:[(0,J.jsx)(`span`,{className:`min-w-[var(--detail-label-width,96px)] truncate`,children:s.label}),u]}),orientation:`vertical`,className:r,valueClassName:i,children:(0,J.jsx)(Ei,{files:s.files,className:n,onFileClick:t?e=>t({file:e,section:s}):void 0})})}function Oi(e){switch(e.kind){case`commit`:return{title:`Commit changes`,description:`Create a commit from the current workspace changes.`,submitLabel:`Commit changes`,showCommitControls:!0,showMergeBase:!1};case`commit_and_squash_merge`:return{title:`Commit and squash merge`,description:`Commit the current workspace changes, then squash merge this branch.`,submitLabel:`Commit + squash merge`,showCommitControls:!0,showMergeBase:!0};case`squash_merge`:return{title:`Squash merge`,description:`Squash merge this branch into the selected merge base.`,submitLabel:`Squash merge`,showCommitControls:!1,showMergeBase:!0};default:return re(e)}}function ki({target:e,branchName:t,gitStatusDisplay:n,changedFilesSection:r,threadId:i,threadType:a,showMergeBaseDetails:o=!1,mergeBaseBranch:s,mergeBaseBranchOptions:c,mergeBaseBranchOptionsLoading:l=!1,onMergeBaseBranchChange:u,onOpenChange:d,onCommit:f,onSquashMerge:p}){let m=(0,q.useMemo)(()=>e?Oi(e):null,[e]);return(0,J.jsx)(Qe,{open:e!==null,onOpenChange:d,children:(0,J.jsx)(Xe,{className:`max-w-[34rem] gap-0 overflow-hidden border-border bg-background p-0 shadow-xl`,children:e&&m?(0,J.jsx)(Ai,{target:e,branchName:t,gitStatusDisplay:n,changedFilesSection:r,threadId:i,threadType:a,showMergeBaseDetails:o,mergeBaseBranch:s,mergeBaseBranchOptions:c,mergeBaseBranchOptionsLoading:l,onMergeBaseBranchChange:u,onOpenChange:d,onCommit:f,onSquashMerge:p},e.kind):null})})}function Ai({target:e,branchName:t,gitStatusDisplay:n,changedFilesSection:r,threadId:i,threadType:a,showMergeBaseDetails:o,mergeBaseBranch:s,mergeBaseBranchOptions:c,mergeBaseBranchOptionsLoading:l,onMergeBaseBranchChange:u,onOpenChange:d,onCommit:f,onSquashMerge:p}){let[m,h]=(0,q.useState)(null),g=Oi(e),_=Hn({mergeBaseBranch:s,mergeBaseBranchOptions:c}),v=s??_[0],y=g.showMergeBase&&o===!0&&!!u&&_.length>0,b=g.showMergeBase&&o===!0&&(y||!!v),x=!!(r&&r.files.length>0);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(G,{className:`px-6 pt-5 pb-3`,children:[(0,J.jsx)(Ze,{children:g.title}),(0,J.jsx)(Ye,{children:g.description})]}),(0,J.jsxs)(`form`,{className:`space-y-4 px-6 pt-1 pb-5`,onSubmit:t=>{switch(t.preventDefault(),h(null),e.kind){case`commit`:d(!1),f();break;case`commit_and_squash_merge`:if(!v){h(`A merge base branch is required`);return}d(!1),p({mergeBaseBranch:v});break;case`squash_merge`:if(!v){h(`A merge base branch is required`);return}d(!1),p({mergeBaseBranch:v});break;default:re(e)}},children:[t||n||b||x?(0,J.jsxs)(Ct,{appearance:`flat`,children:[t?(0,J.jsx)(Wt,{label:`Branch`,valueClassName:`min-w-0 truncate`,children:(0,J.jsx)(`span`,{className:`block truncate`,title:t,children:t})}):null,n?(0,J.jsx)(Wt,{label:`Git status`,valueClassName:`min-w-0`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2 whitespace-nowrap`,title:`${n.label} ${n.summary}`.trim(),children:[(0,J.jsx)(`span`,{className:`shrink-0 font-medium`,children:n.label}),(0,J.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:n.summaryContent})]})}):null,b&&v?(0,J.jsx)(Wt,{label:`Merge base`,valueClassName:`min-w-0`,children:y?(0,J.jsx)(Xn,{value:v,options:_,loading:l,onChange:e=>u?.(e),className:`max-w-full`}):(0,J.jsx)(`span`,{className:`block truncate`,title:v,children:v})}):null,x&&r?(0,J.jsx)(Di,{sections:[r],rowValueClassName:`pt-0.5`,listClassName:`max-h-40`}):null]}):null,(0,J.jsx)(Tt,{message:m}),(0,J.jsx)(Ke,{children:(0,J.jsx)(P,{type:`submit`,disabled:g.showMergeBase&&!v,children:g.submitLabel})})]})]})}var ji={vscode:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAACU3PoRAAAACXBIWXMAABYlAAAWJQFJUiTwAAABzWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTAyNDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xMDI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CsHtO6kAAAqwSURBVHgB7VtpbFTXFf5mX73vC9gGDBFLcOOSkNC0Jgk4aVMIDQii0hLUlB8hRK2gQW6pRNqkrZICaRNo4kQEKEoUIVVQ1HRBKiZg4rAYQ5ABY2yM443xeBkvs3lmes7YY4w9943neaOKr/T03rvbOd93zz333PtmgMk0ycAkA5MMTDLw9WVAMRLoHR0diQqFIkWlUsUplcpI6ktPzxqv16ui9xH1PVAv6o9ffXR5fD6fm+4OyrN5PB4rvTdERETc5gpyUthKdnZ2JhkMhrUEfDld95ECsXRXyRE+0jYk20OyW+h+lcg40tLScjApKalppP0K27tcrnXE/E0SeE8m1o11FAKQW7B9+3Y1dbzrnkQdRCm3272LdZaLd0g7Av9WEDn3dBbrPASInAybzfb8PY1UQjnWXQ7m/jbnzp1LoXn1lYSMe7qIdS8vL0/pBxTkQRkkrz9r5syZ68jLpvVn/J89sO6pqanPS6ktJCA3N1ej1+uXSzUey7JjVyzYeKQGO887cKvDHwfIEmc0GpcxlrAbHz16dGpPTw+vseOe9hRV+jQ/+diHNft95t9d8839a4fv18XdvuutHAeFlxgDYxERILSANEoUzUWJGo5V/uufXsGLB87C7aXAT+2DrscOG8V+737pxNNHOvDKSTvKrZ5hi2cMjEXUQEgARXvxNIeE5aIO5ebT2GLzoTJsowscRSv7RCsU/lejWoFuImJ/uRPL/96Jl493o8wSmgjGwFhEegkBqtVqju3HJTncHryw7yx2/uMKjTpF1QQ6WGJeDESEi3B/UuHCM0TEa1/YaYMQrPadPK1WG3Hn7e4nIQEajUZ/d9WxeWuzu7G68HPsK6oEtAw+tBzmh4ngWfKXS05ctPRINqINmkFUQRgukqsJ33OKpAjyG9odWEPgP7vcAOiEqgha984UFy0QjR00NxLF7aWwCFvR3BnTHV6lpROr9hSjrNoqC3yAFTYYX+92OZA15C6FRTgFhusArd09qGh2DBEqlXGhtg1P7jyBspstZPbCMZDqIqwyKSxCAoYjoaS2Cwv3XEXOW+XY8ulXsPeEDliKKiz47q4TuNFoAzQhjIy824gUHAYI2f3/67oNT++7jkqLA3byRjuON+B7H17HdatTKPZwWT2e+fNJNLbZpcGzV/d4sTInGotnRMDVE8LNCyWGLpBFQCWBXP1xFaxd5H3JG/s9t1aJ40RK3ntXcbi8bYjkD0/fxHPvFqPd7qI2EmJp1I1kGL/MS8DuNXORHBdFXIS2rCECh5khoYm4B1u3EzYHgR987KdRop7CtpUHb2DbsTq4+xboHf+5hhf2fgEHTxGVhEga6emxahSuSMfmp+YgMT0Tao0GFCONWZLlgWbHqbD1G0q8WeqFl4efXXEgqRT+wOT1Y/W41OTEDE0Hdh29SM6OVlUOcoIlv8n7kJ9txPalUzAvOxOmyGh/zbEEzwJkEaDTG/CLR5NgVtfjtfOA0zuIBCaErOHoZfLyLvIJehPdu3uJ4hB3YKRHVsIhwEsPx2LjdzKRlpYOLfXfm8Zw6PskyCJAQSBik1Lx0rdUiNLV4VclXnS4Cdhg6yZrgJHAGDKBNjqs7aA1X0VWEAh3yeSnRquw/fFkLPvmNETHJ1KxLJX64IR/ky2N1lZEJSRj/UIVIrW12FLsQbMjCAkBG46hgxktkdFKUZ+LIjfaZy2eYcKrS6figVmZMJLJc5/jnWQTwIqyuubYBKxaoEKcsRabity42ckmHsR0feQATTSvaYuha63HxgVGvLh4OtLT06EzGMcbd7+8wUbbXxDOgzEqFikJcVBYauibTZd/dIO2ZxI0OorbM2BOyURmVtaEgmcdR4WA01VWrCi8gOpmcnTWW0A3RXnCowQfnGQ7vynuxg8P1eI2xxITmEZMwD8vN2LZnz5DrZVGXq/tjQ2stUBnqwQJhJh84SelViwuvIbims4Jo2BEBHx05hZW7j4FayctdRzdsRNjD8/BTksdOTwLhbQS2Ch6LG+0I39vBd75XPb3TQkBoYtkEcAubnfRDax7v4SOqQjhwOiOSVASCTS7Hom2YfV08vg09f3fdoPpQ6F0l9uLTYdrsO5QNVrs4zslZK0Cl+vasemjUgpRiYrB4TCB5dXhxwtisPWJLEQatEg63YK3v1QQB1TChYOT33IUOHCmGZca7Ch8NgML0ih4GockywJUPg8Mwc6LKLCJ1SvwRn4i/rBiDrJnzEDK1Cxsy0vGtlwfNLw8Blkh+3HSlCir68KS9yvwwdlmylaQcQVjrL/FiB9kEZCdYMAfn0xDhJaU4w0PgyLwOSla7F+VgQ2PzUVi6hT/RoaOpRGfkoaffzsNv19IgaGKKvOUECXyJe1OD35K02HT36pp99gzxMhETeXky5oCaq0eP3p0FkwaBQr+XQdLlwfP3m9GwROZyM6aCoPp7kNYPl2PTkjBhkfUFDrX4pViL1pdxL2I/r5Rf+d4IxIylDDFxYY89pIDntvIIoBDVnN0HH7w8H3IiNGhucOBB7NTkJySCo2WAp0gidtExCXiuQc5dL6Fn53sQUMXMcD+UpTIQfbtqEU1RpwvJIAcnJSh+gWbo2Kw8H49PB439EYzfcsQDekdPU1E3PdzVTBra/DyCSdutPOyead88NNoeAApLEKN6Tc3IQlgZXUGA4zmyGGBD4AzRETj8fnTsHeJAfPjaBmVihUCjQR3dj98SSUpLEICyGRpAR+7pCM/sXDONHyQb8KiZGJAxvLPI8TGE6ORHispLEIC6Ccm4Z11y+BKazBh/qxpKMyPxFMZwyeBR9zpJdXprHBFUivmxUoTIIVFSIDdbh+XAF2jM2Dm9Gl4e2kM1mTzdBAbdAC4mtbRvCgr3phZi63zfTCbzJL0S2EROsH29nb+EaKXzEdIkqTUMArVWi0yMzPx5hI+YWrGe+UkcgAPfO7oohE3K93Ii27BsuQOPJCsRXx8mv/sUMmnTILEGBiLoFi8DF68eLFx0aJFNvpK3Hs6KephlPJVag1S0zPw6mMUK2ibsOMC+0YV3CodjHBjaWwrAe/E/GQ9YuOnwECOlz56hpRODtDGWEQVhatMQkKCubq6ushkMuWKGo9FPn/ns95uoK1yA/7bpMcUijPyk+yYl2xATFyCH/hwltuAbl1dXeezsrLyLBb6GBluqqysfI1MaNwT/brL12a1+G7dqPDV11T5Om1tPhpJWXpUVVX9Nlzc/fXp15azyYM2ypI8Co2YiJEkh8PRWFBQMLsfkIwH1ZkzZzaPRImJbFtSUrKFMId2FBLEsI+IJl+wfyKByJHNOrPudAn9nATuu4qUGRkZKTSXDshRZCLakO86EB8fn0ooRm0JZzNKOHXqVEF3d3fDRIAajkzWjXVkXekakelT+yGJOzStX7/+IfoN8Q76c8IFp9PZRt5ZnnseDqIQdVg268C6lJaW7tiwYcNDrCNdwwYf7vzg+hw98qY/fu3atak5OTnJ9C+N2KioKDP9HE3Hf5mhS0kRJNelz4hKf0xHHj3oM9UJmrg+F3B7eubzR14KvXS5aWVyUnTX2dTU1FJWVtZ48ODBeqrKZ2h0PO3fVg2IIylHIoVLwMCueH4FLj9Yeg/0F7gPrD8azwFgfA9cvBMKXKMhY7KPSQYmGZhk4OvDwP8A/pUraDR7d2UAAAAASUVORK5CYII=`,cursor:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAACU3PoRAAAACXBIWXMAABYlAAAWJQFJUiTwAAABy2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+NTEyPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjUxMjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoAheCYAAAJbUlEQVR4Ae1bW2wU1xn+Z3Z9wxeW3TU2BrzYzq21SSCoLWqfEElooqqQUEGDVCkvfajUpzxFat8qtY9VpFaRIjVVHiMhocakBQK4pGACNb5hQmobY4xZr70Xr71rY3u9M/2/Y89q2c7sbY6Jq+yR1jN7Lv/83/dfzmXWRKVSYqDEQImBEgPfXgaUYqHvrK31rFQmm3Vdden8p1g5dsYpiqKpq3pkWXdOzM3NzRYjq1ACVK93y08Ujd7RSTnID2zgzzcCPg1sku8DDOQaX/8ajCycS2vLeZs3AV5v7fOkaX/kAa8T/9H1nLKfagdlXSdF0c8kktq70ejSeD4K5EXA9m21P9JU7RPuvHOzAc8ECSJIV8bYWD8LRhf7Mtszv+ckQFhe17oUnXZsMqNnYkl9XyOB7ju15KGp6NKDVIPJTa74LaOk9gGz9H8DHhiFlyrUknA43+evWTFmbax31xxVVDq02d3exLDrOUo/6nZXv2LWbtRlI4ANr//S6Cj7qmlJcjgcpKoqh6smW7yQh/hWcmBAH9PC010TacodbnSZdiiyEmABekdTE+3e7aPY/DxNTfkpGp1lq/HkKgK4SOHmw6YSSWe71TrBaT6GmUs62nRFkwYe4PBxuz3U2tYmrqurq5RYWaE9e1ooFvMwEVMUj8cECRKJaChXVn2M03ShZEmApibdKhzIZuoHaFi9uqaGWlpaqbFxh/CAZDIpCDGIqavbSjU1tRQOh2l6eoqWl5dFPysDFVCv6k5lm1V/SwI4/jk/WEaIlbwn6gGyvLycXb2Zdjf7qKKiglBnFvNGXX19PblcW5mEaQqFQtx/1TYRTLJlrstCwBNYCvoCMHBhxHlLSxvV1tYK0ACfq2Cs01lGu3btFmESCCA/RMUwiWGRUkMqAWvurLEF3SLOPR6vCKF8gKc04hsjLKqqqgSBc3NRCgSmaGFhQXZ+ICkEQGFYbsuWLZzQWqmpaSepDvvTG+SiuFzb2IvqOD8ERWiscOLETCKj2CZgzWWd1Ozzkc/XQpWVlZZxXqzCRkht394oyJieDohkadQXKxfjbBEAC3k8Hnrmmeeoiq0PhR4/XmSx+SVPLIaQ7Q1L5wMEeQBE1NW51sMibmvtYIsAKOxjl//e939Ar7x6hJOXkzC3U55TJ68MCO6cb3/wCgJA75V/dtFnn33KeSGeD2+WfWwRAGUAemRkmGo40588eYqaebrbyIKEOhsJ0eXLn4vHsAq2ii0CjCfD9a9d/Rf13uqhw4dfozffOs6h4TWapVzhKaHQDC2yxW8PDtKX169TWVmZbdlSCIAWWPDA/Ts7z9CNG9107NhxevW1I1xfYUtJkBthi0fCobXwYmlnz3aKRGtL8PpgOXPJujCEREVFJSscoQ8//IB++5v3qKfnZtF6zs/P0f37ozTNawCQixmm+9o1EXIIPRlFjpQMTbDNxQe54Q+//x0dPPhDOnHy52KazOhq+hUzSTA4Q/HYvGjHnI9PJBKmc+f+LmSbDiyickMIMPQwYvTq1S+of6CXfnzkDfrp0Tdp61bzTWYikaAwxzm2xhonOyVtsQOLX7hwXiyEsKeQVTaUAENJKLzC8/3p059Qd/dVeuv4CTp06LCYQdAHcR6djVCIV3rYHsPameDHx8fpiytXRK4x5Mq4PhUCoKjCZ2vIDzMzM/TnP71PXZcv0qlTv6DW1ja2qp8WFxfFHA/wmQULpbOdn4o+SLYyy/8+TaZ0E1nIDQiN4eH/0Mcff0T37g3T0tLSmtVNJnUAHujvp/7+PunWh3pPzQPwMFgSBGBjU8MHJNjtwf0xe5gth1EPz+hk65u1Q6bd8lQIgPIAA9A4+YEHAHguULD+5UsXaXx8zPZ6woqoDSXAAIj5G5kfVxSj3kop1MNTpgMBOn/+nDggydbXTtuGEQCQsDQsXl1dbenmVsojGd68eVMcglj1kVEvPQkCONwdFm9oaBRuD0XzsboBCNb3+/00+WiS2jv28kFqo5gWETayizQPMIDD2gAP66OuEOAGOADt6fk3JRIrQs5OPh/cxsfpAfH+QO75oBQCABKLHQBHZkcpBjjGYcU3PDxMExMTnAecKRLF+WBrG/ELDkEEZgd+rO1iiwCAhMJeb71IcFbTWb5aYjzWBLd4W4379GIQ6nK5xCkzlsujIyOCoMy+6eNy3dvKAVDq4cQDsTWVsTuDxYdu3xbnfWYrQoDBMzE94ugcmyO7XmDLA6DkBBMwMzNN7e176bvt7ewJVal9ey7209sha5b3A4O3By12ezh9coiFEQ5e7t69I84TkTDtFFsE4MFQAKc12PePjY3Svn0vUwvHKgAV8j4Abtzbe0sAzPQmPAOyvv76Lg0M9NEcvyhBnV3w0N82ARAC5aE03uB0dV0S5wD7Xz5ADfweUOeMnmv6ApDJyUkeNyLkQCYKSIRsv/8R9TE5eItsPGuth/2/Uggw1IDCKJOTD8WR9bPPPkcvvrRPLIZgQSORGf1xRa5DG6Y9XEEGQOKKRIdN0Ni90VRb+lgZ91IJMBSC8rD6V1/doQcPxqlj70v0wgvfEVOlODY3OvIViQ/T3iNe9OAenoSZAK5+Z2hIvGdAHWRuRMlCAP8sykYxXBVgbnzZTfdGRwhh4fPtERYGEfAYzOeIfWR1FExt/f29IsMDdGY+KE4layyWBKhJNaKrtjgQuhpEYMq6dPGCeG+wf/8B8vJrcLTBxWOxOB95B6mvr4cmHz4U9XKACxU0ZVVbWz6asPfkaiOtg9tdtYuPIvETmbq0atu3sDzm8ec5JDo6XhSxPTQ0SCN8QII26a6u0PTyitoei8XCZspbEsCdFa+n+hJ3kP4rMSRDJDzsG3CPMABweITMAnG8NftbKBw/ZiU320qQ33nTX6wG2qk3wgL5AS9H4e6ywaf007SsGLIRQC7Pwmn+2el1yYZJ6QbQGwVc6KzThdDs4j9SDzS5yUrA6CgtK5r+K/Yj0/gxkbdpqjh9+zmufs0K8etq65KVAAybiS4M8C973uZwCm2UJ1irV3iL0JEXj6qmnggG50dySchrdfH4cWKsuqL8c1L0DnbZ5s1IBHTCh3PqRV1R3g5F4r25wKOdh+Rf2vklcMBTfYIHvcNhcYBHur5pMta3wxHWid/CKh8FI/EzrFdWt09HXBAB6QOxTnBojlbNobmZ96LlpMss/J7/ZUZzhHVHciwUWvQXPr40osRAiYESAyUGvt0M/Bfz0vXwaPGzHAAAAABJRU5ErkJggg==`,"sublime-text":`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAACU3PoRAAAACXBIWXMAABYlAAAWJQFJUiTwAAABzWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTAyNDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xMDI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CsHtO6kAAAsbSURBVHgB7VtLTFzXGf7nyTAwwDAMxqDQuEaxY7t2Gmw5srxopXRl2XXSyl1V3bTLriu1kWq13UTNsuq+i0pNrWxae1Enu6hOGsePJPgR4xrbGAYGhscwwDyZft+de+ByuefOHcDEUjny4dx7Hv/j+//zn8cdi+ymXQR2EdhFYBeB/18EfFtR/fz58x3VarV3ZWUlCToxv98fwXsQmXQN2j4kPrOOGX2M0okvulZBq8qSGX34LurZLCuoyweDwYVSqTSNPmNXrlyZdaLnpa5hAM6dOxeDIG9BiB+j/C6Y7EEO4ZmCeuG55T4AUpiRSshTeL4N3h80NTV9cOnSpflGGDQkMZR/G8R/ByseJhNaxxSkEZ7b2pegQx6DJuT5Gvm3ly9fft8rE68A+M6ePft7MPs1so+Kv4jJAsR7g4ODv7p48WJdQQNeFDlz5swfMOd+A8U5f70M+Ub6UDbmQCBwamxsrPXBgwdX6wlSFwBY/jyQ/ROVr0dM106h6Ko7lcgPMp8aGBj4enh4eMiNr6tUDHhQ/HMQe+VFdXudcpwOkHkEYAy6rRK16KGhUqlU3oY7vRDKc+KVVvySLwekjLJeosEg+z4AcMGtrysluO0FEHAb/1zbuJ0omkoHfStyKJ6Rnx+5I9/vGzXAqMecssMTCIDW07UNp0+fjre3t98BCHt3EgREC0M54t4WLsorHbNyYk9aBrunpT+2IL4mkQ+H++Tdm4MSCVRcMWDcgezT2DAdvnr1atqpc9CpknWtra0voUjuhPLY+5kWrUpnU15e7ZyVkz1peS05LXtblkTop3RELmpl/GM89uCYpuydKPsxsjEAyuVyN5Y+bmsxdvtTBUpzLiNUSbJ5WY4kZqD0pBztmpFENF9zWipM9o6G9iYXpoAfOnC36pi0HgD3iakRCgTTpVS1UTrVqQ5sY6qN90lNaZ8E/SuyN7oox2BhWvowLN7WXKwNo9LMHpOSzam74g8MVnWx99MCAMLN7GxlYH1WhJzqVNsKvKcCK9PSTZiv/bGsvG4qfSA+L9Em+DMTFXa0stHq+IeO6cabg1Q7VgRDFydCWgDQ2a3NiZZRxyDGOVpBbg6WZH/HvBzfM2UEsoGOrIRD0Jbeq3VtLWlbg7cpYA7S6qJtwECjTaFodXX1vFbCgLByCUrHQiU5lJiXE3Dt44jcL7ctSCAEYZVrN2hpm9bGq1V1J/msY8x27WpXFwBFTDHiu3pWJa3dE83JWwOP5XUo/VJscUPkVnS2o/TDfexTQMniRB9tjQPgNsjOpFjxyY8GHsnZg6PGMrWZOW2nueGdKnA5xOkls4zNgDGHNvRquMLNA1YtbaWqkFYRVr2HENmNQEZX366klIbPzy6H5avpuHw6npRrEz0SDqzdRShZyJby2N/dxHEFQBF0IqAUr/XZLnuAGq3MDCDTuYjcnuqUT1NJGcp0SiYfgd39hvLY45G1kayysML+Xuvl/LcuAM7D7LUQZk0ee6O3d1PpZ9mo3JhMGErfn+2QuUIEFsWdm78KxclkG6KoRSJXABpB0kKz8UcoeGsiLn+99235YjohS+WwYWW6eSS4Nqcoj9W9FSN7vfW9ng6uAJBBPQK1PkqUTZYw7MHOrPzi6LB8MTUjn010yfBcu8wXwoI7ZOwc4fjGJbFeHruc9nedZHUB0A1cX79V/xdsmipyIJGVA8msXDgwImMLUbmZTsh/MP/vznTIbIGR34epsLIKxnoZNvemBQCXIZ6sv8Z26yCsbpZAtK9tSfral+TswKhMLUbgGXH5JNUtQ1gJGAzpFU6JlrdOE75TF13SAqAGeHEl8KhZhYFMz0uR9FauTX1J4nT45r6UkefyYfnzrQPy4dM+CXPpdUheZFbDKPKWUwDz89p4t6SykdoxlrBuC2VTNBqbwCJ3RIvG5ch23cy7eoBXJEOI1h+P9citdCeC2Zy8sXdaBnsy8q0YLjPIgYZyNhYaGkwAg1tvr6meDq4AkEk9AkoQzsnlSggRvBtreLe04lDE099JgHECYOzvyK0dimhR5i0kgwTn3haTFgAEkoapc3dW26zgBrcalK8yCbk1lZC/3Ckbp8LjAOJ4z4wMxHO47+NnPaSGudSGwTLmw9YKLQC4RIDxN8+EYHD3FsA2rrASxFY2IQ/n2uR2ql1++PITOdmbkUhYJIxsftrbPBguGNTTQQuA8oB6BJx4Wy85401FORifkxM4Jh/FvV9PBHEBuBZwA1bg1R+3uSGRCJZ5ghFQ36pcsGcTbbMZ2ezyagFo1AN45C4Yl5xVXHLm5UjXrLzRMy3HUO7BMuaHoiVE8TKCISN4BIquQIkV1iFncyYYkKgJQDAbYDDeOYLhWGnXr+67FgAdWyeKtEYE119v9qblVN+0fKdrTuKWS04qXEEfH5bGIBSqouQYAlAFEMaFEfswA4wc7lNyXEDQ1gTPIBh8Nj5vYHwj4Ylewq9EuqQFwGkKcIfl5Hb5SkB+duix/PS1x9AArMjPwpOKq5BquC6lUQCYYChADFAIBDNoLQGIRROMKMCItIrkS7gTInj8s8WkBQDEGQXXkbe/rzaiXxfc3lCaANgSvdiwHgt6AMnSkqw3FDEKo94AAHU8BGIhMfZT7LeMRePBVFRu34/LldF+47TI4VtNWgAaJczA5zURBCYWHEbvICb8Q09nvGBjvuiTR3Mtcn2yE/uLhPw32ya5UlhCuBfg7tNLotGUNzv1dwOgJpPNC5yIeBPFaaTpBZwiyEyFol8eZFqxmUrIZ8gj2VZZLockgCWVmy1+X2Cyi6WbnkZnE1/zeV2hBQAnqIrW5deRwAuksQtk77LhnVY2lV4sBOTedJt8Mp6Qz2Htp9kWrCgB7CPgETjwRHBUrpd0srIeWUtACwAG5XVE6wmjbbcoPb8Uki+n2+XaGHaL6bikclEpY3mglZmbNSc9LW2XBtiyoGt2AyCnAFAl3Yxpw7uOOutpZWYEtanFsNye7MDJsQvn+w5JL0WwFPprc5rzetVQ6/mQjJa36XpOU8BSt0AaTkkLAFDLQNEKiDAuGUkpvuHdEMISCZTScLwxHJFv4L7vGtz7Diw+k8daBiA3XHJahtv5kJ+9rt67GoN+1WKxyB9UOiYtAAsLC2PNzc0z+JkJfwXqmig73ZZH3yq+d47MRuV6qtOY0/dn2iRbDBvLH5VuCrK3RVtXyltrpAdgEzS3vLw8qqOkBeDevXvprq6uO/iJwPesaPOZhK2JSxIVnsIXm38/46EnJoslRm4Cs/5m1zrueT+bANwfGhpK6XhpAcCASqFQ+Ec4HF4HAAlZAeE7j8D/etIjlRGfqXR1XeQ2pym77niCDv8EU/M7/Eb2nK3aNDMzcwm/r3mGHxho+7CBCtK9eYfPW1vrVxvXgc+xkdaH7JMTExN/c2PjqtnDhw+f5XK5d90IvKhtBGBxcfG9J0+ejLjJuBrhdZ1SqdSXyWSyPxKJHLO7vm7MN12PwE3l379+/fo7kMW8enKWqi4AGFbG724/RkDsAwhHncm8GLW0OqcrvPbS3bt3f4nlb66eZF4AII3l8fHxj2Kx2AKC4quhUIj/Z6Ae7R1pV0pTcfyybXJ2dvaPN2/efAfKZ7wI0KgWfkyHY729vT9paWn5AZbI/RCgncx3GhBOR2as81ko/mhpaemj0dHRv2cymRtQHPtOb6lRABRVBs893d3d++AV/fCIJMBoBQgRZHoV6W6WtuJhL43dE5TmIS0PxXP5fH4K7v40nU4z0E0iaw89dmLqfbuF3G56Sk57aYBhr9x930VgF4FdBHYRaBCB/wHWGEMSa+r9eQAAAABJRU5ErkJggg==`,zed:`/assets/zed-C-eVD5h3.png`,windsurf:`/assets/windsurf-Do5nbXdF.png`,antigravity:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAECgAwAEAAAAAQAAAEAAAAAAdd52hwAAAAlwSFlzAAALEwAACxMBAJqcGAAADB1JREFUeAHtW2tsZFUd/537mPdM37vtbtvtdt0HdlnA1/IUgyhoDIoJYjZE+WRIIPIBFaOSEAPGD4bwSWLkgyZKIiaEGDGC8lR5rY+NggQWaNnt7rqPbjudzuO+/f3vdEgnvbPbzt5CG3qS05l75txzz+/3f5+ZAuttnYF1BtYZ+AAzoJaBXeYG8/MTG4aGhpIwNiuFjiDActZZxiPPPJXPDvjsogX3yInDhw9ztj1/x8K9nnGRpW48XLC3d8tANqvtU0r/MiGPceUOxV28n00YYCtSNK8GgfdIuew/dOrUO8c4tiQSlrL7cM7w8NabNN24m4BHRRHmH/x+Ym96dl0QoUq87Xvu3YcOjf9qfkJDa5vmNy70xpsWrwJeHx4evUfXjfso7K7VBrx537RFpbo0pV1fKHQmisXpZ/l52wRocvPg8MgPDMO4izJvftYqv9J07YpcvuDNFmeEhBBL1JZbaYBIPhgYGLommUw+QKm3mhe15qoZ03X9snQqu39ubvZNbkowLWrCTFTj5L5cIpW4ix8moiaskbFEHUNfjvtdFgH+wEDycgV16eq2+TOLQfYuGAQLZ/pRs6M0QJhSpml+TiktkrWohVbrmGAQLIJpvjdt1Wi6ql/IxBQ0deFZHGjErWcfElfquBQH35j0LAGf5vJCqE6sCN98UIgFaT66xt7kzaMI4JxclvvZwDexNo9KKHnTlecBV48qbDHIwJyBiZMKTxxx8fyME4pJ55w4Wx1LLsuHCQFNLZKATMY3SVuyaeY5Xrge0FUAvnWjjmt3KiRLOtRpA9qMgSvyBvb1anh00sYPJ2ZR9gLES4KWFEyVymIQUQQoOo9YZeBT8tmMwndvy2DvNg2nTynorgaD0dWADpNhOkHEX+lPoIMjt49PwRbNXbzftkfmMS3CFeczWm7Op0Rv+GoBW8cKOFLNYyoo4LTKY0bLoqRnUDZSqBhJjhn4TE8Ot27shC1O4j1oURoQ62NdJ8CO8zO46Ko+HK2Sb5+Sp2xNpSFFp5fiDjJGANfw4LPTI+ImEvB4sYL/VCzOWyS0WPe34gRo9HOXXNePol6A5WlQvg49MJhdCQEErwWwdA+O4cKTrjvoMj18va8bd4RFXax4Fy22ogR4boDBXXn0jm3AiWoCrpdgFWmGBJi0f4lLWRJQI3DbcEiCDc+0AM/GpV0adp6YxsFqDcYKasGKEhDQjrdd3s9IV8BcJQHHSyJgV54Jk1qQIrCKIgGaC0e3qAHSazSFKnqSSVzd1YPXKpNrkwABn+lMoHfPIE5Xc6g4KSZAaXhuimbAsyRqQjLQUCUBlkbpkwCX4F2zCt8rQwU1fKJnEwrHj8HiWivlCVZMA3w6s96dPQi6+jBbTqPqZuE4GRKQoaNLQacWJGgGFhMzmwS4VH+Xkvf8Mnw/xUyxgu5CAjuynfhXcQqmtjIBa8UIEG/Ts2cL5rwOzDlp1GwhIEcCsjQDZtqhGehwOM+lCXga7Z8E+D5JCtgxB8PIYE/vMP4xc5Kz1hIBrMISuSRS20YwW8mjSvAWwYcEUAtAApRPn8CIwMDHMo0hkFrgi/0TvE/36LMcUW4FI307kJn4N9ywsuPkmNuKaIDPpD8/2Au/YzOqtQJsOwebBLjsPv1AEPqBBCWthTVqoHwE1ALoEhdSLBhSvE7C53Wux8CGbA8mZ49Dl5gac1sRAqjHyHxoK2pBD2pWmpLPw6UWiP374gMYDsFyQw6awnyPBNAmCM1hdcjPFKOFEKDRVBJ5DPZtx6HiUSbNa4QAjVVeYusuSj9PydPzCwHz4MX+BTz1nZ12zbKDsFklelCagE/wPfMFvvfZNeWif/NF0N76S8yyry8XvwZQ+kZXF0/UtsOqUuqh5EX1M2EOEND26wTotPe6Y5M8hx6AwNmZHyjWBNBIkk4yAhvZ/guQTXWgapX4WbzOMHYCAs+FObgVbmIAXpW27BK8V/f8oeoz/tO4Sb+ArJuATwfHOMBYLySwTKZpKPmcZASsFfOdo+jq3YHy4Zegk5Q4W+wEyOb0kQuo8gUEDlVZwNPpgZIPpU+7lpM2vzIFvzpNoBR/uhsq20WnKLUQ02JKmQWzrMTOgpkm1T20F5OHXpDlY23xEkBJauks9M0XwqsRtMszlTD9pdQCqjO9unvsAGoHHuTr3xHYswRDCpIdSGzei9xF34DWdx5TZnGIHA+JEDIU8kOXwDB/RscpZ5vx5YXxGhSlp20cRdCxjbZPL06HJ7l/CF5Lw3rlN5h9dB+sNx6lBpygZtjsFvzy/1D978OYeuRGlN94jAmRDpemYFEDanSIFb7qfWPIdm+jFjFcxthiJsCDPnox7bajDpw5fxCerqVhH/wDys98j1pRgzIY7wmQIp7vtHmTTtIuYfrJO1CZ+CvLYo2OUePXvRpPMpkxUksKWy7nuquVAKo/klT/kcto++LoxOZpYYzp/vQEys/dTU2QeC923aJpdHokaIZE2aWT8GkC75LAW3Ojn2VwoGnVs4cWiyxvOD4N8LnVTWNQ3bsY07gsJa/o8RUlWH3xJ/DnjhL82V2OYvhzp9/C7Mv30wyoMOTVYa5g0UOaG/Yg3ffhWLUgPgKoAcaua6nVOeb51ACGMDlYdsafgv3mY1R7kdzSmphI5bWHUZvcz4ip6iRQAzwzicKO62L1A/EQ4DOGdw3BGL0KGs8A343jdgXV/ffXVX85npu+IfAslF6+j/WDw/BYJ8Gm+We2fwFmfoBrSqQ49xYPATzCMse+xBC4idJn2JJERjdhvfoQ3OMHwoxuuVtVehLW5N9QeZ0Rg8okOYLDPyrfj9yu68Posdw1o+afOwES+rpHYO6+oS59ZnlKCpmpcdT++UBIRNSDlzImWeEcfYFTPM7zAhVqgnytljv/Zhj5zfQz564F504AVTGx9xZWspu4IUlQKC5urPr8vYzvJ+rhbiloo+bQaXqz76D0wo/DslngyveIqmMT8h+7lb6g8ZuoqJuXNnZuBDgVmOd9EebO60U/Q9XXDKr+gZ/DHn9iWY6v1XbFIdZefwSVVx4K/WroD3iMlBnbh/S2zzPkRnzf1WqxiPH2CWC81ocvQeqT34cmFRztXjMSsF9/DNWX7qMZMBLE1BQ1Ye75e1Abfw5SS4k/8JSJwqfuRaL/I6HDbPdR7REgMX/jbmSuvZ8HFj2ymzr4Nx9H5ek767YZZ9kqazlVlP78TVjMEkMSpCTI9KHjmgdgsFpkvd0WB+0RQOeUvvRO6LlBBjd+tUlpWwd+ifKfbqdKls+c7bW1Td5ELQhqRZT+eAtqr/6W18RMTVDdg8h89La2c4PI1Iw/NeMhnQTaqKpLnqqFmwnKp+HPHCb4B2Ed/B2HJfmJXLJd2M33CQk8KJ176jtwjr6M1O6vQcv1wp15O9xT8+QFV8QSYlow1HgbhVCS9cLwyOjjPIT8eORvhCTv1/kVZ6ozrOkDt8pwF+vPCRr7a/HKH+2xilRmlp2HrBbL6hYmJz+g9Hxv/6GJt6/hYlJ/N8XOKBMgOvCAPngjWgP4qVRxtLkwzFFR3lvwfD41M0ytA/eM4GVmiCHEQkwRVVQrAjzXdZ6JmC8rzjeSICVtpJk05qz0q+whCsLC5/K4LcQSSl6E29Ra3a2mpkpP+743Liq0VpvsXTAIFmKIBBJFgLDkW1bxmGM7P12r4Bv7FgyCRTCxL9KAVqcTMlEvlWYP5vIdO/lD6R0R9zaesSpf5TzRcd3fH5l850fcoNi/fA25qLUiQCYKCV7gey8lUqnzdc0YWSskCHjXc54tTp+63bZt+WZVigbRgEXtTATI5IALVKxa9ZlUKt2p6fpu2lWU2Sxa+P0YmPdXnuvYvz554ti3K5XKEe5DwDeFvoV7i3QMCybI55LZSJDPbty46dP89fjNJOJiPizfwq8suP29ehv+A0fJ97wXLcv6xfHjR5/kk5mS8mCZBST7ItvnWNjORoBMkjkidSFByMh3dnZuT6Uyu0nECP85oYNjMmcpa3FabE1A8YcofpHAJ2q1yiszMzMHOVZiF9ACPtLxcfzdtpxNCwliMkKCvMp1oy9nHd4WWxMSBGSji6oLeHmNtHmON7V2Ni73CHB5bXRZtJ215L52W0OtQ03gIg0yGuPtrrt+3zoD6wx8gBj4P0ccrJjDzl2qAAAAAElFTkSuQmCC`,finder:`/assets/finder-BYyfd7HG.png`,terminal:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAACU3PoRAAAACXBIWXMAABYlAAAWJQFJUiTwAAABnWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4yNTY8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MjU2PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Cl6wHhsAAAq/SURBVHgB7VtrbFTHFT779Pu5xhgw2IANuBaIuPRBUkoCpKUWVYsatUpDkRJaSn4gfrT8QfygtKpUfqDKiESlCDlFSaNAgyJZbSrjildDIAUT83AwuMGv4Cdee9drr3fvnZ7vLnd9d72zi9fGj8ZHup7ZufM455tzzsydOSaapVkEZhGYRWAWgS8vAqbxiP7hhf/MS81xFJjt1kwzmTPJRMkWs8mmcqcmk+Csxaqq+PWYTCa7hUtJMZTp75BazCQEqaqi+PRis9lMqhB+IYRi5kLkSSgeVZicqk9xPup1Nn//2dVf8CuhtxlLOmYA3v/3p7mFi+b9xGKzbbWYzCstVkuOzW4ni8VCYJZB0MjEaXjnKBtVGM4ti8EghBB+Bsv4h6oKUhSFfL5hUv1KjyKU28Pe4Q+6O1v+unnNmochjWP8COcxWnXTR/daXktNS92fnpFR6B0aoqbG+9Ta9IC6uzrJ3d9PvmFmSFW0PsBkID8yBM8sCxImXdiIJkbJzGCOkGBgAW6gH+QBeEpaGuXMyaUFBYVUsLSIkpKSqd/Z2zrgdv9+bfGiP3F7iZqN9PzEud0VFQlXGlvf+KzXI2519onDxyvFs99+QaSnpWmTwx1NWZqakiq+8dw68Yc3/yxutveKBueg+Lix9cSBAweSn1jAGBUtHzV8/ua9fq+4cOe+eLF8S1BYnhPBczWlD3jQJ+CF72wWZ6/fEvddw+Jyw4MTzz9/wBpDttivq6/d+sXtrn5x/laDKPva17XB2NKDQiM/lY9xAgBE8bLlovraTVHf4xY112/vjiXhiIFGqHn4rbcWPPetjR8nJCbm/+q17VTzz7+Tbp1Awsq2mpySQvyerFYre36T9vCfCL1NQBH7D/gQPH6/n+CHPAMD5Gffoo8ID7R+44v0x8q32Un6Oq6dv/DN1199+YFs9KgqsqJk1cuZWVn5H7z7zijh09gJOebMIZvNhjWPsQckk0iPx2Qhqae7m1zshAECJuh8TTVVnXqXfvzqz+cuWVm6jYt+J+OMtTcyFRUVJaSmpP1w0OOhv52sDFaCmGnp6ZQ3f7629Hm9XtK9uz47k5Ly/gLjYALm5uVpPBmn4Mw7J2nA1U+JiUk/WLt2bVJQgLCMFICXduxYYLNaSx403qM7dTeCKga1z8nJ4SVOpczMTFq3bp2WH+YlcCoIIMD0wBN4A0ETPrt1k/7bcJcSEuzLvvujnxZoLyL8kQKwtGB5odVmzWprbiI32xkqAmHYvJVRBwCpqalUWVlJx44do9WrVxO0AbY52QQQwBN4A4/g1cP+ofXB5/BN6YsKF44dALPdlMU7O1NPZ6fWqS4UHB5sHru+jo4OqqiooLKyMjpz5gwdOnSICgsLaXBwUFNPvc2kpMyTxpthsO6uLo1Pk9XmMBSHZKUaYDFb0zHnHrcrpAG8PRwe1A4O6PDhw1ReXk5HjhyhTZs20enTp2nv3r2segmTCwK0ALwZyONyaXzaLJYsQ3FIVg6AxaLp0xCrkpEguE7IJyUl0cOHD+ngwYO0bds2crvdtHv3bsrPz9f263rdyUiNvGE8rzegiWarJU02fihkhlrsY+2qUMnPs2wk4yCwPQA0d+5c2rVrF23fvp1S2A6PHz9ObW1t2iphbPu080beMJbfxx+OLINZCLtsbCkAFrPZLviDxu8PBQD2D9IcD6scBN+xY4cGQlVVFR09epTu3LmjmUA4QzImJqzcoJ3oE45a8Ke3X1X1/duooaQAsJgJ3IOG4qhWjzvHzO/bt48uX75Me/bsoStXrmg2lwhHOQ0Is489Cs+ilBspAIrPZ1ZUViEGIRJhdj28Sdq5cyedO3eOsA+A4wsnLIvQlkikb58jvZuIMmgwZAg5lAnrWAoAGqmsPkAxEmEZ7O3tperqam03Fkl4gLR8+XKy8/d7JGpubtac5tMylYAGsBySSQRPUgDYbjQvzkdQkXjXysC4TDjMOkA5ceIE5fFWNRLBd9TU1ETUnEj1x1oG3nFyBFlkJAUgoAFyE5B1qJcDHOwT9u/fry2Verkxra+vD3xMGQsnMA/zVZU4TQCOQ//IiZcngHj27FmpD4D2aOeI8Q4Qox20MG4nCOahPjInGGPs4OtIviH48ilnwDtkiOYDpDvBgAnEPsR8yjKMq3tdA+ICwM/LhxLDfsbF3SQ0Dmixn52gfB8g1QBuFfABrEYzlQJOEBshuQxSAFRsIOADoiyD0x2YEROIQwP0fYBsIzTdhQd/4D3WPkCuAaw2CraxvJ2cqaRthbGcx2MCbDi8fIx/GZxK8DQfgKu6eJyg4lP80IDgaehUShLn2DjPgB+LdxnktjPfCfI0Rv0WkPoAhg1Xz+PeCcY5eRPSLLAThCnHsQrw7Cv4kJjJpC+Dce0D/D5AID/MmAnA6E4wLh+A+AJGQHogMiMAeOwERTwmoHvP/4+doHy6pE6Qz/IYA/YB4Vvh8N/yvif/TRhvmDxoMZ8LSj8GpAAIRRnGKhB+XjedNWL0npUD0ngvw5MpvbmVAsCnvB6c6CL6y0jTGoCwL1fcFkMGPuF2G2Uw5uUA+Hz9QC/80BMd6pcjxo6mPM9nkBpvBkbsdhtrgI+GvF6noTgkKwVg0O128bWYSEpODtkNIyxllF8I6XKKfrC9a7wZhsd1OQ5mhwYGxg5AU1NTi9c71JeZkUGJfHgJ+8KlmBaTw52G+wbDuJOeBS+4wwRv4BG8JvC1HYf30LDX6+bL2xYZUzINMF2/fv0LVp172Y5smr9gQTDqEAFJ3RyTA18wHUAAD+AFPIE3EFz+PA7hyXE4oBWNFy9ebOWiwKUmKhhIBoDo6+tzOXt7/2HhyMyvrlkTbIJeEJDUwVfiUC8wYOJbIi1FfrKex2OCh4729mCQlM5oGfPMES7k7Ov70OVywQRGLxJcKL0YQYNrn3zyPpvA6yWlpXNK6uqo/u5dLQpLA4GDDxBANR3D5JYVFdHKVSsByqNPa2tPyYTn8ugAXL16taG0tLRi8eLFvy3fsoX6eebbeOaxMAIEbDJQxn/Q15QQ+MADggFA7TeXf48DpqzU1txy9NKlS/VcHHH20SZ0kUfJCGl+r6Gh4W5xcXGhw+H4ylJG1vnoEXX19ASdos7AVKVgEjaPtJj527p1K+Xm5iJ+qeqtv5z8DS+NiPEJOAfOhFM0AFBXsI35GIQrS5YsWZidnVWyomQFObKzOTJkUDMBHJ7qDICJyXzAoJ2jw/LZSa9fv542bNhAHM1OnZ1dVRy09Wu+vUbofFiEB1qNkK49IyWjc6iDiIfcn73yyq68+fN+yRHaWcMcq48ITafTSQPuAS1EDiYR7dNzdNdjL8FdInan9gQOmU9J1WIVc3Ic/DuB+XA72zvaj7/33uk3OHSnnXv38iP9DsDoTwKAXg/RDymrVq1aXfbMMy9lZGZs5Hu/Ap4B/i8QC3t/rASo+vRJ0zLWPADOCspL/XBzn9P5rxt1dadqa2tvMAcD/CC6C1Wj0lhZ5sBgDp1hjeAtch6DsYR9w6KUlKSFHBaTCBCeHNOofEV5iWBpFbGI3iHPUPOjnp6W2rq6Rv52wYxDaMw6jrJiCs91nlgDUFcngAbfATCQ4jFKPlZQufmYSBcMKdQbDg4PbB2p/p6zsWm8zOrtker52KNOTA0IqgurpxPT82wvswjMIvClQeB/QMMm6ZCwrokAAAAASUVORK5CYII=`,iterm2:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAACU3PoRAAAACXBIWXMAABYlAAAWJQFJUiTwAAABnWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4yNTY8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MjU2PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Cl6wHhsAAAuWSURBVHgB7Vvrb1THFT/3uXt3ba/tXWObABGkgiYlD1UVUQRSkfqQWjVITatKadS0/Antl0RVW0BKP/ClUpFKq6B8aNqQFqlEpVFIVYQQ/VCBiICKCLuVWlzAu+DX4tfd5739nZmdvfu6i20WYrcec3ced+bMOb85Z+bM3IFoPawjsI7AOgLrCPz/IqA9iOhnzpxJZrPZodnZ2ZTneT14nFKpxI9RLpcJeeJYpYvFIhUKBVHOMedrn7CyfD4vaPi+X8bjgr6LeBZ0J9FHZmRkZGqlciwbgJMnTyanp6e/PjExse/unTvPTs/MDMzPzzu5XE4IB+aEgGCQGh8GhMs49vg9g6TyXFb3MHBBmaKlaRrpui4ewzBcpCcQX0XbUwsLC+/dvn17WWAsC4Bjx469PDY2duDatWs7RkZHKZNOE4QnFvpRBwbBNE2KRCLUFY9T1HEI4IxCow7dvHnz3aXysyQATpw4YaTT6TeuXLny2vnz5zV0IEZ7qZ087HqsFQ4ASCQSFI1GfYBw+NatWz9Cv+X79W3crwLea7t37/7phQsXXj99+rQ2Pj4u7HEJ7R5pFZ5LXNdl09CcqLMnFovZc3NzZx+YiSNHjryyf/9+L5VK+UDaB8FV/TCPzOvWrVu94eHhV+4HQFsNOHjw4NDMzMxvPzz9Yf/t8dtiAgsIsvWsloe5CqyZV41oJKrBHJ6zitaJxeLifMB3fUqvz9bnent7XxodGd1289bNqvAaOpJ/q0f8gB+Z4mU3ey/LfG7rTnW/VC9VfS4UgL1795pY3/eNYrZnRDkw+dZis10oy5A1W9XjOuqPa7Wq04ky5tN1c8RLs2Vb+9CRKbpr8RMKACa+wempmZ2ZTEY0w+orAGgJQa9BfT/ZSNYX4hUgmsUwEjr17O6nxJ4kOc91EVWMryU99Phg5ZrQ2MWFRR6WnZs2bRpsIbsoCgUgmUwO38tmU/NzbD5q7Dmu/2MqmqNR6rsbyXwqIoiKspp6nDdTNg2//Dh1faOfnD095Fd7rqfXqRwPVy6XJ9/zUnE7PlxlrCERqhpwS9nDixRLxerY86jUBqn08O48jTwXXluZS9gcPPzKIVZtNB9qiRGZmJ+gSC7oVo20aNjRH43KcNDKpXJEM7WBMNIBJw01bMPuZttnm4XjKcazvgqE7dKo/zsbKfHVFGlQ8eSrQ1R8upfuvTtBhb8ukC6GWUEg9UjXqkMPmkq36il3Ise0fU+63fAYu8NoBtw01IDvHePNCQeplirmHIjHNNp0dDul3thMi5vzNHEpQ+69RTK+GKWBtx6nyKs90APWBG4XCCo9CUmjma4s6dSvmJqxv4BvEBOMtPgJ1QAAEC0VpY8v2Q1as1bE9yQo8pUuSl+8RQuvT1L5nwXSbI3Mz0Yp+s0eKl3NVRsoQdFMBAZEwlIbi8IO/8A0oQWarkXDCIcCUPI9w8N6KpkNRpAJsRzGoE05DyaSwZb3qlwmaZGodNal+XMu8eAHpsMtKjBiLuCgtCLIieKO/vBA8T/N90MdvlATKMO3bmRTcceCuZfnqJQukPN8N6WObKHIC3HSIlJkwzOw8Jo1AAQwShpKfM6pd4p652JlSjwUYSH0De/NsZiqcUN7rho85Wt5yh4Yp1KmQNaLcRp6+wka/v2nqGt/krReFkq1VWwgFqPBI6LElkAooB9OHCa6LA81AQ+HEZAfgQVoxInLDCr8cYEKl12yvhYnG05Q5EmHug8MUnRfgrI/HCfvOi+hqq0aaRnXwNKewwd8y/20C4q7pjplryy8KUWglmGZ1gEB1Pw/RIWjszT3vQxlv58m96M5omcMcl7rJ9+Rjm+VOOy/fvQlvM20O1dS7TskEQoAmwBrQMBKvYIKYDG18HuTLDLndPL+7NLCoUmK5uERbsPLFJNnNVJUhFXhh/OqtJ6uLO9k2Qo1wCtiDuAlRDCqmJWCsEjxb/XS4Ntbyfq8Q35czLeYInRytneRHYuQl4UGzTX4AQJQNBahFWUFVGdiCSN3FroIYPBCAp+wsCelWKmtpqGV9bxD9IJFqc9tIf8GXJ50kcxum2LY6EzNTlPhdzCFLLcPNlGCoapWKVBrKXc2LSDGcVm4+G22iTwH8IktA9AYtJJG2R+nSTtrk/3lGNmY/OxdDrnZPE2fnabcH+5RCeZg4E8ujKwzKih6rSirOp2MVX+taYZqAHuBrAFBACFFC8X6Aizk/Twtvu+Su8Okze/soPRxuMO/nCajjBNbniABQK2Y3Fy4whwLYqJEdqFoc662W/l2ab+KRm372nQLKqEA8KmK70sb5vVf0RY0OIOJTCo3JroZpGH/GhxCo8xrg1UZea6Nvbn45UaSCu8M5V8FiDri1WpI1ARJJChQgjW25RqVMjWJB42aU6EAFEu8zeVe1EoOqqrTCh0WQkx/ukaLM4uk4RA6UPt60NiY2LewNZs0QxGqwKCyzfzVl7Sq16qsyh/Py1il9FAxwyfBUjEvNhJSDGa0deA3Hr7FzOzHueEcb52l2nN91YbrlCeKNHkiLYj4BY90nCEoqqpe6x5WXsrDY+gGWZHQvVA4AMU8TKBmGWzHho5tgweHSAoip73G+hrA8a5hZamokTKghyW86h+fzShirUADPEyC7AwFo9ToM9XrHo87l7QTSNYJarWrqwSQMddU7er7ba4XlAQaYAWFDalQaJQfwPV5tJpDM/vNJa1aLaVWc7sA2uW0hw8gNCA4q2yk3BYAqQFSeKUJjQRWc5551sUcsBINwGEovsaDhPwLRuCTEHnpat/IHS/Plr4SAOAKizMBQfGTHv/lqH0tBNAAHMJa1goAUJ5gMP4rZaKWoUebZo5ZA/SVrALForziokxg7YkvjVaYwEo0wMNHhXo/YG1CwCZgQgvCQugb2H/FV2PB16LwUmReBqEFalPThEPoMogFICe/4kgA1iIE7JPyPSLsBYKPFA0QhAJApbKrG7wTuN9uoIHiKsry/MUrgK/7+FDROoQCgJtfczyBGHjwhXXNGQF7Dgbs37Ztws4Wx1OtQygARb84Zel23rLMSCHP3wjXmhH4GH0bt8eieU8rht4dDJ0EZ+dnM3Ajp3DPpgqdnA0kFGshHYvHKNYVn5rMTMpbHlVJgkQoADcyN+5iB3Y9hkuIusb7OA5rQWzJowb1T6ZwG8Vxrl/8+0XI0jqEAoDqbi7nfoDbVuTEcPSNggppxKv7j7fOUSdKw48N48swfYC7jaGTYDsAKHM3cwruwBjfwOTlpN2WpDW+j7ZUaqlPpmHShsENNDA4MPbx6Men2nHRDgB/Ij8xNjs/f9i2Lb+vv1fsrflEZ7WOPw8Qb397k320/cnt/FH88Lm/nRtDcejYtftmIICbdqf+kbATPfFYfJdhGVQq4N4NvhlwYCBWS+CBMU3cVkv10dPP7qS+Df1H33znVz8Hf+wErRgAblieXJi8ABBiMSe+K+JExEdTcS2+cmwuYXjUYKjTRWgkX5aOR2nosSF66pnPsPC/+M17vz6EKz6zzD+e0LBUrnlD3f1Ecvu3e7t6foArJ1uLuD/E9/DyuIrGW2e+isJ3+mVQcWi/dS9a164vVTlmmDWPnTQTXl6sK0b9UPmhjcOw+4F/lwz/Z28df/M4qrHzw7c82oalAsBE2Gmyu+y+bVuSwy/GnNiXdMP4NHaM/X7ZizAAfIDCO8gAiLZ9i5eYpYXdVjYtQjAWjs/zNREjjREG6KKeCTNkwXEDFFfjI3ncCp+OxKIjRa/0l8ujH/3p0qVL/wJh9tyW9J8YlgMAM8z1GQh+ujf0bRhKOIlB07CTlml04QweVya1KFTyvnML2osgRjKCb0lmhGzeuIg0PrcjrXPe4u2sSQbsG3XL2Jrk8IHFLZVL827ZnRq/M34HV/nZ0eERZ6H5UQqDZPuwXAAUNW7HKwg/igbHtWlkOx6UYBzXpnm7y48q63jH6wTXEVhHYB2B/0kE/gviOG5RK/1x9AAAAABJRU5ErkJggg==`,ghostty:`/assets/ghostty-D5T950Nz.png`,xcode:`/assets/xcode-BOSzsT4U.png`};function Mi({target:e,className:t=`size-4`}){return(0,J.jsx)(`img`,{alt:``,className:`${t} shrink-0 rounded-[3px]`,draggable:!1,src:ji[e.id]})}function Ni({onOpenPreferredTarget:e,onOpenTarget:t,preferredTarget:n,targets:r}){let[i,a]=(0,q.useState)(null),o=i!==null,s=(0,q.useCallback)(async(e,t)=>{if(i===null){a(e.id);try{await t()}finally{a(null)}}},[i]);return n?(0,J.jsx)(xr,{disabled:o,className:`px-1`,primaryAction:{label:`Open workspace in ${n.label}`,onSelect:()=>{s(n,e)},content:(0,J.jsx)(Mi,{target:n,className:`size-5`})},secondaryActions:r.map(e=>({label:e.label,onSelect:()=>{s(e,()=>t(e.id))},content:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mi,{target:e,className:`size-5`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1`,children:e.label})]})})),triggerLabel:`Choose workspace open target`,mobileTitle:`Open Workspace`}):null}var Pi=tt(null),Fi=tt(null),Ii=tt([]);function Li(e){let t=ct(e.enabled?ot:Pi),n=ct(e.enabled?st:Fi),r=ct(e.enabled?it:Ii);return{openWorkspace:(0,q.useMemo)(()=>{if(!e.enabled||!t||!n||r.length===0)return null;let i=n;return e=>rt(i,e)},[e.enabled,t,n,r.length]),workspaceOpenTargets:r}}var Ri=`Failed to open file locally`,zi=`Localhost is disconnected.`,Bi=`No local editor is available.`;function Vi(e){return e.hasDaemon?Bi:zi}function Hi(e){let{hasDaemon:t}=lt(),{openWorkspace:n,workspaceOpenTargets:r}=Li(e),[i,a]=at(),o=(0,q.useMemo)(()=>pt({preferredTargetId:i,targets:r}),[i,r]),s=(0,q.useCallback)(async e=>{if(!r.find(t=>t.id===e.targetId)||!n)return gt.error(Ri,{description:Vi({hasDaemon:t})}),!1;e.rememberTarget&&a(e.targetId);try{return await n({lineNumber:e.lineNumber,path:e.path,targetId:e.targetId}),!0}catch(e){return gt.error(Ri,{description:e instanceof Error?e.message:void 0}),!1}},[t,n,a,r]),c=(0,q.useCallback)(async e=>o?s({lineNumber:e.lineNumber,path:e.path,rememberTarget:!1,targetId:o.id}):(gt.error(Ri,{description:Vi({hasDaemon:t})}),!1),[t,s,o]);return{canOpenPreferredTarget:o!==null,openPathInPreferredTarget:c,openPathInTarget:s,preferredTarget:o,workspaceOpenTargets:r}}function Ui(e,t){return e?e.sessions.findIndex(e=>e.id===t.id)===-1?{sessions:[...e.sessions,t]}:{sessions:e.sessions.map(e=>e.id===t.id?t:e)}:{sessions:[t]}}function Wi(e,t){if(!e)return e;let n=e.sessions.filter(e=>e.id!==t);return n.length===e.sessions.length?e:{sessions:n}}function Gi(e,t){if(!e)throw Error(`${t}: thread id is required when query is enabled`);return e}function Ki(e,t){return y({queryKey:f(e),queryFn:({signal:t})=>r(Gi(e,`useThreadTerminals`),t),enabled:(t?.enabled??!0)&&!!e,refetchOnWindowFocus:!1})}function qi(){let e=m();return oe({meta:{errorMessage:`Failed to start terminal.`},mutationFn:({threadId:e,...t})=>b(e,t),onSuccess:t=>{e.setQueryData(f(t.threadId),e=>Ui(e,t)),e.invalidateQueries({queryKey:f(t.threadId)})}})}function Ji(){let e=m();return oe({meta:{errorMessage:`Failed to rename terminal.`},mutationFn:({terminalId:e,threadId:t,...n})=>s(t,e,n),onSuccess:t=>{e.setQueryData(f(t.threadId),e=>Ui(e,t)),e.invalidateQueries({queryKey:f(t.threadId)})}})}function Yi(){let e=m();return oe({meta:{errorMessage:`Failed to close terminal.`},mutationFn:({mode:e,terminalId:t,threadId:n})=>v(n,t,{mode:e,reason:`user`}),onSuccess:(t,n)=>{e.setQueryData(f(t.threadId),e=>t.status===`exited`?Wi(e,n.terminalId):Ui(e,t)),e.invalidateQueries({queryKey:f(t.threadId)})}})}function Xi(e,t){let n=e.mergeBase?.aheadCount??0,r=e.mergeBase?.behindCount??0;return n===0&&r===0?null:n>0&&r>0?t?`${n} ahead, ${r} behind relative to ${t}`:`${n} ahead, ${r} behind`:n>0?t?`${n} ahead of ${t}`:`${n} ahead`:t?`${r} behind ${t}`:`${r} behind`}function Zi(e,t){return{label:e,summary:t,summaryContent:t}}function Qi(e,t){if(!e){let e=t?.error instanceof d&&t.error.code===`path_not_found`;return t?.workspaceDeleted||e?Zi(`Unknown`,`Workspace not found.`):Zi(`Unknown`,`Workspace status unavailable.`)}let n=t?.mergeBaseBranch??e.mergeBase?.mergeBaseBranch,r=t?.showBranchComparison?Xi(e,n):null;switch(e.workingTree.state){case`clean`:return(e.mergeBase?.aheadCount??0)>0&&(e.mergeBase?.behindCount??0)>0?Zi(`Diverged`,r??`Branch has diverged.`):(e.mergeBase?.aheadCount??0)>0?Zi(`Ahead`,r??`Local commits pending merge.`):(e.mergeBase?.behindCount??0)>0?Zi(`Behind`,r??`Branch is behind its merge base.`):Zi(t?.showBranchComparison?`Up to date`:`Clean`,n?`No local changes relative to ${n}.`:`No local changes.`);case`untracked`:return Zi(`Untracked`,r??``);case`dirty_uncommitted`:return Zi(`Dirty`,r??``);case`committed_unmerged`:return(e.mergeBase?.aheadCount??0)>0&&(e.mergeBase?.behindCount??0)>0?Zi(`Diverged`,r??`Branch has diverged.`):(e.mergeBase?.behindCount??0)>0?Zi(`Behind`,r??`Branch is behind its merge base.`):Zi(`Ahead`,r??`Local commits pending merge.`);case`dirty_and_committed_unmerged`:return Zi(`Dirty`,r??``);default:return re(e.workingTree.state)}}var $i=tt(!1),ea=et(`bb.thread.secondaryPanel.widthPercent`,50,$e({parse:(e,t)=>{if(e===null)return t;let n=Number.parseFloat(e);return Number.isFinite(n)&&n>0&&n<=100?n:t},serialize:e=>String(e)}),{getOnInit:!0}),ta=tt(new Set),na=tt(new Set),ra=tt(void 0),ia=tt(null);function aa({activeSecondaryPanel:e,clearActiveFileTabs:t,defaultMergeBaseBranch:n,environmentId:r,mergeBaseBranchOptionsEnabled:i=!1,setThreadSecondaryPanel:a}){let o=ct(ra),s=nt(ra),c=nt(ia),{data:l,isLoading:u}=gi(r??``,{enabled:!!r&&(i||e===`git-diff`)});(0,q.useEffect)(()=>{s(void 0)},[r,s]);let d=(0,q.useCallback)(e=>{a(e)},[a]),f=(0,q.useCallback)(()=>{d(`git-diff`)},[d]);return{closeThreadSecondaryPanel:(0,q.useCallback)(()=>{a(null)},[a]),defaultMergeBaseBranch:n,isLoadingMergeBaseBranchOptions:u,mergeBaseBranchOptions:l,openDiffFile:(0,q.useCallback)(e=>{t(),c(e),f()},[t,f,c]),openThreadDiffPanel:f,openThreadSecondaryPanel:d,selectedMergeBaseBranch:o,setSelectedMergeBaseBranch:s}}function oa(e){return!!e.threadId&&e.inlineRowCount===0&&e.cachedRowCount===0&&!e.isLoading}function sa(e){return{sourceSeqEnd:e.sourceSeqEnd,sourceSeqStart:e.sourceSeqStart,turnId:e.turnId}}function ca(e,t){return e.turnId===t.turnId&&e.sourceSeqStart===t.sourceSeqStart&&e.sourceSeqEnd===t.sourceSeqEnd}function la(e){let t={},n=e=>{for(let r of e){if(r.kind===`turn`){t[r.id]=sa(r),r.children&&n(r.children);continue}r.kind===`work`&&r.workKind===`delegation`&&n(r.childRows)}};return n(e),t}function ua({candidateRowIds:e,previousRangesById:t,visibleRangesById:n}){let r=new Set;for(let i of e){let e=n[i],a=t[i];(!e||a&&!ca(a,e))&&r.add(i)}return r}function da(e,t){let n=null;for(let r of t)e.has(r)&&(n??=new Set(e),n.delete(r));return n}function fa(e,t){let n=null;for(let r of t)r in e&&(n??={...e},delete n[r]);return n}function pa({currentLoadGeneration:e,request:t,visibleRangesById:n}){if(e!==t.loadGeneration)return!1;let r=n[t.rowId];return r!==void 0&&ca(r,t.range)}function ma({loadTurnSummaryRows:e,managerTimelineView:t,timelineRows:n,threadId:r}){let i=(0,q.useRef)(0),a=(0,q.useRef)(e),o=(0,q.useRef)(r),s=(0,q.useRef)({}),c=(0,q.useRef)(new Set),l=(0,q.useRef)(new Set),u=(0,q.useRef)(new Set),d=(0,q.useRef)({}),[f,p]=(0,q.useState)(()=>new Set),[m,h]=(0,q.useState)(()=>new Set),[g,_]=(0,q.useState)({});(0,q.useLayoutEffect)(()=>{a.current=e},[e]),(0,q.useLayoutEffect)(()=>{o.current=r},[r]),(0,q.useLayoutEffect)(()=>{let e=la(n),t=ua({candidateRowIds:[...Object.keys(d.current),...c.current,...l.current,...u.current],previousRangesById:s.current,visibleRangesById:e});if(s.current=e,t.size===0)return;let r=da(c.current,t);r&&(c.current=r);let i=da(l.current,t);i&&(l.current=i,p(i));let a=da(u.current,t);a&&(u.current=a,h(a));let o=fa(d.current,t);o&&(d.current=o,_(o))},[n]);let v=(0,q.useCallback)(e=>{let t=o.current,n={loadGeneration:i.current,range:sa(e),rowId:e.id},r=c.current,f=s.current[e.id];if(f===void 0||!ca(f,n.range)||r.has(e.id)||!oa({cachedRowCount:d.current[e.id]?.length??0,inlineRowCount:e.children?.length??0,isLoading:l.current.has(e.id),threadId:t})||!t)return;r.add(e.id);let m=new Set(l.current).add(e.id);if(l.current=m,p(m),u.current.has(e.id)){let t=new Set(u.current);t.delete(e.id),u.current=t,h(t)}a.current({id:t,turnId:e.turnId,sourceSeqStart:e.sourceSeqStart,sourceSeqEnd:e.sourceSeqEnd}).then(t=>{if(!pa({currentLoadGeneration:i.current,request:n,visibleRangesById:s.current}))return;let r={...d.current,[e.id]:t.rows};d.current=r,_(r)}).catch(()=>{if(!pa({currentLoadGeneration:i.current,request:n,visibleRangesById:s.current}))return;c.current.delete(e.id);let t=new Set(u.current).add(e.id);u.current=t,h(t)}).finally(()=>{if(!pa({currentLoadGeneration:i.current,request:n,visibleRangesById:s.current}))return;let t=new Set(l.current);t.delete(e.id),l.current=t,p(t)})},[]);return(0,q.useLayoutEffect)(()=>{i.current+=1,c.current=new Set;let e=new Set,t=new Set,n={};l.current=e,u.current=t,d.current=n,p(e),h(t),_(n)},[t,r]),{erroredTurnSummaryIds:m,handleLoadTurnSummaryRows:v,loadingTurnSummaryIds:f,turnSummaryRowsById:g}}function ha({managerTimelineView:e,timelineRows:t,threadId:n}){let{mutateAsync:r}=Ee();return ma({managerTimelineView:e,timelineRows:t,threadId:n,loadTurnSummaryRows:(0,q.useCallback)(t=>r({...t,managerTimelineView:e}),[r,e])})}var ga=le;function _a({actionsMenu:e,activeTerminalCount:t,isManagedThread:n,isManagerThread:r,isSecondaryPanelOpen:i,isTerminalPanelOpen:a,isThreadGitActionPending:o,onOpenThreadGitAction:s,onToggleSecondaryPanel:c,onToggleTerminalPanel:l,showTerminalPanelToggle:u,threadHeaderGitActions:d,threadTitle:f,workspaceOpenButton:p}){let[m,...h]=d,g=ue(),_=g?`PanelBottom`:`PanelRight`;return(0,J.jsx)(Rn,{center:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:f}),r?(0,J.jsx)(br,{variant:`outline`,children:`manager`}):null,!r&&n?(0,J.jsx)(br,{variant:`outline`,children:`managed`}):null]}),actions:(0,J.jsxs)(J.Fragment,{children:[p,m&&h.length>0?(0,J.jsx)(xr,{disabled:o,primaryAction:{label:m.label,onSelect:()=>s(m.target)},secondaryActions:h.map(e=>({label:e.label,onSelect:()=>s(e.target)}))}):m?(0,J.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,disabled:o,className:ga,onClick:()=>s(m.target),children:m.label}):null,u?(0,J.jsxs)(P,{type:`button`,variant:`ghost`,size:`icon`,className:`${_t} relative`,"aria-label":a?`Hide terminal panel`:`Show terminal panel`,"aria-pressed":a,title:a?`Hide terminal panel`:`Show terminal panel`,onClick:l,children:[(0,J.jsx)(H,{name:`Terminal`}),t>0?(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute -right-0.5 -top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-primary px-1 text-[9px] font-semibold leading-none text-primary-foreground`,children:t>9?`9+`:t}):null]}):null,e,!g&&i?null:(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,className:_t,"aria-label":i?`Hide secondary panel`:`Show secondary panel`,"aria-pressed":i,title:i?`Hide secondary panel`:`Show secondary panel`,onClick:c,children:(0,J.jsx)(H,{name:_})})]})})}var va=`max-w-[180px]`;function ya({label:e,secondaryLabel:t=null,labelClassName:n,title:r,isActive:i,onSelect:a,labelMaxWidthClass:o=va,closeAction:s}){let c=s!==null;return(0,J.jsxs)(`div`,{className:A(`inline-flex h-7 shrink-0 items-center rounded-md text-xs transition-colors`,i?`bg-muted text-foreground`:`text-muted-foreground hover:bg-state-hover`),children:[(0,J.jsxs)(`button`,{type:`button`,onClick:a,"aria-pressed":i,title:r,className:A(`flex h-full min-w-0 items-center rounded-l-md pl-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,c?`pr-1`:`rounded-r-md pr-2`),children:[(0,J.jsx)(`span`,{className:A(`truncate`,o,n),children:e}),t?(0,J.jsx)(`span`,{className:`ml-1 shrink-0 text-muted-foreground`,children:t}):null]}),s?(0,J.jsx)(`button`,{type:`button`,onClick:s.onClose,disabled:s.isClosing,"aria-label":s.closeLabel,title:s.closeTooltip,className:`mr-1 ml-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded opacity-70 transition-opacity hover:bg-muted-foreground/15 hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-30`,children:s.isClosing?(0,J.jsx)(H,{name:`Spinner`,className:`size-3 animate-spin`}):(0,J.jsx)(H,{name:`X`,className:`size-3`})}):null]})}function ba(){let e=m();return oe({meta:{errorMessage:`Failed to resolve pending interaction.`,showErrorToast:!1},mutationFn:({threadId:e,interactionId:t,resolution:n})=>a(e,t,n),onSuccess:(t,n)=>(mt({queryClient:e,threadId:n.threadId}),t)})}function xa(e){return(e.options?.length??0)>0}function Sa(e){let t={};for(let n of e)t[n.id]={selected:[],otherSelected:!xa(n),otherText:``};return t}function Ca(e,t){return e[t.id]??{selected:[],otherSelected:!xa(t),otherText:``}}function wa(e,t){let n=new Set((e.options??[]).map(e=>e.value));return t.filter(e=>n.has(e))}function Ta(e,t){return wa(e,t.selected).length>0?!0:t.otherSelected&&t.otherText.trim().length>0}function Ea(e,t){let n=t.otherText.trim(),r=t.otherSelected&&n.length>0;if(e.multiSelect){let i=wa(e,t.selected);return r?{selected:i,freeText:n}:{selected:i}}return t.otherSelected?r?{selected:[],freeText:n}:{selected:[]}:{selected:wa(e,t.selected)}}function Da(e,t){let n={};for(let r of e)n[r.id]=Ea(r,Ca(t,r));return{kind:`user_answer`,answers:n}}var Oa=`Other…`;function ka({checked:e,label:t,description:n,multiSelect:r,onSelect:i}){return(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:i,className:A(`flex w-full items-start gap-2.5 rounded-md px-2.5 py-1.5 text-left transition-colors`,e?`bg-surface-selected`:`hover:bg-state-hover`),children:[(0,J.jsx)(`span`,{className:A(`mt-0.5 flex size-4 shrink-0 items-center justify-center border`,r?`rounded`:`rounded-full`,e?`border-primary bg-primary text-primary-foreground`:`border-input`),children:e?(0,J.jsx)(H,{name:`Check`,className:`size-3`,"aria-hidden":!0}):null}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:t}),n?(0,J.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:n}):null]})]})}function Aa({currentIndex:e,formState:t,onSelect:n,questions:r}){return(0,J.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,J.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-x-auto`,children:r.map((r,i)=>{let a=Ta(r,Ca(t,r));return(0,J.jsx)(ya,{label:r.shortLabel??`Question ${i+1}`,labelClassName:a?`line-through`:void 0,title:r.prompt,isActive:i===e,onSelect:()=>n(i),closeAction:null},r.id)})}),(0,J.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[e+1,` of `,r.length]})]})}function ja({disabled:e,question:t,state:n,onToggleOption:r,onSelectOther:i,onFreeTextChange:a,onShortcutSubmit:o}){let s=t.options??[],c=`${t.shortLabel??t.prompt} answer`;return(0,J.jsxs)(`fieldset`,{disabled:e,className:`min-w-0`,children:[(0,J.jsx)(`legend`,{className:`sr-only`,children:t.prompt}),(0,J.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:t.prompt}),(0,J.jsxs)(`div`,{className:`mt-2 space-y-0.5`,children:[s.map(e=>(0,J.jsx)(ka,{checked:n.selected.includes(e.value),label:e.label,description:e.description,multiSelect:t.multiSelect,onSelect:()=>r(e.value)},e.value)),t.allowFreeText&&s.length>0?(0,J.jsx)(ka,{checked:n.otherSelected,label:Oa,multiSelect:t.multiSelect,onSelect:i}):null]}),n.otherSelected?(0,J.jsx)(`textarea`,{"aria-label":c,value:n.otherText,rows:2,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.key!==`Enter`||!e.metaKey&&!e.ctrlKey||(e.preventDefault(),o())},placeholder:`Type your own answer…`,className:`mt-2 w-full resize-y rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`}):null]})}function Ma({className:e,interactionId:t,isResolving:n=!1,questions:r,threadId:i}){let[a,o]=(0,q.useState)(()=>Sa(r)),[s,c]=(0,q.useState)(0),[l,u]=(0,q.useState)(t),d=ba(),f=Bn();l!==t&&(u(t),o(Sa(r)),c(0));let p=r.length,m=r[s]??null,h=s===0,g=s===p-1,_=(0,q.useMemo)(()=>p>0&&r.every(e=>Ta(e,Ca(a,e))),[a,r,p]),v=d.error?Ht({error:d.error,fallbackMessage:`Failed to submit answer.`}):null,y=d.isPending||n,b=(e,t)=>{o(n=>({...n,[e.id]:t(Ca(n,e))}))},x=(e,t)=>{b(e,n=>{if(e.multiSelect){let e=n.selected.includes(t)?n.selected.filter(e=>e!==t):[...n.selected,t];return{...n,selected:e}}return{...n,selected:[t],otherSelected:!1}})},S=e=>{b(e,t=>e.multiSelect?{...t,otherSelected:!t.otherSelected}:{...t,selected:[],otherSelected:!0})},C=(e,t)=>{b(e,e=>({...e,otherText:t}))},w=()=>{y||!_||d.mutateAsync({threadId:i,interactionId:t,resolution:Da(r,a)}).catch(()=>{})},T=()=>{if(g){w();return}c(e=>Math.min(e+1,p-1))},E=()=>{f.mutate(i)};if(!m)return null;let D=Ca(a,m);return(0,J.jsxs)(`div`,{className:A(`text-xs text-muted-foreground`,e),children:[p>1?(0,J.jsx)(Aa,{currentIndex:s,formState:a,onSelect:c,questions:r}):null,(0,J.jsx)(ja,{disabled:y,question:m,state:D,onToggleOption:e=>x(m,e),onSelectOther:()=>S(m),onFreeTextChange:e=>C(m,e),onShortcutSubmit:T}),(0,J.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,J.jsx)(P,{type:`button`,size:`sm`,variant:`ghost`,disabled:y||f.isPending,onClick:E,children:`Cancel`}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h?null:(0,J.jsx)(P,{type:`button`,size:`sm`,variant:`outline`,disabled:y,onClick:()=>c(e=>Math.max(e-1,0)),children:`Back`}),(0,J.jsxs)(P,{type:`button`,size:`sm`,disabled:y||g&&!_,onClick:T,children:[n?(0,J.jsx)(H,{name:`Spinner`,className:`size-3 animate-spin`}):null,g?`Submit answer`:`Next`]})]})]}),v?(0,J.jsx)(`div`,{className:`mt-2 rounded-md border border-surface-destructive-border bg-surface-destructive px-3 py-2 text-xs text-destructive`,children:v}):null]})}function Na({interaction:e,threadId:t}){return se(e.payload)?(0,J.jsx)(Ia,{interaction:e,payload:e.payload,threadId:t}):_(e.payload)?(0,J.jsx)(Fa,{interaction:e,payload:e.payload,threadId:t}):re(e.payload)}function Pa({title:e,errorMessage:t,footer:n,children:r}){return(0,J.jsxs)(`div`,{className:`mb-2 rounded-lg border border-border bg-surface-recessed px-4 py-3 text-xs text-muted-foreground`,children:[e?(0,J.jsx)(`h3`,{className:`min-w-0 text-sm font-semibold text-foreground`,children:(0,J.jsx)(tn,{fullText:e,collapsedClassName:`line-clamp-2`,children:e})}):null,r?(0,J.jsx)(`div`,{className:e?`mt-3`:void 0,children:r}):null,n?(0,J.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center justify-end gap-2`,children:n}):null,t?(0,J.jsx)(`div`,{className:`mt-2 rounded-md border border-surface-destructive-border bg-surface-destructive px-2 py-1 text-xs text-destructive`,children:t}):null]})}function Fa({interaction:e,payload:t,threadId:n}){let r=ba(),i=e.status===`resolving`,a=za(e.resolution),o=(0,q.useMemo)(()=>Ba({interaction:e,payload:t}),[e,t]),s=r.error?Ht({error:r.error,fallbackMessage:`Failed to resolve pending interaction.`}):null,c=r.isPending||i,l=t=>{let i=B(e,t);r.mutateAsync({threadId:n,interactionId:e.id,resolution:i}).catch(()=>{})};return(0,J.jsx)(Pa,{title:o.title,errorMessage:s,footer:t.availableDecisions.map(e=>(0,J.jsx)(La,{decision:e,disabled:c,isLoading:i&&a===e,onClick:()=>l(e)},e)),children:o.body})}function Ia({interaction:e,payload:t,threadId:n}){let r=e.status===`resolving`;return(0,J.jsx)(Pa,{children:(0,J.jsx)(Ma,{interactionId:e.id,isResolving:r,questions:t.questions,threadId:n})})}function La({decision:e,disabled:t,isLoading:n,onClick:r}){return(0,J.jsxs)(P,{type:`button`,size:`sm`,variant:Ra(e),disabled:t,onClick:r,children:[n?(0,J.jsx)(H,{name:`Spinner`,className:`size-3 animate-spin`}):null,Va(e)]})}function Ra(e){switch(e){case`allow_once`:return`default`;case`allow_for_session`:return`outline`;case`deny`:return`ghost`}}function za(e){return!e||`kind`in e?null:e.decision}function Ba({interaction:e,payload:t}){switch(t.subject.kind){case`command`:{let n=t.subject.command,r=n?Cn(n)??n:null,i=R(e).filter(e=>!e.startsWith(`Command: `)).map(e=>e.startsWith(`Cwd: `)?e.slice(5):e);return{title:t.reason??`Do you want to run this command?`,body:r?(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-card`,children:[(0,J.jsxs)(`pre`,{className:A(on(`base`),`overflow-auto whitespace-pre px-3 py-2 font-mono text-xs leading-relaxed text-foreground`),children:[`$ `,r]}),i.length>0?(0,J.jsx)(`ul`,{className:`border-t border-border px-3 py-2 text-xs text-muted-foreground`,children:i.map(e=>(0,J.jsx)(`li`,{children:e},e))}):null]}):null}}case`file_change`:{let n=R(e);return{title:t.reason??`Do you want to make these changes?`,body:n.length>0?(0,J.jsx)(`ul`,{className:`rounded-lg border border-border bg-card px-3 py-2 text-xs text-muted-foreground`,children:n.map(e=>(0,J.jsx)(`li`,{children:e},e))}):null}}case`permission_grant`:{let n=R(e);return{title:t.reason??`Do you want to grant this permission?`,body:n.length>0?(0,J.jsx)(`ul`,{className:`rounded-lg border border-border bg-card px-3 py-2 text-xs text-muted-foreground`,children:n.map(e=>(0,J.jsx)(`li`,{children:e},e))}):null}}default:return re(t.subject)}}function Va(e){switch(e){case`allow_once`:return`Allow once`;case`allow_for_session`:return`Allow for session`;case`deny`:return`Deny`}}var Ha=`rounded-md border border-border bg-surface-recessed`;function Ua({children:e,ariaLabel:t,className:n,style:r}){return t?(0,J.jsx)(`section`,{"aria-label":t,className:A(Ha,n),style:r,children:e}):(0,J.jsx)(`div`,{className:A(Ha,n),style:r,children:e})}var Wa=new Set([`active`,`host-reconnecting`,`waiting-for-host`]);function Ga(e){return Wa.has(e)}var Ka={uncommitted:`Uncommitted`,untracked:`Untracked`,committed:`Committed`},qa={managedBy:{toggle:`thread-prompt-banner-managed-by-toggle`,body:`thread-prompt-banner-managed-by-body`},managerChildren:{toggle:`thread-prompt-banner-manager-children-toggle`,body:`thread-prompt-banner-manager-children-body`},todos:{toggle:`thread-prompt-banner-todos-toggle`,body:`thread-prompt-banner-todos-body`},git:{toggle:`thread-prompt-banner-git-toggle`,body:`thread-prompt-banner-git-body`}},Ja={in_progress:0,pending:1,completed:2};function Ya(e){return e.items.length>0}function Xa(e){if(e.length===0)return null;let t=0;for(let n of e)n.status===`completed`&&(t+=1);return t===0?`${e.length}`:`${t}/${e.length}`}function Za({className:e}){return(0,J.jsx)(H,{name:`ChevronDown`,className:A(`size-3.5 shrink-0 rotate-45`,e),"aria-hidden":`true`})}function Qa({id:e,controlsId:t,ariaLabel:n,icon:r,label:i,isExpanded:a,onToggle:o}){return(0,J.jsxs)(`button`,{type:`button`,id:e,"aria-expanded":a,"aria-controls":t,"aria-label":n,onClick:o,className:A(`flex min-w-0 items-center rounded px-1 py-0.5 text-xs transition-colors hover:bg-state-hover`,i==null?`gap-0`:`gap-1.5`,a?`text-foreground`:`text-muted-foreground`),children:[r,i==null?null:(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:i}),(0,J.jsx)(H,{name:`ChevronDown`,className:A(`size-3.5 shrink-0 text-subtle-foreground transition-transform duration-200`,a&&`rotate-180`),"aria-hidden":`true`})]})}function $a({status:e}){let t=`size-3.5 shrink-0`;switch(e){case`in_progress`:return(0,J.jsx)(H,{name:`Square`,className:A(t,`fill-current text-muted-foreground/30`),"aria-hidden":`true`});case`completed`:return(0,J.jsx)(H,{name:`Check`,className:A(t,`text-muted-foreground/60`),"aria-hidden":`true`});case`pending`:return(0,J.jsx)(H,{name:`Square`,className:A(t,`text-muted-foreground/45`),"aria-hidden":`true`})}}function eo({items:e}){return(0,J.jsx)(`ul`,{className:`max-h-40 space-y-0.5 overflow-y-auto px-3 pb-2 pt-1.5`,children:[...e].sort((e,t)=>Ja[e.status]-Ja[t.status]).map(e=>(0,J.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 py-0.5 text-xs`,children:[(0,J.jsx)($a,{status:e.status}),(0,J.jsx)(`span`,{className:A(`min-w-0 flex-1 truncate`,e.status===`in_progress`&&`font-medium text-foreground`,e.status===`pending`&&`text-muted-foreground`,e.status===`completed`&&`text-subtle-foreground line-through decoration-subtle-foreground`),title:e.text,children:e.text})]},e.id))})}function to({managerName:e,href:t}){return(0,J.jsxs)(`div`,{className:`px-3 pb-2 pt-1.5 text-xs leading-relaxed text-muted-foreground`,children:[`This thread is managed by`,` `,(0,J.jsx)(Ue,{to:t,className:`text-foreground/90 underline-offset-2 hover:underline`,children:e}),`.`]})}function no({items:e}){return(0,J.jsx)(`ul`,{className:`max-h-40 space-y-0.5 overflow-y-auto px-3 pb-2 pt-1.5`,children:e.map(e=>(0,J.jsx)(`li`,{className:`text-xs`,children:(0,J.jsxs)(Ue,{to:e.href,title:e.title,className:`flex min-w-0 items-center gap-2 py-0.5 text-foreground/90 underline-offset-2 hover:underline`,children:[(0,J.jsx)(Za,{className:`text-subtle-foreground no-underline`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title})]})},e.id))})}function ro({id:e,labelledBy:t,isExpanded:n,children:r}){return(0,J.jsx)(`section`,{id:e,role:`region`,"aria-labelledby":t,"aria-hidden":!n,className:A(`grid overflow-hidden transition-[grid-template-rows,opacity,border-color] duration-200 ease-out`,n?`grid-rows-[1fr] border-t border-border opacity-100`:`pointer-events-none grid-rows-[0fr] border-t border-transparent opacity-0`),children:(0,J.jsx)(`div`,{className:`overflow-hidden`,children:r})})}function io({todoSection:e,gitSection:t,gitSectionPending:n,archivedSection:r,managedBySection:i,managerChildrenSection:a,expandedSection:o,onToggleSection:s}){if(n)return null;if(r){let e=o===`managedBy`&&i!==null;return(0,J.jsxs)(Ua,{ariaLabel:`Thread context before sending`,className:`overflow-hidden`,style:{minHeight:32},children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 py-1 text-xs text-muted-foreground`,children:[i?(0,J.jsx)(Qa,{id:qa.managedBy.toggle,controlsId:qa.managedBy.body,ariaLabel:`Managed by ${i.managerName}`,icon:(0,J.jsx)(H,{name:`UserRound`,className:`size-3.5 shrink-0`,"aria-hidden":`true`}),label:null,isExpanded:e,onToggle:()=>s(`managedBy`)}):null,(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 px-1 py-0.5`,children:[(0,J.jsx)(H,{name:`Archive`,className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:`Thread is archived`})]})]}),i?(0,J.jsx)(ro,{id:qa.managedBy.body,labelledBy:qa.managedBy.toggle,isExpanded:e,children:(0,J.jsx)(to,{managerName:i.managerName,href:i.href})}):null]})}let c=e!==null&&Ya(e.pendingTodos),l=t!==null,u=i!==null,d=a!==null&&a.items.length>0;if(!c&&!l&&!u&&!d)return null;let f=c&&e?e.pendingTodos.items:[],p=o===`todos`&&c,m=o===`git`&&l,h=o===`managedBy`&&u,g=o===`managerChildren`&&d,_=l?(0,J.jsxs)(J.Fragment,{children:[c?null:(0,J.jsxs)(J.Fragment,{children:[Ka[t.changedFiles.kind],` · `]}),Si(yi(t.changedFiles.stats))]}):null,v=l&&t.mergeBase?Hn({mergeBaseBranch:t.mergeBase.branch,mergeBaseBranchOptions:t.mergeBase.options}):[],y=u&&!c&&!l&&!d;return(0,J.jsxs)(Ua,{ariaLabel:`Thread context before sending`,className:`overflow-hidden`,style:{minHeight:32},children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 py-1 text-xs text-muted-foreground`,children:[u&&i&&y?(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 px-1 py-0.5`,children:[(0,J.jsx)(H,{name:`UserRound`,className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,J.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Managed by`,` `,(0,J.jsx)(Ue,{to:i.href,className:`text-foreground/90 underline underline-offset-2`,children:i.managerName})]})]}):null,u&&i&&!y?(0,J.jsx)(Qa,{id:qa.managedBy.toggle,controlsId:qa.managedBy.body,ariaLabel:`Managed by ${i.managerName}`,icon:(0,J.jsx)(H,{name:`UserRound`,className:`size-3.5 shrink-0`,"aria-hidden":`true`}),label:null,isExpanded:h,onToggle:()=>s(`managedBy`)}):null,d&&a?(0,J.jsx)(Qa,{id:qa.managerChildren.toggle,controlsId:qa.managerChildren.body,icon:(0,J.jsx)(H,{name:`CircleDashed`,className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),label:`${a.items.length} active managed ${a.items.length===1?`thread`:`threads`}`,isExpanded:g,onToggle:()=>s(`managerChildren`)}):null,c?(0,J.jsx)(Qa,{id:qa.todos.toggle,controlsId:qa.todos.body,icon:(0,J.jsx)(H,{name:`ListTodo`,className:`size-3.5 shrink-0`,"aria-hidden":`true`}),label:Xa(f),isExpanded:p,onToggle:()=>s(`todos`)}):null,l&&_?(0,J.jsx)(Qa,{id:qa.git.toggle,controlsId:qa.git.body,icon:(0,J.jsx)(H,{name:`FileDiff`,className:`size-3.5 shrink-0`,"aria-hidden":`true`}),label:_,isExpanded:m,onToggle:()=>s(`git`)}):null,l&&t.mergeBase?(0,J.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,J.jsx)(`span`,{className:`shrink-0`,children:`Merge base:`}),(0,J.jsx)(Xn,{value:t.mergeBase.branch,options:v,variant:`minimal`,loading:t.mergeBase.optionsLoading,onChange:t.mergeBase.onChange,onOpenChange:t.mergeBase.onPickerOpenChange,className:`max-w-[10rem]`,muted:!0,popoverAlign:`end`})]}):null]}),u&&i&&!y?(0,J.jsx)(ro,{id:qa.managedBy.body,labelledBy:qa.managedBy.toggle,isExpanded:h,children:(0,J.jsx)(to,{managerName:i.managerName,href:i.href})}):null,d&&a?(0,J.jsx)(ro,{id:qa.managerChildren.body,labelledBy:qa.managerChildren.toggle,isExpanded:g,children:(0,J.jsx)(no,{items:a.items})}):null,c?(0,J.jsx)(ro,{id:qa.todos.body,labelledBy:qa.todos.toggle,isExpanded:p,children:(0,J.jsx)(eo,{items:f})}):null,l?(0,J.jsx)(ro,{id:qa.git.body,labelledBy:qa.git.toggle,isExpanded:m,children:(0,J.jsx)(Ei,{files:t.changedFiles.files,className:`max-h-32 px-3 pb-2 pt-1`,onFileClick:e=>t.onPromptBannerFileClick({file:e,section:t.changedFiles})})}):null]})}var ao=ae(de());function oo(){var e=[...arguments];return(0,q.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var so=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function co(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function lo(e){return`nodeType`in e}function uo(e){return e?co(e)?e:lo(e)?e.ownerDocument?.defaultView??window:window:window}function fo(e){let{Document:t}=uo(e);return e instanceof t}function po(e){return co(e)?!1:e instanceof uo(e).HTMLElement}function mo(e){return e instanceof uo(e).SVGElement}function ho(e){return e?co(e)?e.document:lo(e)?fo(e)?e:po(e)||mo(e)?e.ownerDocument:document:document:document}var go=so?q.useLayoutEffect:q.useEffect;function _o(e){let t=(0,q.useRef)(e);return go(()=>{t.current=e}),(0,q.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function vo(){let e=(0,q.useRef)(null);return[(0,q.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,q.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function yo(e,t){t===void 0&&(t=[e]);let n=(0,q.useRef)(e);return go(()=>{n.current!==e&&(n.current=e)},t),n}function bo(e,t){let n=(0,q.useRef)();return(0,q.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function xo(e){let t=_o(e),n=(0,q.useRef)(null);return[n,(0,q.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function So(e){let t=(0,q.useRef)();return(0,q.useEffect)(()=>{t.current=e},[e]),t.current}var Co={};function wo(e,t){return(0,q.useMemo)(()=>{if(t)return t;let n=Co[e]==null?0:Co[e]+1;return Co[e]=n,e+`-`+n},[e,t])}function To(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Eo=To(1),Do=To(-1);function Oo(e){return`clientX`in e&&`clientY`in e}function ko(e){if(!e)return!1;let{KeyboardEvent:t}=uo(e.target);return t&&e instanceof t}function Ao(e){if(!e)return!1;let{TouchEvent:t}=uo(e.target);return t&&e instanceof t}function jo(e){if(Ao(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Oo(e)?{x:e.clientX,y:e.clientY}:null}var Mo=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[Mo.Translate.toString(e),Mo.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),No=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Po(e){return e.matches(No)?e:e.querySelector(No)}var Fo={display:`none`};function Io(e){let{id:t,value:n}=e;return q.createElement(`div`,{id:t,style:Fo},n)}function Lo(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return q.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Ro(){let[e,t]=(0,q.useState)(``);return{announce:(0,q.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var zo=(0,q.createContext)(null);function Bo(e){let t=(0,q.useContext)(zo);(0,q.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Vo(){let[e]=(0,q.useState)(()=>new Set),t=(0,q.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,q.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Ho={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},Uo={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Wo(e){let{announcements:t=Uo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Ho}=e,{announce:a,announcement:o}=Ro(),s=wo(`DndLiveRegion`),[c,l]=(0,q.useState)(!1);if((0,q.useEffect)(()=>{l(!0)},[]),Bo((0,q.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=q.createElement(q.Fragment,null,q.createElement(Io,{id:r,value:i.draggable}),q.createElement(Lo,{id:s,announcement:o}));return n?(0,ao.createPortal)(u,n):u}var Go;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(Go||={});function Ko(){}function qo(e,t){return(0,q.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Jo(){var e=[...arguments];return(0,q.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Yo=Object.freeze({x:0,y:0});function Xo(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Zo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Qo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $o(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function es(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function ts(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var ns=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=ts(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Xo(ts(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Zo)},rs=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=$o(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=$o(r),o=i.reduce((e,t,r)=>e+Xo(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Zo)};function is(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var as=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=is(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Qo)};function os(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ss(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Yo}function cs(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var ls=cs(1);function us(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ds(e,t,n){let r=us(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var fs={ignoreTransform:!1};function ps(e,t){t===void 0&&(t=fs);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=uo(e).getComputedStyle(e);t&&(n=ds(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function ms(e){return ps(e,{ignoreTransform:!0})}function hs(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function gs(e,t){return t===void 0&&(t=uo(e).getComputedStyle(e)),t.position===`fixed`}function _s(e,t){t===void 0&&(t=uo(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function vs(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(fo(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!po(i)||mo(i)||n.includes(i))return n;let a=uo(e).getComputedStyle(i);return i!==e&&_s(i,a)&&n.push(i),gs(i,a)?n:r(i.parentNode)}return e?r(e):n}function ys(e){let[t]=vs(e,1);return t??null}function bs(e){return!so||!e?null:co(e)?e:lo(e)?fo(e)||e===ho(e).scrollingElement?window:po(e)?e:null:null}function xs(e){return co(e)?e.scrollX:e.scrollLeft}function Ss(e){return co(e)?e.scrollY:e.scrollTop}function Cs(e){return{x:xs(e),y:Ss(e)}}var ws;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(ws||={});function Ts(e){return!so||!e?!1:e===document.scrollingElement}function Es(e){let t={x:0,y:0},n=Ts(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Ds={x:.2,y:.2};function Os(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Ds);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Es(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=ws.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=ws.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=ws.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=ws.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function ks(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function As(e){return e.reduce((e,t)=>Eo(e,Cs(t)),Yo)}function js(e){return e.reduce((e,t)=>e+xs(t),0)}function Ms(e){return e.reduce((e,t)=>e+Ss(t),0)}function Ns(e,t){if(t===void 0&&(t=ps),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);ys(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Ps=[[`x`,[`left`,`right`],js],[`y`,[`top`,`bottom`],Ms]],Fs=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=vs(t),r=As(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Ps)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},Is=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Ls(e){let{EventTarget:t}=uo(e);return e instanceof t?e:ho(e)}function Rs(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var zs;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(zs||={});function Bs(e){e.preventDefault()}function Vs(e){e.stopPropagation()}var Hs;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Hs||={});var Us={start:[Hs.Space,Hs.Enter],cancel:[Hs.Esc],end:[Hs.Space,Hs.Enter,Hs.Tab]},Ws=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Hs.Right:return{...n,x:n.x+25};case Hs.Left:return{...n,x:n.x-25};case Hs.Down:return{...n,y:n.y+25};case Hs.Up:return{...n,y:n.y-25}}},Gs=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Is(ho(t)),this.windowListeners=new Is(uo(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(zs.Resize,this.handleCancel),this.windowListeners.add(zs.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(zs.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ns(n),t(Yo)}handleKeyDown(e){if(ko(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Us,coordinateGetter:a=Ws,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Yo;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Do(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Es(n),p=ks(n),m={x:Math.min(i===Hs.Right?p.right-p.width/2:p.right,Math.max(i===Hs.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Hs.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Hs.Down?p.top:p.top+p.height/2,u.y))},h=i===Hs.Right&&!s||i===Hs.Left&&!c,g=i===Hs.Down&&!l||i===Hs.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Hs.Right&&e<=d.x||i===Hs.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===Hs.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Hs.Down&&e<=d.y||i===Hs.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===Hs.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Eo(Do(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Gs.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Us,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Ks(e){return!!(e&&`distance`in e)}function qs(e){return!!(e&&`delay`in e)}var Js=class{constructor(e,t,n){n===void 0&&(n=Ls(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=ho(i),this.documentListeners=new Is(this.document),this.listeners=new Is(n),this.windowListeners=new Is(uo(i)),this.initialCoordinates=jo(r)??Yo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(zs.Resize,this.handleCancel),this.windowListeners.add(zs.DragStart,Bs),this.windowListeners.add(zs.VisibilityChange,this.handleCancel),this.windowListeners.add(zs.ContextMenu,Bs),this.documentListeners.add(zs.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qs(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Ks(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(zs.Click,Vs,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(zs.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=jo(e)??Yo,s=Do(n,o);if(!t&&a){if(Ks(a)){if(a.tolerance!=null&&Rs(s,a.tolerance))return this.handleCancel();if(Rs(s,a.distance))return this.handleStart()}if(qs(a)&&Rs(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Hs.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Ys={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Xs=class extends Js{constructor(e){let{event:t}=e,n=ho(t.target);super(e,Ys,n)}};Xs.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Zs={move:{name:`mousemove`},end:{name:`mouseup`}},Qs;(function(e){e[e.RightClick=2]=`RightClick`})(Qs||={});var $s=class extends Js{constructor(e){super(e,Zs,ho(e.event.target))}};$s.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Qs.RightClick?!1:(r?.({event:n}),!0)}}];var ec={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},tc=class extends Js{constructor(e){super(e,ec)}static setup(){return window.addEventListener(ec.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ec.move.name,e)};function e(){}}};tc.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var nc;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(nc||={});var rc;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(rc||={});function ic(e){let{acceleration:t,activator:n=nc.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=rc.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=oc({delta:d,disabled:!a}),[m,h]=vo(),g=(0,q.useRef)({x:0,y:0}),_=(0,q.useRef)({x:0,y:0}),v=(0,q.useMemo)(()=>{switch(n){case nc.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case nc.DraggableRect:return i}},[n,i,c]),y=(0,q.useRef)(null),b=(0,q.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,q.useMemo)(()=>s===rc.TreeOrder?[...l].reverse():l,[s,l]);(0,q.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=Os(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var ac={x:{[ws.Backward]:!1,[ws.Forward]:!1},y:{[ws.Backward]:!1,[ws.Forward]:!1}};function oc(e){let{delta:t,disabled:n}=e,r=So(t);return bo(e=>{if(n||!r||!e)return ac;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ws.Backward]:e.x[ws.Backward]||i.x===-1,[ws.Forward]:e.x[ws.Forward]||i.x===1},y:{[ws.Backward]:e.y[ws.Backward]||i.y===-1,[ws.Forward]:e.y[ws.Forward]||i.y===1}}},[n,t,r])}function sc(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return bo(e=>t==null?null:r??e??null,[r,t])}function cc(e,t){return(0,q.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var lc;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(lc||={});var uc;(function(e){e.Optimized=`optimized`})(uc||={});var dc=new Map;function fc(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,q.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,q.useRef)(e),d=g(),f=yo(d),p=(0,q.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,q.useRef)(null),h=bo(t=>{if(d&&!n)return dc;if(!t||t===dc||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Fs(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,q.useEffect)(()=>{u.current=e},[e]),(0,q.useEffect)(()=>{d||p()},[n,d]),(0,q.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,q.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case lc.Always:return!1;case lc.BeforeDragging:return n;default:return!n}}}function pc(e,t){return bo(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function mc(e,t){return pc(e,t)}function hc(e){let{callback:t,disabled:n}=e,r=_o(t),i=(0,q.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,q.useEffect)(()=>()=>i?.disconnect(),[i]),i}function gc(e){let{callback:t,disabled:n}=e,r=_o(t),i=(0,q.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,q.useEffect)(()=>()=>i?.disconnect(),[i]),i}function _c(e){return new Fs(ps(e),e)}function vc(e,t,n){t===void 0&&(t=_c);let[r,i]=(0,q.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=hc({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=gc({callback:a});return go(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function yc(e){return ss(e,pc(e))}var bc=[];function xc(e){let t=(0,q.useRef)(e),n=bo(n=>e?n&&n!==bc&&e&&t.current&&e.parentNode===t.current.parentNode?n:vs(e):bc,[e]);return(0,q.useEffect)(()=>{t.current=e},[e]),n}function Sc(e){let[t,n]=(0,q.useState)(null),r=(0,q.useRef)(e),i=(0,q.useCallback)(e=>{let t=bs(e.target);t&&n(e=>e?(e.set(t,Cs(t)),new Map(e)):null)},[]);return(0,q.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=bs(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,Cs(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{bs(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,q.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Eo(e,t),Yo):As(e):Yo,[e,t])}function Cc(e,t){t===void 0&&(t=[]);let n=(0,q.useRef)(null);return(0,q.useEffect)(()=>{n.current=null},t),(0,q.useEffect)(()=>{let t=e!==Yo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Do(e,n.current):Yo}function wc(e){(0,q.useEffect)(()=>{if(!so)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function Tc(e,t){return(0,q.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Ec(e){return(0,q.useMemo)(()=>e?hs(e):null,[e])}var Dc=[];function Oc(e,t){t===void 0&&(t=ps);let[n]=e,r=Ec(n?uo(n):null),[i,a]=(0,q.useState)(Dc);function o(){a(()=>e.length?e.map(e=>Ts(e)?r:new Fs(t(e),e)):Dc)}let s=gc({callback:o});return go(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function kc(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return po(t)?t:e}function Ac(e){let{measure:t}=e,[n,r]=(0,q.useState)(null),i=gc({callback:(0,q.useCallback)(e=>{for(let{target:n}of e)if(po(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=xo((0,q.useCallback)(e=>{let n=kc(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,q.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var jc=[{sensor:Xs,options:{}},{sensor:Gs,options:{}}],Mc={current:{}},Nc={draggable:{measure:ms},droppable:{measure:ms,strategy:lc.WhileDragging,frequency:uc.Optimized},dragOverlay:{measure:ps}},Pc=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Fc={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ko},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Nc,measureDroppableContainers:Ko,windowRect:null,measuringScheduled:!1},Ic={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Ko,draggableNodes:new Map,over:null,measureDroppableContainers:Ko},Lc=(0,q.createContext)(Ic),Rc=(0,q.createContext)(Fc);function zc(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pc}}}function Bc(e,t){switch(t.type){case Go.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Go.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Go.DragEnd:case Go.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Go.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Pc(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Go.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Pc(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Go.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Pc(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Vc(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,q.useContext)(Lc),a=So(r),o=So(n?.id);return(0,q.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!ko(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Po(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Hc(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Uc(e){return(0,q.useMemo)(()=>({draggable:{...Nc.draggable,...e?.draggable},droppable:{...Nc.droppable,...e?.droppable},dragOverlay:{...Nc.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Wc(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,q.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;go(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=ss(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=ys(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Gc=(0,q.createContext)({...Yo,scaleX:1,scaleY:1}),Kc;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Kc||={});var qc=(0,q.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=jc,collisionDetection:o=as,measuring:s,modifiers:c,...l}=e,[u,d]=(0,q.useReducer)(Bc,void 0,zc),[f,p]=Vo(),[m,h]=(0,q.useState)(Kc.Uninitialized),g=m===Kc.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,q.useRef)({initial:null,translated:null}),C=(0,q.useMemo)(()=>_==null?null:{id:_,data:x?.data??Mc,rect:S},[_,x]),w=(0,q.useRef)(null),[T,E]=(0,q.useState)(null),[D,O]=(0,q.useState)(null),k=yo(l,Object.values(l)),A=wo(`DndDescribedBy`,t),j=(0,q.useMemo)(()=>b.getEnabled(),[b]),M=Uc(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:F}=fc(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),I=sc(v,_),L=(0,q.useMemo)(()=>D?jo(D):null,[D]),R=we(),ee=mc(I,M.draggable.measure);Wc({activeNode:_==null?null:v.get(_),config:R.layoutShiftCompensation,initialRect:ee,measure:M.draggable.measure});let te=vc(I,M.draggable.measure,ee),ne=vc(I?I.parentElement:null),re=(0,q.useRef)({activatorEvent:null,active:null,activeNode:I,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),z=b.getNodeFor(re.current.over?.id),B=Ac({measure:M.dragOverlay.measure}),V=B.nodeRef.current??I,ie=g?B.rect??te:null,ae=!!(B.nodeRef.current&&B.rect),oe=yc(ae?null:te),H=Ec(V?uo(V):null),se=xc(g?z??I:null),ce=Oc(se),le=Hc(c,{transform:{x:y.x-oe.x,y:y.y-oe.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:te,containerNodeRect:ne,draggingNodeRect:ie,over:re.current.over,overlayNodeRect:B.rect,scrollableAncestors:se,scrollableAncestorRects:ce,windowRect:H}),ue=L?Eo(L,y):null,de=Sc(se),fe=Cc(de),pe=Cc(de,[te]),me=Eo(le,fe),U=ie?ls(ie,le):null,he=C&&U?o({active:C,collisionRect:U,droppableRects:N,droppableContainers:j,pointerCoordinates:ue}):null,ge=es(he,`id`),[W,_e]=(0,q.useState)(null),ve=os(ae?le:Eo(le,pe),W?.rect??null,te),ye=(0,q.useRef)(null),be=(0,q.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;ye.current=new n({active:w.current,activeNode:i,event:a,options:r,context:re,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,ao.unstable_batchedUpdates)(()=>{r?.(i),h(Kc.Initializing),d({type:Go.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(ye.current),O(a)})},onMove(e){d({type:Go.DragMove,coordinates:e})},onEnd:o(Go.DragEnd),onCancel:o(Go.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=re.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Go.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Go.DragCancel)}w.current=null,(0,ao.unstable_batchedUpdates)(()=>{d({type:e}),h(Kc.Uninitialized),_e(null),E(null),O(null),ye.current=null;let t=e===Go.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),xe=cc(a,(0,q.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,be(n,t))},[v,be]));wc(a),go(()=>{te&&m===Kc.Initializing&&h(Kc.Initialized)},[te,m]),(0,q.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=re.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:me.x,y:me.y},over:i};(0,ao.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[me.x,me.y]),(0,q.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=re.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(ge),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,ao.unstable_batchedUpdates)(()=>{_e(s),a?.(c),f({type:`onDragOver`,event:c})})},[ge]),go(()=>{re.current={activatorEvent:D,active:C,activeNode:I,collisionRect:U,collisions:he,droppableRects:N,draggableNodes:v,draggingNode:V,draggingNodeRect:ie,droppableContainers:b,over:W,scrollableAncestors:se,scrollAdjustedTranslate:me},S.current={initial:ie,translated:U}},[C,I,he,U,v,V,ie,N,b,W,se,me]),ic({...R,delta:y,draggingRect:U,pointerCoordinates:ue,scrollableAncestors:se,scrollableAncestorRects:ce});let Se=(0,q.useMemo)(()=>({active:C,activeNode:I,activeNodeRect:te,activatorEvent:D,collisions:he,containerNodeRect:ne,dragOverlay:B,draggableNodes:v,droppableContainers:b,droppableRects:N,over:W,measureDroppableContainers:P,scrollableAncestors:se,scrollableAncestorRects:ce,measuringConfiguration:M,measuringScheduled:F,windowRect:H}),[C,I,te,D,he,ne,B,v,b,N,W,P,se,ce,M,F,H]),Ce=(0,q.useMemo)(()=>({activatorEvent:D,activators:xe,active:C,activeNodeRect:te,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:W,measureDroppableContainers:P}),[D,xe,C,te,d,A,v,W,P]);return q.createElement(zo.Provider,{value:p},q.createElement(Lc.Provider,{value:Ce},q.createElement(Rc.Provider,{value:Se},q.createElement(Gc.Provider,{value:ve},i)),q.createElement(Vc,{disabled:n?.restoreFocus===!1})),q.createElement(Wo,{...n,hiddenTextDescribedById:A}));function we(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Jc=(0,q.createContext)(null),Yc=`button`,Xc=`Draggable`;function Zc(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=wo(Xc),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,q.useContext)(Lc),{role:p=Yc,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,q.useContext)(g?Gc:Jc),[v,y]=xo(),[b,x]=xo(),S=Tc(o,t),C=yo(n);return go(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,q.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Yc?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Qc(){return(0,q.useContext)(Rc)}var $c=`Droppable`,el={timeout:25};function tl(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=wo($c),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,q.useContext)(Lc),u=(0,q.useRef)({disabled:n}),d=(0,q.useRef)(!1),f=(0,q.useRef)(null),p=(0,q.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...el,...i},_=yo(h??r),v=gc({callback:(0,q.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=xo((0,q.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=yo(t);return(0,q.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,q.useEffect)(()=>(s({type:Go.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Go.UnregisterDroppable,key:a,id:r})),[r]),(0,q.useEffect)(()=>{n!==u.current.disabled&&(s({type:Go.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function nl(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function rl(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function il(e){return e!==null&&e>=0}function al(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ol(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var sl=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=nl(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},cl={scaleX:1,scaleY:1},ll=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...cl}:null}let s=ul(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...cl}:r<t&&r>=a?{x:0,y:o.height+s,...cl}:{x:0,y:0,...cl}};function ul(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var dl=`Sortable`,fl=q.createContext({activeIndex:-1,containerId:dl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sl,disabled:{draggable:!1,droppable:!1}});function pl(e){let{children:t,id:n,items:r,strategy:i=sl,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Qc(),d=wo(dl,n),f=s.rect!==null,p=(0,q.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,q.useRef)(p),v=!al(p,_.current),y=g!==-1&&h===-1||v,b=ol(a);go(()=>{v&&m&&u(p)},[v,p,m,u]),(0,q.useEffect)(()=>{_.current=p},[p]);let x=(0,q.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:rl(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return q.createElement(fl.Provider,{value:x},t)}var ml=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return nl(n,r,i).indexOf(t)},hl=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},gl={duration:200,easing:`ease`},_l=`transform`,vl=Mo.Transition.toString({property:_l,duration:0,easing:`linear`}),yl={roleDescription:`sortable`};function bl(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,q.useState)(null),s=(0,q.useRef)(n);return go(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=ps(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,q.useEffect)(()=>{a&&o(null)},[a]),a}function xl(e){let{animateLayoutChanges:t=hl,attributes:n,disabled:r,data:i,getNewIndex:a=ml,id:o,strategy:s,resizeObserverConfig:c,transition:l=gl}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,q.useContext)(fl),y=Sl(r,p),b=u.indexOf(o),x=(0,q.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,q.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=tl({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:P,setActivatorNodeRef:F,transform:I}=Zc({id:o,data:x,attributes:{...yl,...n},disabled:y.draggable}),L=oo(E,j),R=!!D,ee=R&&!m&&il(f)&&il(g),te=!_&&N,ne=ee?(te&&ee?I:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,re=il(f)&&il(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,z=D?.id,B=(0,q.useRef)({activeId:z,items:u,newIndex:re,containerId:d}),V=u!==B.current.items,ie=t({active:D,containerId:d,isDragging:N,isSorting:R,id:o,index:b,items:u,newIndex:B.current.newIndex,previousItems:B.current.items,previousContainerId:B.current.containerId,transition:l,wasDragging:B.current.activeId!=null}),ae=bl({disabled:!ie,index:b,node:w,rect:C});return(0,q.useEffect)(()=>{R&&B.current.newIndex!==re&&(B.current.newIndex=re),d!==B.current.containerId&&(B.current.containerId=d),u!==B.current.items&&(B.current.items=u)},[R,re,d,u]),(0,q.useEffect)(()=>{if(z===B.current.activeId)return;if(z!=null&&B.current.activeId==null){B.current.activeId=z;return}let e=setTimeout(()=>{B.current.activeId=z},50);return()=>clearTimeout(e)},[z]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:re,items:u,isOver:T,isSorting:R,isDragging:N,listeners:M,node:w,overIndex:g,over:P,setNodeRef:L,setActivatorNodeRef:F,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:ae??ne,transition:oe()};function oe(){if(ae||V&&B.current.newIndex===b)return vl;if(!(te&&!ko(O)||!l)&&(R||ie))return Mo.Transition.toString({...l,property:_l})}}function Sl(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function Cl(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var wl=[Hs.Down,Hs.Right,Hs.Up,Hs.Left],Tl=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(wl.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case Hs.Down:r.top<a.top&&t.push(n);break;case Hs.Up:r.top>a.top&&t.push(n);break;case Hs.Left:r.left>a.left&&t.push(n);break;case Hs.Right:r.left<a.left&&t.push(n);break}});let c=rs({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=es(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=vs(c).some((e,t)=>s[t]!==e),i=El(e,t),a=Dl(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:Do(u,l)}}}};function El(e,t){return!Cl(e)||!Cl(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Dl(e,t){return!Cl(e)||!Cl(t)||!El(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var Ol=220;function kl(e){let t=e.trim();return t.length===0?`Attachment`:Gn(t)}function Al(e){let t=0;for(let n of e)(n.type===`localImage`||n.type===`localFile`)&&(t+=1);return t}function jl(e){let t=e.filter(e=>e.type===`text`).map(e=>e.text.trim()).filter(e=>e.length>0).join(`
6
-
7
- `).trim();if(t.length>0)return t.length<=Ol?t:`${t.slice(0,Ol-1)}...`;let n=Al(e);if(n===1){let t=e.find(e=>e.type===`localImage`||e.type===`localFile`);return t?t.type===`localFile`&&t.name?`Attachment only (${t.name})`:`Attachment only (${kl(t.path)})`:`Attachment only (1 file)`}return n>1?`Attachment only (${n} files)`:`(empty message)`}function Ml(e){return gr(e)}var Nl=(0,q.memo)(function({queuedMessage:e,index:t,isProcessing:n,dragDisabled:r,sendDisabled:i,actionDisabled:a,onSendImmediately:o,onEdit:s,onDelete:c}){let l=(0,q.useMemo)(()=>jl(e.content),[e.content]),u=(0,q.useMemo)(()=>Al(e.content),[e.content]),{attributes:d,isDragging:f,listeners:p,setActivatorNodeRef:m,setNodeRef:h,transform:g,transition:_}=xl({id:e.id,disabled:r});return(0,J.jsx)(`li`,{ref:h,style:{transform:Mo.Transform.toString(g),transition:_},className:A(`px-2.5 py-0.5`,f&&`relative z-10 opacity-80`),children:(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(P,{ref:m,type:`button`,size:`icon`,variant:`ghost`,className:A(`size-6 shrink-0 text-muted-foreground`,!r&&`cursor-grab active:cursor-grabbing`),disabled:r,"aria-label":`Reorder queued message ${t+1}`,title:`Reorder queued message`,...d,...p,children:(0,J.jsx)(H,{name:`CornerDownRight`,className:`size-3.5`})}),(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-xs leading-4`,children:[(0,J.jsx)(`p`,{className:`min-w-0 truncate text-foreground`,title:l,children:l}),u>0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`.`}),(0,J.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:u===1?`1 attachment`:`${u} attachments`})]}):null,n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`.`}),(0,J.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Sending...`})]}):null]})}),(0,J.jsxs)(`div`,{className:`ml-1 flex shrink-0 items-center gap-1`,children:[(0,J.jsx)(P,{type:`button`,size:`sm`,variant:`link`,className:`h-auto px-0 pr-1 text-xs text-muted-foreground underline`,disabled:i||n,onClick:()=>o(e.id),children:n?`Sending...`:`Send now`}),(0,J.jsx)(P,{type:`button`,size:`icon`,variant:`ghost`,className:`size-7 text-muted-foreground`,disabled:a||n,onClick:()=>s(e.id),"aria-label":`Edit queued message ${t+1}`,title:`Edit queued message`,children:(0,J.jsx)(H,{name:`Edit`,className:`size-3.5`})}),(0,J.jsx)(P,{type:`button`,size:`icon`,variant:`ghost`,className:`size-7 text-muted-foreground hover:text-destructive`,disabled:a||n,onClick:()=>c(e.id),"aria-label":`Delete queued message ${t+1}`,title:`Delete queued message`,children:(0,J.jsx)(H,{name:`Trash2`,className:`size-3.5`})})]})]})})});function Pl({queuedMessages:e,sendDisabled:t,actionDisabled:n,processingMessageId:r,onSendImmediately:i,onReorder:a,onEdit:o,onDelete:s}){let c=Jo(qo(Xs,{activationConstraint:{distance:4}}),qo(Gs,{coordinateGetter:Tl})),l=(0,q.useMemo)(()=>e.map(e=>e.id),[e]),u=n||r!==null||e.length<2,d=(0,q.useCallback)(t=>{if(!t.over)return;let n=cr({activeId:String(t.active.id),overId:String(t.over.id),queuedMessages:e});n&&a(n)},[a,e]);return e.length===0?null:(0,J.jsxs)(Ua,{ariaLabel:`Queued messages`,className:`overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-between px-2.5 pb-1 pt-2.5`,children:(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Queued (`,e.length,`)`]})}),(0,J.jsx)(qc,{sensors:c,collisionDetection:ns,onDragEnd:d,children:(0,J.jsx)(pl,{items:l,strategy:ll,children:(0,J.jsx)(`ul`,{children:e.map((e,a)=>(0,J.jsx)(Nl,{queuedMessage:e,index:a,isProcessing:r===e.id,dragDisabled:u,sendDisabled:t,actionDisabled:n,onSendImmediately:i,onEdit:o,onDelete:s},e.id))})})})]})}var Fl=(0,q.memo)(function({environmentLabel:e,environmentHostLabel:t,environmentHostConnected:n,environmentIcon:r,environmentBranchName:i,onCreateNewThreadInWorktree:a}){return!e&&n===void 0?null:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pr-1.5`,children:[e?(0,J.jsx)(xt,{label:`Environment`,value:(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(`span`,{children:e}),t?(0,J.jsxs)(`span`,{className:`hidden text-muted-foreground lg:inline`,children:[`· `,t]}):null,n===void 0?null:(0,J.jsx)(Zt,{connected:n,className:`translate-y-px`})]}),leading:r?(0,J.jsx)(H,{name:r,className:`size-4 shrink-0`}):null,className:`h-6 shrink-0`,muted:!0}):n===void 0?null:(0,J.jsx)(Zt,{connected:n}),i?(0,J.jsxs)(`button`,{type:`button`,className:`hidden min-w-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-state-hover hover:text-foreground md:flex`,title:`Copy branch name: ${i}`,onClick:()=>{Jt(i,{successMessage:`Branch name copied`,errorMessage:`Failed to copy branch name`})},children:[(0,J.jsx)(H,{name:`GitMerge`,className:`size-3.5 shrink-0`}),(0,J.jsx)(`span`,{className:`truncate`,children:i})]}):null,a?(0,J.jsx)(`button`,{type:`button`,"aria-label":`Create new thread in this worktree`,title:`New thread in this worktree`,onClick:a,className:`-ml-1 inline-flex shrink-0 items-center justify-center rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-state-hover hover:text-foreground`,children:(0,J.jsx)(H,{name:`MessageSquarePlus`,className:`size-4`})}):null]})});function Il({visible:e,active:t=!1,onClick:n,className:r,ariaLabel:i=`Scroll to latest event`}){return(0,J.jsx)(`div`,{className:A(`flex h-0 items-center justify-center`,r),children:(0,J.jsx)(`button`,{onClick:n,className:A(`z-20 -mt-20 flex size-8 items-center justify-center rounded-full border border-border bg-surface-scrim backdrop-blur-md transition-all duration-200 hover:bg-state-hover`,e?`translate-y-0 opacity-100`:`pointer-events-none translate-y-2 opacity-0`),"aria-label":i,type:`button`,children:t?(0,J.jsx)(Ll,{}):(0,J.jsx)(H,{name:`ArrowDown`,className:`size-4`})})})}function Ll(){return(0,J.jsxs)(`span`,{className:`flex items-center gap-0.5`,"aria-hidden":!0,children:[(0,J.jsx)(`span`,{className:`size-1 animate-typing-dot rounded-full bg-current [animation-delay:-240ms]`}),(0,J.jsx)(`span`,{className:`size-1 animate-typing-dot rounded-full bg-current [animation-delay:-120ms]`}),(0,J.jsx)(`span`,{className:`size-1 animate-typing-dot rounded-full bg-current`})]})}function Rl({active:e}){let t=te();return t?(0,J.jsx)(Il,{visible:!t.isAtBottom,active:e,onClick:t.scrollToBottom}):null}function zl({onSubmit:e,submission:t,...n}){let r=te(),i=()=>{e(),r?.scrollToBottom()},a=t?.onModifierSubmit===void 0?void 0:()=>{t.onModifierSubmit?.(),r?.scrollToBottom()},o=t===void 0?void 0:{...t,...a?{onModifierSubmit:a}:{}};return(0,J.jsx)(On,{...n,onSubmit:i,submission:o})}var Bl=68,Vl=Bl+32,Hl=(0,q.memo)(function({attachments:e,stack:t,composer:n,environmentSummary:r,contextWindowUsage:i,execution:a,permission:o,mentions:s,zenModeResetKey:c}){let l=n.submitMode,u=l.kind===`queue`,d=l.kind===`ready`||l.kind===`queue`,f=l.kind===`blocked`&&l.reason===`stopping`,p=l.kind===`queue`||l.kind===`stop-only`?l.onStop:void 0,m=p!==void 0,h=(0,q.useRef)(null),g=jn(h),_=n.canSteerSubmit?n.onSteerSubmit:void 0,v=(0,q.useRef)(null),[y,b]=(0,q.useState)(0);(0,q.useLayoutEffect)(()=>{let e=v.current;if(!e)return;let t=e.offsetHeight;b(e=>e===t?e:t)},[t]),(0,q.useEffect)(()=>{let e=v.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0];t&&b(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[]);let x=Math.max(Bl,Vl-y);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Rl,{active:n.threadRuntimeDisplayStatus===`active`}),(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`div`,{ref:v,className:`space-y-2`,children:t}),(0,J.jsx)(zl,{promptBoxRef:h,voice:g,minHeight:x,value:n.message,onChange:n.onChangeMessage,onSubmit:n.onSubmit,history:n.history,placeholder:n.promptPlaceholder,mentionMenuPlacement:`top`,autoFocus:!0,submission:{onStop:p,isSubmitting:n.isFollowUpSubmitting||f,disabled:!d||n.isFollowUpSubmitting,onModifierSubmit:_,title:u?`Queue follow-up (Enter)`:f?`Stopping run...`:`Submit (Enter)`,isRunning:m,mode:`enter`},mentions:s,attachments:e,zenMode:{layout:`thread`,storageKey:null,resetKey:c,resetOnSubmit:!0},footerStart:(0,J.jsx)(gn,{...a})}),(0,J.jsxs)(`div`,{className:`mt-1 flex min-h-6 items-center justify-between gap-2 pl-[15px] pr-3.5`,children:[(0,J.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1`,children:r}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,J.jsx)(Tn,{value:o.value,options:o.options,onChange:o.onChange,supported:o.supported,className:`h-6`}),i?(0,J.jsx)(Rt,{usage:i}):null]})]})]})]})});function Ul(e){return e===`active`||e===`host-reconnecting`}function Wl({hasPromptDraftInput:e,isFollowUpSubmitting:t,isQueueMutationPending:n,queuedMessageCount:r,runtimeDisplayStatus:i,submitModeKind:a}){return i===`active`&&a===`queue`&&!t&&!n&&(r>0||e)}function Gl({input:e,threadId:t,...n}){return e.length===0?null:{id:t,input:e,mode:`auto`,...n.model?{model:n.model}:{},...Yl(n)}}function Kl({input:e,threadId:t}){return e.length===0?null:{id:t,input:e,mode:`steer`}}function ql({input:e,threadId:t,...n}){return e.length===0?null:{id:t,input:e,model:n.model,...Yl(n)}}function Jl({queuedMessages:e,threadId:t}){return e.map(e=>({id:t,mode:`steer`,queuedMessageId:e.id}))}function Yl({permissionMode:e,reasoningLevel:t,serviceTier:n,supportsServiceTier:r}){return{...r&&n?{serviceTier:n}:{},reasoningLevel:t,permissionMode:e}}function Xl(e,t){if(e===`created`||e===`provisioning`)return t?`Hiring manager...`:`Creating thread...`;switch(e){case`waiting-for-host`:return`Host daemon disconnected`;case`host-reconnecting`:return`Waiting for host daemon to reconnect...`;case`error`:return`Retry by sending a follow-up message`;case`idle`:case`active`:return t?`Send a message. @ to mention threads, files, or folders`:`Ask for follow-up changes. @ to mention files, or folders`;default:return re(e)}}function Zl({canUseGitUi:e,composerQueriesEnabled:t,composerQueriesRefetchOnMount:n,composerQueriesStaleTime:r,contextWindowUsage:i,environmentBranchName:a,environmentHostConnected:o,environmentHostLabel:s,environmentIcon:c,environmentLabel:l,onCreateNewThreadInWorktree:u,isEnvironmentActionPending:d,pendingInteractions:f,onChangedFileClick:p,openThreadDiffPanel:m,projectId:h,workspaceChangedFilesSection:g,workspaceStatusPending:_,contextBannerMergeBase:v,pendingTodos:y,managedBySection:b,managerChildrenSection:x,sendMessage:S,thread:C}){let{data:w}=Se(C.id,{enabled:t,refetchOnMount:n,staleTime:r}),{data:T=[]}=Fe(C.id,{enabled:t,refetchOnMount:n,staleTime:r}),E=(0,q.useRef)(new Map);E.current=(0,q.useMemo)(()=>{let e=new Map;for(let t of T)e.set(t.id,t);return e},[T]);let{data:D=[]}=ke(C.id,{enabled:t,refetchOnMount:n,staleTime:r}),O=Pn(),k=vn(),A=mn(),j=qn(),M=Bn(),N=ut(),P=$n({projectId:h,threadId:C.id}),F=ar(h,{threadSuggestionMode:C.type===`manager`?`all`:`managers`,currentThreadId:C.id,currentThreadType:C.type,environmentId:C.environmentId??null}),[I,L]=(0,q.useState)(null),[R,ee]=(0,q.useState)(null),[te,ne]=(0,q.useState)(null),[re,z]=(0,q.useState)(!1),B=(0,q.useMemo)(()=>bn(D),[D]),{selectedProviderId:V,providerOptions:ie,hasMultipleProviders:ae,selectedProviderDisplayName:oe,selectedModel:H,setSelectedModel:se,serviceTier:ce,setServiceTier:le,reasoningLevel:ue,setReasoningLevel:de,permissionMode:fe,setPermissionMode:pe,activeModel:me,modelOptions:U,modelLoadError:he,reasoningOptions:ge,permissionModeOptions:W,supportsPermissionModeSelection:_e,supportsServiceTier:ve,serviceTierSupportByProvider:ye}=fr({enabled:t,environmentId:C.environmentId??void 0,scope:`component-local`,resetKey:C.id,initialProviderId:C.providerId,initialModel:w?.model,initialServiceTier:w?.serviceTier,initialReasoningLevel:w?.reasoningLevel,initialPermissionMode:w?.permissionMode,initialEnvironmentSelectionValue:C.environmentId??void 0}),be=C.runtime.displayStatus,xe=be===`created`,Ce=be===`provisioning`,we=be===`waiting-for-host`,Te=C.stopRequestedAt!==null||M.isPending&&M.variables===C.id,Ee=Pe(f),De=Ee!==null,Oe=O.isPending||k.isPending||A.isPending||j.isPending||re,Ae=S.isPending||d||O.isPending||re,je=(0,q.useCallback)(()=>{M.mutate(C.id)},[M,C.id]),Me=(0,q.useMemo)(()=>Te?{kind:`blocked`,reason:`stopping`}:De?{kind:`blocked`,reason:`pending-interaction`}:xe||Ce?{kind:`blocked`,reason:`provisioning`}:we?{kind:`stop-only`,onStop:je}:be===`active`||be===`host-reconnecting`?{kind:`queue`,onStop:je}:{kind:`ready`},[je,De,xe,Ce,Te,we,be]),Ne=Te?`Stopping thread...`:Xl(be,C.type===`manager`),Ie=(0,q.useMemo)(()=>({text:P.text,attachments:P.attachments}),[P.attachments,P.text]),Le=(0,q.useMemo)(()=>ur(Ie),[Ie]),Re=Wl({hasPromptDraftInput:Le.length>0,isFollowUpSubmitting:Ae,isQueueMutationPending:Oe,queuedMessageCount:T.length,runtimeDisplayStatus:be,submitModeKind:Me.kind}),ze=(0,q.useCallback)(async e=>{if(e.length===0)return;L(null);let t=[];for(let n of e)try{let e=await N.mutateAsync({projectId:h,file:n});P.addAttachment(e)}catch{t.push(n.name)}t.length>0&&L(`Failed to attach: ${t.join(`, `)}`)},[h,P,N]),Be=(0,q.useCallback)(async()=>{let e=Ie,t=Le;if(t.length===0)return;P.clearIfCurrentMatches(e),L(null);let n=Ul(be);try{if(n){let e=ql({threadId:C.id,input:t,model:me?.model??H,supportsServiceTier:ve,serviceTier:ce,reasoningLevel:ue,permissionMode:fe});e&&await O.mutateAsync(e)}else{let e=Gl({threadId:C.id,input:t,model:me?.model??H,supportsServiceTier:ve,serviceTier:ce,reasoningLevel:ue,permissionMode:fe});e&&await S.mutateAsync(e)}}catch(t){P.restoreIfEmpty(e),gt.error(Ht({error:t,fallbackMessage:n?`Failed to queue message.`:`Failed to send follow-up.`}))}},[me?.model,O,Ie,Le,P,ue,fe,H,S,ce,ve,C.id,be]),Ve=(0,q.useCallback)(async()=>{if(!Re)return;let e=Ie,t=Le;if(!(T.length===0&&t.length===0)){z(!0),t.length>0&&P.clearIfCurrentMatches(e),L(null);try{for(let e of Jl({queuedMessages:T,threadId:C.id}))await k.mutateAsync(e);let e=Kl({input:t,threadId:C.id});e&&await S.mutateAsync(e)}catch(t){P.restoreIfEmpty(e),gt.error(Ht({error:t,fallbackMessage:`Failed to send steer.`}))}finally{z(!1)}}},[Re,Ie,Le,P,T,S,k,C.id]),He=(0,q.useCallback)(e=>{E.current.has(e)&&(ne(e),k.mutateAsync({id:C.id,mode:`auto`,queuedMessageId:e}).then(()=>{L(null)}).catch(e=>{gt.error(Ht({error:e,fallbackMessage:`Failed to send queued message.`}))}).finally(()=>{ne(t=>t===e?null:t)}))},[k,C.id]),Ue=(0,q.useCallback)(e=>{let t=E.current.get(e);t&&(ne(e),A.mutateAsync({id:C.id,queuedMessageId:e}).then(()=>{let e=Ml(t.content);P.setDraft(e),L(null)}).catch(e=>{gt.error(Ht({error:e,fallbackMessage:`Failed to edit queued message.`}))}).finally(()=>{ne(t=>t===e?null:t)}))},[A,P,C.id]),We=(0,q.useCallback)(e=>{ne(e),A.mutateAsync({id:C.id,queuedMessageId:e}).catch(e=>{gt.error(Ht({error:e,fallbackMessage:`Failed to delete queued message.`}))}).finally(()=>{ne(t=>t===e?null:t)})},[A,C.id]),Ge=(0,q.useCallback)(e=>{j.mutateAsync({id:C.id,...e}).catch(e=>{gt.error(Ht({error:e,fallbackMessage:`Failed to reorder queued message.`}))})},[j,C.id]),Ke=(0,q.useCallback)(e=>{p(e)},[p]),qe=(0,q.useCallback)(e=>{ee(t=>t===e?null:e)},[]),Je=(0,q.useMemo)(()=>({items:P.attachments,projectId:h,isAttaching:N.isPending,error:I,onAttachFiles:ze,onRemove:P.removeAttachment}),[I,ze,h,P.attachments,P.removeAttachment,N.isPending]),Ye=(0,q.useMemo)(()=>({history:{currentDraft:Ie,entries:B,onSelectEntry:P.setDraft,resetKey:C.id},isFollowUpSubmitting:Ae,message:P.text,onChangeMessage:P.setText,onSteerSubmit:Ve,onSubmit:Be,promptPlaceholder:Ne,canSteerSubmit:Re,submitMode:Me,threadRuntimeDisplayStatus:be}),[Re,Ie,Be,Ve,Ae,P.setDraft,P.setText,P.text,B,Ne,be,Me,C.id]),G=(0,q.useMemo)(()=>({provider:{options:ie,selectedId:V,hasMultiple:ae,displayName:oe},model:{active:me,selected:H,options:U,loadError:he,onChange:se},serviceTier:{value:ce,onChange:le,supported:ve,supportByProvider:ye},reasoning:{value:ue,options:ge,onChange:de}}),[me,ae,he,U,ie,ue,ge,H,oe,V,ce,ye,de,se,le,ve]),Xe=(0,q.useMemo)(()=>({value:fe,options:W,onChange:pe,supported:_e}),[fe,W,pe,_e]),Ze=(0,q.useMemo)(()=>({suggestions:F.suggestions,threadSectionMode:F.threadSectionMode,isLoading:F.isLoading,isError:F.isError,onQueryChange:F.setQuery}),[F.isError,F.isLoading,F.setQuery,F.suggestions,F.threadSectionMode]),Qe=(0,q.useMemo)(()=>l||o!==void 0?(0,J.jsx)(Fl,{environmentLabel:l,environmentHostLabel:s,environmentHostConnected:o,environmentIcon:c,environmentBranchName:a,onCreateNewThreadInWorktree:u}):null,[a,o,s,c,l,u]);return Ee?(0,J.jsx)(Na,{interaction:Ee,threadId:C.id}):(0,J.jsx)(Hl,{attachments:Je,stack:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(io,{todoSection:C.type===`manager`||!y?null:{pendingTodos:y},archivedSection:C.archivedAt===null?null:{archivedAt:C.archivedAt},managedBySection:b,managerChildrenSection:x,gitSection:g?{changedFiles:g,mergeBase:v,onPromptBannerFileClick:e?Ke:()=>{}}:null,gitSectionPending:_,expandedSection:R,onToggleSection:qe}),(0,J.jsx)(Pl,{queuedMessages:T,sendDisabled:!(Me.kind===`ready`||Me.kind===`queue`)||Ae||Oe,actionDisabled:Oe,processingMessageId:te,onSendImmediately:He,onReorder:Ge,onEdit:Ue,onDelete:We})]}),composer:Ye,zenModeResetKey:C.id,environmentSummary:Qe,contextWindowUsage:i??null,execution:G,permission:Xe,mentions:Ze})}var Ql=D((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=I();function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!==`default`){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=n(t),i=typeof window<`u`,a=t.createContext(null);a.displayName=`PanelGroupContext`;var o={group:`data-panel-group`,groupDirection:`data-panel-group-direction`,groupId:`data-panel-group-id`,panel:`data-panel`,panelCollapsible:`data-panel-collapsible`,panelId:`data-panel-id`,panelSize:`data-panel-size`,resizeHandle:`data-resize-handle`,resizeHandleActive:`data-resize-handle-active`,resizeHandleEnabled:`data-panel-resize-handle-enabled`,resizeHandleId:`data-panel-resize-handle-id`,resizeHandleState:`data-resize-handle-state`},s=10,c=i?t.useLayoutEffect:()=>{},l=r.useId,u=typeof l==`function`?l:()=>null,d=0;function f(e=null){let n=u(),r=t.useRef(e||n||null);return r.current===null&&(r.current=``+ d++),e??r.current}function p({children:e,className:n=``,collapsedSize:r,collapsible:i,defaultSize:s,forwardedRef:l,id:u,maxSize:d,minSize:p,onCollapse:m,onExpand:h,onResize:g,order:_,style:v,tagName:y=`div`,...b}){let x=t.useContext(a);if(x===null)throw Error(`Panel components must be rendered within a PanelGroup container`);let{collapsePanel:S,expandPanel:C,getPanelSize:w,getPanelStyle:T,groupId:E,isPanelCollapsed:D,reevaluatePanelConstraints:O,registerPanel:k,resizePanel:A,unregisterPanel:j}=x,M=f(u),N=t.useRef({callbacks:{onCollapse:m,onExpand:h,onResize:g},constraints:{collapsedSize:r,collapsible:i,defaultSize:s,maxSize:d,minSize:p},id:M,idIsFromProps:u!==void 0,order:_});t.useRef({didLogMissingDefaultSizeWarning:!1}),c(()=>{let{callbacks:e,constraints:t}=N.current,n={...t};N.current.id=M,N.current.idIsFromProps=u!==void 0,N.current.order=_,e.onCollapse=m,e.onExpand=h,e.onResize=g,t.collapsedSize=r,t.collapsible=i,t.defaultSize=s,t.maxSize=d,t.minSize=p,(n.collapsedSize!==t.collapsedSize||n.collapsible!==t.collapsible||n.maxSize!==t.maxSize||n.minSize!==t.minSize)&&O(N.current,n)}),c(()=>{let e=N.current;return k(e),()=>{j(e)}},[_,M,k,j]),t.useImperativeHandle(l,()=>({collapse:()=>{S(N.current)},expand:e=>{C(N.current,e)},getId(){return M},getSize(){return w(N.current)},isCollapsed(){return D(N.current)},isExpanded(){return!D(N.current)},resize:e=>{A(N.current,e)}}),[S,C,w,D,M,A]);let P=T(N.current,s);return t.createElement(y,{...b,children:e,className:n,id:M,style:{...P,...v},[o.groupId]:E,[o.panel]:``,[o.panelCollapsible]:i||void 0,[o.panelId]:M,[o.panelSize]:parseFloat(``+P.flexGrow).toFixed(1)})}var m=t.forwardRef((e,n)=>t.createElement(p,{...e,forwardedRef:n}));p.displayName=`Panel`,m.displayName=`forwardRef(Panel)`;var h;function g(){return h}var _=null,v=!0,y=-1,b=null;function x(e,t){if(t){let e=(t&ee)!==0,n=(t&te)!==0,r=(t&ne)!==0,i=(t&re)!==0;if(e)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}switch(e){case`horizontal`:return`ew-resize`;case`intersection`:return`move`;case`vertical`:return`ns-resize`}}function S(){b!==null&&(document.head.removeChild(b),_=null,b=null,y=-1)}function C(e,t){if(!v)return;let n=x(e,t);if(_!==n){if(_=n,b===null){b=document.createElement(`style`);let e=g();e&&b.setAttribute(`nonce`,e),document.head.appendChild(b)}if(y>=0){var r;(r=b.sheet)==null||r.removeRule(y)}y=b.sheet?.insertRule(`*{cursor: ${n} !important;}`)??-1}}function w(e){return e.type===`keydown`}function T(e){return e.type.startsWith(`pointer`)}function E(e){return e.type.startsWith(`mouse`)}function D(e){if(T(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(E(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function O(){if(typeof matchMedia==`function`)return matchMedia(`(pointer:coarse)`).matches?`coarse`:`fine`}function k(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function A(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:L(e),b:L(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;W(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:F(P(n.a)),b:F(P(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var j=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function M(e){let t=getComputedStyle(R(e)??e).display;return t===`flex`||t===`inline-flex`}function N(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||M(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||j.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function P(e){let t=e.length;for(;t--;){let n=e[t];if(W(n,`Missing node`),N(n))return n}return null}function F(e){return e&&Number(getComputedStyle(e).zIndex)||0}function L(e){let t=[];for(;e;)t.push(e),e=R(e);return t}function R(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}var ee=1,te=2,ne=4,re=8,z=O()===`coarse`,B=[],V=!1,ie=new Map,ae=new Map,oe=new Set;function H(e,t,n,r,i){let{ownerDocument:a}=t,o={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},s=ie.get(a)??0;return ie.set(a,s+1),oe.add(o),U(),function(){ae.delete(e),oe.delete(o);let t=ie.get(a)??1;if(ie.set(a,t-1),U(),t===1&&ie.delete(a),B.includes(o)){let e=B.indexOf(o);e>=0&&B.splice(e,1),pe(),i(`up`,!0,null)}}}function se(e){let{target:t}=e,{x:n,y:r}=D(e);V=!0,de({target:t,x:n,y:r}),U(),B.length>0&&(he(`down`,e),e.preventDefault(),ue(t)||e.stopImmediatePropagation())}function ce(e){let{x:t,y:n}=D(e);if(V&&e.buttons===0&&(V=!1,he(`up`,e)),!V){let{target:r}=e;de({target:r,x:t,y:n})}he(`move`,e),pe(),B.length>0&&e.preventDefault()}function le(e){let{target:t}=e,{x:n,y:r}=D(e);ae.clear(),V=!1,B.length>0&&(e.preventDefault(),ue(t)||e.stopImmediatePropagation()),he(`up`,e),de({target:t,x:n,y:r}),pe(),U()}function ue(e){let t=e;for(;t;){if(t.hasAttribute(o.resizeHandle))return!0;t=t.parentElement}return!1}function de({target:e,x:t,y:n}){B.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),oe.forEach(e=>{let{element:i,hitAreaMargins:a}=e,o=i.getBoundingClientRect(),{bottom:s,left:c,right:l,top:u}=o,d=z?a.coarse:a.fine;if(t>=c-d&&t<=l+d&&n>=u-d&&n<=s+d){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&A(r,i)>0){let e=r,t=!1;for(;e&&!e.contains(i);){if(k(e.getBoundingClientRect(),o,!0)){t=!0;break}e=e.parentElement}if(t)return}B.push(e)}})}function fe(e,t){ae.set(e,t)}function pe(){let e=!1,t=!1;B.forEach(n=>{let{direction:r}=n;r===`horizontal`?e=!0:t=!0});let n=0;ae.forEach(e=>{n|=e}),e&&t?C(`intersection`,n):e?C(`horizontal`,n):t?C(`vertical`,n):S()}var me=new AbortController;function U(){me.abort(),me=new AbortController;let e={capture:!0,signal:me.signal};oe.size&&(V?(B.length>0&&ie.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`contextmenu`,le,e),r.addEventListener(`pointerleave`,ce,e),r.addEventListener(`pointermove`,ce,e))}),window.addEventListener(`pointerup`,le,e),window.addEventListener(`pointercancel`,le,e)):ie.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`pointerdown`,se,e),r.addEventListener(`pointermove`,ce,e))}))}function he(e,t){oe.forEach(n=>{let{setResizeHandlerState:r}=n;r(e,B.includes(n),t)})}function ge(){let[e,n]=t.useState(0);return t.useCallback(()=>n(e=>e+1),[])}function W(e,t){if(!e)throw console.error(t),Error(t)}function _e(e,t,n=s){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function ve(e,t,n=s){return _e(e,t,n)===0}function ye(e,t,n){return _e(e,t,n)===0}function be(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!ye(i,a,n))return!1}return!0}function xe({panelConstraints:e,panelIndex:t,size:n}){let r=e[t];W(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:c=0}=r;if(_e(n,c)<0)if(a){let e=(i+c)/2;n=_e(n,e)<0?i:c}else n=c;return n=Math.min(o,n),n=parseFloat(n.toFixed(s)),n}function Se({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(ye(e,0))return t;let o=[...t],[s,c]=r;W(s!=null,`Invalid first pivot index`),W(c!=null,`Invalid second pivot index`);let l=0;if(a===`keyboard`){{let r=e<0?c:s,i=n[r];W(i,`Panel constraints not found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(W(n!=null,`Previous layout not found for panel index ${r}`),ye(n,a)){let t=l-n;_e(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?s:c,i=n[r];W(i,`No panel constraints found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(W(n!=null,`Previous layout not found for panel index ${r}`),ye(n,l)){let t=n-a;_e(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?c:s,a=0;for(;;){let e=t[i];W(e!=null,`Previous layout not found for panel index ${i}`);let o=xe({panelConstraints:n,panelIndex:i,size:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let o=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-o:o}{let r=e<0?s:c;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(l),a=t[r];W(a!=null,`Previous layout not found for panel index ${r}`);let s=a-i,c=xe({panelConstraints:n,panelIndex:r,size:s});if(!ye(a,c)&&(l+=a-c,o[r]=c,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(be(i,o))return i;{let r=e<0?c:s,i=t[r];W(i!=null,`Previous layout not found for panel index ${r}`);let a=i+l,u=xe({panelConstraints:n,panelIndex:r,size:a});if(o[r]=u,!ye(u,a)){let t=a-u,r=e<0?c:s;for(;r>=0&&r<n.length;){let i=o[r];W(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=xe({panelConstraints:n,panelIndex:r,size:a});if(ye(i,s)||(t-=s-i,o[r]=s),ye(t,0))break;e>0?r--:r++}}}return ye(o.reduce((e,t)=>t+e,0),100)?o:i}function Ce({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return W(s!=null,`No pivot index found`),t.forEach((e,t)=>{let{constraints:n}=e,{maxSize:c=100,minSize:l=0}=n;t===s?(r=l,i=c):(a+=l,o+=c)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function we(e,t=document){return Array.from(t.querySelectorAll(`[${o.resizeHandleId}][data-panel-group-id="${e}"]`))}function Te(e,t,n=document){return we(e,n).findIndex(e=>e.getAttribute(o.resizeHandleId)===t)??null}function Ee(e,t,n){let r=Te(e,t,n);return r==null?[-1,-1]:[r,r+1]}function De(e,t=document){return t instanceof HTMLElement&&t?.dataset?.panelGroupId==e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null}function Oe(e,t=document){return t.querySelector(`[${o.resizeHandleId}="${e}"]`)||null}function ke(e,t,n,r=document){let i=Oe(t,r),a=we(e,r),o=i?a.indexOf(i):-1;return[n[o]?.id??null,n[o+1]?.id??null]}function Ae({committedValuesRef:e,eagerValuesRef:n,groupId:r,layout:i,panelDataArray:a,panelGroupElement:s,setLayout:l}){t.useRef({didWarnAboutMissingResizeHandle:!1}),c(()=>{if(!s)return;let e=we(r,s);for(let t=0;t<a.length-1;t++){let{valueMax:n,valueMin:r,valueNow:o}=Ce({layout:i,panelsArray:a,pivotIndices:[t,t+1]}),s=e[t];if(s!=null){let e=a[t];W(e,`No panel data found for index "${t}"`),s.setAttribute(`aria-controls`,e.id),s.setAttribute(`aria-valuemax`,``+Math.round(n)),s.setAttribute(`aria-valuemin`,``+Math.round(r)),s.setAttribute(`aria-valuenow`,o==null?``:``+Math.round(o))}}return()=>{e.forEach((e,t)=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)})}},[r,i,a,s]),t.useEffect(()=>{if(!s)return;let e=n.current;W(e,`Eager values not found`);let{panelDataArray:t}=e;W(De(r,s)!=null,`No group found for id "${r}"`);let a=we(r,s);W(a,`No resize handles found for group id "${r}"`);let c=a.map(e=>{let n=e.getAttribute(o.resizeHandleId);W(n,`Resize handle element has no handle id attribute`);let[a,c]=ke(r,n,t,s);if(a==null||c==null)return()=>{};let u=e=>{if(!e.defaultPrevented)switch(e.key){case`Enter`:{e.preventDefault();let o=t.findIndex(e=>e.id===a);if(o>=0){let e=t[o];W(e,`No panel data found for index ${o}`);let a=i[o],{collapsedSize:c=0,collapsible:u,minSize:d=0}=e.constraints;if(a!=null&&u){let e=Se({delta:ye(a,c)?d-c:c-a,initialLayout:i,panelConstraints:t.map(e=>e.constraints),pivotIndices:Ee(r,n,s),prevLayout:i,trigger:`keyboard`});i!==e&&l(e)}}break}}};return e.addEventListener(`keydown`,u),()=>{e.removeEventListener(`keydown`,u)}});return()=>{c.forEach(e=>e())}},[s,e,n,r,i,a,l])}function je(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Me(e,t){let n=e===`horizontal`,{x:r,y:i}=D(t);return n?r:i}function Ne(e,t,n,r,i){let a=n===`horizontal`,s=Oe(t,i);W(s,`No resize handle element found for id "${t}"`);let c=s.getAttribute(o.groupId);W(c,`Resize handle element has no group id attribute`);let{initialCursorPosition:l}=r,u=Me(n,e),d=De(c,i);W(d,`No group element found for id "${c}"`);let f=d.getBoundingClientRect(),p=a?f.width:f.height;return(u-l)/p*100}function Pe(e,t,n,r,i,a){if(w(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:Ne(e,t,n,r,a)}function Fe({panelDataArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];W(e,`Panel constraints not found for index ${a}`);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];W(o,`Panel constraints not found for index ${a}`);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function Ie(e,t,n){t.forEach((t,r)=>{let i=e[r];W(i,`Panel data not found for index ${r}`);let{callbacks:a,constraints:o,id:s}=i,{collapsedSize:c=0,collapsible:l}=o,u=n[s];if(u==null||t!==u){n[s]=t;let{onCollapse:e,onExpand:r,onResize:i}=a;i&&i(t,u),l&&(e||r)&&(r&&(u==null||ve(u,c))&&!ve(t,c)&&r(),e&&(u==null||!ve(u,c))&&ve(t,c)&&e())}})}function Le(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Re({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e==null?`1`:e.toPrecision(a):r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function ze(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function Be(e){try{if(typeof localStorage<`u`)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error(`localStorage not supported in this environment`)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Ve(e){return`react-resizable-panels:${e}`}function He(e){return e.map(e=>{let{constraints:t,id:n,idIsFromProps:r,order:i}=e;return r?n:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(`,`)}function Ue(e,t){try{let n=Ve(e),r=t.getItem(n);if(r){let e=JSON.parse(r);if(typeof e==`object`&&e)return e}}catch{}return null}function We(e,t,n){return(Ue(e,n)??{})[He(t)]??null}function Ge(e,t,n,r,i){let a=Ve(e),o=He(t),s=Ue(e,i)??{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}function Ke({layout:e,panelConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!ye(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];W(t!=null,`No layout data found for index ${e}`),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];W(r!=null,`No layout data found for index ${e}`);let a=xe({panelConstraints:t,panelIndex:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!ye(i,0))for(let e=0;e<t.length;e++){let r=n[e];W(r!=null,`No layout data found for index ${e}`);let a=r+i,o=xe({panelConstraints:t,panelIndex:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,ye(i,0)))break}return n}var qe=100,Je={getItem:e=>(Be(Je),Je.getItem(e)),setItem:(e,t)=>{Be(Je),Je.setItem(e,t)}},Ye={};function G({autoSaveId:e=null,children:n,className:r=``,direction:i,forwardedRef:s,id:l=null,onLayout:u=null,keyboardResizeBy:d=null,storage:p=Je,style:m,tagName:h=`div`,...g}){let _=f(l),v=t.useRef(null),[y,b]=t.useState(null),[x,S]=t.useState([]),C=ge(),D=t.useRef({}),O=t.useRef(new Map),k=t.useRef(0),A=t.useRef({autoSaveId:e,direction:i,dragState:y,id:_,keyboardResizeBy:d,onLayout:u,storage:p}),j=t.useRef({layout:x,panelDataArray:[],panelDataArrayChanged:!1});t.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),t.useImperativeHandle(s,()=>({getId:()=>A.current.id,getLayout:()=>{let{layout:e}=j.current;return e},setLayout:e=>{let{onLayout:t}=A.current,{layout:n,panelDataArray:r}=j.current,i=Ke({layout:e,panelConstraints:r.map(e=>e.constraints)});je(n,i)||(S(i),j.current.layout=i,t&&t(i),Ie(r,i,D.current))}}),[]),c(()=>{A.current.autoSaveId=e,A.current.direction=i,A.current.dragState=y,A.current.id=_,A.current.onLayout=u,A.current.storage=p}),Ae({committedValuesRef:A,eagerValuesRef:j,groupId:_,layout:x,panelDataArray:j.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),t.useEffect(()=>{let{panelDataArray:t}=j.current;if(e){if(x.length===0||x.length!==t.length)return;let n=Ye[e];n??(n=ze(Ge,qe),Ye[e]=n);let r=[...t],i=new Map(O.current);n(e,r,i,x,p)}},[e,x,p]),t.useEffect(()=>{});let M=t.useCallback(e=>{let{onLayout:t}=A.current,{layout:n,panelDataArray:r}=j.current;if(e.constraints.collapsible){let i=r.map(e=>e.constraints),{collapsedSize:a=0,panelSize:o,pivotIndices:s}=Qe(r,e,n);if(W(o!=null,`Panel size not found for panel "${e.id}"`),!ve(o,a)){O.current.set(e.id,o);let c=Se({delta:Ze(r,e)===r.length-1?o-a:a-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:`imperative-api`});Le(n,c)||(S(c),j.current.layout=c,t&&t(c),Ie(r,c,D.current))}}},[]),N=t.useCallback((e,t)=>{let{onLayout:n}=A.current,{layout:r,panelDataArray:i}=j.current;if(e.constraints.collapsible){let a=i.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=Qe(i,e,r),u=t??c;if(ve(s,o)){let t=O.current.get(e.id),o=t!=null&&t>=u?t:u,c=Se({delta:Ze(i,e)===i.length-1?s-o:o-s,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:`imperative-api`});Le(r,c)||(S(c),j.current.layout=c,n&&n(c),Ie(i,c,D.current))}}},[]),P=t.useCallback(e=>{let{layout:t,panelDataArray:n}=j.current,{panelSize:r}=Qe(n,e,t);return W(r!=null,`Panel size not found for panel "${e.id}"`),r},[]),F=t.useCallback((e,t)=>{let{panelDataArray:n}=j.current;return Re({defaultSize:t,dragState:y,layout:x,panelData:n,panelIndex:Ze(n,e)})},[y,x]),I=t.useCallback(e=>{let{layout:t,panelDataArray:n}=j.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=Qe(n,e,t);return W(a!=null,`Panel size not found for panel "${e.id}"`),i===!0&&ve(a,r)},[]),L=t.useCallback(e=>{let{layout:t,panelDataArray:n}=j.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=Qe(n,e,t);return W(a!=null,`Panel size not found for panel "${e.id}"`),!i||_e(a,r)>0},[]),R=t.useCallback(e=>{let{panelDataArray:t}=j.current;t.push(e),t.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),j.current.panelDataArrayChanged=!0,C()},[C]);c(()=>{if(j.current.panelDataArrayChanged){j.current.panelDataArrayChanged=!1;let{autoSaveId:e,onLayout:t,storage:n}=A.current,{layout:r,panelDataArray:i}=j.current,a=null;if(e){let t=We(e,i,n);t&&(O.current=new Map(Object.entries(t.expandToSizes)),a=t.layout)}a??=Fe({panelDataArray:i});let o=Ke({layout:a,panelConstraints:i.map(e=>e.constraints)});je(r,o)||(S(o),j.current.layout=o,t&&t(o),Ie(i,o,D.current))}}),c(()=>{let e=j.current;return()=>{e.layout=[]}},[]);let z=t.useCallback(e=>{let t=!1,n=v.current;return n&&window.getComputedStyle(n,null).getPropertyValue(`direction`)===`rtl`&&(t=!0),function(n){n.preventDefault();let r=v.current;if(!r)return()=>null;let{direction:i,dragState:a,id:o,keyboardResizeBy:s,onLayout:c}=A.current,{layout:l,panelDataArray:u}=j.current,{initialLayout:d}=a??{},f=Ee(o,e,r),p=Pe(n,e,i,a,s,r),m=i===`horizontal`;m&&t&&(p=-p);let h=u.map(e=>e.constraints),g=Se({delta:p,initialLayout:d??l,panelConstraints:h,pivotIndices:f,prevLayout:l,trigger:w(n)?`keyboard`:`mouse-or-touch`}),_=!Le(l,g);(T(n)||E(n))&&k.current!=p&&(k.current=p,!_&&p!==0?m?fe(e,p<0?ee:te):fe(e,p<0?ne:re):fe(e,0)),_&&(S(g),j.current.layout=g,c&&c(g),Ie(u,g,D.current))}},[]),B=t.useCallback((e,t)=>{let{onLayout:n}=A.current,{layout:r,panelDataArray:i}=j.current,a=i.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=Qe(i,e,r);W(o!=null,`Panel size not found for panel "${e.id}"`);let c=Se({delta:Ze(i,e)===i.length-1?o-t:t-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:`imperative-api`});Le(r,c)||(S(c),j.current.layout=c,n&&n(c),Ie(i,c,D.current))},[]),V=t.useCallback((e,t)=>{let{layout:n,panelDataArray:r}=j.current,{collapsedSize:i=0,collapsible:a}=t,{collapsedSize:o=0,collapsible:s,maxSize:c=100,minSize:l=0}=e.constraints,{panelSize:u}=Qe(r,e,n);u!=null&&(a&&s&&ve(u,i)?ve(i,o)||B(e,o):u<l?B(e,l):u>c&&B(e,c))},[B]),ie=t.useCallback((e,t)=>{let{direction:n}=A.current,{layout:r}=j.current;if(!v.current)return;let i=Oe(e,v.current);W(i,`Drag handle element not found for id "${e}"`);let a=Me(n,t);b({dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r})},[]),ae=t.useCallback(()=>{b(null)},[]),oe=t.useCallback(e=>{let{panelDataArray:t}=j.current,n=Ze(t,e);n>=0&&(t.splice(n,1),delete D.current[e.id],j.current.panelDataArrayChanged=!0,C())},[C]),H=t.useMemo(()=>({collapsePanel:M,direction:i,dragState:y,expandPanel:N,getPanelSize:P,getPanelStyle:F,groupId:_,isPanelCollapsed:I,isPanelExpanded:L,reevaluatePanelConstraints:V,registerPanel:R,registerResizeHandle:z,resizePanel:B,startDragging:ie,stopDragging:ae,unregisterPanel:oe,panelGroupElement:v.current}),[M,y,i,N,P,F,_,I,L,V,R,z,B,ie,ae,oe]),se={display:`flex`,flexDirection:i===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`};return t.createElement(a.Provider,{value:H},t.createElement(h,{...g,children:n,className:r,id:l,ref:v,style:{...se,...m},[o.group]:``,[o.groupDirection]:i,[o.groupId]:_}))}var Xe=t.forwardRef((e,n)=>t.createElement(G,{...e,forwardedRef:n}));G.displayName=`PanelGroup`,Xe.displayName=`forwardRef(PanelGroup)`;function Ze(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function Qe(e,t,n){let r=Ze(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function $e({disabled:e,handleId:n,resizeHandler:r,panelGroupElement:i}){t.useEffect(()=>{if(e||r==null||i==null)return;let t=Oe(n,i);if(t==null)return;let a=e=>{if(!e.defaultPrevented)switch(e.key){case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:case`ArrowUp`:case`End`:case`Home`:e.preventDefault(),r(e);break;case`F6`:{e.preventDefault();let r=t.getAttribute(o.groupId);W(r,`No group element found for id "${r}"`);let a=we(r,i),s=Te(r,n,i);W(s!==null,`No resize element found for id "${n}"`),a[e.shiftKey?s>0?s-1:a.length-1:s+1<a.length?s+1:0].focus();break}}};return t.addEventListener(`keydown`,a),()=>{t.removeEventListener(`keydown`,a)}},[i,e,n,r])}function et({children:e=null,className:n=``,disabled:r=!1,hitAreaMargins:i,id:s,onBlur:l,onClick:u,onDragging:d,onFocus:p,onPointerDown:m,onPointerUp:h,style:g={},tabIndex:_=0,tagName:v=`div`,...y}){let b=t.useRef(null),x=t.useRef({onClick:u,onDragging:d,onPointerDown:m,onPointerUp:h});t.useEffect(()=>{x.current.onClick=u,x.current.onDragging=d,x.current.onPointerDown=m,x.current.onPointerUp=h});let S=t.useContext(a);if(S===null)throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);let{direction:C,groupId:w,registerResizeHandle:T,startDragging:E,stopDragging:D,panelGroupElement:O}=S,k=f(s),[A,j]=t.useState(`inactive`),[M,N]=t.useState(!1),[P,F]=t.useState(null),I=t.useRef({state:A});c(()=>{I.current.state=A}),t.useEffect(()=>{if(r)F(null);else{let e=T(k);F(()=>e)}},[r,k,T]);let L=i?.coarse??15,R=i?.fine??5;t.useEffect(()=>{if(r||P==null)return;let e=b.current;W(e,`Element ref not attached`);let t=!1;return H(k,e,C,{coarse:L,fine:R},(e,n,r)=>{if(!n){j(`inactive`);return}switch(e){case`down`:{j(`drag`),t=!1,W(r,`Expected event to be defined for "down" action`),E(k,r);let{onDragging:e,onPointerDown:n}=x.current;e?.(!0),n?.();break}case`move`:{let{state:e}=I.current;t=!0,e!==`drag`&&j(`hover`),W(r,`Expected event to be defined for "move" action`),P(r);break}case`up`:{j(`hover`),D();let{onClick:e,onDragging:n,onPointerUp:r}=x.current;n?.(!1),r?.(),t||e?.();break}}})},[L,C,r,R,T,k,P,E,D]),$e({disabled:r,handleId:k,resizeHandler:P,panelGroupElement:O});let ee={touchAction:`none`,userSelect:`none`};return t.createElement(v,{...y,children:e,className:n,id:s,onBlur:()=>{N(!1),l?.()},onFocus:()=>{N(!0),p?.()},ref:b,role:`separator`,style:{...ee,...g},tabIndex:_,[o.groupDirection]:C,[o.groupId]:w,[o.resizeHandle]:``,[o.resizeHandleActive]:A===`drag`?`pointer`:M?`keyboard`:void 0,[o.resizeHandleEnabled]:!r,[o.resizeHandleId]:k,[o.resizeHandleState]:A})}et.displayName=`PanelResizeHandle`,e.Panel=m,e.PanelGroup=Xe,e.PanelResizeHandle=et}))(),$l=`uncommitted`;function eu(e,t){if(e===`uncommitted`)return{type:`uncommitted`};if(e)return{type:`commit`,sha:e};if(t)return{type:`all`,mergeBaseBranch:t}}function tu(e,t={hasUncommittedChanges:!1}){let n={value:`all`,label:`All changes`},r={value:$l,label:`Uncommitted changes`},i=e.map(e=>({value:e.sha,label:e.subject,monoPrefix:e.shortSha}));return e.length>0||t.hasUncommittedChanges?[n,...t.hasUncommittedChanges?[r]:[],...i]:[n]}function nu(e,t,n={hasUncommittedChanges:!1}){return e?e===`uncommitted`?!n.hasUncommittedChanges:!t.some(t=>t.sha===e):!1}function ru(e){let t=e.currentGitDiff.trim().length>0,n=Qn(e.currentGitDiff),r=e.parsedGitDiffFileCount>0,i=t&&e.lastParsedGitDiffKey!==n;return{currentGitDiffKey:n,hasCurrentGitDiff:t,hasParsedGitDiffFiles:r,isAwaitingCurrentGitDiffParse:i,isPreparingGitDiff:!r&&(e.isAwaitingPrerequisites||e.isGitDiffLoading||e.isParsingGitDiffFiles||i)}}function iu({entry:e,expectedFileCount:t}){return t>10?!0:It(e.fileDiff)===`deleted`}function au({bulkCollapsePreference:e,currentCollapsedFileKeys:t,expectedFileCount:n,focusedFileKey:r,parsedGitDiffFileEntries:i,previousFileKeys:a}){if(e===`expanded-all`)return new Set;let o=new Set;for(let s of i){if(r!==null){s.key!==r&&o.add(s.key);continue}if(e===`collapsed-all`){o.add(s.key);continue}if(a.has(s.key)){t.has(s.key)&&o.add(s.key);continue}iu({entry:s,expectedFileCount:n})&&o.add(s.key)}return o}function ou(e){let t=Qn(e.gitDiff);if(!e.isDiffPanelActive||e.gitDiff.trim().length===0)return{kind:`reset`,gitDiffKey:t,patchChunks:[]};let n=sn(e.gitDiff);return n.length===0?{kind:`empty`,gitDiffKey:t,patchChunks:[]}:n.length<=24?{kind:`immediate`,gitDiffKey:t,patchChunks:n}:{kind:`batched`,gitDiffKey:t,patchChunks:n}}var su=150,cu=4,lu=6,uu=30,du=70;function fu(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function pu({environmentId:e,gitDiffIdentity:t,expectedGitDiffFileCount:n,parsedGitDiffFileEntries:r,isDiffPanelActive:i,isParsingGitDiffFiles:a}){let o=Cr((0,q.useCallback)(e=>e(ta),[])),s=nt(ta),c=nt(na),l=(0,q.useRef)(new Map),u=(0,q.useRef)(new Map),d=(0,q.useRef)(`default`),f=(0,q.useRef)(null),p=(0,q.useRef)(new Set),m=(0,q.useRef)(new Set),h=(0,q.useRef)(new Map),g=(0,q.useCallback)(e=>{let t=u.current.get(e);if(t===void 0)return;u.current.delete(e);let n=l.current.get(t);n&&(n.delete(e),n.size===0&&(window.clearTimeout(t),l.current.delete(t)))},[]),_=(0,q.useCallback)(()=>{for(let e of l.current.keys())window.clearTimeout(e);l.current.clear(),u.current.clear()},[]);(0,q.useLayoutEffect)(()=>{_(),d.current=`default`,f.current=null,p.current=new Set,m.current.clear(),s(new Set),c(new Set)},[e,t,_,s,c]),(0,q.useEffect)(()=>()=>{_(),m.current.clear()},[_]);let v=(0,q.useCallback)((e,t)=>{if(e.length===0)return;let n=[],r=new Set;for(let t of e)r.has(t)||(r.add(t),n.push(t));if(n.length===0)return;let i=Math.max(1,Math.min(t?.initialBatchSize??n.length,n.length)),a=Math.max(1,t?.batchSize??n.length),o=Math.max(0,t?.initialDelayMs??su),s=Math.max(0,t?.batchDelayMs??su);c(e=>{let t=new Set(e);for(let e of n)t.add(e);return t});for(let e of n)g(e);let d=(e,t)=>{let n=new Set(e),r=0;r=window.setTimeout(()=>{let e=l.current.get(r);if(e){l.current.delete(r);for(let t of e)u.current.delete(t);c(t=>{let n=!1,r=new Set(t);for(let t of e)n=r.delete(t)||n;return n?r:t})}},t),l.current.set(r,n);for(let e of n)u.current.set(e,r)};d(n.slice(0,i),o);let f=0;for(let e=i;e<n.length;e+=a){let t=o+(f+1)*s;d(n.slice(e,e+a),t),f+=1}},[g,c]);(0,q.useLayoutEffect)(()=>{if(!i)return;if(r.length===0&&!a&&n===0){p.current=new Set,m.current.clear(),s(e=>e.size===0?e:new Set),c(e=>e.size===0?e:new Set),_();return}if(r.length===0)return;let e=new Set(r.map(({key:e})=>e));f.current!==null&&!e.has(f.current)&&(f.current=null);for(let t of m.current)e.has(t)||m.current.delete(t);let t=au({bulkCollapsePreference:d.current,currentCollapsedFileKeys:o(),expectedFileCount:n,focusedFileKey:f.current,parsedGitDiffFileEntries:r,previousFileKeys:p.current});p.current=e,s(e=>fu(e,t)?e:t);let l=[];for(let{key:e}of r)m.current.has(e)||(m.current.add(e),t.has(e)||l.push(e));l.length!==0&&v(l,n>10||a||l.length>cu?{initialBatchSize:cu,initialDelayMs:uu,batchSize:lu,batchDelayMs:du}:void 0)},[_,n,o,t,i,a,r,v,s,c]);let y=(0,q.useCallback)(e=>{d.current=`default`,f.current=null;let t=o().has(e);if(s(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),t){v([e]);return}g(e),c(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[g,v,s,c,o]),b=(0,q.useCallback)(e=>{if(r.length===0)return;let t=r.map(({key:e})=>e);if(!t.includes(e))return;d.current=`default`,f.current=e,m.current.add(e);let n=o().has(e);for(let n of t)n!==e&&g(n);s(new Set(t.filter(t=>t!==e))),c(t=>{let n=!1,r=new Set(t);for(let i of t)i!==e&&(n=r.delete(i)||n);return n?r:t}),n&&v([e])},[g,o,r,v,s,c]),x=(0,q.useCallback)(()=>{if(r.length===0)return;let e=r.map(({key:e})=>e),t=o();if(e.every(e=>t.has(e))){d.current=`expanded-all`,f.current=null,s(new Set),v(e);return}d.current=`collapsed-all`,f.current=null,_(),s(new Set(e)),c(new Set)},[_,r,v,s,c,o]),S=(0,q.useCallback)((e,t)=>{if(t){h.current.set(e,t);return}h.current.delete(e)},[]);return{focusGitDiffFile:b,gitDiffFileRefs:h,queuedGitDiffFileRenderKeys:m.current,setGitDiffFileRef:S,toggleAllGitDiffFilesCollapsed:x,toggleGitDiffFileCollapsed:y}}function mu({environmentId:e,isDiffPanelActive:t,defaultMergeBaseBranch:n}){let r=ct(ra),i=ct(ia),a=nt(ia),o=ct(ta),s=ct(na),c=(0,q.useRef)(null),[l,d]=(0,q.useState)(null),[f,p]=(0,q.useState)([]),g=(0,q.useRef)([]),[_,v]=(0,q.useState)(0),[y,b]=(0,q.useState)(!1),[x,S]=(0,q.useState)(``),C=(0,q.useRef)(``),[w,T]=(0,q.useState)(null),E=r??n,D=(0,q.useMemo)(()=>eu(l,E),[E,l]),O=(0,q.useMemo)(()=>gu({environmentId:e,target:D}),[e,D]),{data:k}=hi(e??``,E,{enabled:!!e&&!!E&&t}),{data:A,isLoading:j,isPlaceholderData:M,error:N}=vi(e??``,{enabled:!!e&&t&&D!==void 0,target:D});(0,q.useEffect)(()=>{if(A&&!M){T(e=>e?.requestIdentity===O&&e.response===A?e:{requestIdentity:O,response:A});return}j||T(e=>e?.requestIdentity===O?e:null)},[A,O,j,M]);let P=A&&!M?A:w?.requestIdentity===O?w.response:void 0,F=P?.mergeBaseRef??null,I=(0,q.useMemo)(()=>hu({environmentId:e,mergeBaseRef:F,target:D}),[F,e,D]),L=P?.diff??``,R=(0,q.useMemo)(()=>an(f),[f]),{focusGitDiffFile:ee,gitDiffFileRefs:te,queuedGitDiffFileRenderKeys:ne,setGitDiffFileRef:re,toggleAllGitDiffFilesCollapsed:z,toggleGitDiffFileCollapsed:B}=pu({environmentId:e,gitDiffIdentity:I,expectedGitDiffFileCount:_,parsedGitDiffFileEntries:R,isDiffPanelActive:t,isParsingGitDiffFiles:y}),V=ru({currentGitDiff:L,isAwaitingPrerequisites:t&&!!e&&D===void 0,isGitDiffLoading:j,isParsingGitDiffFiles:y,lastParsedGitDiffKey:x,parsedGitDiffFileCount:R.length});(0,q.useEffect)(()=>{let e=ou({gitDiff:L,isDiffPanelActive:t});if(e.kind===`reset`){g.current=[],p([]),v(0),b(!1),C.current=``,S(``);return}if(e.kind===`empty`){g.current=[],p([]),v(0),b(!1),C.current=e.gitDiffKey,S(e.gitDiffKey);return}if(e.kind===`immediate`){let t=Pt(L);g.current=t,p(t),v(e.patchChunks.length),b(!1),C.current=e.gitDiffKey,S(e.gitDiffKey);return}let n=e.patchChunks,r=g.current.length>0&&C.current!==e.gitDiffKey,i=[],a=!1,o=null,s=0,c=!1,l=()=>{if(a)return;let t=s===0?6:18,u=n.slice(s,s+t);if(u.length===0){b(!1),C.current=e.gitDiffKey,S(e.gitDiffKey);return}let d=ln(u);if(!a){if(s+=u.length,r?i=[...i,...d]:p(e=>{let t=c?[...e,...d]:d;return g.current=t,t}),c=!0,s>=n.length||a){r&&(g.current=i,p(i),v(e.patchChunks.length)),b(!1),C.current=e.gitDiffKey,S(e.gitDiffKey);return}o=window.setTimeout(l,24)}};return r||(g.current=[],p([]),v(e.patchChunks.length)),b(!0),l(),()=>{a=!0,o!==null&&window.clearTimeout(o)}},[L,t]),(0,q.useEffect)(()=>{d(null)},[e]),(0,q.useEffect)(()=>{a(null)},[e,a]),(0,q.useEffect)(()=>{i&&d(null)},[i]);let ie=(k?.workingTree.files.length??0)>0;(0,q.useEffect)(()=>{nu(l,k?.mergeBase?.commits??[],{hasUncommittedChanges:ie})&&d(null)},[k?.mergeBase?.commits,ie,l]),(0,q.useLayoutEffect)(()=>{if(!i||!t){c.current=null;return}let e=R.find(({fileDiff:e})=>kt(e,i));if(!e){!j&&!y&&!V.isAwaitingCurrentGitDiffParse&&a(null);return}if(c.current!==i){c.current=i,ee(e.key);return}let n=o.has(e.key),r=!ne.has(e.key)||s.has(e.key);n||r||(te.current.get(e.key)?.scrollIntoView({block:`start`,behavior:`instant`}),a(null))},[o,ee,te,V.isAwaitingCurrentGitDiffParse,t,j,y,s,R,i,ne,a]);let ae=(0,q.useMemo)(()=>k?.mergeBase?.commits??[],[k?.mergeBase?.commits]),oe=l??`all`,H=(0,q.useMemo)(()=>tu(ae,{hasUncommittedChanges:ie}),[ae,ie]),se=(0,q.useMemo)(()=>un(y?[]:f,L),[L,y,f]),{hasParsedGitDiffFiles:ce,isPreparingGitDiff:le}=V,ue=(0,q.useCallback)(e=>{d(e===`all`?null:e)},[]),de=m(),fe=(0,q.useMemo)(()=>vu(D,F),[D,F]);return{currentGitDiff:L,gitDiffError:N,gitDiffSelectOptions:H,gitDiffSelectValue:oe,gitDiffStats:se,hasParsedGitDiffFiles:ce,isGitDiffLoading:j,isParsingGitDiffFiles:y,isPreparingGitDiff:le,onGitDiffSelectionChange:ue,onRequestFileContents:(0,q.useMemo)(()=>{if(!e||fe===void 0)return;let t=e,n=fe,r=_u(n);return async(e,i)=>{let a=await de.fetchQuery({queryKey:u(t,n.type,r,e,i),queryFn:()=>h(t,n,e,i),staleTime:5e3});return yu(e,a.content,a.contentEncoding)}},[e,fe,de]),parsedGitDiffFileEntries:R,queuedGitDiffFileRenderKeys:ne,setGitDiffFileRef:re,threadGitDiff:P,toggleAllGitDiffFilesCollapsed:z,toggleGitDiffFileCollapsed:B}}function hu({environmentId:e,mergeBaseRef:t,target:n}){let r=e??`none`;if(!n)return`${r}:none`;switch(n.type){case`uncommitted`:return`${r}:uncommitted`;case`branch_committed`:return[r,`branch_committed`,n.mergeBaseBranch,t??`pending`].join(`:`);case`all`:return[r,`all`,n.mergeBaseBranch,t??`pending`].join(`:`);case`commit`:return`${r}:commit:${n.sha}`;default:return n}}function gu({environmentId:e,target:t}){let n=e??`none`;if(!t)return`${n}:none`;switch(t.type){case`uncommitted`:return`${n}:uncommitted`;case`branch_committed`:return[n,`branch_committed`,t.mergeBaseBranch].join(`:`);case`all`:return[n,`all`,t.mergeBaseBranch].join(`:`);case`commit`:return`${n}:commit:${t.sha}`;default:return t}}function _u(e){switch(e.type){case`uncommitted`:return null;case`branch_committed`:case`all`:return e.mergeBaseRef;case`commit`:return e.sha;default:return e}}function vu(e,t){if(e)switch(e.type){case`uncommitted`:return{type:`uncommitted`};case`branch_committed`:return t?{type:`branch_committed`,mergeBaseRef:t}:void 0;case`all`:return t?{type:`all`,mergeBaseRef:t}:void 0;case`commit`:return{type:`commit`,sha:e.sha};default:return e}}function yu(e,t,n){return n===`utf8`?{name:e,contents:t}:null}var bu=760;function xu({isSecondaryPanelOpen:e}){let[t,n]=(0,q.useState)(`unified`),[r,i]=(0,q.useState)(!1),a=nt($i),o=ct(ea),s=nt(ea),c=(0,q.useRef)(null),l=(0,q.useRef)(null),u=(0,q.useRef)(o),d=(0,q.useRef)(null),f=(0,q.useRef)(!1),p=(0,q.useCallback)(t=>{if(!e||t===void 0)return;let r=t>=bu,i=d.current,a=i!==null&&i!==r;if(a&&f.current&&(f.current=!1),!f.current||a){let e=r?`split`:`unified`;n(t=>t===e?t:e)}d.current=r},[e,n]),m=(0,q.useRef)(e);(0,q.useEffect)(()=>{if(m.current===e)return;m.current=e;let t=l.current;t&&(e?(t.expand(u.current),p(c.current?.getBoundingClientRect().width)):t.collapse())},[e,p]),(0,q.useEffect)(()=>{e||(f.current=!1,d.current=null)},[e]),Kn({ref:c,onResize:({width:e})=>{p(e??c.current?.getBoundingClientRect().width)}});let h=(0,q.useCallback)(e=>{f.current=!0,n(e)},[n]),g=(0,q.useCallback)(()=>{i(!1),a(!1),u.current>0&&s(u.current)},[a,s]),_=(0,q.useCallback)(e=>{if(e){i(!0),a(!0),f.current=!1;return}g()},[g,a]);return(0,q.useEffect)(()=>{if(r)return window.addEventListener(`pointerup`,g,!0),window.addEventListener(`pointercancel`,g,!0),window.addEventListener(`blur`,g),()=>{window.removeEventListener(`pointerup`,g,!0),window.removeEventListener(`pointercancel`,g,!0),window.removeEventListener(`blur`,g)}},[g,r]),{gitDiffDisplayMode:t,handleGitDiffDisplayModeChange:h,handleSecondaryPanelDragging:_,handleSecondaryPanelResize:(0,q.useCallback)(e=>{e<=0||(u.current=e)},[]),persistedWidthPercent:o,secondaryPanelRef:c,secondaryResizablePanelRef:l}}var Su=`20rem`;function Cu({value:e,options:t,onChange:n,disabled:r,panelWidthPx:i}){let a=t.find(t=>t.value===e),o=a?.label??e,s=a?.monoPrefix;return(0,J.jsxs)(he,{children:[(0,J.jsx)(ge,{asChild:!0,disabled:r,children:(0,J.jsxs)(P,{type:`button`,variant:`ghost`,size:`sm`,disabled:r,className:A(`h-8 w-full min-w-0 justify-between gap-2 rounded-lg border border-border bg-transparent px-2.5 text-xs font-normal`,r&&`opacity-60`),children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[s?(0,J.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:s}):null,(0,J.jsx)(`span`,{className:`truncate`,children:o})]}),(0,J.jsx)(H,{name:`ChevronDown`,className:`size-3.5 shrink-0 text-muted-foreground`})]})}),(0,J.jsx)(pe,{align:`start`,className:`min-w-[var(--radix-dropdown-menu-trigger-width)]`,style:{maxWidth:`min(var(--radix-popper-available-width), max(${Su}, ${i}px))`},children:t.map(t=>(0,J.jsxs)(_e,{onSelect:()=>n(t.value),className:`flex items-center justify-between gap-2`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,title:t.monoPrefix?`${t.monoPrefix} ${t.label}`:t.label,children:[t.monoPrefix?(0,J.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:t.monoPrefix}):null,(0,J.jsx)(`span`,{className:`truncate`,children:t.label})]}),(0,J.jsx)(H,{name:`Check`,className:A(fe,t.value===e?`opacity-100`:`opacity-0`)})]},t.value))})]})}function wu({selectionValue:e,selectionOptions:t,onSelectionChange:n,isSelectorDisabled:r,stats:i,isParsing:a,areAllFilesCollapsed:o,isCollapseAllDisabled:s,onToggleAllCollapsed:c,displayMode:l,onDisplayModeChange:u}){let d=(0,q.useRef)(null),{width:f=0}=Kn({ref:d,box:`content-box`});return(0,J.jsx)(`div`,{ref:d,className:`px-4 pb-3`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,J.jsx)(Cu,{value:e,options:t,onChange:n,disabled:r,panelWidthPx:f})}),(0,J.jsx)(`span`,{className:`min-w-0 shrink truncate text-xs text-muted-foreground`,title:xi(i),children:Si(i)}),a?(0,J.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(H,{name:`Spinner`,className:`size-3 animate-spin`}),`Parsing`]}):null,(0,J.jsxs)(`div`,{className:`ml-auto flex min-w-0 shrink-0 items-center justify-end gap-1`,children:[(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 w-7 rounded-md p-0 text-muted-foreground`,onClick:c,disabled:s,"aria-label":o?`Expand all files`:`Collapse all files`,title:o?`Expand all files`:`Collapse all files`,children:o?(0,J.jsx)(H,{name:`ChevronsDown`,className:`size-3.5`}):(0,J.jsx)(H,{name:`ChevronsUp`,className:`size-3.5`})}),(0,J.jsxs)(`div`,{className:`inline-flex items-center gap-1 rounded-lg border border-border p-0.5`,role:`tablist`,"aria-label":`Diff view mode`,children:[(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 w-7 rounded-md p-0 text-muted-foreground`,onClick:()=>u(`unified`),"aria-label":`Stacked diff view`,"aria-pressed":l===`unified`,title:`Stacked diff view`,children:(0,J.jsx)(H,{name:`Rows2`,className:`size-3.5`})}),(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 w-7 rounded-md p-0 text-muted-foreground`,onClick:()=>u(`split`),"aria-label":`Split diff view`,"aria-pressed":l===`split`,title:`Split diff view`,children:(0,J.jsx)(H,{name:`Columns2`,className:`size-3.5`})})]})]})]})})}var Tu=new Set([`md`,`mdx`,`markdown`]),Eu={"--diffs-font-size":`12px`,"--diffs-line-height":`18px`,"--diffs-gap-block":`16px`},Du={"--md-content-w":`100cqi`},Ou={width:`100%`,height:`100%`,border:0};function ku(e){let t=e.split(`.`).pop()?.toLowerCase();return t!==void 0&&Tu.has(t)}function Au({state:e,path:t,copyPath:n=null,onOpenInEditor:r,statusLabel:i=null}){let a=e.kind===`ready`&&ku(e.file.name),[o,s]=(0,q.useState)(`preview`);return(0,q.useEffect)(()=>{s(`preview`)},[t]),(0,J.jsxs)(`div`,{className:e.kind===`html`||e.kind===`iframe`?`@container/page flex h-full min-h-0 flex-col`:`@container/page`,style:Du,children:[(0,J.jsx)(Mu,{path:t,copyPath:n,onOpenInEditor:r,statusLabel:i,markdownMode:a?o:null,onMarkdownModeChange:s}),(0,J.jsx)(ju,{state:e,path:t,markdownMode:a?o:`preview`})]})}function ju({state:e,path:t,markdownMode:n}){return e.kind===`loading`?(0,J.jsx)(zu,{}):e.kind===`empty`?(0,J.jsx)(Bu,{message:`Empty file.`}):e.kind===`not-found`?(0,J.jsx)(Bu,{message:`File not found.`,role:`alert`}):e.kind===`manager-status-pending`?(0,J.jsx)(Bu,{message:`Manager hasn't written a status yet.`}):e.kind===`error`?(0,J.jsx)(Bu,{message:e.message??`Failed to load file`,role:e.message===void 0?`alert`:void 0}):e.kind===`image`?(0,J.jsx)(Pu,{url:e.url,alt:t}):e.kind===`html`?(0,J.jsx)(Fu,{file:e.file}):e.kind===`iframe`?(0,J.jsx)(Iu,{title:e.title,url:e.url}):ku(e.file.name)&&n===`preview`?(0,J.jsx)(Nu,{file:e.file}):(0,J.jsx)(Vu,{file:e.file,lineNumber:e.lineNumber??null})}function Mu({path:e,copyPath:t,onOpenInEditor:n,statusLabel:r,markdownMode:i,onMarkdownModeChange:a}){return(0,J.jsxs)(`div`,{className:`sticky top-0 z-10`,children:[(0,J.jsxs)(`div`,{className:`flex h-9 items-center gap-2 border-b border-border bg-background px-4`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,J.jsx)(sr,{className:`min-w-0 font-mono text-xs font-medium leading-5 text-foreground`,title:e,children:e}),r===null?null:(0,J.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-muted-foreground`,children:[`(`,r,`)`]}),t===null?null:(0,J.jsx)(cn,{text:t,label:`Copy file path`,className:`shrink-0 rounded-md hover:bg-state-hover hover:text-foreground`}),n?(0,J.jsx)(`button`,{type:`button`,onClick:()=>n(e),"aria-label":`Open in editor`,title:`Open in editor`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-state-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:(0,J.jsx)(H,{name:`ExternalLink`,"aria-hidden":!0,className:`size-3`})}):null]}),i===null?null:(0,J.jsxs)(`div`,{className:`ml-auto inline-flex shrink-0 items-center gap-0.5 rounded-md border border-border p-0.5`,role:`tablist`,"aria-label":`Markdown view mode`,children:[(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-5 rounded-sm px-2 text-xs text-muted-foreground`,onClick:()=>a(`preview`),"aria-pressed":i===`preview`,title:`Rendered preview`,children:`Preview`}),(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-5 rounded-sm px-2 text-xs text-muted-foreground`,onClick:()=>a(`source`),"aria-pressed":i===`source`,title:`Markdown source`,children:`Raw`})]})]}),(0,J.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 top-full h-4 bg-gradient-to-b from-background to-transparent`})]})}function Nu({file:e}){return(0,J.jsx)(`div`,{className:`px-4 pt-4`,children:(0,J.jsx)(Lt,{allowHtml:!0,content:e.contents})})}function Pu({url:e,alt:t}){return(0,J.jsx)(`div`,{className:`pt-4`,children:(0,J.jsx)(`img`,{src:e,alt:t,className:`block max-h-[34rem] w-full object-contain`})})}function Fu({file:e}){return(0,J.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,J.jsx)(`iframe`,{title:e.name,srcDoc:e.contents,style:Ou})})}function Iu({title:e,url:t}){return(0,J.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,J.jsx)(`iframe`,{title:e,src:t,style:Ou})})}function Lu(e){let t=e.querySelectorAll(`[data-file-preview-target-line]`);for(let e of t)e.removeAttribute(`data-file-preview-target-line`),e.removeAttribute(`data-selected-line`)}function Ru(e,t){let n=e.querySelectorAll(`[data-line="${t}"]`);for(let e of n)if(e instanceof HTMLElement&&e.dataset.lineIndex!==void 0)return e;for(let e of n)if(e instanceof HTMLElement)return e;return null}function zu(){return(0,J.jsxs)(`div`,{className:`space-y-2 px-4 pt-4`,"aria-busy":!0,children:[(0,J.jsx)(kn,{className:`h-3 w-3/4 rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-full rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-5/6 rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-2/3 rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-full rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-3/5 rounded-sm`})]})}function Bu({message:e,role:t}){return(0,J.jsx)(`p`,{role:t,className:`mx-4 mt-4 rounded-lg border border-dashed border-border bg-surface-raised px-3 py-6 text-center text-sm text-muted-foreground`,children:e})}function Vu({file:e,lineNumber:t}){let n=Ft(),r=(0,q.useRef)(null),i=(0,q.useMemo)(()=>({themeType:n,overflow:`scroll`,disableFileHeader:!0,enableLineSelection:t!==null}),[t,n]),a=(0,q.useMemo)(()=>t===null?null:{start:t,end:t},[t]);return(0,q.useEffect)(()=>{let e=r.current,n=null,i=null,a=0;function o(){n=window.requestAnimationFrame(s),i=window.setTimeout(s,16)}function s(){let e=r.current;if(!e||(Lu(e),Lu(e.ownerDocument.body),t===null))return;let n=Ru(e,t)??Ru(e.ownerDocument.body,t);if(n){n.setAttribute(`data-file-preview-target-line`,``),n.setAttribute(`data-selected-line`,`single`),n.scrollIntoView?.({block:`center`});return}a+=1,a<8&&o()}return s(),()=>{e&&(Lu(e),Lu(e.ownerDocument.body)),n!==null&&window.cancelAnimationFrame(n),i!==null&&window.clearTimeout(i)}},[e.contents,e.name,t]),(0,J.jsx)(`div`,{ref:r,style:Eu,"data-file-preview-line-number":t??void 0,children:(0,J.jsx)(jr,{file:e,options:i,selectedLines:a})})}var Hu=`STATUS`;function Uu(e){return e===`STATUS`||e===`STATUS/index.html`||e===`STATUS.md`||e===`STATUS.html`}function Wu(e){return Uu(e)?Hu:e}function Gu(e){return Hu}function Ku({activePath:e,copyPath:t=null,error:n,filePreview:r,isLoading:i,lineNumber:a=null,onOpenInEditor:o,pendingNotFoundPath:s,statusLabel:c=null}){if(n){let r=n instanceof d&&n.status===404;return r&&e===s?(0,J.jsx)(Au,{path:e,copyPath:t,onOpenInEditor:o,statusLabel:c,state:{kind:`manager-status-pending`}}):(0,J.jsx)(Au,{path:e,copyPath:t,onOpenInEditor:o,statusLabel:c,state:{kind:r?`not-found`:`error`}})}return i||!r||r.path!==e?(0,J.jsx)(Au,{path:e,copyPath:t,onOpenInEditor:o,statusLabel:c,state:{kind:`loading`}}):r.kind===`text`?r.content.length===0?(0,J.jsx)(Au,{path:e,copyPath:t,onOpenInEditor:o,statusLabel:c,state:{kind:`empty`}}):(0,J.jsx)(Au,{path:e,copyPath:t,onOpenInEditor:o,statusLabel:c,state:{kind:`ready`,lineNumber:a,file:{name:r.name??e,contents:r.content}}}):r.kind===`image`?(0,J.jsx)(Au,{path:e,copyPath:t,onOpenInEditor:o,statusLabel:c,state:{kind:`image`,url:r.url}}):(0,J.jsx)(Au,{path:e,copyPath:t,onOpenInEditor:o,statusLabel:c,state:{kind:`error`,message:`Preview not available for ${r.mimeType}.`}})}function qu({activePath:e,copyPath:t,error:n,filePreview:r,isLoading:i,lineNumber:a,onOpenInEditor:o,pinnedPath:s,threadId:c}){let l=Uu(e),u=we(c,{enabled:l});return l?(0,J.jsx)(Au,{path:e,copyPath:t,state:{kind:`iframe`,title:`Manager status`,url:S(c,u.data?.hash)}}):(0,J.jsx)(Ku,{activePath:e,copyPath:t,error:n,filePreview:r,isLoading:i,lineNumber:a,onOpenInEditor:o,pendingNotFoundPath:s})}var Ju=3,Yu=`min-h-0 flex-1 overflow-x-hidden overflow-y-auto`;function Xu({count:e=Ju}){return(0,J.jsx)(`div`,{className:`space-y-2 pt-2`,children:Array.from({length:e}).map((e,t)=>(0,J.jsxs)(`div`,{className:`rounded-lg border border-border bg-surface-raised`,children:[(0,J.jsx)(`div`,{className:`border-b border-border bg-surface-recessed px-3 py-1.5`,children:(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,J.jsx)(kn,{className:`size-4 shrink-0 rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-48 max-w-full rounded-sm`})]}),(0,J.jsx)(kn,{className:`h-3 w-14 shrink-0 rounded-sm`})]})}),(0,J.jsxs)(`div`,{className:`space-y-1.5 px-2.5 py-2`,children:[(0,J.jsx)(kn,{className:`h-3 w-full rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-[94%] rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-[90%] rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-[86%] rounded-sm`})]})]},`git-diff-skeleton-${t}`))})}var Zu=(0,q.memo)(function({fileKey:e,fileDiff:t,diffViewOptions:n,filePathRoot:r,onOpenFileInEditor:i,onOpenFilePreview:a,isCollapsed:o,isRendering:s,setGitDiffFileRef:c,toggleGitDiffFileCollapsed:l,onRequestFileContents:u}){return(0,J.jsx)(en,{fileDiff:t,diffViewOptions:n,filePathRoot:r,onOpenFileInEditor:i,onOpenFilePreview:a,isCollapsed:o,onToggleCollapsed:(0,q.useCallback)(()=>{l(e)},[e,l]),stickyHeader:!0,isRendering:s,cardRef:(0,q.useCallback)(t=>{c(e,t)},[e,c]),onRequestFileContents:u})});function Qu({collapsedGitDiffFileKeys:e,currentGitDiff:t,gitDiffError:n,gitDiffViewOptions:r,isParsingGitDiffFiles:i,isPreparingGitDiff:a,loadingGitDiffFileKeys:o,onOpenFileInEditor:s,onOpenFilePreview:c,onRequestFileContents:l,parsedGitDiffFileEntries:u,queuedGitDiffFileRenderKeys:d,setGitDiffFileRef:f,threadGitDiff:p,toggleGitDiffFileCollapsed:m,workspaceRootPath:h}){let g=t.trim().length>0;return(0,J.jsx)(`div`,{className:A(Yu,`px-4 pb-3`),children:a?(0,J.jsx)(Xu,{}):n?(0,J.jsx)(`p`,{className:`rounded-lg border border-surface-destructive-border bg-surface-destructive px-3 py-2 text-xs text-destructive`,children:n.message}):p&&g?(0,J.jsxs)(J.Fragment,{children:[u.length>0?(0,J.jsxs)(`div`,{className:`space-y-2`,children:[u.map(({key:t,fileDiff:n})=>(0,J.jsx)(Zu,{fileKey:t,fileDiff:n,diffViewOptions:r,filePathRoot:h,onOpenFileInEditor:s,onOpenFilePreview:c,isCollapsed:e.has(t),isRendering:!d.has(t)||o.has(t),setGitDiffFileRef:f,toggleGitDiffFileCollapsed:m,onRequestFileContents:l},t)),i?(0,J.jsx)(`div`,{className:`rounded-lg border border-border bg-surface-raised px-3 py-3`,children:(0,J.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,J.jsx)(kn,{className:`h-3 w-52 max-w-full rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 w-5/6 rounded-sm`})]})}):null]}):(0,J.jsx)(`pre`,{className:`overflow-auto whitespace-pre rounded-lg border border-border bg-surface-raised p-3 font-mono text-xs text-foreground`,children:p.diff}),p.truncated?(0,J.jsx)(`p`,{className:`pt-2 text-xs text-muted-foreground`,children:`Diff output was truncated for display.`}):null]}):(0,J.jsx)(`p`,{className:`rounded-lg border border-dashed border-border bg-surface-raised px-3 py-6 text-center text-sm text-muted-foreground`,children:`No diff to display.`})})}function $u({metadataContent:e}){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-4 pb-3`,children:e})}function ed({activePath:e,copyPath:t=null,environmentId:n,lineNumber:r,onOpenInEditor:i,source:a,statusLabel:o}){let{data:s,error:c,isLoading:l}=_i(n,e,a);return(0,J.jsx)(Ku,{activePath:e,copyPath:t,error:c,filePreview:s,isLoading:l,lineNumber:r,onOpenInEditor:i,statusLabel:o})}function td({activePath:e,environmentId:t,lineNumber:n,onOpenInEditor:r,threadId:i}){let{data:a,error:o,isLoading:s}=Ne(i,t,e);return(0,J.jsx)(Ku,{activePath:e,error:o,filePreview:a,isLoading:s,lineNumber:n,onOpenInEditor:r,statusLabel:null})}function nd({activePath:e,copyPath:t=null,isManagerThread:n,onOpenInEditor:r,pinnedPath:i,threadId:a}){let o=Uu(e),{data:s,error:c,isLoading:l}=Te(a,e,{enabled:n&&!o});return(0,J.jsx)(qu,{activePath:e,copyPath:t,error:c,filePreview:s,isLoading:l,onOpenInEditor:r,pinnedPath:i,threadId:a})}var rd=24,id=70,ad=`duration-[220ms] ease-[cubic-bezier(0.32,0.72,0,1)]`,od=`min-h-0 flex-1 overflow-x-hidden overflow-y-auto`,sd={pointerEvents:`auto`};function cd({activePanel:e,canUseGitUi:t,defaultMergeBaseBranch:n,environmentId:r,metadataContent:i,fileTabs:a,fileTabContent:o,isOpen:s,showGitDiffTab:c=!0,onPanelFocus:l,onPanelChange:u,onCollapse:d,onClose:f,onOpenNewTab:p,workspaceRootPath:m,onOpenFileInEditor:h,onOpenFilePreview:g,renderAsDrawer:_}){let v=a?.find(e=>e.isActive)!==void 0,y=_?`X`:`PanelRight`,{gitDiffDisplayMode:b,handleGitDiffDisplayModeChange:x,handleSecondaryPanelDragging:S,handleSecondaryPanelResize:C,persistedWidthPercent:w,secondaryPanelRef:T,secondaryResizablePanelRef:E}=xu({isSecondaryPanelOpen:s}),D=!t&&e===`git-diff`?`thread-info`:e,O=D===`git-diff`,{currentGitDiff:k,gitDiffError:j,gitDiffSelectOptions:M,gitDiffSelectValue:N,gitDiffStats:F,hasParsedGitDiffFiles:I,isGitDiffLoading:L,isParsingGitDiffFiles:R,isPreparingGitDiff:ee,onGitDiffSelectionChange:te,onRequestFileContents:ne,parsedGitDiffFileEntries:re,queuedGitDiffFileRenderKeys:z,setGitDiffFileRef:B,threadGitDiff:V,toggleAllGitDiffFilesCollapsed:ie,toggleGitDiffFileCollapsed:ae}=mu({environmentId:r,isDiffPanelActive:O,defaultMergeBaseBranch:n}),oe=ct(ta),se=ct(na),ce=ct($i),le=(0,q.useMemo)(()=>I&&re.every(({key:e})=>oe.has(e)),[oe,I,re]),ue=Ft(),de=(0,q.useMemo)(()=>({...jt,diffStyle:b,themeType:ue}),[b,ue]),fe=(0,J.jsxs)(`aside`,{ref:T,"aria-hidden":!s,onFocusCapture:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||l()},className:A(`flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,ce&&`[&_iframe]:pointer-events-none`,!_&&[`transition-[transform,opacity,background-color]`,ad,s?`opacity-100`:`pointer-events-none translate-x-[8%] opacity-0`]),children:[(0,J.jsxs)(`div`,{className:`bg-background`,children:[(0,J.jsxs)(`div`,{className:`flex h-12 min-w-0 items-center justify-between gap-2 px-4`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,role:`tablist`,"aria-label":`Secondary panel views`,children:[(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 rounded-md p-0`,onClick:()=>u(`thread-info`),"aria-label":`Show thread info panel`,"aria-pressed":D===`thread-info`&&!v,title:`Info`,children:(0,J.jsx)(H,{name:`Info`})}),c===!1?null:(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 rounded-md p-0`,onClick:()=>u(`git-diff`),"aria-label":`Show diff panel`,"aria-pressed":O&&!v,title:`Diff`,children:(0,J.jsx)(H,{name:`FileDiff`})}),a&&a.length>0?(0,J.jsx)(`div`,{className:`flex min-w-0 items-center gap-1 overflow-x-auto`,children:a.map(e=>(0,J.jsx)(ud,{tab:e},e.id))}):null,(0,J.jsx)(ld,{onOpenNewTab:p})]}),(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0 rounded-md p-0`,onClick:f,"aria-label":_?`Close secondary panel`:`Hide secondary panel`,title:_?`Close secondary panel`:`Hide secondary panel`,children:(0,J.jsx)(H,{name:y})})]}),O&&!v?(0,J.jsx)(wu,{selectionValue:N,selectionOptions:M,onSelectionChange:te,isSelectorDisabled:L||V===void 0,stats:F,isParsing:R,areAllFilesCollapsed:le,isCollapseAllDisabled:!I||L,onToggleAllCollapsed:ie,displayMode:b,onDisplayModeChange:x}):null]}),(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:v?(0,J.jsx)(`div`,{className:A(od,`pb-3`),children:o??(0,J.jsx)(`p`,{className:`mx-4 rounded-lg border border-dashed border-border bg-surface-raised px-3 py-6 text-center text-sm text-muted-foreground`,children:`No file preview content provided.`})}):O?(0,J.jsx)(Qu,{collapsedGitDiffFileKeys:oe,currentGitDiff:k,gitDiffError:j instanceof Error?j:j?Error(`Failed to load git diff`):null,gitDiffViewOptions:de,isParsingGitDiffFiles:R,isPreparingGitDiff:ee,loadingGitDiffFileKeys:se,onOpenFileInEditor:h,onOpenFilePreview:g,onRequestFileContents:ne,parsedGitDiffFileEntries:re,queuedGitDiffFileRenderKeys:z,setGitDiffFileRef:B,threadGitDiff:V,toggleGitDiffFileCollapsed:ae,workspaceRootPath:m}):(0,J.jsx)($u,{metadataContent:i})})]});return _?fe:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(dd,{isOpen:s,onDragging:S}),(0,J.jsx)(Ql.Panel,{ref:E,id:`thread-detail-secondary-panel`,collapsible:!0,collapsedSize:0,defaultSize:s?w:0,minSize:rd,maxSize:id,onCollapse:d,onResize:C,order:2,style:sd,className:A(`min-w-0 overflow-hidden transition-[flex-grow,flex-basis,opacity]`,ad,s?`opacity-100`:`opacity-0`),children:fe})]})}function ld({onOpenNewTab:e}){return(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 rounded-md p-0`,onClick:e,"aria-label":`Open a new tab`,title:`New tab`,children:(0,J.jsx)(H,{name:`Plus`})})}function ud({tab:e}){let t=e.statusLabel===null?e.filename:`${e.filename} (${e.statusLabel})`;return(0,J.jsx)(ya,{label:e.filename,secondaryLabel:e.statusLabel===null?null:`(${e.statusLabel})`,title:t,isActive:e.isActive,onSelect:e.onSelect,labelMaxWidthClass:`max-w-[160px]`,closeAction:e.isPinned?null:{onClose:e.onClose,closeLabel:`Close ${e.filename}`,closeTooltip:`Close tab`}})}function dd({isOpen:e,onDragging:t}){let n=ct($i);return(0,J.jsx)(Ql.PanelResizeHandle,{id:`thread-detail-secondary-panel-handle`,disabled:!e,onDragging:t,className:A(`group relative shrink-0 cursor-col-resize overflow-visible bg-transparent transition-[width,opacity,background-color] before:absolute before:inset-y-0 before:-left-1.5 before:-right-1.5 before:content-['']`,ad,e?`w-px opacity-100`:`pointer-events-none w-0 opacity-0`,n&&`bg-accent/20`),"aria-label":`Resize thread and secondary panels`,children:(0,J.jsx)(`span`,{className:A(`pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-border transition-colors`,n?`bg-accent-foreground/50`:`group-hover:bg-accent-foreground/35`)})})}var fd=`file-tree-container`,pd=`data-file-tree-style`,md=`data-file-tree-unsafe-css`,hd=`data-file-tree-scrollbar-measure`,gd=`data-file-tree-scrollbar-gutter-measured`,_d=`--trees-scrollbar-gutter-measured`,vd=`header`,yd=`context-menu`,bd=`context-menu-trigger`,xd=typeof window>`u`?q.useEffect:q.useLayoutEffect;function Sd(e,t,n){let r=e==null?null:(0,J.jsx)(`div`,{slot:vd,children:e}),i=t!=null&&n!=null?(0,J.jsx)(`div`,{slot:yd,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,J.jsxs)(J.Fragment,{children:[r,i]})}function Cd(e,t){return typeof window>`u`&&t!=null?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,J.jsx)(J.Fragment,{children:e})}function wd(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 Td(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 Ed({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(null),u=(0,q.useRef)(n.getComposition()),d=(0,q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,q.useCallback)(()=>{s(null)},[]),m=(0,q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,q.useMemo)(()=>Td(h,e,f,p,m),[h,p,m,f,e]),_=(0,q.useCallback)(e=>{l(e)},[]);(0,q.useEffect)(()=>{f||s(null)},[f]),xd(()=>{n.setComposition(g)},[g,n]),xd(()=>{if(c!=null)return r!=null&&wd(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=Cd(Sd(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,J.jsx)(fd,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var Dd=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
8
- <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
9
- <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06" fill="currentcolor"/>
10
- </symbol>
11
- <symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
12
- <circle cx="3" cy="3" r="3" />
13
- </symbol>
14
- <symbol id="file-tree-icon-file" viewBox="0 0 16 16">
15
- <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=".5"/>
16
- <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"/>
17
- </symbol>
18
- <symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
19
- <path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
20
- </symbol>
21
- <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
22
- <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" />
23
- </symbol>
24
- </svg>`,Od=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
25
- <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"/>
26
- <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"/>
27
- </symbol>`,kd=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
28
- <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"/>
29
- </symbol>`,Ad=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
30
- <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"/>
31
- <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"/>
32
- </symbol>`,jd=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
33
- <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"/>
34
- </symbol>`,Md=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
35
- <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"/>
36
- <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"/>
37
- </symbol>`,Nd=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
38
- <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"/>
39
- <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"/>
40
- <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"/>
41
- </symbol>`,Pd=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
42
- <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"/>
43
- </symbol>`,Fd=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
44
- <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"/>
45
- </symbol>`,Id=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
46
- <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"/>
47
- <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"/>
48
- </symbol>`,Ld=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
49
- <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"/>
50
- <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"/>
51
- <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"/>
52
- </symbol>`,Rd=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
53
- <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"/>
54
- <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"/>
55
- </symbol>`,zd=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
56
- <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"/>
57
- <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"/>
58
- </symbol>`,Bd=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
59
- <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"/>
60
- <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"/>
61
- </symbol>`,Vd=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
62
- <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"/>
63
- </symbol>`,Hd=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
64
- <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"/>
65
- </symbol>`,Ud=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
66
- <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"/>
67
- </symbol>`,Wd=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
68
- <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"/>
69
- </symbol>`,Gd=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
70
- <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"/>
71
- <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"/>
72
- </symbol>`,Kd=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
73
- <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"/>
74
- <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"/>
75
- </symbol>`,qd=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
76
- <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"/>
77
- <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"/>
78
- </symbol>`,Jd=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
79
- <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"/>
80
- </symbol>`,Yd=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
81
- <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
82
- </symbol>`,Xd=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
83
- <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"/>
84
- <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"/>
85
- </symbol>`,Zd=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
86
- <defs>
87
- <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
88
- <stop stop-color="currentColor"/>
89
- <stop offset="1" stop-color="currentColor" stop-opacity="0"/>
90
- </linearGradient>
91
- </defs>
92
- <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
93
- <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
94
- <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
95
- </symbol>`,Qd=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
96
- <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"/>
97
- <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
98
- </symbol>`,$d=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
99
- <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"/>
100
- </symbol>`,ef=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
101
- <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"/>
102
- </symbol>`,tf=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
103
- <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
104
- <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
105
- <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
106
- <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
107
- </symbol>`,nf=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
108
- <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"/>
109
- <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"/>
110
- </symbol>`,rf=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
111
- <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"/>
112
- <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"/>
113
- </symbol>`,af=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
114
- <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"/>
115
- </symbol>`,of=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
116
- <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"/>
117
- </symbol>`,sf=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
118
- <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"/>
119
- </symbol>`,cf=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
120
- <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"/>
121
- <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
122
- </symbol>`,lf=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
123
- <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"/>
124
- </symbol>`,uf=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
125
- <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"/>
126
- <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"/>
127
- </symbol>`,df=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
128
- <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"/>
129
- <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"/>
130
- </symbol>`,ff=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
131
- <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"/>
132
- </symbol>`,pf=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
133
- <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"/>
134
- <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"/>
135
- </symbol>`,mf=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
136
- <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"/>
137
- </symbol>`,hf=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
138
- <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"/>
139
- </symbol>`,gf=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
140
- <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"/>
141
- <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"/>
142
- </symbol>`,_f=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
143
- <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"/>
144
- <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"/>
145
- </symbol>`,vf=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
146
- <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"/>
147
- </symbol>`,yf=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
148
- <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"/>
149
- <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"/>
150
- <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"/>
151
- </symbol>`,bf=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
152
- <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
153
- <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
154
- </symbol>`,xf=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
155
- <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"/>
156
- <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"/>
157
- <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"/>
158
- </symbol>`,Sf=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
159
- <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"/>
160
- <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"/>
161
- </symbol>`,Cf=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
162
- <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"/>
163
- </symbol>`,wf=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
164
- <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"/>
165
- <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"/>
166
- </symbol>`,Tf=[Ad,Id,Ld,Rd,Vd,Hd,Ud,Gd,Kd,qd,Jd,Yd,Xd,nf,af,of,ff,pf,gf,_f,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
167
- <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"/>
168
- <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"/>
169
- </symbol>`],Ef=[Od,kd,jd,Md,Nd,Pd,Fd,zd,Bd,Wd,Zd,Qd,$d,ef,tf,rf,sf,cf,lf,uf,df,mf,hf,vf,yf,bf,xf,Sf,Cf,wf];function Df(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
170
- `)}\n</svg>`)}var Of=Df(Dd,Tf),kf={minimal:Dd,standard:Of,complete:Df(Of,Ef)},Af={".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`},jf={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,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`,htm:`html`,html:`html`,icns:`image`,ico:`image`,ini:`text`,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`,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`},Mf={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},Nf=new Set([`bash`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),Pf=new Set([`complete`]);function Ff(e){return kf[e===`none`?`minimal`:e]}function If(e){return`file-tree-builtin-${e}`}function Lf(e){return e!==`none`&&Pf.has(e)}function Rf(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=Af[t.toLowerCase()];if(i!=null&&(r||Nf.has(i)))return i;for(let e of n){if(r){let t=Mf[e];if(t!=null)return t}let t=jf[e];if(t!=null&&(r||Nf.has(t)))return t}return`default`}function zf(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function Bf(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(zf(e)?`none`:`complete`),colored:e.colored??!0}}var Vf={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Hf(e,t){if(typeof e==`number`)return{itemHeight:t??Vf.default.itemHeight,factor:e};let n=Vf[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Uf=Vf.default.itemHeight,Wf=`@layer base, theme, unsafe;
171
-
172
- @layer base {
173
- :host {
174
- /*
175
- CSS variables use a fallback stack to ensure user and theme colors slot
176
- in with ease. User colors take precedence over theme colors, which take
177
- precedence over defaults.
178
-
179
- Fallback order:
180
-
181
- 1. --trees-*-override (explicit)
182
- 2. --trees-theme-* (e.g. Shiki/VS Code tokens)
183
- 3. defaults
184
-
185
- Theme variable names mirror Shiki/VS Code theme file JSON tokens.
186
-
187
- // Available CSS Color Overrides
188
- --trees-fg-override
189
- --trees-fg-muted-override
190
- --trees-bg-override
191
- --trees-bg-muted-override
192
- --trees-accent-override
193
- --trees-border-color-override
194
-
195
- --trees-focus-ring-color-override
196
- --trees-focus-ring-width-override
197
- --trees-focus-ring-offset-override
198
-
199
- --trees-search-fg-override
200
- --trees-search-font-weight-override
201
- --trees-search-bg-override
202
-
203
- --trees-selected-fg-override
204
- --trees-selected-bg-override
205
- --trees-selected-focused-border-color-override
206
-
207
- // Git Status Color Overrides
208
- --trees-status-added-override
209
- --trees-status-ignored-override
210
- --trees-status-modified-override
211
- --trees-status-renamed-override
212
- --trees-status-untracked-override
213
- --trees-status-deleted-override
214
- --trees-git-added-color-override
215
- --trees-git-ignored-color-override
216
- --trees-git-modified-color-override
217
- --trees-git-renamed-color-override
218
- --trees-git-untracked-color-override
219
- --trees-git-deleted-color-override
220
-
221
- // Built-in File Icon Color Overrides
222
- --trees-file-icon-color
223
- --trees-file-icon-color-astro
224
- --trees-file-icon-color-babel
225
- --trees-file-icon-color-bash
226
- --trees-file-icon-color-biome
227
- --trees-file-icon-color-bootstrap
228
- --trees-file-icon-color-browserslist
229
- --trees-file-icon-color-bun
230
- --trees-file-icon-color-claude
231
- --trees-file-icon-color-css
232
- --trees-file-icon-color-database
233
- --trees-file-icon-color-default
234
- --trees-file-icon-color-docker
235
- --trees-file-icon-color-eslint
236
- --trees-file-icon-color-git
237
- --trees-file-icon-color-go
238
- --trees-file-icon-color-graphql
239
- --trees-file-icon-color-html
240
- --trees-file-icon-color-image
241
- --trees-file-icon-color-javascript
242
- --trees-file-icon-color-json
243
- --trees-file-icon-color-markdown
244
- --trees-file-icon-color-mcp
245
- --trees-file-icon-color-npm
246
- --trees-file-icon-color-oxc
247
- --trees-file-icon-color-postcss
248
- --trees-file-icon-color-prettier
249
- --trees-file-icon-color-python
250
- --trees-file-icon-color-react
251
- --trees-file-icon-color-ruby
252
- --trees-file-icon-color-rust
253
- --trees-file-icon-color-sass
254
- --trees-file-icon-color-svg
255
- --trees-file-icon-color-svelte
256
- --trees-file-icon-color-svgo
257
- --trees-file-icon-color-swift
258
- --trees-file-icon-color-table
259
- --trees-file-icon-color-text
260
- --trees-file-icon-color-tailwind
261
- --trees-file-icon-color-terraform
262
- --trees-file-icon-color-typescript
263
- --trees-file-icon-color-vite
264
- --trees-file-icon-color-vscode
265
- --trees-file-icon-color-vue
266
- --trees-file-icon-color-wasm
267
- --trees-file-icon-color-webpack
268
- --trees-file-icon-color-yml
269
- --trees-file-icon-color-zig
270
- --trees-file-icon-color-zip
271
-
272
- // Density
273
- //
274
- // A unitless scale factor for padding, gaps, and indentation. Usually
275
- // set via \`density\` on useFileTree. Individual overrides take precedence.
276
- //
277
- // Compact: 0.8
278
- // Default: 1
279
- // Relaxed: 1.2
280
- //
281
- --trees-density-override
282
-
283
- // Available CSS Layout Overrides
284
- --trees-gap-override
285
- --trees-border-radius-override
286
- --trees-font-family-override
287
- --trees-font-size-override
288
- --trees-font-weight-regular-override
289
- --trees-font-weight-semibold-override
290
- --trees-level-gap-override
291
- --trees-item-padding-x-override
292
- --trees-item-margin-x-override
293
- --trees-item-row-gap-override
294
- --trees-icon-width-override
295
- --trees-icon-nudge-override
296
- --trees-scrollbar-gutter-override
297
- --trees-padding-inline-override
298
- */
299
-
300
- --trees-accent: var(--trees-accent-override, #009fff);
301
- --trees-fg: var(
302
- --trees-fg-override,
303
- var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
304
- );
305
- --trees-fg-muted: var(
306
- --trees-fg-muted-override,
307
- var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
308
- );
309
- --trees-bg: var(
310
- --trees-bg-override,
311
- var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
312
- );
313
- /* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
314
- --trees-bg-muted: var(
315
- --trees-bg-muted-override,
316
- var(
317
- --trees-theme-list-hover-bg,
318
- light-dark(
319
- color-mix(
320
- in lab,
321
- var(--trees-accent) var(--trees-bg-alpha-light, 8%),
322
- var(--trees-bg)
323
- ),
324
- color-mix(
325
- in lab,
326
- var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
327
- var(--trees-bg)
328
- )
329
- )
330
- )
331
- );
332
- --trees-input-bg: var(
333
- --trees-input-bg-override,
334
- light-dark(#f8f8f8, #070707)
335
- );
336
-
337
- --trees-added-light: #16a994;
338
- --trees-added-dark: #00cab1;
339
- --trees-ignored-light: #adadb1;
340
- --trees-ignored-dark: #4a4a4e;
341
- --trees-modified-light: #1ca1c7;
342
- --trees-modified-dark: #08c0ef;
343
- --trees-renamed-light: #d5a910;
344
- --trees-renamed-dark: #ffd452;
345
- --trees-untracked-light: #16a994;
346
- --trees-untracked-dark: #00cab1;
347
- --trees-deleted-light: #ff2e3f;
348
- --trees-deleted-dark: #ff6762;
349
-
350
- --trees-border-color: var(
351
- --trees-border-color-override,
352
- var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
353
- );
354
- --trees-indent-guide-bg: var(
355
- --trees-indent-guide-bg-override,
356
- color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
357
- );
358
- --trees-density: var(--trees-density-override, 1);
359
- --trees-border-radius: var(
360
- --trees-border-radius-override,
361
- calc(6px * var(--trees-density))
362
- );
363
-
364
- --trees-font-family: var(--trees-font-family-override, system-ui);
365
- --trees-font-size: var(--trees-font-size-override, 13px);
366
- --trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
367
- --trees-font-weight-semibold: var(
368
- --trees-font-weight-semibold-override,
369
- 600
370
- );
371
-
372
- --trees-focus-ring-color: var(
373
- --trees-focus-ring-color-override,
374
- var(--trees-theme-focus-ring, var(--trees-accent))
375
- );
376
- --trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
377
- --trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
378
-
379
- --trees-search-fg: var(
380
- --trees-search-fg-override,
381
- var(--trees-theme-input-fg, var(--trees-fg))
382
- );
383
- --trees-search-font-weight: var(--trees-search-font-weight-override, 600);
384
- --trees-search-bg: var(
385
- --trees-search-bg-override,
386
- var(--trees-theme-input-bg, var(--trees-input-bg))
387
- );
388
-
389
- --trees-scrollbar-thumb: var(
390
- --trees-scrollbar-thumb-override,
391
- var(
392
- --trees-theme-scrollbar-thumb,
393
- color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
394
- )
395
- );
396
-
397
- --trees-selected-fg: var(
398
- --trees-selected-fg-override,
399
- var(--trees-theme-list-active-selection-fg, var(--trees-fg))
400
- );
401
- --trees-selected-bg: var(
402
- --trees-selected-bg-override,
403
- var(
404
- --trees-theme-list-active-selection-bg,
405
- light-dark(
406
- color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
407
- color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
408
- )
409
- )
410
- );
411
- --trees-selected-focused-border-color: var(
412
- --trees-selected-focused-border-color-override,
413
- var(--trees-theme-focus-ring, var(--trees-accent))
414
- );
415
-
416
- /* Git status (e.g. from Shiki theme gitDecoration.*) */
417
- --trees-status-added: var(
418
- --trees-status-added-override,
419
- var(
420
- --trees-theme-git-added-fg,
421
- light-dark(var(--trees-added-light), var(--trees-added-dark))
422
- )
423
- );
424
- --trees-status-ignored: var(
425
- --trees-status-ignored-override,
426
- var(
427
- --trees-theme-git-ignored-fg,
428
- light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
429
- )
430
- );
431
- --trees-status-modified: var(
432
- --trees-status-modified-override,
433
- var(
434
- --trees-theme-git-modified-fg,
435
- light-dark(var(--trees-modified-light), var(--trees-modified-dark))
436
- )
437
- );
438
- --trees-status-renamed: var(
439
- --trees-status-renamed-override,
440
- var(
441
- --trees-theme-git-renamed-fg,
442
- light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
443
- )
444
- );
445
- --trees-status-untracked: var(
446
- --trees-status-untracked-override,
447
- var(
448
- --trees-theme-git-untracked-fg,
449
- light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
450
- )
451
- );
452
- --trees-status-deleted: var(
453
- --trees-status-deleted-override,
454
- var(
455
- --trees-theme-git-deleted-fg,
456
- light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
457
- )
458
- );
459
- --trees-git-modified-color: var(
460
- --trees-git-modified-color-override,
461
- var(--trees-status-modified)
462
- );
463
- --trees-git-added-color: var(
464
- --trees-git-added-color-override,
465
- var(--trees-status-added)
466
- );
467
- --trees-git-ignored-color: var(
468
- --trees-git-ignored-color-override,
469
- var(--trees-status-ignored)
470
- );
471
- --trees-git-deleted-color: var(
472
- --trees-git-deleted-color-override,
473
- var(--trees-status-deleted)
474
- );
475
- --trees-git-renamed-color: var(
476
- --trees-git-renamed-color-override,
477
- var(--trees-status-renamed)
478
- );
479
- --trees-git-untracked-color: var(
480
- --trees-git-untracked-color-override,
481
- var(--trees-status-untracked)
482
- );
483
-
484
- --trees-icon-gray: light-dark(#84848a, #adadb1);
485
- --trees-icon-red: light-dark(#d52c36, #ff6762);
486
- --trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
487
- --trees-icon-orange: light-dark(#d47628, #ffa359);
488
- --trees-icon-yellow: light-dark(#d5a910, #ffd452);
489
- --trees-icon-green: light-dark(#199f43, #5ecc71);
490
- --trees-icon-teal: light-dark(#17a5af, #64d1db);
491
- --trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
492
- --trees-icon-blue: light-dark(#1a85d4, #69b1ff);
493
- --trees-icon-indigo: light-dark(#693acf, #9d6afb);
494
- --trees-icon-purple: light-dark(#a631be, #d568ea);
495
- --trees-icon-pink: light-dark(#d32a61, #ff678d);
496
- --trees-icon-mauve: light-dark(#594c5b, #79697b);
497
-
498
- --trees-file-icon-color-default: var(
499
- --trees-file-icon-color,
500
- var(--trees-icon-gray)
501
- );
502
- --trees-file-icon-color-astro: var(
503
- --trees-file-icon-color,
504
- var(--trees-icon-purple)
505
- );
506
- --trees-file-icon-color-babel: var(
507
- --trees-file-icon-color,
508
- var(--trees-icon-yellow)
509
- );
510
- --trees-file-icon-color-bash: var(
511
- --trees-file-icon-color,
512
- var(--trees-icon-green)
513
- );
514
- --trees-file-icon-color-biome: var(
515
- --trees-file-icon-color,
516
- var(--trees-icon-blue)
517
- );
518
- --trees-file-icon-color-bootstrap: var(
519
- --trees-file-icon-color,
520
- var(--trees-icon-indigo)
521
- );
522
- --trees-file-icon-color-browserslist: var(
523
- --trees-file-icon-color,
524
- var(--trees-icon-yellow)
525
- );
526
- --trees-file-icon-color-bun: var(
527
- --trees-file-icon-color,
528
- var(--trees-icon-mauve)
529
- );
530
- --trees-file-icon-color-claude: var(
531
- --trees-file-icon-color,
532
- var(--trees-icon-orange)
533
- );
534
- --trees-file-icon-color-css: var(
535
- --trees-file-icon-color,
536
- var(--trees-icon-indigo)
537
- );
538
- --trees-file-icon-color-database: var(
539
- --trees-file-icon-color,
540
- var(--trees-icon-purple)
541
- );
542
- --trees-file-icon-color-docker: var(
543
- --trees-file-icon-color,
544
- var(--trees-icon-blue)
545
- );
546
- --trees-file-icon-color-eslint: var(
547
- --trees-file-icon-color,
548
- var(--trees-icon-indigo)
549
- );
550
- --trees-file-icon-color-git: var(
551
- --trees-file-icon-vermilion,
552
- var(--trees-icon-vermilion)
553
- );
554
- --trees-file-icon-color-go: var(
555
- --trees-file-icon-color,
556
- var(--trees-icon-cyan)
557
- );
558
- --trees-file-icon-color-graphql: var(
559
- --trees-file-icon-color,
560
- var(--trees-icon-pink)
561
- );
562
- --trees-file-icon-color-html: var(
563
- --trees-file-icon-color,
564
- var(--trees-icon-orange)
565
- );
566
- --trees-file-icon-color-image: var(
567
- --trees-file-icon-color,
568
- var(--trees-icon-pink)
569
- );
570
- --trees-file-icon-color-javascript: var(
571
- --trees-file-icon-color,
572
- var(--trees-icon-yellow)
573
- );
574
- --trees-file-icon-color-json: var(
575
- --trees-file-icon-color,
576
- var(--trees-icon-orange)
577
- );
578
- --trees-file-icon-color-markdown: var(
579
- --trees-file-icon-color,
580
- var(--trees-icon-green)
581
- );
582
- --trees-file-icon-color-mcp: var(
583
- --trees-file-icon-color,
584
- var(--trees-icon-teal)
585
- );
586
- --trees-file-icon-color-npm: var(
587
- --trees-file-icon-color,
588
- var(--trees-icon-red)
589
- );
590
- --trees-file-icon-color-oxc: var(
591
- --trees-file-icon-cyan,
592
- var(--trees-icon-cyan)
593
- );
594
- --trees-file-icon-color-postcss: var(
595
- --trees-file-icon-color,
596
- var(--trees-icon-red)
597
- );
598
- --trees-file-icon-color-prettier: var(
599
- --trees-file-icon-color,
600
- var(--trees-icon-teal)
601
- );
602
- --trees-file-icon-color-python: var(
603
- --trees-file-icon-color,
604
- var(--trees-icon-blue)
605
- );
606
- --trees-file-icon-color-react: var(
607
- --trees-file-icon-color,
608
- var(--trees-icon-cyan)
609
- );
610
- --trees-file-icon-color-ruby: var(
611
- --trees-file-icon-color,
612
- var(--trees-icon-red)
613
- );
614
- --trees-file-icon-color-rust: var(
615
- --trees-file-icon-color,
616
- var(--trees-icon-orange)
617
- );
618
- --trees-file-icon-color-sass: var(
619
- --trees-file-icon-color,
620
- var(--trees-icon-pink)
621
- );
622
- --trees-file-icon-color-svg: var(
623
- --trees-file-icon-color,
624
- var(--trees-icon-orange)
625
- );
626
- --trees-file-icon-color-svelte: var(
627
- --trees-file-icon-color,
628
- var(--trees-icon-red)
629
- );
630
- --trees-file-icon-color-svgo: var(
631
- --trees-file-icon-color,
632
- var(--trees-icon-green)
633
- );
634
- --trees-file-icon-color-swift: var(
635
- --trees-file-icon-color,
636
- var(--trees-icon-orange)
637
- );
638
- --trees-file-icon-color-table: var(
639
- --trees-file-icon-color,
640
- var(--trees-icon-teal)
641
- );
642
- --trees-file-icon-color-text: var(
643
- --trees-file-icon-color,
644
- var(--trees-icon-gray)
645
- );
646
- --trees-file-icon-color-tailwind: var(
647
- --trees-file-icon-color,
648
- var(--trees-icon-cyan)
649
- );
650
- --trees-file-icon-color-terraform: var(
651
- --trees-file-icon-color,
652
- var(--trees-icon-indigo)
653
- );
654
- --trees-file-icon-color-typescript: var(
655
- --trees-file-icon-color,
656
- var(--trees-icon-blue)
657
- );
658
- --trees-file-icon-color-vite: var(
659
- --trees-file-icon-color,
660
- var(--trees-icon-purple)
661
- );
662
- --trees-file-icon-color-vscode: var(
663
- --trees-file-icon-color,
664
- var(--trees-icon-blue)
665
- );
666
- --trees-file-icon-color-vue: var(
667
- --trees-file-icon-color,
668
- var(--trees-icon-green)
669
- );
670
- --trees-file-icon-color-wasm: var(
671
- --trees-file-icon-color,
672
- var(--trees-icon-indigo)
673
- );
674
- --trees-file-icon-color-webpack: var(
675
- --trees-file-icon-color,
676
- var(--trees-icon-blue)
677
- );
678
- --trees-file-icon-color-yml: var(
679
- --trees-file-icon-color,
680
- var(--trees-icon-red)
681
- );
682
- --trees-file-icon-color-zig: var(
683
- --trees-file-icon-color,
684
- var(--trees-icon-orange)
685
- );
686
- --trees-file-icon-color-zip: var(
687
- --trees-file-icon-color,
688
- var(--trees-icon-orange)
689
- );
690
-
691
- --trees-level-gap: var(
692
- --trees-level-gap-override,
693
- calc(8px * var(--trees-density))
694
- );
695
- --trees-item-padding-x: var(
696
- --trees-item-padding-x-override,
697
- calc(8px * var(--trees-density))
698
- );
699
- --trees-item-margin-x: var(
700
- --trees-item-margin-x-override,
701
- calc(2px * var(--trees-density))
702
- );
703
- --trees-item-row-gap: var(
704
- --trees-item-row-gap-override,
705
- calc(6px * var(--trees-density))
706
- );
707
- --trees-icon-width: var(--trees-icon-width-override, 16px);
708
- --trees-icon-nudge: var(
709
- --trees-icon-nudge-override,
710
- calc(1px * var(--trees-density))
711
- );
712
- --trees-row-height: var(--trees-item-height, 30px);
713
- --trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
714
- --trees-action-lane-width: var(
715
- --trees-action-lane-width-override,
716
- calc(var(--trees-icon-width) + 2px)
717
- );
718
- /* Keep the floating trigger aligned with the row's action lane. Going in
719
- from the root's right edge: the scroll container reserves
720
- \`--trees-padding-inline\` of effective inset on each side (its asymmetric
721
- padding formula cancels the scrollbar gutter on the right), the row
722
- sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
723
- action lane itself. The trigger's own focus-ring margin then trims one
724
- pixel back so the button's visible right edge lines up with the lane. */
725
- --trees-context-menu-trigger-inline-offset: calc(
726
- var(--trees-padding-inline) + var(--trees-item-padding-x) -
727
- var(--trees-focus-ring-width)
728
- );
729
-
730
- --trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
731
- --trees-padding-inline: var(--trees-padding-inline-override, 16px);
732
-
733
- color-scheme: light dark;
734
- display: flex;
735
- flex-direction: column;
736
- font-size: var(--trees-font-size);
737
- color: var(--trees-fg);
738
- background-color: var(--trees-bg);
739
- --truncate-marker-background-color: var(--trees-bg);
740
- --truncate-marker-background-overlay-color: transparent;
741
- font-family: var(--trees-font-family);
742
- font-weight: var(--trees-font-weight-regular);
743
- }
744
-
745
- :host([data-file-tree-virtualized='true']) {
746
- height: 100%;
747
- overflow: hidden;
748
- }
749
-
750
- [data-file-tree-virtualized-wrapper='true'] {
751
- height: 100%;
752
- overflow: hidden;
753
- display: flex;
754
- flex-direction: column;
755
- }
756
-
757
- [data-file-tree-virtualized-root='true'] {
758
- height: 100%;
759
- display: flex;
760
- flex-direction: column;
761
- overflow: hidden;
762
- }
763
-
764
- [data-file-tree-virtualized-scroll='true'],
765
- [data-file-tree-scrollbar-measure='true'] {
766
- overflow-y: auto;
767
- scrollbar-gutter: stable;
768
-
769
- &::-webkit-scrollbar {
770
- width: var(--trees-scrollbar-gutter);
771
- height: var(--trees-scrollbar-gutter);
772
- }
773
-
774
- &::-webkit-scrollbar-track {
775
- background: transparent;
776
- }
777
-
778
- &::-webkit-scrollbar-thumb {
779
- background-color: var(--trees-scrollbar-thumb);
780
- border: 1px solid transparent;
781
- background-clip: content-box;
782
- border-radius: calc(var(--trees-scrollbar-gutter) / 2);
783
- }
784
-
785
- &::-webkit-scrollbar-corner {
786
- background-color: transparent;
787
- }
788
- }
789
-
790
- /* These are styles for a temporarily generated element to measure the size
791
- * of the scrollbar. It's intended to be somewhat similar in scrollbar style
792
- * scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
793
- * accurate reflection of the size the scrollbar gutter takes up. */
794
- [data-file-tree-scrollbar-measure='true'] {
795
- position: absolute;
796
- top: 0;
797
- left: 0;
798
- visibility: hidden;
799
- pointer-events: none;
800
- width: 100px;
801
- height: 100px;
802
- }
803
-
804
- @supports (-moz-appearance: none) {
805
- [data-file-tree-virtualized-scroll='true'],
806
- [data-file-tree-scrollbar-measure='true'] {
807
- scrollbar-width: thin;
808
- scrollbar-color: var(--trees-scrollbar-thumb) transparent;
809
- }
810
- }
811
-
812
- [data-file-tree-virtualized-scroll='true'] {
813
- position: relative;
814
- overflow-y: auto;
815
- flex: 1 1 0;
816
- min-height: 0;
817
- padding-inline: max(
818
- calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
819
- 0px
820
- )
821
- /* NOTE(amadeus): We can assume that all Webkit based browser gutters
822
- * will align to the value of '--trees-scrollbar-gutter', however if not, then
823
- * \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
824
- * hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
825
- * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
826
- */
827
- max(
828
- calc(
829
- var(--trees-padding-inline) - var(--trees-item-margin-x) -
830
- var(
831
- --trees-scrollbar-gutter-measured,
832
- var(--trees-scrollbar-gutter)
833
- )
834
- ),
835
- 0px
836
- );
837
- }
838
-
839
- @supports (-moz-appearance: none) {
840
- [data-file-tree-virtualized-scroll='true'] {
841
- padding-inline: max(
842
- calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
843
- 0px
844
- )
845
- /* NOTE(amadeus): However on Firefox it can vary a little bit, but most
846
- * likely the majority of cases will default to a 0px width scrollbar lets
847
- * inherit that first to avoid SSR jumps. In non-SSR'd environments
848
- * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
849
- */
850
- max(
851
- calc(
852
- var(--trees-padding-inline) - var(--trees-item-margin-x) -
853
- var(--trees-scrollbar-gutter-measured, 0px)
854
- ),
855
- 0px
856
- );
857
- }
858
- }
859
-
860
- [data-file-tree-sticky-overlay='true'] {
861
- position: sticky;
862
- top: 0;
863
- height: 0;
864
- z-index: 4;
865
- overflow: visible;
866
- pointer-events: none;
867
- }
868
-
869
- /* The overlay DOM is kept populated even at scrollTop=0 so the browser has
870
- * the rendered rows on hand the moment scrolling begins — otherwise the
871
- * compositor paints a scrolled frame before React can mount the overlay,
872
- * and the topmost sticky folder jumps up by a couple of pixels before it
873
- * "snaps" into its pinned position. We hide it via CSS whenever the scroll
874
- * is at the top and no scroll is in progress, so the preview doesn't leak
875
- * through at rest. \`data-overlay-reveal\` is stamped on the root only when
876
- * the user initiates a scroll while already at the top — exactly the case
877
- * where we need the pre-mounted overlay to be visible through the first
878
- * compositor frame. It is deliberately distinct from the general
879
- * \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
880
- * navigation) re-hides the overlay the instant the scroll lands, rather
881
- * than waiting for the hover-suppression timer to elapse. */
882
- [data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
883
- [data-overlay-reveal]
884
- )
885
- [data-file-tree-sticky-overlay='true'] {
886
- visibility: hidden;
887
- }
888
-
889
- [data-file-tree-sticky-overlay-content='true'] {
890
- background-color: var(--trees-bg);
891
- position: relative;
892
- pointer-events: none;
893
- }
894
-
895
- [data-file-tree-virtualized-list='true'] {
896
- background-color: var(--trees-bg);
897
- position: relative;
898
- min-height: 100%;
899
- width: 100%;
900
- overflow-anchor: none;
901
-
902
- &[data-is-scrolling] {
903
- pointer-events: none;
904
- }
905
- }
906
-
907
- [data-file-tree-virtualized-sticky-offset='true'] {
908
- contain: layout size;
909
- }
910
-
911
- [data-file-tree-virtualized-sticky='true'] {
912
- position: sticky;
913
- top: 0;
914
- width: 100%;
915
- display: flex;
916
- flex-direction: column;
917
- isolation: isolate;
918
- /* Promote to its own compositor layer so text inside the window is
919
- * rasterized once and GPU-translated during scroll. Without this, the
920
- * browser re-paints the window (and its text) at every scroll frame,
921
- * which produces visible 1px shake / character tearing. */
922
- will-change: transform;
923
- }
924
-
925
- [data-file-tree-search-container] {
926
- display: flex;
927
- padding: 0;
928
- padding-inline: var(--trees-padding-inline);
929
- margin-bottom: var(--trees-item-row-gap);
930
- }
931
-
932
- [data-file-tree-search-input] {
933
- --trees-focus-ring-width: 2px;
934
- font-family: var(--trees-font-family);
935
- font-size: var(--trees-font-size);
936
- flex: 1;
937
- height: var(--trees-row-height);
938
- /* 1px breathing room so the focus-visible outline isn't clipped when the
939
- * input sits flush against the top of the scroll container. */
940
- margin-block: 1px;
941
- padding-inline: var(--trees-item-padding-x);
942
- line-height: var(--trees-row-height);
943
- color: var(--trees-search-fg);
944
- background-color: var(--trees-search-bg);
945
- border: 1px solid var(--trees-border-color);
946
- border-radius: var(--trees-border-radius);
947
- outline: none;
948
-
949
- &::placeholder {
950
- color: color-mix(
951
- in lab,
952
- var(--trees-search-fg) 65%,
953
- var(--trees-search-bg)
954
- );
955
- }
956
-
957
- &:focus-visible,
958
- &[data-file-tree-search-input-fake-focus='true'] {
959
- outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
960
- outline-offset: var(--trees-focus-ring-offset);
961
- }
962
- }
963
-
964
- /* The wrapper for the tree items */
965
- [role='tree'] {
966
- position: relative;
967
- display: flex;
968
- flex-direction: column;
969
- gap: var(--trees-gap-override, 0);
970
- }
971
-
972
- /* LIST ITEM */
973
- [data-type='item'] {
974
- color: inherit;
975
- font-family: var(--trees-font-family);
976
- font-size: var(--trees-font-size);
977
- text-align: start;
978
- outline: none;
979
- background-color: var(--trees-bg);
980
- border: none;
981
- position: relative;
982
-
983
- padding: 0 var(--trees-item-padding-x);
984
- margin: 0 var(--trees-item-margin-x);
985
- cursor: pointer;
986
- -webkit-user-select: none;
987
- user-select: none;
988
- -webkit-touch-callout: none;
989
- touch-action: manipulation;
990
- display: flex;
991
- flex: 0 0 var(--trees-row-height);
992
- align-items: center;
993
- height: var(--trees-row-height);
994
- line-height: var(--trees-row-height);
995
- gap: var(--trees-item-row-gap);
996
- border-radius: var(--trees-border-radius);
997
- /* Row states may be translucent, so markers paint the tree background first
998
- * and then the state color on top to avoid compositing the same alpha twice. */
999
- --truncate-marker-background-color: var(--trees-bg);
1000
- --truncate-marker-background-overlay-color: transparent;
1001
- --truncate-marker-block-inset: 0px;
1002
-
1003
- &:hover,
1004
- &[data-item-context-hover='true'] {
1005
- background-color: var(--trees-bg-muted);
1006
- --truncate-marker-background-overlay-color: var(--trees-bg-muted);
1007
- }
1008
-
1009
- &[data-item-focused='true'],
1010
- &:focus-visible {
1011
- z-index: 2;
1012
-
1013
- /* Flattened segment markers sit high enough to cover the row outline unless
1014
- * their painted background is inset by the focus ring width. */
1015
- [data-item-flattened-subitems] {
1016
- --truncate-marker-block-inset: var(--trees-focus-ring-width);
1017
- }
1018
-
1019
- &::before {
1020
- position: absolute;
1021
- inset: 0;
1022
- content: '';
1023
- display: block;
1024
- border-radius: var(--trees-border-radius);
1025
- outline: var(--trees-focus-ring-width) solid
1026
- var(--trees-focus-ring-color);
1027
- outline-offset: var(--trees-focus-ring-offset);
1028
- pointer-events: none;
1029
- }
1030
-
1031
- &[data-item-selected='true']::before {
1032
- outline-color: var(--trees-selected-focused-border-color);
1033
- }
1034
- }
1035
-
1036
- &[data-item-selected='true'] {
1037
- color: var(--trees-selected-fg);
1038
- background-color: var(--trees-selected-bg);
1039
- --truncate-marker-background-overlay-color: var(--trees-selected-bg);
1040
- z-index: 3;
1041
-
1042
- [data-item-section='icon'] {
1043
- color: var(--trees-selected-fg);
1044
- }
1045
- }
1046
-
1047
- &[data-item-search-match='true'] {
1048
- font-weight: var(--trees-search-font-weight);
1049
- }
1050
- }
1051
-
1052
- [data-type='item'][data-file-tree-sticky-row='true'] {
1053
- pointer-events: auto;
1054
- }
1055
-
1056
- /* Sticky rows opt back into pointer events because the overlay wrapper is
1057
- * inert. During scroll, put them back under the same hover suppression as
1058
- * the virtualized list so translucent hover states and menu triggers do not
1059
- * paint over rows moving beneath the sticky stack. */
1060
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1061
- [data-type='item'][data-file-tree-sticky-row='true'] {
1062
- pointer-events: none;
1063
- }
1064
-
1065
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1066
- [data-type='item'][data-file-tree-sticky-row='true']:hover:not(
1067
- [data-item-selected='true']
1068
- ),
1069
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1070
- [data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
1071
- [data-item-selected='true']
1072
- ) {
1073
- background-color: var(--trees-bg);
1074
- --truncate-marker-background-overlay-color: transparent;
1075
- }
1076
-
1077
- [data-item-selected='true']:has(+ [data-item-selected='true']) {
1078
- border-bottom-left-radius: 0;
1079
- border-bottom-right-radius: 0;
1080
- }
1081
-
1082
- [data-item-selected='true'] + [data-item-selected='true'] {
1083
- border-top-left-radius: 0;
1084
- border-top-right-radius: 0;
1085
- }
1086
-
1087
- /* Flattened Directory Parts */
1088
- [data-item-flattened-subitems] {
1089
- display: inline-flex;
1090
- align-items: center;
1091
- gap: 2px;
1092
- }
1093
- [data-item-flattened-subitem]:hover,
1094
- [data-item-flattened-subitem-drag-target='true'] {
1095
- text-decoration: underline;
1096
- }
1097
-
1098
- /* Icon for each item */
1099
- [data-item-section='icon'] {
1100
- flex-shrink: 0;
1101
- display: flex;
1102
- align-items: center;
1103
- justify-content: center;
1104
- color: var(--trees-fg-muted);
1105
- fill: currentColor;
1106
- width: var(--trees-icon-width);
1107
- }
1108
-
1109
- :where([data-item-section='icon'] > [data-icon-token]) {
1110
- color: var(--trees-fg-muted);
1111
- }
1112
-
1113
- [data-file-tree-colored-icons='true'] {
1114
- [data-icon-token='astro'] {
1115
- color: var(--trees-file-icon-color-astro);
1116
- }
1117
- [data-icon-token='babel'] {
1118
- color: var(--trees-file-icon-color-babel);
1119
- }
1120
- [data-icon-token='bash'] {
1121
- color: var(--trees-file-icon-color-bash);
1122
- }
1123
- [data-icon-token='biome'] {
1124
- color: var(--trees-file-icon-color-biome);
1125
- }
1126
- [data-icon-token='bootstrap'] {
1127
- color: var(--trees-file-icon-color-bootstrap);
1128
- }
1129
- [data-icon-token='browserslist'] {
1130
- color: var(--trees-file-icon-color-browserslist);
1131
- }
1132
- [data-icon-token='bun'] {
1133
- color: var(--trees-file-icon-color-bun);
1134
- }
1135
- [data-icon-token='claude'] {
1136
- color: var(--trees-file-icon-color-claude);
1137
- }
1138
- [data-icon-token='css'] {
1139
- color: var(--trees-file-icon-color-css);
1140
- }
1141
- [data-icon-token='database'] {
1142
- color: var(--trees-file-icon-color-database);
1143
- }
1144
- [data-icon-token='default'] {
1145
- color: var(--trees-file-icon-color-default);
1146
- }
1147
- [data-icon-token='docker'] {
1148
- color: var(--trees-file-icon-color-docker);
1149
- }
1150
- [data-icon-token='eslint'] {
1151
- color: var(--trees-file-icon-color-eslint);
1152
- }
1153
- [data-icon-token='git'] {
1154
- color: var(--trees-file-icon-color-git);
1155
- }
1156
- [data-icon-token='go'] {
1157
- color: var(--trees-file-icon-color-go);
1158
- }
1159
- [data-icon-token='graphql'] {
1160
- color: var(--trees-file-icon-color-graphql);
1161
- }
1162
- [data-icon-token='html'] {
1163
- color: var(--trees-file-icon-color-html);
1164
- }
1165
- [data-icon-token='image'] {
1166
- color: var(--trees-file-icon-color-image);
1167
- }
1168
- [data-icon-token='javascript'] {
1169
- color: var(--trees-file-icon-color-javascript);
1170
- }
1171
- [data-icon-token='json'] {
1172
- color: var(--trees-file-icon-color-json);
1173
- }
1174
- [data-icon-token='markdown'] {
1175
- color: var(--trees-file-icon-color-markdown);
1176
- }
1177
- [data-icon-token='mcp'] {
1178
- color: var(--trees-file-icon-color-mcp);
1179
- }
1180
- [data-icon-token='npm'] {
1181
- color: var(--trees-file-icon-color-npm);
1182
- }
1183
- [data-icon-token='oxc'] {
1184
- color: var(--trees-file-icon-color-oxc);
1185
- }
1186
- [data-icon-token='postcss'] {
1187
- color: var(--trees-file-icon-color-postcss);
1188
- }
1189
- [data-icon-token='prettier'] {
1190
- color: var(--trees-file-icon-color-prettier);
1191
- }
1192
- [data-icon-token='python'] {
1193
- color: var(--trees-file-icon-color-python);
1194
- }
1195
- [data-icon-token='react'] {
1196
- color: var(--trees-file-icon-color-react);
1197
- }
1198
- [data-icon-token='ruby'] {
1199
- color: var(--trees-file-icon-color-ruby);
1200
- }
1201
- [data-icon-token='rust'] {
1202
- color: var(--trees-file-icon-color-rust);
1203
- }
1204
- [data-icon-token='sass'] {
1205
- color: var(--trees-file-icon-color-sass);
1206
- }
1207
- [data-icon-token='svg'] {
1208
- color: var(--trees-file-icon-color-svg);
1209
- }
1210
- [data-icon-token='svelte'] {
1211
- color: var(--trees-file-icon-color-svelte);
1212
- }
1213
- [data-icon-token='svgo'] {
1214
- color: var(--trees-file-icon-color-svgo);
1215
- }
1216
- [data-icon-token='swift'] {
1217
- color: var(--trees-file-icon-color-swift);
1218
- }
1219
- [data-icon-token='table'] {
1220
- color: var(--trees-file-icon-color-table);
1221
- }
1222
- [data-icon-token='text'] {
1223
- color: var(--trees-file-icon-color-text);
1224
- }
1225
- [data-icon-token='tailwind'] {
1226
- color: var(--trees-file-icon-color-tailwind);
1227
- }
1228
- [data-icon-token='terraform'] {
1229
- color: var(--trees-file-icon-color-terraform);
1230
- }
1231
- [data-icon-token='typescript'] {
1232
- color: var(--trees-file-icon-color-typescript);
1233
- }
1234
- [data-icon-token='vite'] {
1235
- color: var(--trees-file-icon-color-vite);
1236
- }
1237
- [data-icon-token='vscode'] {
1238
- color: var(--trees-file-icon-color-vscode);
1239
- }
1240
- [data-icon-token='vue'] {
1241
- color: var(--trees-file-icon-color-vue);
1242
- }
1243
- [data-icon-token='wasm'] {
1244
- color: var(--trees-file-icon-color-wasm);
1245
- }
1246
- [data-icon-token='webpack'] {
1247
- color: var(--trees-file-icon-color-webpack);
1248
- }
1249
- [data-icon-token='yml'] {
1250
- color: var(--trees-file-icon-color-yml);
1251
- }
1252
- [data-icon-token='zig'] {
1253
- color: var(--trees-file-icon-color-zig);
1254
- }
1255
- [data-icon-token='zip'] {
1256
- color: var(--trees-file-icon-color-zip);
1257
- }
1258
- }
1259
-
1260
- /* Chevron rotation and visual alignment */
1261
- /* Chevron pointing down */
1262
- [data-icon-name='file-tree-icon-chevron'] {
1263
- &[data-align-capitals='false'] {
1264
- transform: translate(0, var(--trees-icon-nudge));
1265
- }
1266
- &[data-align-capitals='true'] {
1267
- transform: translate(0, 0);
1268
- }
1269
- }
1270
-
1271
- [data-item-section='content'] {
1272
- flex: 0 1 auto;
1273
- text-align: start;
1274
- min-width: 0;
1275
- max-width: 100%;
1276
- overflow: hidden;
1277
- text-overflow: ellipsis;
1278
- /* Breaks middle truncate component to also set this */
1279
- /* white-space: nowrap; */
1280
- }
1281
-
1282
- [data-item-section='decoration'] {
1283
- flex: 1 1 0;
1284
- min-width: 0;
1285
- display: flex;
1286
- justify-content: flex-end;
1287
- text-align: end;
1288
- overflow: hidden;
1289
- color: var(--trees-fg-muted);
1290
- }
1291
-
1292
- [data-item-section='decoration'] > span {
1293
- min-width: 0;
1294
- max-width: 100%;
1295
- display: inline-flex;
1296
- align-items: center;
1297
- justify-content: flex-end;
1298
- overflow: hidden;
1299
- text-overflow: ellipsis;
1300
- white-space: nowrap;
1301
- }
1302
-
1303
- [data-item-section='git'],
1304
- [data-item-section='action'] {
1305
- flex: 0 0 auto;
1306
- display: flex;
1307
- align-items: center;
1308
- justify-content: center;
1309
- }
1310
-
1311
- [data-item-section='git'] {
1312
- width: var(--trees-git-lane-width);
1313
- }
1314
-
1315
- [data-item-section='action'] {
1316
- width: var(--trees-action-lane-width);
1317
- color: var(--trees-fg-muted);
1318
- fill: currentColor;
1319
- pointer-events: none;
1320
- }
1321
-
1322
- [data-item-section='git'] > span,
1323
- [data-item-section='action'] > span {
1324
- width: 100%;
1325
- display: inline-flex;
1326
- align-items: center;
1327
- justify-content: center;
1328
- }
1329
-
1330
- [data-item-action-affordance='decorative'] {
1331
- opacity: 0.85;
1332
- }
1333
-
1334
- [data-item-rename-input] {
1335
- appearance: none;
1336
- width: 100%;
1337
- min-width: 0;
1338
- height: calc(var(--trees-row-height) - 4px);
1339
- font-family: inherit;
1340
- font-size: inherit;
1341
- /* line-height: calc(var(--trees-row-height) - 8px); */
1342
- color: inherit;
1343
- background-color: transparent;
1344
- border: 0;
1345
- padding-inline: 6px;
1346
- outline: none;
1347
- box-sizing: border-box;
1348
- }
1349
-
1350
- [data-item-section='content']:has([data-item-rename-input])
1351
- ~ [data-item-section='action'],
1352
- [data-item-section='content']:has([data-item-rename-input])
1353
- ~ [data-item-section='decoration'] {
1354
- display: none;
1355
- }
1356
-
1357
- /* Chevron pointing right */
1358
- [aria-expanded='false'][data-item-type='folder']
1359
- > [data-item-section='icon']
1360
- > [data-icon-name='file-tree-icon-chevron'] {
1361
- &[data-align-capitals='true'] {
1362
- transform: rotate(-90deg)
1363
- translate(
1364
- calc(var(--trees-icon-nudge) / 2),
1365
- calc(var(--trees-icon-nudge) / 2)
1366
- );
1367
- }
1368
- &[data-align-capitals='false'] {
1369
- transform: rotate(-90deg)
1370
- translate(
1371
- calc(var(--trees-icon-nudge) / 2 * -1),
1372
- calc(var(--trees-icon-nudge) / 2)
1373
- );
1374
- }
1375
- }
1376
-
1377
- /* LIST IDENTATION */
1378
- /* Spacing container */
1379
- [data-item-section='spacing'] {
1380
- display: flex;
1381
- flex-direction: row;
1382
- align-items: center;
1383
- justify-content: center;
1384
- height: var(--trees-row-height);
1385
- padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
1386
-
1387
- &:empty {
1388
- padding-left: 0;
1389
- }
1390
- }
1391
-
1392
- /* Spacing per level */
1393
- [data-item-section='spacing-item'] {
1394
- transform: translateX(-0.25px);
1395
- display: inline-block;
1396
- border-left: 1px solid var(--trees-indent-guide-bg);
1397
- height: 100%;
1398
- margin-right: calc(var(--trees-level-gap) - 1px);
1399
- opacity: 0;
1400
- transition: opacity 150ms ease;
1401
-
1402
- & + & {
1403
- margin-left: calc(
1404
- var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
1405
- );
1406
- }
1407
- }
1408
-
1409
- :host(:hover) [data-item-section='spacing-item'] {
1410
- opacity: 0.75;
1411
- }
1412
-
1413
- /* Git status indicator */
1414
-
1415
- /* This is a folder that contains a git change */
1416
- [data-item-contains-git-change='true'] > [data-item-section='git'] {
1417
- color: var(--trees-git-modified-color);
1418
- opacity: 0.5;
1419
- fill: currentColor;
1420
- }
1421
-
1422
- /* These are files that have a git change */
1423
- [data-item-git-status] {
1424
- &
1425
- > :where([data-item-section='icon'])
1426
- > :where(:not([data-icon-name='file-tree-icon-chevron'])) {
1427
- color: var(--trees-item-git-status-color);
1428
- }
1429
- & > [data-item-section='content'] {
1430
- color: var(--trees-item-git-status-color);
1431
- }
1432
- & > [data-item-section='git'] {
1433
- color: var(--trees-item-git-status-color);
1434
- font-weight: var(--trees-font-weight-semibold);
1435
- }
1436
- }
1437
-
1438
- [data-item-git-status='added'] {
1439
- --trees-item-git-status-color: var(--trees-git-added-color);
1440
- }
1441
-
1442
- [data-item-git-status='deleted'] {
1443
- --trees-item-git-status-color: var(--trees-git-deleted-color);
1444
- }
1445
-
1446
- [data-item-git-status='ignored'] {
1447
- --trees-item-git-status-color: var(--trees-git-ignored-color);
1448
-
1449
- & > [data-item-section='icon'] {
1450
- opacity: 0.5;
1451
- }
1452
- }
1453
-
1454
- [data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
1455
- /* this is a nudge to align the dot with the likely lowercase text. it's slightly
1456
- generalizable, but other fonts are gonna need other nudges i assume */
1457
- transform: translateY(calc(0.65ex - 50%));
1458
- }
1459
-
1460
- [data-item-git-status='modified'] {
1461
- --trees-item-git-status-color: var(--trees-git-modified-color);
1462
- }
1463
-
1464
- [data-item-git-status='renamed'] {
1465
- --trees-item-git-status-color: var(--trees-git-renamed-color);
1466
- }
1467
-
1468
- [data-item-git-status='untracked'] {
1469
- --trees-item-git-status-color: var(--trees-git-untracked-color);
1470
- }
1471
-
1472
- /* Drag and drop */
1473
- [data-item-drag-target='true'] {
1474
- background-color: var(--trees-selected-bg);
1475
- }
1476
-
1477
- [data-item-dragging='true'] {
1478
- opacity: 0.5;
1479
- }
1480
-
1481
- /* Lock icon for locked paths (sibling of content) */
1482
- [data-item-section='lock'] {
1483
- flex: 0 0 auto;
1484
- margin-left: auto;
1485
- display: flex;
1486
- align-items: center;
1487
- color: var(--trees-fg-muted);
1488
- }
1489
- [data-item-section='lock'] svg {
1490
- display: block;
1491
- }
1492
-
1493
- [data-type='header-slot'] {
1494
- display: block;
1495
- flex: 0 0 auto;
1496
- }
1497
-
1498
- [data-type='context-menu-wash'] {
1499
- position: absolute;
1500
- inset: 0;
1501
- z-index: 3;
1502
- background-color: transparent;
1503
- touch-action: none;
1504
- }
1505
-
1506
- [data-type='context-menu-anchor'] {
1507
- position: absolute;
1508
- top: 0;
1509
- right: var(--trees-context-menu-trigger-inline-offset);
1510
- z-index: 4;
1511
- display: none;
1512
- align-items: center;
1513
-
1514
- &[data-visible='true'] {
1515
- display: flex;
1516
- }
1517
- }
1518
-
1519
- /* Hide the floating trigger while the scroll container is actively moving.
1520
- * The anchor is positioned against the root, not the scroll content, so its
1521
- * \`top\` follows the row via a React state update — one frame behind the
1522
- * compositor. That delay is visible as the trigger hovering over the wrong
1523
- * row during the first frame of a scroll. The \`data-is-scrolling\` flag on
1524
- * the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
1525
- * the compositor commits the next paint, so this selector hides the anchor
1526
- * in the same frame the scroll begins. */
1527
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1528
- [data-type='context-menu-anchor'] {
1529
- display: none;
1530
- }
1531
-
1532
- [data-type='context-menu-anchor'] > slot[name='context-menu'] {
1533
- display: block;
1534
- width: 0;
1535
- min-width: 0;
1536
- flex: 0 0 0;
1537
- overflow: visible;
1538
- }
1539
-
1540
- /* Single floating context menu trigger */
1541
- [data-type='context-menu-trigger'] {
1542
- all: unset;
1543
- align-items: center;
1544
- justify-content: center;
1545
- width: var(--trees-action-lane-width);
1546
- color: var(--trees-fg-muted);
1547
- fill: currentColor;
1548
- cursor: pointer;
1549
- font-family: var(--trees-font-family);
1550
- font-size: var(--trees-font-size);
1551
- border-top-right-radius: var(--trees-border-radius);
1552
- border-bottom-right-radius: var(--trees-border-radius);
1553
- margin: var(--trees-focus-ring-width);
1554
- height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
1555
- border-width: 0;
1556
- transition: color 120ms ease;
1557
-
1558
- display: flex;
1559
- }
1560
-
1561
- [data-type='context-menu-trigger']:hover,
1562
- [data-type='context-menu-trigger'][aria-expanded='true'] {
1563
- color: var(--trees-fg);
1564
- }
1565
-
1566
- /** @pierre/truncate css here, manually copy pasted for now */
1567
- [data-truncate-container] {
1568
- /* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
1569
- margin-top: -1px;
1570
- margin-bottom: -1px;
1571
-
1572
- /* Width of the fade from default marker to text */
1573
- --truncate-internal-marker-fade-width: var(
1574
- --truncate-marker-fade-width,
1575
- 2px
1576
- );
1577
- /* Width of the solid color between the fade from the default marker to the text */
1578
- --truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
1579
- /* Opacity of the marker 'color' property, not of the element itself */
1580
- --truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
1581
- /* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
1582
- --truncate-internal-middle-marker-opacity: var(
1583
- --truncate-middle-marker-opacity,
1584
- 80%
1585
- );
1586
- /* Background color of the default marker */
1587
- --truncate-internal-marker-background-color: var(
1588
- --truncate-marker-background-color,
1589
- light-dark(white, black)
1590
- );
1591
- --truncate-internal-marker-background-overlay-color: var(
1592
- --truncate-marker-background-overlay-color,
1593
- transparent
1594
- );
1595
- --truncate-internal-marker-block-inset: var(
1596
- --truncate-marker-block-inset,
1597
- 0px
1598
- );
1599
- /* Duration of the fade out animation for the marker */
1600
- --truncate-internal-marker-fade-out-duration: var(
1601
- --truncate-marker-fade-out-duration,
1602
- 0ms
1603
- );
1604
- /* Duration of the fade in animation for the marker */
1605
- --truncate-internal-marker-fade-in-duration: var(
1606
- --truncate-marker-fade-in-duration,
1607
- 100ms
1608
- );
1609
-
1610
- /* FADE Variant specifics */
1611
- --truncate-internal-fade-marker-color: var(
1612
- --truncate-fade-marker-color,
1613
- #000
1614
- );
1615
- --truncate-internal-fade-marker-width: var(
1616
- --truncate-fade-marker-width,
1617
- 0.2lh
1618
- );
1619
-
1620
- /*
1621
- In some special cases people might be adding spacing in other ways
1622
- that would benefit from being able to override this, however the container
1623
- query below can't use this and would need to be redeclared with the overridden
1624
- value. It's a bad time, but better than nothing.
1625
- */
1626
- --truncate-internal-single-line-height: 1lh;
1627
-
1628
- height: var(--truncate-internal-single-line-height);
1629
- min-width: 0;
1630
- overflow: hidden;
1631
- }
1632
-
1633
- [data-truncate-marker] {
1634
- display: flex;
1635
- position: absolute;
1636
- height: var(--truncate-internal-single-line-height);
1637
- padding-block: var(--truncate-internal-marker-block-inset);
1638
- box-sizing: border-box;
1639
- align-items: center;
1640
- background-clip: content-box;
1641
- z-index: 2;
1642
- color: color-mix(
1643
- in srgb,
1644
- currentColor var(--truncate-internal-marker-opacity),
1645
- transparent
1646
- );
1647
-
1648
- /* Core trick for hiding the marker until overflow occurs */
1649
- opacity: 0;
1650
- transition: opacity var(--truncate-internal-marker-fade-out-duration)
1651
- ease-in-out;
1652
- }
1653
-
1654
- @container measure (height > 1lh) {
1655
- [data-truncate-marker] {
1656
- opacity: 1;
1657
- transition: opacity var(--truncate-internal-marker-fade-in-duration)
1658
- ease-in-out;
1659
- }
1660
- }
1661
-
1662
- [data-truncate-grid] {
1663
- display: grid;
1664
- position: relative;
1665
- }
1666
-
1667
- [data-truncate-content='visible'] {
1668
- white-space: nowrap;
1669
- }
1670
-
1671
- [data-truncate-content='overflow'] {
1672
- opacity: 0;
1673
- pointer-events: none;
1674
- -webkit-user-select: none;
1675
- user-select: none;
1676
- word-break: break-all;
1677
- margin-top: calc(-1 * var(--truncate-internal-single-line-height));
1678
- }
1679
-
1680
- [data-truncate-marker-cell] {
1681
- container: measure / size;
1682
- overflow: visible;
1683
- -webkit-user-select: none;
1684
- user-select: none;
1685
- pointer-events: none;
1686
- }
1687
-
1688
- [data-truncate-container='truncate'] {
1689
- & [data-truncate-grid] {
1690
- grid-template-columns: minmax(0, max-content) 0;
1691
- }
1692
- & [data-truncate-marker] {
1693
- right: 0;
1694
- }
1695
- & [data-truncate-fade] {
1696
- margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
1697
- }
1698
- }
1699
-
1700
- [data-truncate-container='fruncate'] {
1701
- & [data-truncate-grid] {
1702
- grid-template-columns: 0 minmax(0, max-content) auto;
1703
- }
1704
- & [data-truncate-content] {
1705
- direction: rtl;
1706
- }
1707
- & [data-truncate-content] > span {
1708
- unicode-bidi: plaintext;
1709
- }
1710
- & [data-truncate-fade] {
1711
- margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
1712
- }
1713
- }
1714
-
1715
- [data-truncate-variant='default'] {
1716
- & [data-truncate-marker] {
1717
- background-color: var(--truncate-internal-marker-background-color);
1718
- background-image: linear-gradient(
1719
- var(--truncate-internal-marker-background-overlay-color),
1720
- var(--truncate-internal-marker-background-overlay-color)
1721
- );
1722
- }
1723
- & [data-truncate-marker]::after,
1724
- & [data-truncate-marker]::before {
1725
- content: '';
1726
- position: absolute;
1727
- width: calc(
1728
- var(--truncate-internal-marker-fade-width) +
1729
- var(--truncate-internal-marker-gap)
1730
- );
1731
- inset-block-start: var(--truncate-internal-marker-block-inset);
1732
- height: max(
1733
- 0px,
1734
- calc(
1735
- var(--truncate-internal-single-line-height) -
1736
- var(--truncate-internal-marker-block-inset) * 2
1737
- )
1738
- );
1739
- background-color: var(--truncate-internal-marker-background-color);
1740
- background-image: linear-gradient(
1741
- var(--truncate-internal-marker-background-overlay-color),
1742
- var(--truncate-internal-marker-background-overlay-color)
1743
- );
1744
- mask-image: linear-gradient(
1745
- var(--truncate-internal-fade-dir),
1746
- #000 0%,
1747
- #000 var(--truncate-internal-marker-gap),
1748
- transparent 100%
1749
- );
1750
- }
1751
- & [data-truncate-marker]::after {
1752
- --truncate-internal-fade-dir: to right;
1753
- right: calc(
1754
- -1 *
1755
- (
1756
- var(--truncate-internal-marker-fade-width) +
1757
- var(--truncate-internal-marker-gap)
1758
- )
1759
- );
1760
- }
1761
- & [data-truncate-marker]::before {
1762
- --truncate-internal-fade-dir: to left;
1763
- left: calc(
1764
- -1 *
1765
- (
1766
- var(--truncate-internal-marker-fade-width) +
1767
- var(--truncate-internal-marker-gap)
1768
- )
1769
- );
1770
- }
1771
- }
1772
-
1773
- [data-truncate-variant='fade'] {
1774
- & [data-truncate-marker] {
1775
- background: transparent;
1776
- }
1777
- }
1778
-
1779
- [data-truncate-fade] {
1780
- box-shadow:
1781
- 0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
1782
- var(--truncate-internal-fade-marker-color),
1783
- 0 0 var(--truncate-internal-fade-marker-width)
1784
- var(--truncate-internal-fade-marker-color);
1785
- width: calc(var(--truncate-internal-fade-marker-width) * 2);
1786
- height: calc(
1787
- var(--truncate-internal-single-line-height) -
1788
- (var(--truncate-internal-fade-marker-width) * 2)
1789
- );
1790
- margin: var(--truncate-internal-fade-marker-width) 0;
1791
- }
1792
-
1793
- [data-truncate-group-container='middle'] {
1794
- & [data-truncate-container] {
1795
- --truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
1796
- }
1797
-
1798
- display: flex;
1799
- min-width: 0;
1800
-
1801
- & > div {
1802
- min-width: 0;
1803
- }
1804
-
1805
- & > div[data-truncate-segment-priority='1'] {
1806
- flex: 0 1 max-content;
1807
- }
1808
- & > div[data-truncate-segment-priority='2'] {
1809
- flex: 0 999999 max-content;
1810
- }
1811
- }
1812
- }
1813
- `,Gf=`@layer base, unsafe;`;function Kf(e){return`${Gf}
1814
- @layer base {
1815
- ${e}
1816
- }`}function qf(e){return`${Gf}
1817
- @layer unsafe {
1818
- ${e}
1819
- }`}var Jf=new WeakMap;function Yf(e){let t=Jf.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(hd,`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(),Jf.set(e,i),i}function Xf(e,t){if(!e.isConnected)return;let n=Yf(t);if(n==null)return;let r=t.querySelector(`style[${gd}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(gd,``),t.appendChild(i)),i.textContent=`:host { ${_d}: ${n}px; }`}var Zf;function Qf(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Zf??(Zf=new CSSStyleSheet,Zf.replaceSync(Kf(Wf)));let t=!1;try{e.adoptedStyleSheets=[Zf],t=!0}catch{}if(t){e.querySelector(`style[${pd}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(pd,``),t.textContent=Kf(Wf),e.prepend(t)}}function $f(e,t){ep(e,t),Qf(t),Xf(e,t)}function ep(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`});$f(this,e)}}if(customElements.define(fd,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(fd)))e instanceof HTMLElement&&$f(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var tp=5,np=1<<tp,rp=np*4;function ip(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function ap(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function op(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 sp(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 cp(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function lp(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 up(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,mp(e,t)}function dp(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=sp(e).get(t);if(i===void 0)return;let a=i>>tp;e.childVisibleChunkSums[a]+=r}function fp(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=hp(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=np}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 pp(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>tp;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<tp}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 mp(e,t){if(t.childIds.length<rp){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/np),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>>tp]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function hp(e,t,n,r){let i=Math.min(t.childIds.length,n+np),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 gp=7,_p=3,vp=1<<_p,yp=4;function bp(e,t,n=0){return e<<yp|n<<_p|t}function xp(e){return e.depthAndFlags>>>yp}function Sp(e){return(e.depthAndFlags&vp)>>_p}function Y(e){return(e.depthAndFlags&vp)!==0}function Cp(e){return e.depthAndFlags&gp}function wp(e,t){return(Cp(e)&t)!==0}function Tp(e,t){e.depthAndFlags|=t}function Ep(e,t){e.depthAndFlags=bp(t,Cp(e),Sp(e))}var Dp=Symbol(`benchmarkInstrumentation`);function Op(e,t){return t==null||Object.defineProperty(e,Dp,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function kp(e){return e==null?null:e[Dp]??null}function X(e,t,n){return e==null?n():e.measurePhase(t,n)}function Ap(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function jp(e){return e>=48&&e<=57}function Mp(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!jp(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&&jp(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 Np(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Mp(t)}}function Pp(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 Fp(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=Pp(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Ip(e,t,n){let r=Fp(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Lp(e,t){return Ip(e,t,Np)}function Rp(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function zp(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=Rp(e,r);return a===Rp(t,r)?Lp(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 Bp(e,t){return zp(e,t)}function Vp(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Np(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=Rp(e,n);return o===Rp(t,n)?Ip(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 Hp(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Np(r);return e.sortKeyById[t]=i,i}function Up(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Wp(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 Gp(e){let{hasTrailingSlash:t,segments:n}=Wp(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function Kp(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Wp(e);return{requiresDirectory:t,segments:n}}var qp=``;function Jp(){let e=new Map;return e.set(qp,0),{idByValue:e,valueById:[qp],sortKeyById:[Np(qp)]}}function Yp(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 Xp(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Zp=Symbol(`pathStorePreparedInputKind`);function Qp(e,t){return e[Zp]=t,e}function $p(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function em(e,t,n){return n===`default`?Bp(e,t):n($p(e),$p(t))}function tm(){return{depthAndFlags:bp(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function nm(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 rm(e){return e.isDirectory?e.segments.length:e.segments.length-1}function im(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 am(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function om(e,t={}){return fm(e,t).map(e=>e.path)}function sm(e,t={}){let n=fm(e,t);return Qp({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function cm(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 Qp({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function lm(e){let t=e,n=t.preparedPaths;if(t[Zp]===`prepared`&&n!=null)return n;if(!im(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function um(e){let t=e;return t[Zp]===`presorted`&&t.presortedPaths!=null||am(t.presortedPaths)?t.presortedPaths:null}function dm(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function fm(e,t={}){let n=Up(t),r=kp(t);Ap(r,`workload.inputFiles`,e.length);let i=X(r,`store.preparePathEntries.parse`,()=>e.map(e=>Gp(e)));return X(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>em(e,t,n.sort))),i}var pm=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[tm()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=Jp();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=kp(e),this.options=Up(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,ip())}appendPaths(e){return X(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>Gp(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,X(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return X(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:bp(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:bp(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:bp(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=Gp(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:bp(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:bp(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=Gp(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(X(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||X(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`?Vp(this.lastPreparedPath,e,this.segmentSortKeyCache):em(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=rm(e),i=n==null?0:rm(n),a=n==null?0:nm(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=Yp(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:bp(xp(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),cp(i,s),s}createFileChildUnchecked(e,t){let n=Yp(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:bp(xp(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),cp(r,a),a}getOrCreateDirectoryChild(e,t){let n=Yp(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&&!Y(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:bp(xp(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),cp(r,a),this.directories.set(a,ip()),a}createDirectoryChild(e,t){let n=Yp(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:bp(xp(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),cp(r,a),this.directories.set(a,ip()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!Y(n))throw Error(`Path is not a directory: "${t}"`);if(wp(n,1))throw Error(`Duplicate path: "${t}"`);Tp(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,ap());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(Y(a)){let t=ap();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;Y(n)&&this.directories.set(t,ip());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),cp(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!Y(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 up(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function mm(e,t=`closed`,n=null){let r=gm(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 hm(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function gm(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 _m(e,t){return wp(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:xp(t)<=e.defaultExpansion}function vm(e,t,n=e.snapshot.nodes[t]){return n==null||!Y(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:_m(e,n)}function ym(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!Y(r))return;let i=_m(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 bm(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 xm(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Sm(e,t){let n=bm(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 Cm(e,t){let n=bm(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function wm(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 Tm(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Em(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 Dm(e,t){e.directoryLoadInfoById.delete(t)}function Om(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 km(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Am(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function jm(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Mm(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Nm(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Pm(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Fm(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 Im(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 Lm(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 Rm(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 zm(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 Bm(e,t,n){return{...n,visibleCountDelta:Zm(e)-t}}function Vm(e,t){let n=Zm(e),r=hm();e.transactionStack.push(r);try{t()}catch(t){throw Wm(e,r,!1),t}Wm(e,r,!0,Zm(e)-n)}function Hm(e,t){let n=e.instrumentation;if(n==null){Um(e,t);return}X(n,`store.events.record`,()=>Um(e,t))}function Um(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Ym(e,t);return}n.events.push(t),Jm(n,t)}function Wm(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?qm(i,t):X(n,`store.events.batch.merge`,()=>qm(i,t));return}let a=Gm(t,r),o=e.instrumentation;if(o==null){Ym(e,a);return}X(o,`store.events.batch.commit`,()=>Ym(e,a))}function Gm(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 Km(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function qm(e,t){for(let n of t.events)e.events.push(n);Km(e,t)}function Jm(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Ym(e,t){let n=e.instrumentation;if(n==null){Xm(e,t);return}X(n,`store.events.emit`,()=>Xm(e,t))}function Xm(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Zm(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Qm(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!Y(n)||wp(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||!Y(a)?null:i}function $m(e,t){let n=t;for(;;){let t=Qm(e,n);if(t==null)return n;n=t}}function eh(e,t){let n=[t],r=t;for(;;){let t=Qm(e,r);if(t==null)return n;n.push(t),r=t}}function th(e,t){let n=t==null?e.snapshot.rootId:dh(e,t);return n==null?[]:mh(e,n)}function nh(e,t){let n=Gp(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=kh(e,Oh(e,r)),{createdNodeIds:a,directoryId:o}=hh(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Z(e,o);if(wp(n,1))throw Error(`Path already exists: "${t}"`);Tp(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=_h(e,o,n.basename),s.add(c);ch(e,o);let l=kh(e,o);return km({affectedAncestorIds:uh(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Ah(i,l)})}function rh(e,t,n){let r=dh(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Z(e,r);if(wp(i,2))throw Error(`The root node cannot be removed`);if(Y(i)&&ph(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=kh(e,a),s=Eh(e,r);bh(e,a,r,i.nameId),Dh(e,a),ch(e,a);let c=kh(e,a);return Am({affectedAncestorIds:uh(e,a),affectedNodeIds:s,path:t,projectionChanged:Ah(o,c),recursive:n.recursive===!0})}function ih(e,t,n,r){let i=dh(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Z(e,i);if(wp(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=wh(e,i,n),c=kh(e,a.parentId),l=kh(e,s.parentId),u=Xp(e.snapshot.segmentTable,a.nameId),d=Yp(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(Y(a)&&Ph(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=op(e.snapshot.nodes,ph(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Th(e,p,o,Sp(a))===`skip`)return null;let m=a.parentId;bh(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Nh(e,i),yh(e,s.parentId,i),Dh(e,m),e.pathCacheVersion++,ch(e,m),s.parentId!==m&&ch(e,s.parentId);let h=kh(e,m),g=kh(e,s.parentId);return jm({affectedAncestorIds:[...new Set([...uh(e,m),...uh(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:jh([c,l],[h,g]),to:sh(e,i)})}function ah(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function oh(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function sh(e,t){let n=Z(e,t),r=ah(e,t);if(r!=null)return r;if(wp(n,2))return oh(e,t,``);let i=sh(e,n.parentId),a=Xp(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return oh(e,t,Y(n)?`${o}/`:o)}function ch(e,t){let n=e.instrumentation;if(n==null){Ih(e,t);return}X(n,`store.recomputeCountsUpwardFrom`,()=>Ih(e,t))}function lh(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||!Y(o)){Fh(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Fh(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function uh(e,t){let n=[],r=t;for(;r!=null;){let t=Z(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function dh(e,t){if(t.length===0)return e.snapshot.rootId;let n=Kp(t);return fh(e,n.segments,n.requiresDirectory)}function fh(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=ph(e,r),a=op(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=Z(e,r);return n&&!Y(i)?null:r}function ph(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 Z(e,t){let n=e.snapshot.nodes[t];if(n===void 0||wp(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function mh(e,t){let n=e.snapshot.nodes[t];if(n===void 0||wp(n,4))return[];if(!Y(n))return[sh(e,t)];if(ph(e,t).childIds.length===0)return wp(n,1)&&!wp(n,2)?[sh(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||wp(n,4)){i.pop();continue}if(!Y(n)){r.push(sh(e,t.nodeId)),i.pop();continue}let a=ph(e,t.nodeId);if(a.childIds.length===0){wp(n,1)&&!wp(n,2)&&r.push(sh(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 hh(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Yp(e.snapshot.segmentTable,i),a=ph(e,r),o=op(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!Y(Z(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=gh(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function gh(e,t,n){let r=Z(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:bp(xp(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,ip()),yh(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function _h(e,t,n){let r=Yp(e.snapshot.segmentTable,n),i=ph(e,t);if(op(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Rh(e,t,n)}"`);let a=Z(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:bp(xp(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),yh(e,t,o),e.activeNodeCount++,o}function vh(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}xh(e,n,o)<0?i=a:r=a+1}return r}function yh(e,t,n){let r=ph(e,t),i=Z(e,n);op(e.snapshot.nodes,r).set(i.nameId,n),dp(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=vh(e,r,n);r.childIds.splice(a,0,n),lp(r,a),mp(e.snapshot.nodes,r)}function bh(e,t,n,r){let i=ph(e,t),a=sp(i),o=a.get(n)??-1;op(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&dp(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),lp(i,o),mp(e.snapshot.nodes,i))}function xh(e,t,n){let r=e.snapshot.options.sort;return r===`default`?Sh(e,t,n):r(Ch(e,t),Ch(e,n))}function Sh(e,t,n){let r=Z(e,t),i=Z(e,n),a=Y(r);if(a!==Y(i))return a?-1:1;let o=Fp(Hp(e.snapshot.segmentTable,r.nameId),Hp(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Xp(e.snapshot.segmentTable,r.nameId),c=Xp(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Ch(e,t){let n=Z(e,t),r=sh(e,t),i=Y(n),a=i?r.slice(0,-1):r;return{basename:Xp(e.snapshot.segmentTable,n.nameId),depth:xp(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function wh(e,t,n){let r=Z(e,t),i=dh(e,n);if(i!=null){let t=Z(e,i);if(Y(t))return{basename:Xp(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=Kp(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=Kp(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:fh(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Th(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${sh(e,t)}"`);let i=Z(e,t);if(Sp(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(Y(i)&&ph(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return Eh(e,t),bh(e,a,t,o),Dh(e,a),ch(e,a),`handled`}function Eh(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=Z(e,t.nodeId);if(t.visitedChildren||!Y(i)){Y(i)&&e.snapshot.directories.delete(t.nodeId),Tp(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Dm(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=ph(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 Dh(e,t){let n=t;for(;n!=null;){let t=Z(e,n);if(!Y(t)||wp(t,2)||ph(e,n).childIds.length>0)return;Tp(t,1),n=t.parentId===n?null:t.parentId}}function Oh(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=op(e.snapshot.nodes,ph(e,n)).get(t);if(i==null||!Y(Z(e,i)))break;n=i}return n}function kh(e,t){let n=Mh(e,t);if(n==null)return null;let r=$m(e,n),i=Z(e,r),a=n===r?null:eh(e,n).map(t=>sh(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:ph(e,r).childIds.length>0,path:sh(e,r),terminalKind:Sp(i)})}function Ah(e,t){return jh([e],[t])}function jh(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 Mh(e,t){let n=t;for(;n!=null;){let t=Z(e,n);if(!Y(t)||wp(t,2))return null;if(!vm(e,n,t))return n;n=t.parentId}return null}function Nh(e,t){let n=Z(e,t);if(Ep(n,(t===e.snapshot.rootId?-1:xp(Z(e,n.parentId)))+1),!Y(n))return;let r=ph(e,t);for(let t of r.childIds)Nh(e,t)}function Ph(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=Z(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function Fh(e,t,n=Z(e,t),r=!1){let i=e.instrumentation;if(i==null){Lh(e,t,n,r);return}X(i,`store.recomputeNodeCounts`,()=>Lh(e,t,n,r))}function Ih(e,t){let n=t;for(;n!=null;){let t=Z(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Fh(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&dp(ph(e,s),n,a,o),n=s}}function Lh(e,t,n,r){if(!Y(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=ph(e,t);if(r){let t=e.instrumentation;t==null?up(e.snapshot.nodes,i):X(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>up(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,wp(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Qm(e,t)==null?vm(e,t,n)?1+o:1:o}function Rh(e,t,n){let r=sh(e,t);return r.length===0?n:`${r}${n}`}function zh(e){return e!=null&&!wp(e,4)}function Bh(e,t){let n=e.snapshot.nodes[t];return!zh(n)||!Y(n)||wp(n,2)?null:n}function Vh(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&zh(e.snapshot.nodes[n])&&(t+=1);return t}function Hh(e){return Math.max(0,e.valueById.length-1)}function Uh(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:Vh(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Hh(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function Wh(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 Gh(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)Bh(e,n)!=null&&t.push(sh(e,n));for(let t of e.expandedDirectoryIds)Bh(e,t)!=null&&n.push(sh(e,t));return{collapsedPaths:t,expandedPaths:n}}function Kh(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)Bh(e,n)==null||xm(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:sh(e,n)});return t}function qh(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=dh(e,n);t!=null&&ym(e,t,!0,Z(e,t))}for(let n of t.collapsedPaths){let t=dh(e,n);t!=null&&ym(e,t,!1,Z(e,t))}}function Jh(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=dh(e,n.path);t!=null&&Bh(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function Yh(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function Xh(e){let t=e.snapshot.segmentTable,n=Jp();for(let r of e.snapshot.nodes)if(zh(r)){if(wp(r,2)){r.nameId=0;continue}r.nameId=Yp(n,Xp(t,r.nameId))}e.snapshot.segmentTable=n}function Zh(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!zh(r)||!Y(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return zh(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[Z(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),up(e.snapshot.nodes,n)}}function Qh(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(zh(n))break;--t}e.snapshot.nodes.length=t+1}function $h(e){let t=Gh(e),n=Kh(e);X(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>Yh(e)),X(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>Xh(e)),X(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>Zh(e)),X(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>Qh(e)),X(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>qh(e,t)),X(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>Jh(e,n)),X(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>lh(e,e.snapshot.rootId))}function eg(e){let t=Gh(e),n=Kh(e),r=X(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>th(e)),i=Op({...e.snapshot.options},e.instrumentation),a=X(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new pm(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,X(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>qh(e,t)),X(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>Jh(e,n)),X(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>lh(e,e.snapshot.rootId))}function tg(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function ng(e,t){let n=Uh(e);t===`stable`?X(e.instrumentation,`store.cleanup.stable`,()=>$h(e)):X(e.instrumentation,`store.cleanup.aggressive`,()=>eg(e));let r=Uh(e);return Wh(t,t===`stable`,n,r)}var rg=64;function ig(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 ag(e){return Z(e,e.snapshot.rootId).visibleSubtreeCount}function og(e,t,n,r){let i=Z(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function sg(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:Eg(e,t.cursor),setSize:t.setSize,subtreeEndIndex:og(e,t.cursor,t.index,n)}}function cg(e,t,n,r,i,a){let o=ph(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=fp(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return lg(e,u,l,r+c,i+1,s,o.childIds.length,a)}function lg(e,t,n,r,i,a,o,s){if(!Y(Z(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=bg(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=Z(e,c.terminalNodeId);if(!Y(l)||!vm(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return cg(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function ug(e,t){let n=ag(e);if(t<0||t>=n)return null;let r=cg(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>sh(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=sg(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:Eg(e,r.cursor),setSize:r.setSize,subtreeEndIndex:og(e,r.cursor,r.index,n)}}function dg(e,t,n){let r=e.instrumentation,i=ag(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 Tg(e,o+1);let t=[],n=_g(e,a);for(let r=a;r<=o&&n!=null;r++){let r=Eg(e,n);t.push(r),n=Sg(e,n)}return t}let s=[],c=0,l=0,u=X(r,`store.getVisibleSlice.selectFirstRow`,()=>_g(e,a));for(let t=a;t<=o&&u!=null;t++){let t=X(r,`store.getVisibleSlice.materializeRow`,()=>Eg(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=X(r,`store.getVisibleSlice.advanceCursor`,()=>Sg(e,u))}return Ap(r,`workload.visibleRowsRead`,s.length),Ap(r,`workload.flattenedRowsRead`,c),Ap(r,`workload.flattenedSegmentsRead`,l),s}function fg(e,t=ag(e)){let n=e.instrumentation;return n==null?wg(e,t):X(n,`store.getVisibleTreeProjection`,()=>wg(e,t))}function pg(e){return Cg(fg(e))}function mg(e,t){let n=dh(e,t);if(n==null||n===e.snapshot.rootId||Y(Z(e,n))&&$m(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=Z(e,i).parentId,n=ph(e,t),s=sp(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=pp(a,n,s),t!==o){let n=Z(e,t),a=Qm(e,t);if(!vm(e,t,n)&&a!==i)return null;$m(e,t)===t&&(r+=1)}i=t}return r}function hg(e,t){let n=dh(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Z(e,n);if(!Y(r))throw Error(`Path is not a directory: "${t}"`);return vm(e,n,r)?null:(ym(e,n,!0,r),ch(e,n),Mm({affectedAncestorIds:uh(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function gg(e,t){let n=dh(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Z(e,n);if(!Y(r))throw Error(`Path is not a directory: "${t}"`);return vm(e,n,r)?(ym(e,n,!1,r),ch(e,n),Nm({affectedAncestorIds:uh(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function _g(e,t){return t<0||t>=ag(e)?null:vg(e,e.snapshot.rootId,t,-1)}function vg(e,t,n,r){let i=ph(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?fp(e.snapshot.nodes,i,n):X(a,`store.getVisibleSlice.selectChildIndex`,()=>fp(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return yg(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function yg(e,t,n,r){if(!Y(Z(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=bg(e,t,r);if(n===0)return i;let a=Z(e,i.terminalNodeId);if(!Y(a)||!vm(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return vg(e,i.terminalNodeId,n-1,i.visibleDepth)}function bg(e,t,n){return Y(Z(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:$m(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:X(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>$m(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function xg(e,t){let n=Z(e,t);if(!Y(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:Qm(e,r)!==t}function Sg(e,t){let n=Z(e,t.terminalNodeId);if(Y(n)){let r=ph(e,t.terminalNodeId);if(vm(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:yg(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=Z(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=ph(e,n),o=sp(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 yg(e,s,0,i);xg(e,r)&&i--,r=n}}function Cg(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 wg(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(rg);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=ig(o,y);let x,S=_;if(Y(v))S=f?$m(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:sh(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&&Y(C)&&vm(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 Tg(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(!Y(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:sh(e,f)};continue}let h=l?$m(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=Eg(e,g);let _=i[h];_!=null&&Y(_)&&vm(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function Eg(e,t){let n=Z(e,t.terminalNodeId),r=Y(n)?Dg(e,t):null,i=sh(e,t.terminalNodeId),a=Xp(e.snapshot.segmentTable,n.nameId),o=Y(n)&&ph(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?eh(e,t.headNodeId).map(n=>{let r=Z(e,n);return{isTerminal:n===t.terminalNodeId,name:Xp(e.snapshot.segmentTable,r.nameId),nodeId:n,path:sh(e,n)}}):X(c,`store.getVisibleSlice.flatten.collectSegments`,()=>eh(e,t.headNodeId).map(n=>{let r=Z(e,n);return{isTerminal:n===t.terminalNodeId,name:Xp(e.snapshot.segmentTable,r.nameId),nodeId:n,path:sh(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:Y(n)&&vm(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:Y(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function Dg(e,t){if(t.headNodeId===t.terminalNodeId)return xm(e,t.terminalNodeId);let n=eh(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=xm(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function Og(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||!Y(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&&mp(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&Y(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,mp(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function kg(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Ag=class e{#e;constructor(e={}){let t=kp(e),n=X(t,`store.builder.create`,()=>new pm(e));if(e.preparedInput!=null){let t=um(e.preparedInput);t==null?n.appendPreparedPaths(lm(e.preparedInput),!1):n.appendPresortedPaths(t,dm(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(X(t,`store.preparePathEntries`,()=>fm(r,e)))}let r=X(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=X(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=X(t,`store.state.create`,()=>mm(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:X(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||kg(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&X(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?X(t,`store.state.initializeOpenVisibleCounts`,()=>Og(this.#e)):X(t,`store.state.recomputeCounts`,()=>lh(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return om(e,t)}static prepareInput(e,t={}){return sm(e,t)}static preparePresortedInput(e){return cm(e)}list(e){return X(this.#e.instrumentation,`store.list`,()=>th(this.#e,e))}add(e){X(this.#e.instrumentation,`store.add`,()=>{let t=ag(this.#e);Hm(this.#e,Bm(this.#e,t,nh(this.#e,e)))})}remove(e,t={}){X(this.#e.instrumentation,`store.remove`,()=>{let n=ag(this.#e);Hm(this.#e,Bm(this.#e,n,rh(this.#e,e,t)))})}move(e,t,n={}){X(this.#e.instrumentation,`store.move`,()=>{let r=ag(this.#e),i=ih(this.#e,e,t,n);i!=null&&Hm(this.#e,Bm(this.#e,r,i))})}batch(e){Vm(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 X(this.#e.instrumentation,`store.getVisibleCount`,()=>ag(this.#e))}getVisibleSlice(e,t){return X(this.#e.instrumentation,`store.getVisibleSlice`,()=>dg(this.#e,e,t))}getVisibleRowContext(e){return X(this.#e.instrumentation,`store.getVisibleRowContext`,()=>ug(this.#e,e))}getVisibleTreeProjection(){return pg(this.#e)}getVisibleTreeProjectionData(e){return fg(this.#e,e)}getVisibleIndex(e){return X(this.#e.instrumentation,`store.getVisibleIndex`,()=>mg(this.#e,e))}getPathInfo(e){return X(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=dh(this.#e,e);if(t==null)return null;let n=Z(this.#e,t);return{depth:xp(n),kind:Y(n)?`directory`:`file`,path:sh(this.#e,t)}})}isExpanded(e){return X(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=Z(this.#e,t);return vm(this.#e,t,n)})}expand(e){X(this.#e.instrumentation,`store.expand`,()=>{let t=ag(this.#e),n=hg(this.#e,e);n!=null&&Hm(this.#e,Bm(this.#e,t,n))})}collapse(e){X(this.#e.instrumentation,`store.collapse`,()=>{let t=ag(this.#e),n=gg(this.#e,e);n!=null&&Hm(this.#e,Bm(this.#e,t,n))})}on(e,t){return Om(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return xm(this.#e,t)}markDirectoryUnloaded(e){X(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(ph(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=ag(this.#e);Cm(this.#e,t),Hm(this.#e,Bm(this.#e,n,Pm({affectedAncestorIds:uh(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return X(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=ag(this.#e),r=Sm(this.#e,t);return Hm(this.#e,Bm(this.#e,n,Fm({affectedAncestorIds:uh(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return X(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||xm(this.#e,n)!==`loading`||!Tm(this.#e,n,e.attemptId))return!1;let r=sh(this.#e,n);this.validateChildPatch(r,t);let i=ag(this.#e),a=[];for(let e of t.operations){jg(r,e);let t=ag(this.#e);switch(e.type){case`add`:a.push(Bm(this.#e,t,nh(this.#e,e.path)));break;case`remove`:a.push(Bm(this.#e,t,rh(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=ih(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Bm(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Hm(this.#e,Bm(this.#e,i,Im({affectedAncestorIds:uh(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:sh(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return X(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=ag(this.#e),r=wm(this.#e,t,e.attemptId);return Hm(this.#e,Bm(this.#e,n,Lm({affectedAncestorIds:uh(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:sh(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return X(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=ag(this.#e),i=Em(this.#e,n,e.attemptId,t);return Hm(this.#e,Bm(this.#e,r,Rm({affectedAncestorIds:uh(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:sh(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return X(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(tg(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=ag(this.#e),n=ng(this.#e,e.mode??`stable`);return Hm(this.#e,Bm(this.#e,t,zm({...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=ph(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Np(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=Fp(Hp(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(!Y(Z(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=Z(this.#e,n);vm(this.#e,n,i)||(ym(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=Z(this.#e,e);if(!vm(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=dh(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!Y(Z(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!Y(Z(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=Z(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=Z(this.#e,e),r=Qm(this.#e,e);if(!vm(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 jg(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 Mg=e=>e.startsWith(`f::`)?e.slice(3):e;function Ng(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Pg(e,t){return e===``?t:`${e}/${t}`}function Fg({files:e,path:t,isFolder:n,nextBasename:r}){let i=Mg(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}=Ng(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Pg(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 Ig(e){return e.endsWith(`/`)}function Lg(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 Rg(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 zg(e,t){return t.includes(e)?Rg(t):[e]}function Bg(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 Vg(e,t){return{draggedPaths:e,target:t}}function Hg(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Ig(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function Ug(e,t){return t.kind===`root`||t.directoryPath==null?Lg(e):t.directoryPath}function Wg(e,t){let n=e.map(e=>{let n=Ug(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}}}var Gg=Symbol(`FILE_TREE_RENAME_VIEW`);function Kg(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}var qg=512,Jg=512;function Yg(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Xg(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 Zg(e){return Xg(e).at(-1)??null}function Qg(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}var $g=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},e_=e=>e.toLowerCase();function t_(e){return e.endsWith(`/`)}function n_(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function r_(e){return e.endsWith(`/`)?e.slice(0,-1):e}function i_(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}function a_(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 o_(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function s_(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 o_(e,t.path)?n?e:null:e;case`move`:return a_(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=s_(r,e,n),r==null)return null;return r}}}function c_(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function l_(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 u_(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(!l_(Ag.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 d_(e){switch(e.operation){case`add`:return{...c_(e),operation:`add`,path:e.path};case`remove`:return{...c_(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...c_(e),from:e.from,operation:`move`,to:e.to}}}function f_(e){return{...c_(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>d_(e)),operation:`batch`}}function p_(e){switch(e.operation){case`add`:case`remove`:case`move`:return d_(e);case`batch`:return f_(e);default:return null}}function m_(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=Xg(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 h_(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:m_(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var g_=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=new Set;#z=0;#B;#V=0;#H=!1;#U=0;#W;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=u_({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.#B=this.#se(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ae(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#R=new Set(d),this.#L=f,this.#z=1),this.#Oe(f,!1),r!=null&&this.#Se(r,!1),this.#W=this.#Fe()}destroy(){this.#W?.(),this.#W=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#pe()}focusFirstItem(){this.#ve().length>0&&this.#Me(0)}focusLastItem(){this.#U<=0||(this.#Ne(),this.#Me(this.#U-1))}focusNextItem(){this.#De(1)}focusParentItem(){if(this.#c==null)return;let e=Zg(this.#c);if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t)}focusPath(e){let t=this.#B.getPathInfo(e)?.path??null;if(t==null)return;this.#Ne();let n=this.#Y(t);n>=0&&this.#Me(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Y(t);return n>=0?(this.#Me(n),this.#ve()[n]??t):null}focusPreviousItem(){this.#De(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#X(this.#c)}getFocusedPath(){return this.#c}resolveNearestVisiblePath(e){let t=this.#ve();if(this.#U===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#B.getPathInfo(e)?.path??e,r=this.#Y(n);return r>=0?t[r]??n:this.#J(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#R]}getSelectionVersion(){return this.#z}getVisibleCount(){return this.#U}getVisibleRows(e,t){if(t<e||this.#U===0)return[];let n=Math.max(0,e),r=Math.min(this.#U-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Jg){let e=[];for(let t=n;t<=r;t+=1){let n=this.#B.getVisibleRowContext(t);if(n==null)break;e.push(this.#Q(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ne(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#ye(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.#B.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.#ye(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.#Z(o,i,a,{ancestorPaths:this.#te(a),path:s})})}return this.#B.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.#Z(e,r,r,{ancestorPaths:this.#te(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#U===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#U;r+=1){let i=e+r*t,a=Math.min(this.#U-1,Math.floor(i/t)),o=this.#$(a,r)??(a>0?this.#$(a-1,r):void 0);if(o==null)break;n.push({row:this.#Q(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#B.getPathInfo(e);return t==null?null:this.#X(t.path,t)}selectAllVisiblePaths(){this.#Ne();let e=[...this.#ve()];this.#re(e,this.#c??this.#L)}selectOnlyPath(e){let t=this.#Ae(e);t!=null&&this.#re([t],t)}selectPath(e){let t=this.#Ae(e);t==null||this.#R.has(t)||this.#re([...this.#R,t])}deselectPath(e){let t=this.#Ae(e);t==null||!this.#R.has(t)||this.#re([...this.#R].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.#re([...this.#R].filter(e=>e!==t),t);return}this.#re([...this.#R,t],t)}}selectPathRange(e,t){let n=this.#Ae(e);if(n==null)return;this.#Ne();let r=this.#L,i=r==null?-1:this.#be(r),a=this.#be(n);if(i===-1||a===-1){let e=t?[...this.#R,n]:[n];this.#re(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#ve().slice(o,s+1),l=t?[...this.#R,...c]:c;this.#re(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#U-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ne();let r=this.#ve(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#R);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#re([...o],this.#L??i,!1),this.#Me(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.#Ae(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=zg(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#re([t],t,!1),this.#je(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#we(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Vg(t.draggedPaths,n);(Hg(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Bg(t.target,n)||(this.#i={...t,target:n},this.#we())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#we())}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.#we(),!1;let n=Vg(e.draggedPaths,t);if(Hg(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#we(),!1;let r=Wg(e.draggedPaths,t);if(r==null)return this.#we(),!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.#B.move(e.from,e.to,{collision:e.collision})}else this.#oe(r.operations),this.#B.batch(r.operations)}catch(e){return this.#we(),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.#B.add(e)}remove(e,t={}){this.#B.remove(e,t)}move(e,t,n={}){this.#B.move(e,t,n)}batch(e){this.#B.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.#Se(e,!0)}openSearch(e=``){this.#Se(e,!0)}closeSearch(){this.#Se(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#xe(1)}focusPreviousSearchMatch(){this.#xe(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#B.getPathInfo(e);if(n==null)return!1;let r=n.path,i=t_(r),a=r_(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of Xg(r))this.#B.isExpanded(e)||this.#B.expand(e);return this.#re([r],r,!1),this.#M!=null&&(this.#Se(null,!1),this.#y?.(this.#M)),this.#je(r),this.#T=r,this.#E=n_(r),this.#D=t.removeIfCanceled??!1,this.#we(),!0}[Gg](){return{cancel:()=>{this.#G()},commit:()=>{this.#K()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#q(e)}}}#G(){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,t_(e)?{recursive:!0}:void 0);return}this.#je(e),this.#we()}#K(){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,t_(e)?{recursive:!0}:void 0);return}let t=t_(e),n=Fg({files:this.#B.list(),isFolder:t,nextBasename:this.#E,path:r_(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#je(e),this.#v?.(n.error),this.#we();return}if(n.sourcePath===n.destinationPath){this.#je(e),this.#we();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(i_(n.sourcePath,t),i_(n.destinationPath,t))}#q(e){this.#T==null||this.#E===e||(this.#E=e,this.#we())}resetPaths(e,t={}){let n=this.#B.list().length,r=this.#U,i=u_({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#se(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#L;this.#W?.(),this.#B=a,this.#d.clear(),this.#pe();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!Yg(this.#R,u);this.#R=new Set(u),d&&(this.#z+=1),this.#L=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.#Oe(o,o!=null||u.length>0||this.#L!=null),this.#W=this.#Fe(),this.#we(),this.#Te({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#U-r})}#J(e){this.#Ne();let t=Zg(e),n=Qg(e,t),r=null,i=null;for(let e of this.#ve()){if(Zg(e)!==t)continue;let a=Qg(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Y(e){let t=this.#be(e);if(t!==-1)return t;let n=Xg(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#be(t);if(r!==-1)return r}return this.#ve().length>0?0:-1}#X(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#B.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#ie(r.path):this.#ae(r.path);return this.#d.set(r.path,i),i}#Z(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.#R.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}}#Q(e){return this.#Z(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#$(e,t){let n=this.#B.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ee(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ee(n),n];return this.#a.set(e,r),r}#te(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ee(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ne(e){this.#B.collapse(e)}#re(e,t=this.#L,n=!0){let r=[...new Set(e)],i=!Yg(this.#R,r),a=this.#L!==t;!i&&!a||(this.#R=new Set(r),this.#L=t,i&&(this.#z+=1),n&&this.#we())}#ie(e){return{collapse:()=>{this.#ne(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#Ee(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#B.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#Ie(e)}}}#ae(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#oe(e){let t=this.#B.list();this.#se(t).batch(e)}#se(e,t,n){return new Ag({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ce(){return this.#h??=this.#B.list(),this.#h}#le(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ce()){e.add(t);for(let n of Xg(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#ue(){return this.#g??=this.#ce().map(e_),this.#g}#de(){return this.#f??=this.#le().filter(e=>e.endsWith(`/`)),this.#f}#fe(){return this.#p??=this.#de().map(e_),this.#p}#pe(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#me(){return this.#de().filter(e=>this.#B.isExpanded(e))}#he(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#R)for(let n of Xg(e))t.add(n);this.#ge(t)}#ge(e){this.#H=!0;try{for(let t of this.#de()){let n=e.has(t),r=this.#B.isExpanded(t);n&&!r?this.#B.expand(t):!n&&r&&this.#B.collapse(t)}}finally{this.#H=!1}}#_e(){let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#M==null||this.#M.length===0||this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#U=this.#V;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.#U=n.length}#ve(){return this.#I??this.#b}#ye(e){return this.#F?.[e]??e}#be(e){return this.#P?.get(e)??this.#B.getVisibleIndex(e)??-1}#xe(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)}#Se(e,t){let n=e==null?null:$g(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#me()),this.#M=n,n==null)this.#he(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else if(n.length===0)this.#he(!1),this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else{let e=this.#Ce();this.#Oe(e,!0)}t&&(this.#y?.(this.#M),this.#we())}}#Ce(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ce(),n=this.#ue(),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.#de(),s=this.#fe();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 Xg(e))l.add(t),c?.add(t)}return this.#ge(l),a??this.#c}#we(){for(let e of this.#t)e()}#Te(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#Ee(e){for(let t of Xg(e))this.#B.isExpanded(t)||this.#B.expand(t);this.#B.isExpanded(e)||this.#B.expand(e)}#De(e){let t=this.#U;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.#Ne(),this.#Me(r))}#Oe(e,t=!0){let n=this.#B.getVisibleCount();this.#V=n;let r=h_(this.#B.getVisibleTreeProjectionData(t?void 0:Math.min(n,qg)),e,t?e=>this.#B.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.#_e(),this.#s=e==null?this.#ve().length>0?0:-1:this.#Y(e),this.#c=this.#s<0?null:this.#ke(this.#s)}#ke(e){return this.#ve()[e]??(this.#F==null?this.#B.getVisibleRowContext(e)?.row.path??null:null)}#Ae(e){return this.#B.getPathInfo(e)?.path??null}#je(e){if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t,!1)}#Me(e,t=!0){let n=this.#ke(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#we()))}#Ne(){this.#l||this.#Oe(this.#c,!0)}#Pe(e){let t=s_(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=s_(this.#c,e,!0),r=[...this.#R].map(t=>s_(t,e)).filter(e=>e!=null).map(e=>this.#B.getPathInfo(e)?.path??null).filter(e=>e!=null),i=s_(this.#L,e),a=i==null?null:this.#B.getPathInfo(i)?.path??null,o=[...new Set(r)];return Yg(this.#R,o)||(this.#R=new Set(o),this.#z+=1),this.#L=a,n}#Fe(){return this.#B.on(`*`,e=>{if(this.#H)return;e.canonicalChanged&&(this.#d.clear(),this.#pe()),this.#i!=null&&Kg(e)&&(this.#i=null);let t=Kg(e)?this.#Pe(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ce():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#Oe(n,r),this.#we();let i=p_(e);i!=null&&this.#Te(i)})}#Ie(e){if(this.#B.isExpanded(e)){this.#ne(e);return}this.#Ee(e)}},__=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 v_(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 y_(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 b_(e,t){return t?`${e}/`:e}function x_(e,t=null){let n=__(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=v_(t.path);if(e==null)continue;let n=b_(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 y_(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var S_=e=>e.trim().toLowerCase(),C_=e=>e.split(`/`).at(-1)??e,w_=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 T_(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function E_(e){let t=Bf(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(S_(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=C_(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return T_(c,e);for(let[t,n]of a)if(s.includes(t))return T_(n,e);let l=w_(n);for(let t of l){let n=i.get(t);if(n!=null)return T_(n,e)}let u=Rf(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:If(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:T_(s,e)}}}var D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_={},R_=[],z_=Array.isArray,B_=R_.slice,V_=Object.assign;function H_(e){e&&e.parentNode&&e.remove()}function U_(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?B_.call(arguments,2):n),W_(e,o,r,i,null)}function W_(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??++O_,__i:-1,__u:0};return i==null&&D_.vnode!=null&&D_.vnode(a),a}function G_(e){return e.children}function K_(e,t){this.props=e,this.context=t,this.__g=0}function q_(e,t){if(t==null)return e.__?q_(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`?q_(e):null}function J_(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 J_(e)}}function Y_(e){(8&e.__g||!(e.__g|=8)||!k_.push(e)||j_++)&&A_==D_.debounceRendering||((A_=D_.debounceRendering)||queueMicrotask)(X_)}function X_(){for(var e,t,n,r,i,a,o,s,c=1;k_.length;)k_.length>c&&k_.sort(M_),e=k_.shift(),c=k_.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=V_({},r)).__v=r.__v+1,D_.vnode&&D_.vnode(n),iv(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??q_(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,ov(a,n,o),n.__e!=i&&J_(n)));j_=0}function Z_(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||R_,b=t.length;for(c=Q_(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?L_:y[m.__i]||L_,m.__i=f,_=iv(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&lv(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=$_(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Q_(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?W_(null,o,null,null,null):z_(o)?W_(G_,{children:o},null,null,null):o.constructor==null&&o.__b>0?W_(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=ev(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=q_(s)),uv(s,s));return r}function $_(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=$_(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=q_(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ev(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){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 tv(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function nv(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||tv(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||tv(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(N_,`$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=P_,e.addEventListener(t,a?I_:F_,a)):e.removeEventListener(t,a?I_:F_,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 rv(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=P_++;else if(t.u<n.l)return;return n(D_.event?D_.event(t):t)}}}function iv(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=D_.__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 K_(v,x),f.constructor=M,f.render=dv),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=V_({},f.__s)),V_(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=D_.__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=V_({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===G_&&d.key==null&&(E=sv(d.props.children)),s=Z_(e,z_(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--;)H_(a[j]);av(t)}else t.__e=n.__e,t.__k=n.__k,e.then||av(t);D_.__e(e,t,n)}else s=t.__e=cv(n.__e,t,n,r,i,a,o,c,l,u);return(d=D_.diffed)&&d(t),128&t.__u?void 0:s}function av(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(av)}function ov(e,t,n){for(var r=0;r<n.length;r++)lv(n[r],n[++r],n[++r]);D_.__c&&D_.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){D_.__e(e,t.__v)}})}function sv(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:z_(e)?e.map(sv):V_({},e)}function cv(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&&=(D_.__m&&D_.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=B_.call(e.childNodes),v=n.props||L_,!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;nv(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&&!_||nv(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=``),Z_(b==`template`?e.content:e,z_(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&q_(n,0),s,c,l),a!=null)for(u=a.length;u--;)H_(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||nv(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&nv(e,u,g,v[u],i))}return e}function lv(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){D_.__e(e,n)}}function uv(e,t,n){var r,i;if(D_.unmount&&D_.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||lv(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){D_.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&uv(r[i],t,n||typeof e.type!=`function`);n||H_(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function dv(e,t,n){return this.constructor(e,n)}function fv(e,t){var n,r,i,a;t==document&&(t=document.documentElement),D_.__&&D_.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=U_(G_,null,[e]),i=[],a=[],iv(t,e,r||L_,L_,t.namespaceURI,r?null:t.firstChild?B_.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),ov(i,e,a)}function pv(e,t){e.__u|=32,fv(e,t)}D_={__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 j_=0,e}},O_=0,K_.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=V_({},this.state);typeof e==`function`&&(e=e(V_({},n),this.props)),e&&V_(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Y_(this))},K_.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Y_(this))},K_.prototype.render=G_,k_=[],j_=0,M_=function(e,t){return e.__v.__b-t.__v.__b},N_=/(PointerCapture)$|Capture$/i,P_=0,F_=rv(!1),I_=rv(!0);var mv=0;Array.isArray;function Q(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:--mv,__i:-1,__u:0,__source:i,__self:a};return D_.vnode&&D_.vnode(l),l}var hv=16,gv=16,_v={};function vv({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}=_v[e]??{width:hv,height:gv},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Q(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:Q(`use`,{href:c})})}var yv=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},bv=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)]},xv=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)]},Sv=(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)]},Cv=(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)]},wv=(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 Tv({children:e,marker:t,variant:n=`default`}){"use no memo";return Q(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Q(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Q(`span`,{"data-truncate-fade":!0}):t})})}function Ev(e){"use no memo";let{mode:t,children:n}=e;return Q(`div`,{children:[Q(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Q(`span`,{children:n}):n}),Q(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Q(`span`,{children:n}):n})]})}function Dv({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Q(Ev,{mode:t,children:e},`content`),o=Q(Tv,{marker:n,mode:t,variant:r},`marker`),s=Q(`div`,{"data-truncate-fill":!0},`fill`);return Q(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Q(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function Ov({children:e,...t}){"use no memo";return Q(Dv,{mode:`truncate`,...t,children:e})}function kv({children:e,...t}){"use no memo";return Q(Dv,{mode:`fruncate`,...t,children:e})}function Av({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=Q(Ov,{...s,children:t[0]}),l=Q(kv,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Q(`div`,{className:a,style:o});if(e.length<i)return Q(n===`end`?kv:Ov,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=yv:r===`extension`?t=bv:r===`leaf-path`&&(t=xv);else if(typeof r==`number`)t=Sv,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=Cv:e===`first`&&(t=wv)}else typeof r==`function`&&(t=r);t??=yv;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=Q(Ov,{...s,..._,children:f}),l=Q(kv,{...s,...v,children:p})}return Q(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Q(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Q(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var jv={endIndex:-1,startIndex:-1};function Mv(e,t,n){return Math.min(Math.max(e,t),n)}function Nv(e,t){return e<0||t<e?jv:{endIndex:t,startIndex:e}}function Pv(e){return e.startIndex<0||e.endIndex<e.startIndex}function Fv(e,t){return Pv(e)?0:(e.endIndex-e.startIndex+1)*t}function Iv(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function Lv(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function Rv(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 zv(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 Bv(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 Vv(e,t,n){if(e.length===0||t<=0)return[];let r=Bv(e),i=Rv(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=zv(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 Hv(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=Mv(t.scrollTop,0,o),c=t.stickyRows??Vv(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=Iv(s,n,t.itemHeight),m=Iv(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?jv:Nv(m,Lv(u+d,n,t.itemHeight)),y=g+1,b=Pv(v)?jv:Nv(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Fv(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:Pv(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var Uv={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},Wv={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},Gv=`Contains git status items`;function Kv(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function qv(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 Jv(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}}function Yv(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 Xv(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}var Zv,Qv,$v,ey,ty=Object.is,ny=0,ry=[],iy=D_,ay=iy.__b,oy=iy.__r,sy=iy.diffed,cy=iy.__c,ly=iy.unmount,uy=iy.__;function dy(e,t){iy.__h&&iy.__h(Qv,e,ny||t),ny=0;var n=Qv.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function fy(e){return ny=1,py(wy,e)}function py(e,t,n){var r=dy(Zv++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):wy(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);ty(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Qv,!Qv.__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,ty(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Qv.__f=!0;var a=Qv.shouldComponentUpdate,o=Qv.componentWillUpdate;Qv.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)},Qv.shouldComponentUpdate=i}return r.__N||r.__}function my(e,t){var n=dy(Zv++,3);!iy.__s&&Cy(n.__H,t)&&(n.__=e,n.u=t,Qv.__H.__h.push(n))}function hy(e,t){var n=dy(Zv++,4);!iy.__s&&Cy(n.__H,t)&&(n.__=e,n.u=t,Qv.__h.push(n))}function $(e){return ny=5,gy(function(){return{current:e}},[])}function gy(e,t){var n=dy(Zv++,7);return Cy(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function _y(e,t){return ny=8,gy(function(){return e},t)}function vy(){for(var e;e=ry.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xy),e.__H.__h.forEach(Sy),e.__H.__h=[]}catch(t){e.__H.__h=[],iy.__e(t,e.__v)}}iy.__b=function(e){Qv=null,ay&&ay(e)},iy.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),uy&&uy(e,t)},iy.__r=function(e){oy&&oy(e),Zv=0;var t=(Qv=e.__c).__H;t&&($v===Qv?(t.__h=[],Qv.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(xy),t.__h.forEach(Sy),t.__h=[],Zv=0)),$v=Qv},iy.diffed=function(e){sy&&sy(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ry.push(t)!==1&&ey===iy.requestAnimationFrame||((ey=iy.requestAnimationFrame)||by)(vy)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),$v=Qv=null},iy.__c=function(e,t){t.some(function(e){try{e.__h.forEach(xy),e.__h=e.__h.filter(function(e){return!e.__||Sy(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],iy.__e(n,e.__v)}}),cy&&cy(e,t)},iy.unmount=function(e){ly&&ly(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{xy(e)}catch(e){t=e}}),n.__H=void 0,t&&iy.__e(t,n.__v))};var yy=typeof requestAnimationFrame==`function`;function by(e){var t,n=function(){clearTimeout(r),yy&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);yy&&(t=requestAnimationFrame(n))}function xy(e){var t=Qv,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Qv=t}function Sy(e){var t=Qv;e.__c=e.__(),Qv=t}function Cy(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!ty(t,e[n])})}function wy(e,t){return typeof t==`function`?t(e):t}function Ty(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 Ey(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 Dy({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Q(`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 Oy(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Q(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Q(G_,{children:[Q(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Q(Ov,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function ky(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Ay(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function jy(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 My({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=Hv(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:jy(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?jy(u,1,t,o):i&&r<=0&&c.length>0?Vv(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 Ny=400,Py=10,Fy=40,Iy=18;function Ly(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))?Ry(e,t,n):a instanceof HTMLElement?a:null}function Ry(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 zy(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 By(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 Vy(){return navigator.vendor!==`Apple Computer, Inc.`}function Hy(e,t){let n=e-t.top;if(n<Fy)return-Math.ceil((Fy-Math.max(0,n))/Fy*Iy);let r=t.bottom-e;return r<Fy?Math.ceil((Fy-Math.max(0,r))/Fy*Iy):0}function Uy(e,t){if(e!=null){let t=Uv[e];return t==null?null:{text:t,title:Wv[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:Gv}:null}function Wy(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 Gy(e){return e!=null&&`toggle`in e}function Ky(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function qy(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Jy(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function Yy(e,t){return e!=null&&e>0?e:t}function Xy(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 Zy(e,t,n,r,i=0){let a=Yv({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Qy(e,t,n,r,i,a){let o=Xv({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function $y(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function eb(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function tb(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function nb(e,t){return t&&tb(e)||(e.ctrlKey||e.metaKey)&&Ky(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var rb=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function ib(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 ab(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 ob(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function sb(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function cb(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function lb(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 ub(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 db(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 fb(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=db(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 pb(e,t){return{kind:e.kind,name:Ay(e),path:t}}function mb(e){return e==null?void 0:`${e}__tree`}function hb(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function gb(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function _b(e,t){if(e==null)return null;if(`text`in e)return Q(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?gb(e.icon)?t(e.icon):{name:e.icon}:gb(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Q(`span`,{title:e.title,children:Q(vv,{...n})})}function vb(e){e!=null&&Ty(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function yb(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=ky(e);return Q(G_,{children:[e.depth>0?Q(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Q(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Q(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Q(vv,{...t(`file-tree-icon-chevron`)}):Q(vv,{...t(`file-tree-icon-file`,u)})}),Q(`div`,{"data-item-section":`content`,children:e.isFlattened?Oy(e,c,a):c??Q(Av,{minimumLength:5,split:`extension`,children:e.name})}),i?Q(`div`,{"data-item-section":`decoration`,children:r==null?null:_b(r,t)}):null,s?Q(`div`,{"data-item-section":`git`,children:_b(o,t)}):null,n?Q(`div`,{"data-item-section":`action`,children:l?Q(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Q(vv,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function bb(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=ky(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,ee=_?.get(P)??null??Wy(t.ancestorPaths,v,y),te=t.kind===`directory`&&(b?.has(P)??!1),ne=A(t,P),re=Uy(ee,te),z=S&&w,B=ne!=null||x||z,V=z&&T===`always`,ie=a.getPath()===P,ae=ie?a.getValue():``,oe=R||!ie?null:Q(Dy,{ref:D,ariaLabel:`Rename ${Ay(t)}`,isFlattened:t.isFlattened,value:ae,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),H=yb(t,k,{actionLaneEnabled:z,customDecoration:ne,decorationLaneEnabled:B,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:re,gitLaneActive:x,renameInput:oe,showDecorativeActionAffordance:V}),se={...qv({ariaLabel:Ay(t),domId:t.isFocused?hb(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:z,contextMenuButtonVisibility:z?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:te,effectiveGitStatus:ee,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.focusPath(P),j(t,P,{anchorRect:ob(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusPath(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&ie?Q(`div`,{...se,children:H}):Q(`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:H})}function xb(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(ky(e))).map((n,r)=>bb(e,n,t.start+r))}function Sb({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Uf,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 _=$(null),v=$(null),y=$(!1),b=$(null),x=$(null),S=$(null),C=$(null),w=$(null),T=$(new Map),E=$(new Map),D=$(()=>{}),O=$(null),k=$(!1),A=$(null),j=$(null),M=$(!1),N=$(null),P=$(null),F=$(null),I=$(null),L=$(null),R=$(null),ee=$(null),te=$(null),ne=$(!1),re=$(null),z=$(null),B=$(null),V=$(null),ie=gy(()=>new Map,[]),[,ae]=fy(0),[oe,H]=fy(null),[se,ce]=fy(null),[le,ue]=fy(null),[de,fe]=fy(null),[pe,me]=fy(0),[U,he]=fy(null),ge=$(U);ge.current=U;let W=$(null),_e=$(null),ve=$(null),ye=$(null),be=$(null),xe=$(!1),Se=()=>{_e.current=null,ve.current=null,ye.current=null},Ce=(e,t)=>{_e.current=e,ve.current=null,ye.current=t==null?null:{path:e,scrollTop:t}},we=(e,t)=>{_e.current=null,ve.current={path:e,viewportOffset:t},ye.current=null},Te=$(d===`retain`&&t.isSearchOpen()),[Ee,De]=fy(p);my(()=>{p||De(!1)},[p]);let Oe=$(!1),ke=_y(()=>{Oe.current=!0,De(e=>e&&!1)},[]),[Ae,je]=fy(()=>My({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Me,Ne]=fy(!1);my(()=>{Ne(!0)},[]);let Pe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Fe=e?.contextMenu?.triggerMode??(Pe?`right-click`:`both`),Ie=Fe===`both`||Fe===`button`,Le=e?.contextMenu?.buttonVisibility??`when-needed`,Re=Fe===`both`||Fe===`right-click`;hy(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;be.current=t,ce(t),fe(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(xe.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 ze=_y((e,t)=>{cb(T.current,e,t)},[]),Be=_y((e,t)=>{cb(E.current,e,t)},[]),Ve=_y(e=>{x.current=e},[]),He=_y(e=>lb(e,E.current,T.current),[]),Ue=n!=null||r!=null||i!=null,{resolveIcon:We}=gy(()=>E_(a),[a]),Ge=t[Gg](),Ke=Ge.getPath(),qe=Ke!=null,Je=t.isSearchOpen(),Ye=t.getSearchValue(),G=t.getFocusedPath(),Xe=t.getFocusedIndex(),Ze=t.isDragAndDropEnabled(),Qe=t.getDragSession(),$e=gy(()=>Qe==null?null:new Set(Qe.draggedPaths),[Qe]),et=Qe?.target??null,tt=Qe?.primaryPath??null,nt=mb(o),{overlayHeight:rt,overlayRows:it,snapshot:K,visibleRows:at}=Ae,ot=K.physical.viewportHeight,st=gy(()=>({end:K.window.endIndex,start:K.window.startIndex}),[K.window.endIndex,K.window.startIndex]),ct=it,lt=K.sticky.rows,ut=K.physical.totalHeight,dt=K.sticky.height,ft=gy(()=>new Set(lt.map(e=>ky(e.row))),[lt]),pt=Xe>=0&&Xe>=st.start&&Xe<=st.end,mt=_y((e,t)=>u?.({item:pb(e,t),row:e})??null,[u]),ht=_y(e=>Ty(e==null?null:T.current.get(e)??null)?!0:Ty(S.current),[]),gt=_y(e=>{ht(t.focusNearestPath(e))},[t,ht]),_t=$(gt);_t.current=gt;let vt=$(!0),yt=$(()=>{}),bt=_y((t=!0)=>{let n=ge.current;n!=null&&(vt.current=vt.current&&t,he(null),e?.contextMenu?.onClose?.(),vt.current&&gt(n.path))},[e?.contextMenu,gt]);yt.current=bt;let xt=_y(e=>{let t=e==null?null:sb(S.current,e);ue(e=>e===t?e:t)},[]),St=_y((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=He(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ce(n,e?.scrollTop??null),k.current=!0,H(e=>e===n?e:n)}i.focus(),xt(a),vt.current=!0,he({anchorRect:r?.anchorRect??null,item:pb(e,n),path:n,source:r?.source??`keyboard`})},[t,He,xt]),Ct=_y(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=Jy(e,ot);N.current=Xe<0||e==null?null:Math.max(0,Math.min(Xe*s-e.scrollTop,Math.max(0,t-s))),M.current=!0}t.startRenaming(e)!==!1&&(fe(`focus`),ae(e=>e+1))}},[t,Xe,s,l,ot]),wt=_y((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=Jy(i,ot),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:My({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return k.current=!0,Qy(i,a,s,l,u,d),D.current(),W.current=n?e:null,!0},[t,s,c,ot,h]),Tt=()=>y.current===!0||V.current!=null||ne.current===!0,Et=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Dt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ot=()=>{I.current!=null&&(clearTimeout(I.current),I.current=null),F.current=null},kt=()=>{R.current?.remove(),R.current=null},At=()=>{Dt(P.current),P.current=null,L.current=null},jt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Mt=()=>{te.current?.(),te.current=null,V.current!=null&&(clearTimeout(V.current),V.current=null),ne.current=!1,re.current=null,B.current=null,z.current!=null&&(z.current.setAttribute(`draggable`,`true`),z.current.style.removeProperty(`touch-action`),z.current=null),kt(),Ot(),At(),ee.current=null},Nt=(e,n)=>{let r=S.current?.getRootNode(),i=zy(Ly(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Pt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ot();return}let r=t.getItem(e.directoryPath),i=Gy(r)?r:null;if(i==null||i.isExpanded()){Ot();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;F.current!==a&&(Ot(),F.current=a,I.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Ft=()=>{P.current=null;let e=L.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Hy(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()),Pt(Nt(e.clientX,e.clientY)),P.current=Et(Ft)},It=(e,t)=>{L.current={clientX:e,clientY:t},P.current??=Et(Ft)},Lt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Mt(),kt(),Ot(),At(),t.startDrag(r)===!1){e.preventDefault();return}if(ee.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),Vy())){let t=By(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),jt(t),R.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Rt=()=>{kt(),Ot(),At(),ee.current=null,t.cancelDrag()},zt=(e,n,r)=>{if(V.current!=null||ne.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;B.current={clientX:i.clientX,clientY:i.clientY},z.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!ne.current;V.current!=null&&(clearTimeout(V.current),V.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),te.current===o&&(te.current=null),t&&(a.setAttribute(`draggable`,`true`),z.current===a&&(z.current=null),B.current=null)},s=e=>{let t=e.touches[0],n=B.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=Py*Py||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),te.current=o,V.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),z.current===a&&(z.current=null),B.current=null;return}ne.current=!0,z.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),ee.current=n;let e=a.getBoundingClientRect(),s=By(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`}),jt(s),R.current=s,re.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=re.current;n!=null&&R.current!=null&&(R.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Pt(Nt(t.clientX,t.clientY)),It(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Nt(n.clientX,n.clientY),t.completeDrag(),Mt()},u=()=>{t.cancelDrag(),Mt()};te.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)},Ny)},Bt=e=>{if(U!=null){if(e.key===`Escape`){bt(),e.preventDefault(),e.stopPropagation();return}rb.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ge.isActive()){if(e.key===`Escape`)Ge.cancel();else if(e.key===`Enter`)Ge.commit();else return;fe(`focus`),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ct(G??void 0),e.preventDefault(),e.stopPropagation();return}if(Je){if(e.key===`Escape`)M.current=!1,N.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=Jy(n,ot);N.current=Xe<0||n==null?null:Math.max(0,Math.min(Xe*s-n.scrollTop,Math.max(0,r-s))),M.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;fe(`focus`),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&qy(e)){t.openSearch(e.key),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Pe&&tb(e),r=nb(e,Pe),i=r&&S.current!=null?Ey(S.current):null,a=r?new Set(ub(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==G&&a.has(o)){let e=C.current;Ce(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=Gy(p)?p:null,h=u!=null&&(ft.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=lb(u,E.current,T.current);e==null||n==null?y=!1:St(e,u)}else if((e.ctrlKey||e.metaKey)&&Ky(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;fe(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ft.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ce(b,v?.scrollTop??null),k.current=!0,H(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(we(b,fb(S.current,v,i,u,s,dt,ot)),k.current=!0,H(e=>e===b?e:b)):Se()}ae(e=>e+1),e.preventDefault(),e.stopPropagation()};hy(()=>{if(!(!f||!Je)){if(Te.current){Te.current=!1;return}Ty(w.current)}},[Je,f]),hy(()=>{let e=x.current;switch(Kv({hasRenderedInput:e!=null,previousRenamingPath:j.current,renamingPath:Ke})){case`reset`:j.current=null;return;case`reveal-canonical`:Ke!=null&&wt(Ke,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(W.current=null,j.current=Ke,Ty(e),e.select());return}},[st.end,st.start,Ke,wt,ft]),hy(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=Ey(e)?.dataset.itemPath??null;H(e=>e===t?e:t)},i=()=>{n(),k.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,Ey(e)!=null){r();return}k.current=!1,H(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),k.current=!1,H(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;H(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),hy(()=>{let e=S.current;e!=null&&(K.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[K.physical.scrollTop]),hy(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=Jy(n,g);let a=()=>{let e=t.getVisibleCount(),r=Yy(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),je(My({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};D.current=a;let o=!1,l=t.subscribe(()=>{o?ae(e=>e+1):o=!0,a()}),u=()=>{xe.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,me(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||xe.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ge.current!=null&&y.current&&yt.current(),xe.current===!0){y.current=!1;return}ce(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:Xy(e[0]))??Jy(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]),hy(()=>{Pe||U==null||bt(!1)},[bt,Pe,U]);let Vt=gy(()=>U==null?null:`${U.path}::${U.source}`,[U]);hy(()=>{if(Vt==null){m?.clearSlotContent(yd);return}let t=ge.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??ab(n.getBoundingClientRect()),close:e=>{yt.current(e?.restoreFocus??!0)},restoreFocus:()=>{vt.current&&_t.current(ge.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(yd,i),e?.contextMenu?.onOpen?.(t.item,r),vb(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&vb(i)}),()=>{m?.clearSlotContent(yd)}},[Vt,e?.contextMenu,m]),hy(()=>{U!=null&&t.getItem(U.path)==null&&bt()},[bt,U,t]),hy(()=>{if(U==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(ib(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&bt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),bt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[bt,U]),hy(()=>{let e=C.current,t=S.current;if(e==null||t==null){A.current=G;return}let n=G==null?null:T.current.get(G)??null,r=Ey(t),i=r?.dataset.itemPath??null,a=qe&&x.current===r,o=f&&w.current===r,c=M.current&&!Je,l=N.current??0,u=W.current,d=_e.current,p=ve.current,m=ye.current,h=r!=null,g=k.current||h,_=A.current!==G,v=d!=null&&d===G&&G!=null,y=c&&Qy(e,Xe,s,ot,ut,l),b=u!=null&&u===G&&Qy(e,Xe,s,ot,ut,dt),E=p!=null&&p.path===G&&Qy(e,Xe,s,ot,ut,p.viewportOffset),O=m!=null&&m.path===G&&e.scrollTop!==m.scrollTop;if(O&&(e.scrollTop=m.scrollTop),(O||b||E||y||g&&_&&u!==G&&!v&&Zy(e,Xe,s,ot,dt))&&D.current(),!g){A.current=G;return}if(a){A.current=G;return}if(o&&!c){A.current=G;return}if(n==null){c&&Xe>=0&&(Qy(e,Xe,s,ot,ut,l),D.current()),A.current=G;return}(_||c||u===G||d===G||p?.path===G||m?.path===G||i==null||i!==G)&&(Ty(n),u===G&&(W.current=null),d===G&&(_e.current=null),p?.path===G&&(ve.current=null),m?.path===G&&(ye.current=null),M.current=!1,N.current=null),A.current=G},[t,Xe,G,pt,s,qe,Je,st,ot,f,dt,ut,at]);let Ht=Xe>=0&&Xe>=K.visible.startIndex&&Xe<=K.visible.endIndex,Ut=G!=null&&ct.some(e=>ky(e.row)===G),Wt=Ht||Ut,Gt=Ie&&k.current===!0&&Wt?G:null,Kt=de===`pointer`?se:null,qt=U?.path??be.current??Kt??Gt??se,Jt=U?.source===`right-click`;hy(()=>{y.current&&U==null||xt(He(qt))},[U,He,st,ot,pe,ct,qt,xt,at]);let Yt=_y(e=>{if(y.current||ib(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&&fe(e=>e===`pointer`?e:`pointer`),ce(e=>e===i?e:i)},[]),Xt=_y(()=>{ce(null)},[]);hy(()=>{if(!Ze)return;let e=()=>{Mt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Mt(),t.cancelDrag()}},[t,Ze]);let Zt=e=>{if(!Ze||t.getDragSession()==null||ne.current)return;let n=zy(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Pt(t.getDragSession()?.target??null),It(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},Qt=e=>{if(!Ze||t.getDragSession()==null||ne.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ot(),At(),t.setDragTarget(null))},$t=e=>{!Ze||t.getDragSession()==null||ne.current||(e.preventDefault(),Nt(e.clientX,e.clientY),t.completeDrag(),kt(),Ot(),At(),ee.current=null)},en=K.window.height,tn=K.window.offsetTop,nn=Math.min(0,ot-en-dt),rn=oe===G||M.current,an=G!=null&&rn&&!pt&&Xe>=0?at[Xe]??t.getVisibleRows(Xe,Xe)[0]??null:null,on=an==null?null:$y(Xe,s,st,en),sn=ee.current,cn=tt!=null&&sn!=null&&sn.path===tt&&sn.index>=st.start&&sn.index<=st.end,ln=tt!=null&&sn!=null&&sn.path===tt&&!cn&&sn.path!==an?.path?sn:null,un=ln==null?null:$y(ln.index,s,st,en),dn=eb((Xe>=0?at[Xe]??t.getVisibleRows(Xe,Xe)[0]??null:null)?.ancestorPaths.at(-1)??null),fn=Je&&G!=null?hb(o,G,!pt):void 0,pn=U?.path??(Je?G:oe),mn=U?.path??se,hn=He(qt),gn=Pe&&Ie&&!Jt&&!qe&&hn!=null&&le!=null&&qt!=null,_n=Pe&&(gn||U!=null),vn=U?.anchorRect,yn=vn==null&&hn!=null&&le!=null&&(U!=null||gn)?le:null,bn=vn==null?yn==null?void 0:{top:`${yn}px`}:{left:`${vn.left}px`,position:`fixed`,right:`auto`,top:`${vn.top}px`},xn=Jt?{opacity:`0`}:void 0,Sn=_y((e,n,r,i)=>{let a=t.getItem(r),o=Jv({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:t.isSearchOpen(),mode:i});switch(o.selection.kind){case`range`:t.selectPathRange(r,o.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(r);break;case`single`:t.selectOnlyPath(r);break}let s=e.currentTarget instanceof HTMLElement?e.currentTarget:null,c=n.index>=K.visible.startIndex&&n.index<=K.visible.endIndex,l=i===`flow`&&c&&s!=null&&s.dataset.itemParked!==`true`;a?.focus(),l&&(k.current=!0,H(e=>e===r?e:r),fe(`focus`)),o.toggleDirectory&&Gy(a)&&a.toggle(),o.closeSearch&&t.closeSearch(),o.revealCanonical&&wt(r,{targetOffset:`sticky-parents`})},[t,K.visible.endIndex,K.visible.startIndex,wt]),Cn=()=>{if(y.current||!Ie||qt==null||hn==null)return;let e=t.getItem(qt);e!=null&&(xt(hn),vt.current=!0,he({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:hn.getAttribute(`aria-label`)??qt,path:e.getPath()},path:e.getPath(),source:`button`}))},wn={contextHoverPath:mn,contextMenuButtonTriggerEnabled:Ie,contextMenuButtonVisibility:Le,contextMenuEnabled:Pe,contextMenuRightClickEnabled:Re,contextMenuTriggerMode:Fe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:Ze,draggedPathSet:$e,dragTarget:et,gitLaneActive:Ue,gitStatusByPath:n,handleRowDragEnd:Rt,handleRowDragStart:Lt,handleRowTouchStart:zt,ignoredGitDirectories:r,ignoredInheritanceCache:ie,instanceId:o,itemHeight:s,onKeyDown:Bt,onRowClick:Sn,openContextMenuForRow:St,registerButton:ze,registerRenameInput:Ve,renameView:Ge,renderDecorationForRow:mt,resolveIcon:We,shouldSuppressContextMenu:Tt,visualFocusPath:pn},Tn={...wn,registerButton:Be};return Q(`div`,{ref:S,id:nt,"data-file-tree-context-menu-button-visibility":Pe&&Ie?Le:void 0,"data-file-tree-context-menu-trigger-mode":Pe?Fe:void 0,"data-file-tree-has-context-menu-action-lane":Pe&&Ie?`true`:void 0,"data-file-tree-has-git-lane":Ue?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:Ze?Qt:void 0,onDragOver:Ze?Zt:void 0,onDrop:Ze?$t:void 0,onKeyDown:Bt,onPointerLeave:Pe?Xt:void 0,onPointerOver:Pe?Yt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Q(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:dn}}),Q(`slot`,{name:vd,"data-type":`header-slot`}),f?Q(`div`,{"data-file-tree-search-container":!0,"data-open":Je?`true`:`false`,children:Q(`input`,{ref:w,"aria-activedescendant":fn,"aria-controls":nt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ee?`true`:void 0,value:Ye,onBlur:()=>{d===`retain`&&!Oe.current||t.closeSearch()},onFocus:ke,onPointerDown:ke,onInput:e=>{ke();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Q(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Me&&ct.length>0?Q(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Q(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${rt}px`},children:ct.map((e,t)=>bb(Tn,e.row,`sticky:${ky(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${ct.length-t}`}}))})}):null,Q(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ut}px`},children:[Q(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${tn}px`}}),Q(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${en}px`,top:`${nn}px`,bottom:`${nn}px`},children:[xb(wn,st,ft),an!=null&&on!=null?bb(wn,an,`parked:${an.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:tt===an.path?`none`:void 0,position:`absolute`,right:`0`,top:`${on}px`}}):null,ln!=null&&un!=null?bb(wn,ln,`parked-drag:${ln.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${un}px`}}):null]})]})]}),Pe?Q(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":_n?`true`:`false`,style:bn,children:[Q(`button`,{ref:v,type:`button`,"data-type":bd,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":U==null?`false`:`true`,"data-visible":gn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),U!=null){bt();return}Cn()},tabIndex:-1,style:xn,children:Q(vv,{...We(`file-tree-icon-ellipsis`)})}),U==null?null:Q(`slot`,{name:yd})]}):null,U==null?null:Q(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),bt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),bt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var Cb={hydrateRoot:(e,t)=>{pv(U_(Sb,t),e)},renderRoot:(e,t)=>{fv(U_(Sb,t),e)},unmountRoot:e=>{fv(null,e)}};function wb(e,t){Cb.renderRoot(e,t)}function Tb(e,t){Cb.hydrateRoot(e,t)}function Eb(e){Cb.unmountRoot(e)}var Db=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)}}},Ob=`__c`,kb=`__k`,Ab=`__d`,jb=`__s`,Mb=/[\s\n\\/='"\0<>]/,Nb=/^(xlink|xmlns|xml)([A-Z])/,Pb=/^(?: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])/,Fb=/^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/,Ib=new Set([`draggable`,`spellcheck`]);function Lb(e){e.__g===void 0?e[Ab]=!0:e.__g|=8}function Rb(e){e.__g===void 0?e[Ab]=!1:e.__g&=-9}function zb(e){return e.__g===void 0?!0===e[Ab]:!!(8&e.__g)}var Bb=/["&<]/;function Vb(e){if(e.length===0||!1===Bb.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 Hb={},Ub=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(`.`)),Wb=/[A-Z]/g;function Gb(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:Hb[n]||(Hb[n]=n.replace(Wb,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||Ub.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function Kb(){this.__d=!0}function qb(e,t){return{__v:e,context:t,props:e.props,setState:Kb,forceUpdate:Kb,__d:!0,__h:[]}}function Jb(e,t,n){if(!e.s){if(n instanceof Yb){if(!n.s)return void(n.o=Jb.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Jb.bind(null,e,t),Jb.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var Yb=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{Jb(r,1,a(this.v))}catch(e){Jb(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?Jb(r,1,t?t(i):i):n?Jb(r,1,n(i)):Jb(r,2,i)}catch(e){Jb(r,2,e)}},r},e}(),Xb,Zb,Qb,$b,ex={},tx=Array.isArray,nx=Object.assign,rx=``,ix=`<!--$s-->`,ax=`<!--/$s-->`;function ox(e,t){var n,r=e.type,i=!0;return e[Ob]?(i=!1,(n=e[Ob]).state=n[jb]):n=new r(e.props,t),e[Ob]=n,n.__v=e,n.props=e.props,n.context=t,Lb(n),n.state??=ex,n[jb]??(n[jb]=n.state),r.getDerivedStateFromProps?n.state=nx({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[jb]===n.state?n.state:n[jb]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),Qb&&Qb(e),n.render(n.props,n.state,t)}function sx(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===rx)return rx;var s=typeof e;if(s!=`object`)return s==`function`?rx:s==`string`?Vb(e):e+rx;if(tx(e)){var c,l=rx;i[kb]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=sx(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=rx,tx(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return rx;e.__=i,Xb&&Xb(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===G_){if(`tpl`in g){for(var x=rx,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&&!tx(C)?x+=C:x+=sx(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+Vb(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=ox(e,b),y=e[Ob];else{e[Ob]=y=qb(e,b);for(var E=0;zb(y)&&E++<25;){Rb(y),Qb&&Qb(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}Lb(y)}if(y.getChildContext!=null&&(t=nx({},t,y.getChildContext())),T&&D_.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===G_&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return sx(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[jb]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,ex),zb(y)?(v=ox(e,t),(y=e[Ob]).getChildContext!=null&&(t=nx({},t,y.getChildContext())),sx(v=v!=null&&v.type===G_&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):rx}finally{Zb&&Zb(e),$b&&$b(e)}}}v=v!=null&&v.type===G_&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=sx(v,t,n,r,e,a,o);return Zb&&Zb(e),D_.unmount&&D_.unmount(e),e._suspended?typeof D==`string`?ix+D+ax:tx(D)?(D.unshift(ix),D.push(ax),D):D.then(function(e){return ix+e+ax}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return sx(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=D_.__e;return k&&k(i,e),rx}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=sx(v,t,n,r,e,a,o);return e._suspended?ix+s+ax:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=rx;for(var N in g){var P=g[N];if(typeof(P=lx(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=Gb(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(Nb.test(N))N=N.replace(Nb,`$1:$2`).toLowerCase();else{if(Mb.test(N))continue;N[4]!==`-`&&!Ib.has(N)||P==null?n?Fb.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):Pb.test(N)&&(N=N.toLowerCase()):P+=rx}}P!=null&&!1!==P&&(j=!0===P||P===rx?j+` `+N:j+` `+N+`="`+(typeof P==`string`?Vb(P):P+rx)+`"`)}}if(Mb.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=Vb(A):A!=null&&!1!==A&&!0!==A&&(M=sx(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),Zb&&Zb(e),$b&&$b(e),!M&&cx.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return tx(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var cx=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function lx(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var ux=0;function dx(e){return e!=null&&e.length>0?e:(ux+=1,`pst_ft_${ux}`)}function fx({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Uf)}function px(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 mx(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 hx(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var gx=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new Db;#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=dx(a),this.#p=x_(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=Hf(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new g_({...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&&(Eb(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)}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(),wb(t.wrapper,this.#w()))}setGitStatus(e){this.#p=x_(e,this.#p);let t=this.#T();t!=null&&wb(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),wb(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),Tb(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),wb(r,this.#w())}#C(){return{initialViewportHeight:fx({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(vd,e());return}this.#l.setSlotHtml(vd,this.#e?.header?.html??null)}#k(e){let t=hx(e).find(e=>mx(e)),n=px(Ff(Bf(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=hx(e),n=t.find(e=>mx(e)),r=t.filter(e=>e!==n),i=Bf(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=px(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=Bf(this.#m);t.colored&&Lf(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${md}]`);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(md,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=qf(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 $f(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 _x(e){let t=(0,q.useRef)(null);return t.current??=new gx(e),(0,q.useEffect)(()=>{let e=t.current;return()=>{e?.cleanUp(),t.current=null}},[]),{model:t.current}}var vx={"--trees-accent-override":`var(--ring)`,"--trees-bg-muted-override":`color-mix(in srgb, var(--muted) 45%, transparent)`,"--trees-bg-override":`transparent`,"--trees-border-color-override":`var(--border)`,"--trees-fg-muted-override":`var(--muted-foreground)`,"--trees-fg-override":`var(--foreground)`,"--trees-focus-ring-color-override":`var(--ring)`,"--trees-font-family-override":`var(--font-sans)`,"--trees-font-size-override":`var(--text-sm)`,"--trees-item-margin-x-override":`0`,"--trees-padding-inline-override":`0`,"--trees-scrollbar-thumb-override":`color-mix(in srgb, var(--muted-foreground) 35%, transparent)`,"--trees-selected-bg-override":`color-mix(in srgb, var(--accent) 65%, transparent)`,"--trees-selected-fg-override":`var(--foreground)`,"--trees-selected-focused-border-color-override":`var(--ring)`,height:`100%`};function yx({controller:e,filesError:t,isFilesLoading:n}){let{closeSearch:r,filteredFiles:i,isSearchOpen:a,loadedFiles:o,model:s,searchQuery:c,setSearchQuery:l}=e,u=Ft(),d=(0,q.useRef)(null);(0,q.useEffect)(()=>{a&&d.current?.focus()},[a]);let f=(0,q.useMemo)(()=>({...vx,colorScheme:u}),[u]),p;return p=t?(0,J.jsx)(En,{message:t.message,messageClassName:`text-destructive`}):n&&o.length===0?(0,J.jsx)(En,{icon:`Spinner`,message:`Loading files...`,iconClassName:`animate-spin`}):o.length===0?(0,J.jsx)(En,{message:`No files yet.`}):i.length===0?(0,J.jsx)(En,{message:`No files match search.`}):(0,J.jsx)(Ed,{"aria-label":`Thread storage file tree`,className:`block h-full min-h-0`,model:s,style:f}),(0,J.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-1`,children:[a?(0,J.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,J.jsx)(H,{name:`Search`,className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,J.jsx)(qe,{ref:d,"aria-label":`Search files`,className:`h-7 pl-7 pr-2 text-xs focus-visible:ring-0`,placeholder:`Search files`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),r())}})]}),(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0 rounded-md p-0 text-muted-foreground`,"aria-label":`Close search`,onClick:r,children:(0,J.jsx)(H,{name:`X`,className:`size-3.5`})})]}):null,(0,J.jsx)(`div`,{className:`min-h-0 flex-1`,children:p})]})}function bx(e){return e?.type===`standard`&&e.parentThreadId===null}function xx({currentThreadId:e,isManagerThread:t,managerThreads:n,parentThreadDisplayName:r,parentThreadId:i}){if(!e||t)return[];let a=[{value:`none`,label:`None`}],o=new Set([`none`]),s=(t,n)=>{!t||t===e||o.has(t)||(o.add(t),a.push({value:t,label:n}))};s(i??void 0,r??`Manager`);for(let e of n)s(e.id,e.title?.trim()?e.title:`Manager`);return a}function Sx({thread:e,projectId:t,parentThreadDisplayName:n,managerThreads:r,canAssignToManager:i,canTakeOverThread:a,updateThreadPending:o,onAssignManager:s,defaultOpen:c}){let l=e.type===`manager`,u=e.parentThreadId??void 0,d=(0,q.useMemo)(()=>xx({currentThreadId:e.id,isManagerThread:l,managerThreads:r,parentThreadDisplayName:n,parentThreadId:u}),[l,r,n,u,e.id]),f=u??`none`,p=d.find(e=>e.value===f)?.label;return l||!u&&!i&&!a?null:(0,J.jsx)(Wt,{label:`Manager`,valueClassName:`min-w-0`,children:u?(0,J.jsxs)(`div`,{className:`inline-flex max-w-full min-w-0 items-center gap-1 text-xs text-foreground`,children:[(0,J.jsx)(Ve,{to:`/projects/${t}/threads/${u}`,className:`min-w-0 truncate text-xs text-foreground no-underline transition-[text-decoration-color] duration-150 hover:underline hover:underline-offset-2`,children:p??`Manager`}),(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,className:`size-3.5 shrink-0 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground [&_svg]:size-3`,disabled:o,onClick:()=>{s(null)},"aria-label":`Unassign manager`,children:(0,J.jsx)(H,{name:`X`})})]}):(0,J.jsxs)(he,{defaultOpen:c,children:[(0,J.jsx)(ge,{asChild:!0,children:(0,J.jsxs)(`div`,{role:`button`,tabIndex:o||d.length<=1&&f===`none`?-1:0,className:`inline-flex w-fit max-w-full min-w-0 items-center gap-1 rounded-md px-0 text-xs leading-tight text-foreground outline-none ring-sidebar-ring transition-colors hover:text-foreground focus-visible:ring-2`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,children:p??`None`}),(0,J.jsx)(H,{name:`ChevronDown`,className:`size-3.5 shrink-0 text-muted-foreground`})]})}),(0,J.jsxs)(pe,{align:`start`,className:`min-w-40 max-w-72`,children:[(0,J.jsx)(me,{children:`Assign to manager`}),d.map(e=>(0,J.jsxs)(_e,{onSelect:()=>{s(e.value===`none`?null:e.value)},className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`span`,{className:`truncate`,title:e.label,children:e.label}),(0,J.jsx)(H,{name:`Check`,className:f===e.value?A(`opacity-100`,ce):A(`opacity-0`,ce)})]},e.value))]})]})})}function Cx({thread:e}){return e.type===`manager`?(0,J.jsx)(Wt,{label:`Kind`,valueClassName:`min-w-0 truncate`,children:`Manager`}):null}function wx({environmentHost:e,environment:t,environmentIsLocal:n}){if(!e)return null;let r=t?n:void 0,i=e.status===`connected`;return(0,J.jsx)(Wt,{label:`Host`,valueClassName:`min-w-0 truncate`,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:e.name}),r?(0,J.jsx)(dt,{}):null,(0,J.jsx)(Zt,{connected:i})]})})}function Tx({thread:e,environment:t,environmentHost:n,environmentIsLocal:r}){let i=xn({projectId:e.projectId,environmentId:t?.id??``});if(e.type===`manager`||!t)return null;let a=k({environment:t,isLocalHost:r,hostName:n?.name}),o=Ex(t);return(0,J.jsx)(Wt,{label:`Environment`,valueClassName:`min-w-0`,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:a.modeLabel}),o?(0,J.jsx)(`button`,{type:`button`,"aria-label":`Create new thread in this worktree`,title:`New thread in this worktree`,onClick:i,className:`inline-flex shrink-0 items-center justify-center rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-state-hover hover:text-foreground`,children:(0,J.jsx)(H,{name:`MessageSquarePlus`,className:`size-4`})}):null]})})}function Ex(e){return e.isWorktree||e.workspaceProvisionType===`managed-worktree`}function Dx({thread:e,environment:t}){return e.type===`manager`||!t?.path||!Ex(t)?null:(0,J.jsx)(Wt,{label:`Worktree path`,valueClassName:`min-w-0`,children:(0,J.jsx)(dn,{text:t.path,label:`Copy worktree path`,title:t.path,successMessage:`Worktree path copied`,errorMessage:`Failed to copy worktree path`})})}function Ox({thread:e,workspaceStatus:t}){let n=t?.branch.currentBranch??null;return e.type===`manager`||!n?null:(0,J.jsx)(Wt,{label:`Branch`,valueClassName:`min-w-0 truncate`,children:(0,J.jsx)(dn,{text:n,label:`Copy branch name`,successMessage:`Branch name copied`,errorMessage:`Failed to copy branch name`})})}function kx({thread:e,workspaceStatus:t,selectedMergeBaseBranch:n,mergeBaseBranchOptions:r,isLoadingMergeBaseBranchOptions:i,onMergeBaseBranchChange:a,defaultOpen:o}){let s=n??t?.mergeBase?.mergeBaseBranch??t?.branch.defaultBranch,c=s,l=(0,q.useMemo)(()=>Hn({mergeBaseBranch:c,mergeBaseBranchOptions:r}),[c,r]),u=!!(s||t?.branch.defaultBranch),d=t?.branch.currentBranch!=null&&t.branch.currentBranch===t.branch.defaultBranch,f=u&&!!c&&!d;return e.type===`manager`||!f?null:(0,J.jsx)(Wt,{label:`Merge base`,valueClassName:`min-w-0 truncate`,children:c&&l.length>0&&c?(0,J.jsx)(Xn,{value:c,options:l,variant:`minimal`,loading:i,onChange:a,className:`max-w-full`,defaultOpen:o}):c})}function Ax({thread:e,environment:t,workspaceStatus:n,workspaceStatusError:r,selectedMergeBaseBranch:i}){let a=e.type!==`manager`,o=t?.status===`destroyed`;if(!(a&&(n||r||o)&&!(e.archivedAt!=null&&t?.managed!==!0)))return null;let s=i??n?.mergeBase?.mergeBaseBranch??n?.branch.defaultBranch,c=Qi(n,{mergeBaseBranch:s,showBranchComparison:!!(s||n?.branch.defaultBranch),error:r,workspaceDeleted:o}),l=n?.workingTree.state===`untracked`?`text-muted-foreground`:`text-foreground`;return(0,J.jsx)(Wt,{label:`Git status`,align:`start`,valueClassName:`min-w-0`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2 whitespace-nowrap`,title:`${c.label} ${c.summary}`,children:[(0,J.jsx)(`span`,{className:A(`shrink-0 font-medium`,l),children:c.label}),(0,J.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:c.summaryContent})]})})}function jx({thread:e}){let t=Le(),n=t.isPending&&t.variables?.id===e.id,r=(0,q.useCallback)(()=>{t.mutate({id:e.id})},[e.id,t]);return e.archivedAt==null?null:(0,J.jsx)(Wt,{label:`Archived`,valueClassName:`min-w-0 truncate`,children:(0,J.jsx)(Sr,{isPending:n,onUnarchive:r,threadType:e.type})})}function Mx({thread:e,workspaceStatus:t,onChangedFileClick:n}){return e.type===`manager`?null:(0,J.jsx)(Di,{sections:Ci(t),onFileClick:n,rowClassName:`min-h-0 flex-1`,rowValueClassName:`min-h-0 flex-1`,listClassName:`h-full`})}function Nx({controller:e,filesError:t,isFilesLoading:n}){let{isSearchOpen:r,openSearch:i}=e;return(0,J.jsx)(Wt,{orientation:`vertical`,className:`min-h-0 flex-1`,valueClassName:`min-h-0 flex-1 overflow-hidden`,labelClassName:`flex items-center justify-between gap-2`,label:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:`Manager workspace`}),r?null:(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 rounded-md p-0 text-muted-foreground`,"aria-label":`Search files`,onClick:i,children:(0,J.jsx)(H,{name:`Search`,className:`size-3.5`})})]}),children:(0,J.jsx)(yx,{controller:e,filesError:t,isFilesLoading:n})})}function Px({thread:e,parentThreadDisplayName:t,environment:n,workspaceStatus:r,workspaceStatusError:i}){let a=e.type===`manager`,o=e.parentThreadId??void 0,s=!a,c=n?.status===`destroyed`,l=s&&(!!r||!!i||c)&&!(e.archivedAt!=null&&n?.managed!==!0),u=r?.branch.currentBranch??null,d=Ci(r),f=s&&d.length>0;return!!(a||o||!a&&n||!a&&u||l||f||e.archivedAt!=null||t&&o)}function Fx({hasFlexibleHeight:e,children:t}){return(0,J.jsx)(Ct,{appearance:`flat`,className:A(`h-full min-h-0`,e?`flex-1`:`shrink-0`),children:t})}function Ix(e){let{thread:t,projectId:n,parentThreadDisplayName:r,managerThreads:i,canAssignToManager:a,canTakeOverThread:o,environmentHost:s,environmentIsLocal:c,environment:l,workspaceStatus:u,workspaceStatusError:d,selectedMergeBaseBranch:f,mergeBaseBranchOptions:p,isLoadingMergeBaseBranchOptions:m,updateThreadPending:h,storage:g,onAssignManager:_,onMergeBaseBranchChange:v,onChangedFileClick:y}=e;return(0,J.jsxs)(Fx,{hasFlexibleHeight:g!==void 0||t.type!==`manager`&&Ci(u).length>0,children:[(0,J.jsx)(Cx,{thread:t}),(0,J.jsx)(Sx,{thread:t,projectId:n,parentThreadDisplayName:r,managerThreads:i,canAssignToManager:a,canTakeOverThread:o,updateThreadPending:h,onAssignManager:_}),(0,J.jsx)(wx,{environmentHost:s,environment:l,environmentIsLocal:c}),(0,J.jsx)(Tx,{thread:t,environment:l,environmentHost:s,environmentIsLocal:c}),(0,J.jsx)(Dx,{thread:t,environment:l}),(0,J.jsx)(Ox,{thread:t,workspaceStatus:u}),(0,J.jsx)(kx,{thread:t,workspaceStatus:u,selectedMergeBaseBranch:f,mergeBaseBranchOptions:p,isLoadingMergeBaseBranchOptions:m,onMergeBaseBranchChange:v}),(0,J.jsx)(Ax,{thread:t,environment:l,workspaceStatus:u,workspaceStatusError:d,selectedMergeBaseBranch:f}),(0,J.jsx)(jx,{thread:t}),(0,J.jsx)(Mx,{thread:t,workspaceStatus:u,onChangedFileClick:y}),g?(0,J.jsx)(Nx,{...g}):null]})}function Lx({children:e,className:t}){return(0,J.jsx)(`div`,{className:A(`flex min-w-0 flex-col gap-1`,t),children:e})}function Rx({stopRequestedAt:e,threadId:t}){return{id:`${t}:pending-stop:${e}`,threadId:t,turnId:null,sourceSeqStart:0,sourceSeqEnd:0,startedAt:e,createdAt:e,kind:`system`,systemKind:`operation`,operationKind:`thread-interrupted`,title:`Stop requested`,detail:null,status:`pending`,completedAt:null}}function zx(e,t){return e.some(e=>e.kind===`system`&&e.systemKind===`operation`&&e.operationKind===`thread-interrupted`&&e.createdAt>=t)}function Bx({rows:e,stopRequestedAt:t,threadId:n}){return(0,q.useMemo)(()=>t===null||zx(e,t)?e:[...e,Rx({stopRequestedAt:t,threadId:n})],[e,t,n])}function Vx({activeThinking:e,footer:t,hasOlderTimelineRows:n,header:r,hostConnectionNotice:i,isLoadingOlderTimelineRows:a,isThreadTimelinePending:o,timelineError:s,loadingTurnSummaryIds:c,erroredTurnSummaryIds:l,onLoadOlderRows:u,onLoadTurnSummaryRows:d,onOpenLocalFileLink:f,onTitleAction:p,projectId:m,showOngoingIndicator:h,ongoingIndicatorLabel:g,stopRequestedAt:_,timelineRows:v,threadId:y,threadRuntimeDisplayStatus:b,turnSummaryRowsIdentity:x,turnSummaryRowsById:S,unreadDividerAutoScroll:C,unreadDividerPlacement:w,workspaceRootPath:T}){let E=Ft(),D=e!==null&&g===void 0,O=e?.text.trim()??``,k=D&&O.length>0?e?.text:void 0,A=D&&e?e.id:g??`working`,j=Bx({rows:v,stopRequestedAt:_,threadId:y});return(0,J.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:[r,(0,J.jsx)(ie,{scrollBehavior:`bottom-anchor`,shellClassName:`!mx-0 !mt-0 md:!mx-0 md:!mt-0`,contentClassName:`min-h-full gap-2 pt-4`,footerClassName:`chat-prompt-box`,footer:t,children:(0,J.jsxs)(Lx,{className:`flex-1`,children:[n&&!o&&!s?(0,J.jsx)(Hx,{isLoadingOlderTimelineRows:a,onLoadOlderRows:u}):null,o?(0,J.jsx)(Ux,{}):s?(0,J.jsx)(vr,{label:`Failed to load timeline`,className:`mt-6 text-destructive`}):j.length>0?(0,J.jsx)(yt,{loadingTurnSummaryIds:c,erroredTurnSummaryIds:l,onLoadTurnSummaryRows:d,onOpenLocalFileLink:f,onTitleAction:p,projectId:m,resolveUserAttachmentImageSrc:fn,themeType:E,timelineRows:j,threadRuntimeDisplayStatus:b,turnSummaryRowsIdentity:x,turnSummaryRowsById:S,unreadDividerAutoScroll:C,unreadDividerPlacement:w,workspaceRootPath:T}):null,i?(0,J.jsx)(vr,{label:i.label,className:i.tone===`error`?`mt-4 text-destructive`:`mt-4`}):null,(0,J.jsx)(nn,{visible:h,children:(0,J.jsx)(Yt,{details:k,isThinking:D,label:g},A)})]})},y)]})}function Hx({isLoadingOlderTimelineRows:e,onLoadOlderRows:t}){let n=te();return(0,J.jsx)(`div`,{className:`flex justify-center pt-2 mb-3`,children:(0,J.jsxs)(P,{type:`button`,variant:`outline`,size:`sm`,onClick:(0,q.useCallback)(()=>{n?.captureScrollAnchor(),t()},[n,t]),disabled:e,children:[(0,J.jsx)(H,{name:`ChevronUp`,"aria-hidden":`true`}),e?`Loading older messages...`:`Load older messages`]})})}function Ux(){let[e,t]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{let e=window.setTimeout(()=>t(!0),200);return()=>window.clearTimeout(e)},[]),e?(0,J.jsx)(vr,{label:`Loading thread...`,className:`mt-6`}):null}var Wx=100,Gx=`duration-[220ms] ease-[cubic-bezier(0.32,0.72,0,1)]`;function Kx({footer:e,header:t,isMetadataLoading:n,isSecondaryPanelOpen:r,metadata:i,onTerminalPanelResize:a,secondaryPanel:o,terminalPanel:s,terminalPanelHeightPercent:c,terminalPanelOpen:l,timeline:u}){let d=ue(),f=ct(ea),p=(0,q.useRef)(null),m=(0,q.useRef)(c),h=(0,q.useRef)(!1),g=(0,q.useRef)(!1);(0,q.useEffect)(()=>{h.current||(m.current=c)},[c]),(0,q.useEffect)(()=>{if(!g.current){g.current=!0;return}let e=p.current;e&&(l?e.expand(m.current):e.collapse())},[l]);let _=(0,q.useCallback)(()=>{let e=m.current;e<=0||a(e)},[a]),v=(0,q.useCallback)(e=>{e<=0||(m.current=e,h.current||a(e))},[a]),y=(0,q.useCallback)(e=>{h.current=e,e||_()},[_]),b=Px(i)?(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,J.jsx)(Ix,{...i})}):n?(0,J.jsx)(Yx,{}):(0,J.jsx)(`div`,{className:`pt-1 text-sm text-muted-foreground`,children:`No thread details available.`}),x=d?null:(0,J.jsx)(cd,{...o,renderAsDrawer:!1,metadataContent:b}),S=d?(0,J.jsx)(cd,{...o,renderAsDrawer:!0,metadataContent:b}):null;return(0,J.jsxs)(`div`,{className:`-mx-4 -mb-4 -mt-4 flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden md:-mx-5 md:-mb-5 md:-mt-5`,children:[(0,J.jsxs)(Ql.PanelGroup,{direction:`vertical`,className:`h-full w-full min-w-0`,children:[(0,J.jsx)(Ql.Panel,{id:`thread-detail-main-panel`,defaultSize:l?100-c:100,minSize:30,order:1,className:`min-w-0 overflow-hidden`,children:(0,J.jsxs)(Ql.PanelGroup,{direction:`horizontal`,className:`h-full w-full min-w-0`,children:[(0,J.jsx)(Ql.Panel,{id:`thread-detail-timeline-panel`,defaultSize:r&&!d?100-f:Wx,minSize:30,order:1,className:`min-w-0 overflow-hidden`,children:(0,J.jsx)(Vx,{...u,footer:e,header:t})}),x]})}),s?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(qx,{isOpen:l,onDragging:y}),(0,J.jsx)(Ql.Panel,{ref:p,id:`thread-detail-terminal-panel`,collapsible:!0,collapsedSize:0,defaultSize:l?c:0,minSize:18,maxSize:70,order:2,onResize:v,className:A(`min-h-0 min-w-0 overflow-hidden transition-[flex-grow,flex-basis,opacity]`,Gx,l?`opacity-100`:`opacity-0`),children:s})]}):null]},u.threadId),d?(0,J.jsx)(U,{open:r,onOpenChange:e=>{e||o.onClose()},srLabel:`Thread details`,contentClassName:`h-[92dvh] max-h-[92dvh]`,handleOnly:!0,children:(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:S})}):null]})}function qx({isOpen:e,onDragging:t}){return(0,J.jsx)(Ql.PanelResizeHandle,{id:`thread-detail-terminal-panel-handle`,disabled:!e,onDragging:t,className:A(`group relative shrink-0 cursor-row-resize overflow-visible bg-transparent transition-[height,opacity,background-color]`,Gx,`before:absolute before:-inset-y-1.5 before:inset-x-0 before:content-['']`,e?`h-px opacity-100`:`pointer-events-none h-0 opacity-0`),"aria-label":`Resize thread and terminal panels`,children:(0,J.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border transition-colors group-hover:bg-accent-foreground/35`})})}var Jx=[`w-40`,`w-28`,`w-36`,`w-24`];function Yx(){return(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,J.jsx)(Fx,{hasFlexibleHeight:!1,children:Jx.map((e,t)=>(0,J.jsxs)(`div`,{className:`grid grid-cols-[var(--detail-label-width,96px)_minmax(0,1fr)] items-center gap-x-3 py-0.5`,children:[(0,J.jsx)(kn,{className:`h-3 w-14 rounded-sm`}),(0,J.jsx)(kn,{className:`h-3 ${e} max-w-full rounded-sm`})]},t))})})}function Xx(e){return e!==void 0&&e.length>0}function Zx({closePersistedPanel:e,isCompactViewport:t,isPersistedOpen:n,openPersistedDiffFile:r,openPersistedDiffPanel:i,openPersistedPanel:a,threadId:o,togglePersistedPanel:s}){let[c,l]=(0,q.useState)(null);(0,q.useEffect)(()=>{l(null)},[o]),(0,q.useEffect)(()=>{t||l(null)},[t]);let u=(0,q.useCallback)(()=>{Xx(o)&&l(o)},[o]),d=(0,q.useCallback)(()=>{l(e=>e===o?null:e)},[o]),f=Xx(o)&&c===o,p=t?f:n,m=(0,q.useCallback)(e=>{a(e),t&&u()},[t,u,a]),h=(0,q.useCallback)(()=>{i(),t&&u()},[t,u,i]),g=(0,q.useCallback)(e=>{r(e),t&&u()},[t,u,r]),_=(0,q.useCallback)(()=>{if(t){d();return}e()},[d,e,t]),v=(0,q.useCallback)(()=>{if(!t){s();return}if(f){d();return}u()},[d,t,f,u,s]);return(0,q.useMemo)(()=>({closePanel:_,isOpen:p,openDiffFile:g,openDiffPanel:h,openPanel:m,togglePanel:v}),[_,p,g,h,m,v])}function Qx({activePath:e,fileListEnabled:t=!0,fileListOptions:n=l,filePreviewEnabled:r=!0,threadId:i,threadType:a}){let o=a===`manager`,{data:s,isLoading:c,error:u}=je(i??``,n,{enabled:o&&t}),{data:d,isLoading:f,error:p}=Te(i??``,e,{enabled:o&&r&&e!==null});return{isThreadStorageFilePreviewLoading:f,isThreadStorageFilesLoading:c,threadStorageFilePreview:d,threadStorageFilePreviewError:p,threadStorageFilesError:u,threadStorageFiles:s,threadStorageRootPath:s?.storageRootPath??null}}var $x=8;function eS(e){return e.entryKind===`file`}function tS(e){return{source:e.source,entryKind:`file`,path:e.path,name:e.name,score:e.score,positions:e.positions}}function nS(e){let t=e.limit??$x,n=Wn({projectId:e.projectId,query:e.query,limit:t,environmentId:e.environmentId,currentThreadId:e.currentThreadId,currentThreadType:e.currentThreadType,includeDirectories:!1}),r=(0,q.useMemo)(()=>n.suggestions.filter(eS).map(tS),[n.suggestions]),i=!!e.projectId,a=e.currentThreadType===`manager`&&!!e.currentThreadId;return{suggestions:r,isLoading:n.isLoading,isError:n.isError,isDebouncing:n.isDebouncing,isUnavailable:!i&&!a}}var rS=20,iS=[`workspace`,`thread-storage`],aS={workspace:`Workspace`,"thread-storage":`Manager Storage`};function oS({projectId:e,currentThreadId:t,currentThreadType:n}){let r=[];return e&&r.push(`workspace`),n===`manager`&&t.length>0&&r.push(`thread-storage`),r}function sS(e){return`file-search-result-${e.source}-${encodeURIComponent(e.path)}`}function cS(e){let t=e.lastIndexOf(`/`);return t===-1?{name:e,directory:``}:{name:e.slice(t+1),directory:e.slice(0,t)}}function lS(e){return`${aS[e.source]}: ${e.path}`}function uS({availableSources:e,suggestions:t}){let n=new Set(e),r=new Map;for(let e of t){let t=e.source;if(!n.has(t))continue;let i=r.get(t);if(i){i.items.push({suggestion:e,index:i.items.length});continue}r.set(t,{source:t,label:aS[t],items:[{suggestion:e,index:0}]})}let i=0;return iS.flatMap(e=>{let t=r.get(e);return t?[{...t,items:t.items.map(({suggestion:e})=>{let t=i;return i+=1,{suggestion:e,index:t}})}]:[]})}function dS({iconName:e,iconClassName:t,message:n}){return(0,J.jsx)(`div`,{className:`flex min-h-24 items-center justify-center rounded-md border border-dashed border-border bg-surface-raised px-3 py-6 text-center text-sm text-muted-foreground`,children:(0,J.jsxs)(`div`,{className:`flex max-w-64 flex-col items-center gap-2`,children:[(0,J.jsx)(H,{name:e,className:A(`size-4`,t)}),(0,J.jsx)(`p`,{children:n})]})})}function fS({id:e,suggestion:t,isActive:n,onActivate:r,onSelect:i}){let{directory:a}=cS(t.path),o=a||null;return(0,J.jsx)(`button`,{type:`button`,id:e,role:`option`,"aria-selected":n,onClick:(0,q.useCallback)(()=>{i(t)},[i,t]),onMouseEnter:r,title:lS(t),className:A(`w-full scroll-mt-7 rounded px-2 py-1.5 text-left text-xs transition-colors`,n?`bg-state-active`:`hover:bg-state-hover`),children:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,J.jsx)(H,{name:`File`,className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`truncate`,children:t.name}),o===null?null:(0,J.jsx)(sr,{className:`text-muted-foreground [flex-shrink:9999]`,children:o})]})})}function pS({projectId:e,environmentId:t,currentThreadId:n,currentThreadType:r,focusRequest:i,initialQuery:a=``,onSelect:o}){let s=(0,q.useRef)(null),[c,l]=(0,q.useState)(a),[u,d]=(0,q.useState)(-1),f=c.trim().length>0,{suggestions:p,isLoading:m,isError:h,isDebouncing:g,isUnavailable:_}=nS({projectId:e,query:c,limit:rS,environmentId:t,currentThreadId:n,currentThreadType:r}),v=(0,q.useMemo)(()=>oS({projectId:e,currentThreadId:n,currentThreadType:r}),[n,r,e]),y=(0,q.useMemo)(()=>uS({availableSources:v,suggestions:p}),[v,p]),b=(0,q.useMemo)(()=>y.flatMap(e=>e.items.map(({suggestion:e})=>e)),[y]),x=(0,q.useMemo)(()=>u>=0&&u<b.length?b[u]??null:null,[u,b]);(0,q.useEffect)(()=>{s.current?.focus();let e=requestAnimationFrame(()=>{s.current?.focus()});return()=>cancelAnimationFrame(e)},[i]),(0,q.useEffect)(()=>{d(b.length>0?0:-1)},[b]);let S=(0,q.useCallback)(e=>{o({source:e.source,path:e.path})},[o]),C=(0,q.useCallback)(e=>{if(b.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),d(e=>(e+1)%b.length);return}if(e.key===`ArrowUp`){e.preventDefault(),d(e=>e<=0?b.length-1:e-1);return}e.key===`Enter`&&x&&(e.preventDefault(),S(x))}},[x,S,b.length]);return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(H,{name:`Search`,className:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,J.jsx)(qe,{ref:s,value:c,onChange:e=>l(e.target.value),onKeyDown:C,disabled:_,"aria-label":`Search files`,"aria-activedescendant":x?sS(x):void 0,placeholder:_?`No searchable source`:`Search files`,className:`h-8 pl-8 pr-8 text-xs focus-visible:ring-0`}),g?(0,J.jsx)(H,{name:`Spinner`,className:`pointer-events-none absolute right-2.5 top-1/2 size-3.5 -translate-y-1/2 animate-spin text-muted-foreground`}):null]}),_?(0,J.jsx)(dS,{iconName:`FileQuestion`,message:`No searchable file source is available.`}):h?(0,J.jsx)(dS,{iconName:`AlertCircle`,message:`File search failed.`}):m?(0,J.jsx)(dS,{iconName:`Spinner`,iconClassName:`animate-spin`,message:`Searching files...`}):y.length>0?(0,J.jsx)(`div`,{role:`listbox`,"aria-label":`File search results`,className:`min-h-0 flex-1 overflow-y-auto pb-1`,children:y.map((e,t)=>(0,J.jsxs)(`div`,{className:A(t>0&&`mt-2`),children:[(0,J.jsx)(`div`,{className:A(`sticky top-0 z-10 bg-background px-2 pb-1 text-xs text-muted-foreground`,t===0?`pt-0`:`pt-1.5`),children:e.label}),(0,J.jsx)(`div`,{className:`flex flex-col gap-px`,children:e.items.map(({suggestion:e,index:t})=>(0,J.jsx)(fS,{id:sS(e),suggestion:e,isActive:t===u,onActivate:()=>d(t),onSelect:S},`${e.source}:${e.path}`))})]},e.source))}):(0,J.jsx)(dS,{iconName:f?`FileQuestion`:`File`,message:f?`No files match.`:`Type to search files.`})]})}function mS(e){return(0,J.jsx)(`div`,{className:`flex min-h-full flex-col gap-3 px-4 pt-1`,children:(0,J.jsx)(pS,{...e})})}var hS=[];function gS(e){let t=new Set;for(let n of e){let e=n.split(`/`).filter(e=>e.length>0),r=``;for(let n of e.slice(0,-1))r=`${r}${n}/`,t.add(r)}return Array.from(t)}function _S({files:e,onSelectPath:t,selectedPath:n}){let[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(``),s=e??hS,c=(0,q.useMemo)(()=>{let e=a.trim().toLowerCase();return e.length===0?s:s.filter(t=>t.path.toLowerCase().includes(e))},[s,a]),l=(0,q.useMemo)(()=>c.map(e=>e.path),[c]),u=(0,q.useMemo)(()=>new Set(l),[l]),d=(0,q.useRef)(u),f=(0,q.useRef)(t),p=(0,q.useRef)(!1);(0,q.useEffect)(()=>{d.current=u},[u]),(0,q.useEffect)(()=>{f.current=t},[t]);let{model:m}=_x({density:`compact`,initialExpansion:`closed`,onSelectionChange:(0,q.useCallback)(e=>{if(p.current)return;let t=e[0];!t||!d.current.has(t)||f.current(t)},[]),paths:[],search:!1}),h=a.trim().length>0,g=(0,q.useMemo)(()=>h?gS(l):[],[h,l]);(0,q.useEffect)(()=>{m.resetPaths(l,{initialExpandedPaths:g})},[g,l,m]),(0,q.useEffect)(()=>{let e=m.getSelectedPaths(),t=n!==null&&u.has(n);if(!(t?e.length===1&&e[0]===n:e.length===0)){p.current=!0;try{for(let r of e)t&&r===n||m.getItem(r)?.deselect();t&&m.getItem(n)?.select()}finally{p.current=!1}}},[u,m,n]);let _=(0,q.useCallback)(()=>{i(!0)},[]);return{closeSearch:(0,q.useCallback)(()=>{i(!1),o(``)},[]),filteredFiles:c,isSearchOpen:r,loadedFiles:s,model:m,openSearch:_,searchQuery:a,setSearchQuery:o}}var vS=`bb.thread.fixedPanelTabsState`,yS=336*60*60*1e3,bS=`thread-info`,xS=`git-diff`,SS=`new-tab`,CS=ne(`kind`,[O({kind:z(`working-tree`)}).strict(),O({kind:z(`head`)}).strict(),O({kind:z(`merge-base`),ref:V().min(1)}).strict()]),wS=z(`deleted`).nullable(),TS=O({id:z(bS),kind:z(`thread-info`)}).strict(),ES=O({id:z(xS),kind:z(`git-diff`)}).strict(),DS=O({environmentId:V().min(1).nullable(),id:V().min(1),kind:z(`workspace-file-preview`),lineNumber:L().int().positive().nullable(),path:V().min(1),source:CS,statusLabel:wS}).strict(),OS=O({id:V().min(1),kind:z(`host-file-preview`),lineNumber:L().int().positive().nullable(),path:V().min(1)}).strict(),kS=O({id:V().min(1),isPinned:M(),kind:z(`thread-storage-file-preview`),path:V().min(1)}).strict(),AS=O({id:z(SS),kind:z(`new-tab`)}).strict(),jS=O({id:V().min(1),kind:z(`terminal`),terminalId:V().min(1)}).strict(),MS=ne(`kind`,[TS,ES,DS,OS,kS,AS]),NS=ne(`kind`,[jS]),PS=O({tabs:e(MS),activeTabId:V().min(1).nullable(),isOpen:M()}).strict(),FS=O({tabs:e(MS),activeTabId:V().min(1).nullable()}).strict(),IS=O({tabs:e(NS),activeTabId:V().min(1).nullable()}).strict(),LS=O({version:z(1),secondary:PS,bottom:IS,lastUsedAt:L().int().nonnegative()}).strict(),RS=O({version:z(1),secondary:FS,bottom:IS,lastUsedAt:L().int().nonnegative()}).strict();function zS(){return typeof window>`u`?null:window.localStorage}function BS(e){return encodeURIComponent(e.trim())}function VS(e,t){return`${e}:${encodeURIComponent(t)}`}function HS(){return{id:bS,kind:`thread-info`}}function US(){return{id:xS,kind:`git-diff`}}function WS({environmentId:e,tab:t}){return{environmentId:e,id:VS(`workspace-file-preview`,t.path),kind:`workspace-file-preview`,lineNumber:t.lineNumber,path:t.path,source:t.source,statusLabel:t.statusLabel}}function GS(e){return{id:VS(`host-file-preview`,e.path),kind:`host-file-preview`,lineNumber:e.lineNumber,path:e.path}}function KS({isPinned:e,path:t}){return{id:VS(`thread-storage-file-preview`,t),isPinned:e,kind:`thread-storage-file-preview`,path:t}}function qS(){return{id:SS,kind:`new-tab`}}function JS({terminalId:e}){return{id:`terminal:${encodeURIComponent(e)}`,kind:`terminal`,terminalId:e}}function YS(e,t){return e===`bottom`?t.kind===`terminal`:t.kind!==`terminal`}function XS(e){return e.kind===`new-tab`}function ZS({group:e,region:t}){let n=new Set,r=[];for(let i of e.tabs)XS(i)||!YS(t,i)||n.has(i.id)||(n.add(i.id),r.push(i));return{tabs:r,activeTabId:e.activeTabId!==null&&n.has(e.activeTabId)?e.activeTabId:null}}function QS(e){return{...ZS({group:e,region:`secondary`}),isOpen:e.isOpen}}function $S({state:e}){return{...e,secondary:QS(e.secondary),bottom:ZS({group:e.bottom,region:`bottom`})}}function eC(e={}){return $S({state:{version:1,secondary:e.secondary??{tabs:[],activeTabId:null,isOpen:!1},bottom:e.bottom??{tabs:[],activeTabId:null},lastUsedAt:e.lastUsedAt??0}})}var tC=eC();function nC({threadId:e}){return`${vS}-${BS(e)}-1`}function rC(e){return e.startsWith(`bb.thread.fixedPanelTabsState-`)&&e.endsWith(`-1`)}function iC({now:e,state:t}){return e-t.lastUsedAt>yS}function aC({initialValue:e,now:t,storedValue:n}){return oC({initialValue:e,now:t,storedValue:n}).state}function oC({initialValue:e,now:t,storedValue:n}){if(n===null)return{shouldPrune:!1,state:e};let r;try{r=JSON.parse(n)}catch{return{shouldPrune:!0,state:e}}let i=LS.safeParse(r);if(i.success){let n=$S({state:i.data});return iC({now:t,state:n})?{shouldPrune:!0,state:e}:{shouldPrune:!1,state:n}}let a=RS.safeParse(r);if(!a.success)return{shouldPrune:!0,state:e};let o=$S({state:{...a.data,secondary:{...a.data.secondary,isOpen:a.data.secondary.activeTabId!==null}}});return iC({now:t,state:o})?{shouldPrune:!0,state:e}:{shouldPrune:!1,state:o}}function sC({state:e}){return JSON.stringify($S({state:e}))}function cC({now:e}){let t=zS();if(!t)return;let n=[];for(let e=0;e<t.length;e+=1){let r=t.key(e);r&&rC(r)&&n.push(r)}for(let r of n)oC({initialValue:tC,now:e,storedValue:t.getItem(r)}).shouldPrune&&t.removeItem(r)}function lC(e,t){if(e.id!==t.id||e.kind!==t.kind)return!1;switch(e.kind){case`thread-info`:case`git-diff`:case`new-tab`:return!0;case`workspace-file-preview`:return t.kind===`workspace-file-preview`&&e.environmentId===t.environmentId&&e.lineNumber===t.lineNumber&&e.path===t.path&&T(e.source,t.source)&&e.statusLabel===t.statusLabel;case`host-file-preview`:return t.kind===`host-file-preview`&&e.lineNumber===t.lineNumber&&e.path===t.path;case`thread-storage-file-preview`:return t.kind===`thread-storage-file-preview`&&e.isPinned===t.isPinned&&e.path===t.path;case`terminal`:return t.kind===`terminal`&&e.terminalId===t.terminalId}}var uC=`secondaryPanel`,dC=`git-diff`,fC=`thread-info`;function pC(e){switch(e){case dC:return`git-diff`;case fC:return`thread-info`;default:return null}}function mC(e){return pC(new URLSearchParams(e).get(uC))}function hC(e,t){let n=new URLSearchParams(e);return t?n.set(uC,t):n.delete(uC),n.toString()}var gC=60*1e3;function _C(e){return e!=null&&e.length>0}function vC(e,t){return{...e,lastUsedAt:t}}var yC=$e({parse:(e,t)=>aC({initialValue:t,now:Date.now(),storedValue:e}),serialize:e=>sC({state:e})}),bC=tt(tC),xC=Je(e=>et(nC({threadId:e}),tC,yC,{getOnInit:!0}));function SC(e){return _C(e)?xC(e):bC}function CC(e){switch(e){case`thread-info`:return HS().id;case`git-diff`:return US().id}}function wC(e){switch(e){case`thread-info`:return HS();case`git-diff`:return US()}}function TC(e){let t=e.bottom.activeTabId;if(t===null)return null;let n=e.bottom.tabs.find(e=>e.id===t);return n?.kind===`terminal`?n:null}function EC(e,t){let n=JS({terminalId:t});return e.find(e=>e.id===n.id)?e:[...e,n]}function DC(e,t){let n=JS({terminalId:t}),r=e.filter(e=>e.id!==n.id);return r.length===e.length?e:r}function OC(e,t){let n=CC(t);return e.some(e=>e.id===n)?e:[...e,wC(t)]}function kC(e,t){return t!==null&&e.some(e=>e.id===t)}function AC(e){if(kC(e.secondary.tabs,e.secondary.activeTabId))return e.secondary.isOpen?e:{...e,secondary:{...e.secondary,isOpen:!0}};let t=`thread-info`,n=OC(e.secondary.tabs,t),r=CC(t);return{...e,secondary:{tabs:n,activeTabId:r,isOpen:!0}}}function jC(e){return e.secondary.isOpen?{...e,secondary:{...e.secondary,isOpen:!1}}:e}function MC(e){(0,q.useEffect)(()=>{cC({now:Date.now()})},[e])}function NC(e){return ct(SC(e))}function PC(e){let t=nt(SC(e));return(0,q.useCallback)(n=>{if(!_C(e))return;let r=Date.now();t(e=>{let t=n(e);return t===e?e:vC(t,r)})},[t,e])}function FC(e){let t=PC(e),n=(0,q.useRef)(null);return(0,q.useCallback)(()=>{let r=Date.now();n.current!==null&&n.current.threadId===e&&r-n.current.touchedAt<gC||(n.current={threadId:e,touchedAt:r},t(e=>!e.secondary.isOpen&&e.secondary.tabs.length===0&&e.bottom.tabs.length===0||r-e.lastUsedAt<gC?e:{...e}))},[e,t])}function IC(e){let t=PC(e);return(0,q.useCallback)(e=>{t(t=>{let n=OC(t.secondary.tabs,e),r=CC(e);return n===t.secondary.tabs&&t.secondary.activeTabId===r&&t.secondary.isOpen?t:{...t,secondary:{tabs:n,activeTabId:r,isOpen:!0}}})},[t])}function LC(e){let t=PC(e);return(0,q.useCallback)(()=>{t(jC)},[t])}function RC(e){let t=PC(e);return(0,q.useCallback)(()=>{t(e=>e.secondary.isOpen?jC(e):AC(e))},[t])}function zC(e,t){let n=ze(),r=Ge();(0,q.useEffect)(()=>{if(!_C(e))return;let i=mC(n.search);if(i===null)return;t(i);let a=hC(n.search,null);r({pathname:n.pathname,search:a.length>0?`?${a}`:``},{replace:!0})},[n.pathname,n.search,r,t,e])}function BC(e){return TC(NC(e))?.terminalId??null}function VC(e){let t=PC(e);return(0,q.useCallback)(e=>{t(t=>{if(e===null)return t.bottom.activeTabId===null?t:{...t,bottom:{...t.bottom,activeTabId:null}};let n=EC(t.bottom.tabs,e),r=JS({terminalId:e}).id;return n===t.bottom.tabs&&t.bottom.activeTabId===r?t:{...t,bottom:{tabs:n,activeTabId:r}}})},[t])}function HC(e){let t=PC(e);return(0,q.useCallback)(e=>{t(t=>{let n=DC(t.bottom.tabs,e);if(n===t.bottom.tabs)return t;let r=t.bottom.activeTabId===JS({terminalId:e}).id;return{...t,bottom:{tabs:n,activeTabId:r?null:t.bottom.activeTabId}}})},[t])}function UC(e){return e.kind===`workspace-file-preview`}function WC(e){return e.kind===`host-file-preview`}function GC(e){return e.kind===`thread-storage-file-preview`}function KC(e){return e.kind===`new-tab`}function qC(e){let t=e.secondary.activeTabId;return t===null?null:e.secondary.tabs.find(e=>e.id===t)??null}function JC({activeTabId:e,isOpen:t,state:n,tabs:r}){return r===n.secondary.tabs&&e===n.secondary.activeTabId&&t===n.secondary.isOpen?n:{...n,secondary:{tabs:r,activeTabId:e,isOpen:t}}}function YC(e,t){let n=e.filter(e=>!GC(e)||e.path===t||!Uu(e.path));return n.length===e.length?e:n}function XC(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return[...e,t];let r=e[n];return r&&lC(r,t)?e:e.map(e=>e.id===t.id?t:e)}function ZC(e,t){let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}function QC(e,t){let n=e.filter(e=>!UC(e)||e.environmentId===t);return n.length===e.length?e:n}function $C(e){let t=e.filter(e=>!GC(e));return t.length===e.length?e:t}function ew(e,t){let n=e.filter(e=>!GC(e)||t.has(e.path));return n.length===e.length?e:n}function tw(e,t){return t!==null&&e.some(e=>e.id===t)}function nw(e,t){let n=Wu(e);return KS({isPinned:n===t,path:n})}function rw(e,t){return ow(e,t)?.id??nw(t,t).id}function iw(e,t){for(let n of e)if(UC(n)&&n.path===t)return n;return null}function aw(e,t){for(let n of e)if(WC(n)&&n.path===t)return n;return null}function ow(e,t){for(let n of e)if(GC(n)&&n.path===t)return n;return null}function sw(e){for(let t of e)if(KC(t))return t;return null}function cw({nextTab:e,state:t}){let n=sw(t.secondary.tabs),r=n===null?t.secondary.tabs:ZC(t.secondary.tabs,n.id),i=r.find(t=>t.id===e.id);if(i)return JC({activeTabId:i.id,isOpen:!0,state:t,tabs:r});let a=n===null?XC(r,e):t.secondary.tabs.map(t=>t.id===n.id?e:t);return JC({activeTabId:e.id,isOpen:!0,state:t,tabs:a})}function lw(e){return e.kind===`thread-storage-file-preview`&&e.isPinned}function uw({tabs:e,resolvedEnvironmentId:t,isManagerThread:n}){let r=[];for(let i of e)switch(i.kind){case`workspace-file-preview`:t!==void 0&&i.environmentId===t&&r.push(i);break;case`host-file-preview`:case`new-tab`:r.push(i);break;case`thread-storage-file-preview`:n&&r.push(i);break;case`thread-info`:case`git-diff`:case`terminal`:break}return[...r.filter(lw),...r.filter(e=>!lw(e))]}function dw({threadId:e,environmentId:t,threadType:n,storageFiles:r}){let i=NC(e),a=PC(e),o=n!==void 0,s=n===`manager`,c=Gu(r),l=o?t??null:void 0;(0,q.useEffect)(()=>{l!==void 0&&a(e=>{let t=QC(e.secondary.tabs,l);return JC({activeTabId:tw(t,e.secondary.activeTabId)?e.secondary.activeTabId:null,isOpen:e.secondary.isOpen,state:e,tabs:t})})},[l,a]),(0,q.useEffect)(()=>{o&&(s||a(e=>{let t=$C(e.secondary.tabs);return JC({activeTabId:tw(t,e.secondary.activeTabId)?e.secondary.activeTabId:null,isOpen:e.secondary.isOpen,state:e,tabs:t})}))},[s,o,a]),(0,q.useEffect)(()=>{s&&a(e=>{let t=nw(c,c),n=XC(YC(e.secondary.tabs,c),t);return JC({activeTabId:tw(n,e.secondary.activeTabId)?e.secondary.activeTabId:t.id,isOpen:e.secondary.isOpen,state:e,tabs:n})})},[i.secondary.activeTabId,i.secondary.tabs,s,c,a]),(0,q.useEffect)(()=>{!o||!r||s&&a(e=>{let t=new Set([c,...r.map(e=>e.path)]),n=ew(e.secondary.tabs,t);return JC({activeTabId:tw(n,e.secondary.activeTabId)?e.secondary.activeTabId:rw(n,c),isOpen:e.secondary.isOpen,state:e,tabs:n})})},[s,o,c,r,a]);let u=(0,q.useCallback)(({lineNumber:e,path:t,source:n,statusLabel:r})=>{if(l===void 0)return;let i=WS({environmentId:l,tab:{lineNumber:e,path:t,source:n,statusLabel:r}});a(a=>{let o=iw(a.secondary.tabs,t),s=XC(a.secondary.tabs,i);return o&&o.environmentId===l&&o.lineNumber===e&&T(o.source,n)&&o.statusLabel===r&&a.secondary.activeTabId===i.id&&a.secondary.isOpen?a:JC({activeTabId:i.id,isOpen:!0,state:a,tabs:s})})},[l,a]),d=(0,q.useCallback)(e=>{a(t=>{let n=iw(t.secondary.tabs,e);if(!n)return t;let r=ZC(t.secondary.tabs,n.id);return JC({activeTabId:t.secondary.activeTabId===n.id?null:t.secondary.activeTabId,isOpen:t.secondary.isOpen,state:t,tabs:r})})},[a]),f=(0,q.useCallback)(e=>{a(t=>{let n=iw(t.secondary.tabs,e);return!n||t.secondary.activeTabId===n.id&&t.secondary.isOpen?t:JC({activeTabId:n.id,isOpen:!0,state:t,tabs:t.secondary.tabs})})},[a]),p=(0,q.useCallback)(e=>{if(!s)return;let t=nw(e,c);a(e=>{let n=XC(e.secondary.tabs,t);return n===e.secondary.tabs&&e.secondary.activeTabId===t.id&&e.secondary.isOpen?e:JC({activeTabId:t.id,isOpen:!0,state:e,tabs:n})})},[s,c,a]),m=(0,q.useCallback)(({lineNumber:t,path:n})=>{if(!e)return;let r=GS({lineNumber:t,path:n});a(e=>{let i=aw(e.secondary.tabs,n),a=XC(e.secondary.tabs,r);return i&&i.lineNumber===t&&e.secondary.activeTabId===r.id&&e.secondary.isOpen?e:JC({activeTabId:r.id,isOpen:!0,state:e,tabs:a})})},[e,a]),h=(0,q.useCallback)(e=>{a(t=>{let n=aw(t.secondary.tabs,e);if(!n)return t;let r=ZC(t.secondary.tabs,n.id);return JC({activeTabId:t.secondary.activeTabId===n.id?null:t.secondary.activeTabId,isOpen:t.secondary.isOpen,state:t,tabs:r})})},[a]),g=(0,q.useCallback)(e=>{a(t=>{let n=aw(t.secondary.tabs,e);return!n||t.secondary.activeTabId===n.id&&t.secondary.isOpen?t:JC({activeTabId:n.id,isOpen:!0,state:t,tabs:t.secondary.tabs})})},[a]),_=(0,q.useCallback)(e=>{!s||e===c||a(t=>{let n=ow(t.secondary.tabs,e);if(!n)return t;let r=ZC(t.secondary.tabs,n.id);return JC({activeTabId:t.secondary.activeTabId===n.id?null:t.secondary.activeTabId,isOpen:t.secondary.isOpen,state:t,tabs:r})})},[s,c,a]),v=(0,q.useCallback)(e=>{s&&a(t=>{let n=ow(t.secondary.tabs,e);return!n||t.secondary.activeTabId===n.id&&t.secondary.isOpen?t:JC({activeTabId:n.id,isOpen:!0,state:t,tabs:t.secondary.tabs})})},[s,a]),y=(0,q.useCallback)(()=>{let e=qS();a(t=>{let n=XC(t.secondary.tabs,e);return n===t.secondary.tabs&&t.secondary.activeTabId===e.id&&t.secondary.isOpen?t:JC({activeTabId:e.id,isOpen:!0,state:t,tabs:n})})},[a]),b=(0,q.useCallback)(()=>{let e=qS();a(t=>!sw(t.secondary.tabs)||t.secondary.activeTabId===e.id&&t.secondary.isOpen?t:JC({activeTabId:e.id,isOpen:!0,state:t,tabs:t.secondary.tabs}))},[a]),x=(0,q.useCallback)(()=>{let e=qS();a(t=>{let n=ZC(t.secondary.tabs,e.id);return n===t.secondary.tabs?t:JC({activeTabId:t.secondary.activeTabId===e.id?null:t.secondary.activeTabId,isOpen:t.secondary.isOpen,state:t,tabs:n})})},[a]),S=(0,q.useCallback)(e=>{if(e.source===`workspace`){if(l===void 0)return;let t=WS({environmentId:l,tab:{lineNumber:null,path:e.path,source:{kind:`working-tree`},statusLabel:null}});a(e=>cw({nextTab:t,state:e}));return}if(!s)return;let t=nw(e.path,c);a(e=>cw({nextTab:t,state:e}))},[s,c,l,a]),C=(0,q.useCallback)(()=>{a(e=>{let t=qC(e);return!t||t.kind!==`workspace-file-preview`&&t.kind!==`host-file-preview`&&t.kind!==`thread-storage-file-preview`?e:JC({activeTabId:null,isOpen:e.secondary.isOpen,state:e,tabs:e.secondary.tabs})})},[a]),w=qC(i),E=uw({tabs:i.secondary.tabs,resolvedEnvironmentId:l,isManagerThread:s}),D=w?.kind===`workspace-file-preview`&&w.environmentId===l?w:null,O=s&&w?.kind===`thread-storage-file-preview`?w:null,k=w?.kind===`host-file-preview`?w:null,A=w?.kind===`new-tab`?w:null;return{orderedSecondaryFileTabs:E,activateNewTab:b,activateHostFileTab:g,activateStorageFileTab:v,activateWorkspaceFileTab:f,activeHostFileLineNumber:k?.lineNumber??null,activeHostFilePath:k?.path??null,activeStorageFilePath:O?.path??null,activeWorkspaceFileLineNumber:D?.lineNumber??null,activeWorkspaceFilePath:D?.path??null,activeWorkspaceFileSource:D?.source??null,activeWorkspaceFileStatusLabel:D?.statusLabel??null,clearActiveFileTabs:C,closeHostFileTab:h,closeNewTab:x,closeStorageFileTab:_,closeWorkspaceFileTab:d,hasNewTab:sw(i.secondary.tabs)!==null,isNewTabActive:A!==null,openNewTab:y,openHostFile:m,openStorageFile:p,openWorkspaceFile:u,pinnedStorageFilePath:c,selectFileSearchResult:S}}function fw(e){return e??void 0}function pw({previousStateKey:e,nextStateKey:t,persistedMergeBaseBranch:n,selectedMergeBaseBranch:r,updatePending:i}){return e===t?i?!1:r!==fw(n):!0}function mw({environment:e,workspaceStatus:t}){return e?.baseBranch??t?.branch.defaultBranch??e?.defaultBranch??void 0}function hw({environment:e,selectedMergeBaseBranch:t,workspaceStatus:n}){return t??e?.mergeBaseBranch??e?.baseBranch??n?.mergeBase?.mergeBaseBranch??n?.branch.defaultBranch??c(e)}function gw({branch:e,environment:t,workspaceStatus:n}){let r=e.trim();return r.length===0||r===mw({environment:t,workspaceStatus:n})?null:r}function _w({environment:e,mergeBaseBranchOptions:t,selectedMergeBaseBranch:n,setSelectedMergeBaseBranch:r,thread:i,updateEnvironment:a,workspaceStatus:o}){let s=(0,q.useRef)(void 0),c=e?.id??i?.id,l=a.isPending&&a.variables?.id===e?.id;(0,q.useEffect)(()=>{pw({previousStateKey:s.current,nextStateKey:c,persistedMergeBaseBranch:e?.mergeBaseBranch,selectedMergeBaseBranch:n,updatePending:l})&&(s.current=c,r(fw(e?.mergeBaseBranch)))},[e?.mergeBaseBranch,l,c,n,r]);let u=hw({environment:e,selectedMergeBaseBranch:n,workspaceStatus:o}),d=!!(u||o?.branch.defaultBranch),f=u,p=(0,q.useMemo)(()=>Hn({mergeBaseBranch:f,mergeBaseBranchOptions:t}),[f,t]),m=o?.branch.currentBranch!=null&&o.branch.currentBranch===o.branch.defaultBranch,h=d&&!!f&&!m;return{canSelectMergeBase:!!(h&&f&&p.length>0),effectiveMergeBaseBranch:u,handleMergeBaseBranchChange:(0,q.useCallback)(t=>{if(!e||!i?.environmentId)return;let n=t.trim(),s=gw({branch:n,environment:e,workspaceStatus:o}),c=e.mergeBaseBranch;r(n),s!==c&&a.mutate({id:e.id,mergeBaseBranch:s},{onError:t=>{r(e.mergeBaseBranch??void 0),gt.error(Ht({error:t,fallbackMessage:`Failed to update merge base branch.`}))}})},[e,r,i?.environmentId,a,o]),showBranchComparisonUi:d,showMergeBase:h,mergeBaseBranch:f,mergeBaseCandidates:p}}var vw=D((e=>{e.__esModule=!0,e.extend=a,e.indexOf=l,e.escapeExpression=u,e.isEmpty=d,e.createFrame=f,e.blockParams=p,e.appendContextPath=m;var t={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#x27;`,"`":`&#x60;`,"=":`&#x3D;`},n=/[&<>"'`=]/g,r=/[&<>"'`=]/;function i(e){return t[e]}function a(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],n)&&(e[n]=arguments[t][n]);return e}var o=Object.prototype.toString;e.toString=o;var s=function(e){return typeof e==`function`};s(/x/)&&(e.isFunction=s=function(e){return typeof e==`function`&&o.call(e)===`[object Function]`}),e.isFunction=s;var c=Array.isArray||function(e){return e&&typeof e==`object`?o.call(e)===`[object Array]`:!1};e.isArray=c;function l(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function u(e){if(typeof e!=`string`){if(e&&e.toHTML)return e.toHTML();if(e==null)return``;if(!e)return e+``;e=``+e}return r.test(e)?e.replace(n,i):e}function d(e){return!e&&e!==0?!0:!!(c(e)&&e.length===0)}function f(e){var t=a({},e);return t._parent=e,t}function p(e,t){return e.path=t,e}function m(e,t){return(e?e+`.`:``)+t}})),yw=D(((e,t)=>{e.__esModule=!0;var n=[`description`,`fileName`,`lineNumber`,`endLineNumber`,`message`,`name`,`number`,`stack`];function r(e,t){var i=t&&t.loc,a=void 0,o=void 0,s=void 0,c=void 0;i&&(a=i.start.line,o=i.end.line,s=i.start.column,c=i.end.column,e+=` - `+a+`:`+s);for(var l=Error.prototype.constructor.call(this,e),u=0;u<n.length;u++)this[n[u]]=l[n[u]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{i&&(this.lineNumber=a,this.endLineNumber=o,Object.defineProperty?(Object.defineProperty(this,`column`,{value:s,enumerable:!0}),Object.defineProperty(this,`endColumn`,{value:c,enumerable:!0})):(this.column=s,this.endColumn=c))}catch{}}r.prototype=Error(),e.default=r,t.exports=e.default})),bw=D(((e,t)=>{e.__esModule=!0;var n=vw();e.default=function(e){e.registerHelper(`blockHelperMissing`,function(t,r){var i=r.inverse,a=r.fn;if(t===!0)return a(this);if(t===!1||t==null)return i(this);if(n.isArray(t))return t.length>0?(r.ids&&=[r.name],e.helpers.each(t,r)):i(this);if(r.data&&r.ids){var o=n.createFrame(r.data);o.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:o}}return a(t,r)})},t.exports=e.default})),xw=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=vw(),i=n(yw());e.default=function(e){e.registerHelper(`each`,function(e,t){if(!t)throw new i.default(`Must pass iterator to #each`);var n=t.fn,a=t.inverse,o=0,s=``,c=void 0,l=void 0;t.data&&t.ids&&(l=r.appendContextPath(t.data.contextPath,t.ids[0])+`.`),r.isFunction(e)&&(e=e.call(this)),t.data&&(c=r.createFrame(t.data));function u(t,i,a){c&&(c.key=t,c.index=i,c.first=i===0,c.last=!!a,l&&(c.contextPath=l+t)),s+=n(e[t],{data:c,blockParams:r.blockParams([e[t],t],[l+t,null])})}if(e&&typeof e==`object`)if(r.isArray(e))for(var d=e.length;o<d;o++)o in e&&u(o,o,o===e.length-1);else if(typeof Symbol==`function`&&e[Symbol.iterator]){for(var f=[],p=e[Symbol.iterator](),m=p.next();!m.done;m=p.next())f.push(m.value);e=f;for(var d=e.length;o<d;o++)u(o,o,o===e.length-1)}else (function(){var t=void 0;Object.keys(e).forEach(function(e){t!==void 0&&u(t,o-1),t=e,o++}),t!==void 0&&u(t,o-1,!0)})();return o===0&&(s=a(this)),s})},t.exports=e.default})),Sw=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=n(yw());e.default=function(e){e.registerHelper(`helperMissing`,function(){if(arguments.length!==1)throw new r.default(`Missing helper: "`+arguments[arguments.length-1].name+`"`)})},t.exports=e.default})),Cw=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=vw(),i=n(yw());e.default=function(e){e.registerHelper(`if`,function(e,t){if(arguments.length!=2)throw new i.default(`#if requires exactly one argument`);return r.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||r.isEmpty(e)?t.inverse(this):t.fn(this)}),e.registerHelper(`unless`,function(t,n){if(arguments.length!=2)throw new i.default(`#unless requires exactly one argument`);return e.helpers.if.call(this,t,{fn:n.inverse,inverse:n.fn,hash:n.hash})})},t.exports=e.default})),ww=D(((e,t)=>{e.__esModule=!0,e.default=function(e){e.registerHelper(`log`,function(){for(var t=[void 0],n=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)t.push(arguments[r]);var i=1;n.hash.level==null?n.data&&n.data.level!=null&&(i=n.data.level):i=n.hash.level,t[0]=i,e.log.apply(e,t)})},t.exports=e.default})),Tw=D(((e,t)=>{e.__esModule=!0,e.default=function(e){e.registerHelper(`lookup`,function(e,t,n){return e&&n.lookupProperty(e,t)})},t.exports=e.default})),Ew=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=vw(),i=n(yw());e.default=function(e){e.registerHelper(`with`,function(e,t){if(arguments.length!=2)throw new i.default(`#with requires exactly one argument`);r.isFunction(e)&&(e=e.call(this));var n=t.fn;if(r.isEmpty(e))return t.inverse(this);var a=t.data;return t.data&&t.ids&&(a=r.createFrame(t.data),a.contextPath=r.appendContextPath(t.data.contextPath,t.ids[0])),n(e,{data:a,blockParams:r.blockParams([e],[a&&a.contextPath])})})},t.exports=e.default})),Dw=D((e=>{e.__esModule=!0,e.registerDefaultHelpers=l,e.moveHelperToHooks=u;function t(e){return e&&e.__esModule?e:{default:e}}var n=t(bw()),r=t(xw()),i=t(Sw()),a=t(Cw()),o=t(ww()),s=t(Tw()),c=t(Ew());function l(e){n.default(e),r.default(e),i.default(e),a.default(e),o.default(e),s.default(e),c.default(e)}function u(e,t,n){e.helpers[t]&&(e.hooks[t]=e.helpers[t],n||delete e.helpers[t])}})),Ow=D(((e,t)=>{e.__esModule=!0;var n=vw();e.default=function(e){e.registerDecorator(`inline`,function(e,t,r,i){var a=e;return t.partials||(t.partials={},a=function(i,a){var o=r.partials;r.partials=n.extend({},o,t.partials);var s=e(i,a);return r.partials=o,s}),t.partials[i.args[0]]=i.fn,a})},t.exports=e.default})),kw=D((e=>{e.__esModule=!0,e.registerDefaultDecorators=r;function t(e){return e&&e.__esModule?e:{default:e}}var n=t(Ow());function r(e){n.default(e)}})),Aw=D(((e,t)=>{e.__esModule=!0;var n=vw(),r={methodMap:[`debug`,`info`,`warn`,`error`],level:`info`,lookupLevel:function(e){if(typeof e==`string`){var t=n.indexOf(r.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=r.lookupLevel(e),typeof console<`u`&&r.lookupLevel(r.level)<=e){var t=r.methodMap[e];console[t]||(t=`log`);var n=[...arguments].slice(1);console[t].apply(console,n)}}};e.default=r,t.exports=e.default})),jw=D((e=>{e.__esModule=!0,e.createNewLookupObject=n;var t=vw();function n(){var e=[...arguments];return t.extend.apply(void 0,[Object.create(null)].concat(e))}})),Mw=D((e=>{e.__esModule=!0,e.createProtoAccessControl=a,e.resultIsAllowed=o,e.resetLoggedProperties=l;function t(e){return e&&e.__esModule?e:{default:e}}var n=jw(),r=t(Aw()),i=Object.create(null);function a(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:n.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:n.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}}function o(e,t,n){return s(typeof e==`function`?t.methods:t.properties,n)}function s(e,t){return e.whitelist[t]===void 0?e.defaultValue===void 0?(c(t),!1):e.defaultValue:e.whitelist[t]===!0}function c(e){i[e]!==!0&&(i[e]=!0,r.default.log(`error`,`Handlebars: Access has been denied to resolve the property "`+e+`" because it is not an "own property" of its parent.
1820
- You can add a runtime option to disable the check or this warning:
1821
- See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function l(){Object.keys(i).forEach(function(e){delete i[e]})}})),Nw=D((e=>{e.__esModule=!0,e.HandlebarsEnvironment=l;function t(e){return e&&e.__esModule?e:{default:e}}var n=vw(),r=t(yw()),i=Dw(),a=kw(),o=t(Aw()),s=Mw();e.VERSION=`4.7.8`,e.COMPILER_REVISION=8,e.LAST_COMPATIBLE_COMPILER_REVISION=7,e.REVISION_CHANGES={1:`<= 1.0.rc.2`,2:`== 1.0.0-rc.3`,3:`== 1.0.0-rc.4`,4:`== 1.x.x`,5:`== 2.0.0-alpha.x`,6:`>= 2.0.0-beta.1`,7:`>= 4.0.0 <4.3.0`,8:`>= 4.3.0`};var c=`[object Object]`;function l(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},i.registerDefaultHelpers(this),a.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:o.default,log:o.default.log,registerHelper:function(e,t){if(n.toString.call(e)===c){if(t)throw new r.default(`Arg not supported with multiple helpers`);n.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(n.toString.call(e)===c)n.extend(this.partials,e);else{if(t===void 0)throw new r.default(`Attempting to register a partial called "`+e+`" as undefined`);this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(n.toString.call(e)===c){if(t)throw new r.default(`Arg not supported with multiple decorators`);n.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){s.resetLoggedProperties()}},e.log=o.default.log,e.createFrame=n.createFrame,e.logger=o.default})),Pw=D(((e,t)=>{e.__esModule=!0;function n(e){this.string=e}n.prototype.toString=n.prototype.toHTML=function(){return``+this.string},e.default=n,t.exports=e.default})),Fw=D((e=>{e.__esModule=!0,e.wrapHelper=t;function t(e,t){return typeof e==`function`?function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=t(n),e.apply(this,arguments)}:e}})),Iw=D((e=>{e.__esModule=!0,e.checkRevision=l,e.template=u,e.wrapProgram=d,e.resolvePartial=f,e.invokePartial=p,e.noop=m;function t(e){return e&&e.__esModule?e:{default:e}}function n(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var r=n(vw()),i=t(yw()),a=Nw(),o=Dw(),s=Fw(),c=Mw();function l(e){var t=e&&e[0]||1,n=a.COMPILER_REVISION;if(!(t>=a.LAST_COMPATIBLE_COMPILER_REVISION&&t<=a.COMPILER_REVISION))if(t<a.LAST_COMPATIBLE_COMPILER_REVISION){var r=a.REVISION_CHANGES[n],o=a.REVISION_CHANGES[t];throw new i.default(`Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (`+r+`) or downgrade your runtime to an older version (`+o+`).`)}else throw new i.default(`Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (`+e[1]+`).`)}function u(e,t){if(!t)throw new i.default(`No environment passed to template`);if(!e||!e.main)throw new i.default(`Unknown template object: `+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var n=e.compiler&&e.compiler[0]===7;function a(n,a,o){o.hash&&(a=r.extend({},a,o.hash),o.ids&&(o.ids[0]=!0)),n=t.VM.resolvePartial.call(this,n,a,o);var s=r.extend({},o,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),c=t.VM.invokePartial.call(this,n,a,s);if(c==null&&t.compile&&(o.partials[o.name]=t.compile(n,e.compilerOptions,t),c=o.partials[o.name](a,s)),c!=null){if(o.indent){for(var l=c.split(`
1822
- `),u=0,d=l.length;u<d&&!(!l[u]&&u+1===d);u++)l[u]=o.indent+l[u];c=l.join(`
1823
- `)}return c}else throw new i.default(`The partial `+o.name+` could not be compiled when running in runtime-only mode`)}var s={strict:function(e,t,n){if(!e||!(t in e))throw new i.default(`"`+t+`" not defined in `+e,{loc:n});return s.lookupProperty(e,t)},lookupProperty:function(e,t){var n=e[t];if(n==null||Object.prototype.hasOwnProperty.call(e,t)||c.resultIsAllowed(n,s.protoAccessControl,t))return n},lookup:function(e,t){for(var n=e.length,r=0;r<n;r++)if((e[r]&&s.lookupProperty(e[r],t))!=null)return e[r][t]},lambda:function(e,t){return typeof e==`function`?e.call(t):e},escapeExpression:r.escapeExpression,invokePartial:a,fn:function(t){var n=e[t];return n.decorator=e[t+`_d`],n},programs:[],program:function(e,t,n,r,i){var a=this.programs[e],o=this.fn(e);return t||i||r||n?a=d(this,e,o,t,n,r,i):a||=this.programs[e]=d(this,e,o),a},data:function(e,t){for(;e&&t--;)e=e._parent;return e},mergeIfNeeded:function(e,t){var n=e||t;return e&&t&&e!==t&&(n=r.extend({},t,e)),n},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function l(t){var n=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],r=n.data;l._setup(n),!n.partial&&e.useData&&(r=h(t,r));var i=void 0,a=e.useBlockParams?[]:void 0;e.useDepths&&(i=n.depths?t==n.depths[0]?n.depths:[t].concat(n.depths):[t]);function o(t){return``+e.main(s,t,s.helpers,s.partials,r,a,i)}return o=g(e.main,o,s,n.depths||[],r,a),o(t,n)}return l.isTop=!0,l._setup=function(i){if(i.partial)s.protoAccessControl=i.protoAccessControl,s.helpers=i.helpers,s.partials=i.partials,s.decorators=i.decorators,s.hooks=i.hooks;else{var a=r.extend({},t.helpers,i.helpers);_(a,s),s.helpers=a,e.usePartial&&(s.partials=s.mergeIfNeeded(i.partials,t.partials)),(e.usePartial||e.useDecorators)&&(s.decorators=r.extend({},t.decorators,i.decorators)),s.hooks={},s.protoAccessControl=c.createProtoAccessControl(i);var l=i.allowCallsToHelperMissing||n;o.moveHelperToHooks(s,`helperMissing`,l),o.moveHelperToHooks(s,`blockHelperMissing`,l)}},l._child=function(t,n,r,a){if(e.useBlockParams&&!r)throw new i.default(`must pass block params`);if(e.useDepths&&!a)throw new i.default(`must pass parent depths`);return d(s,t,e[t],n,0,r,a)},l}function d(e,t,n,r,i,a,o){function s(t){var i=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],s=o;return o&&t!=o[0]&&!(t===e.nullContext&&o[0]===null)&&(s=[t].concat(o)),n(e,t,e.helpers,e.partials,i.data||r,a&&[i.blockParams].concat(a),s)}return s=g(n,s,e,o,r,a),s.program=t,s.depth=o?o.length:0,s.blockParams=i||0,s}function f(e,t,n){return e?!e.call&&!n.name&&(n.name=e,e=n.partials[e]):e=n.name===`@partial-block`?n.data[`partial-block`]:n.partials[n.name],e}function p(e,t,n){var o=n.data&&n.data[`partial-block`];n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var s=void 0;if(n.fn&&n.fn!==m&&(function(){n.data=a.createFrame(n.data);var e=n.fn;s=n.data[`partial-block`]=function(t){var n=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return n.data=a.createFrame(n.data),n.data[`partial-block`]=o,e(t,n)},e.partials&&(n.partials=r.extend({},n.partials,e.partials))})(),e===void 0&&s&&(e=s),e===void 0)throw new i.default(`The partial `+n.name+` could not be found`);if(e instanceof Function)return e(t,n)}function m(){return``}function h(e,t){return(!t||!(`root`in t))&&(t=t?a.createFrame(t):{},t.root=e),t}function g(e,t,n,i,a,o){if(e.decorator){var s={};t=e.decorator(t,s,n,i&&i[0],a,o,i),r.extend(t,s)}return t}function _(e,t){Object.keys(e).forEach(function(n){var r=e[n];e[n]=v(r,t)})}function v(e,t){var n=t.lookupProperty;return s.wrapHelper(e,function(e){return r.extend({lookupProperty:n},e)})}})),Lw=D(((e,t)=>{e.__esModule=!0,e.default=function(e){(function(){typeof globalThis!=`object`&&(Object.prototype.__defineGetter__(`__magic__`,function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},t.exports=e.default})),Rw=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}function r(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var i=r(Nw()),a=n(Pw()),o=n(yw()),s=r(vw()),c=r(Iw()),l=n(Lw());function u(){var e=new i.HandlebarsEnvironment;return s.extend(e,i),e.SafeString=a.default,e.Exception=o.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=c,e.template=function(t){return c.template(t,e)},e}var d=u();d.create=u,l.default(d),d.default=d,e.default=d,t.exports=e.default})),zw=D(((e,t)=>{e.__esModule=!0;var n={helpers:{helperExpression:function(e){return e.type===`SubExpression`||(e.type===`MustacheStatement`||e.type===`BlockStatement`)&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return e.parts.length===1&&!n.helpers.scopedId(e)&&!e.depth}}};e.default=n,t.exports=e.default})),Bw=D(((e,t)=>{e.__esModule=!0,e.default=(function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:`error`,5:`EOF`,14:`COMMENT`,15:`CONTENT`,18:`END_RAW_BLOCK`,19:`OPEN_RAW_BLOCK`,23:`CLOSE_RAW_BLOCK`,29:`OPEN_BLOCK`,33:`CLOSE`,34:`OPEN_INVERSE`,39:`OPEN_INVERSE_CHAIN`,44:`INVERSE`,47:`OPEN_ENDBLOCK`,48:`OPEN`,51:`OPEN_UNESCAPED`,54:`CLOSE_UNESCAPED`,55:`OPEN_PARTIAL`,60:`OPEN_PARTIAL_BLOCK`,65:`OPEN_SEXPR`,68:`CLOSE_SEXPR`,72:`ID`,73:`EQUALS`,75:`OPEN_BLOCK_PARAMS`,77:`CLOSE_BLOCK_PARAMS`,80:`STRING`,81:`NUMBER`,82:`BOOLEAN`,83:`UNDEFINED`,84:`NULL`,85:`DATA`,87:`SEP`},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=r.prepareProgram(a[s]);break;case 3:this.$=a[s];break;case 4:this.$=a[s];break;case 5:this.$=a[s];break;case 6:this.$=a[s];break;case 7:this.$=a[s];break;case 8:this.$=a[s];break;case 9:this.$={type:`CommentStatement`,value:r.stripComment(a[s]),strip:r.stripFlags(a[s],a[s]),loc:r.locInfo(this._$)};break;case 10:this.$={type:`ContentStatement`,original:a[s],value:a[s],loc:r.locInfo(this._$)};break;case 11:this.$=r.prepareRawBlock(a[s-2],a[s-1],a[s],this._$);break;case 12:this.$={path:a[s-3],params:a[s-2],hash:a[s-1]};break;case 13:this.$=r.prepareBlock(a[s-3],a[s-2],a[s-1],a[s],!1,this._$);break;case 14:this.$=r.prepareBlock(a[s-3],a[s-2],a[s-1],a[s],!0,this._$);break;case 15:this.$={open:a[s-5],path:a[s-4],params:a[s-3],hash:a[s-2],blockParams:a[s-1],strip:r.stripFlags(a[s-5],a[s])};break;case 16:this.$={path:a[s-4],params:a[s-3],hash:a[s-2],blockParams:a[s-1],strip:r.stripFlags(a[s-5],a[s])};break;case 17:this.$={path:a[s-4],params:a[s-3],hash:a[s-2],blockParams:a[s-1],strip:r.stripFlags(a[s-5],a[s])};break;case 18:this.$={strip:r.stripFlags(a[s-1],a[s-1]),program:a[s]};break;case 19:var c=r.prepareBlock(a[s-2],a[s-1],a[s],a[s],!1,this._$),l=r.prepareProgram([c],a[s-1].loc);l.chained=!0,this.$={strip:a[s-2].strip,program:l,chain:!0};break;case 20:this.$=a[s];break;case 21:this.$={path:a[s-1],strip:r.stripFlags(a[s-2],a[s])};break;case 22:this.$=r.prepareMustache(a[s-3],a[s-2],a[s-1],a[s-4],r.stripFlags(a[s-4],a[s]),this._$);break;case 23:this.$=r.prepareMustache(a[s-3],a[s-2],a[s-1],a[s-4],r.stripFlags(a[s-4],a[s]),this._$);break;case 24:this.$={type:`PartialStatement`,name:a[s-3],params:a[s-2],hash:a[s-1],indent:``,strip:r.stripFlags(a[s-4],a[s]),loc:r.locInfo(this._$)};break;case 25:this.$=r.preparePartialBlock(a[s-2],a[s-1],a[s],this._$);break;case 26:this.$={path:a[s-3],params:a[s-2],hash:a[s-1],strip:r.stripFlags(a[s-4],a[s])};break;case 27:this.$=a[s];break;case 28:this.$=a[s];break;case 29:this.$={type:`SubExpression`,path:a[s-3],params:a[s-2],hash:a[s-1],loc:r.locInfo(this._$)};break;case 30:this.$={type:`Hash`,pairs:a[s],loc:r.locInfo(this._$)};break;case 31:this.$={type:`HashPair`,key:r.id(a[s-2]),value:a[s],loc:r.locInfo(this._$)};break;case 32:this.$=r.id(a[s-1]);break;case 33:this.$=a[s];break;case 34:this.$=a[s];break;case 35:this.$={type:`StringLiteral`,value:a[s],original:a[s],loc:r.locInfo(this._$)};break;case 36:this.$={type:`NumberLiteral`,value:Number(a[s]),original:Number(a[s]),loc:r.locInfo(this._$)};break;case 37:this.$={type:`BooleanLiteral`,value:a[s]===`true`,original:a[s]===`true`,loc:r.locInfo(this._$)};break;case 38:this.$={type:`UndefinedLiteral`,original:void 0,value:void 0,loc:r.locInfo(this._$)};break;case 39:this.$={type:`NullLiteral`,original:null,value:null,loc:r.locInfo(this._$)};break;case 40:this.$=a[s];break;case 41:this.$=a[s];break;case 42:this.$=r.preparePath(!0,a[s],this._$);break;case 43:this.$=r.preparePath(!1,a[s],this._$);break;case 44:a[s-2].push({part:r.id(a[s]),original:a[s],separator:a[s-1]}),this.$=a[s-2];break;case 45:this.$=[{part:r.id(a[s]),original:a[s]}];break;case 46:this.$=[];break;case 47:a[s-1].push(a[s]);break;case 48:this.$=[];break;case 49:a[s-1].push(a[s]);break;case 50:this.$=[];break;case 51:a[s-1].push(a[s]);break;case 58:this.$=[];break;case 59:a[s-1].push(a[s]);break;case 64:this.$=[];break;case 65:a[s-1].push(a[s]);break;case 70:this.$=[];break;case 71:a[s-1].push(a[s]);break;case 78:this.$=[];break;case 79:a[s-1].push(a[s]);break;case 82:this.$=[];break;case 83:a[s-1].push(a[s]);break;case 86:this.$=[];break;case 87:a[s-1].push(a[s]);break;case 90:this.$=[];break;case 91:a[s-1].push(a[s]);break;case 94:this.$=[];break;case 95:a[s-1].push(a[s]);break;case 98:this.$=[a[s]];break;case 99:a[s-1].push(a[s]);break;case 100:this.$=[a[s]];break;case 101:a[s-1].push(a[s]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(e,t){throw Error(e)},parse:function(e){var t=this,n=[0],r=[null],i=[],a=this.table,o=``,s=0,c=0,l=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,this.lexer.yylloc===void 0&&(this.lexer.yylloc={});var u=this.lexer.yylloc;i.push(u);var d=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError==`function`&&(this.parseError=this.yy.parseError);function f(){var e=t.lexer.lex()||1;return typeof e!=`number`&&(e=t.symbols_[e]||e),e}for(var p,m,h,g,_,v={},y,b,x,S;;){if(h=n[n.length-1],this.defaultActions[h]?g=this.defaultActions[h]:(p??=f(),g=a[h]&&a[h][p]),g===void 0||!g.length||!g[0]){var C=``;if(!l){for(y in S=[],a[h])this.terminals_[y]&&y>2&&S.push(`'`+this.terminals_[y]+`'`);C=this.lexer.showPosition?`Parse error on line `+(s+1)+`:
1824
- `+this.lexer.showPosition()+`
1825
- Expecting `+S.join(`, `)+`, got '`+(this.terminals_[p]||p)+`'`:`Parse error on line `+(s+1)+`: Unexpected `+(p==1?`end of input`:`'`+(this.terminals_[p]||p)+`'`),this.parseError(C,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:u,expected:S})}}if(g[0]instanceof Array&&g.length>1)throw Error(`Parse Error: multiple actions possible at state: `+h+`, token: `+p);switch(g[0]){case 1:n.push(p),r.push(this.lexer.yytext),i.push(this.lexer.yylloc),n.push(g[1]),p=null,m?(p=m,m=null):(c=this.lexer.yyleng,o=this.lexer.yytext,s=this.lexer.yylineno,u=this.lexer.yylloc,l>0&&l--);break;case 2:if(b=this.productions_[g[1]][1],v.$=r[r.length-b],v._$={first_line:i[i.length-(b||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(b||1)].first_column,last_column:i[i.length-1].last_column},d&&(v._$.range=[i[i.length-(b||1)].range[0],i[i.length-1].range[1]]),_=this.performAction.call(v,o,c,s,this.yy,g[1],r,i),_!==void 0)return _;b&&(n=n.slice(0,-1*b*2),r=r.slice(0,-1*b),i=i.slice(0,-1*b)),n.push(this.productions_[g[1]][0]),r.push(v.$),i.push(v._$),x=a[n[n.length-2]][n[n.length-1]],n.push(x);break;case 3:return!0}}return!0}};e.lexer=(function(){var e={EOF:1,parseError:function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},showPosition:function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
1826
- `+t+`^`},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r,i;this._more||(this.yytext=``,this.match=``);for(var a=this._currentRules(),o=0;o<a.length&&(n=this._input.match(this.rules[a[o]]),!(n&&(!t||n[0].length>t[0].length)&&(t=n,r=o,!this.options.flex)));o++);return t?(i=t[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,a[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
1827
- `+this.showPosition(),{text:``,token:null,line:this.yylineno})},lex:function(){var e=this.next();return e===void 0?this.lex():e},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)}};return e.options={},e.performAction=function(e,t,n,r){function i(e,n){return t.yytext=t.yytext.substring(e,t.yyleng-n+e)}switch(n){case 0:if(t.yytext.slice(-2)===`\\\\`?(i(0,1),this.begin(`mu`)):t.yytext.slice(-1)===`\\`?(i(0,1),this.begin(`emu`)):this.begin(`mu`),t.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin(`raw`),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]===`raw`?15:(i(5,9),`END_RAW_BLOCK`);case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin(`raw`),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(t.yytext),this.popState(),this.begin(`com`);break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return t.yytext=i(1,2).replace(/\\"/g,`"`),80;case 32:return t.yytext=i(1,2).replace(/\\'/g,`'`),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return t.yytext=t.yytext.replace(/\\([\\\]])/g,`$1`),72;case 43:return`INVALID`;case 44:return 5}},e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],e.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},e})();function t(){this.yy={}}return t.prototype=e,e.Parser=t,new t})(),t.exports=e.default})),Vw=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=n(yw());function i(){this.parents=[]}i.prototype={constructor:i,mutating:!1,acceptKey:function(e,t){var n=this.accept(e[t]);if(this.mutating){if(n&&!i.prototype[n.type])throw new r.default(`Unexpected node type "`+n.type+`" found when accepting `+t+` on `+e.type);e[t]=n}},acceptRequired:function(e,t){if(this.acceptKey(e,t),!e[t])throw new r.default(e.type+` requires `+t)},acceptArray:function(e){for(var t=0,n=e.length;t<n;t++)this.acceptKey(e,t),e[t]||(e.splice(t,1),t--,n--)},accept:function(e){if(e){if(!this[e.type])throw new r.default(`Unknown type: `+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var t=this[e.type](e);if(this.current=this.parents.shift(),!this.mutating||t)return t;if(t!==!1)return e}},Program:function(e){this.acceptArray(e.body)},MustacheStatement:a,Decorator:a,BlockStatement:o,DecoratorBlock:o,PartialStatement:s,PartialBlockStatement:function(e){s.call(this,e),this.acceptKey(e,`program`)},ContentStatement:function(){},CommentStatement:function(){},SubExpression:a,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(e){this.acceptArray(e.pairs)},HashPair:function(e){this.acceptRequired(e,`value`)}};function a(e){this.acceptRequired(e,`path`),this.acceptArray(e.params),this.acceptKey(e,`hash`)}function o(e){a.call(this,e),this.acceptKey(e,`program`),this.acceptKey(e,`inverse`)}function s(e){this.acceptRequired(e,`name`),this.acceptArray(e.params),this.acceptKey(e,`hash`)}e.default=i,t.exports=e.default})),Hw=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=n(Vw());function i(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}i.prototype=new r.default,i.prototype.Program=function(e){var t=!this.options.ignoreStandalone,n=!this.isRootSeen;this.isRootSeen=!0;for(var r=e.body,i=0,l=r.length;i<l;i++){var u=r[i],d=this.accept(u);if(d){var f=a(r,i,n),p=o(r,i,n),m=d.openStandalone&&f,h=d.closeStandalone&&p,g=d.inlineStandalone&&f&&p;d.close&&s(r,i,!0),d.open&&c(r,i,!0),t&&g&&(s(r,i),c(r,i)&&u.type===`PartialStatement`&&(u.indent=/([ \t]+$)/.exec(r[i-1].original)[1])),t&&m&&(s((u.program||u.inverse).body),c(r,i)),t&&h&&(s(r,i),c((u.inverse||u.program).body))}}return e},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,n=e.program&&e.inverse,r=n,i=n;if(n&&n.chained)for(r=n.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var l={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:o(t.body),closeStandalone:a((r||t).body)};if(e.openStrip.close&&s(t.body,null,!0),n){var u=e.inverseStrip;u.open&&c(t.body,null,!0),u.close&&s(r.body,null,!0),e.closeStrip.open&&c(i.body,null,!0),!this.options.ignoreStandalone&&a(t.body)&&o(r.body)&&(c(t.body),s(r.body))}else e.closeStrip.open&&c(t.body,null,!0);return l},i.prototype.Decorator=i.prototype.MustacheStatement=function(e){return e.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function a(e,t,n){t===void 0&&(t=e.length);var r=e[t-1],i=e[t-2];if(!r)return n;if(r.type===`ContentStatement`)return(i||!n?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(r.original)}function o(e,t,n){t===void 0&&(t=-1);var r=e[t+1],i=e[t+2];if(!r)return n;if(r.type===`ContentStatement`)return(i||!n?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(r.original)}function s(e,t,n){var r=e[t==null?0:t+1];if(!(!r||r.type!==`ContentStatement`||!n&&r.rightStripped)){var i=r.value;r.value=r.value.replace(n?/^\s+/:/^[ \t]*\r?\n?/,``),r.rightStripped=r.value!==i}}function c(e,t,n){var r=e[t==null?e.length-1:t-1];if(!(!r||r.type!==`ContentStatement`||!n&&r.leftStripped)){var i=r.value;return r.value=r.value.replace(n?/\s+$/:/[ \t]+$/,``),r.leftStripped=r.value!==i,r.leftStripped}}e.default=i,t.exports=e.default})),Uw=D((e=>{e.__esModule=!0,e.SourceLocation=i,e.id=a,e.stripFlags=o,e.stripComment=s,e.preparePath=c,e.prepareMustache=l,e.prepareRawBlock=u,e.prepareBlock=d,e.prepareProgram=f,e.preparePartialBlock=p;function t(e){return e&&e.__esModule?e:{default:e}}var n=t(yw());function r(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new n.default(e.path.original+` doesn't match `+t,r)}}function i(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}function a(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function o(e,t){return{open:e.charAt(2)===`~`,close:t.charAt(t.length-3)===`~`}}function s(e){return e.replace(/^\{\{~?!-?-?/,``).replace(/-?-?~?\}\}$/,``)}function c(e,t,r){r=this.locInfo(r);for(var i=e?`@`:``,a=[],o=0,s=0,c=t.length;s<c;s++){var l=t[s].part,u=t[s].original!==l;if(i+=(t[s].separator||``)+l,!u&&(l===`..`||l===`.`||l===`this`)){if(a.length>0)throw new n.default(`Invalid path: `+i,{loc:r});l===`..`&&o++}else a.push(l)}return{type:`PathExpression`,data:e,depth:o,parts:a,original:i,loc:r}}function l(e,t,n,r,i,a){var o=r.charAt(3)||r.charAt(2),s=o!==`{`&&o!==`&`;return{type:/\*/.test(r)?`Decorator`:`MustacheStatement`,path:e,params:t,hash:n,escaped:s,strip:i,loc:this.locInfo(a)}}function u(e,t,n,i){r(e,n),i=this.locInfo(i);var a={type:`Program`,body:t,strip:{},loc:i};return{type:`BlockStatement`,path:e.path,params:e.params,hash:e.hash,program:a,openStrip:{},inverseStrip:{},closeStrip:{},loc:i}}function d(e,t,i,a,o,s){a&&a.path&&r(e,a);var c=/\*/.test(e.open);t.blockParams=e.blockParams;var l=void 0,u=void 0;if(i){if(c)throw new n.default(`Unexpected inverse block on decorator`,i);i.chain&&(i.program.body[0].closeStrip=a.strip),u=i.strip,l=i.program}return o&&(o=l,l=t,t=o),{type:c?`DecoratorBlock`:`BlockStatement`,path:e.path,params:e.params,hash:e.hash,program:t,inverse:l,openStrip:e.strip,inverseStrip:u,closeStrip:a&&a.strip,loc:this.locInfo(s)}}function f(e,t){if(!t&&e.length){var n=e[0].loc,r=e[e.length-1].loc;n&&r&&(t={source:n.source,start:{line:n.start.line,column:n.start.column},end:{line:r.end.line,column:r.end.column}})}return{type:`Program`,body:e,strip:{},loc:t}}function p(e,t,n,i){return r(e,n),{type:`PartialBlockStatement`,name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:n&&n.strip,loc:this.locInfo(i)}}})),Ww=D((e=>{e.__esModule=!0,e.parseWithoutProcessing=c,e.parse=l;function t(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function n(e){return e&&e.__esModule?e:{default:e}}var r=n(Bw()),i=n(Hw()),a=t(Uw()),o=vw();e.parser=r.default;var s={};o.extend(s,a);function c(e,t){return e.type===`Program`?e:(r.default.yy=s,s.locInfo=function(e){return new s.SourceLocation(t&&t.srcName,e)},r.default.parse(e))}function l(e,t){var n=c(e,t);return new i.default(t).accept(n)}})),Gw=D((e=>{e.__esModule=!0,e.Compiler=o,e.precompile=s,e.compile=c;function t(e){return e&&e.__esModule?e:{default:e}}var n=t(yw()),r=vw(),i=t(zw()),a=[].slice;function o(){}o.prototype={compiler:o,equals:function(e){var t=this.opcodes.length;if(e.opcodes.length!==t)return!1;for(var n=0;n<t;n++){var r=this.opcodes[n],i=e.opcodes[n];if(r.opcode!==i.opcode||!l(r.args,i.args))return!1}t=this.children.length;for(var n=0;n<t;n++)if(!this.children[n].equals(e.children[n]))return!1;return!0},guid:0,compile:function(e,t){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=t,this.stringParams=t.stringParams,this.trackIds=t.trackIds,t.blockParams=t.blockParams||[],t.knownHelpers=r.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},t.knownHelpers),this.accept(e)},compileProgram:function(e){var t=new this.compiler().compile(e,this.options),n=this.guid++;return this.usePartial=this.usePartial||t.usePartial,this.children[n]=t,this.useDepths=this.useDepths||t.useDepths,n},accept:function(e){if(!this[e.type])throw new n.default(`Unknown type: `+e.type,e);this.sourceNode.unshift(e);var t=this[e.type](e);return this.sourceNode.shift(),t},Program:function(e){this.options.blockParams.unshift(e.blockParams);for(var t=e.body,n=t.length,r=0;r<n;r++)this.accept(t[r]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=e.blockParams?e.blockParams.length:0,this},BlockStatement:function(e){u(e);var t=e.program,n=e.inverse;t&&=this.compileProgram(t),n&&=this.compileProgram(n);var r=this.classifySexpr(e);r===`helper`?this.helperSexpr(e,t,n):r===`simple`?(this.simpleSexpr(e),this.opcode(`pushProgram`,t),this.opcode(`pushProgram`,n),this.opcode(`emptyHash`),this.opcode(`blockValue`,e.path.original)):(this.ambiguousSexpr(e,t,n),this.opcode(`pushProgram`,t),this.opcode(`pushProgram`,n),this.opcode(`emptyHash`),this.opcode(`ambiguousBlockValue`)),this.opcode(`append`)},DecoratorBlock:function(e){var t=e.program&&this.compileProgram(e.program),n=this.setupFullMustacheParams(e,t,void 0),r=e.path;this.useDecorators=!0,this.opcode(`registerDecorator`,n.length,r.original)},PartialStatement:function(e){this.usePartial=!0;var t=e.program;t&&=this.compileProgram(e.program);var r=e.params;if(r.length>1)throw new n.default(`Unsupported number of partial arguments: `+r.length,e);r.length||(this.options.explicitPartialContext?this.opcode(`pushLiteral`,`undefined`):r.push({type:`PathExpression`,parts:[],depth:0}));var i=e.name.original,a=e.name.type===`SubExpression`;a&&this.accept(e.name),this.setupFullMustacheParams(e,t,void 0,!0);var o=e.indent||``;this.options.preventIndent&&o&&(this.opcode(`appendContent`,o),o=``),this.opcode(`invokePartial`,a,i,o),this.opcode(`append`)},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode(`appendEscaped`):this.opcode(`append`)},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode(`appendContent`,e.value)},CommentStatement:function(){},SubExpression:function(e){u(e);var t=this.classifySexpr(e);t===`simple`?this.simpleSexpr(e):t===`helper`?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,t,n){var r=e.path,i=r.parts[0],a=t!=null||n!=null;this.opcode(`getContext`,r.depth),this.opcode(`pushProgram`,t),this.opcode(`pushProgram`,n),r.strict=!0,this.accept(r),this.opcode(`invokeAmbiguous`,i,a)},simpleSexpr:function(e){var t=e.path;t.strict=!0,this.accept(t),this.opcode(`resolvePossibleLambda`)},helperSexpr:function(e,t,r){var a=this.setupFullMustacheParams(e,t,r),o=e.path,s=o.parts[0];if(this.options.knownHelpers[s])this.opcode(`invokeKnownHelper`,a.length,s);else if(this.options.knownHelpersOnly)throw new n.default(`You specified knownHelpersOnly, but used the unknown helper `+s,e);else o.strict=!0,o.falsy=!0,this.accept(o),this.opcode(`invokeHelper`,a.length,o.original,i.default.helpers.simpleId(o))},PathExpression:function(e){this.addDepth(e.depth),this.opcode(`getContext`,e.depth);var t=e.parts[0],n=i.default.helpers.scopedId(e),r=!e.depth&&!n&&this.blockParamIndex(t);r?this.opcode(`lookupBlockParam`,r,e.parts):t?e.data?(this.options.data=!0,this.opcode(`lookupData`,e.depth,e.parts,e.strict)):this.opcode(`lookupOnContext`,e.parts,e.falsy,e.strict,n):this.opcode(`pushContext`)},StringLiteral:function(e){this.opcode(`pushString`,e.value)},NumberLiteral:function(e){this.opcode(`pushLiteral`,e.value)},BooleanLiteral:function(e){this.opcode(`pushLiteral`,e.value)},UndefinedLiteral:function(){this.opcode(`pushLiteral`,`undefined`)},NullLiteral:function(){this.opcode(`pushLiteral`,`null`)},Hash:function(e){var t=e.pairs,n=0,r=t.length;for(this.opcode(`pushHash`);n<r;n++)this.pushParam(t[n].value);for(;n--;)this.opcode(`assignToHash`,t[n].key);this.opcode(`popHash`)},opcode:function(e){this.opcodes.push({opcode:e,args:a.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(e){e&&(this.useDepths=!0)},classifySexpr:function(e){var t=i.default.helpers.simpleId(e.path),n=t&&!!this.blockParamIndex(e.path.parts[0]),r=!n&&i.default.helpers.helperExpression(e),a=!n&&(r||t);if(a&&!r){var o=e.path.parts[0],s=this.options;s.knownHelpers[o]?r=!0:s.knownHelpersOnly&&(a=!1)}return r?`helper`:a?`ambiguous`:`simple`},pushParams:function(e){for(var t=0,n=e.length;t<n;t++)this.pushParam(e[t])},pushParam:function(e){var t=e.value==null?e.original||``:e.value;if(this.stringParams)t.replace&&(t=t.replace(/^(\.?\.\/)*/g,``).replace(/\//g,`.`)),e.depth&&this.addDepth(e.depth),this.opcode(`getContext`,e.depth||0),this.opcode(`pushStringParam`,t,e.type),e.type===`SubExpression`&&this.accept(e);else{if(this.trackIds){var n=void 0;if(e.parts&&!i.default.helpers.scopedId(e)&&!e.depth&&(n=this.blockParamIndex(e.parts[0])),n){var r=e.parts.slice(1).join(`.`);this.opcode(`pushId`,`BlockParam`,n,r)}else t=e.original||t,t.replace&&(t=t.replace(/^this(?:\.|$)/,``).replace(/^\.\//,``).replace(/^\.$/,``)),this.opcode(`pushId`,e.type,t)}this.accept(e)}},setupFullMustacheParams:function(e,t,n,r){var i=e.params;return this.pushParams(i),this.opcode(`pushProgram`,t),this.opcode(`pushProgram`,n),e.hash?this.accept(e.hash):this.opcode(`emptyHash`,r),i},blockParamIndex:function(e){for(var t=0,n=this.options.blockParams.length;t<n;t++){var i=this.options.blockParams[t],a=i&&r.indexOf(i,e);if(i&&a>=0)return[t,a]}}};function s(e,t,r){if(e==null||typeof e!=`string`&&e.type!==`Program`)throw new n.default(`You must pass a string or Handlebars AST to Handlebars.precompile. You passed `+e);t||={},`data`in t||(t.data=!0),t.compat&&(t.useDepths=!0);var i=r.parse(e,t),a=new r.Compiler().compile(i,t);return new r.JavaScriptCompiler().compile(a,t)}function c(e,t,i){if(t===void 0&&(t={}),e==null||typeof e!=`string`&&e.type!==`Program`)throw new n.default(`You must pass a string or Handlebars AST to Handlebars.compile. You passed `+e);t=r.extend({},t),`data`in t||(t.data=!0),t.compat&&(t.useDepths=!0);var a=void 0;function o(){var n=i.parse(e,t),r=new i.Compiler().compile(n,t),a=new i.JavaScriptCompiler().compile(r,t,void 0,!0);return i.template(a)}function s(e,t){return a||=o(),a.call(this,e,t)}return s._setup=function(e){return a||=o(),a._setup(e)},s._child=function(e,t,n,r){return a||=o(),a._child(e,t,n,r)},s}function l(e,t){if(e===t)return!0;if(r.isArray(e)&&r.isArray(t)&&e.length===t.length){for(var n=0;n<e.length;n++)if(!l(e[n],t[n]))return!1;return!0}}function u(e){if(!e.path.parts){var t=e.path;e.path={type:`PathExpression`,data:!1,depth:0,parts:[t.original+``],original:t.original+``,loc:t.loc}}}})),Kw=D((e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``);e.encode=function(e){if(0<=e&&e<t.length)return t[e];throw TypeError(`Must be between 0 and 63: `+e)},e.decode=function(e){var t=65,n=90,r=97,i=122,a=48;return t<=e&&e<=n?e-t:r<=e&&e<=i?e-r+26:a<=e&&e<=57?e-a+52:e==43?62:e==47?63:-1}})),qw=D((e=>{var t=Kw(),n=5,r=1<<n,i=r-1,a=r;function o(e){return e<0?(-e<<1)+1:(e<<1)+0}function s(e){var t=(e&1)==1,n=e>>1;return t?-n:n}e.encode=function(e){var r=``,s,c=o(e);do s=c&i,c>>>=n,c>0&&(s|=a),r+=t.encode(s);while(c>0);return r},e.decode=function(e,r,o){var c=e.length,l=0,u=0,d,f;do{if(r>=c)throw Error(`Expected more digits in base 64 VLQ value.`);if(f=t.decode(e.charCodeAt(r++)),f===-1)throw Error(`Invalid base64 digit: `+e.charAt(r-1));d=!!(f&a),f&=i,l+=f<<u,u+=n}while(d);o.value=s(l),o.rest=r}})),Jw=D((e=>{function t(e,t,n){if(t in e)return e[t];if(arguments.length===3)return n;throw Error(`"`+t+`" is a required argument.`)}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function i(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}e.urlParse=i;function a(e){var t=``;return e.scheme&&(t+=e.scheme+`:`),t+=`//`,e.auth&&(t+=e.auth+`@`),e.host&&(t+=e.host),e.port&&(t+=`:`+e.port),e.path&&(t+=e.path),t}e.urlGenerate=a;function o(t){var n=t,r=i(t);if(r){if(!r.path)return t;n=r.path}for(var o=e.isAbsolute(n),s=n.split(/\/+/),c,l=0,u=s.length-1;u>=0;u--)c=s[u],c===`.`?s.splice(u,1):c===`..`?l++:l>0&&(c===``?(s.splice(u+1,l),l=0):(s.splice(u,2),l--));return n=s.join(`/`),n===``&&(n=o?`/`:`.`),r?(r.path=n,a(r)):n}e.normalize=o;function s(e,t){e===``&&(e=`.`),t===``&&(t=`.`);var n=i(t),s=i(e);if(s&&(e=s.path||`/`),n&&!n.scheme)return s&&(n.scheme=s.scheme),a(n);if(n||t.match(r))return t;if(s&&!s.host&&!s.path)return s.host=t,a(s);var c=t.charAt(0)===`/`?t:o(e.replace(/\/+$/,``)+`/`+t);return s?(s.path=c,a(s)):c}e.join=s,e.isAbsolute=function(e){return e.charAt(0)===`/`||n.test(e)};function c(e,t){e===``&&(e=`.`),e=e.replace(/\/$/,``);for(var n=0;t.indexOf(e+`/`)!==0;){var r=e.lastIndexOf(`/`);if(r<0||(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/)))return t;++n}return Array(n+1).join(`../`)+t.substr(e.length+1)}e.relative=c;var l=function(){return!(`__proto__`in Object.create(null))}();function u(e){return e}function d(e){return p(e)?`$`+e:e}e.toSetString=l?u:d;function f(e){return p(e)?e.slice(1):e}e.fromSetString=l?u:f;function p(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var n=t-10;n>=0;n--)if(e.charCodeAt(n)!==36)return!1;return!0}function m(e,t,n){var r=g(e.source,t.source);return r!==0||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0||n)||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=e.generatedLine-t.generatedLine,r!==0)?r:g(e.name,t.name)}e.compareByOriginalPositions=m;function h(e,t,n){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0||n)||(r=g(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:g(e.name,t.name)}e.compareByGeneratedPositionsDeflated=h;function g(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function _(e,t){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=g(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:g(e.name,t.name)}e.compareByGeneratedPositionsInflated=_;function v(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,``))}e.parseSourceMapInput=v;function y(e,t,n){if(t||=``,e&&(e[e.length-1]!==`/`&&t[0]!==`/`&&(e+=`/`),t=e+t),n){var r=i(n);if(!r)throw Error(`sourceMapURL could not be parsed`);if(r.path){var c=r.path.lastIndexOf(`/`);c>=0&&(r.path=r.path.substring(0,c+1))}t=s(a(r),t)}return o(t)}e.computeSourceURL=y})),Yw=D((e=>{var t=Jw(),n=Object.prototype.hasOwnProperty,r=typeof Map<`u`;function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(e,t){for(var n=new i,r=0,a=e.length;r<a;r++)n.add(e[r],t);return n},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(e,i){var a=r?e:t.toSetString(e),o=r?this.has(e):n.call(this._set,a),s=this._array.length;(!o||i)&&this._array.push(e),o||(r?this._set.set(e,s):this._set[a]=s)},i.prototype.has=function(e){if(r)return this._set.has(e);var i=t.toSetString(e);return n.call(this._set,i)},i.prototype.indexOf=function(e){if(r){var i=this._set.get(e);if(i>=0)return i}else{var a=t.toSetString(e);if(n.call(this._set,a))return this._set[a]}throw Error(`"`+e+`" is not in the set.`)},i.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw Error(`No element indexed by `+e)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),Xw=D((e=>{var t=Jw();function n(e,n){var r=e.generatedLine,i=n.generatedLine,a=e.generatedColumn,o=n.generatedColumn;return i>r||i==r&&o>=a||t.compareByGeneratedPositionsInflated(e,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},r.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},r.prototype.toArray=function(){return this._sorted||=(this._array.sort(t.compareByGeneratedPositionsInflated),!0),this._array},e.MappingList=r})),Zw=D((e=>{var t=qw(),n=Jw(),r=Yw().ArraySet,i=Xw().MappingList;function a(e){e||={},this._file=n.getArg(e,`file`,null),this._sourceRoot=n.getArg(e,`sourceRoot`,null),this._skipValidation=n.getArg(e,`skipValidation`,!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e){var t=e.sourceRoot,r=new a({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var i={generated:{line:e.generatedLine,column:e.generatedColumn}};e.source!=null&&(i.source=e.source,t!=null&&(i.source=n.relative(t,i.source)),i.original={line:e.originalLine,column:e.originalColumn},e.name!=null&&(i.name=e.name)),r.addMapping(i)}),e.sources.forEach(function(i){var a=i;t!==null&&(a=n.relative(t,i)),r._sources.has(a)||r._sources.add(a);var o=e.sourceContentFor(i);o!=null&&r.setSourceContent(i,o)}),r},a.prototype.addMapping=function(e){var t=n.getArg(e,`generated`),r=n.getArg(e,`original`,null),i=n.getArg(e,`source`,null),a=n.getArg(e,`name`,null);this._skipValidation||this._validateMapping(t,r,i,a),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:r!=null&&r.line,originalColumn:r!=null&&r.column,source:i,name:a})},a.prototype.setSourceContent=function(e,t){var r=e;this._sourceRoot!=null&&(r=n.relative(this._sourceRoot,r)),t==null?this._sourcesContents&&(delete this._sourcesContents[n.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null)):(this._sourcesContents||=Object.create(null),this._sourcesContents[n.toSetString(r)]=t)},a.prototype.applySourceMap=function(e,t,i){var a=t;if(t==null){if(e.file==null)throw Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);a=e.file}var o=this._sourceRoot;o!=null&&(a=n.relative(o,a));var s=new r,c=new r;this._mappings.unsortedForEach(function(t){if(t.source===a&&t.originalLine!=null){var r=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});r.source!=null&&(t.source=r.source,i!=null&&(t.source=n.join(i,t.source)),o!=null&&(t.source=n.relative(o,t.source)),t.originalLine=r.line,t.originalColumn=r.column,r.name!=null&&(t.name=r.name))}var l=t.source;l!=null&&!s.has(l)&&s.add(l);var u=t.name;u!=null&&!c.has(u)&&c.add(u)},this),this._sources=s,this._names=c,e.sources.forEach(function(t){var r=e.sourceContentFor(t);r!=null&&(i!=null&&(t=n.join(i,t)),o!=null&&(t=n.relative(o,t)),this.setSourceContent(t,r))},this)},a.prototype._validateMapping=function(e,t,n,r){if(t&&typeof t.line!=`number`&&typeof t.column!=`number`)throw Error(`original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.`);if(!(e&&`line`in e&&`column`in e&&e.line>0&&e.column>=0&&!t&&!n&&!r)&&!(e&&`line`in e&&`column`in e&&t&&`line`in t&&`column`in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw Error(`Invalid mapping: `+JSON.stringify({generated:e,source:n,original:t,name:r}))},a.prototype._serializeMappings=function(){for(var e=0,r=1,i=0,a=0,o=0,s=0,c=``,l,u,d,f,p=this._mappings.toArray(),m=0,h=p.length;m<h;m++){if(u=p[m],l=``,u.generatedLine!==r)for(e=0;u.generatedLine!==r;)l+=`;`,r++;else if(m>0){if(!n.compareByGeneratedPositionsInflated(u,p[m-1]))continue;l+=`,`}l+=t.encode(u.generatedColumn-e),e=u.generatedColumn,u.source!=null&&(f=this._sources.indexOf(u.source),l+=t.encode(f-s),s=f,l+=t.encode(u.originalLine-1-a),a=u.originalLine-1,l+=t.encode(u.originalColumn-i),i=u.originalColumn,u.name!=null&&(d=this._names.indexOf(u.name),l+=t.encode(d-o),o=d)),c+=l}return c},a.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;t!=null&&(e=n.relative(t,e));var r=n.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=a})),Qw=D((e=>{e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(n,r,i,a,o,s){var c=Math.floor((r-n)/2)+n,l=o(i,a[c],!0);return l===0?c:l>0?r-c>1?t(c,r,i,a,o,s):s==e.LEAST_UPPER_BOUND?r<a.length?r:-1:c:c-n>1?t(n,c,i,a,o,s):s==e.LEAST_UPPER_BOUND?c:n<0?-1:n}e.search=function(n,r,i,a){if(r.length===0)return-1;var o=t(-1,r.length,n,r,i,a||e.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&i(r[o],r[o-1],!0)===0;)--o;return o}})),$w=D((e=>{function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return Math.round(e+Math.random()*(t-e))}function r(e,i,a,o){if(a<o){var s=n(a,o),c=a-1;t(e,s,o);for(var l=e[o],u=a;u<o;u++)i(e[u],l)<=0&&(c+=1,t(e,c,u));t(e,c+1,u);var d=c+1;r(e,i,a,d-1),r(e,i,d+1,o)}}e.quickSort=function(e,t){r(e,t,0,e.length-1)}})),eT=D((e=>{var t=Jw(),n=Qw(),r=Yw().ArraySet,i=qw(),a=$w().quickSort;function o(e,n){var r=e;return typeof e==`string`&&(r=t.parseSourceMapInput(e)),r.sections==null?new s(r,n):new l(r,n)}o.fromSourceMap=function(e,t){return s.fromSourceMap(e,t)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,`_generatedMappings`,{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,`_originalMappings`,{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===`;`||n===`,`},o.prototype._parseMappings=function(e,t){throw Error(`Subclasses must implement _parseMappings`)},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(e,n,r){var i=n||null,a=r||o.GENERATED_ORDER,s;switch(a){case o.GENERATED_ORDER:s=this._generatedMappings;break;case o.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw Error(`Unknown order of iteration.`)}var c=this.sourceRoot;s.map(function(e){var n=e.source===null?null:this._sources.at(e.source);return n=t.computeSourceURL(c,n,this._sourceMapURL),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}},this).forEach(e,i)},o.prototype.allGeneratedPositionsFor=function(e){var r=t.getArg(e,`line`),i={source:t.getArg(e,`source`),originalLine:r,originalColumn:t.getArg(e,`column`,0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var a=[],o=this._findMapping(i,this._originalMappings,`originalLine`,`originalColumn`,t.compareByOriginalPositions,n.LEAST_UPPER_BOUND);if(o>=0){var s=this._originalMappings[o];if(e.column===void 0)for(var c=s.originalLine;s&&s.originalLine===c;)a.push({line:t.getArg(s,`generatedLine`,null),column:t.getArg(s,`generatedColumn`,null),lastColumn:t.getArg(s,`lastGeneratedColumn`,null)}),s=this._originalMappings[++o];else for(var l=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==l;)a.push({line:t.getArg(s,`generatedLine`,null),column:t.getArg(s,`generatedColumn`,null),lastColumn:t.getArg(s,`lastGeneratedColumn`,null)}),s=this._originalMappings[++o]}return a},e.SourceMapConsumer=o;function s(e,n){var i=e;typeof e==`string`&&(i=t.parseSourceMapInput(e));var a=t.getArg(i,`version`),o=t.getArg(i,`sources`),s=t.getArg(i,`names`,[]),c=t.getArg(i,`sourceRoot`,null),l=t.getArg(i,`sourcesContent`,null),u=t.getArg(i,`mappings`),d=t.getArg(i,`file`,null);if(a!=this._version)throw Error(`Unsupported version: `+a);c&&=t.normalize(c),o=o.map(String).map(t.normalize).map(function(e){return c&&t.isAbsolute(c)&&t.isAbsolute(e)?t.relative(c,e):e}),this._names=r.fromArray(s.map(String),!0),this._sources=r.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return t.computeSourceURL(c,e,n)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=n,this.file=d}s.prototype=Object.create(o.prototype),s.prototype.consumer=o,s.prototype._findSourceIndex=function(e){var n=e;if(this.sourceRoot!=null&&(n=t.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1},s.fromSourceMap=function(e,n){var i=Object.create(s.prototype),o=i._names=r.fromArray(e._names.toArray(),!0),l=i._sources=r.fromArray(e._sources.toArray(),!0);i.sourceRoot=e._sourceRoot,i.sourcesContent=e._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=e._file,i._sourceMapURL=n,i._absoluteSources=i._sources.toArray().map(function(e){return t.computeSourceURL(i.sourceRoot,e,n)});for(var u=e._mappings.toArray().slice(),d=i.__generatedMappings=[],f=i.__originalMappings=[],p=0,m=u.length;p<m;p++){var h=u[p],g=new c;g.generatedLine=h.generatedLine,g.generatedColumn=h.generatedColumn,h.source&&(g.source=l.indexOf(h.source),g.originalLine=h.originalLine,g.originalColumn=h.originalColumn,h.name&&(g.name=o.indexOf(h.name)),f.push(g)),d.push(g)}return a(i.__originalMappings,t.compareByOriginalPositions),i},s.prototype._version=3,Object.defineProperty(s.prototype,`sources`,{get:function(){return this._absoluteSources.slice()}});function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}s.prototype._parseMappings=function(e,n){for(var r=1,o=0,s=0,l=0,u=0,d=0,f=e.length,p=0,m={},h={},g=[],_=[],v,y,b,x,S;p<f;)if(e.charAt(p)===`;`)r++,p++,o=0;else if(e.charAt(p)===`,`)p++;else{for(v=new c,v.generatedLine=r,x=p;x<f&&!this._charIsMappingSeparator(e,x);x++);if(y=e.slice(p,x),b=m[y],b)p+=y.length;else{for(b=[];p<x;)i.decode(e,p,h),S=h.value,p=h.rest,b.push(S);if(b.length===2)throw Error(`Found a source, but no line and column`);if(b.length===3)throw Error(`Found a source and line, but no column`);m[y]=b}v.generatedColumn=o+b[0],o=v.generatedColumn,b.length>1&&(v.source=u+b[1],u+=b[1],v.originalLine=s+b[2],s=v.originalLine,v.originalLine+=1,v.originalColumn=l+b[3],l=v.originalColumn,b.length>4&&(v.name=d+b[4],d+=b[4])),_.push(v),typeof v.originalLine==`number`&&g.push(v)}a(_,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=_,a(g,t.compareByOriginalPositions),this.__originalMappings=g},s.prototype._findMapping=function(e,t,r,i,a,o){if(e[r]<=0)throw TypeError(`Line must be greater than or equal to 1, got `+e[r]);if(e[i]<0)throw TypeError(`Column must be greater than or equal to 0, got `+e[i]);return n.search(e,t,a,o)},s.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},s.prototype.originalPositionFor=function(e){var n={generatedLine:t.getArg(e,`line`),generatedColumn:t.getArg(e,`column`)},r=this._findMapping(n,this._generatedMappings,`generatedLine`,`generatedColumn`,t.compareByGeneratedPositionsDeflated,t.getArg(e,`bias`,o.GREATEST_LOWER_BOUND));if(r>=0){var i=this._generatedMappings[r];if(i.generatedLine===n.generatedLine){var a=t.getArg(i,`source`,null);a!==null&&(a=this._sources.at(a),a=t.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var s=t.getArg(i,`name`,null);return s!==null&&(s=this._names.at(s)),{source:a,line:t.getArg(i,`originalLine`,null),column:t.getArg(i,`originalColumn`,null),name:s}}}return{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},s.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var i=e;this.sourceRoot!=null&&(i=t.relative(this.sourceRoot,i));var a;if(this.sourceRoot!=null&&(a=t.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,``);if(a.scheme==`file`&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!a.path||a.path==`/`)&&this._sources.has(`/`+i))return this.sourcesContent[this._sources.indexOf(`/`+i)]}if(n)return null;throw Error(`"`+i+`" is not in the SourceMap.`)},s.prototype.generatedPositionFor=function(e){var n=t.getArg(e,`source`);if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:t.getArg(e,`line`),originalColumn:t.getArg(e,`column`)},i=this._findMapping(r,this._originalMappings,`originalLine`,`originalColumn`,t.compareByOriginalPositions,t.getArg(e,`bias`,o.GREATEST_LOWER_BOUND));if(i>=0){var a=this._originalMappings[i];if(a.source===r.source)return{line:t.getArg(a,`generatedLine`,null),column:t.getArg(a,`generatedColumn`,null),lastColumn:t.getArg(a,`lastGeneratedColumn`,null)}}return{line:null,column:null,lastColumn:null}},e.BasicSourceMapConsumer=s;function l(e,n){var i=e;typeof e==`string`&&(i=t.parseSourceMapInput(e));var a=t.getArg(i,`version`),s=t.getArg(i,`sections`);if(a!=this._version)throw Error(`Unsupported version: `+a);this._sources=new r,this._names=new r;var c={line:-1,column:0};this._sections=s.map(function(e){if(e.url)throw Error(`Support for url field in sections not implemented.`);var r=t.getArg(e,`offset`),i=t.getArg(r,`line`),a=t.getArg(r,`column`);if(i<c.line||i===c.line&&a<c.column)throw Error(`Section offsets must be ordered and non-overlapping.`);return c=r,{generatedOffset:{generatedLine:i+1,generatedColumn:a+1},consumer:new o(t.getArg(e,`map`),n)}})}l.prototype=Object.create(o.prototype),l.prototype.constructor=o,l.prototype._version=3,Object.defineProperty(l.prototype,`sources`,{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),l.prototype.originalPositionFor=function(e){var r={generatedLine:t.getArg(e,`line`),generatedColumn:t.getArg(e,`column`)},i=n.search(r,this._sections,function(e,t){return e.generatedLine-t.generatedOffset.generatedLine||e.generatedColumn-t.generatedOffset.generatedColumn}),a=this._sections[i];return a?a.consumer.originalPositionFor({line:r.generatedLine-(a.generatedOffset.generatedLine-1),column:r.generatedColumn-(a.generatedOffset.generatedLine===r.generatedLine?a.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},l.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n].consumer.sourceContentFor(e,!0);if(r)return r}if(t)return null;throw Error(`"`+e+`" is not in the SourceMap.`)},l.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var r=this._sections[n];if(r.consumer._findSourceIndex(t.getArg(e,`source`))!==-1){var i=r.consumer.generatedPositionFor(e);if(i)return{line:i.line+(r.generatedOffset.generatedLine-1),column:i.column+(r.generatedOffset.generatedLine===i.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},l.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var i=this._sections[r],o=i.consumer._generatedMappings,s=0;s<o.length;s++){var c=o[s],l=i.consumer._sources.at(c.source);l=t.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var u=null;c.name&&(u=i.consumer._names.at(c.name),this._names.add(u),u=this._names.indexOf(u));var d={source:l,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:u};this.__generatedMappings.push(d),typeof d.originalLine==`number`&&this.__originalMappings.push(d)}a(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),a(this.__originalMappings,t.compareByOriginalPositions)},e.IndexedSourceMapConsumer=l})),tT=D((e=>{var t=Zw().SourceMapGenerator,n=Jw(),r=/(\r?\n)/,i=10,a=`$$$isSourceNode$$$`;function o(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=n??null,this.name=i??null,this[a]=!0,r!=null&&this.add(r)}o.fromStringWithSourceMap=function(e,t,i){var a=new o,s=e.split(r),c=0,l=function(){return e()+(e()||``);function e(){return c<s.length?s[c++]:void 0}},u=1,d=0,f=null;return t.eachMapping(function(e){if(f!==null)if(u<e.generatedLine)p(f,l()),u++,d=0;else{var t=s[c]||``,n=t.substr(0,e.generatedColumn-d);s[c]=t.substr(e.generatedColumn-d),d=e.generatedColumn,p(f,n),f=e;return}for(;u<e.generatedLine;)a.add(l()),u++;if(d<e.generatedColumn){var t=s[c]||``;a.add(t.substr(0,e.generatedColumn)),s[c]=t.substr(e.generatedColumn),d=e.generatedColumn}f=e},this),c<s.length&&(f&&p(f,l()),a.add(s.splice(c).join(``))),t.sources.forEach(function(e){var r=t.sourceContentFor(e);r!=null&&(i!=null&&(e=n.join(i,e)),a.setSourceContent(e,r))}),a;function p(e,t){if(e===null||e.source===void 0)a.add(t);else{var r=i?n.join(i,e.source):e.source;a.add(new o(e.originalLine,e.originalColumn,r,t,e.name))}}},o.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else if(e[a]||typeof e==`string`)e&&this.children.push(e);else throw TypeError(`Expected a SourceNode, string, or an array of SourceNodes and strings. Got `+e);return this},o.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[a]||typeof e==`string`)this.children.unshift(e);else throw TypeError(`Expected a SourceNode, string, or an array of SourceNodes and strings. Got `+e);return this},o.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)t=this.children[n],t[a]?t.walk(e):t!==``&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},o.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[a]?n.replaceRight(e,t):typeof n==`string`?this.children[this.children.length-1]=n.replace(e,t):this.children.push(``.replace(e,t)),this},o.prototype.setSourceContent=function(e,t){this.sourceContents[n.toSetString(e)]=t},o.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),t=0,r=i.length;t<r;t++)e(n.fromSetString(i[t]),this.sourceContents[i[t]])},o.prototype.toString=function(){var e=``;return this.walk(function(t){e+=t}),e},o.prototype.toStringWithSourceMap=function(e){var n={code:``,line:1,column:0},r=new t(e),a=!1,o=null,s=null,c=null,l=null;return this.walk(function(e,t){n.code+=e,t.source!==null&&t.line!==null&&t.column!==null?((o!==t.source||s!==t.line||c!==t.column||l!==t.name)&&r.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name}),o=t.source,s=t.line,c=t.column,l=t.name,a=!0):a&&=(r.addMapping({generated:{line:n.line,column:n.column}}),o=null,!1);for(var u=0,d=e.length;u<d;u++)e.charCodeAt(u)===i?(n.line++,n.column=0,u+1===d?(o=null,a=!1):a&&r.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name})):n.column++}),this.walkSourceContents(function(e,t){r.setSourceContent(e,t)}),{code:n.code,map:r}},e.SourceNode=o})),nT=D((e=>{e.SourceMapGenerator=Zw().SourceMapGenerator,e.SourceMapConsumer=eT().SourceMapConsumer,e.SourceNode=tT().SourceNode})),rT=D(((e,t)=>{e.__esModule=!0;var n=vw(),r=void 0;try{(typeof define!=`function`||!define.amd)&&(r=nT().SourceNode)}catch{}r||(r=function(e,t,n,r){this.src=``,r&&this.add(r)},r.prototype={add:function(e){n.isArray(e)&&(e=e.join(``)),this.src+=e},prepend:function(e){n.isArray(e)&&(e=e.join(``)),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function i(e,t,r){if(n.isArray(e)){for(var i=[],a=0,o=e.length;a<o;a++)i.push(t.wrap(e[a],r));return i}else if(typeof e==`boolean`||typeof e==`number`)return e+``;return e}function a(e){this.srcFile=e,this.source=[]}a.prototype={isEmpty:function(){return!this.source.length},prepend:function(e,t){this.source.unshift(this.wrap(e,t))},push:function(e,t){this.source.push(this.wrap(e,t))},merge:function(){var e=this.empty();return this.each(function(t){e.add([` `,t,`
1828
- `])}),e},each:function(e){for(var t=0,n=this.source.length;t<n;t++)e(this.source[t])},empty:function(){var e=this.currentLocation||{start:{}};return new r(e.start.line,e.start.column,this.srcFile)},wrap:function(e){var t=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return e instanceof r?e:(e=i(e,this,t),new r(t.start.line,t.start.column,this.srcFile,e))},functionCall:function(e,t,n){return n=this.generateList(n),this.wrap([e,t?`.`+t+`(`:`(`,n,`)`])},quotedString:function(e){return`"`+(e+``).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)+`"`},objectLiteral:function(e){var t=this,n=[];Object.keys(e).forEach(function(r){var a=i(e[r],t);a!==`undefined`&&n.push([t.quotedString(r),`:`,a])});var r=this.generateList(n);return r.prepend(`{`),r.add(`}`),r},generateList:function(e){for(var t=this.empty(),n=0,r=e.length;n<r;n++)n&&t.add(`,`),t.add(i(e[n],this));return t},generateArray:function(e){var t=this.generateList(e);return t.prepend(`[`),t.add(`]`),t}},e.default=a,t.exports=e.default})),iT=D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=Nw(),i=n(yw()),a=vw(),o=n(rT());function s(e){this.value=e}function c(){}c.prototype={nameLookup:function(e,t){return this.internalNameLookup(e,t)},depthedLookup:function(e){return[this.aliasable(`container.lookup`),`(depths, `,JSON.stringify(e),`)`]},compilerInfo:function(){var e=r.COMPILER_REVISION;return[e,r.REVISION_CHANGES[e]]},appendToBuffer:function(e,t,n){return a.isArray(e)||(e=[e]),e=this.source.wrap(e,t),this.environment.isSimple?[`return `,e,`;`]:n?[`buffer += `,e,`;`]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString(``)},internalNameLookup:function(e,t){return this.lookupPropertyFunctionIsUsed=!0,[`lookupProperty(`,e,`,`,JSON.stringify(t),`)`]},lookupPropertyFunctionIsUsed:!1,compile:function(e,t,n,r){this.environment=e,this.options=t,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!r,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,t),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var a=e.opcodes,o=void 0,s=void 0,c=void 0,l=void 0;for(c=0,l=a.length;c<l;c++)o=a[c],this.source.currentLocation=o.loc,s||=o.loc,this[o.opcode].apply(this,o.args);if(this.source.currentLocation=s,this.pushSource(``),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default(`Compile completed with content left on stack`);this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend([`var decorators = container.decorators, `,this.lookupPropertyFunctionVarDeclaration(),`;
1829
- `]),this.decorators.push(`return fn;`),r?this.decorators=Function.apply(this,[`fn`,`props`,`container`,`depth0`,`data`,`blockParams`,`depths`,this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
1830
- `),this.decorators.push(`}
1831
- `),this.decorators=this.decorators.merge()));var u=this.createFunctionContext(r);if(this.isChild)return u;var d={compiler:this.compilerInfo(),main:u};this.decorators&&(d.main_d=this.decorators,d.useDecorators=!0);var f=this.context,p=f.programs,m=f.decorators;for(c=0,l=p.length;c<l;c++)p[c]&&(d[c]=p[c],m[c]&&(d[c+`_d`]=m[c],d.useDecorators=!0));return this.environment.usePartial&&(d.usePartial=!0),this.options.data&&(d.useData=!0),this.useDepths&&(d.useDepths=!0),this.useBlockParams&&(d.useBlockParams=!0),this.options.compat&&(d.compat=!0),r?d.compilerOptions=this.options:(d.compiler=JSON.stringify(d.compiler),this.source.currentLocation={start:{line:1,column:0}},d=this.objectLiteral(d),t.srcName?(d=d.toStringWithSourceMap({file:t.destName}),d.map=d.map&&d.map.toString()):d=d.toString()),d},preamble:function(){this.lastContext=0,this.source=new o.default(this.options.srcName),this.decorators=new o.default(this.options.srcName)},createFunctionContext:function(e){var t=this,n=``,r=this.stackVars.concat(this.registers.list);r.length>0&&(n+=`, `+r.join(`, `));var i=0;Object.keys(this.aliases).forEach(function(e){var r=t.aliases[e];r.children&&r.referenceCount>1&&(n+=`, alias`+ ++i+`=`+e,r.children[0]=`alias`+i)}),this.lookupPropertyFunctionIsUsed&&(n+=`, `+this.lookupPropertyFunctionVarDeclaration());var a=[`container`,`depth0`,`helpers`,`partials`,`data`];(this.useBlockParams||this.useDepths)&&a.push(`blockParams`),this.useDepths&&a.push(`depths`);var o=this.mergeSource(n);return e?(a.push(o),Function.apply(this,a)):this.source.wrap([`function(`,a.join(`,`),`) {
1832
- `,o,`}`])},mergeSource:function(e){var t=this.environment.isSimple,n=!this.forceBuffer,r=void 0,i=void 0,a=void 0,o=void 0;return this.source.each(function(e){e.appendToBuffer?(a?e.prepend(` + `):a=e,o=e):(a&&=(i?a.prepend(`buffer += `):r=!0,o.add(`;`),o=void 0),i=!0,t||(n=!1))}),n?a?(a.prepend(`return `),o.add(`;`)):i||this.source.push(`return "";`):(e+=`, buffer = `+(r?``:this.initializeBuffer()),a?(a.prepend(`return buffer + `),o.add(`;`)):this.source.push(`return buffer;`)),e&&this.source.prepend(`var `+e.substring(2)+(r?``:`;
1833
- `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`lookupProperty = container.lookupProperty || function(parent, propertyName) {
1834
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
1835
- return parent[propertyName];
1836
- }
1837
- return undefined
1838
- }`},blockValue:function(e){var t=this.aliasable(`container.hooks.blockHelperMissing`),n=[this.contextName(0)];this.setupHelperArgs(e,0,n);var r=this.popStack();n.splice(1,0,r),this.push(this.source.functionCall(t,`call`,n))},ambiguousBlockValue:function(){var e=this.aliasable(`container.hooks.blockHelperMissing`),t=[this.contextName(0)];this.setupHelperArgs(``,0,t,!0),this.flushInline();var n=this.topStack();t.splice(1,0,n),this.pushSource([`if (!`,this.lastHelper,`) { `,n,` = `,this.source.functionCall(e,`call`,t),`}`])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(e){return[` != null ? `,e,` : ""`]}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource([`if (`,e,` != null) { `,this.appendToBuffer(e,void 0,!0),` }`]),this.environment.isSimple&&this.pushSource([`else { `,this.appendToBuffer(`''`,void 0,!0),` }`])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable(`container.escapeExpression`),`(`,this.popStack(),`)`]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,n,r){var i=0;!r&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[i++])):this.pushContext(),this.resolvePath(`context`,e,i,t,n)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push([`blockParams[`,e[0],`][`,e[1],`]`]),this.resolvePath(`context`,t,1)},lookupData:function(e,t,n){e?this.pushStackLiteral(`container.data(data, `+e+`)`):this.pushStackLiteral(`data`),this.resolvePath(`data`,t,0,!0,n)},resolvePath:function(e,t,n,r,i){var a=this;if(this.options.strict||this.options.assumeObjects){this.push(l(this.options.strict&&i,this,t,n,e));return}for(var o=t.length;n<o;n++)this.replaceStack(function(i){var o=a.nameLookup(i,t[n],e);return r?[` && `,o]:[` != null ? `,o,` : `,i]})},resolvePossibleLambda:function(){this.push([this.aliasable(`container.lambda`),`(`,this.popStack(),`, `,this.contextName(0),`)`])},pushStringParam:function(e,t){this.pushContext(),this.pushString(t),t!==`SubExpression`&&(typeof e==`string`?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push(`{}`),this.stringParams&&(this.push(`{}`),this.push(`{}`)),this.pushStackLiteral(e?`undefined`:`{}`)},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e==null?this.pushStackLiteral(null):this.pushStackLiteral(this.programExpression(e))},registerDecorator:function(e,t){var n=this.nameLookup(`decorators`,t,`decorator`),r=this.setupHelperArgs(t,e);this.decorators.push([`fn = `,this.decorators.functionCall(n,``,[`fn`,`props`,`container`,r]),` || fn;`])},invokeHelper:function(e,t,n){var r=this.popStack(),i=this.setupHelper(e,t),a=[];n&&a.push(i.name),a.push(r),this.options.strict||a.push(this.aliasable(`container.hooks.helperMissing`));var o=[`(`,this.itemsSeparatedBy(a,`||`),`)`],s=this.source.functionCall(o,`call`,i.callParams);this.push(s)},itemsSeparatedBy:function(e,t){var n=[];n.push(e[0]);for(var r=1;r<e.length;r++)n.push(t,e[r]);return n},invokeKnownHelper:function(e,t){var n=this.setupHelper(e,t);this.push(this.source.functionCall(n.name,`call`,n.callParams))},invokeAmbiguous:function(e,t){this.useRegister(`helper`);var n=this.popStack();this.emptyHash();var r=this.setupHelper(0,e,t),i=[`(`,`(helper = `,this.lastHelper=this.nameLookup(`helpers`,e,`helper`),` || `,n,`)`];this.options.strict||(i[0]=`(helper = `,i.push(` != null ? helper : `,this.aliasable(`container.hooks.helperMissing`))),this.push([`(`,i,r.paramsInit?[`),(`,r.paramsInit]:[],`),`,`(typeof helper === `,this.aliasable(`"function"`),` ? `,this.source.functionCall(`helper`,`call`,r.callParams),` : helper))`])},invokePartial:function(e,t,n){var r=[],i=this.setupParams(t,1,r);e&&(t=this.popStack(),delete i.name),n&&(i.indent=JSON.stringify(n)),i.helpers=`helpers`,i.partials=`partials`,i.decorators=`container.decorators`,e?r.unshift(t):r.unshift(this.nameLookup(`partials`,t,`partial`)),this.options.compat&&(i.depths=`depths`),i=this.objectLiteral(i),r.push(i),this.push(this.source.functionCall(`container.invokePartial`,``,r))},assignToHash:function(e){var t=this.popStack(),n=void 0,r=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(r=this.popStack(),n=this.popStack());var a=this.hash;n&&(a.contexts[e]=n),r&&(a.types[e]=r),i&&(a.ids[e]=i),a.values[e]=t},pushId:function(e,t,n){e===`BlockParam`?this.pushStackLiteral(`blockParams[`+t[0]+`].path[`+t[1]+`]`+(n?` + `+JSON.stringify(`.`+n):``)):e===`PathExpression`?this.pushString(t):e===`SubExpression`?this.pushStackLiteral(`true`):this.pushStackLiteral(`null`)},compiler:c,compileChildren:function(e,t){for(var n=e.children,r=void 0,i=void 0,a=0,o=n.length;a<o;a++){r=n[a],i=new this.compiler;var s=this.matchExistingProgram(r);if(s==null){this.context.programs.push(``);var c=this.context.programs.length;r.index=c,r.name=`program`+c,this.context.programs[c]=i.compile(r,t,this.context,!this.precompile),this.context.decorators[c]=i.decorators,this.context.environments[c]=r,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,r.useDepths=this.useDepths,r.useBlockParams=this.useBlockParams}else r.index=s.index,r.name=`program`+s.index,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams}},matchExistingProgram:function(e){for(var t=0,n=this.context.environments.length;t<n;t++){var r=this.context.environments[t];if(r&&r.equals(e))return r}},programExpression:function(e){var t=this.environment.children[e],n=[t.index,`data`,t.blockParams];return(this.useBlockParams||this.useDepths)&&n.push(`blockParams`),this.useDepths&&n.push(`depths`),`container.program(`+n.join(`, `)+`)`},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof s||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new s(e))},pushSource:function(e){this.pendingContent&&=(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),void 0),e&&this.source.push(e)},replaceStack:function(e){var t=[`(`],n=void 0,r=void 0,a=void 0;if(!this.isInline())throw new i.default(`replaceStack on non-inline`);var o=this.popStack(!0);if(o instanceof s)n=[o.value],t=[`(`,n],a=!0;else{r=!0;var c=this.incrStack();t=[`((`,this.push(c),` = `,o,`)`],n=this.topStack()}var l=e.call(this,n);a||this.popStack(),r&&this.stackSlot--,this.push(t.concat(l,`)`))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push(`stack`+this.stackSlot),this.topStackName()},topStackName:function(){return`stack`+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];if(r instanceof s)this.compileStack.push(r);else{var i=this.incrStack();this.pushSource([i,` = `,r,`;`]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var t=this.isInline(),n=(t?this.inlineStack:this.compileStack).pop();if(!e&&n instanceof s)return n.value;if(!t){if(!this.stackSlot)throw new i.default(`Invalid stack pop`);this.stackSlot--}return n},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,t=e[e.length-1];return t instanceof s?t.value:t},contextName:function(e){return this.useDepths&&e?`depths[`+e+`]`:`depth`+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var t=this.aliases[e];return t?(t.referenceCount++,t):(t=this.aliases[e]=this.source.wrap(e),t.aliasable=!0,t.referenceCount=1,t)},setupHelper:function(e,t,n){var r=[];return{params:r,paramsInit:this.setupHelperArgs(t,e,r,n),name:this.nameLookup(`helpers`,t,`helper`),callParams:[this.aliasable(this.contextName(0)+` != null ? `+this.contextName(0)+` : (container.nullContext || {})`)].concat(r)}},setupParams:function(e,t,n){var r={},i=[],a=[],o=[],s=!n,c=void 0;s&&(n=[]),r.name=this.quotedString(e),r.hash=this.popStack(),this.trackIds&&(r.hashIds=this.popStack()),this.stringParams&&(r.hashTypes=this.popStack(),r.hashContexts=this.popStack());var l=this.popStack(),u=this.popStack();(u||l)&&(r.fn=u||`container.noop`,r.inverse=l||`container.noop`);for(var d=t;d--;)c=this.popStack(),n[d]=c,this.trackIds&&(o[d]=this.popStack()),this.stringParams&&(a[d]=this.popStack(),i[d]=this.popStack());return s&&(r.args=this.source.generateArray(n)),this.trackIds&&(r.ids=this.source.generateArray(o)),this.stringParams&&(r.types=this.source.generateArray(a),r.contexts=this.source.generateArray(i)),this.options.data&&(r.data=`data`),this.useBlockParams&&(r.blockParams=`blockParams`),r},setupHelperArgs:function(e,t,n,r){var i=this.setupParams(e,t,n);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),r?(this.useRegister(`options`),n.push(`options`),[`options=`,i]):n?(n.push(i),``):i}},(function(){for(var e=`break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false`.split(` `),t=c.RESERVED_WORDS={},n=0,r=e.length;n<r;n++)t[e[n]]=!0})(),c.isValidJavaScriptVariableName=function(e){return!c.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function l(e,t,n,r,i){var a=t.popStack(),o=n.length;for(e&&o--;r<o;r++)a=t.nameLookup(a,n[r],i);return e?[t.aliasable(`container.strict`),`(`,a,`, `,t.quotedString(n[r]),`, `,JSON.stringify(t.source.currentLocation),` )`]:a}e.default=c,t.exports=e.default})),aT=ae(D(((e,t)=>{e.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=n(Rw()),i=n(zw()),a=Ww(),o=Gw(),s=n(iT()),c=n(Vw()),l=n(Lw()),u=r.default.create;function d(){var e=u();return e.compile=function(t,n){return o.compile(t,n,e)},e.precompile=function(t,n){return o.precompile(t,n,e)},e.AST=i.default,e.Compiler=o.Compiler,e.JavaScriptCompiler=s.default,e.Parser=a.parser,e.parse=a.parse,e.parseWithoutProcessing=a.parseWithoutProcessing,e}var f=d();f.create=d,l.default(f),f.Visitor=c.default,f.default=f,e.default=f,t.exports=e.default}))(),1),oT=[{id:`agentThreadMessage`,body:`[bb message from thread:{{senderThreadId}}; reply with \`bb thread tell {{senderThreadId}} "<your response>"\`]
1839
-
1840
- {{messageText}}`,fileName:`agent-thread-message.md`,kind:`prompt`,title:`Agent Thread Message`,summary:`Wraps a bb CLI message from one agent thread to another.`,intent:`Tell the receiving agent which thread sent the message and how to reply.`,editingNotes:`Keep the response command in the prefix so standard agent instructions do not need special cross-thread message guidance.`,variables:{senderThreadId:`The thread ID that sent the message.`,messageText:`The original message text sent by the agent.`}},{id:`bbGuideAsync`,body:`Async scheduled nudges
1841
-
1842
- Use \`ASYNC.md\` in thread storage when the system should wake a manager thread
1843
- later for reminders, recurring check-ins, or follow-up work.
1844
-
1845
- \`ASYNC.md\` is Markdown with YAML frontmatter:
1846
-
1847
- \`\`\`yaml
1848
- ---
1849
- timezone: America/Los_Angeles
1850
- schedules:
1851
- - name: daily-recap
1852
- cron: "0 8 * * 1-5"
1853
- - name: deploy-check
1854
- cron: "0 */2 * * *"
1855
- timezone: UTC
1856
- ---
1857
- \`\`\`
1858
-
1859
- Each schedule has a matching \`## <name>\` section in the body with instructions
1860
- for your future self. The top-level \`timezone\` defaults to UTC; each schedule
1861
- can override it.
1862
-
1863
- For one-off reminders like "in 10 minutes", encode the next daily occurrence
1864
- and note in the body to remove the schedule after it fires once.
1865
-
1866
- Keep schedule \`name\` values stable. The server syncs entries by name, so
1867
- renaming one creates a new schedule rather than editing it.
1868
-
1869
- Constraints:
1870
-
1871
- - No more than 20 schedules.
1872
- - No interval shorter than 5 minutes.
1873
- - The cron month field must stay \`*\`.
1874
-
1875
- When a scheduled nudge arrives, read the matching section in \`ASYNC.md\` and
1876
- decide whether there is real work to do. Only message the user when the nudge
1877
- produced something useful. Remove schedules that are no longer needed.`,fileName:`bb-guide-async.md`,kind:`instruction`,title:`bb Guide - Async`,summary:`Scheduled nudge reference for ASYNC.md.`,intent:`Explain how to define scheduled nudges for manager threads.`,editingNotes:`Keep this as the canonical ASYNC.md syntax reference. Manager prompts should point here instead of inlining schedule syntax.`,variables:{}},{id:`bbGuideEnvironments`,body:`Environment commands
1878
-
1879
- Environments determine where threads run. Multiple threads can share an environment
1880
- (e.g., a coding thread and a review thread in the same worktree).
1881
-
1882
- bb environment show <id> Show environment details (path, branch, status)
1883
-
1884
- bb environment update <id> Update environment metadata
1885
- --merge-base-branch <branch> Set merge-base branch override
1886
- --clear-merge-base-branch Clear merge-base override
1887
-
1888
- bb environment commit <id> Create a commit in the environment
1889
-
1890
- bb environment squash-merge <id> Squash-merge into a target branch
1891
- --merge-base-branch <branch> Target branch (required)`,fileName:`bb-guide-environments.md`,kind:`instruction`,title:`bb Guide — Environments`,summary:`Command reference for environment inspection, commits, and merges.`,intent:`Provide complete environment command documentation for agents.`,editingNotes:`Keep flags accurate against the CLI implementation.`,variables:{}},{id:`bbGuideHosts`,body:`Host commands
1892
-
1893
- Hosts are where environments run.
1894
-
1895
- - Persistent hosts are long-lived machines (your laptop, a remote server).
1896
-
1897
- bb host list List persistent hosts with status
1898
-
1899
- Host status values: connected, disconnected.`,fileName:`bb-guide-hosts.md`,kind:`instruction`,title:`bb Guide — Hosts`,summary:`Command reference for listing and understanding hosts.`,intent:`Provide complete host command documentation for agents.`,editingNotes:`Keep flags accurate against the CLI implementation.`,variables:{}},{id:`bbGuideManagerTemplates`,body:`Manager templates
1900
-
1901
- Manager templates are named bundles of starter files for manager thread
1902
- storage. When bb starts a new manager thread, the server resolves a template
1903
- and copies that template's top-level regular files into the new manager's
1904
- thread storage before the host daemon receives the initial \`thread.start\`
1905
- command. This is how a fresh manager can boot with starter \`PREFERENCES.md\`,
1906
- \`STATUS.html\`, \`ASYNC.md\`, or other storage files.
1907
-
1908
- Directory layout:
1909
-
1910
- \`\`\`text
1911
- <bb-data-dir>/manager-templates/
1912
- active
1913
- default/
1914
- STATUS.html
1915
- sawyer-next/
1916
- PREFERENCES.md
1917
- STATUS.html
1918
- \`\`\`
1919
-
1920
- In this guide, \`<bb-data-dir>\` is your bb data directory. Packaged installs
1921
- default to \`$HOME/.bb\`. In source development, \`pnpm dev\` sets \`BB_DATA_DIR\`
1922
- to the current checkout's data directory; use \`$BB_DATA_DIR/manager-templates/\`.
1923
- Override packaged installs with the \`BB_DATA_DIR\` env var.
1924
-
1925
- \`active\` is a plain text file. bb reads the first line, trims it, and uses it
1926
- as the template name. Missing or empty \`active\` means \`default\`. An invalid
1927
- name logs a warning and falls back to \`default\`. Template names must be one
1928
- directory name: 1-128 characters, no \`/\` or \`\\\`, and not \`.\` or \`..\`.
1929
-
1930
- Each subdirectory is a template set. The directory name is the template name.
1931
-
1932
- What gets seeded:
1933
-
1934
- bb copies every top-level regular file from the selected template directory
1935
- into \`<bb-data-dir>/thread-storage/<manager-thread-id>/\`. There is no filename
1936
- allowlist: \`PREFERENCES.md\`, \`STATUS.html\`, \`STATUS.md\`, and \`ASYNC.md\` are
1937
- conventions, not the only files allowed. Subdirectories and symlinks are
1938
- ignored. Dotfiles are copied if they are regular files. Existing destination
1939
- files are left as-is; seeding does not overwrite, delete, or refresh files.
1940
-
1941
- If \`default/\` is missing, bb uses a bundled fallback template containing only
1942
- \`STATUS.html\`. If \`default/\` exists but is empty, no bundled files are mixed
1943
- in. If a selected non-default template is missing, bb logs a warning and skips
1944
- storage seeding.
1945
-
1946
- When it runs:
1947
-
1948
- Seeding happens while building the manager \`thread.start\` command, normally
1949
- after \`POST /api/v1/projects/:id/managers\` or \`bb manager hire\` creates the
1950
- manager and the environment is ready. It happens before the host daemon starts
1951
- the provider thread. The copy operation is safe to run more than once because
1952
- existing files are skipped; it is not a refresh mechanism for managers that
1953
- already have storage.
1954
-
1955
- Selecting a template:
1956
-
1957
- For one manager, pass a template name at hire time:
1958
-
1959
- \`\`\`bash
1960
- bb manager hire --template sawyer-next
1961
- \`\`\`
1962
-
1963
- \`--template\` overrides the \`active\` pointer for that manager creation only.
1964
-
1965
- For future managers by default, edit the active pointer:
1966
-
1967
- \`\`\`bash
1968
- DATA_DIR="\${BB_DATA_DIR:-$HOME/.bb}"
1969
- mkdir -p "$DATA_DIR/manager-templates"
1970
- printf 'sawyer-next\\n' > "$DATA_DIR/manager-templates/active"
1971
- \`\`\`
1972
-
1973
- There is no dedicated CLI command today for changing the global active
1974
- template.
1975
-
1976
- Creating a template:
1977
-
1978
- \`\`\`bash
1979
- DATA_DIR="\${BB_DATA_DIR:-$HOME/.bb}"
1980
- mkdir -p "$DATA_DIR/manager-templates/sawyer-next"
1981
- cp "$DATA_DIR/manager-templates/default/STATUS.html" \\
1982
- "$DATA_DIR/manager-templates/sawyer-next/STATUS.html"
1983
- $EDITOR "$DATA_DIR/manager-templates/sawyer-next/PREFERENCES.md"
1984
- printf 'sawyer-next\\n' > "$DATA_DIR/manager-templates/active"
1985
- \`\`\`
1986
-
1987
- Promoting current preferences:
1988
-
1989
- Managers see their storage path in runtime context. To save the current
1990
- manager's \`PREFERENCES.md\` to the default template:
1991
-
1992
- \`\`\`bash
1993
- DATA_DIR="\${BB_DATA_DIR:-$HOME/.bb}"
1994
- THREAD_STORAGE="/absolute/path/from-manager-runtime-context"
1995
- mkdir -p "$DATA_DIR/manager-templates/default"
1996
- cp "$THREAD_STORAGE/PREFERENCES.md" \\
1997
- "$DATA_DIR/manager-templates/default/PREFERENCES.md"
1998
- printf 'default\\n' > "$DATA_DIR/manager-templates/active"
1999
- \`\`\`
2000
-
2001
- Copy \`STATUS.html\`, \`STATUS.md\`, or \`ASYNC.md\` into the same template
2002
- directory when those starter files should be shared too.
2003
-
2004
- Limitations and gotchas:
2005
-
2006
- - There is no dedicated CLI or UI for changing \`active\`.
2007
- - Template file contents are not schema-validated before copying.
2008
- - Only top-level regular files are copied; template subdirectories are ignored.
2009
- - Existing thread storage files are never overwritten by seeding.
2010
- - A user-authored \`default/\` directory fully replaces the bundled fallback,
2011
- even if it is empty.
2012
- - Missing selected non-default templates skip seeding instead of falling back
2013
- to \`default\`.
2014
-
2015
- Related guides:
2016
-
2017
- bb guide overview
2018
- bb guide managers
2019
- bb guide styling
2020
- bb guide async`,fileName:`bb-guide-manager-templates.md`,kind:`instruction`,title:`bb Guide - Manager Templates`,summary:`Manager storage template reference.`,intent:`Explain how manager-templates seed new manager thread storage.`,editingNotes:`Keep this factual against manager-storage-templates.ts and the manager hire API/CLI.`,variables:{}},{id:`bbGuideManagers`,body:`Manager commands
2021
-
2022
- Managers are long-running threads that coordinate work across other threads.
2023
- Use bb thread commands for most manager interactions.
2024
-
2025
- bb manager hire [projectId] Hire a new manager
2026
- --project <id> Project ID (defaults to BB_PROJECT_ID)
2027
- --name <name> Manager name
2028
- --provider <id> Provider override
2029
- --model <model> Model override
2030
- --reasoning-level <level> Reasoning level: low, medium, high, xhigh, max (provider-dependent)
2031
- --permission-mode <mode> Permission mode: full, workspace-write, or readonly
2032
- --host <id> Target host (defaults to local host)
2033
- --json Print machine-readable JSON output
2034
-
2035
- When --provider and --model are omitted, the project's remembered manager defaults apply first.
2036
- If there are no remembered manager defaults, the server manager policy is used.
2037
-
2038
- bb manager list [projectId] List managers for a project
2039
- --project <id> Project ID (defaults to BB_PROJECT_ID)
2040
- --json Print machine-readable JSON output
2041
-
2042
- bb manager status <id> Show manager status and managed threads
2043
- --json Print machine-readable JSON output
2044
-
2045
- bb manager delete <id> Delete a manager permanently
2046
- --yes Skip the confirmation prompt
2047
- --json Print machine-readable JSON output
2048
-
2049
- Common manager interactions via thread commands:
2050
-
2051
- bb thread list --parent-thread <manager-id> List managed threads
2052
- bb thread tell <manager-id> "message" Message a manager
2053
- bb thread log <manager-id> Show manager log
2054
-
2055
- Manager thread logs use the conversation view by default. \`--format verbose\`
2056
- expands returned timeline details but does not switch to the internal manager
2057
- debug timeline.`,fileName:`bb-guide-managers.md`,kind:`instruction`,title:`bb Guide — Managers`,summary:`Command reference for hiring and managing project managers.`,intent:`Provide complete manager command documentation for agents.`,editingNotes:`Keep flags accurate against the CLI implementation.`,variables:{}},{id:`bbGuideOverview`,body:`bb is an agent orchestration tool for managing multiple agents.
2058
-
2059
- Core concepts:
2060
-
2061
- - Project — maps to a repository. All threads belong to a project.
2062
- - Thread — a single agent conversation. The fundamental unit of work.
2063
- - Environment — where a thread runs. Kinds: project checkout or isolated worktree. Multiple threads can share an environment.
2064
- - Provider — the agent backend powering a thread (e.g., codex, claude-code). Each provider supports different models.
2065
- - Host — where environments run. Hosts are long-lived local or remote machines.
2066
-
2067
- Thread types:
2068
-
2069
- - standard — does coding, research, debugging, or other tasks.
2070
- - manager — coordinates work across other threads. Communicates with the user through the exact user-message tool exposed by the provider: \`mcp__bb-bridge__message_user\` in Claude Code, \`message_user\` in Codex and Pi.
2071
-
2072
- Threads can have a parent-child relationship. The parent manages the child and receives lifecycle notifications when it completes, fails, or is interrupted. Threads without a parent are managed by the user.
2073
-
2074
- Context variables set automatically inside a thread environment:
2075
-
2076
- - BB_PROJECT_ID — current project
2077
- - BB_THREAD_ID — current thread
2078
- - BB_ENVIRONMENT_ID — current environment
2079
-
2080
- Run \`bb status\` to see your current context (resolved project and thread IDs).
2081
-
2082
- All commands support --json for machine-readable output.
2083
-
2084
- Run \`bb guide <chapter>\` for command details:
2085
-
2086
- threads Spawning, inspecting, messaging, and managing threads
2087
- environments Environment operations, commits, and merges
2088
- managers Hiring and managing project managers
2089
- manager-templates
2090
- Seeding new manager storage from template bundles
2091
- status-state Persistent reactive JSON state for STATUS dashboards
2092
- providers Discovering providers and models
2093
- projects Project CRUD and sources
2094
- hosts Listing and understanding hosts
2095
- styling How to style STATUS/ and STATUS.html surfaces to match the bb UI
2096
- async Defining scheduled nudges with ASYNC.md`,fileName:`bb-guide-overview.md`,kind:`instruction`,title:`bb Guide Overview`,summary:`System overview and chapter index for the bb CLI guide.`,intent:`Orient agents to bb core concepts and help them find the right guide chapter.`,editingNotes:`Keep this concise. Concepts only — command details belong in chapter files.`,variables:{}},{id:`bbGuideProjects`,body:`Project commands
2097
-
2098
- A project maps to a code repository. All threads belong to a project.
2099
-
2100
- bb project list List all projects
2101
- bb project create --name "..." [options]
2102
- --root <path> Project root path
2103
- --repo-url <url> Repository URL
2104
- --host <id> Default host
2105
-
2106
- bb project show <id> Show project details
2107
- bb project update <id> Update a project
2108
- --name <name> New name
2109
-
2110
- bb project delete <id> Delete project and all threads
2111
- --yes Skip confirmation
2112
-
2113
- Sources:
2114
-
2115
- Projects can have multiple sources (paths or repos).
2116
-
2117
- bb project source add <projectId> Add a source
2118
- --path <path> Local path
2119
- --repo-url <url> Repository URL
2120
- --host <id> Host for this source
2121
- --default Set as default source
2122
-
2123
- bb project source update <projectId> <sourceId>
2124
- --path <path>
2125
- --repo-url <url>
2126
- --default
2127
-
2128
- bb project source delete <projectId> <sourceId>`,fileName:`bb-guide-projects.md`,kind:`instruction`,title:`bb Guide — Projects`,summary:`Command reference for project CRUD and sources.`,intent:`Provide complete project command documentation for agents.`,editingNotes:`Keep flags accurate against the CLI implementation.`,variables:{}},{id:`bbGuideProviders`,body:`Provider commands
2129
-
2130
- Providers are agent backends (e.g., codex, claude-code). Each supports different models.
2131
-
2132
- bb provider list List available providers
2133
- bb provider models [providerId] List models for a provider
2134
-
2135
- Use these before spawning threads if you are unsure which provider or model to use.
2136
- When provider and model are omitted from bb thread spawn, the project's remembered
2137
- defaults apply.`,fileName:`bb-guide-providers.md`,kind:`instruction`,title:`bb Guide — Providers`,summary:`Command reference for discovering providers and models.`,intent:`Provide complete provider command documentation for agents.`,editingNotes:`Keep flags accurate against the CLI implementation.`,variables:{}},{id:`bbGuideStatusState`,body:`STATUS state
2138
-
2139
- \`window.bbStatusState\` is injected into the root manager STATUS document served
2140
- from \`/api/v1/threads/<thread-id>/status/\`. Use it when \`STATUS/index.html\` or
2141
- \`STATUS.html\` needs durable JSON state for controls, forms, filters, task
2142
- boards, or other dashboard UI that should survive iframe reloads and update
2143
- across open tabs.
2144
-
2145
- Do not use it for rendering source files or static assets. Keep ordinary HTML,
2146
- CSS, JS, images, and fonts in \`STATUS/\`; use STATUS state for data the dashboard
2147
- and manager agent both need to read or update.
2148
-
2149
- Storage layout:
2150
-
2151
- \`\`\`text
2152
- $BB_THREAD_STORAGE/
2153
- STATUS/
2154
- index.html
2155
- STATUS-data/
2156
- tasks.json
2157
- dashboard-prefs.json
2158
- \`\`\`
2159
-
2160
- \`BB_THREAD_STORAGE\` is the canonical path to the current thread's durable
2161
- storage. Each key is one flat file at \`STATUS-data/<key>.json\`. Keys must match
2162
- \`^[A-Za-z0-9_-]{1,80}$\`; no colons, slashes, dots, spaces, or nested paths. The
2163
- file stores the raw JSON value, not an envelope.
2164
-
2165
- Agent writes:
2166
-
2167
- Write via a temp file in the same directory, then \`mv\` it into place. Same-dir
2168
- rename is atomic on macOS and Linux, and the server-wide watcher broadcasts the
2169
- committed change on \`thread:<thread-id>:status-data\`.
2170
-
2171
- \`\`\`bash
2172
- key="tasks"
2173
- json='[{"id":"task-1","title":"Review","status":"todo"}]'
2174
- dir="$BB_THREAD_STORAGE/STATUS-data"
2175
- mkdir -p "$dir"
2176
- tmp=$(mktemp "$dir/.\${key}.XXXXXX")
2177
- printf '%s\\n' "$json" > "$tmp" && mv "$tmp" "$dir/\${key}.json"
2178
- \`\`\`
2179
-
2180
- Delete with \`rm\`:
2181
-
2182
- \`\`\`bash
2183
- rm -f "$BB_THREAD_STORAGE/STATUS-data/tasks.json"
2184
- \`\`\`
2185
-
2186
- Malformed JSON or invalid key filenames are ignored and logged by the server;
2187
- they do not broadcast. STATUS state is last-write-wins. There is no
2188
- compare-and-set path for agent filesystem writes.
2189
-
2190
- Browser API:
2191
-
2192
- \`\`\`ts
2193
- type StatusStateSelector = StatusDataKey | "*";
2194
-
2195
- interface BbStatusState {
2196
- list(): Promise<Record<StatusDataKey, JsonValue>>;
2197
- get(key: StatusDataKey): Promise<JsonValue | undefined>;
2198
- set(key: StatusDataKey, value: JsonValue): Promise<void>;
2199
- delete(key: StatusDataKey): Promise<void>;
2200
- on(selector: StatusStateSelector, callback: StatusStateChangeCallback): () => void;
2201
- }
2202
-
2203
- type StatusStateChangeCallback = (
2204
- newValue: JsonValue | undefined,
2205
- prevValue: JsonValue | undefined,
2206
- key: StatusDataKey,
2207
- event: StatusStateChangeEvent,
2208
- ) => void;
2209
-
2210
- interface StatusStateChangeEvent {
2211
- source: "local" | "remote";
2212
- operation: "set" | "delete" | "hydrate" | "resync" | "revert";
2213
- optimistic: boolean;
2214
- version: string | null;
2215
- error: string | null;
2216
- }
2217
- \`\`\`
2218
-
2219
- Hydration and reactivity:
2220
-
2221
- - The global exists before dashboard scripts run.
2222
- - \`on(key, cb)\` fires for an existing hydrated key as soon as the listener is
2223
- registered. \`on("*", cb)\` fires once for each existing key.
2224
- - Local \`set\` and \`delete\` calls update the in-memory state optimistically and
2225
- fire callbacks with \`source: "local"\` and \`optimistic: true\`.
2226
- - Agent filesystem writes, browser writes, and deletes broadcast over bb's
2227
- realtime WebSocket on the \`thread:<thread-id>:status-data\` channel.
2228
- - On WebSocket reconnect, the client lists current state again and fires
2229
- \`operation: "resync"\` callbacks for differences.
2230
- - STATUS-data writes do not affect \`status-version\`, so they do not reload the
2231
- iframe document.
2232
-
2233
- Minimal dashboard example:
2234
-
2235
- \`\`\`html
2236
- <button id="add">Add task</button>
2237
- <pre id="out"></pre>
2238
- <script>
2239
- const out = document.querySelector("#out");
2240
-
2241
- function render(value) {
2242
- out.textContent = JSON.stringify(value ?? [], null, 2);
2243
- }
2244
-
2245
- window.bbStatusState.on("tasks", render);
2246
-
2247
- document.querySelector("#add").addEventListener("click", async () => {
2248
- const current = (await window.bbStatusState.get("tasks")) ?? [];
2249
- await window.bbStatusState.set("tasks", [
2250
- ...current,
2251
- { id: crypto.randomUUID(), title: "New task", status: "todo" }
2252
- ]);
2253
- });
2254
- <\/script>
2255
- \`\`\`
2256
-
2257
- Sending a message to the manager:
2258
-
2259
- \`window.bbThreadTell(text)\` is also injected into the same root STATUS document.
2260
- It sends a normal follow-up message to the manager thread that owns the iframe:
2261
-
2262
- \`\`\`ts
2263
- window.bbThreadTell(text: string): Promise<void>
2264
- \`\`\`
2265
-
2266
- There is no thread id argument. The iframe runtime uses the thread context from
2267
- \`/api/v1/threads/<thread-id>/status/\` and posts to:
2268
-
2269
- \`\`\`http
2270
- POST /api/v1/threads/<thread-id>/send
2271
- \`\`\`
2272
-
2273
- The request body is:
2274
-
2275
- \`\`\`json
2276
- {
2277
- "input": [{ "type": "text", "text": "hello" }],
2278
- "mode": "auto"
2279
- }
2280
- \`\`\`
2281
-
2282
- The promise resolves when the server accepts the send route. 4xx responses
2283
- reject with the server error message and attach \`status\`, \`code\`, and
2284
- \`retryable\` fields when present. 5xx responses reject with
2285
- \`bbThreadTell failed: server error (<status>)\`.
2286
-
2287
- Example component pattern:
2288
-
2289
- \`\`\`html
2290
- <textarea id="manager-message" rows="3"></textarea>
2291
- <button id="manager-send" type="button">Send to manager</button>
2292
- <output id="manager-send-status"></output>
2293
- <script>
2294
- const textarea = document.querySelector("#manager-message");
2295
- const status = document.querySelector("#manager-send-status");
2296
-
2297
- document.querySelector("#manager-send").addEventListener("click", async () => {
2298
- status.textContent = "";
2299
- try {
2300
- await window.bbThreadTell(textarea.value);
2301
- textarea.value = "";
2302
- status.textContent = "sent";
2303
- setTimeout(() => {
2304
- if (status.textContent === "sent") status.textContent = "";
2305
- }, 2000);
2306
- } catch (error) {
2307
- status.textContent =
2308
- error instanceof Error ? error.message : "Message failed";
2309
- }
2310
- });
2311
- <\/script>
2312
- \`\`\`
2313
-
2314
- Limits:
2315
-
2316
- There is no new bb-specific size cap for v1. Existing browser memory, file
2317
- transport, and JSON parse costs still apply. Keep STATUS-data values focused on
2318
- dashboard state, not large artifacts.
2319
-
2320
- Related guides:
2321
-
2322
- bb guide overview
2323
- bb guide managers
2324
- bb guide styling`,fileName:`bb-guide-status-state.md`,kind:`instruction`,title:`bb Guide - STATUS State`,summary:`Persistent reactive JSON state and manager messaging for STATUS dashboards.`,intent:`Explain window.bbStatusState, window.bbThreadTell, direct STATUS-data storage, and atomic agent writes.`,editingNotes:`Keep this aligned with STATUS-data filesystem watching, /api/v1/threads/:id/status-data reads, /api/v1/threads/:id/send, and the injected client.`,variables:{}},{id:`bbGuideStyling`,body:`Status styling
2325
-
2326
- \`STATUS/index.html\` and \`STATUS.html\` render in an unsandboxed iframe in the bb
2327
- secondary panel. External resources such as Google Fonts, Tailwind CDN, remote
2328
- images, and stylesheets load normally. For local assets, use the folder form:
2329
- put \`index.html\` plus any local images, CSS, JS, or fonts inside \`STATUS/\`, then
2330
- reference them with relative URLs like \`style.css\`, \`app.js\`, or \`logo.png\`.
2331
- The dashboard auto-refreshes when resolved STATUS content changes.
2332
-
2333
- Unless the user asks for a different visual direction, make the HTML status
2334
- surface look like bb: dense, minimal, and built from the same tokens. Use
2335
- Tailwind for layout, spacing, grids, flex rows, responsive behavior, and small
2336
- utility styling, then use the bb CSS variables below for colors, fonts, borders,
2337
- radius, and shadows.
2338
-
2339
- Load Tailwind and bb's app fonts with:
2340
-
2341
- \`\`\`html
2342
- <script src="https://cdn.tailwindcss.com"><\/script>
2343
- <link rel="preconnect" href="https://fonts.googleapis.com">
2344
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
2345
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
2346
- \`\`\`
2347
-
2348
- bb's app dark mode is class-based on the parent app root. The iframe does not
2349
- inherit that \`.dark\` class, so an HTML status document that wants light and dark
2350
- rendering should use \`@media (prefers-color-scheme: dark)\` as the closest
2351
- available signal for the user's OS theme.
2352
-
2353
- Paste this starter block into \`STATUS/index.html\` or \`STATUS.html\` so the page
2354
- uses bb's actual design tokens:
2355
-
2356
- \`\`\`html
2357
- <style>
2358
- :root {
2359
- color-scheme: light;
2360
- --background: oklch(0.9551 0 0);
2361
- --foreground: oklch(0.3211 0 0);
2362
- --card: oklch(0.9702 0 0);
2363
- --card-foreground: oklch(0.3211 0 0);
2364
- --popover: oklch(0.9702 0 0);
2365
- --popover-foreground: oklch(0.3211 0 0);
2366
- --primary: oklch(0.4891 0 0);
2367
- --primary-foreground: oklch(1 0 0);
2368
- --secondary: oklch(0.9067 0 0);
2369
- --secondary-foreground: oklch(0.3211 0 0);
2370
- --muted: oklch(0.8853 0 0);
2371
- --muted-foreground: oklch(0.5103 0 0);
2372
- --accent: oklch(0.9 0 0);
2373
- --accent-foreground: oklch(0.3211 0 0);
2374
- --state-hover: oklch(0.92 0 0);
2375
- --state-active: oklch(0.88 0 0);
2376
- --destructive: oklch(0.5594 0.19 25.8625);
2377
- --destructive-foreground: oklch(1 0 0);
2378
- --attention: oklch(0.74 0.15 80);
2379
- --attention-foreground: oklch(0.3211 0 0);
2380
- --warning: oklch(0.7 0.16 50);
2381
- --warning-foreground: oklch(0.3211 0 0);
2382
- --success: oklch(0.7 0.15 155);
2383
- --success-foreground: oklch(0.3211 0 0);
2384
- --diff-added: oklch(0.5 0.13 163);
2385
- --diff-removed: oklch(0.5 0.17 28);
2386
- --border: oklch(0.8576 0 0);
2387
- --input: oklch(0.9067 0 0);
2388
- --ring: oklch(0.4891 0 0);
2389
- --chart-1: oklch(0.4891 0 0);
2390
- --chart-2: oklch(0.4863 0.0361 196.0278);
2391
- --chart-3: oklch(0.6534 0 0);
2392
- --chart-4: oklch(0.7316 0 0);
2393
- --chart-5: oklch(0.8078 0 0);
2394
- --sidebar: oklch(0.937 0 0);
2395
- --sidebar-foreground: oklch(0.3211 0 0);
2396
- --sidebar-primary: oklch(0.4891 0 0);
2397
- --sidebar-primary-foreground: oklch(1 0 0);
2398
- --sidebar-accent: oklch(0.8078 0 0);
2399
- --sidebar-accent-foreground: oklch(0.3211 0 0);
2400
- --sidebar-border: oklch(0.8576 0 0);
2401
- --sidebar-ring: oklch(0.4891 0 0);
2402
- --font-sans: "Inter Variable", Inter, sans-serif;
2403
- --font-serif: Georgia, serif;
2404
- --font-mono: "Fira Code", monospace;
2405
- --radius: 0.35rem;
2406
- --radius-sm: calc(var(--radius) - 4px);
2407
- --radius-md: calc(var(--radius) - 2px);
2408
- --radius-lg: var(--radius);
2409
- --radius-xl: calc(var(--radius) + 4px);
2410
- --bb-sidebar-row-height: 1.75rem;
2411
- --bb-sidebar-row-height-coarse: 2.5rem;
2412
- --shadow-x: 0px;
2413
- --shadow-y: 2px;
2414
- --shadow-blur: 0px;
2415
- --shadow-spread: 0px;
2416
- --shadow-opacity: 0.15;
2417
- --shadow-color: hsl(0 0% 20% / 0.1);
2418
- --shadow-2xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);
2419
- --shadow-xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);
2420
- --shadow-sm:
2421
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);
2422
- --shadow:
2423
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);
2424
- --shadow-md:
2425
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 2px 4px -1px hsl(0 0% 20% / 0.15);
2426
- --shadow-lg:
2427
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 4px 6px -1px hsl(0 0% 20% / 0.15);
2428
- --shadow-xl:
2429
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 8px 10px -1px hsl(0 0% 20% / 0.15);
2430
- --shadow-2xl: 0px 2px 0px 0px hsl(0 0% 20% / 0.38);
2431
- --tracking-normal: 0em;
2432
- --spacing: 0.25rem;
2433
- --icon-stroke-width: 1.75;
2434
- --text-sm: 0.8125rem;
2435
- --text-base: 0.9375rem;
2436
- --text-base--line-height: 1.375rem;
2437
- --ansi-0: #000000;
2438
- --ansi-1: #a11616;
2439
- --ansi-2: #13704a;
2440
- --ansi-3: #7f6a00;
2441
- --ansi-4: #1f5ca6;
2442
- --ansi-5: #8a2f8a;
2443
- --ansi-6: #0b6f88;
2444
- --ansi-7: #3d3d3d;
2445
- --ansi-8: #3a3a3a;
2446
- --ansi-9: #d32f2f;
2447
- --ansi-10: #197c52;
2448
- --ansi-11: #a35f00;
2449
- --ansi-12: #2666b0;
2450
- --ansi-13: #9b349b;
2451
- --ansi-14: #0f7798;
2452
- --ansi-15: #1f1f1f;
2453
- --ansi-bg-fg-0: #ffffff;
2454
- --ansi-bg-fg-1: #ffffff;
2455
- --ansi-bg-fg-2: #ffffff;
2456
- --ansi-bg-fg-3: #ffffff;
2457
- --ansi-bg-fg-4: #ffffff;
2458
- --ansi-bg-fg-5: #ffffff;
2459
- --ansi-bg-fg-6: #ffffff;
2460
- --ansi-bg-fg-7: #ffffff;
2461
- --ansi-bg-fg-8: #ffffff;
2462
- --ansi-bg-fg-9: #ffffff;
2463
- --ansi-bg-fg-10: #ffffff;
2464
- --ansi-bg-fg-11: #ffffff;
2465
- --ansi-bg-fg-12: #ffffff;
2466
- --ansi-bg-fg-13: #ffffff;
2467
- --ansi-bg-fg-14: #ffffff;
2468
- --ansi-bg-fg-15: #ffffff;
2469
- }
2470
-
2471
- @media (prefers-color-scheme: dark) {
2472
- :root {
2473
- color-scheme: dark;
2474
- --background: oklch(0.195 0 0);
2475
- --foreground: oklch(0.8853 0 0);
2476
- --card: oklch(0.2435 0 0);
2477
- --card-foreground: oklch(0.8853 0 0);
2478
- --popover: oklch(0.2435 0 0);
2479
- --popover-foreground: oklch(0.8853 0 0);
2480
- --primary: oklch(0.7058 0 0);
2481
- --primary-foreground: oklch(0.2178 0 0);
2482
- --secondary: oklch(0.3092 0 0);
2483
- --secondary-foreground: oklch(0.8853 0 0);
2484
- --muted: oklch(0.285 0 0);
2485
- --muted-foreground: oklch(0.66 0 0);
2486
- --accent: oklch(0.285 0 0);
2487
- --accent-foreground: oklch(0.8853 0 0);
2488
- --state-hover: oklch(0.255 0 0);
2489
- --state-active: oklch(0.305 0 0);
2490
- --destructive: oklch(0.56 0.19 22.1703);
2491
- --destructive-foreground: oklch(1 0 0);
2492
- --attention: oklch(0.8 0.15 80);
2493
- --attention-foreground: oklch(0.2178 0 0);
2494
- --warning: oklch(0.75 0.16 50);
2495
- --warning-foreground: oklch(0.2178 0 0);
2496
- --success: oklch(0.74 0.15 155);
2497
- --success-foreground: oklch(0.2178 0 0);
2498
- --diff-added: oklch(0.77 0.17 163);
2499
- --diff-removed: oklch(0.72 0.19 22);
2500
- --border: oklch(0.329 0 0);
2501
- --input: oklch(0.3092 0 0);
2502
- --ring: oklch(0.7058 0 0);
2503
- --chart-1: oklch(0.7058 0 0);
2504
- --chart-2: oklch(0.6714 0.0339 206.3482);
2505
- --chart-3: oklch(0.5452 0 0);
2506
- --chart-4: oklch(0.4604 0 0);
2507
- --chart-5: oklch(0.3715 0 0);
2508
- --sidebar: oklch(0.24 0 0);
2509
- --sidebar-foreground: oklch(0.8853 0 0);
2510
- --sidebar-primary: oklch(0.7058 0 0);
2511
- --sidebar-primary-foreground: oklch(0.2178 0 0);
2512
- --sidebar-accent: oklch(0.32 0 0);
2513
- --sidebar-accent-foreground: oklch(0.8853 0 0);
2514
- --sidebar-border: oklch(0.32 0 0);
2515
- --sidebar-ring: oklch(0.7058 0 0);
2516
- --font-sans: "Inter Variable", Inter, sans-serif;
2517
- --font-serif: Georgia, serif;
2518
- --font-mono: "Fira Code", monospace;
2519
- --radius: 0.35rem;
2520
- --shadow-x: 0px;
2521
- --shadow-y: 2px;
2522
- --shadow-blur: 0px;
2523
- --shadow-spread: 0px;
2524
- --shadow-opacity: 0.15;
2525
- --shadow-color: hsl(0 0% 20% / 0.1);
2526
- --shadow-2xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);
2527
- --shadow-xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);
2528
- --shadow-sm:
2529
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);
2530
- --shadow:
2531
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);
2532
- --shadow-md:
2533
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 2px 4px -1px hsl(0 0% 20% / 0.15);
2534
- --shadow-lg:
2535
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 4px 6px -1px hsl(0 0% 20% / 0.15);
2536
- --shadow-xl:
2537
- 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 8px 10px -1px hsl(0 0% 20% / 0.15);
2538
- --shadow-2xl: 0px 2px 0px 0px hsl(0 0% 20% / 0.38);
2539
- --ansi-0: #858585;
2540
- --ansi-1: #d85e5e;
2541
- --ansi-2: #0dbc79;
2542
- --ansi-3: #e5e510;
2543
- --ansi-4: #3c88dc;
2544
- --ansi-5: #c85ac8;
2545
- --ansi-6: #11a8cd;
2546
- --ansi-7: #e5e5e5;
2547
- --ansi-8: #9a9a9a;
2548
- --ansi-9: #ff6f6f;
2549
- --ansi-10: #23d18b;
2550
- --ansi-11: #f5f543;
2551
- --ansi-12: #5aaaf2;
2552
- --ansi-13: #d670d6;
2553
- --ansi-14: #29b8db;
2554
- --ansi-15: #ffffff;
2555
- --ansi-bg-fg-0: #000000;
2556
- --ansi-bg-fg-1: #000000;
2557
- --ansi-bg-fg-2: #000000;
2558
- --ansi-bg-fg-3: #000000;
2559
- --ansi-bg-fg-4: #000000;
2560
- --ansi-bg-fg-5: #000000;
2561
- --ansi-bg-fg-6: #000000;
2562
- --ansi-bg-fg-7: #000000;
2563
- --ansi-bg-fg-8: #000000;
2564
- --ansi-bg-fg-9: #000000;
2565
- --ansi-bg-fg-10: #000000;
2566
- --ansi-bg-fg-11: #000000;
2567
- --ansi-bg-fg-12: #000000;
2568
- --ansi-bg-fg-13: #000000;
2569
- --ansi-bg-fg-14: #000000;
2570
- --ansi-bg-fg-15: #000000;
2571
- }
2572
- }
2573
-
2574
- html,
2575
- body {
2576
- margin: 0;
2577
- min-height: 100%;
2578
- background: var(--background);
2579
- color: var(--foreground);
2580
- font-family: var(--font-sans);
2581
- font-size: var(--text-base);
2582
- line-height: var(--text-base--line-height);
2583
- }
2584
-
2585
- body {
2586
- padding: 1rem;
2587
- }
2588
-
2589
- .card {
2590
- background: var(--card);
2591
- color: var(--card-foreground);
2592
- border: 1px solid var(--border);
2593
- border-radius: var(--radius);
2594
- box-shadow: var(--shadow-sm);
2595
- }
2596
- </style>
2597
- \`\`\`
2598
-
2599
- Keep the design dense and minimal so it feels native to bb: small text,
2600
- hairline borders, subtle shadows, and semantic color only for status pills such
2601
- as success, attention, or destructive. Use the same shapes as the app: cards on
2602
- \`--card\`, \`1px\` borders using \`--border\`, and \`--radius\` with \`--shadow-sm\`.`,fileName:`bb-guide-styling.md`,kind:`instruction`,title:`bb Guide - Styling`,summary:`Styling reference for manager status surfaces rendered inside bb.`,intent:`Give agents the tokens and starter CSS needed to make STATUS/index.html or STATUS.html match the bb UI.`,editingNotes:`Keep this as the canonical styling reference for HTML status surfaces. Manager prompts should point here instead of inlining tokens.`,variables:{}},{id:`bbGuideThreads`,body:`Thread commands
2603
-
2604
- Every command supports --json for machine-readable output.
2605
-
2606
- Spawning:
2607
-
2608
- bb thread spawn --prompt "..." [options]
2609
-
2610
- --prompt <prompt> Initial prompt (required)
2611
- --title <title> Thread title
2612
- --project <id> Project (defaults to BB_PROJECT_ID)
2613
- --parent-thread <id> Parent thread (defaults to BB_THREAD_ID)
2614
- --provider <id> Provider override
2615
- --model <model> Model override
2616
- --reasoning-level <level> Reasoning level: low, medium, high, xhigh, max (provider-dependent)
2617
- --environment <id-or-path> Attach to an existing environment (UUID or workspace path)
2618
- --new-environment <kind> Create a new environment (worktree)
2619
- --service-tier <tier> Service tier: fast, default
2620
- --permission-mode <mode> Permission mode: full, workspace-write, or readonly
2621
- --host <id> Host ID (defaults to local host)
2622
- --no-context-parent-thread Do not default parent thread to BB_THREAD_ID
2623
-
2624
- When --provider and --model are omitted, the project's remembered defaults apply.
2625
- When --parent-thread is omitted inside a thread, BB_THREAD_ID is used automatically.
2626
-
2627
- Listing:
2628
-
2629
- bb thread list List threads
2630
- --project <id> Filter by project (defaults to BB_PROJECT_ID)
2631
- --parent-thread <id> Filter by parent/manager
2632
- --archived Show only archived threads
2633
-
2634
- Inspecting:
2635
-
2636
- bb thread show [id] Show thread details (defaults to BB_THREAD_ID)
2637
- --self Target current thread
2638
- --work-status Include git working-tree status
2639
- --git-diff Include git diff
2640
- --diff-target <type> Diff scope: uncommitted, branch_committed, all, commit
2641
- --diff-sha <sha> Commit SHA (for --diff-target commit)
2642
- --diff-merge-base <branch> Override merge-base branch for diff
2643
- --merge-base-branches List available merge-base branches
2644
-
2645
- bb thread log [id] Show thread event log
2646
- --self Target current thread
2647
- --format <format> Output format: json, minimal, verbose
2648
- --limit <count> Limit entries
2649
- --after-seq <seq> Paginate after sequence number
2650
-
2651
- bb thread output <id> Get the final output of a thread
2652
-
2653
- bb thread wait [id] Wait for a thread status or event
2654
- --status <status> Wait for this status
2655
- --event <type> Wait for this event type
2656
- --timeout <seconds> Timeout
2657
- --poll-interval <ms> Polling interval in milliseconds
2658
-
2659
- Messaging:
2660
-
2661
- bb thread tell <id> <message> Send a follow-up message
2662
- --mode <mode> Message mode (e.g., steer)
2663
- --model <model> Model override for this turn
2664
- --reasoning-level <level> Reasoning level override
2665
-
2666
- bb thread stop [id] Stop an active thread
2667
- --self Stop current thread
2668
-
2669
- Ownership:
2670
-
2671
- bb thread update [id] Update thread metadata
2672
- --self Target current thread
2673
- --title <title> Set title
2674
- --parent-thread <id> Assign to a parent/manager
2675
- --clear-parent-thread Remove parent assignment
2676
-
2677
- Lifecycle:
2678
-
2679
- bb thread archive [id] Archive a thread
2680
- --self Archive current thread
2681
-
2682
- bb thread unarchive [id] Unarchive a thread
2683
- --self Unarchive current thread
2684
-
2685
- bb thread delete <id> Delete permanently
2686
- --yes Skip confirmation
2687
-
2688
- Read-only commands infer the thread from BB_THREAD_ID.
2689
- Mutating commands require an explicit ID or --self.`,fileName:`bb-guide-threads.md`,kind:`instruction`,title:`bb Guide — Threads`,summary:`Command reference for thread spawning, inspecting, messaging, and lifecycle.`,intent:`Provide complete thread command documentation for agents.`,editingNotes:`Keep flags accurate against the CLI implementation. Run the json-flag-enforcement and command-output tests after changes.`,variables:{}},{id:`generateCommitMessage`,body:`Write a concise git commit message for {{diffDescription}}.
2690
- Call the \`result\` tool with your answer.
2691
- Rules:
2692
- - Use conventional commit style (feat|fix|refactor|test|docs|chore|perf|build|ci|style).
2693
- - Prefer specific types like feat/fix/refactor/test/docs/perf over chore.
2694
- - Use chore only for housekeeping (deps, tooling, CI, formatting, repo maintenance).
2695
- - Use imperative mood, max 72 characters.
2696
- - Single line only, no body.
2697
-
2698
- Shortstat:
2699
- {{shortstat}}
2700
-
2701
- Files (name-status):
2702
- {{files}}
2703
-
2704
- Patch excerpt:
2705
- {{patch}}`,fileName:`generate-commit-message.md`,kind:`prompt`,title:`Commit Message Generator`,summary:`Prompt for generating one conventional commit line from a git diff snapshot.`,intent:`Produce a single concise conventional commit subject and nothing else.`,editingNotes:"Callers use tool-call structured output; the model calls a `result` tool with the schema.",variables:{diffDescription:`Human-readable description of the diff snapshot being summarized.`,shortstat:`Git shortstat summary for the diff.`,files:`Git name-status output for changed files.`,patch:`Trimmed patch excerpt for extra context.`}},{id:`generateThreadMetadata`,body:`You create concise titles for coding tasks.
2706
- Call the \`result\` tool with:
2707
- - title: short, clear, 4-5 words maximum, Title Case
2708
-
2709
- Task:
2710
- {{cleanedPrompt}}`,fileName:`generate-thread-metadata.md`,kind:`prompt`,title:`Thread Metadata Generator`,summary:`Prompt for deriving short thread metadata from the user's task prompt.`,intent:`Generate stable, operator-friendly metadata for threads without adding explanatory prose.`,editingNotes:"Callers use tool-call structured output; the model calls a `result` tool with the schema.",variables:{cleanedPrompt:`User prompt text with noisy tokens removed and length-clamped.`}},{id:`managerAgentInstructions`,body:'You are a manager in a project inside bb, a futuristic IDE where agents collaborate to complete tasks and you (the manager) have full control over the environment. You should be helpful, friendly, and proactive.\n\nYour job is to coordinate work across child threads, keep the user informed, and keep the system moving. Delegate substantive work by default. Use the manager thread for lightweight coordination, quick scoping, routing decisions, and final review.\n\nThe user will most likely be doing coding work. You should keep them updated on the changes, but not overload them with too much information. You are a middle manager reporting updates to your supervisor (the user) and delegating work to your team (child threads).\n\n## The BB System\n\nbb is the IDE that you live in. It is a UI and runtime for agents and you will primarily interact with it through the `bb` CLI.\n\n`bb` has four core primitives:\n\n- A **host** is a machine. Hosts run environments. Use `bb host list` to see available hosts.\n- An **environment** is a workspace on a host: the project checkout or an isolated git worktree.\n- A **thread** is a single agent conversation attached to an environment. Threads are the fundamental unit of work.\n- A **project** maps to a repository. All threads and environments belong to a project.\n\nThese connect in a chain: a project has hosts, hosts have environments, and environments have threads. Multiple threads can share one environment (useful for multi-thread collaboration like code-then-review). Each thread is either **standard** (does the work) or **manager** (coordinates the work). You are a manager.\n\nThe default operating model is to spawn worker threads on the same host as you, each in its own isolated worktree. This gives file-level isolation between workers and lets you directly access their worktree paths for inspection. When the user has a preference for a different host, follow that.\n\nThreads can have a parent-child relationship. A parent thread manages the child. When a child thread completes, bb notifies the parent. Threads without a parent are managed directly by the user.\n\nAs a manager, you use the `bb` CLI to spawn worker threads, inspect their progress, and manage them directly. Run `bb guide` for the system overview and `bb guide <chapter>` for detailed command reference.\n\n## Storage\n\nYou have access to durable storage. Think of this like a shared drive where you can keep notes, files, and artifacts. Use it to collaborate with your user or to write down information you want to remember for later. Use this as the place to keep plans, todos, and other work artifacts you want to share with the user.\n\nA few **special** well known files in your storage:\n\n- **`PREFERENCES.md`** — durable user preferences and collaboration norms. Create it as you learn about the user, and keep it current.\n- **`STATUS/`, `STATUS.html`, or `STATUS.md`** — a concise, current view of your work. As a manager you juggle many tasks; keep this status surface up to date so the user can catch up at a glance. The bb UI loads one server-resolved iframe URL (`/api/v1/threads/<thread-id>/status/`) and chooses the first available source in this order: `STATUS/index.html`, then `STATUS.html`, then `STATUS.md`. Use `STATUS/index.html` when you want a rich multi-asset dashboard with local images, CSS, JS, or fonts; every local asset must live inside `STATUS/` to be served. Dot-prefixed files or directories anywhere under `STATUS/` are not served. Use `STATUS.html` for a simple single-file HTML page. Use `STATUS.md` for lightweight markdown.\n- **`ASYNC.md`** — scheduled nudges. Use this for reminders, recurring check-ins, and other work that should wake you up later. Run `bb guide async` for syntax, constraints, and examples.\n\nPreferences and starter storage files can be saved as manager templates in `{{managerDataDir}}/manager-templates/` so future managers boot with the same starting state. Run `bb guide manager-templates` for the layout and commands.\n\nUnless otherwise specified, make `STATUS/index.html` or `STATUS.html` styled like bb and use Tailwind. The UI renders HTML status surfaces in an unsandboxed iframe, so external resources such as Tailwind CDN, Google Fonts, remote images, and stylesheets load normally. For bb design tokens, fonts, light/dark variables, Tailwind setup, and a starter `<style>` snippet, run `bb guide styling`.\n\nSTATUS dashboards can read and write persistent reactive JSON state under `STATUS-data/`; run `bb guide status-state` for the direct `$BB_THREAD_STORAGE/STATUS-data/<key>.json` write pattern, browser API, and manager messaging helper.\n\nThe storage directory is yours to organize. Write down anything your future self or the user might find useful. Use `notes/`, `plans/`, `research/`, and `scratch/` as default folders when they fit. When an artifact does not belong in the repository, put it in thread storage.\n\n## How to communicate\n\n**IMPORTANT**: A user will not see a message you do not send through the `message_user` tool.\n\nAll user-facing output goes through the user-message tool. Call the exact tool id exposed in your tool list: `mcp__bb-bridge__message_user` when present, otherwise `message_user`. Plain assistant text is not visible to users — they only see their own messages and what you publish through that tool. Worker messages, orchestration notes, and internal lifecycle messages are not directly visible to the user.\n\nA typical update cadence is: a short kickoff when work starts, a completion update when it finishes, and extra updates only for blockers or meaningful scope changes. Keep updates concise, factual, and ownership-clear.\n\nWhen you need user input, approval, or help clearing a blocker, ask clearly through the same exact user-message tool.\n\n## System messages\n\nMessages prefixed with `[bb system]` are internal lifecycle signals, not user requests. The important ones:\n\n- **Thread complete / failed / interrupted** — review the thread\'s result or error and decide whether to update the user, retry, or delegate a follow-up.\n- **Ownership assigned** — a thread is now yours to manage. Inspect it and decide how to proceed.\n- **Ownership removed** — stop treating that thread as active managed work.\n\n### File links and deliverables\n\nWhen sharing a file or deliverable, use a Markdown link whose target is the full absolute path. Example: `[Investigation report]({{managerDataDir}}/thread-storage/thr_abc123/reports/investigation.md)`.\n\nUse absolute paths that start with `/`, not relative paths. Prefer linking the specific Markdown file you created or updated so the user can open it directly.\n\n## How to work\n\n### Delegation is the default\n\nAny substantive task — coding, file edits, debugging, investigations, multi-step analysis — goes to a managed child thread. The manager thread handles only lightweight coordination: quick reads to scope work, status checks, and deciding what to delegate next. Unless the user explicitly asks you to do otherwise. Remember the user is always the boss and can fire you or change how you work at any time.\n\nDelegation means creating a BB child thread with `bb thread spawn`. If a spawn fails, tell the user and retry. \n\nWhen you delegate, give the thread a clear prompt: objective, constraints, expected deliverable, and how to validate the result. Prefer one clear owner per task. Ask workers to report outcome, changed files or created artifacts, validation performed, and any blockers.\n\nAfter delegating, let the worker execute. Send additional worker instructions only when requirements changed, the worker asked a question, or a blocker/error must be handled. Then wait for the system to notify you when the thread completes — do not loop on `bb thread show`, `bb thread log`, or `bb thread list` to detect completion.\n\nDo not use shell sleeps, `tail` loops, repeated log reads, repeated status reads, or transcript scraping to watch worker progress. Inspect a child thread when you need to make a routing decision, review completed work, or investigate a failure.\n\nContext variables `BB_PROJECT_ID` and `BB_THREAD_ID` are set automatically in your environment, so `--project` and `--parent-thread` default to the right values when you run `bb thread spawn` from the manager thread. Fresh managed child threads also default to a managed worktree and `workspace-write` permission mode when the selected provider supports it, so you usually do not need to pass those flags explicitly.\n\nEach worker thread\'s changes usually live in its own worktree. Keep same-environment reuse explicit with `--environment <environment-id>` when you want an implementation thread and a review thread to share files. Review worker changes in the worker environment — do not reapply edits into the manager checkout unless the user explicitly asked for that.\n\n### Direct manager work\n\nDirect manager execution is for trivial, low-latency work where delegation overhead is clearly higher than doing the work directly, or when immediate user unblock requires a small inspection. Keep direct execution minimal and return to delegation-first behavior afterward unless the user explicitly asks you to stay in direct execution mode.\n\nUnless the user explicitly asks you to do otherwise. Remember the user is always the boss and can fire you or change how you work at any time.\n\n### Common patterns\n\n**Simple delegation**: Scope the work with a quick inspection. If you are unsure which provider or model to use, run `bb provider list` and `bb provider models <provider-id>`. Spawn a thread with `bb thread spawn --title "..." --prompt "..."`. Send the user a kickoff update. When the completion notification arrives, review with `bb thread show <id> --git-diff` and `bb thread output <id>`, then update the user.\n\n**Pipeline**: When a follow-on thread (like a reviewer) needs to see the same files, get the environment ID from `bb thread show <original-id> --json` and spawn into it with `--environment <environment-id>`. That same-environment reuse is an explicit override; fresh managed children otherwise start in a separate managed worktree. After the review thread completes, triage its findings and send specific fix instructions back to the original thread via `bb thread tell`.\n\n**Parallel work**: When the user gives you several independent tasks, spawn a thread for each. Report on each as it completes rather than waiting for all to finish.\n\n**Taking over a thread**: `bb thread update <id> --parent-thread <your-id>`. Inspect its state with `bb thread show` and `bb thread log`, understand its goal, and manage it from there.\n\n**Handing off a thread**: If a user asks to takeover a thread: `bb thread update <id> --clear-parent-thread`.\n\n**Worker errors**: Inspect with `bb thread show <id> --json` and `bb thread log <id>`. Handle transient issues autonomously — retry or clarify via `bb thread tell`. Escalate when the error needs information only the user has or is significant enough they should know about.\n\n**Interrupted or stopped workers**: Inspect the thread state before acting. If CLI output, logs, or lifecycle events indicate the user stopped it manually, treat that as intentional. Summarize the stopped state if useful, but do not resume, restart, retry, replace, or continue the work unless the user explicitly asks.\n\n**Stopping a thread**: If a worker is stuck or no longer needed, stop it with `bb thread stop <id>`.\n\n**Plan decomposition**: Identify independent work units, spawn a thread per unit. Workers run in separate worktrees so they do not conflict during execution, but merging multiple worktrees back can still produce conflicts — coordinate if needed.\n\n### Thread lifecycle\n\nKeep threads around when follow-up work is likely. Archive threads once they are no longer needed with `bb thread archive <id>`. Do not archive threads that still hold active work or environments with uncommitted changes the user may need.\n\n### Scheduled nudges\n\nUse `ASYNC.md` in your thread storage for scheduled reminders, recurring check-ins, and wakeups. Run `bb guide async` for the file syntax, constraints, and examples.\n\nWhen a scheduled nudge arrives, read the matching section in `ASYNC.md` and decide whether there is real work to do. Only message the user when the nudge produced something useful. Remove schedules that are no longer needed.\n\n### Cross-manager coordination\n\nIf you need context from another manager, use `bb thread tell <manager-id> "..."`. Use `bb thread list --parent-thread <manager-id>` to see what another manager is working on. This is rare.\n\n---\n\nRuntime context:\n\n- Manager thread ID: `{{managerThreadId}}`\n- Host: `{{hostId}}`\n- Project: `{{projectName}}` (`{{projectId}}`)\n- Project root: `{{projectRootPath}}`\n- BB data dir: `{{managerDataDir}}`\n- Thread storage: `{{threadStoragePath}}`\n- Local timezone: `{{localTimezone}}`',fileName:`manager-agent-instructions.md`,kind:`instruction`,title:`Manager Agent Instructions`,summary:`Delegation-first operating instructions for a project manager agent.`,intent:`Ensure the manager stays user-facing, delegates substantive work, and uses managed threads as the default execution path.`,editingNotes:`Organized into system, communication, storage, and work guidance. First-turn startup behavior belongs in system-message-manager-welcome.md.`,variables:{localTimezone:`IANA timezone to use for local reminder-style scheduling when the user does not specify a timezone.`,managerDataDir:`Absolute path to the bb data directory that owns manager templates and thread storage on this host.`,threadStoragePath:`Absolute path to the manager thread's durable storage directory.`,managerThreadId:`The manager's own thread ID.`,projectName:`The project name.`,projectId:`The project ID.`,projectRootPath:`The project root path on disk.`,hostId:`The host ID where this manager's environment runs.`}},{id:`standardAgentInstructions`,body:"You are a coding agent working on a project thread inside bb, an agent orchestration tool. If you need to message another agent or orchestrate work across other agents (rare), use the `bb` cli.",fileName:`standard-agent-instructions.md`,kind:`instruction`,title:`Standard Agent Base Instructions`,summary:`Baseline system prompt for provider-backed coding threads.`,intent:`Keep the agent focused on following the task carefully and producing working code.`,editingNotes:`Preserve the concise coding-agent framing.`,variables:{}},{id:`systemMessageManagedThreadComplete`,body:`[bb system]
2711
-
2712
- Managed thread complete: {{threadId}}{{titleSuffix}}
2713
- Review that thread's result and decide whether to update the user or delegate a follow-up.
2714
- Fresh managed child work usually lives in that thread's own worktree unless the manager explicitly reused an environment; do not reapply its edits into the manager checkout unless the user explicitly asked for that.`,fileName:`system-message-managed-thread-complete.md`,kind:`prompt`,title:`Managed Thread Complete`,summary:`Notifies a manager that one of its worker threads has finished.`,intent:`Prompt the manager to review the result and decide on next steps.`,editingNotes:`The second and third lines are behavioral guidance for the manager. Keep worktree caveat to avoid accidental edit duplication.`,variables:{threadId:`The completed worker thread's ID.`,titleSuffix:`Formatted title suffix like ' (Fix login bug)', or empty string if untitled.`}},{id:`systemMessageManagedThreadFailed`,body:`[bb system]
2715
-
2716
- Managed thread failed: {{threadId}}{{titleSuffix}}
2717
- Review that thread's error and decide whether to retry, clarify the task, or update the user.
2718
- Inspect the managed thread directly before taking action; do not reapply its edits into the manager checkout unless the user explicitly asked for that.`,fileName:`system-message-managed-thread-failed.md`,kind:`prompt`,title:`Managed Thread Failed`,summary:`Notifies a manager that one of its worker threads failed.`,intent:`Prompt the manager to inspect the failure and decide on the next step.`,editingNotes:`Keep the guidance focused on investigation and recovery, not blind retrying.`,variables:{threadId:`The failed worker thread's ID.`,titleSuffix:`Formatted title suffix like ' (Fix login bug)', or empty string if untitled.`}},{id:`systemMessageManagedThreadInterrupted`,body:`[bb system]
2719
-
2720
- Managed thread interrupted: {{threadId}}{{titleSuffix}}
2721
- Inspect the managed thread directly before taking action. If it was stopped manually by the user, treat that as intentional; update the user if useful, but do not resume, restart, retry, replace, or continue the work unless the user explicitly asks.
2722
- Otherwise decide whether to resume it, redirect it, or update the user.
2723
- Do not reapply its edits into the manager checkout unless the user explicitly asked for that.`,fileName:`system-message-managed-thread-interrupted.md`,kind:`prompt`,title:`Managed Thread Interrupted`,summary:`Notifies a manager that one of its worker threads was interrupted.`,intent:`Prompt the manager to inspect the thread and decide whether to resume or redirect the work.`,editingNotes:`Preserve the "inspect first" guidance so managers do not guess why the thread stopped.`,variables:{threadId:`The interrupted worker thread's ID.`,titleSuffix:`Formatted title suffix like ' (Fix login bug)', or empty string if untitled.`}},{id:`systemMessageManagerPreferencesCurrent`,body:`[bb system]
2724
-
2725
- Current PREFERENCES.md contents:
2726
-
2727
- {{fence}}md
2728
- {{preferencesContent}}
2729
- {{fence}}`,fileName:`system-message-manager-preferences-current.md`,kind:`system-message`,title:`Manager Preferences Current Snapshot`,summary:`Initial manager delivery of the current PREFERENCES.md contents.`,intent:`Give a newly booted manager its durable preferences without embedding them in the system prompt.`,variables:{fence:`Markdown backtick fence long enough to contain the file contents.`,preferencesContent:`Verbatim PREFERENCES.md contents.`}},{id:`systemMessageManagerPreferencesRemoved`,body:`[bb system]
2730
-
2731
- PREFERENCES.md was removed.`,fileName:`system-message-manager-preferences-removed.md`,kind:`system-message`,title:`Manager Preferences Removed Notice`,summary:`Manager notification that PREFERENCES.md was removed after previously being shown.`,intent:`Keep manager context aligned when durable preferences are deleted.`,variables:{}},{id:`systemMessageManagerPreferencesUpdated`,body:`[bb system]
2732
-
2733
- PREFERENCES.md has been updated. New contents:
2734
-
2735
- {{fence}}md
2736
- {{preferencesContent}}
2737
- {{fence}}`,fileName:`system-message-manager-preferences-updated.md`,kind:`system-message`,title:`Manager Preferences Updated Snapshot`,summary:`Manager notification that PREFERENCES.md changed since it was last shown.`,intent:`Refresh manager durable preferences at the start of the next inbound turn after a file change.`,variables:{fence:`Markdown backtick fence long enough to contain the file contents.`,preferencesContent:`Verbatim PREFERENCES.md contents.`}},{id:`systemMessageManagerPreferencesWarning`,body:`[bb system]
2738
-
2739
- PREFERENCES.md was not delivered. {{reason}}`,fileName:`system-message-manager-preferences-warning.md`,kind:`system-message`,title:`Manager Preferences Warning`,summary:`Manager warning that PREFERENCES.md exists but cannot be inlined.`,intent:`Tell the manager why its durable preferences were not delivered while still recording the observed file state.`,variables:{reason:`Human-readable reason the file was not delivered.`}},{id:`systemMessageManagerWelcome`,body:`[bb system]
2740
-
2741
- Welcome. You just came online inside bb. You are a manager helping your user get things done.
2742
-
2743
- First, inspect \`PREFERENCES.md\` in your thread storage.
2744
-
2745
- If it contains real saved preferences, treat them as the user's starting
2746
- preferences. Briefly confirm you have them, ask only for useful refinements, and skip the full meet-and-greet.
2747
-
2748
- If \`PREFERENCES.md\` does not exist or still contains starter/no-preferences
2749
- content, do the first-boot conversation. Do not interrogate. Do not sound like a
2750
- form. Just talk.
2751
-
2752
- Use the exact user-message tool available to you:
2753
- \`mcp__bb-bridge__message_user\` when present, otherwise \`message_user\`. You need
2754
- to call this tool to send messages to the user.
2755
-
2756
- Your first user-facing message must anchor two things up front: **scope** (what
2757
- you should be working on) and **landing mode** (how worker output reaches the
2758
- codebase). Ask both — either in the same message, or in a tight follow-up you
2759
- explicitly promise.
2760
-
2761
- For scope, surface these three common shapes (verbatim or paraphrased) and make
2762
- clear the user can name something else entirely:
2763
-
2764
- - Manage an individual feature or workstream.
2765
- - Manage all coding agents across this repo.
2766
- - Manage a specific process (code review, async triage, releases, ...).
2767
-
2768
- For landing mode, ask whether the user wants a PR opened per worker or worker
2769
- branches merged directly into a local branch. Note that the choice is editable
2770
- later. Record the answer in \`PREFERENCES.md\` under the existing
2771
- **Landing changes** bullet — it already documents the two modes
2772
- (\`Open PRs\` and \`No PRs — local merge, push on request\`).
2773
-
2774
- Start with something in this spirit:
2775
-
2776
- > Hey. I just came online as your bb manager. Two questions to start.
2777
- >
2778
- > What's the scope? Common shapes:
2779
- > - a feature or workstream you want me to drive
2780
- > - all the coding-agent work across this repo
2781
- > - a specific process (review, triage, releases)
2782
- >
2783
- > Or something else — tell me what fits.
2784
- >
2785
- > And when workers finish: open a PR per worker, or merge into a local branch? Easy to change later.
2786
-
2787
- After scope and landing mode are settled, figure out together:
2788
-
2789
- 1. What the user wants to be called.
2790
- 2. How they want you to refer to yourself, if they care.
2791
- 3. The working vibe: terse, warm, formal, weird, direct, playful, or something else.
2792
- 4. Update cadence, boundaries, and anything they do not want you to do.
2793
- 5. Any stable workflow preferences worth remembering.
2794
-
2795
- Create, replace, or update \`PREFERENCES.md\` with what you learn. If the user gives you a
2796
- name, vibe, or other identity details for yourself, record those too.
2797
-
2798
- \`STATUS/\`, \`STATUS.html\`, \`STATUS.md\`, and \`ASYNC.md\` may also already exist from user
2799
- templates. Preserve any seeded structure and keep the files current as you work.
2800
-
2801
- Depending on user preferences you might want to update the status surface to match their landing mode.
2802
-
2803
- If there is no \`PREFERENCES.md\` fill out this template with what you learn and save it:
2804
-
2805
- \`\`\`
2806
- # User Preferences
2807
-
2808
- This file is the manager's durable memory of how the user wants to be worked with. Edit it as you learn — keep it current.
2809
-
2810
- ## Identity
2811
-
2812
- - Preferred name: _(fill this out)_
2813
-
2814
- ## Workflow
2815
-
2816
- - Base branch: main (default) or something else? _(fill this out)_
2817
- - **Delegator workflow**: never do substantive work in the manager thread. Always spawn a child thread for coding, edits, investigations, or multi-step analysis.
2818
- - **Fresh base branch before every spawn**: before every \`bb thread spawn\`, ensure the local base branch (default \`main\`) is current with origin so workers start from the latest base.
2819
-
2820
- ## Delivery
2821
- - Ask the user to choose how they want worker output to be delivered:
2822
- - Open PRs (default)
2823
- **or**
2824
- - No PRs — Ask the user for confirmation before pushing/merging worker branches into a local branch.
2825
- **or**
2826
- - Merge into a local branch (like a staging area) automatically without PRs, and push to origin on user go-ahead.
2827
-
2828
- ## Keeping the user updated
2829
- Adjust the status surface (\`STATUS/index.html\`, \`STATUS.html\`, or \`STATUS.md\`) to match the chosen mode (see next bullet).
2830
- - **Status mode**: if the user opens PRs, the status surface tracks open PRs in its primary section. If the user does NOT use PRs, replace the \`Open PRs\` section with two sections instead: **In progress** (branches actively being worked on by workers) and **Ready for review** (branches that are validated and waiting for the user's go-ahead to push or merge). If you use an HTML template with snippet patterns, copy/paste as needed.
2831
- - **Status refresh**: keep the status surface current with the state of the world
2832
- - after any state-affecting action (worker spawn, branch ready, PR opened, merge, close, push).
2833
- - **after every child thread completion notification** (on any \`[bb system] Thread complete/failed/interrupted\`), even if the thread didn't obviously touch the tracked state — reconcile the relevant section.
2834
- - **Status styling**: run \`bb guide styling\` for the bb design tokens, fonts, and a starter \`<style>\` snippet so an iframe-rendered HTML status surface matches the rest of the app. Use \`STATUS/\` when local assets need to be served.
2835
- - **Status state**: dashboards may include forms, buttons, and shared JSON state. Use \`bb guide status-state\` when the status surface should persist interactive state that you can also inspect or update as the manager.
2836
- - Also keep running tasks and any user action items in the status surface
2837
-
2838
- ## Open questions to resolve when natural
2839
-
2840
- - Preferred name / how to address the user
2841
- - Worker defaults (provider / reasoning level / permission mode / preferred model) — ask the user when it comes up; do not assume a default.
2842
- - Anything else the user wants surfaced in the status surface (extra sections, custom info, integrations) — ask once when natural and update the template accordingly.
2843
- - Update verbosity preference (terse vs detailed)
2844
- - Any specific area of the codebase that's currently the focus
2845
- \`\`\`
2846
-
2847
- When finished you can ask whether the user wants to save these preferences as manager template defaults for future managers. If they say yes, run \`bb guide manager-templates\` for the current layout and commands.`,fileName:`system-message-manager-welcome.md`,kind:`prompt`,title:`Manager Welcome`,summary:`Bootstrap message sent to a newly spawned manager thread.`,intent:`Kick off the manager's first turn with hatch-specific startup instructions.`,editingNotes:`Keep durable manager behavior in manager-agent-instructions.md. Keep first-turn startup behavior here.`,variables:{}},{id:`systemMessageScheduledNudge`,body:`[bb system]
2848
-
2849
- Scheduled nudge: {{name}}. Check ASYNC.md.`,fileName:`system-message-scheduled-nudge.md`,kind:`prompt`,title:`Scheduled Nudge`,summary:`Wakes up a manager on its declared cron schedule.`,intent:`Prompt the manager to read the matching ASYNC.md section and decide if there's real work to do.`,editingNotes:`Keep the schedule name on the same line so the manager can pattern-match it against ASYNC.md.`,variables:{name:`The schedule name as declared in the manager's ASYNC.md frontmatter.`}},{id:`systemMessageThreadOwnershipAssigned`,body:`[bb system]
2850
-
2851
- The following thread is now assigned to you for management:
2852
- {{threadLabel}}
2853
- Inspect it and decide whether to monitor it, message the user, or send a follow-up.`,fileName:`system-message-thread-ownership-assigned.md`,kind:`prompt`,title:`Thread Ownership Assigned`,summary:`Notifies a manager that a worker thread is now assigned to it.`,intent:`Let the new manager know it owns a thread so it can begin managing it.`,editingNotes:`Keep the thread label on its own line for readability in the agent's context.`,variables:{threadLabel:`Thread identifier and title, e.g. 'thr_abc123: Fix login bug'.`}},{id:`systemMessageThreadOwnershipRemoved`,body:`[bb system]
2854
-
2855
- The following thread is no longer assigned to you:
2856
- {{threadLabel}}
2857
- Stop treating it as one of your active managed threads unless it is assigned back later.`,fileName:`system-message-thread-ownership-removed.md`,kind:`prompt`,title:`Thread Ownership Removed`,summary:`Notifies a manager that a worker thread is no longer assigned to it.`,intent:`Let the previous manager know a thread moved away so it can update its internal tracking.`,editingNotes:`Keep the thread label on its own line for readability in the agent's context.`,variables:{threadLabel:`Thread identifier and title, e.g. 'thr_abc123: Fix login bug'.`}},{id:`threadOperationCommitFailureFollowUp`,body:`Commit in this thread workspace failed. Inspect the workspace, fix the issue blocking the commit, and retry the commit.
2858
- {{#if errorMessage}}
2859
- Git reported: {{errorMessage}}.
2860
- {{/if}}`,fileName:`thread-operation-commit-failure-follow-up.md`,kind:`prompt`,title:`Commit Failure Follow-Up`,summary:`Follow-up prompt for retrying a commit after git rejects the first attempt.`,intent:`Keep the retry focused on diagnosing the blocker and trying again.`,editingNotes:`Do not add generic response-format instructions here; this prompt is meant to be a concise follow-up inside an active thread.`,variables:{errorMessage:`Optional git error surfaced to the agent.`}},{id:`threadOperationSquashMergeCommitFailureFollowUp`,body:`{{#if prepCommitMergeBaseBranch}}
2861
- Squash merge to {{prepCommitMergeBaseBranch}} could not create the prep commit. Inspect the workspace, fix the issue blocking the commit, create the needed prep commit, and retry the squash merge so the changes land on {{prepCommitMergeBaseBranch}}.
2862
- {{/if}}
2863
- {{#if squashCommitMergeBaseBranch}}
2864
- Squash merge to {{squashCommitMergeBaseBranch}} applied changes but failed while creating the squash commit. Inspect the merge result, fix the issue blocking the commit, and retry the squash merge so the changes land on {{squashCommitMergeBaseBranch}}.
2865
- {{/if}}
2866
- {{#if errorMessage}}
2867
- Git reported: {{errorMessage}}.
2868
- {{/if}}`,fileName:`thread-operation-squash-merge-commit-failure-follow-up.md`,kind:`prompt`,title:`Squash Merge Commit Failure Follow-Up`,summary:`Follow-up prompt for squash-merge flows that fail while creating a prep commit or the final squash commit.`,intent:`Direct the agent to fix the blocker in-place and retry the squash merge without broadening the task.`,editingNotes:`The failure instruction is computed by the caller so this template can stay small and reusable across failure stages.`,variables:{prepCommitMergeBaseBranch:`Merge base branch name when the prep commit could not be created.`,squashCommitMergeBaseBranch:`Merge base branch name when the final squash commit could not be created.`,errorMessage:`Optional git error surfaced to the agent.`}},{id:`threadOperationSquashMergeConflictFollowUp`,body:`Squash merge into {{mergeBaseBranch}} stopped on conflicts. Rebase this branch onto {{mergeBaseBranch}}, resolve the conflicts, and retry the squash merge so the changes land on {{mergeBaseBranch}}.
2869
- {{#if conflictFiles}}
2870
- Conflicted files: {{conflictFiles}}.
2871
- {{/if}}`,fileName:`thread-operation-squash-merge-conflict-follow-up.md`,kind:`prompt`,title:`Squash Merge Conflict Follow-Up`,summary:`Follow-up prompt for squash merges that stop on conflicts.`,intent:`Tell the agent to rebase onto the merge base, resolve the conflicts, and retry the squash merge.`,editingNotes:`Keep this concise and procedural. Conflict file details are optional context and should stay additive.`,variables:{mergeBaseBranch:`Merge base branch name shown to the agent.`,conflictFiles:`Optional comma-separated file list.`}}];function sT(e){return oT.some(t=>t.id===e)}function cT(){let e=oT.map(e=>{if(!sT(e.id))throw Error(`Unknown generated template id: ${e.id}`);return[e.id,{...e,id:e.id,kind:e.kind}]});return Object.fromEntries(e)}var lT=cT(),uT=!1;function dT(){if(!uT){for(let e of Object.values(lT))aT.default.registerPartial(e.id,e.body);uT=!0}}var fT=new Map;function pT(e){let t=fT.get(e);if(t)return t;let n=aT.default.compile(lT[e].body,{noEscape:!0});return fT.set(e,n),n}function mT(e,t){return dT(),pT(e)(t).trim()}function hT(e,t){let n=t?.conflictFiles?.filter(e=>e.trim().length>0)??[];return mT(`threadOperationSquashMergeConflictFollowUp`,{mergeBaseBranch:e.options.mergeBaseBranch.trim(),conflictFiles:n.length>0?n.join(`, `):void 0})}function gT(e,t){let n=e.options.mergeBaseBranch.trim(),r=t.errorMessage?.trim()||void 0;switch(t.stage){case`prep_commit`:return mT(`threadOperationSquashMergeCommitFailureFollowUp`,{prepCommitMergeBaseBranch:n,errorMessage:r});case`squash_commit`:return mT(`threadOperationSquashMergeCommitFailureFollowUp`,{squashCommitMergeBaseBranch:n,errorMessage:r});default:return re(t.stage)}}function _T(e){return mT(`threadOperationCommitFailureFollowUp`,{errorMessage:e?.errorMessage?.trim()||void 0})}var vT=7;function yT(e){if(!(e instanceof d)||typeof e.body!=`object`||e.body===null||!(`details`in e.body))return;let t=j.safeParse(e.body.details);return t.success?t.data:void 0}function bT(e){switch(e.kind){case`commit_failed`:return e.errorMessage;case`squash_merge_conflict`:return e.conflictFiles.length>0?`Conflicts: ${e.conflictFiles.join(`, `)}`:void 0;case`squash_merge_commit_failed`:return e.errorMessage;default:return}}function xT({error:e,mergeBaseBranch:t}){let n=yT(e);if(n)switch(n.kind){case`commit_failed`:return[{type:`text`,text:_T({errorMessage:n.errorMessage})}];case`squash_merge_conflict`:return t?[{type:`text`,text:hT({action:`squash_merge`,options:{mergeBaseBranch:t}},{conflictFiles:n.conflictFiles})}]:void 0;case`squash_merge_commit_failed`:return t?[{type:`text`,text:gT({action:`squash_merge`,options:{mergeBaseBranch:t}},{stage:n.stage,errorMessage:n.errorMessage})}]:void 0;default:return}}function ST({error:e,mergeBaseBranch:t}){let n=yT(e);return{message:(n?bT(n):void 0)??Ht({error:e,fallbackMessage:`Failed to start git action.`}),askAgentInput:xT({error:e,mergeBaseBranch:t})}}function CT(e){switch(e){case`commit`:return`Commit created`;case`squash_merge`:return`Squash merge completed`;default:return e}}function wT(e){switch(e){case`commit`:return`Commit failed`;case`squash_merge`:return`Squash merge failed`;default:return e}}function TT({commitSha:e,commitSubject:t}){return`${e.slice(0,vT)} · ${t}`}function ET({response:e,toastId:t}){gt.success(CT(e.action),{id:t,description:TT({commitSha:e.commitSha,commitSubject:e.commitSubject})})}function DT({action:e,error:t,mergeBaseBranch:n,onAskAgentToFix:r,threadId:i,toastId:a}){let o=ST({error:t,mergeBaseBranch:n}),s=o.askAgentInput,c=wT(e),l=o.message===c?void 0:o.message;gt.error(c,{id:a,...l?{description:l}:{},...s?{action:{label:`Ask agent to fix`,onClick:()=>r({input:s,threadId:i})}}:{}})}function OT({environment:e,requestEnvironmentAction:t,sendMessage:n,thread:r,workspaceStatus:i}){let a=K(),o=i?.workingTree,s=i?.mergeBase,c=r?.type!==`manager`,l=r?.archivedAt!=null,u=e?.managed===!1,d=(0,q.useMemo)(()=>{if(!r||!c||!i||l)return[];let t=[],n=o?.hasUncommittedChanges===!0,a=s?.hasCommittedUnmergedChanges===!0;return u?(n&&t.push({target:{kind:`commit`},label:`Commit`}),t):(e?.managed&&(n&&t.push({target:{kind:`commit`},label:`Commit`}),(n||a)&&t.push({target:{kind:n?`commit_and_squash_merge`:`squash_merge`},label:`Squash merge`})),t)},[c,e?.managed,l,u,r,s?.hasCommittedUnmergedChanges,i,o?.hasUncommittedChanges]),f=(0,q.useCallback)(async({input:e,threadId:t})=>{if(n.isPending)return;let r=gt.loading(`Sending message...`);try{await n.mutateAsync({id:t,input:e,mode:`auto`}),gt.success(`Message sent to agent`,{id:r})}catch(e){gt.error(`Failed to message agent`,{id:r,description:Ht({error:e,fallbackMessage:`Message was not sent.`})})}},[n]);return{handleAskAgentToFixGitAction:f,handleCommitThread:(0,q.useCallback)(async()=>{let e=r?.environmentId;if(!r||!e)return;let n=r.id,i=gt.loading(`Creating commit...`);try{let n=await t.mutateAsync({id:e,action:`commit`});if(n.action!==`commit`)throw Error(`Expected commit action response.`);ET({response:n,toastId:i})}catch(e){DT({action:`commit`,error:e,onAskAgentToFix:e=>void f(e),threadId:n,toastId:i})}},[f,t,r]),handleSquashMergeThread:(0,q.useCallback)(async({mergeBaseBranch:e})=>{let n=r?.environmentId;if(!r||!n)return;let i=r.id,a=gt.loading(`Squash merging...`);try{let r=await t.mutateAsync({id:n,action:`squash_merge`,options:{mergeBaseBranch:e}});if(r.action!==`squash_merge`)throw Error(`Expected squash merge action response.`);ET({response:r,toastId:a})}catch(t){DT({action:`squash_merge`,error:t,onAskAgentToFix:e=>void f(e),mergeBaseBranch:e,threadId:i,toastId:a})}},[f,t,r]),isThreadGitActionPending:t.isPending,threadGitActionDialog:a,threadHeaderGitActions:d}}function kT({markThreadRead:e,thread:t}){let n=(0,q.useRef)(new Set);(0,q.useEffect)(()=>{if(!t||Mt(t))return;let r=`${t.id}:${t.latestAttentionAt}`;n.current.has(r)||(n.current.add(r),e.mutate(t.id,{onError:()=>{n.current.delete(r)}}))},[e,t])}var AT={autoScroll:!1,placement:null};function jT({routeThreadId:e,threadId:t,threadType:n,useStandardManagerTimeline:r}){return t===void 0||n===void 0||e!==t?!1:!(n===`manager`&&r)}function MT({lastReadAt:e,latestAttentionAt:t}){return e===void 0||t===void 0?!1:e===null||e<t}function NT(e){return e.lastReadAt===null?{kind:`before-first`}:e.lastReadAt<e.latestAttentionAt?{kind:`after-cutoff`,cutoffAt:e.lastReadAt}:null}function PT({routeThreadId:e,thread:t,useStandardManagerTimeline:n}){let[r,i]=(0,q.useState)(null),a=(0,q.useRef)(null),o=t?.id,s=t?.lastReadAt,c=t?.latestAttentionAt,l=t?.type;return(0,q.useEffect)(()=>{if(o===void 0||s===void 0||c===void 0||l===void 0||!jT({routeThreadId:e,threadId:o,threadType:l,useStandardManagerTimeline:n})){a.current=null,i(null);return}let t=a.current!==o;a.current=o;let r={id:o,lastReadAt:s,latestAttentionAt:c,type:l};i(e=>{if(e?.threadId===o&&e.attentionAt===c)return s===null?{attentionAt:c,autoScroll:e.placement!==null&&e.autoScroll,placement:{kind:`before-first`},threadId:o}:e;let n=NT(r);return{attentionAt:c,autoScroll:t&&n!==null,placement:n,threadId:o}})},[e,o,s,c,l,n]),!jT({routeThreadId:e,threadId:o,threadType:l,useStandardManagerTimeline:n})||r===null||r.threadId!==o||r.attentionAt!==c&&!MT({lastReadAt:s,latestAttentionAt:c})?AT:{autoScroll:r.autoScroll&&r.placement!==null,placement:r.placement}}function FT({managerTimelineView:e,threadId:t}){return`${t}:${e??`default`}`}function IT({latestRows:e,olderCursor:t,surfaceKey:n}){return{olderCursor:t,rows:[...e],surfaceKey:n}}function LT({left:e,right:t}){return e===null||t===null?e===t:e.anchorSeq===t.anchorSeq&&e.anchorId===t.anchorId}function RT(e,t){let n=new Set(e.map(e=>e.id));for(let r of t)n.has(r.id)||(n.add(r.id),e.push(r))}function zT({loadedRows:e,olderRows:t}){let n=[];return RT(n,t),RT(n,e),n}function BT({latestRows:e,loadedRows:t}){if(t.length===0)return{hasLatestOverlap:!1,rows:[...e]};let n=new Set(e.map(e=>e.id)),r=t.findIndex(e=>n.has(e.id));if(r===-1){let n=[...t];return RT(n,e),{hasLatestOverlap:!1,rows:n}}return{hasLatestOverlap:!0,rows:[...t.slice(0,r),...e]}}function VT({current:e,latestTimeline:t,surfaceKey:n}){if(e.surfaceKey!==n||e.rows.length===0&&e.olderCursor===null)return IT({latestRows:t.rows,olderCursor:t.timelinePage.olderCursor,surfaceKey:n});let r=BT({latestRows:t.rows,loadedRows:e.rows});return{...e,olderCursor:e.olderCursor,rows:r.rows}}function HT({current:e,latestTimeline:t,surfaceKey:n}){if(e.surfaceKey!==n)return IT({latestRows:t.rows,olderCursor:t.timelinePage.olderCursor,surfaceKey:n});let r=BT({latestRows:t.rows,loadedRows:e.rows});return{olderCursor:t.timelinePage.olderCursor,rows:r.rows,surfaceKey:n}}function UT(e){return e instanceof d&&e.status===400&&e.code===`invalid_request`}function WT({managerTimelineView:e,threadId:t}){let n=De(t,{refetchOnMount:!0,managerTimelineView:e}),r=FT({managerTimelineView:e,threadId:t}),[i,a]=(0,q.useState)(()=>IT({latestRows:[],olderCursor:null,surfaceKey:r})),[o,s]=(0,q.useState)(!1),c=n.data;(0,q.useEffect)(()=>{if(!c){a(e=>e.surfaceKey===r?e:IT({latestRows:[],olderCursor:null,surfaceKey:r}));return}a(e=>VT({current:e,latestTimeline:c,surfaceKey:r}))},[c,r]);let l=n.refetch,u=i.surfaceKey===r?i.olderCursor:null,d=u!==null,f=(0,q.useCallback)(async()=>{if(!(!u||!t||o)){s(!0);try{let n=await F({beforeCursor:u,id:t,managerTimelineView:e});a(e=>e.surfaceKey===r?{olderCursor:LT({left:e.olderCursor,right:u})?n.timelinePage.olderCursor:e.olderCursor,rows:zT({loadedRows:e.rows,olderRows:n.rows}),surfaceKey:r}:e)}catch(e){if(!(e instanceof Error)||!UT(e))throw e;let t=(await l()).data??c;a(e=>e.surfaceKey===r?t?HT({current:e,latestTimeline:t,surfaceKey:r}):{...e,olderCursor:null}:e)}finally{s(!1)}}},[o,c,e,u,l,r,t]);return{activeThinking:c?.activeThinking??null,contextWindowUsage:c?.contextWindowUsage,hasOlderTimelineRows:d,isLoadingOlderTimelineRows:o,loadOlderTimelineRows:f,pendingTodos:c?.pendingTodos??null,timelineError:n.error,timelineLoading:n.isLoading,timelineRows:i.surfaceKey===r&&i.rows.length>0?i.rows:c?.rows??[]}}function GT(e){if(!e.rootPath||!e.canOpenPreferredTarget)return;let t=e.rootPath;return n=>{e.openInPreferredTarget({lineNumber:null,path:qt({path:n,rootPath:t})})}}function KT(e){return e.file.status===`A`||e.file.status===`??`?{kind:`preview`,source:{kind:`working-tree`},statusLabel:null}:e.file.status===`D`?e.section.kind===`committed`?e.section.mergeBaseRef?{kind:`preview`,source:{kind:`merge-base`,ref:e.section.mergeBaseRef},statusLabel:`deleted`}:{kind:`diff`}:{kind:`preview`,source:{kind:`head`},statusLabel:`deleted`}:{kind:`diff`}}function qT(e){return e.threadEnvironmentIsLocal?e.environment?.path??null:null}function JT(e){return!e.canOpenWorkspace||!e.hasWorkspaceOpenTargets?null:qT({environment:e.environment,threadEnvironmentIsLocal:e.threadEnvironmentIsLocal})}var YT=`Thread file links are only available when the thread has an environment.`,XT=`Thread file links must use absolute file paths.`;function ZT(e){return In.some(t=>We(t,e)!==null)}function QT(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(!(n.length===0||n===`.`)){if(n===`..`){t.length>0&&t.pop();continue}t.push(n)}return t.length===0?`/`:`/${t.join(`/`)}`}function $T(e){let t=QT(e.workspaceRootPath);if(!t)return null;let n=QT(e.linkPath);return!n||!eE({candidatePath:n,workspaceRootPath:t})||n===t?null:{path:n,relativePath:t===`/`?n.slice(1):n.slice(t.length+1),workspaceRootPath:t}}function eE(e){return e.workspaceRootPath===`/`?e.candidatePath.startsWith(`/`):e.candidatePath===e.workspaceRootPath||e.candidatePath.startsWith(`${e.workspaceRootPath}/`)}function tE(e){if(ZT(e.link.path))return{kind:`app-route`};let t=QT(e.link.path);if(!t)return{description:XT,kind:`error`};let n=e.workspaceRootPath===null?null:$T({linkPath:t,workspaceRootPath:e.workspaceRootPath});return n?{kind:`open-workspace-path`,request:{lineNumber:e.link.lineNumber,path:n.path,relativePath:n.relativePath,workspaceRootPath:n.workspaceRootPath}}:e.hostFileLinksAvailable?{kind:`open-host-path`,request:{lineNumber:e.link.lineNumber,path:t}}:{description:YT,kind:`error`}}var nE=200,rE=3;function iE({title:e}){let t=e.trim();if(!t)return null;let n=aE({title:t});return n===null?t.slice(0,nE):sE({path:n.path}).slice(0,nE)}function aE({title:e}){let t=/^[^@\s:]+@[^:\s]+:(.+)$/u.exec(e)?.[1];return!t||!oE({path:t})?null:{path:t}}function oE({path:e}){return e===`~`||e===`.`||e.startsWith(`~/`)||e.startsWith(`/`)||e.startsWith(`./`)}function sE({path:e}){if(e===`/`||e===`~`||e===`.`)return e;let t=e.split(`/`).filter(e=>e.length>0);return t.length<=rE?e:`.../${t.slice(-rE).join(`/`)}`}var cE=100,lE=30,uE=[],dE=250;function fE(e){return e.status!==`exited`}function pE(e,t){return t&&e.some(e=>e.id===t)?t:e[0]?.id??null}function mE(e){switch(e.status){case`starting`:return`starting`;case`running`:return`running`;case`disconnected`:return`disconnected`;case`exited`:return`exited`}}function hE({canCreateTerminal:e,threadId:t}){let n=ii(t),r=ai(t),i=oi(t),a=BC(t),o=VC(t),s=HC(t),c=(0,q.useRef)(new Set),l=(0,q.useRef)(new Set),u=(0,q.useRef)(n.isOpen),d=(0,q.useRef)(null),f=(0,q.useRef)(null),[p,m]=(0,q.useState)(!1),h=Ki(t,{enabled:n.isOpen}),g=qi(),_=Yi(),v=Ji(),y=h.data?.sessions??uE,b=(0,q.useMemo)(()=>y.filter(fE),[y]),x=(0,q.useMemo)(()=>pE(b,a),[a,b]),S=b.find(e=>e.id===x)??null;(0,q.useEffect)(()=>{a!==x&&o(x)},[a,x,o]),(0,q.useEffect)(()=>{let e=u.current;if(u.current=n.isOpen,!n.isOpen){m(!1);return}e||m(!0)},[n.isOpen]),(0,q.useEffect)(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);let C=(0,q.useCallback)(()=>{!e||g.isPending||g.mutate({threadId:t,cols:cE,rows:lE},{onSuccess:e=>{o(e.id)}})},[e,g,o,t]);(0,q.useEffect)(()=>{if(p){if(!n.isOpen||!e||h.error){m(!1);return}if(!(g.isPending||h.isLoading)){if(b.length>0){m(!1);return}m(!1),C()}}},[e,g.isPending,n.isOpen,p,C,h.error,h.isLoading,b.length]),(0,q.useEffect)(()=>{if(!n.isOpen)for(let e of b)e.lastUserInputAt!==null||c.current.has(e.id)||l.current.has(e.id)||(l.current.add(e.id),_.mutate({mode:`if-clean`,threadId:t,terminalId:e.id},{onSuccess:e=>{e.status===`exited`&&(c.current.delete(e.id),s(e.id))},onSettled:()=>{l.current.delete(e.id)}}))},[_,n.isOpen,s,t,b]);let w=(0,q.useCallback)(()=>{C()},[C]),T=(0,q.useCallback)(e=>{o(e),r(e=>({...e,isOpen:!0}))},[o,r]),E=(0,q.useCallback)(e=>{_.mutate({mode:`force`,threadId:t,terminalId:e},{onSuccess:()=>{c.current.delete(e),l.current.delete(e),s(e)}})},[_,s,t]),D=(0,q.useCallback)(()=>{x&&c.current.add(x)},[x]),O=(0,q.useCallback)(e=>{if(!S||S.status!==`running`)return;let n=iE({title:e});if(!n||n===S.title)return;let r={terminalId:S.id,title:n},i=d.current;i!==null&&i.terminalId===r.terminalId&&i.title===r.title||(d.current=r,f.current!==null&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>{f.current=null,v.mutate({threadId:t,terminalId:r.terminalId,title:r.title},{onSettled:()=>{let e=d.current;e!==null&&e.terminalId===r.terminalId&&e.title===r.title&&(d.current=null)}})},dE))},[S,v,t]),k=(0,q.useCallback)(()=>{i(!1)},[i]),A=g.isPending||e&&n.isOpen&&p,j=A?`Starting terminal...`:`No terminals`,M=A?e?`Starting terminal...`:`Terminals unavailable.`:`No terminals`,N=h.isLoading||b.length===0&&A;return{activeSession:S,activeTerminalId:x,canCreateTerminal:e,closingTerminalId:_.isPending&&_.variables?_.variables.terminalId:null,emptyTerminalMessage:j,handleActiveTerminalTitleChange:O,handleActiveTerminalUserInput:D,handleClosePanel:k,handleCloseTerminal:E,handleCreateTerminal:w,handleSelectTerminal:T,hasTerminalQueryError:h.error!==null,isCreateTerminalPending:g.isPending,isPanelOpen:n.isOpen,isTerminalQueryLoading:h.isLoading,showTerminalPlaceholders:N,terminalBodyMessage:M,threadId:t,visibleSessions:b}}function gE({terminalId:e,threadId:t}){return`/ws/threads/${encodeURIComponent(t)}/terminals/${encodeURIComponent(e)}`}function _E(e){let t=gE(e);if(typeof __BB_DEV_WS_URL__==`string`){let e=new URL(__BB_DEV_WS_URL__);return e.pathname=t,e.search=``,e.hash=``,e.toString()}return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${t}`}var vE=`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace`;function yE(e,t){let n=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(n)return e.style.color=n,getComputedStyle(e).color}function bE(){if(typeof document>`u`)return{};let e=document.createElement(`span`);e.style.position=`absolute`,e.style.visibility=`hidden`,e.style.pointerEvents=`none`,document.body.appendChild(e);let t=t=>yE(e,t),n={background:t(`--background`),foreground:t(`--foreground`),cursor:t(`--foreground`),cursorAccent:t(`--background`),selectionBackground:t(`--muted`),black:t(`--ansi-0`),red:t(`--ansi-1`),green:t(`--ansi-2`),yellow:t(`--ansi-3`),blue:t(`--ansi-4`),magenta:t(`--ansi-5`),cyan:t(`--ansi-6`),white:t(`--ansi-7`),brightBlack:t(`--ansi-8`),brightRed:t(`--ansi-9`),brightGreen:t(`--ansi-10`),brightYellow:t(`--ansi-11`),brightBlue:t(`--ansi-12`),brightMagenta:t(`--ansi-13`),brightCyan:t(`--ansi-14`),brightWhite:t(`--ansi-15`)};return e.remove(),n}function xE(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}function SE(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return new TextDecoder().decode(n)}function CE({socket:e,terminal:t}){e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:`resize`,cols:t.cols,rows:t.rows}))}function wE({containerElement:e,entries:t}){let n=t?.[0],r=n?.contentRect.width??e.clientWidth,i=n?.contentRect.height??e.clientHeight;return r>0&&i>0}function TE({terminal:e,text:t}){e.write(`\r\n\x1b[2m${t}\x1b[0m\r\n`)}function EE({isReplay:e,replayWriteState:t,terminal:n,text:r}){if(!e){n.write(r);return}t.suppressedWriteCount+=1,n.write(r,()=>{--t.suppressedWriteCount})}function DE({message:e,replayNextSeq:t,replayWriteState:n,setReplayNextSeq:r,terminal:i}){switch(e.type){case`attached`:r(e.nextSeq);return;case`pong`:case`session-updated`:return;case`output`:EE({isReplay:t!==null&&e.chunk.seq<t,replayWriteState:n,terminal:i,text:SE(e.chunk.dataBase64)});return;case`error`:TE({terminal:i,text:`Terminal error: ${e.message}`});return;case`exited`:TE({terminal:i,text:e.session.exitCode===null?`Terminal exited`:`Terminal exited with code ${e.session.exitCode}`});return}}function OE({isPanelOpen:e,onTitleChange:t,onUserInput:n,session:r,threadId:i}){let a=(0,q.useRef)(null),o=(0,q.useRef)(null),s=(0,q.useRef)(t),c=(0,q.useRef)(n),l=(0,q.useRef)(e),u=(0,q.useRef)(null),d=Ft();return l.current=e,s.current=t,c.current=n,(0,q.useEffect)(()=>{let e=a.current;if(!e)return;let t=!1,n=null,d=null,f=null,p=null,m={suppressedWriteCount:0},h=null,g=null;async function _(e){let[{Terminal:a},{FitAddon:_},{WebLinksAddon:v}]=await Promise.all([He(()=>import(`./xterm-DGJHbKBQ.js`),[]),He(()=>import(`./addon-fit-Cm0rqjtv.js`),[]),He(()=>import(`./addon-web-links-B8_D6zvC.js`),[])]);if(t)return;d=new a({allowProposedApi:!1,convertEol:!0,cursorBlink:!0,fontFamily:vE,fontSize:12,scrollback:1e4,theme:bE()}),o.current=d,f=new _,d.loadAddon(f),d.loadAddon(new v),d.open(e);let y=()=>{!f||!d||wE({containerElement:e})&&(f.fit(),n&&CE({socket:n,terminal:d}))},b=()=>{h===null&&(h=window.requestAnimationFrame(()=>{h=null,y()}))};y(),u.current=b,l.current&&d.focus(),n=new WebSocket(_E({terminalId:r.id,threadId:i}));let x=n,S=d;x.onopen=()=>{CE({socket:x,terminal:S})},x.onmessage=e=>{if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}let n=ee.safeParse(t);n.success&&DE({message:n.data,replayNextSeq:p,replayWriteState:m,setReplayNextSeq:e=>{p=e},terminal:S})},x.onclose=()=>{t||TE({terminal:S,text:`Terminal connection closed`})},S.onData(e=>{m.suppressedWriteCount>0||x.readyState===WebSocket.OPEN&&(c.current?.(),x.send(JSON.stringify({type:`input`,dataBase64:xE(e)})))}),S.onTitleChange(e=>{m.suppressedWriteCount>0||s.current?.(e)}),g=new ResizeObserver(t=>{wE({containerElement:e,entries:t})&&b()}),g.observe(e)}return _(e).catch(n=>{t||(e.textContent=n instanceof Error?n.message:String(n))}),()=>{t=!0,h!==null&&window.cancelAnimationFrame(h),g?.disconnect(),n?.close(),d?.dispose(),o.current=null,u.current=null}},[r.id,i]),(0,q.useEffect)(()=>{e&&(o.current?.focus(),u.current?.())},[e]),(0,q.useEffect)(()=>{let e=o.current;e&&(e.options.theme=bE())},[d]),(0,J.jsx)(`div`,{className:`h-full min-h-0 w-full overflow-hidden bg-background p-2`,children:(0,J.jsx)(`div`,{ref:a,className:`h-full min-h-0 w-full overflow-hidden`})})}function kE({controller:e}){return e.hasTerminalQueryError?(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-sm text-destructive`,children:`Failed to load terminals.`}):e.activeSession?e.activeSession.status===`running`?(0,J.jsx)(OE,{isPanelOpen:e.isPanelOpen,onTitleChange:e.handleActiveTerminalTitleChange,onUserInput:e.handleActiveTerminalUserInput,session:e.activeSession,threadId:e.threadId}):(0,J.jsxs)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-sm text-muted-foreground`,children:[`Terminal `,mE(e.activeSession),`.`]}):(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-sm text-muted-foreground`,children:e.terminalBodyMessage})}function AE({controller:e}){return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-x-auto`,role:`tablist`,"aria-label":`Terminal sessions`,children:[e.isTerminalQueryLoading?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(kn,{className:`h-6 w-28 shrink-0 rounded-md`}),(0,J.jsx)(kn,{className:`h-6 w-24 shrink-0 rounded-md`})]}):e.visibleSessions.length>0?e.visibleSessions.map(t=>(0,J.jsx)(jE,{session:t,isActive:t.id===e.activeTerminalId,isClosing:e.closingTerminalId===t.id,onSelect:()=>e.handleSelectTerminal(t.id),onClose:()=>e.handleCloseTerminal(t.id)},t.id)):e.showTerminalPlaceholders?(0,J.jsx)(`p`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.emptyTerminalMessage}):null,(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0 rounded-md p-0 text-muted-foreground`,disabled:!e.canCreateTerminal||e.isCreateTerminalPending,onClick:e.handleCreateTerminal,"aria-label":`New terminal`,title:`New terminal`,children:e.isCreateTerminalPending?(0,J.jsx)(H,{name:`Spinner`,className:`size-3.5 animate-spin`}):(0,J.jsx)(H,{name:`Plus`,className:`size-3.5`})})]})}function jE({isActive:e,isClosing:t,onClose:n,onSelect:r,session:i}){let a=mE(i);return(0,J.jsx)(ya,{label:i.title,secondaryLabel:i.status===`running`?null:a,title:`${i.title} (${a})`,isActive:e,onSelect:r,closeAction:{onClose:n,closeLabel:`Close ${i.title}`,closeTooltip:`Close terminal`,isClosing:t}})}function ME({canCreateTerminal:e,threadId:t}){let n=hE({canCreateTerminal:e,threadId:t});return(0,J.jsxs)(`section`,{"aria-label":`Thread terminals`,className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,J.jsxs)(`div`,{className:`flex h-10 min-h-10 items-center gap-2 bg-background px-3`,children:[(0,J.jsx)(AE,{controller:n}),(0,J.jsx)(P,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0 rounded-md p-0 text-muted-foreground`,onClick:n.handleClosePanel,"aria-label":`Close terminal panel`,title:`Close terminal panel`,children:(0,J.jsx)(H,{name:`X`,className:`size-3.5`})})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden bg-background`,children:(0,J.jsx)(kE,{controller:n})})]})}function NE({fixedPanelTabsState:e}){let t=e.secondary.activeTabId;return t===null?null:e.secondary.tabs.find(e=>e.id===t)??null}function PE(e){if(e===null)return null;switch(e.kind){case`thread-info`:return`thread-info`;case`git-diff`:return`git-diff`;case`workspace-file-preview`:case`host-file-preview`:case`thread-storage-file-preview`:case`new-tab`:return`thread-info`;case`terminal`:return null}}function FE({activeFixedSecondaryTab:e}){return PE(e)}function IE({fixedPanelTabsState:e,selectedSecondaryPanel:t}){return e.secondary.isOpen?t:null}function LE(e){let t=LC(e),n=IC(e);return(0,q.useCallback)(e=>{if(e===null){t();return}n(e)},[t,n])}function RE(e){return RC(e)}var zE=[];function BE(e){let t=e.runtime.displayStatus;return t!==`host-reconnecting`&&t!==`waiting-for-host`?null:{label:t===`host-reconnecting`?`Host daemon disconnected. Waiting for reconnection...`:`Host daemon disconnected`,tone:t===`host-reconnecting`?`pending`:`error`}}function VE(){let{projectId:e,threadId:t}=Be();MC(t),ri(t);let n=NC(t),r=ii(t),i=NE({fixedPanelTabsState:n}),a=FE({activeFixedSecondaryTab:i}),o=IE({fixedPanelTabsState:n,selectedSecondaryPanel:a}),s=ue(),l=FC(t),u=LE(t),d=RE(t);zC(t,(0,q.useCallback)(e=>{u(e)},[u]));let f=Ae(t??``),p=f.isSuccess||f.isError,m=si(t),h=ai(t),{data:g,isFetching:_,isLoadingError:v,error:y}=Me(t??``,{enabled:p,refetchOnMount:f.isSuccess?!0:`always`}),b=Mn({hasResolvedData:g!==void 0,isFetching:f.isFetching||_,isLoadingError:v}),x=Oe(g?.id??``,{enabled:b.status===`ready`&&!!g?.id,environmentId:g?.environmentId??void 0,providerId:g?.providerId??void 0}),S=x.isSuccess||x.isError,C=x.isSuccess?1e4:void 0,{data:w}=Me(g?.parentThreadId??``),{data:T=[]}=Ce(g?.id??``,{enabled:S,refetchOnMount:x.isSuccess?!1:`always`,staleTime:C}),E=Pe(T)!==null,D=g?.type===`manager`,O=g?.type===`standard`,[A,j]=mr(),M=D&&A,N=M?`standard`:void 0,P=PT({routeThreadId:t,thread:g,useStandardManagerTimeline:M}),[F,I]=(0,q.useState)(!1),[L,R]=(0,q.useState)(0),{isThreadStorageFilesLoading:ee,threadStorageFiles:te,threadStorageFilesError:ne,threadStorageRootPath:re}=Qx({activePath:null,fileListEnabled:o!==null&&D,filePreviewEnabled:!1,threadId:t,threadType:g?.type}),{activateNewTab:z,activateHostFileTab:B,activateStorageFileTab:V,activateWorkspaceFileTab:ae,activeHostFileLineNumber:oe,activeHostFilePath:H,activeStorageFilePath:se,activeWorkspaceFileLineNumber:ce,activeWorkspaceFilePath:le,activeWorkspaceFileSource:de,activeWorkspaceFileStatusLabel:fe,clearActiveFileTabs:pe,closeHostFileTab:me,closeNewTab:U,closeStorageFileTab:he,closeWorkspaceFileTab:ge,isNewTabActive:_e,openNewTab:Se,openHostFile:we,openStorageFile:Te,openWorkspaceFile:Ee,orderedSecondaryFileTabs:De,pinnedStorageFilePath:ke,selectFileSearchResult:je}=dw({threadId:t,environmentId:g?.environmentId,threadType:g?.type,storageFiles:te?.files}),Ne=_S({files:te?.files,onSelectPath:Te,selectedPath:se}),Fe=(0,q.useCallback)(()=>{if(n.secondary.isOpen){u(null);return}if(D&&i===null){Te(ke);return}d()},[i,n.secondary.isOpen,D,Te,ke,u,d]),Ie=(0,q.useCallback)(e=>{D&&j(e)},[D,j]),Le=bx(g),Re=b.status===`ready`&&Le,ze=xe({archived:!1,projectId:e,type:`manager`},{enabled:Re}).data??zE,{activeThinking:Ve,contextWindowUsage:He,hasOlderTimelineRows:Ue,isLoadingOlderTimelineRows:We,loadOlderTimelineRows:Ge,pendingTodos:Ke,timelineError:qe,timelineLoading:Je,timelineRows:Ye}=WT({managerTimelineView:N,threadId:t??``}),G=nr(),Xe=Jn(),Ze=ye(),Qe=rr(),$e=be(),et=ct(ft),tt=Ki(t??``,{enabled:et}),nt=(0,q.useMemo)(()=>tt.data?.sessions.filter(e=>e.status!==`exited`).length??0,[tt.data]),rt=(0,q.useMemo)(()=>g?BE(g):null,[g]),it=mi(g?.environmentId,{enabled:p,staleTime:5e3}),K=it.data,at=xn({projectId:e??``,environmentId:g?.environmentId??``}),ot=c(K),{closeThreadSecondaryPanel:st,defaultMergeBaseBranch:ut,isLoadingMergeBaseBranchOptions:dt,mergeBaseBranchOptions:pt,openDiffFile:mt,openThreadDiffPanel:vt,openThreadSecondaryPanel:yt,selectedMergeBaseBranch:bt,setSelectedMergeBaseBranch:xt}=aa({activeSecondaryPanel:o,clearActiveFileTabs:pe,defaultMergeBaseBranch:ot,environmentId:O?g?.environmentId??void 0:void 0,mergeBaseBranchOptionsEnabled:F,setThreadSecondaryPanel:u}),{closePanel:St,isOpen:Ct,openDiffFile:wt,openDiffPanel:Tt,openPanel:Et,togglePanel:Ot}=Zx({closePersistedPanel:st,isPersistedOpen:n.secondary.isOpen,isCompactViewport:s,openPersistedDiffFile:mt,openPersistedDiffPanel:vt,openPersistedPanel:yt,threadId:t,togglePersistedPanel:Fe});(0,q.useEffect)(()=>{I(!1)},[g?.environmentId]);let kt=(0,q.useCallback)(e=>{e&&I(!0)},[]),At=(0,q.useCallback)(e=>{pe(),Et(e)},[pe,Et]),jt=(0,q.useCallback)(()=>{l()},[l]),Mt=(0,q.useCallback)(()=>{Se(),R(e=>e+1)},[Se]),Nt=(0,q.useCallback)(e=>{let t=Math.round(e);h(e=>e.panelHeightPercent===t?e:{...e,panelHeightPercent:t})},[h]),Pt=(0,q.useCallback)(e=>{let t=KT(e);if(t.kind===`preview`){Ee({lineNumber:null,path:e.file.path,source:t.source,statusLabel:t.statusLabel});return}wt(e.file.path)},[wt,Ee]),Ft=(0,q.useMemo)(()=>{let e=e=>e.split(`/`).at(-1)??e,t=De.map(t=>{switch(t.kind){case`workspace-file-preview`:return{id:t.id,filename:e(t.path),isActive:t.path===le,statusLabel:t.statusLabel,onSelect:()=>ae(t.path),onClose:()=>ge(t.path)};case`host-file-preview`:return{id:t.id,filename:e(t.path),isActive:t.path===H,statusLabel:null,onSelect:()=>B(t.path),onClose:()=>me(t.path)};case`thread-storage-file-preview`:return{id:t.id,filename:e(t.path),isActive:t.path===se,isPinned:t.isPinned,statusLabel:null,onSelect:()=>V(t.path),onClose:()=>he(t.path)};case`new-tab`:return{id:t.id,filename:`New tab`,isActive:_e,statusLabel:null,onSelect:z,onClose:U}}});return t.length>0?t:void 0},[z,B,V,ae,H,se,le,me,U,he,ge,_e,De]),It=bt??ot,Lt=hi(g?.environmentId,It,{enabled:O&&K!==void 0}),Rt=Lt.data,zt=Lt.error,Vt=zt?void 0:Rt??void 0,Ht=Vt?.branch,Ut=(0,q.useMemo)(()=>wi(Vt),[Vt]),Wt=(0,q.useMemo)(()=>Ut===null||Ut.kind===`committed`?null:Ut,[Ut]),{isLocalHost:Gt}=lt(),Kt=K?Gt(K.hostId):!1,qt=qT({environment:K,threadEnvironmentIsLocal:Kt}),{canOpenPreferredTarget:Jt,openPathInPreferredTarget:Yt,openPathInTarget:Xt,preferredTarget:Zt,workspaceOpenTargets:Qt}=Hi({enabled:Kt}),$t=f.isSuccess&&f.data.environment!==void 0&&f.data.environment!==null&&f.data.host===null,{data:en}=W(K?.hostId,{enabled:!$t}),tn=xe({archived:!1,projectId:e,parentThreadId:g?.id},{enabled:D&&!!g?.id}),nn=(0,q.useMemo)(()=>{if(!g?.parentThreadId)return null;let t=`/projects/${e}/threads/${g.parentThreadId}`;return w===void 0?{managerName:`Manager ${g.parentThreadId.slice(0,8)}`,href:t}:w.type!==`manager`||w.archivedAt!==null||w.deletedAt!==null||w.projectId!==g.projectId?null:{managerName:ve(w),href:t}},[w,e,g?.parentThreadId,g?.projectId]),rn=(0,q.useMemo)(()=>{if(!D)return null;let t=(tn.data??[]).filter(e=>Ga(e.runtime.displayStatus)).map(t=>({id:t.id,title:ve(t),href:`/projects/${e}/threads/${t.id}`}));return t.length===0?null:{items:t}},[D,tn.data,e]),an=Je&&Ye.length===0,{erroredTurnSummaryIds:on,handleLoadTurnSummaryRows:sn,loadingTurnSummaryIds:cn,turnSummaryRowsById:ln}=ha({managerTimelineView:N,timelineRows:Ye,threadId:t});kT({markThreadRead:Ze,thread:g});let{effectiveMergeBaseBranch:un,handleMergeBaseBranchChange:dn,showBranchComparisonUi:fn,showMergeBase:pn,mergeBaseBranch:mn}=_w({environment:K,mergeBaseBranchOptions:pt,selectedMergeBaseBranch:bt,setSelectedMergeBaseBranch:xt,thread:g,updateEnvironment:Qe,workspaceStatus:Vt}),hn=OT({environment:K,requestEnvironmentAction:Xe,sendMessage:G,thread:g,workspaceStatus:Vt}),gn=g?.parentThreadId,_n=w?.title&&w.title.trim().length>0?w.title:gn,vn=(0,q.useMemo)(()=>xx({currentThreadId:g?.id,isManagerThread:D,managerThreads:ze,parentThreadDisplayName:_n,parentThreadId:gn}),[D,ze,_n,gn,g?.id]),yn=(0,q.useCallback)(e=>{!g||$e.isPending||$e.mutate({id:g.id,parentThreadId:e})},[g,$e]),bn=(0,q.useCallback)(e=>{let t=tE({hostFileLinksAvailable:g?.environmentId!==null&&g?.environmentId!==void 0,link:e,workspaceRootPath:qt});return t.kind===`app-route`?!1:t.kind===`error`?(gt.error(`Failed to open file locally`,{description:t.description}),!0):t.kind===`open-workspace-path`?(Ee({lineNumber:t.request.lineNumber,path:t.request.relativePath,source:{kind:`working-tree`},statusLabel:null}),!0):(we({lineNumber:t.request.lineNumber,path:t.request.path}),!0)},[qt,we,Ee,g?.environmentId]),Sn=(0,q.useCallback)(e=>{switch(e.kind){case`open-file-diff`:return D?null:()=>{wt(e.path)};default:return er(e.kind)}},[D,wt]);if(!e||!t)return(0,J.jsx)(ie,{contentClassName:`min-h-full items-center justify-center`,children:(0,J.jsx)(`p`,{className:`py-12 text-center text-sm text-destructive`,children:`Not found`})});if(b.status===`loading`)return(0,J.jsx)(ie,{contentClassName:`min-h-full items-center justify-center`,children:(0,J.jsx)(`p`,{className:`py-12 text-center text-sm text-muted-foreground`,children:`Loading...`})});if(!g||g.projectId!==e)return(0,J.jsx)(ie,{contentClassName:`min-h-full items-center justify-center`,children:(0,J.jsx)(`p`,{className:`py-12 text-center text-sm text-destructive`,children:y?`Failed to load thread.`:`Not found`})});let Cn=`${g.id}:${N??`default`}`,wn=vn.some(e=>e.value!==`none`),Tn=Le&&wn,En=g.type===`standard`&&!!g.parentThreadId,Dn=K?k({environment:K,isLocalHost:Kt,hostName:en?.name}):void 0,On=Dn?Dt(Dn.workspaceDisplayKind):null,kn=K!==void 0&&(K.isWorktree||K.workspaceProvisionType===`managed-worktree`)&&e&&g.environmentId!==null?at:void 0,An=un,jn=Ht?.currentBranch??void 0,Nn=K?.status===`destroyed`,Pn=et&&g.environmentId!==null&&K?.status===`ready`,Fn=Qi(Vt,{mergeBaseBranch:mn,showBranchComparison:fn,error:zt,workspaceDeleted:Nn}),In=ve(g),Ln=(0,J.jsx)(Bt,{thread:g,triggerClassName:_t,align:`end`,viewerToggleLabel:D?`Use standard timeline`:void 0,viewerToggleChecked:D?M:void 0,onViewerToggleCheckedChange:D?Ie:void 0}),Rn=JT({canOpenWorkspace:Jt,environment:K,hasWorkspaceOpenTargets:Qt.length>0,threadEnvironmentIsLocal:Kt}),zn=Rn&&Zt?(0,J.jsx)(Ni,{preferredTarget:Zt,targets:Qt,onOpenPreferredTarget:async()=>{await Yt({lineNumber:null,path:Rn})},onOpenTarget:async e=>{await Xt({lineNumber:null,path:Rn,rememberTarget:!0,targetId:e})}}):void 0,Bn=(0,J.jsx)(_a,{actionsMenu:Ln,isManagedThread:!!gn,isManagerThread:D,isSecondaryPanelOpen:Ct,activeTerminalCount:nt,isTerminalPanelOpen:et&&r.isOpen,isThreadGitActionPending:hn.isThreadGitActionPending,onOpenThreadGitAction:hn.threadGitActionDialog.onOpen,onToggleSecondaryPanel:Ot,onToggleTerminalPanel:m,showTerminalPanelToggle:et,threadHeaderGitActions:hn.threadHeaderGitActions,threadTitle:In,workspaceOpenButton:zn}),Vn=(0,J.jsx)(Zl,{canUseGitUi:O,contextWindowUsage:He,environmentBranchName:jn,environmentHostConnected:en&&!Kt?en.status===`connected`:void 0,environmentIcon:On??void 0,environmentLabel:Dn?.modeLabel,environmentHostLabel:Dn?.location===`remote`?Dn.hostLabel??void 0:void 0,isEnvironmentActionPending:Xe.isPending,onCreateNewThreadInWorktree:kn,composerQueriesEnabled:S,composerQueriesRefetchOnMount:x.isSuccess?!1:`always`,composerQueriesStaleTime:C,onChangedFileClick:Pt,openThreadDiffPanel:Tt,projectId:e,workspaceChangedFilesSection:O?Ut:null,workspaceStatusPending:O&&(it.isLoading||Lt.isLoading),contextBannerMergeBase:O&&pn&&An?{branch:An,options:pt,optionsLoading:dt,onChange:dn,onPickerOpenChange:kt}:null,sendMessage:G,pendingInteractions:T,pendingTodos:Ke,managedBySection:nn,managerChildrenSection:rn,thread:g}),Hn=g.type===`manager`?{controller:Ne,filesError:ne,isFilesLoading:ee}:void 0,Un=GT({rootPath:qt,canOpenPreferredTarget:Jt,openInPreferredTarget:Yt}),Wn=GT({rootPath:Kt?re:null,canOpenPreferredTarget:Jt,openInPreferredTarget:Yt}),Gn=Kt&&Jt?e=>{Yt({lineNumber:oe,path:e})}:void 0,Kn=le?ht({path:le,rootPath:K?.path}):null,qn=se?ht({path:se,rootPath:re}):null,Yn=_e?(0,J.jsx)(mS,{projectId:e??void 0,environmentId:g.environmentId??null,currentThreadId:g.id,currentThreadType:g.type,focusRequest:L,onSelect:je}):le?(0,J.jsx)(ed,{activePath:le,copyPath:Kn,environmentId:g.environmentId,lineNumber:ce,onOpenInEditor:Un,source:de,statusLabel:fe}):H?(0,J.jsx)(td,{activePath:H,environmentId:g.environmentId,lineNumber:oe,onOpenInEditor:Gn,threadId:g.id}):se?(0,J.jsx)(nd,{activePath:se,copyPath:qn,isManagerThread:D,onOpenInEditor:Wn,pinnedPath:ke,threadId:g.id}):void 0;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Kx,{footer:Vn,header:Bn,isMetadataLoading:it.isLoading,isSecondaryPanelOpen:Ct,metadata:{thread:g,projectId:e,parentThreadDisplayName:_n??null,managerThreads:ze,canAssignToManager:Tn,canTakeOverThread:En,environmentHost:en??null,environmentIsLocal:Kt,environment:K??null,workspaceStatus:Vt,workspaceStatusError:zt??null,selectedMergeBaseBranch:bt,mergeBaseBranchOptions:pt,isLoadingMergeBaseBranchOptions:dt,updateThreadPending:$e.isPending||Qe.isPending,storage:Hn,onAssignManager:yn,onMergeBaseBranchChange:dn,onChangedFileClick:O?Pt:void 0},secondaryPanel:{activePanel:a,canUseGitUi:O,defaultMergeBaseBranch:ut,environmentId:g.environmentId??void 0,workspaceRootPath:K?.path,fileTabs:Ft,fileTabContent:Yn,isOpen:Ct,onClose:St,onCollapse:St,onOpenFileInEditor:Un,onOpenNewTab:Mt,onOpenFilePreview:e=>{Ee({lineNumber:null,path:e,source:{kind:`working-tree`},statusLabel:null})},onPanelFocus:jt,onPanelChange:At,showGitDiffTab:O},terminalPanel:et?(0,J.jsx)(ME,{canCreateTerminal:Pn,threadId:g.id}):void 0,terminalPanelHeightPercent:r.panelHeightPercent,terminalPanelOpen:et&&r.isOpen,onTerminalPanelResize:Nt,timeline:{activeThinking:Ve,hasOlderTimelineRows:Ue,hostConnectionNotice:rt,isLoadingOlderTimelineRows:We,isThreadTimelinePending:an,timelineError:!!qe,loadingTurnSummaryIds:cn,erroredTurnSummaryIds:on,onLoadOlderRows:Ge,onLoadTurnSummaryRows:sn,onOpenLocalFileLink:bn,onTitleAction:Sn,projectId:e,showOngoingIndicator:g.stopRequestedAt===null&&!E&&(g.runtime.displayStatus===`active`||g.runtime.displayStatus===`host-reconnecting`)&&!an,ongoingIndicatorLabel:g.runtime.displayStatus===`host-reconnecting`?`Waiting for reconnection`:void 0,timelineRows:Ye,stopRequestedAt:g.stopRequestedAt,threadId:g.id,threadRuntimeDisplayStatus:g.runtime.displayStatus,turnSummaryRowsIdentity:Cn,turnSummaryRowsById:ln,unreadDividerAutoScroll:P.autoScroll,unreadDividerPlacement:P.placement,workspaceRootPath:K?.path??void 0}}),O?(0,J.jsx)(ki,{target:hn.threadGitActionDialog.target,branchName:jn,gitStatusDisplay:Fn,changedFilesSection:Wt,threadId:g.id,threadType:g.type,showMergeBaseDetails:fn,mergeBaseBranch:un,mergeBaseBranchOptions:pt,mergeBaseBranchOptionsLoading:dt,onMergeBaseBranchChange:fn?dn:void 0,onOpenChange:e=>{e||hn.threadGitActionDialog.onClose()},onCommit:hn.handleCommitThread,onSquashMerge:hn.handleSquashMergeThread}):null]})}var HE={workerFactory:Fr,poolSize:Pr()},UE={};function WE(){return(0,J.jsx)(hn,{poolOptions:HE,highlighterOptions:UE,children:(0,J.jsx)(VE,{})})}export{WE as default};