@p4code/cli 0.0.43 → 0.0.45
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.
- package/dist/bin.mjs +317 -177
- package/dist/client/assets/DiffPanel-PPZKQWCF.js +98 -0
- package/dist/client/assets/FilePreviewPanel-DdLy8b8b.js +1778 -0
- package/dist/client/assets/PreviewPanel-BKsstY2H.js +2 -0
- package/dist/client/assets/{angular-html-D2LtifxG.js → angular-html-BwUZQlj7.js} +2 -2
- package/dist/client/assets/{angular-ts-oVDpKJb2.js → angular-ts-8EX8ZNeQ.js} +2 -2
- package/dist/client/assets/{apl-2vnm7rdp.js → apl-DYm7AarA.js} +2 -2
- package/dist/client/assets/arrow-right-BNeeftk2.js +2 -0
- package/dist/client/assets/{astro-CDbEfI_f.js → astro-DFaFMvm9.js} +2 -2
- package/dist/client/assets/{blade-B1MwvSO0.js → blade-D9aigeeZ.js} +2 -2
- package/dist/client/assets/{c-Bi5eHJiI.js → c-BvAsa11Y.js} +2 -2
- package/dist/client/assets/{cobol-BxESWi7D.js → cobol-BZwY3--F.js} +2 -2
- package/dist/client/assets/{coffee-s151wUsp.js → coffee-vNqcHwuy.js} +2 -2
- package/dist/client/assets/{cpp-B51xjAkw.js → cpp-D3Xet0_6.js} +2 -2
- package/dist/client/assets/{crystal-BW0dq2Rw.js → crystal-D-UW0VhN.js} +2 -2
- package/dist/client/assets/{css-Czn5ycv4.js → css-B1CDNsy0.js} +2 -2
- package/dist/client/assets/{edge-DPtVbjt1.js → edge-B_geUcoi.js} +2 -2
- package/dist/client/assets/{elixir-381Dy51E.js → elixir-BzK0Ks1B.js} +2 -2
- package/dist/client/assets/{elm-Bpu_ckb9.js → elm-BvlMiaGz.js} +2 -2
- package/dist/client/assets/{erb-u1vpMXOw.js → erb-OFCHFHP8.js} +2 -2
- package/dist/client/assets/fileCommentAnnotations-BBX2usb_.js +2 -0
- package/dist/client/assets/{git-rebase-ShzdQ6mA.js → git-rebase-Xc_wijNW.js} +2 -2
- package/dist/client/assets/{glimmer-js-DI4_LeGA.js → glimmer-js-D-GpFszK.js} +2 -2
- package/dist/client/assets/{glimmer-ts-BrA1R4ia.js → glimmer-ts-_MmK7qB5.js} +2 -2
- package/dist/client/assets/{glsl--BAUZuR7.js → glsl-Cm_ctoze.js} +2 -2
- package/dist/client/assets/{graphql-XmtNe4tX.js → graphql-De_-LrEt.js} +2 -2
- package/dist/client/assets/{hack-ZPcuqt6I.js → hack-qUzK29KK.js} +2 -2
- package/dist/client/assets/{haml-BLmOYSAV.js → haml-mqyUpOBj.js} +2 -2
- package/dist/client/assets/{handlebars-BxR19vQc.js → handlebars-DS3jjsXS.js} +2 -2
- package/dist/client/assets/{html-derivative-CLJquIOq.js → html-derivative-BPRW_sHn.js} +2 -2
- package/dist/client/assets/{html-Do3TWS07.js → html-ippoHerj.js} +2 -2
- package/dist/client/assets/{http-C6M7KGrt.js → http-xrFfvFRg.js} +2 -2
- package/dist/client/assets/{hurl-AFYDoSjV.js → hurl-DSL-wjHh.js} +2 -2
- package/dist/client/assets/index-CGyzLTcp.css +1 -0
- package/dist/client/assets/index-DnkEkLTH.js +636 -0
- package/dist/client/assets/{java-DoRNyNZ_.js → java-B8xLHoVB.js} +2 -2
- package/dist/client/assets/{javascript-Dd-zEQJs.js → javascript-DkxetjtW.js} +2 -2
- package/dist/client/assets/{jinja-TJRtEusk.js → jinja-DrlmZXOI.js} +2 -2
- package/dist/client/assets/{jison-bG9mcEJe.js → jison-CBYMCWiZ.js} +2 -2
- package/dist/client/assets/{json-DY6EaQUk.js → json-aobk_LSd.js} +2 -2
- package/dist/client/assets/{jsx-BuL0_m-Z.js → jsx-BTcIKPoF.js} +2 -2
- package/dist/client/assets/{julia-4bcuyKPV.js → julia-BwUvFb1K.js} +2 -2
- package/dist/client/assets/{just-F3UNctxi.js → just-2GL8m28O.js} +2 -2
- package/dist/client/assets/{latex-DCJY-Aag.js → latex-BwWZNh8B.js} +2 -2
- package/dist/client/assets/{liquid-M906bGYJ.js → liquid-j8UWR5fn.js} +2 -2
- package/dist/client/assets/{lua-CeupCtSb.js → lua-BiEJazUk.js} +2 -2
- package/dist/client/assets/{marko-D_3SsXZn.js → marko-BrkuG9X9.js} +2 -2
- package/dist/client/assets/{mdc-DRUaGPVE.js → mdc-CbE9Gm1n.js} +2 -2
- package/dist/client/assets/{nginx-B_DJSFb0.js → nginx-C-gcDf_H.js} +2 -2
- package/dist/client/assets/{nim-BxoRFkNd.js → nim-9X20IMJZ.js} +2 -2
- package/dist/client/assets/{perl-CjLiNsGL.js → perl-Dqj-SUzY.js} +2 -2
- package/dist/client/assets/{php-DcklQON0.js → php-CQymwCam.js} +2 -2
- package/dist/client/assets/{pug-DHYHUkbl.js → pug-DIOYJ7Tj.js} +2 -2
- package/dist/client/assets/{qml-Cggn-sFR.js → qml-BpdlPbMh.js} +2 -2
- package/dist/client/assets/{r-BhkOaKoM.js → r-BdXpML7C.js} +2 -2
- package/dist/client/assets/{razor-DksRt091.js → razor-CmGIbQUz.js} +2 -2
- package/dist/client/assets/{regexp-CVeVJKpO.js → regexp-udR9FXf8.js} +2 -2
- package/dist/client/assets/{rst-B8gnyB7p.js → rst-C81pNvVo.js} +2 -2
- package/dist/client/assets/{ruby-B7aYI7EY.js → ruby-D5xBAIVx.js} +2 -2
- package/dist/client/assets/{sas-DmDsVHsr.js → sas-pegDgwhF.js} +2 -2
- package/dist/client/assets/{scss-Cf0hFbmP.js → scss-Dx_Aq9w8.js} +2 -2
- package/dist/client/assets/{shellscript-CJ2l7Ljo.js → shellscript-Bl-HTaUh.js} +2 -2
- package/dist/client/assets/{shellsession-CE-6mg0T.js → shellsession-CezqakSW.js} +2 -2
- package/dist/client/assets/{soy-eTwUOhLL.js → soy-DclELXc7.js} +2 -2
- package/dist/client/assets/{sql-DaTGJ1E1.js → sql-DAsY-zzx.js} +2 -2
- package/dist/client/assets/{stata-DCqqmU-V.js → stata-DjQ16uuy.js} +2 -2
- package/dist/client/assets/{surrealql-DJuyQLb6.js → surrealql-BLzgjzgE.js} +2 -2
- package/dist/client/assets/{svelte-DZfElFr5.js → svelte-DFGwC3eP.js} +2 -2
- package/dist/client/assets/{templ-BeuT7j1S.js → templ-BiFbdCJD.js} +2 -2
- package/dist/client/assets/{tex-CUjxQ3iG.js → tex-DQCF2PEO.js} +2 -2
- package/dist/client/assets/textarea-lBMORu4g.js +46 -0
- package/dist/client/assets/{ts-tags-C00W--Ve.js → ts-tags-CkQC6ekt.js} +2 -2
- package/dist/client/assets/{tsx-h-kXP2gA.js → tsx-m7HWHXfL.js} +2 -2
- package/dist/client/assets/{twig-DhMoAQY-.js → twig-B5P5jotH.js} +2 -2
- package/dist/client/assets/{typescript-DwJdYtiC.js → typescript-DmGwuo7e.js} +2 -2
- package/dist/client/assets/{vue-CvLnzHbi.js → vue-Rn_gU7Px.js} +2 -2
- package/dist/client/assets/{vue-html-fj2AgeR4.js → vue-html-DbKQF2OX.js} +2 -2
- package/dist/client/assets/{vue-vine-D1-Lx9ZR.js → vue-vine-C13tIrLE.js} +2 -2
- package/dist/client/assets/{xml-CDkXSKu_.js → xml-D7fQm-eG.js} +2 -2
- package/dist/client/assets/{xsl-BkotjMT0.js → xsl-Bv743my_.js} +2 -2
- package/dist/client/assets/{yaml-BssI7mmn.js → yaml--h7pPfkH.js} +2 -2
- package/dist/client/index.html +3 -3
- package/package.json +1 -1
- package/dist/client/assets/DiffPanel-D8nVXZ0Y.js +0 -98
- package/dist/client/assets/FilePreviewPanel-CFKCFyJ3.js +0 -1778
- package/dist/client/assets/PreviewPanel-VQey9906.js +0 -2
- package/dist/client/assets/arrow-right-DmJqM7J1.js +0 -2
- package/dist/client/assets/fileCommentAnnotations-BwnrRpfq.js +0 -2
- package/dist/client/assets/index-XxxL_T8f.js +0 -635
- package/dist/client/assets/index-mqpX0B5G.css +0 -1
- package/dist/client/assets/textarea-BM2z9WNB.js +0 -46
|
@@ -0,0 +1,1778 @@
|
|
|
1
|
+
import{$t as e,C as t,E as n,Go as r,Ho as i,Jt as a,Kl as o,Pf as s,Pt as c,Ts as l,Uf as u,as as d,b as f,bs as p,g as m,is as h,lp as g,m as _,op as v,p as y,v as b}from"./textarea-lBMORu4g.js";import{a as x,c as S,i as C,n as ee,o as w,r as T,s as E,t as te}from"./fileCommentAnnotations-BBX2usb_.js";import{C as ne,Cn as D,Ct as O,D as k,Dn as A,Dt as j,En as M,Fr as re,Gn as ie,H as ae,Hn as oe,Nr as se,Qn as ce,Qt as le,Rt as ue,S as de,Sn as fe,Sr as pe,Tn as me,Tr as N,Tt as he,U as ge,V as _e,W as ve,Wn as ye,X as be,b as xe,bn as Se,d as Ce,dr as we,f as Te,fr as Ee,jr as De,l as P,ln as Oe,lr as ke,m as Ae,mr as je,p as Me,pn as Ne,pr as Pe,qn as Fe,u as Ie,ur as Le,v as Re,vr as ze,w as Be,x as Ve,xn as He,y as Ue,yn as We,yr as Ge,z as Ke,zt as qe}from"./index-DnkEkLTH.js";var Je=r(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Ye=r(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Xe=`file-tree-container`,Ze=`data-file-tree-style`,Qe=`data-file-tree-unsafe-css`,$e=`data-file-tree-scrollbar-measure`,et=`data-file-tree-scrollbar-gutter-measured`,tt=`--trees-scrollbar-gutter-measured`,nt=`header`,rt=`context-menu`,it=`context-menu-trigger`,at=5,ot=1<<at,st=ot*4;function ct(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function lt(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function ut(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 dt(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 ft(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function F(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 I(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,gt(e,t)}function pt(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=dt(e).get(t);if(i===void 0)return;let a=i>>at;e.childVisibleChunkSums[a]+=r}function mt(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=_t(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=ot}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 ht(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>at;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<at}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 gt(e,t){if(t.childIds.length<st){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/ot),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>>at]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function _t(e,t,n,r){let i=Math.min(t.childIds.length,n+ot),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 vt=7,yt=3,bt=1<<yt,xt=4;function L(e,t,n=0){return e<<xt|n<<yt|t}function St(e){return e.depthAndFlags>>>xt}function R(e){return(e.depthAndFlags&bt)>>yt}function z(e){return(e.depthAndFlags&bt)!==0}function Ct(e){return e.depthAndFlags&vt}function B(e,t){return(Ct(e)&t)!==0}function wt(e,t){e.depthAndFlags|=t}function Tt(e,t){e.depthAndFlags=L(t,Ct(e),R(e))}var Et=Symbol(`benchmarkInstrumentation`);function Dt(e,t){return t==null||Object.defineProperty(e,Et,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Ot(e){return e==null?null:e[Et]??null}function V(e,t,n){return e==null?n():e.measurePhase(t,n)}function kt(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function At(e){return e>=48&&e<=57}function jt(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!At(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&&At(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 Mt(e){let t=e.toLowerCase();return{lowerValue:t,tokens:jt(t)}}function Nt(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 Pt(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=Nt(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Ft(e,t,n){let r=Pt(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function It(e,t){return Ft(e,t,Mt)}function Lt(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Rt(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=Lt(e,r);return a===Lt(t,r)?It(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 zt(e,t){return Rt(e,t)}function Bt(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Mt(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=Lt(e,n);return o===Lt(t,n)?Ft(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 Vt(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Mt(r);return e.sortKeyById[t]=i,i}function Ht(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Ut(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 Wt(e){let{hasTrailingSlash:t,segments:n}=Ut(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function Gt(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Ut(e);return{requiresDirectory:t,segments:n}}var Kt=``;function qt(){let e=new Map;return e.set(Kt,0),{idByValue:e,valueById:[Kt],sortKeyById:[Mt(Kt)]}}function Jt(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 Yt(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Xt=Symbol(`pathStorePreparedInputKind`);function Zt(e,t){return e[Xt]=t,e}function Qt(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function $t(e,t,n){return n==="default"?zt(e,t):n(Qt(e),Qt(t))}function en(){return{depthAndFlags:L(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function tn(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 nn(e){return e.isDirectory?e.segments.length:e.segments.length-1}function rn(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 an(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function on(e,t={}){return fn(e,t).map(e=>e.path)}function sn(e,t={}){let n=fn(e,t);return Zt({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function cn(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 Zt({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function ln(e){let t=e,n=t.preparedPaths;if(t[Xt]===`prepared`&&n!=null)return n;if(!rn(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function un(e){let t=e;return t[Xt]===`presorted`&&t.presortedPaths!=null||an(t.presortedPaths)?t.presortedPaths:null}function dn(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function fn(e,t={}){let n=Ht(t),r=Ot(t);kt(r,`workload.inputFiles`,e.length);let i=V(r,`store.preparePathEntries.parse`,()=>e.map(e=>Wt(e)));return V(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>$t(e,t,n.sort))),i}var pn=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[en()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=qt();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Ot(e),this.options=Ht(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,ct())}appendPaths(e){return V(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>Wt(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,V(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return V(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:L(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:L(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:L(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=Wt(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:L(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:L(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=Wt(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(V(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||V(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"?Bt(this.lastPreparedPath,e,this.segmentSortKeyCache):$t(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=nn(e),i=n==null?0:nn(n),a=n==null?0:tn(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=Jt(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:L(St(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),ft(i,s),s}createFileChildUnchecked(e,t){let n=Jt(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:L(St(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),ft(r,a),a}getOrCreateDirectoryChild(e,t){let n=Jt(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&&!z(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:L(St(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),ft(r,a),this.directories.set(a,ct()),a}createDirectoryChild(e,t){let n=Jt(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:L(St(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),ft(r,a),this.directories.set(a,ct()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!z(n))throw Error(`Path is not a directory: "${t}"`);if(B(n,1))throw Error(`Duplicate path: "${t}"`);wt(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,lt());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(z(a)){let t=lt();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;z(n)&&this.directories.set(t,ct());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),ft(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!z(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 I(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function mn(e,t=`closed`,n=null){let r=gn(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 hn(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function gn(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 _n(e,t){return B(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:St(t)<=e.defaultExpansion}function vn(e,t,n=e.snapshot.nodes[t]){return n==null||!z(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:_n(e,n)}function yn(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!z(r))return;let i=_n(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 bn(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 xn(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Sn(e,t){let n=bn(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 Cn(e,t){let n=bn(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function wn(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 Tn(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function En(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 Dn(e,t){e.directoryLoadInfoById.delete(t)}function On(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 kn(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function An(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function jn(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Mn(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Nn(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Pn(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Fn(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 In(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 Ln(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 Rn(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 zn(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 Bn(e,t,n){return{...n,visibleCountDelta:Zn(e)-t}}function Vn(e,t){let n=Zn(e),r=hn();e.transactionStack.push(r);try{t()}catch(t){throw Wn(e,r,!1),t}Wn(e,r,!0,Zn(e)-n)}function Hn(e,t){let n=e.instrumentation;if(n==null){Un(e,t);return}V(n,`store.events.record`,()=>Un(e,t))}function Un(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Yn(e,t);return}n.events.push(t),Jn(n,t)}function Wn(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?qn(i,t):V(n,`store.events.batch.merge`,()=>qn(i,t));return}let a=Gn(t,r),o=e.instrumentation;if(o==null){Yn(e,a);return}V(o,`store.events.batch.commit`,()=>Yn(e,a))}function Gn(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 Kn(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function qn(e,t){for(let n of t.events)e.events.push(n);Kn(e,t)}function Jn(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Yn(e,t){let n=e.instrumentation;if(n==null){Xn(e,t);return}V(n,`store.events.emit`,()=>Xn(e,t))}function Xn(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Zn(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Qn(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!z(n)||B(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||!z(a)?null:i}function $n(e,t){let n=t;for(;;){let t=Qn(e,n);if(t==null)return n;n=t}}function er(e,t){let n=[t],r=t;for(;;){let t=Qn(e,r);if(t==null)return n;n.push(t),r=t}}function tr(e,t){let n=t==null?e.snapshot.rootId:ur(e,t);return n==null?[]:fr(e,n)}function nr(e,t){let n=Wt(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Dr(e,Er(e,r)),{createdNodeIds:a,directoryId:o}=pr(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=W(e,o);if(B(n,1))throw Error(`Path already exists: "${t}"`);wt(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=hr(e,o,n.basename),s.add(c);sr(e,o);let l=Dr(e,o);return kn({affectedAncestorIds:lr(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Or(i,l)})}function rr(e,t,n){let r=ur(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=W(e,r);if(B(i,2))throw Error(`The root node cannot be removed`);if(z(i)&&U(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=Dr(e,a),s=wr(e,r);vr(e,a,r,i.nameId),Tr(e,a),sr(e,a);let c=Dr(e,a);return An({affectedAncestorIds:lr(e,a),affectedNodeIds:s,path:t,projectionChanged:Or(o,c),recursive:n.recursive===!0})}function ir(e,t,n,r){let i=ur(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=W(e,i);if(B(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=Sr(e,i,n),c=Dr(e,a.parentId),l=Dr(e,s.parentId),u=Yt(e.snapshot.segmentTable,a.nameId),d=Jt(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(z(a)&&Mr(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=ut(e.snapshot.nodes,U(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Cr(e,p,o,R(a))===`skip`)return null;let m=a.parentId;vr(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),jr(e,i),_r(e,s.parentId,i),Tr(e,m),e.pathCacheVersion++,sr(e,m),s.parentId!==m&&sr(e,s.parentId);let h=Dr(e,m),g=Dr(e,s.parentId);return jn({affectedAncestorIds:[...new Set([...lr(e,m),...lr(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:kr([c,l],[h,g]),to:H(e,i)})}function ar(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function or(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function H(e,t){let n=W(e,t),r=ar(e,t);if(r!=null)return r;if(B(n,2))return or(e,t,``);let i=H(e,n.parentId),a=Yt(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return or(e,t,z(n)?`${o}/`:o)}function sr(e,t){let n=e.instrumentation;if(n==null){Pr(e,t);return}V(n,`store.recomputeCountsUpwardFrom`,()=>Pr(e,t))}function cr(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||!z(o)){Nr(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Nr(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function lr(e,t){let n=[],r=t;for(;r!=null;){let t=W(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function ur(e,t){if(t.length===0)return e.snapshot.rootId;let n=Gt(t);return dr(e,n.segments,n.requiresDirectory)}function dr(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=U(e,r),a=ut(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=W(e,r);return n&&!z(i)?null:r}function U(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 W(e,t){let n=e.snapshot.nodes[t];if(n===void 0||B(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function fr(e,t){let n=e.snapshot.nodes[t];if(n===void 0||B(n,4))return[];if(!z(n))return[H(e,t)];if(U(e,t).childIds.length===0)return B(n,1)&&!B(n,2)?[H(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||B(n,4)){i.pop();continue}if(!z(n)){r.push(H(e,t.nodeId)),i.pop();continue}let a=U(e,t.nodeId);if(a.childIds.length===0){B(n,1)&&!B(n,2)&&r.push(H(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 pr(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Jt(e.snapshot.segmentTable,i),a=U(e,r),o=ut(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!z(W(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=mr(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function mr(e,t,n){let r=W(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:L(St(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,ct()),_r(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function hr(e,t,n){let r=Jt(e.snapshot.segmentTable,n),i=U(e,t);if(ut(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Ir(e,t,n)}"`);let a=W(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:L(St(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),_r(e,t,o),e.activeNodeCount++,o}function gr(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}yr(e,n,o)<0?i=a:r=a+1}return r}function _r(e,t,n){let r=U(e,t),i=W(e,n);ut(e.snapshot.nodes,r).set(i.nameId,n),pt(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=gr(e,r,n);r.childIds.splice(a,0,n),F(r,a),gt(e.snapshot.nodes,r)}function vr(e,t,n,r){let i=U(e,t),a=dt(i),o=a.get(n)??-1;ut(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&pt(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),F(i,o),gt(e.snapshot.nodes,i))}function yr(e,t,n){let r=e.snapshot.options.sort;return r==="default"?br(e,t,n):r(xr(e,t),xr(e,n))}function br(e,t,n){let r=W(e,t),i=W(e,n),a=z(r);if(a!==z(i))return a?-1:1;let o=Pt(Vt(e.snapshot.segmentTable,r.nameId),Vt(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Yt(e.snapshot.segmentTable,r.nameId),c=Yt(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function xr(e,t){let n=W(e,t),r=H(e,t),i=z(n),a=i?r.slice(0,-1):r;return{basename:Yt(e.snapshot.segmentTable,n.nameId),depth:St(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function Sr(e,t,n){let r=W(e,t),i=ur(e,n);if(i!=null){let t=W(e,i);if(z(t))return{basename:Yt(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=Gt(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=Gt(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:dr(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Cr(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${H(e,t)}"`);let i=W(e,t);if(R(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(z(i)&&U(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return wr(e,t),vr(e,a,t,o),Tr(e,a),sr(e,a),`handled`}function wr(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=W(e,t.nodeId);if(t.visitedChildren||!z(i)){z(i)&&e.snapshot.directories.delete(t.nodeId),wt(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Dn(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=U(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 Tr(e,t){let n=t;for(;n!=null;){let t=W(e,n);if(!z(t)||B(t,2)||U(e,n).childIds.length>0)return;wt(t,1),n=t.parentId===n?null:t.parentId}}function Er(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=ut(e.snapshot.nodes,U(e,n)).get(t);if(i==null||!z(W(e,i)))break;n=i}return n}function Dr(e,t){let n=Ar(e,t);if(n==null)return null;let r=$n(e,n),i=W(e,r),a=n===r?null:er(e,n).map(t=>H(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:U(e,r).childIds.length>0,path:H(e,r),terminalKind:R(i)})}function Or(e,t){return kr([e],[t])}function kr(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 Ar(e,t){let n=t;for(;n!=null;){let t=W(e,n);if(!z(t)||B(t,2))return null;if(!vn(e,n,t))return n;n=t.parentId}return null}function jr(e,t){let n=W(e,t);if(Tt(n,(t===e.snapshot.rootId?-1:St(W(e,n.parentId)))+1),!z(n))return;let r=U(e,t);for(let t of r.childIds)jr(e,t)}function Mr(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=W(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function Nr(e,t,n=W(e,t),r=!1){let i=e.instrumentation;if(i==null){Fr(e,t,n,r);return}V(i,`store.recomputeNodeCounts`,()=>Fr(e,t,n,r))}function Pr(e,t){let n=t;for(;n!=null;){let t=W(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Nr(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&pt(U(e,s),n,a,o),n=s}}function Fr(e,t,n,r){if(!z(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=U(e,t);if(r){let t=e.instrumentation;t==null?I(e.snapshot.nodes,i):V(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>I(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,B(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Qn(e,t)==null?vn(e,t,n)?1+o:1:o}function Ir(e,t,n){let r=H(e,t);return r.length===0?n:`${r}${n}`}function Lr(e){return e!=null&&!B(e,4)}function Rr(e,t){let n=e.snapshot.nodes[t];return!Lr(n)||!z(n)||B(n,2)?null:n}function zr(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Lr(e.snapshot.nodes[n])&&(t+=1);return t}function Br(e){return Math.max(0,e.valueById.length-1)}function Vr(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:zr(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Br(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function Hr(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 Ur(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)Rr(e,n)!=null&&t.push(H(e,n));for(let t of e.expandedDirectoryIds)Rr(e,t)!=null&&n.push(H(e,t));return{collapsedPaths:t,expandedPaths:n}}function Wr(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)Rr(e,n)==null||xn(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:H(e,n)});return t}function Gr(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=ur(e,n);t!=null&&yn(e,t,!0,W(e,t))}for(let n of t.collapsedPaths){let t=ur(e,n);t!=null&&yn(e,t,!1,W(e,t))}}function Kr(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=ur(e,n.path);t!=null&&Rr(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function qr(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function Jr(e){let t=e.snapshot.segmentTable,n=qt();for(let r of e.snapshot.nodes)if(Lr(r)){if(B(r,2)){r.nameId=0;continue}r.nameId=Jt(n,Yt(t,r.nameId))}e.snapshot.segmentTable=n}function Yr(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Lr(r)||!z(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Lr(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[W(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),I(e.snapshot.nodes,n)}}function Xr(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Lr(n))break;--t}e.snapshot.nodes.length=t+1}function Zr(e){let t=Ur(e),n=Wr(e);V(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>qr(e)),V(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>Jr(e)),V(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>Yr(e)),V(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>Xr(e)),V(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>Gr(e,t)),V(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>Kr(e,n)),V(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>cr(e,e.snapshot.rootId))}function Qr(e){let t=Ur(e),n=Wr(e),r=V(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>tr(e)),i=Dt({...e.snapshot.options},e.instrumentation),a=V(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new pn(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,V(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>Gr(e,t)),V(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>Kr(e,n)),V(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>cr(e,e.snapshot.rootId))}function $r(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function ei(e,t){let n=Vr(e);t===`stable`?V(e.instrumentation,`store.cleanup.stable`,()=>Zr(e)):V(e.instrumentation,`store.cleanup.aggressive`,()=>Qr(e));let r=Vr(e);return Hr(t,t===`stable`,n,r)}var ti=64;function ni(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 ri(e){return W(e,e.snapshot.rootId).visibleSubtreeCount}function ii(e,t,n,r){let i=W(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function ai(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:wi(e,t.cursor),setSize:t.setSize,subtreeEndIndex:ii(e,t.cursor,t.index,n)}}function oi(e,t,n,r,i,a){let o=U(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=mt(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return si(e,u,l,r+c,i+1,s,o.childIds.length,a)}function si(e,t,n,r,i,a,o,s){if(!z(W(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=vi(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=W(e,c.terminalNodeId);if(!z(l)||!vn(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return oi(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function ci(e,t){let n=ri(e);if(t<0||t>=n)return null;let r=oi(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>H(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=ai(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:wi(e,r.cursor),setSize:r.setSize,subtreeEndIndex:ii(e,r.cursor,r.index,n)}}function li(e,t,n){let r=e.instrumentation,i=ri(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 Ci(e,o+1);let t=[],n=hi(e,a);for(let r=a;r<=o&&n!=null;r++){let r=wi(e,n);t.push(r),n=bi(e,n)}return t}let s=[],c=0,l=0,u=V(r,`store.getVisibleSlice.selectFirstRow`,()=>hi(e,a));for(let t=a;t<=o&&u!=null;t++){let t=V(r,`store.getVisibleSlice.materializeRow`,()=>wi(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=V(r,`store.getVisibleSlice.advanceCursor`,()=>bi(e,u))}return kt(r,`workload.visibleRowsRead`,s.length),kt(r,`workload.flattenedRowsRead`,c),kt(r,`workload.flattenedSegmentsRead`,l),s}function ui(e,t=ri(e)){let n=e.instrumentation;return n==null?Si(e,t):V(n,`store.getVisibleTreeProjection`,()=>Si(e,t))}function di(e){return xi(ui(e))}function fi(e,t){let n=ur(e,t);if(n==null||n===e.snapshot.rootId||z(W(e,n))&&$n(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=W(e,i).parentId,n=U(e,t),s=dt(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=ht(a,n,s),t!==o){let n=W(e,t),a=Qn(e,t);if(!vn(e,t,n)&&a!==i)return null;$n(e,t)===t&&(r+=1)}i=t}return r}function pi(e,t){let n=ur(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=W(e,n);if(!z(r))throw Error(`Path is not a directory: "${t}"`);return vn(e,n,r)?null:(yn(e,n,!0,r),sr(e,n),Mn({affectedAncestorIds:lr(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function mi(e,t){let n=ur(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=W(e,n);if(!z(r))throw Error(`Path is not a directory: "${t}"`);return vn(e,n,r)?(yn(e,n,!1,r),sr(e,n),Nn({affectedAncestorIds:lr(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function hi(e,t){return t<0||t>=ri(e)?null:gi(e,e.snapshot.rootId,t,-1)}function gi(e,t,n,r){let i=U(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?mt(e.snapshot.nodes,i,n):V(a,`store.getVisibleSlice.selectChildIndex`,()=>mt(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return _i(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function _i(e,t,n,r){if(!z(W(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=vi(e,t,r);if(n===0)return i;let a=W(e,i.terminalNodeId);if(!z(a)||!vn(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return gi(e,i.terminalNodeId,n-1,i.visibleDepth)}function vi(e,t,n){return z(W(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:$n(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:V(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>$n(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function yi(e,t){let n=W(e,t);if(!z(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:Qn(e,r)!==t}function bi(e,t){let n=W(e,t.terminalNodeId);if(z(n)){let r=U(e,t.terminalNodeId);if(vn(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:_i(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=W(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=U(e,n),o=dt(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 _i(e,s,0,i);yi(e,r)&&i--,r=n}}function xi(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 Si(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(ti);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=ni(o,y);let x,S=_;if(z(v))S=f?$n(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:H(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&&z(C)&&vn(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 Ci(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(!z(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:H(e,f)};continue}let h=l?$n(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=wi(e,g);let _=i[h];_!=null&&z(_)&&vn(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function wi(e,t){let n=W(e,t.terminalNodeId),r=z(n)?Ti(e,t):null,i=H(e,t.terminalNodeId),a=Yt(e.snapshot.segmentTable,n.nameId),o=z(n)&&U(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?er(e,t.headNodeId).map(n=>{let r=W(e,n);return{isTerminal:n===t.terminalNodeId,name:Yt(e.snapshot.segmentTable,r.nameId),nodeId:n,path:H(e,n)}}):V(c,`store.getVisibleSlice.flatten.collectSegments`,()=>er(e,t.headNodeId).map(n=>{let r=W(e,n);return{isTerminal:n===t.terminalNodeId,name:Yt(e.snapshot.segmentTable,r.nameId),nodeId:n,path:H(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:z(n)&&vn(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:z(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function Ti(e,t){if(t.headNodeId===t.terminalNodeId)return xn(e,t.terminalNodeId);let n=er(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=xn(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function Ei(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||!z(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&>(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&z(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,gt(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Di(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Oi=class e{#e;constructor(e={}){let t=Ot(e),n=V(t,`store.builder.create`,()=>new pn(e));if(e.preparedInput!=null){let t=un(e.preparedInput);t==null?n.appendPreparedPaths(ln(e.preparedInput),!1):n.appendPresortedPaths(t,dn(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(V(t,`store.preparePathEntries`,()=>fn(r,e)))}let r=V(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=V(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=V(t,`store.state.create`,()=>mn(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:V(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Di(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&V(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?V(t,`store.state.initializeOpenVisibleCounts`,()=>Ei(this.#e)):V(t,`store.state.recomputeCounts`,()=>cr(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return on(e,t)}static prepareInput(e,t={}){return sn(e,t)}static preparePresortedInput(e){return cn(e)}list(e){return V(this.#e.instrumentation,`store.list`,()=>tr(this.#e,e))}add(e){V(this.#e.instrumentation,`store.add`,()=>{let t=ri(this.#e);Hn(this.#e,Bn(this.#e,t,nr(this.#e,e)))})}remove(e,t={}){V(this.#e.instrumentation,`store.remove`,()=>{let n=ri(this.#e);Hn(this.#e,Bn(this.#e,n,rr(this.#e,e,t)))})}move(e,t,n={}){V(this.#e.instrumentation,`store.move`,()=>{let r=ri(this.#e),i=ir(this.#e,e,t,n);i!=null&&Hn(this.#e,Bn(this.#e,r,i))})}batch(e){Vn(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 V(this.#e.instrumentation,`store.getVisibleCount`,()=>ri(this.#e))}getVisibleSlice(e,t){return V(this.#e.instrumentation,`store.getVisibleSlice`,()=>li(this.#e,e,t))}getVisibleRowContext(e){return V(this.#e.instrumentation,`store.getVisibleRowContext`,()=>ci(this.#e,e))}getVisibleTreeProjection(){return di(this.#e)}getVisibleTreeProjectionData(e){return ui(this.#e,e)}getVisibleIndex(e){return V(this.#e.instrumentation,`store.getVisibleIndex`,()=>fi(this.#e,e))}getPathInfo(e){return V(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=ur(this.#e,e);if(t==null)return null;let n=W(this.#e,t);return{depth:St(n),kind:z(n)?`directory`:`file`,path:H(this.#e,t)}})}isExpanded(e){return V(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=W(this.#e,t);return vn(this.#e,t,n)})}expand(e){V(this.#e.instrumentation,`store.expand`,()=>{let t=ri(this.#e),n=pi(this.#e,e);n!=null&&Hn(this.#e,Bn(this.#e,t,n))})}collapse(e){V(this.#e.instrumentation,`store.collapse`,()=>{let t=ri(this.#e),n=mi(this.#e,e);n!=null&&Hn(this.#e,Bn(this.#e,t,n))})}on(e,t){return On(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return xn(this.#e,t)}markDirectoryUnloaded(e){V(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(U(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=ri(this.#e);Cn(this.#e,t),Hn(this.#e,Bn(this.#e,n,Pn({affectedAncestorIds:lr(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return V(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=ri(this.#e),r=Sn(this.#e,t);return Hn(this.#e,Bn(this.#e,n,Fn({affectedAncestorIds:lr(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return V(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||xn(this.#e,n)!==`loading`||!Tn(this.#e,n,e.attemptId))return!1;let r=H(this.#e,n);this.validateChildPatch(r,t);let i=ri(this.#e),a=[];for(let e of t.operations){ki(r,e);let t=ri(this.#e);switch(e.type){case`add`:a.push(Bn(this.#e,t,nr(this.#e,e.path)));break;case`remove`:a.push(Bn(this.#e,t,rr(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=ir(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Bn(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Hn(this.#e,Bn(this.#e,i,In({affectedAncestorIds:lr(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:H(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return V(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=ri(this.#e),r=wn(this.#e,t,e.attemptId);return Hn(this.#e,Bn(this.#e,n,Ln({affectedAncestorIds:lr(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:H(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return V(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=ri(this.#e),i=En(this.#e,n,e.attemptId,t);return Hn(this.#e,Bn(this.#e,r,Rn({affectedAncestorIds:lr(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:H(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return V(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if($r(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=ri(this.#e),n=ei(this.#e,e.mode??`stable`);return Hn(this.#e,Bn(this.#e,t,zn({...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=U(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Mt(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=Pt(Vt(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(!z(W(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=W(this.#e,n);vn(this.#e,n,i)||(yn(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=W(this.#e,e);if(!vn(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=ur(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!z(W(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!z(W(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=W(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=W(this.#e,e),r=Qn(this.#e,e);if(!vn(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 ki(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 Ai={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function ji(e,t){if(typeof e==`number`)return{itemHeight:t??Ai.default.itemHeight,factor:e};let n=Ai[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Mi=Ai.default.itemHeight,Ni=`@layer base, theme, unsafe;
|
|
2
|
+
|
|
3
|
+
@layer base {
|
|
4
|
+
:host {
|
|
5
|
+
/*
|
|
6
|
+
CSS variables use a fallback stack to ensure user and theme colors slot
|
|
7
|
+
in with ease. User colors take precedence over theme colors, which take
|
|
8
|
+
precedence over defaults.
|
|
9
|
+
|
|
10
|
+
Fallback order:
|
|
11
|
+
|
|
12
|
+
1. --trees-*-override (explicit)
|
|
13
|
+
2. --trees-theme-* (e.g. Shiki/VS Code tokens)
|
|
14
|
+
3. defaults
|
|
15
|
+
|
|
16
|
+
Theme variable names mirror Shiki/VS Code theme file JSON tokens.
|
|
17
|
+
|
|
18
|
+
// Available CSS Color Overrides
|
|
19
|
+
--trees-fg-override
|
|
20
|
+
--trees-fg-muted-override
|
|
21
|
+
--trees-bg-override
|
|
22
|
+
--trees-bg-muted-override
|
|
23
|
+
--trees-accent-override
|
|
24
|
+
--trees-border-color-override
|
|
25
|
+
|
|
26
|
+
--trees-focus-ring-color-override
|
|
27
|
+
--trees-focus-ring-width-override
|
|
28
|
+
--trees-focus-ring-offset-override
|
|
29
|
+
|
|
30
|
+
--trees-search-fg-override
|
|
31
|
+
--trees-search-font-weight-override
|
|
32
|
+
--trees-search-bg-override
|
|
33
|
+
|
|
34
|
+
--trees-selected-fg-override
|
|
35
|
+
--trees-selected-bg-override
|
|
36
|
+
--trees-selected-focused-border-color-override
|
|
37
|
+
|
|
38
|
+
// Git Status Color Overrides
|
|
39
|
+
--trees-status-added-override
|
|
40
|
+
--trees-status-ignored-override
|
|
41
|
+
--trees-status-modified-override
|
|
42
|
+
--trees-status-renamed-override
|
|
43
|
+
--trees-status-untracked-override
|
|
44
|
+
--trees-status-deleted-override
|
|
45
|
+
--trees-git-added-color-override
|
|
46
|
+
--trees-git-ignored-color-override
|
|
47
|
+
--trees-git-modified-color-override
|
|
48
|
+
--trees-git-renamed-color-override
|
|
49
|
+
--trees-git-untracked-color-override
|
|
50
|
+
--trees-git-deleted-color-override
|
|
51
|
+
|
|
52
|
+
// Built-in File Icon Color Overrides
|
|
53
|
+
--trees-file-icon-color
|
|
54
|
+
--trees-file-icon-color-astro
|
|
55
|
+
--trees-file-icon-color-babel
|
|
56
|
+
--trees-file-icon-color-bash
|
|
57
|
+
--trees-file-icon-color-biome
|
|
58
|
+
--trees-file-icon-color-bootstrap
|
|
59
|
+
--trees-file-icon-color-browserslist
|
|
60
|
+
--trees-file-icon-color-bun
|
|
61
|
+
--trees-file-icon-color-c
|
|
62
|
+
--trees-file-icon-color-cpp
|
|
63
|
+
--trees-file-icon-color-claude
|
|
64
|
+
--trees-file-icon-color-css
|
|
65
|
+
--trees-file-icon-color-database
|
|
66
|
+
--trees-file-icon-color-default
|
|
67
|
+
--trees-file-icon-color-docker
|
|
68
|
+
--trees-file-icon-color-eslint
|
|
69
|
+
--trees-file-icon-color-git
|
|
70
|
+
--trees-file-icon-color-go
|
|
71
|
+
--trees-file-icon-color-graphql
|
|
72
|
+
--trees-file-icon-color-html
|
|
73
|
+
--trees-file-icon-color-image
|
|
74
|
+
--trees-file-icon-color-javascript
|
|
75
|
+
--trees-file-icon-color-json
|
|
76
|
+
--trees-file-icon-color-markdown
|
|
77
|
+
--trees-file-icon-color-mcp
|
|
78
|
+
--trees-file-icon-color-npm
|
|
79
|
+
--trees-file-icon-color-oxc
|
|
80
|
+
--trees-file-icon-color-postcss
|
|
81
|
+
--trees-file-icon-color-prettier
|
|
82
|
+
--trees-file-icon-color-python
|
|
83
|
+
--trees-file-icon-color-react
|
|
84
|
+
--trees-file-icon-color-ruby
|
|
85
|
+
--trees-file-icon-color-rust
|
|
86
|
+
--trees-file-icon-color-sass
|
|
87
|
+
--trees-file-icon-color-svg
|
|
88
|
+
--trees-file-icon-color-svelte
|
|
89
|
+
--trees-file-icon-color-svgo
|
|
90
|
+
--trees-file-icon-color-swift
|
|
91
|
+
--trees-file-icon-color-table
|
|
92
|
+
--trees-file-icon-color-text
|
|
93
|
+
--trees-file-icon-color-tailwind
|
|
94
|
+
--trees-file-icon-color-terraform
|
|
95
|
+
--trees-file-icon-color-typescript
|
|
96
|
+
--trees-file-icon-color-vite
|
|
97
|
+
--trees-file-icon-color-vscode
|
|
98
|
+
--trees-file-icon-color-vue
|
|
99
|
+
--trees-file-icon-color-wasm
|
|
100
|
+
--trees-file-icon-color-webpack
|
|
101
|
+
--trees-file-icon-color-yml
|
|
102
|
+
--trees-file-icon-color-zig
|
|
103
|
+
--trees-file-icon-color-zip
|
|
104
|
+
|
|
105
|
+
// Density
|
|
106
|
+
//
|
|
107
|
+
// A unitless scale factor for padding, gaps, and indentation. Usually
|
|
108
|
+
// set via \`density\` on useFileTree. Individual overrides take precedence.
|
|
109
|
+
//
|
|
110
|
+
// Compact: 0.8
|
|
111
|
+
// Default: 1
|
|
112
|
+
// Relaxed: 1.2
|
|
113
|
+
//
|
|
114
|
+
--trees-density-override
|
|
115
|
+
|
|
116
|
+
// Available CSS Layout Overrides
|
|
117
|
+
--trees-gap-override
|
|
118
|
+
--trees-border-radius-override
|
|
119
|
+
--trees-font-family-override
|
|
120
|
+
--trees-font-size-override
|
|
121
|
+
--trees-font-weight-regular-override
|
|
122
|
+
--trees-font-weight-semibold-override
|
|
123
|
+
--trees-level-gap-override
|
|
124
|
+
--trees-item-padding-x-override
|
|
125
|
+
--trees-item-margin-x-override
|
|
126
|
+
--trees-item-row-gap-override
|
|
127
|
+
--trees-icon-width-override
|
|
128
|
+
--trees-icon-nudge-override
|
|
129
|
+
--trees-scrollbar-gutter-override
|
|
130
|
+
--trees-padding-inline-override
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
--trees-accent: var(--trees-accent-override, #009fff);
|
|
134
|
+
--trees-fg: var(
|
|
135
|
+
--trees-fg-override,
|
|
136
|
+
var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
|
|
137
|
+
);
|
|
138
|
+
--trees-fg-muted: var(
|
|
139
|
+
--trees-fg-muted-override,
|
|
140
|
+
var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
|
|
141
|
+
);
|
|
142
|
+
--trees-bg: var(
|
|
143
|
+
--trees-bg-override,
|
|
144
|
+
var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
|
|
145
|
+
);
|
|
146
|
+
/* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
|
|
147
|
+
--trees-bg-muted: var(
|
|
148
|
+
--trees-bg-muted-override,
|
|
149
|
+
var(
|
|
150
|
+
--trees-theme-list-hover-bg,
|
|
151
|
+
light-dark(
|
|
152
|
+
color-mix(
|
|
153
|
+
in lab,
|
|
154
|
+
var(--trees-accent) var(--trees-bg-alpha-light, 8%),
|
|
155
|
+
var(--trees-bg)
|
|
156
|
+
),
|
|
157
|
+
color-mix(
|
|
158
|
+
in lab,
|
|
159
|
+
var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
|
|
160
|
+
var(--trees-bg)
|
|
161
|
+
)
|
|
162
|
+
)
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
--trees-input-bg: var(
|
|
166
|
+
--trees-input-bg-override,
|
|
167
|
+
light-dark(#f8f8f8, #070707)
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
--trees-added-light: #16a994;
|
|
171
|
+
--trees-added-dark: #00cab1;
|
|
172
|
+
--trees-ignored-light: #adadb1;
|
|
173
|
+
--trees-ignored-dark: #4a4a4e;
|
|
174
|
+
--trees-modified-light: #1ca1c7;
|
|
175
|
+
--trees-modified-dark: #08c0ef;
|
|
176
|
+
--trees-renamed-light: #d5a910;
|
|
177
|
+
--trees-renamed-dark: #ffd452;
|
|
178
|
+
--trees-untracked-light: #16a994;
|
|
179
|
+
--trees-untracked-dark: #00cab1;
|
|
180
|
+
--trees-deleted-light: #ff2e3f;
|
|
181
|
+
--trees-deleted-dark: #ff6762;
|
|
182
|
+
|
|
183
|
+
--trees-border-color: var(
|
|
184
|
+
--trees-border-color-override,
|
|
185
|
+
var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
|
|
186
|
+
);
|
|
187
|
+
--trees-indent-guide-bg: var(
|
|
188
|
+
--trees-indent-guide-bg-override,
|
|
189
|
+
color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
|
|
190
|
+
);
|
|
191
|
+
--trees-density: var(--trees-density-override, 1);
|
|
192
|
+
--trees-border-radius: var(
|
|
193
|
+
--trees-border-radius-override,
|
|
194
|
+
calc(6px * var(--trees-density))
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
--trees-font-family: var(--trees-font-family-override, system-ui);
|
|
198
|
+
--trees-font-size: var(--trees-font-size-override, 13px);
|
|
199
|
+
--trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
|
|
200
|
+
--trees-font-weight-semibold: var(
|
|
201
|
+
--trees-font-weight-semibold-override,
|
|
202
|
+
600
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
--trees-focus-ring-color: var(
|
|
206
|
+
--trees-focus-ring-color-override,
|
|
207
|
+
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
208
|
+
);
|
|
209
|
+
--trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
|
|
210
|
+
--trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
|
|
211
|
+
|
|
212
|
+
--trees-search-fg: var(
|
|
213
|
+
--trees-search-fg-override,
|
|
214
|
+
var(--trees-theme-input-fg, var(--trees-fg))
|
|
215
|
+
);
|
|
216
|
+
--trees-search-font-weight: var(--trees-search-font-weight-override, 600);
|
|
217
|
+
--trees-search-bg: var(
|
|
218
|
+
--trees-search-bg-override,
|
|
219
|
+
var(--trees-theme-input-bg, var(--trees-input-bg))
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
--trees-scrollbar-thumb: var(
|
|
223
|
+
--trees-scrollbar-thumb-override,
|
|
224
|
+
var(
|
|
225
|
+
--trees-theme-scrollbar-thumb,
|
|
226
|
+
color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
|
|
227
|
+
)
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
--trees-selected-fg: var(
|
|
231
|
+
--trees-selected-fg-override,
|
|
232
|
+
var(--trees-theme-list-active-selection-fg, var(--trees-fg))
|
|
233
|
+
);
|
|
234
|
+
--trees-selected-bg: var(
|
|
235
|
+
--trees-selected-bg-override,
|
|
236
|
+
var(
|
|
237
|
+
--trees-theme-list-active-selection-bg,
|
|
238
|
+
light-dark(
|
|
239
|
+
color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
|
|
240
|
+
color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
|
|
241
|
+
)
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
--trees-selected-focused-border-color: var(
|
|
245
|
+
--trees-selected-focused-border-color-override,
|
|
246
|
+
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
/* Git status (e.g. from Shiki theme gitDecoration.*) */
|
|
250
|
+
--trees-status-added: var(
|
|
251
|
+
--trees-status-added-override,
|
|
252
|
+
var(
|
|
253
|
+
--trees-theme-git-added-fg,
|
|
254
|
+
light-dark(var(--trees-added-light), var(--trees-added-dark))
|
|
255
|
+
)
|
|
256
|
+
);
|
|
257
|
+
--trees-status-ignored: var(
|
|
258
|
+
--trees-status-ignored-override,
|
|
259
|
+
var(
|
|
260
|
+
--trees-theme-git-ignored-fg,
|
|
261
|
+
light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
--trees-status-modified: var(
|
|
265
|
+
--trees-status-modified-override,
|
|
266
|
+
var(
|
|
267
|
+
--trees-theme-git-modified-fg,
|
|
268
|
+
light-dark(var(--trees-modified-light), var(--trees-modified-dark))
|
|
269
|
+
)
|
|
270
|
+
);
|
|
271
|
+
--trees-status-renamed: var(
|
|
272
|
+
--trees-status-renamed-override,
|
|
273
|
+
var(
|
|
274
|
+
--trees-theme-git-renamed-fg,
|
|
275
|
+
light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
|
|
276
|
+
)
|
|
277
|
+
);
|
|
278
|
+
--trees-status-untracked: var(
|
|
279
|
+
--trees-status-untracked-override,
|
|
280
|
+
var(
|
|
281
|
+
--trees-theme-git-untracked-fg,
|
|
282
|
+
light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
|
|
283
|
+
)
|
|
284
|
+
);
|
|
285
|
+
--trees-status-deleted: var(
|
|
286
|
+
--trees-status-deleted-override,
|
|
287
|
+
var(
|
|
288
|
+
--trees-theme-git-deleted-fg,
|
|
289
|
+
light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
|
|
290
|
+
)
|
|
291
|
+
);
|
|
292
|
+
--trees-git-modified-color: var(
|
|
293
|
+
--trees-git-modified-color-override,
|
|
294
|
+
var(--trees-status-modified)
|
|
295
|
+
);
|
|
296
|
+
--trees-git-added-color: var(
|
|
297
|
+
--trees-git-added-color-override,
|
|
298
|
+
var(--trees-status-added)
|
|
299
|
+
);
|
|
300
|
+
--trees-git-ignored-color: var(
|
|
301
|
+
--trees-git-ignored-color-override,
|
|
302
|
+
var(--trees-status-ignored)
|
|
303
|
+
);
|
|
304
|
+
--trees-git-deleted-color: var(
|
|
305
|
+
--trees-git-deleted-color-override,
|
|
306
|
+
var(--trees-status-deleted)
|
|
307
|
+
);
|
|
308
|
+
--trees-git-renamed-color: var(
|
|
309
|
+
--trees-git-renamed-color-override,
|
|
310
|
+
var(--trees-status-renamed)
|
|
311
|
+
);
|
|
312
|
+
--trees-git-untracked-color: var(
|
|
313
|
+
--trees-git-untracked-color-override,
|
|
314
|
+
var(--trees-status-untracked)
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
--trees-icon-gray: light-dark(#84848a, #adadb1);
|
|
318
|
+
--trees-icon-red: light-dark(#d52c36, #ff6762);
|
|
319
|
+
--trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
|
|
320
|
+
--trees-icon-orange: light-dark(#d47628, #ffa359);
|
|
321
|
+
--trees-icon-yellow: light-dark(#d5a910, #ffd452);
|
|
322
|
+
--trees-icon-green: light-dark(#199f43, #5ecc71);
|
|
323
|
+
--trees-icon-teal: light-dark(#17a5af, #64d1db);
|
|
324
|
+
--trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
|
|
325
|
+
--trees-icon-blue: light-dark(#1a85d4, #69b1ff);
|
|
326
|
+
--trees-icon-indigo: light-dark(#693acf, #9d6afb);
|
|
327
|
+
--trees-icon-purple: light-dark(#a631be, #d568ea);
|
|
328
|
+
--trees-icon-pink: light-dark(#d32a61, #ff678d);
|
|
329
|
+
--trees-icon-mauve: light-dark(#594c5b, #79697b);
|
|
330
|
+
|
|
331
|
+
--trees-file-icon-color-default: var(
|
|
332
|
+
--trees-file-icon-color,
|
|
333
|
+
var(--trees-icon-gray)
|
|
334
|
+
);
|
|
335
|
+
--trees-file-icon-color-astro: var(
|
|
336
|
+
--trees-file-icon-color,
|
|
337
|
+
var(--trees-icon-purple)
|
|
338
|
+
);
|
|
339
|
+
--trees-file-icon-color-babel: var(
|
|
340
|
+
--trees-file-icon-color,
|
|
341
|
+
var(--trees-icon-yellow)
|
|
342
|
+
);
|
|
343
|
+
--trees-file-icon-color-bash: var(
|
|
344
|
+
--trees-file-icon-color,
|
|
345
|
+
var(--trees-icon-green)
|
|
346
|
+
);
|
|
347
|
+
--trees-file-icon-color-biome: var(
|
|
348
|
+
--trees-file-icon-color,
|
|
349
|
+
var(--trees-icon-blue)
|
|
350
|
+
);
|
|
351
|
+
--trees-file-icon-color-bootstrap: var(
|
|
352
|
+
--trees-file-icon-color,
|
|
353
|
+
var(--trees-icon-indigo)
|
|
354
|
+
);
|
|
355
|
+
--trees-file-icon-color-browserslist: var(
|
|
356
|
+
--trees-file-icon-color,
|
|
357
|
+
var(--trees-icon-yellow)
|
|
358
|
+
);
|
|
359
|
+
--trees-file-icon-color-bun: var(
|
|
360
|
+
--trees-file-icon-color,
|
|
361
|
+
var(--trees-icon-mauve)
|
|
362
|
+
);
|
|
363
|
+
--trees-file-icon-color-c: var(
|
|
364
|
+
--trees-file-icon-color,
|
|
365
|
+
var(--trees-icon-blue)
|
|
366
|
+
);
|
|
367
|
+
--trees-file-icon-color-cpp: var(
|
|
368
|
+
--trees-file-icon-color,
|
|
369
|
+
var(--trees-icon-blue)
|
|
370
|
+
);
|
|
371
|
+
--trees-file-icon-color-claude: var(
|
|
372
|
+
--trees-file-icon-color,
|
|
373
|
+
var(--trees-icon-orange)
|
|
374
|
+
);
|
|
375
|
+
--trees-file-icon-color-css: var(
|
|
376
|
+
--trees-file-icon-color,
|
|
377
|
+
var(--trees-icon-indigo)
|
|
378
|
+
);
|
|
379
|
+
--trees-file-icon-color-database: var(
|
|
380
|
+
--trees-file-icon-color,
|
|
381
|
+
var(--trees-icon-purple)
|
|
382
|
+
);
|
|
383
|
+
--trees-file-icon-color-docker: var(
|
|
384
|
+
--trees-file-icon-color,
|
|
385
|
+
var(--trees-icon-blue)
|
|
386
|
+
);
|
|
387
|
+
--trees-file-icon-color-eslint: var(
|
|
388
|
+
--trees-file-icon-color,
|
|
389
|
+
var(--trees-icon-indigo)
|
|
390
|
+
);
|
|
391
|
+
--trees-file-icon-color-git: var(
|
|
392
|
+
--trees-file-icon-vermilion,
|
|
393
|
+
var(--trees-icon-vermilion)
|
|
394
|
+
);
|
|
395
|
+
--trees-file-icon-color-go: var(
|
|
396
|
+
--trees-file-icon-color,
|
|
397
|
+
var(--trees-icon-cyan)
|
|
398
|
+
);
|
|
399
|
+
--trees-file-icon-color-graphql: var(
|
|
400
|
+
--trees-file-icon-color,
|
|
401
|
+
var(--trees-icon-pink)
|
|
402
|
+
);
|
|
403
|
+
--trees-file-icon-color-html: var(
|
|
404
|
+
--trees-file-icon-color,
|
|
405
|
+
var(--trees-icon-orange)
|
|
406
|
+
);
|
|
407
|
+
--trees-file-icon-color-image: var(
|
|
408
|
+
--trees-file-icon-color,
|
|
409
|
+
var(--trees-icon-pink)
|
|
410
|
+
);
|
|
411
|
+
--trees-file-icon-color-javascript: var(
|
|
412
|
+
--trees-file-icon-color,
|
|
413
|
+
var(--trees-icon-yellow)
|
|
414
|
+
);
|
|
415
|
+
--trees-file-icon-color-json: var(
|
|
416
|
+
--trees-file-icon-color,
|
|
417
|
+
var(--trees-icon-orange)
|
|
418
|
+
);
|
|
419
|
+
--trees-file-icon-color-markdown: var(
|
|
420
|
+
--trees-file-icon-color,
|
|
421
|
+
var(--trees-icon-green)
|
|
422
|
+
);
|
|
423
|
+
--trees-file-icon-color-mcp: var(
|
|
424
|
+
--trees-file-icon-color,
|
|
425
|
+
var(--trees-icon-teal)
|
|
426
|
+
);
|
|
427
|
+
--trees-file-icon-color-npm: var(
|
|
428
|
+
--trees-file-icon-color,
|
|
429
|
+
var(--trees-icon-red)
|
|
430
|
+
);
|
|
431
|
+
--trees-file-icon-color-oxc: var(
|
|
432
|
+
--trees-file-icon-cyan,
|
|
433
|
+
var(--trees-icon-cyan)
|
|
434
|
+
);
|
|
435
|
+
--trees-file-icon-color-postcss: var(
|
|
436
|
+
--trees-file-icon-color,
|
|
437
|
+
var(--trees-icon-red)
|
|
438
|
+
);
|
|
439
|
+
--trees-file-icon-color-prettier: var(
|
|
440
|
+
--trees-file-icon-color,
|
|
441
|
+
var(--trees-icon-teal)
|
|
442
|
+
);
|
|
443
|
+
--trees-file-icon-color-python: var(
|
|
444
|
+
--trees-file-icon-color,
|
|
445
|
+
var(--trees-icon-blue)
|
|
446
|
+
);
|
|
447
|
+
--trees-file-icon-color-react: var(
|
|
448
|
+
--trees-file-icon-color,
|
|
449
|
+
var(--trees-icon-cyan)
|
|
450
|
+
);
|
|
451
|
+
--trees-file-icon-color-ruby: var(
|
|
452
|
+
--trees-file-icon-color,
|
|
453
|
+
var(--trees-icon-red)
|
|
454
|
+
);
|
|
455
|
+
--trees-file-icon-color-rust: var(
|
|
456
|
+
--trees-file-icon-color,
|
|
457
|
+
var(--trees-icon-orange)
|
|
458
|
+
);
|
|
459
|
+
--trees-file-icon-color-sass: var(
|
|
460
|
+
--trees-file-icon-color,
|
|
461
|
+
var(--trees-icon-pink)
|
|
462
|
+
);
|
|
463
|
+
--trees-file-icon-color-svg: var(
|
|
464
|
+
--trees-file-icon-color,
|
|
465
|
+
var(--trees-icon-orange)
|
|
466
|
+
);
|
|
467
|
+
--trees-file-icon-color-svelte: var(
|
|
468
|
+
--trees-file-icon-color,
|
|
469
|
+
var(--trees-icon-red)
|
|
470
|
+
);
|
|
471
|
+
--trees-file-icon-color-svgo: var(
|
|
472
|
+
--trees-file-icon-color,
|
|
473
|
+
var(--trees-icon-green)
|
|
474
|
+
);
|
|
475
|
+
--trees-file-icon-color-swift: var(
|
|
476
|
+
--trees-file-icon-color,
|
|
477
|
+
var(--trees-icon-orange)
|
|
478
|
+
);
|
|
479
|
+
--trees-file-icon-color-table: var(
|
|
480
|
+
--trees-file-icon-color,
|
|
481
|
+
var(--trees-icon-teal)
|
|
482
|
+
);
|
|
483
|
+
--trees-file-icon-color-text: var(
|
|
484
|
+
--trees-file-icon-color,
|
|
485
|
+
var(--trees-icon-gray)
|
|
486
|
+
);
|
|
487
|
+
--trees-file-icon-color-tailwind: var(
|
|
488
|
+
--trees-file-icon-color,
|
|
489
|
+
var(--trees-icon-cyan)
|
|
490
|
+
);
|
|
491
|
+
--trees-file-icon-color-terraform: var(
|
|
492
|
+
--trees-file-icon-color,
|
|
493
|
+
var(--trees-icon-indigo)
|
|
494
|
+
);
|
|
495
|
+
--trees-file-icon-color-typescript: var(
|
|
496
|
+
--trees-file-icon-color,
|
|
497
|
+
var(--trees-icon-blue)
|
|
498
|
+
);
|
|
499
|
+
--trees-file-icon-color-vite: var(
|
|
500
|
+
--trees-file-icon-color,
|
|
501
|
+
var(--trees-icon-purple)
|
|
502
|
+
);
|
|
503
|
+
--trees-file-icon-color-vscode: var(
|
|
504
|
+
--trees-file-icon-color,
|
|
505
|
+
var(--trees-icon-blue)
|
|
506
|
+
);
|
|
507
|
+
--trees-file-icon-color-vue: var(
|
|
508
|
+
--trees-file-icon-color,
|
|
509
|
+
var(--trees-icon-green)
|
|
510
|
+
);
|
|
511
|
+
--trees-file-icon-color-wasm: var(
|
|
512
|
+
--trees-file-icon-color,
|
|
513
|
+
var(--trees-icon-indigo)
|
|
514
|
+
);
|
|
515
|
+
--trees-file-icon-color-webpack: var(
|
|
516
|
+
--trees-file-icon-color,
|
|
517
|
+
var(--trees-icon-blue)
|
|
518
|
+
);
|
|
519
|
+
--trees-file-icon-color-yml: var(
|
|
520
|
+
--trees-file-icon-color,
|
|
521
|
+
var(--trees-icon-red)
|
|
522
|
+
);
|
|
523
|
+
--trees-file-icon-color-zig: var(
|
|
524
|
+
--trees-file-icon-color,
|
|
525
|
+
var(--trees-icon-orange)
|
|
526
|
+
);
|
|
527
|
+
--trees-file-icon-color-zip: var(
|
|
528
|
+
--trees-file-icon-color,
|
|
529
|
+
var(--trees-icon-orange)
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
--trees-level-gap: var(
|
|
533
|
+
--trees-level-gap-override,
|
|
534
|
+
calc(8px * var(--trees-density))
|
|
535
|
+
);
|
|
536
|
+
--trees-item-padding-x: var(
|
|
537
|
+
--trees-item-padding-x-override,
|
|
538
|
+
calc(8px * var(--trees-density))
|
|
539
|
+
);
|
|
540
|
+
--trees-item-margin-x: var(
|
|
541
|
+
--trees-item-margin-x-override,
|
|
542
|
+
calc(2px * var(--trees-density))
|
|
543
|
+
);
|
|
544
|
+
--trees-item-row-gap: var(
|
|
545
|
+
--trees-item-row-gap-override,
|
|
546
|
+
calc(6px * var(--trees-density))
|
|
547
|
+
);
|
|
548
|
+
--trees-icon-width: var(--trees-icon-width-override, 16px);
|
|
549
|
+
--trees-icon-nudge: var(
|
|
550
|
+
--trees-icon-nudge-override,
|
|
551
|
+
calc(1px * var(--trees-density))
|
|
552
|
+
);
|
|
553
|
+
--trees-row-height: var(--trees-item-height, 30px);
|
|
554
|
+
--trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
|
|
555
|
+
--trees-action-lane-width: var(
|
|
556
|
+
--trees-action-lane-width-override,
|
|
557
|
+
calc(var(--trees-icon-width) + 2px)
|
|
558
|
+
);
|
|
559
|
+
/* Keep the floating trigger aligned with the row's action lane. Going in
|
|
560
|
+
from the root's right edge: the scroll container reserves
|
|
561
|
+
\`--trees-padding-inline\` of effective inset on each side (its asymmetric
|
|
562
|
+
padding formula cancels the scrollbar gutter on the right), the row
|
|
563
|
+
sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
|
|
564
|
+
action lane itself. The trigger's own focus-ring margin then trims one
|
|
565
|
+
pixel back so the button's visible right edge lines up with the lane. */
|
|
566
|
+
--trees-context-menu-trigger-inline-offset: calc(
|
|
567
|
+
var(--trees-padding-inline) + var(--trees-item-padding-x) -
|
|
568
|
+
var(--trees-focus-ring-width)
|
|
569
|
+
);
|
|
570
|
+
|
|
571
|
+
--trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
|
|
572
|
+
--trees-padding-inline: var(--trees-padding-inline-override, 16px);
|
|
573
|
+
|
|
574
|
+
color-scheme: light dark;
|
|
575
|
+
display: flex;
|
|
576
|
+
flex-direction: column;
|
|
577
|
+
font-size: var(--trees-font-size);
|
|
578
|
+
color: var(--trees-fg);
|
|
579
|
+
background-color: var(--trees-bg);
|
|
580
|
+
--truncate-marker-background-color: var(--trees-bg);
|
|
581
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
582
|
+
font-family: var(--trees-font-family);
|
|
583
|
+
font-weight: var(--trees-font-weight-regular);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
:host([data-file-tree-virtualized='true']) {
|
|
587
|
+
height: 100%;
|
|
588
|
+
overflow: hidden;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
[data-file-tree-virtualized-wrapper='true'] {
|
|
592
|
+
height: 100%;
|
|
593
|
+
overflow: hidden;
|
|
594
|
+
display: flex;
|
|
595
|
+
flex-direction: column;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
[data-file-tree-virtualized-root='true'] {
|
|
599
|
+
height: 100%;
|
|
600
|
+
display: flex;
|
|
601
|
+
flex-direction: column;
|
|
602
|
+
overflow: hidden;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
[data-file-tree-virtualized-scroll='true'],
|
|
606
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
607
|
+
--trees-scrollbar-thumb-current: transparent;
|
|
608
|
+
overflow-y: auto;
|
|
609
|
+
scrollbar-gutter: stable;
|
|
610
|
+
|
|
611
|
+
&:hover {
|
|
612
|
+
--trees-scrollbar-thumb-current: var(--trees-scrollbar-thumb);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
&::-webkit-scrollbar {
|
|
616
|
+
width: var(--trees-scrollbar-gutter);
|
|
617
|
+
height: var(--trees-scrollbar-gutter);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
&::-webkit-scrollbar-track {
|
|
621
|
+
background: transparent;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
&::-webkit-scrollbar-thumb {
|
|
625
|
+
background-color: var(--trees-scrollbar-thumb-current);
|
|
626
|
+
border: 1px solid transparent;
|
|
627
|
+
background-clip: content-box;
|
|
628
|
+
border-radius: calc(var(--trees-scrollbar-gutter) / 2);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
&::-webkit-scrollbar-corner {
|
|
632
|
+
background-color: transparent;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/* These are styles for a temporarily generated element to measure the size
|
|
637
|
+
* of the scrollbar. It's intended to be somewhat similar in scrollbar style
|
|
638
|
+
* scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
|
|
639
|
+
* accurate reflection of the size the scrollbar gutter takes up. */
|
|
640
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
641
|
+
position: absolute;
|
|
642
|
+
top: 0;
|
|
643
|
+
left: 0;
|
|
644
|
+
visibility: hidden;
|
|
645
|
+
pointer-events: none;
|
|
646
|
+
width: 100px;
|
|
647
|
+
height: 100px;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
@supports (-moz-appearance: none) {
|
|
651
|
+
[data-file-tree-virtualized-scroll='true'],
|
|
652
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
653
|
+
scrollbar-width: thin;
|
|
654
|
+
scrollbar-color: var(--trees-scrollbar-thumb-current) transparent;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[data-file-tree-virtualized-scroll='true'] {
|
|
659
|
+
position: relative;
|
|
660
|
+
overflow-y: auto;
|
|
661
|
+
flex: 1 1 0;
|
|
662
|
+
min-height: 0;
|
|
663
|
+
padding-inline: max(
|
|
664
|
+
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
665
|
+
0px
|
|
666
|
+
)
|
|
667
|
+
/* NOTE(amadeus): We can assume that all Webkit based browser gutters
|
|
668
|
+
* will align to the value of '--trees-scrollbar-gutter', however if not, then
|
|
669
|
+
* \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
|
|
670
|
+
* hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
|
|
671
|
+
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
672
|
+
*/
|
|
673
|
+
max(
|
|
674
|
+
calc(
|
|
675
|
+
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
676
|
+
var(
|
|
677
|
+
--trees-scrollbar-gutter-measured,
|
|
678
|
+
var(--trees-scrollbar-gutter)
|
|
679
|
+
)
|
|
680
|
+
),
|
|
681
|
+
0px
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
@supports (-moz-appearance: none) {
|
|
686
|
+
[data-file-tree-virtualized-scroll='true'] {
|
|
687
|
+
padding-inline: max(
|
|
688
|
+
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
689
|
+
0px
|
|
690
|
+
)
|
|
691
|
+
/* NOTE(amadeus): However on Firefox it can vary a little bit, but most
|
|
692
|
+
* likely the majority of cases will default to a 0px width scrollbar lets
|
|
693
|
+
* inherit that first to avoid SSR jumps. In non-SSR'd environments
|
|
694
|
+
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
695
|
+
*/
|
|
696
|
+
max(
|
|
697
|
+
calc(
|
|
698
|
+
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
699
|
+
var(--trees-scrollbar-gutter-measured, 0px)
|
|
700
|
+
),
|
|
701
|
+
0px
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
[data-file-tree-sticky-overlay='true'] {
|
|
707
|
+
position: sticky;
|
|
708
|
+
top: 0;
|
|
709
|
+
height: 0;
|
|
710
|
+
z-index: 4;
|
|
711
|
+
overflow: visible;
|
|
712
|
+
pointer-events: none;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/* The overlay DOM is kept populated even at scrollTop=0 so the browser has
|
|
716
|
+
* the rendered rows on hand the moment scrolling begins — otherwise the
|
|
717
|
+
* compositor paints a scrolled frame before React can mount the overlay,
|
|
718
|
+
* and the topmost sticky folder jumps up by a couple of pixels before it
|
|
719
|
+
* "snaps" into its pinned position. We hide it via CSS whenever the scroll
|
|
720
|
+
* is at the top and no scroll is in progress, so the preview doesn't leak
|
|
721
|
+
* through at rest. \`data-overlay-reveal\` is stamped on the root only when
|
|
722
|
+
* the user initiates a scroll while already at the top — exactly the case
|
|
723
|
+
* where we need the pre-mounted overlay to be visible through the first
|
|
724
|
+
* compositor frame. It is deliberately distinct from the general
|
|
725
|
+
* \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
|
|
726
|
+
* navigation) re-hides the overlay the instant the scroll lands, rather
|
|
727
|
+
* than waiting for the hover-suppression timer to elapse. */
|
|
728
|
+
[data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
|
|
729
|
+
[data-overlay-reveal]
|
|
730
|
+
)
|
|
731
|
+
[data-file-tree-sticky-overlay='true'] {
|
|
732
|
+
visibility: hidden;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
[data-file-tree-sticky-overlay-content='true'] {
|
|
736
|
+
background-color: var(--trees-bg);
|
|
737
|
+
position: relative;
|
|
738
|
+
pointer-events: none;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
[data-file-tree-virtualized-list='true'] {
|
|
742
|
+
background-color: var(--trees-bg);
|
|
743
|
+
position: relative;
|
|
744
|
+
min-height: 100%;
|
|
745
|
+
width: 100%;
|
|
746
|
+
overflow-anchor: none;
|
|
747
|
+
|
|
748
|
+
&[data-is-scrolling] {
|
|
749
|
+
pointer-events: none;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
[data-file-tree-virtualized-sticky-offset='true'] {
|
|
754
|
+
contain: layout size;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
[data-file-tree-virtualized-sticky='true'] {
|
|
758
|
+
position: sticky;
|
|
759
|
+
top: 0;
|
|
760
|
+
width: 100%;
|
|
761
|
+
display: flex;
|
|
762
|
+
flex-direction: column;
|
|
763
|
+
isolation: isolate;
|
|
764
|
+
/* Promote to its own compositor layer so text inside the window is
|
|
765
|
+
* rasterized once and GPU-translated during scroll. Without this, the
|
|
766
|
+
* browser re-paints the window (and its text) at every scroll frame,
|
|
767
|
+
* which produces visible 1px shake / character tearing. */
|
|
768
|
+
will-change: transform;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
[data-file-tree-search-container] {
|
|
772
|
+
display: flex;
|
|
773
|
+
padding: 0;
|
|
774
|
+
padding-inline: var(--trees-padding-inline);
|
|
775
|
+
margin-bottom: var(--trees-item-row-gap);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
[data-file-tree-search-input] {
|
|
779
|
+
--trees-focus-ring-width: 2px;
|
|
780
|
+
font-family: var(--trees-font-family);
|
|
781
|
+
font-size: var(--trees-font-size);
|
|
782
|
+
flex: 1;
|
|
783
|
+
height: var(--trees-row-height);
|
|
784
|
+
/* 1px breathing room so the focus-visible outline isn't clipped when the
|
|
785
|
+
* input sits flush against the top of the scroll container. */
|
|
786
|
+
margin-block: 1px;
|
|
787
|
+
padding-inline: var(--trees-item-padding-x);
|
|
788
|
+
line-height: var(--trees-row-height);
|
|
789
|
+
color: var(--trees-search-fg);
|
|
790
|
+
background-color: var(--trees-search-bg);
|
|
791
|
+
border: 1px solid var(--trees-border-color);
|
|
792
|
+
border-radius: var(--trees-border-radius);
|
|
793
|
+
outline: none;
|
|
794
|
+
|
|
795
|
+
&::placeholder {
|
|
796
|
+
color: color-mix(
|
|
797
|
+
in lab,
|
|
798
|
+
var(--trees-search-fg) 65%,
|
|
799
|
+
var(--trees-search-bg)
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
&:focus-visible,
|
|
804
|
+
&[data-file-tree-search-input-fake-focus='true'] {
|
|
805
|
+
outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
|
|
806
|
+
outline-offset: var(--trees-focus-ring-offset);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/* The wrapper for the tree items */
|
|
811
|
+
[role='tree'] {
|
|
812
|
+
position: relative;
|
|
813
|
+
display: flex;
|
|
814
|
+
flex-direction: column;
|
|
815
|
+
gap: var(--trees-gap-override, 0);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/* LIST ITEM */
|
|
819
|
+
[data-type='item'] {
|
|
820
|
+
color: inherit;
|
|
821
|
+
font-family: var(--trees-font-family);
|
|
822
|
+
font-size: var(--trees-font-size);
|
|
823
|
+
text-align: start;
|
|
824
|
+
outline: none;
|
|
825
|
+
background-color: var(--trees-bg);
|
|
826
|
+
border: none;
|
|
827
|
+
position: relative;
|
|
828
|
+
|
|
829
|
+
padding: 0 var(--trees-item-padding-x);
|
|
830
|
+
margin: 0 var(--trees-item-margin-x);
|
|
831
|
+
cursor: pointer;
|
|
832
|
+
-webkit-user-select: none;
|
|
833
|
+
user-select: none;
|
|
834
|
+
-webkit-touch-callout: none;
|
|
835
|
+
touch-action: manipulation;
|
|
836
|
+
display: flex;
|
|
837
|
+
flex: 0 0 var(--trees-row-height);
|
|
838
|
+
align-items: center;
|
|
839
|
+
height: var(--trees-row-height);
|
|
840
|
+
line-height: var(--trees-row-height);
|
|
841
|
+
gap: var(--trees-item-row-gap);
|
|
842
|
+
border-radius: var(--trees-border-radius);
|
|
843
|
+
/* Row states may be translucent, so markers paint the tree background first
|
|
844
|
+
* and then the state color on top to avoid compositing the same alpha twice. */
|
|
845
|
+
--truncate-marker-background-color: var(--trees-bg);
|
|
846
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
847
|
+
--truncate-marker-block-inset: 0px;
|
|
848
|
+
|
|
849
|
+
&:hover,
|
|
850
|
+
&[data-item-context-hover='true'] {
|
|
851
|
+
background-color: var(--trees-bg-muted);
|
|
852
|
+
--truncate-marker-background-overlay-color: var(--trees-bg-muted);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
&[data-item-focused='true'],
|
|
856
|
+
&:focus-visible {
|
|
857
|
+
z-index: 2;
|
|
858
|
+
|
|
859
|
+
/* Flattened segment markers sit high enough to cover the row outline unless
|
|
860
|
+
* their painted background is inset by the focus ring width. */
|
|
861
|
+
[data-item-flattened-subitems] {
|
|
862
|
+
--truncate-marker-block-inset: var(--trees-focus-ring-width);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
&::before {
|
|
866
|
+
position: absolute;
|
|
867
|
+
inset: 0;
|
|
868
|
+
content: '';
|
|
869
|
+
display: block;
|
|
870
|
+
border-radius: var(--trees-border-radius);
|
|
871
|
+
outline: var(--trees-focus-ring-width) solid
|
|
872
|
+
var(--trees-focus-ring-color);
|
|
873
|
+
outline-offset: var(--trees-focus-ring-offset);
|
|
874
|
+
pointer-events: none;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
&[data-item-selected='true']::before {
|
|
878
|
+
outline-color: var(--trees-selected-focused-border-color);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
&[data-item-selected='true'] {
|
|
883
|
+
color: var(--trees-selected-fg);
|
|
884
|
+
background-color: var(--trees-selected-bg);
|
|
885
|
+
--truncate-marker-background-overlay-color: var(--trees-selected-bg);
|
|
886
|
+
z-index: 3;
|
|
887
|
+
|
|
888
|
+
[data-item-section='icon'] {
|
|
889
|
+
color: var(--trees-selected-fg);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
&[data-item-search-match='true'] {
|
|
894
|
+
font-weight: var(--trees-search-font-weight);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
899
|
+
pointer-events: auto;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/* Sticky rows opt back into pointer events because the overlay wrapper is
|
|
903
|
+
* inert. During scroll, put them back under the same hover suppression as
|
|
904
|
+
* the virtualized list so translucent hover states and menu triggers do not
|
|
905
|
+
* paint over rows moving beneath the sticky stack. */
|
|
906
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
907
|
+
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
908
|
+
pointer-events: none;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
912
|
+
[data-type='item'][data-file-tree-sticky-row='true']:hover:not(
|
|
913
|
+
[data-item-selected='true']
|
|
914
|
+
),
|
|
915
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
916
|
+
[data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
|
|
917
|
+
[data-item-selected='true']
|
|
918
|
+
) {
|
|
919
|
+
background-color: var(--trees-bg);
|
|
920
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
[data-item-selected='true']:has(+ [data-item-selected='true']) {
|
|
924
|
+
border-bottom-left-radius: 0;
|
|
925
|
+
border-bottom-right-radius: 0;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
[data-item-selected='true'] + [data-item-selected='true'] {
|
|
929
|
+
border-top-left-radius: 0;
|
|
930
|
+
border-top-right-radius: 0;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/* Flattened Directory Parts */
|
|
934
|
+
[data-item-flattened-subitems] {
|
|
935
|
+
display: inline-flex;
|
|
936
|
+
align-items: center;
|
|
937
|
+
gap: 2px;
|
|
938
|
+
}
|
|
939
|
+
[data-item-flattened-subitem]:hover,
|
|
940
|
+
[data-item-flattened-subitem-drag-target='true'] {
|
|
941
|
+
text-decoration: underline;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/* Icon for each item */
|
|
945
|
+
[data-item-section='icon'] {
|
|
946
|
+
flex-shrink: 0;
|
|
947
|
+
display: flex;
|
|
948
|
+
align-items: center;
|
|
949
|
+
justify-content: center;
|
|
950
|
+
color: var(--trees-fg-muted);
|
|
951
|
+
fill: currentColor;
|
|
952
|
+
width: var(--trees-icon-width);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
:where([data-item-section='icon'] > [data-icon-token]) {
|
|
956
|
+
color: var(--trees-fg-muted);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-file-tree-colored-icons='true'] {
|
|
960
|
+
[data-icon-token='astro'] {
|
|
961
|
+
color: var(--trees-file-icon-color-astro);
|
|
962
|
+
}
|
|
963
|
+
[data-icon-token='babel'] {
|
|
964
|
+
color: var(--trees-file-icon-color-babel);
|
|
965
|
+
}
|
|
966
|
+
[data-icon-token='bash'] {
|
|
967
|
+
color: var(--trees-file-icon-color-bash);
|
|
968
|
+
}
|
|
969
|
+
[data-icon-token='biome'] {
|
|
970
|
+
color: var(--trees-file-icon-color-biome);
|
|
971
|
+
}
|
|
972
|
+
[data-icon-token='bootstrap'] {
|
|
973
|
+
color: var(--trees-file-icon-color-bootstrap);
|
|
974
|
+
}
|
|
975
|
+
[data-icon-token='browserslist'] {
|
|
976
|
+
color: var(--trees-file-icon-color-browserslist);
|
|
977
|
+
}
|
|
978
|
+
[data-icon-token='bun'] {
|
|
979
|
+
color: var(--trees-file-icon-color-bun);
|
|
980
|
+
}
|
|
981
|
+
[data-icon-token='c'] {
|
|
982
|
+
color: var(--trees-file-icon-color-c);
|
|
983
|
+
}
|
|
984
|
+
[data-icon-token='cpp'] {
|
|
985
|
+
color: var(--trees-file-icon-color-cpp);
|
|
986
|
+
}
|
|
987
|
+
[data-icon-token='claude'] {
|
|
988
|
+
color: var(--trees-file-icon-color-claude);
|
|
989
|
+
}
|
|
990
|
+
[data-icon-token='css'] {
|
|
991
|
+
color: var(--trees-file-icon-color-css);
|
|
992
|
+
}
|
|
993
|
+
[data-icon-token='database'] {
|
|
994
|
+
color: var(--trees-file-icon-color-database);
|
|
995
|
+
}
|
|
996
|
+
[data-icon-token='default'] {
|
|
997
|
+
color: var(--trees-file-icon-color-default);
|
|
998
|
+
}
|
|
999
|
+
[data-icon-token='docker'] {
|
|
1000
|
+
color: var(--trees-file-icon-color-docker);
|
|
1001
|
+
}
|
|
1002
|
+
[data-icon-token='eslint'] {
|
|
1003
|
+
color: var(--trees-file-icon-color-eslint);
|
|
1004
|
+
}
|
|
1005
|
+
[data-icon-token='git'] {
|
|
1006
|
+
color: var(--trees-file-icon-color-git);
|
|
1007
|
+
}
|
|
1008
|
+
[data-icon-token='go'] {
|
|
1009
|
+
color: var(--trees-file-icon-color-go);
|
|
1010
|
+
}
|
|
1011
|
+
[data-icon-token='graphql'] {
|
|
1012
|
+
color: var(--trees-file-icon-color-graphql);
|
|
1013
|
+
}
|
|
1014
|
+
[data-icon-token='html'] {
|
|
1015
|
+
color: var(--trees-file-icon-color-html);
|
|
1016
|
+
}
|
|
1017
|
+
[data-icon-token='image'] {
|
|
1018
|
+
color: var(--trees-file-icon-color-image);
|
|
1019
|
+
}
|
|
1020
|
+
[data-icon-token='javascript'] {
|
|
1021
|
+
color: var(--trees-file-icon-color-javascript);
|
|
1022
|
+
}
|
|
1023
|
+
[data-icon-token='json'] {
|
|
1024
|
+
color: var(--trees-file-icon-color-json);
|
|
1025
|
+
}
|
|
1026
|
+
[data-icon-token='markdown'] {
|
|
1027
|
+
color: var(--trees-file-icon-color-markdown);
|
|
1028
|
+
}
|
|
1029
|
+
[data-icon-token='mcp'] {
|
|
1030
|
+
color: var(--trees-file-icon-color-mcp);
|
|
1031
|
+
}
|
|
1032
|
+
[data-icon-token='npm'] {
|
|
1033
|
+
color: var(--trees-file-icon-color-npm);
|
|
1034
|
+
}
|
|
1035
|
+
[data-icon-token='oxc'] {
|
|
1036
|
+
color: var(--trees-file-icon-color-oxc);
|
|
1037
|
+
}
|
|
1038
|
+
[data-icon-token='postcss'] {
|
|
1039
|
+
color: var(--trees-file-icon-color-postcss);
|
|
1040
|
+
}
|
|
1041
|
+
[data-icon-token='prettier'] {
|
|
1042
|
+
color: var(--trees-file-icon-color-prettier);
|
|
1043
|
+
}
|
|
1044
|
+
[data-icon-token='python'] {
|
|
1045
|
+
color: var(--trees-file-icon-color-python);
|
|
1046
|
+
}
|
|
1047
|
+
[data-icon-token='react'] {
|
|
1048
|
+
color: var(--trees-file-icon-color-react);
|
|
1049
|
+
}
|
|
1050
|
+
[data-icon-token='ruby'] {
|
|
1051
|
+
color: var(--trees-file-icon-color-ruby);
|
|
1052
|
+
}
|
|
1053
|
+
[data-icon-token='rust'] {
|
|
1054
|
+
color: var(--trees-file-icon-color-rust);
|
|
1055
|
+
}
|
|
1056
|
+
[data-icon-token='sass'] {
|
|
1057
|
+
color: var(--trees-file-icon-color-sass);
|
|
1058
|
+
}
|
|
1059
|
+
[data-icon-token='svg'] {
|
|
1060
|
+
color: var(--trees-file-icon-color-svg);
|
|
1061
|
+
}
|
|
1062
|
+
[data-icon-token='svelte'] {
|
|
1063
|
+
color: var(--trees-file-icon-color-svelte);
|
|
1064
|
+
}
|
|
1065
|
+
[data-icon-token='svgo'] {
|
|
1066
|
+
color: var(--trees-file-icon-color-svgo);
|
|
1067
|
+
}
|
|
1068
|
+
[data-icon-token='swift'] {
|
|
1069
|
+
color: var(--trees-file-icon-color-swift);
|
|
1070
|
+
}
|
|
1071
|
+
[data-icon-token='table'] {
|
|
1072
|
+
color: var(--trees-file-icon-color-table);
|
|
1073
|
+
}
|
|
1074
|
+
[data-icon-token='text'] {
|
|
1075
|
+
color: var(--trees-file-icon-color-text);
|
|
1076
|
+
}
|
|
1077
|
+
[data-icon-token='tailwind'] {
|
|
1078
|
+
color: var(--trees-file-icon-color-tailwind);
|
|
1079
|
+
}
|
|
1080
|
+
[data-icon-token='terraform'] {
|
|
1081
|
+
color: var(--trees-file-icon-color-terraform);
|
|
1082
|
+
}
|
|
1083
|
+
[data-icon-token='typescript'] {
|
|
1084
|
+
color: var(--trees-file-icon-color-typescript);
|
|
1085
|
+
}
|
|
1086
|
+
[data-icon-token='vite'] {
|
|
1087
|
+
color: var(--trees-file-icon-color-vite);
|
|
1088
|
+
}
|
|
1089
|
+
[data-icon-token='vscode'] {
|
|
1090
|
+
color: var(--trees-file-icon-color-vscode);
|
|
1091
|
+
}
|
|
1092
|
+
[data-icon-token='vue'] {
|
|
1093
|
+
color: var(--trees-file-icon-color-vue);
|
|
1094
|
+
}
|
|
1095
|
+
[data-icon-token='wasm'] {
|
|
1096
|
+
color: var(--trees-file-icon-color-wasm);
|
|
1097
|
+
}
|
|
1098
|
+
[data-icon-token='webpack'] {
|
|
1099
|
+
color: var(--trees-file-icon-color-webpack);
|
|
1100
|
+
}
|
|
1101
|
+
[data-icon-token='yml'] {
|
|
1102
|
+
color: var(--trees-file-icon-color-yml);
|
|
1103
|
+
}
|
|
1104
|
+
[data-icon-token='zig'] {
|
|
1105
|
+
color: var(--trees-file-icon-color-zig);
|
|
1106
|
+
}
|
|
1107
|
+
[data-icon-token='zip'] {
|
|
1108
|
+
color: var(--trees-file-icon-color-zip);
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/* Chevron rotation and visual alignment */
|
|
1113
|
+
/* Chevron pointing down */
|
|
1114
|
+
[data-icon-name='file-tree-icon-chevron'] {
|
|
1115
|
+
&[data-align-capitals='false'] {
|
|
1116
|
+
transform: translate(0, var(--trees-icon-nudge));
|
|
1117
|
+
}
|
|
1118
|
+
&[data-align-capitals='true'] {
|
|
1119
|
+
transform: translate(0, 0);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
[data-item-section='content'] {
|
|
1124
|
+
flex: 0 1 auto;
|
|
1125
|
+
text-align: start;
|
|
1126
|
+
min-width: 0;
|
|
1127
|
+
max-width: 100%;
|
|
1128
|
+
overflow: hidden;
|
|
1129
|
+
text-overflow: ellipsis;
|
|
1130
|
+
/* Breaks middle truncate component to also set this */
|
|
1131
|
+
/* white-space: nowrap; */
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
[data-item-section='decoration'] {
|
|
1135
|
+
flex: 1 1 0;
|
|
1136
|
+
min-width: 0;
|
|
1137
|
+
display: flex;
|
|
1138
|
+
justify-content: flex-end;
|
|
1139
|
+
text-align: end;
|
|
1140
|
+
overflow: hidden;
|
|
1141
|
+
color: var(--trees-fg-muted);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
[data-item-section='decoration'] > span {
|
|
1145
|
+
min-width: 0;
|
|
1146
|
+
max-width: 100%;
|
|
1147
|
+
display: inline-flex;
|
|
1148
|
+
align-items: center;
|
|
1149
|
+
justify-content: flex-end;
|
|
1150
|
+
overflow: hidden;
|
|
1151
|
+
text-overflow: ellipsis;
|
|
1152
|
+
white-space: nowrap;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
[data-item-section='git'],
|
|
1156
|
+
[data-item-section='action'] {
|
|
1157
|
+
flex: 0 0 auto;
|
|
1158
|
+
display: flex;
|
|
1159
|
+
align-items: center;
|
|
1160
|
+
justify-content: center;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
[data-item-section='git'] {
|
|
1164
|
+
width: var(--trees-git-lane-width);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
[data-item-section='action'] {
|
|
1168
|
+
width: var(--trees-action-lane-width);
|
|
1169
|
+
color: var(--trees-fg-muted);
|
|
1170
|
+
fill: currentColor;
|
|
1171
|
+
pointer-events: none;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
[data-item-section='git'] > span,
|
|
1175
|
+
[data-item-section='action'] > span {
|
|
1176
|
+
width: 100%;
|
|
1177
|
+
display: inline-flex;
|
|
1178
|
+
align-items: center;
|
|
1179
|
+
justify-content: center;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
[data-item-action-affordance='decorative'] {
|
|
1183
|
+
opacity: 0.85;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
[data-item-rename-input] {
|
|
1187
|
+
appearance: none;
|
|
1188
|
+
width: 100%;
|
|
1189
|
+
min-width: 0;
|
|
1190
|
+
height: calc(var(--trees-row-height) - 4px);
|
|
1191
|
+
font-family: inherit;
|
|
1192
|
+
font-size: inherit;
|
|
1193
|
+
/* line-height: calc(var(--trees-row-height) - 8px); */
|
|
1194
|
+
color: inherit;
|
|
1195
|
+
background-color: transparent;
|
|
1196
|
+
border: 0;
|
|
1197
|
+
padding-inline: 6px;
|
|
1198
|
+
outline: none;
|
|
1199
|
+
box-sizing: border-box;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
[data-item-section='content']:has([data-item-rename-input])
|
|
1203
|
+
~ [data-item-section='action'],
|
|
1204
|
+
[data-item-section='content']:has([data-item-rename-input])
|
|
1205
|
+
~ [data-item-section='decoration'] {
|
|
1206
|
+
display: none;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/* Chevron pointing right */
|
|
1210
|
+
[aria-expanded='false'][data-item-type='folder']
|
|
1211
|
+
> [data-item-section='icon']
|
|
1212
|
+
> [data-icon-name='file-tree-icon-chevron'] {
|
|
1213
|
+
&[data-align-capitals='true'] {
|
|
1214
|
+
transform: rotate(-90deg)
|
|
1215
|
+
translate(
|
|
1216
|
+
calc(var(--trees-icon-nudge) / 2),
|
|
1217
|
+
calc(var(--trees-icon-nudge) / 2)
|
|
1218
|
+
);
|
|
1219
|
+
}
|
|
1220
|
+
&[data-align-capitals='false'] {
|
|
1221
|
+
transform: rotate(-90deg)
|
|
1222
|
+
translate(
|
|
1223
|
+
calc(var(--trees-icon-nudge) / 2 * -1),
|
|
1224
|
+
calc(var(--trees-icon-nudge) / 2)
|
|
1225
|
+
);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/* LIST IDENTATION */
|
|
1230
|
+
/* Spacing container */
|
|
1231
|
+
[data-item-section='spacing'] {
|
|
1232
|
+
display: flex;
|
|
1233
|
+
flex-direction: row;
|
|
1234
|
+
align-items: center;
|
|
1235
|
+
justify-content: center;
|
|
1236
|
+
height: var(--trees-row-height);
|
|
1237
|
+
padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
|
|
1238
|
+
|
|
1239
|
+
&:empty {
|
|
1240
|
+
padding-left: 0;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/* Spacing per level */
|
|
1245
|
+
[data-item-section='spacing-item'] {
|
|
1246
|
+
transform: translateX(-0.25px);
|
|
1247
|
+
display: inline-block;
|
|
1248
|
+
border-left: 1px solid var(--trees-indent-guide-bg);
|
|
1249
|
+
height: 100%;
|
|
1250
|
+
margin-right: calc(var(--trees-level-gap) - 1px);
|
|
1251
|
+
opacity: 0;
|
|
1252
|
+
transition: opacity 150ms ease;
|
|
1253
|
+
|
|
1254
|
+
& + & {
|
|
1255
|
+
margin-left: calc(
|
|
1256
|
+
var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
:host(:hover) [data-item-section='spacing-item'] {
|
|
1262
|
+
opacity: 0.75;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/* Git status indicator */
|
|
1266
|
+
|
|
1267
|
+
/* This is a folder that contains a git change */
|
|
1268
|
+
[data-item-contains-git-change='true'] > [data-item-section='git'] {
|
|
1269
|
+
color: var(--trees-git-modified-color);
|
|
1270
|
+
opacity: 0.5;
|
|
1271
|
+
fill: currentColor;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
/* These are files that have a git change */
|
|
1275
|
+
[data-item-git-status] {
|
|
1276
|
+
&
|
|
1277
|
+
> :where([data-item-section='icon'])
|
|
1278
|
+
> :where(:not([data-icon-name='file-tree-icon-chevron'])) {
|
|
1279
|
+
color: var(--trees-item-git-status-color);
|
|
1280
|
+
}
|
|
1281
|
+
& > [data-item-section='content'] {
|
|
1282
|
+
color: var(--trees-item-git-status-color);
|
|
1283
|
+
}
|
|
1284
|
+
& > [data-item-section='git'] {
|
|
1285
|
+
color: var(--trees-item-git-status-color);
|
|
1286
|
+
font-weight: var(--trees-font-weight-semibold);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
[data-item-git-status='added'] {
|
|
1291
|
+
--trees-item-git-status-color: var(--trees-git-added-color);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
[data-item-git-status='deleted'] {
|
|
1295
|
+
--trees-item-git-status-color: var(--trees-git-deleted-color);
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
[data-item-git-status='ignored'] {
|
|
1299
|
+
--trees-item-git-status-color: var(--trees-git-ignored-color);
|
|
1300
|
+
|
|
1301
|
+
& > [data-item-section='icon'] {
|
|
1302
|
+
opacity: 0.5;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
[data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
|
|
1307
|
+
/* this is a nudge to align the dot with the likely lowercase text. it's slightly
|
|
1308
|
+
generalizable, but other fonts are gonna need other nudges i assume */
|
|
1309
|
+
transform: translateY(calc(0.65ex - 50%));
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
[data-item-git-status='modified'] {
|
|
1313
|
+
--trees-item-git-status-color: var(--trees-git-modified-color);
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
[data-item-git-status='renamed'] {
|
|
1317
|
+
--trees-item-git-status-color: var(--trees-git-renamed-color);
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
[data-item-git-status='untracked'] {
|
|
1321
|
+
--trees-item-git-status-color: var(--trees-git-untracked-color);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
/* Drag and drop */
|
|
1325
|
+
[data-item-drag-target='true'] {
|
|
1326
|
+
background-color: var(--trees-selected-bg);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
[data-item-dragging='true'] {
|
|
1330
|
+
opacity: 0.5;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/* Lock icon for locked paths (sibling of content) */
|
|
1334
|
+
[data-item-section='lock'] {
|
|
1335
|
+
flex: 0 0 auto;
|
|
1336
|
+
margin-left: auto;
|
|
1337
|
+
display: flex;
|
|
1338
|
+
align-items: center;
|
|
1339
|
+
color: var(--trees-fg-muted);
|
|
1340
|
+
}
|
|
1341
|
+
[data-item-section='lock'] svg {
|
|
1342
|
+
display: block;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
[data-type='header-slot'] {
|
|
1346
|
+
display: block;
|
|
1347
|
+
flex: 0 0 auto;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
[data-type='context-menu-wash'] {
|
|
1351
|
+
position: absolute;
|
|
1352
|
+
inset: 0;
|
|
1353
|
+
z-index: 3;
|
|
1354
|
+
background-color: transparent;
|
|
1355
|
+
touch-action: none;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
[data-type='context-menu-anchor'] {
|
|
1359
|
+
position: absolute;
|
|
1360
|
+
top: 0;
|
|
1361
|
+
right: var(--trees-context-menu-trigger-inline-offset);
|
|
1362
|
+
z-index: 4;
|
|
1363
|
+
display: none;
|
|
1364
|
+
align-items: center;
|
|
1365
|
+
|
|
1366
|
+
&[data-visible='true'] {
|
|
1367
|
+
display: flex;
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/* Hide the floating trigger while the scroll container is actively moving.
|
|
1372
|
+
* The anchor is positioned against the root, not the scroll content, so its
|
|
1373
|
+
* \`top\` follows the row via a React state update — one frame behind the
|
|
1374
|
+
* compositor. That delay is visible as the trigger hovering over the wrong
|
|
1375
|
+
* row during the first frame of a scroll. The \`data-is-scrolling\` flag on
|
|
1376
|
+
* the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
|
|
1377
|
+
* the compositor commits the next paint, so this selector hides the anchor
|
|
1378
|
+
* in the same frame the scroll begins. */
|
|
1379
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1380
|
+
[data-type='context-menu-anchor'] {
|
|
1381
|
+
display: none;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
[data-type='context-menu-anchor'] > slot[name='context-menu'] {
|
|
1385
|
+
display: block;
|
|
1386
|
+
width: 0;
|
|
1387
|
+
min-width: 0;
|
|
1388
|
+
flex: 0 0 0;
|
|
1389
|
+
overflow: visible;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
/* Single floating context menu trigger */
|
|
1393
|
+
[data-type='context-menu-trigger'] {
|
|
1394
|
+
all: unset;
|
|
1395
|
+
align-items: center;
|
|
1396
|
+
justify-content: center;
|
|
1397
|
+
width: var(--trees-action-lane-width);
|
|
1398
|
+
color: var(--trees-fg-muted);
|
|
1399
|
+
fill: currentColor;
|
|
1400
|
+
cursor: pointer;
|
|
1401
|
+
font-family: var(--trees-font-family);
|
|
1402
|
+
font-size: var(--trees-font-size);
|
|
1403
|
+
border-top-right-radius: var(--trees-border-radius);
|
|
1404
|
+
border-bottom-right-radius: var(--trees-border-radius);
|
|
1405
|
+
margin: var(--trees-focus-ring-width);
|
|
1406
|
+
height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
|
|
1407
|
+
border-width: 0;
|
|
1408
|
+
transition: color 120ms ease;
|
|
1409
|
+
|
|
1410
|
+
display: flex;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
[data-type='context-menu-trigger']:hover,
|
|
1414
|
+
[data-type='context-menu-trigger'][aria-expanded='true'] {
|
|
1415
|
+
color: var(--trees-fg);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/** @pierre/truncate css here, manually copy pasted for now */
|
|
1419
|
+
[data-truncate-container] {
|
|
1420
|
+
/* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
|
|
1421
|
+
margin-top: -1px;
|
|
1422
|
+
margin-bottom: -1px;
|
|
1423
|
+
|
|
1424
|
+
/* Width of the fade from default marker to text */
|
|
1425
|
+
--truncate-internal-marker-fade-width: var(
|
|
1426
|
+
--truncate-marker-fade-width,
|
|
1427
|
+
2px
|
|
1428
|
+
);
|
|
1429
|
+
/* Width of the solid color between the fade from the default marker to the text */
|
|
1430
|
+
--truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
|
|
1431
|
+
/* Opacity of the marker 'color' property, not of the element itself */
|
|
1432
|
+
--truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
|
|
1433
|
+
/* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
|
|
1434
|
+
--truncate-internal-middle-marker-opacity: var(
|
|
1435
|
+
--truncate-middle-marker-opacity,
|
|
1436
|
+
80%
|
|
1437
|
+
);
|
|
1438
|
+
/* Background color of the default marker */
|
|
1439
|
+
--truncate-internal-marker-background-color: var(
|
|
1440
|
+
--truncate-marker-background-color,
|
|
1441
|
+
light-dark(white, black)
|
|
1442
|
+
);
|
|
1443
|
+
--truncate-internal-marker-background-overlay-color: var(
|
|
1444
|
+
--truncate-marker-background-overlay-color,
|
|
1445
|
+
transparent
|
|
1446
|
+
);
|
|
1447
|
+
--truncate-internal-marker-block-inset: var(
|
|
1448
|
+
--truncate-marker-block-inset,
|
|
1449
|
+
0px
|
|
1450
|
+
);
|
|
1451
|
+
/* Duration of the fade out animation for the marker */
|
|
1452
|
+
--truncate-internal-marker-fade-out-duration: var(
|
|
1453
|
+
--truncate-marker-fade-out-duration,
|
|
1454
|
+
0ms
|
|
1455
|
+
);
|
|
1456
|
+
/* Duration of the fade in animation for the marker */
|
|
1457
|
+
--truncate-internal-marker-fade-in-duration: var(
|
|
1458
|
+
--truncate-marker-fade-in-duration,
|
|
1459
|
+
100ms
|
|
1460
|
+
);
|
|
1461
|
+
|
|
1462
|
+
/* FADE Variant specifics */
|
|
1463
|
+
--truncate-internal-fade-marker-color: var(
|
|
1464
|
+
--truncate-fade-marker-color,
|
|
1465
|
+
#000
|
|
1466
|
+
);
|
|
1467
|
+
--truncate-internal-fade-marker-width: var(
|
|
1468
|
+
--truncate-fade-marker-width,
|
|
1469
|
+
0.2lh
|
|
1470
|
+
);
|
|
1471
|
+
|
|
1472
|
+
/*
|
|
1473
|
+
In some special cases people might be adding spacing in other ways
|
|
1474
|
+
that would benefit from being able to override this, however the container
|
|
1475
|
+
query below can't use this and would need to be redeclared with the overridden
|
|
1476
|
+
value. It's a bad time, but better than nothing.
|
|
1477
|
+
*/
|
|
1478
|
+
--truncate-internal-single-line-height: 1lh;
|
|
1479
|
+
|
|
1480
|
+
height: var(--truncate-internal-single-line-height);
|
|
1481
|
+
min-width: 0;
|
|
1482
|
+
overflow: hidden;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
[data-truncate-marker] {
|
|
1486
|
+
display: flex;
|
|
1487
|
+
position: absolute;
|
|
1488
|
+
height: var(--truncate-internal-single-line-height);
|
|
1489
|
+
padding-block: var(--truncate-internal-marker-block-inset);
|
|
1490
|
+
box-sizing: border-box;
|
|
1491
|
+
align-items: center;
|
|
1492
|
+
background-clip: content-box;
|
|
1493
|
+
z-index: 2;
|
|
1494
|
+
color: color-mix(
|
|
1495
|
+
in srgb,
|
|
1496
|
+
currentColor var(--truncate-internal-marker-opacity),
|
|
1497
|
+
transparent
|
|
1498
|
+
);
|
|
1499
|
+
|
|
1500
|
+
/* Core trick for hiding the marker until overflow occurs */
|
|
1501
|
+
opacity: 0;
|
|
1502
|
+
transition: opacity var(--truncate-internal-marker-fade-out-duration)
|
|
1503
|
+
ease-in-out;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
@container measure (height > 1lh) {
|
|
1507
|
+
[data-truncate-marker] {
|
|
1508
|
+
opacity: 1;
|
|
1509
|
+
transition: opacity var(--truncate-internal-marker-fade-in-duration)
|
|
1510
|
+
ease-in-out;
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
[data-truncate-grid] {
|
|
1515
|
+
display: grid;
|
|
1516
|
+
position: relative;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
[data-truncate-content='visible'] {
|
|
1520
|
+
white-space: nowrap;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
[data-truncate-content='overflow'] {
|
|
1524
|
+
opacity: 0;
|
|
1525
|
+
pointer-events: none;
|
|
1526
|
+
-webkit-user-select: none;
|
|
1527
|
+
user-select: none;
|
|
1528
|
+
word-break: break-all;
|
|
1529
|
+
margin-top: calc(-1 * var(--truncate-internal-single-line-height));
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
[data-truncate-marker-cell] {
|
|
1533
|
+
container: measure / size;
|
|
1534
|
+
overflow: visible;
|
|
1535
|
+
-webkit-user-select: none;
|
|
1536
|
+
user-select: none;
|
|
1537
|
+
pointer-events: none;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
[data-truncate-container='truncate'] {
|
|
1541
|
+
& [data-truncate-grid] {
|
|
1542
|
+
grid-template-columns: minmax(0, max-content) 0;
|
|
1543
|
+
}
|
|
1544
|
+
& [data-truncate-marker] {
|
|
1545
|
+
right: 0;
|
|
1546
|
+
}
|
|
1547
|
+
& [data-truncate-fade] {
|
|
1548
|
+
margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
[data-truncate-container='fruncate'] {
|
|
1553
|
+
& [data-truncate-grid] {
|
|
1554
|
+
grid-template-columns: 0 minmax(0, max-content) auto;
|
|
1555
|
+
}
|
|
1556
|
+
& [data-truncate-content] {
|
|
1557
|
+
direction: rtl;
|
|
1558
|
+
}
|
|
1559
|
+
& [data-truncate-content] > span {
|
|
1560
|
+
unicode-bidi: plaintext;
|
|
1561
|
+
}
|
|
1562
|
+
& [data-truncate-fade] {
|
|
1563
|
+
margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
[data-truncate-variant='default'] {
|
|
1568
|
+
& [data-truncate-marker] {
|
|
1569
|
+
background-color: var(--truncate-internal-marker-background-color);
|
|
1570
|
+
background-image: linear-gradient(
|
|
1571
|
+
var(--truncate-internal-marker-background-overlay-color),
|
|
1572
|
+
var(--truncate-internal-marker-background-overlay-color)
|
|
1573
|
+
);
|
|
1574
|
+
}
|
|
1575
|
+
& [data-truncate-marker]::after,
|
|
1576
|
+
& [data-truncate-marker]::before {
|
|
1577
|
+
content: '';
|
|
1578
|
+
position: absolute;
|
|
1579
|
+
width: calc(
|
|
1580
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1581
|
+
var(--truncate-internal-marker-gap)
|
|
1582
|
+
);
|
|
1583
|
+
inset-block-start: var(--truncate-internal-marker-block-inset);
|
|
1584
|
+
height: max(
|
|
1585
|
+
0px,
|
|
1586
|
+
calc(
|
|
1587
|
+
var(--truncate-internal-single-line-height) -
|
|
1588
|
+
var(--truncate-internal-marker-block-inset) * 2
|
|
1589
|
+
)
|
|
1590
|
+
);
|
|
1591
|
+
background-color: var(--truncate-internal-marker-background-color);
|
|
1592
|
+
background-image: linear-gradient(
|
|
1593
|
+
var(--truncate-internal-marker-background-overlay-color),
|
|
1594
|
+
var(--truncate-internal-marker-background-overlay-color)
|
|
1595
|
+
);
|
|
1596
|
+
mask-image: linear-gradient(
|
|
1597
|
+
var(--truncate-internal-fade-dir),
|
|
1598
|
+
#000 0%,
|
|
1599
|
+
#000 var(--truncate-internal-marker-gap),
|
|
1600
|
+
transparent 100%
|
|
1601
|
+
);
|
|
1602
|
+
}
|
|
1603
|
+
& [data-truncate-marker]::after {
|
|
1604
|
+
--truncate-internal-fade-dir: to right;
|
|
1605
|
+
right: calc(
|
|
1606
|
+
-1 *
|
|
1607
|
+
(
|
|
1608
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1609
|
+
var(--truncate-internal-marker-gap)
|
|
1610
|
+
)
|
|
1611
|
+
);
|
|
1612
|
+
}
|
|
1613
|
+
& [data-truncate-marker]::before {
|
|
1614
|
+
--truncate-internal-fade-dir: to left;
|
|
1615
|
+
left: calc(
|
|
1616
|
+
-1 *
|
|
1617
|
+
(
|
|
1618
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1619
|
+
var(--truncate-internal-marker-gap)
|
|
1620
|
+
)
|
|
1621
|
+
);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
[data-truncate-variant='fade'] {
|
|
1626
|
+
& [data-truncate-marker] {
|
|
1627
|
+
background: transparent;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
[data-truncate-fade] {
|
|
1632
|
+
box-shadow:
|
|
1633
|
+
0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
|
|
1634
|
+
var(--truncate-internal-fade-marker-color),
|
|
1635
|
+
0 0 var(--truncate-internal-fade-marker-width)
|
|
1636
|
+
var(--truncate-internal-fade-marker-color);
|
|
1637
|
+
width: calc(var(--truncate-internal-fade-marker-width) * 2);
|
|
1638
|
+
height: calc(
|
|
1639
|
+
var(--truncate-internal-single-line-height) -
|
|
1640
|
+
(var(--truncate-internal-fade-marker-width) * 2)
|
|
1641
|
+
);
|
|
1642
|
+
margin: var(--truncate-internal-fade-marker-width) 0;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
[data-truncate-group-container='middle'] {
|
|
1646
|
+
& [data-truncate-container] {
|
|
1647
|
+
--truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
display: flex;
|
|
1651
|
+
min-width: 0;
|
|
1652
|
+
|
|
1653
|
+
& > div {
|
|
1654
|
+
min-width: 0;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
& > div[data-truncate-segment-priority='1'] {
|
|
1658
|
+
flex: 0 1 max-content;
|
|
1659
|
+
}
|
|
1660
|
+
& > div[data-truncate-segment-priority='2'] {
|
|
1661
|
+
flex: 0 999999 max-content;
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
`,Pi=`@layer base, unsafe;`;function Fi(e){return`${Pi}
|
|
1666
|
+
@layer base {
|
|
1667
|
+
${e}
|
|
1668
|
+
}`}function Ii(e){return`${Pi}
|
|
1669
|
+
@layer unsafe {
|
|
1670
|
+
${e}
|
|
1671
|
+
}`}var Li=new WeakMap;function Ri(e){let t=Li.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute($e,`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(),Li.set(e,i),i}function zi(e,t){if(!e.isConnected)return;let n=Ri(t);if(n==null)return;let r=t.querySelector(`style[${et}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(et,``),t.appendChild(i)),i.textContent=`:host { ${tt}: ${n}px; }`}var Bi;function Vi(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Bi??(Bi=new CSSStyleSheet,Bi.replaceSync(Fi(Ni)));let t=!1;try{e.adoptedStyleSheets=[Bi],t=!0}catch{}if(t){e.querySelector(`style[${Ze}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Ze,``),t.textContent=Fi(Ni),e.prepend(t)}}function Hi(e,t){Ui(e,t),Vi(t),zi(e,t)}function Ui(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`});Hi(this,e)}}if(customElements.define(Xe,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Xe)))e instanceof HTMLElement&&Hi(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Wi=e=>e.startsWith(`f::`)?e.slice(3):e;function Gi(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Ki(e,t){return e===``?t:`${e}/${t}`}function qi({files:e,path:t,isFolder:n,nextBasename:r}){let i=Wi(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}=Gi(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Ki(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 Ji(e){return e.endsWith(`/`)}function Yi(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 Xi(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 Zi(e,t){return t.includes(e)?Xi(t):[e]}function Qi(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 $i(e,t){return{draggedPaths:e,target:t}}function ea(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Ji(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function ta(e,t){return t.kind===`root`||t.directoryPath==null?Yi(e):t.directoryPath}function na(e,t){let n=e.map(e=>{let n=ta(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function ra(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 ia(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(!ra(Oi.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 aa(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function oa(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 sa(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function ca(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 sa(e,t.path)?n?e:null:e;case`move`:return oa(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=ca(r,e,n),r==null)return null;return r}}}function la(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function ua(e){switch(e.operation){case`add`:return{...la(e),operation:`add`,path:e.path};case`remove`:return{...la(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...la(e),from:e.from,operation:`move`,to:e.to}}}function da(e){return{...la(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>ua(e)),operation:`batch`}}function fa(e){switch(e.operation){case`add`:case`remove`:case`move`:return ua(e);case`batch`:return da(e);default:return null}}function pa(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function ma(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 ha(e){return ma(e).at(-1)??null}function ga(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function _a(e){return e.endsWith(`/`)}var va=e=>e.toLowerCase();function ya(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function ba(e){return e.endsWith(`/`)?e.slice(0,-1):e}function xa(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var Sa=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},Ca=Symbol(`FILE_TREE_RENAME_VIEW`),wa=512,Ta=512;function Ea(e){return e===`top`||e===`center`?e:`nearest`}function Da(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=ma(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 Oa(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:Da(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var ka=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=ia({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=ha(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Ea(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Ta){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=Zi(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=$i(t.draggedPaths,n);(ea(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Qi(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=$i(e.draggedPaths,t);if(ea(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=na(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=_a(r),a=ba(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of ma(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=ya(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[Ca](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,_a(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,_a(e)?{recursive:!0}:void 0);return}let t=_a(e),n=qi({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:ba(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(xa(n.sourcePath,t),xa(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=ia({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!pa(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=ha(e),n=ga(e,t),r=null,i=null;for(let e of this.#be()){if(ha(e)!==t)continue;let a=ga(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=ma(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!pa(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Oi({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of ma(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(va),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(va),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of ma(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:Sa(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of ma(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of ma(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Oa(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,wa)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=ca(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=ca(this.#c,e,!0),r=[...this.#B].map(t=>ca(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=ca(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return pa(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&aa(e)&&(this.#i=null);let t=aa(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=fa(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},Aa=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 ja(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 Ma(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 Na(e,t){return t?`${e}/`:e}function Pa(e,t=null){let n=Aa(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=ja(t.path);if(e==null)continue;let n=Na(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 Ma(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var G,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa={},Ga=[],Ka=Array.isArray,qa=Ga.slice,Ja=Object.assign;function Ya(e){e&&e.parentNode&&e.remove()}function Xa(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?qa.call(arguments,2):n),Za(e,o,r,i,null)}function Za(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??++Fa,__i:-1,__u:0};return i==null&&G.vnode!=null&&G.vnode(a),a}function Qa(e){return e.children}function $a(e,t){this.props=e,this.context=t,this.__g=0}function eo(e,t){if(t==null)return e.__?eo(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`?eo(e):null}function to(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 to(e)}}function no(e){(8&e.__g||!(e.__g|=8)||!Ia.push(e)||Ra++)&&La==G.debounceRendering||((La=G.debounceRendering)||queueMicrotask)(ro)}function ro(){for(var e,t,n,r,i,a,o,s,c=1;Ia.length;)Ia.length>c&&Ia.sort(za),e=Ia.shift(),c=Ia.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Ja({},r)).__v=r.__v+1,G.vnode&&G.vnode(n),fo(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??eo(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,mo(a,n,o),n.__e!=i&&to(n)));Ra=0}function io(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Ga,b=t.length;for(c=ao(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Wa:y[m.__i]||Wa,m.__i=f,_=fo(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&_o(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=oo(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function ao(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?Za(null,o,null,null,null):Ka(o)?Za(Qa,{children:o},null,null,null):o.constructor==null&&o.__b>0?Za(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=so(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=eo(s)),vo(s,s));return r}function oo(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=oo(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=eo(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function so(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 co(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function lo(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||co(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||co(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Ba,`$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=Va,e.addEventListener(t,a?Ua:Ha,a)):e.removeEventListener(t,a?Ua:Ha,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 uo(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=Va++;else if(t.u<n.l)return;return n(G.event?G.event(t):t)}}}function fo(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,w,T,E,te,ne,D,O,k=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=G.__b)&&d(t);n:if(typeof k==`function`)try{if(v=t.props,y=`prototype`in k&&k.prototype.render,b=(d=k.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 k(v,x):(t.__c=f=new $a(v,x),f.constructor=k,f.render=yo),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&&k.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ja({},f.__s)),Ja(f.__s,k.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&k.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&k.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=G.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),w=0;w<f._sb.length;w++)f.__h.push(f._sb[w]);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&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=Ja({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),T=d,d!=null&&d.type===Qa&&d.key==null&&(T=ho(d.props.children)),s=io(e,Ka(T)?T:[T],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(E=0,te=!1,t.__u|=c?160:128,t.__c.__z=[],ne=0;ne<a.length;ne++)(D=a[ne])==null||te||(D.nodeType==8&&D.data==`$s`?(E>0&&t.__c.__z.push(D),E++,a[ne]=null):D.nodeType==8&&D.data==`/$s`?(--E>0&&t.__c.__z.push(D),te=E===0,s=a[ne],a[ne]=null):E>0&&(t.__c.__z.push(D),a[ne]=null));if(!te){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(O=a.length;O--;)Ya(a[O]);po(t)}else t.__e=n.__e,t.__k=n.__k,e.then||po(t);G.__e(e,t,n)}else s=t.__e=go(n.__e,t,n,r,i,a,o,c,l,u);return(d=G.diffed)&&d(t),128&t.__u?void 0:s}function po(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(po)}function mo(e,t,n){for(var r=0;r<n.length;r++)_o(n[r],n[++r],n[++r]);G.__c&&G.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){G.__e(e,t.__v)}})}function ho(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Ka(e)?e.map(ho):Ja({},e)}function go(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&&=(G.__m&&G.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=qa.call(e.childNodes),v=n.props||Wa,!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;lo(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&&!_||lo(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=``),io(b==`template`?e.content:e,Ka(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&eo(n,0),s,c,l),a!=null)for(u=a.length;u--;)Ya(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||lo(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&lo(e,u,g,v[u],i))}return e}function _o(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){G.__e(e,n)}}function vo(e,t,n){var r,i;if(G.unmount&&G.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||_o(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){G.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&vo(r[i],t,n||typeof e.type!=`function`);n||Ya(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function yo(e,t,n){return this.constructor(e,n)}function bo(e,t){var n,r,i,a;t==document&&(t=document.documentElement),G.__&&G.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=Xa(Qa,null,[e]),i=[],a=[],fo(t,e,r||Wa,Wa,t.namespaceURI,r?null:t.firstChild?qa.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),mo(i,e,a)}function xo(e,t){e.__u|=32,bo(e,t)}G={__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 Ra=0,e}},Fa=0,$a.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ja({},this.state);typeof e==`function`&&(e=e(Ja({},n),this.props)),e&&Ja(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),no(this))},$a.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),no(this))},$a.prototype.render=Qa,Ia=[],Ra=0,za=function(e,t){return e.__v.__b-t.__v.__b},Ba=/(PointerCapture)$|Capture$/i,Va=0,Ha=uo(!1),Ua=uo(!0);var So=0;Array.isArray;function K(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:--So,__i:-1,__u:0,__source:i,__self:a};return G.vnode&&G.vnode(l),l}var Co=16,wo=16,To={};function Eo({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}=To[e]??{width:Co,height:wo},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return K(`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:K(`use`,{href:c})})}var Do=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},Oo=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)]},ko=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)]},Ao=(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)]},jo=(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)]},Mo=(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 No({children:e,marker:t,variant:n=`default`}){"use no memo";return K(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:K(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?K(`span`,{"data-truncate-fade":!0}):t})})}function Po(e){"use no memo";let{mode:t,children:n}=e;return K(`div`,{children:[K(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?K(`span`,{children:n}):n}),K(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?K(`span`,{children:n}):n})]})}function Fo({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=K(Po,{mode:t,children:e},`content`),o=K(No,{marker:n,mode:t,variant:r},`marker`),s=K(`div`,{"data-truncate-fill":!0},`fill`);return K(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:K(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function Io({children:e,...t}){"use no memo";return K(Fo,{mode:`truncate`,...t,children:e})}function Lo({children:e,...t}){"use no memo";return K(Fo,{mode:`fruncate`,...t,children:e})}function Ro({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=K(Io,{...s,children:t[0]}),l=K(Lo,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return K(`div`,{className:a,style:o});if(e.length<i)return K(n===`end`?Lo:Io,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=Do:r===`extension`?t=Oo:r===`leaf-path`&&(t=ko);else if(typeof r==`number`)t=Ao,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=jo:e===`first`&&(t=Mo)}else typeof r==`function`&&(t=r);t??=Do;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=K(Io,{...s,..._,children:f}),l=K(Lo,{...s,...v,children:p})}return K(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[K(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),K(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var zo={endIndex:-1,startIndex:-1};function Bo(e,t,n){return Math.min(Math.max(e,t),n)}function Vo(e,t){return e<0||t<e?zo:{endIndex:t,startIndex:e}}function Ho(e){return e.startIndex<0||e.endIndex<e.startIndex}function Uo(e,t){return Ho(e)?0:(e.endIndex-e.startIndex+1)*t}function Wo(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function Go(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function Ko(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 qo(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 Jo(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 Yo(e,t,n){if(e.length===0||t<=0)return[];let r=Jo(e),i=Ko(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=qo(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 Xo(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=Bo(t.scrollTop,0,o),c=t.stickyRows??Yo(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=Wo(s,n,t.itemHeight),m=Wo(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?zo:Vo(m,Go(u+d,n,t.itemHeight)),y=g+1,b=Ho(v)?zo:Vo(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Uo(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:Ho(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var Zo={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},Qo={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},$o=`Contains git status items`;function es(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 ts(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return es({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function ns(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function rs(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 is(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 as(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function os(e,t){return e!=null&&e>0?e:t}function ss(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 cs(e,t,n,r,i=0){let a=es({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function ls(e,t,n,r,i,a,o=0){let s=ts({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function us(e,t,n,r,i,a){let o=ns({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function ds(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function fs(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function ps({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return K(`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 ms(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 hs(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var gs,q,_s,vs,ys=Object.is,bs=0,xs=[],J=G,Ss=J.__b,Cs=J.__r,ws=J.diffed,Ts=J.__c,Es=J.unmount,Ds=J.__;function Os(e,t){J.__h&&J.__h(q,e,bs||t),bs=0;var n=q.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function ks(e){return bs=1,As(Vs,e)}function As(e,t,n){var r=Os(gs++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Vs(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);ys(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=q,!q.__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,ys(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};q.__f=!0;var a=q.shouldComponentUpdate,o=q.componentWillUpdate;q.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)},q.shouldComponentUpdate=i}return r.__N||r.__}function js(e,t){var n=Os(gs++,3);!J.__s&&Bs(n.__H,t)&&(n.__=e,n.u=t,q.__H.__h.push(n))}function Ms(e,t){var n=Os(gs++,4);!J.__s&&Bs(n.__H,t)&&(n.__=e,n.u=t,q.__h.push(n))}function Y(e){return bs=5,Ns(function(){return{current:e}},[])}function Ns(e,t){var n=Os(gs++,7);return Bs(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ps(e,t){return bs=8,Ns(function(){return e},t)}function Fs(){for(var e;e=xs.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Rs),e.__H.__h.forEach(zs),e.__H.__h=[]}catch(t){e.__H.__h=[],J.__e(t,e.__v)}}J.__b=function(e){q=null,Ss&&Ss(e)},J.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ds&&Ds(e,t)},J.__r=function(e){Cs&&Cs(e),gs=0;var t=(q=e.__c).__H;t&&(_s===q?(t.__h=[],q.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Rs),t.__h.forEach(zs),t.__h=[],gs=0)),_s=q},J.diffed=function(e){ws&&ws(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(xs.push(t)!==1&&vs===J.requestAnimationFrame||((vs=J.requestAnimationFrame)||Ls)(Fs)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),_s=q=null},J.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Rs),e.__h=e.__h.filter(function(e){return!e.__||zs(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],J.__e(n,e.__v)}}),Ts&&Ts(e,t)},J.unmount=function(e){Es&&Es(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Rs(e)}catch(e){t=e}}),n.__H=void 0,t&&J.__e(t,n.__v))};var Is=typeof requestAnimationFrame==`function`;function Ls(e){var t,n=function(){clearTimeout(r),Is&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Is&&(t=requestAnimationFrame(n))}function Rs(e){var t=q,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),q=t}function zs(e){var t=q;e.__c=e.__(),q=t}function Bs(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!ys(t,e[n])})}function Vs(e,t){return typeof t==`function`?t(e):t}function Hs(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:K(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return K(Qa,{children:[K(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:K(Io,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Us(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Ws(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function Gs(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 Ks({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=Xo(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:Gs(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?Gs(u,1,t,o):i&&r<=0&&c.length>0?Yo(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 qs=400,Js=10,Ys=40,Xs=18;function Zs(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))?Qs(e,t,n):a instanceof HTMLElement?a:null}function Qs(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 $s(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 ec(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 tc(){return navigator.vendor!==`Apple Computer, Inc.`}function nc(e,t){let n=e-t.top;if(n<Ys)return-Math.ceil((Ys-Math.max(0,n))/Ys*Xs);let r=t.bottom-e;return r<Ys?Math.ceil((Ys-Math.max(0,r))/Ys*Xs):0}function rc(e,t){if(e!=null){let t=Zo[e];return t==null?null:{text:t,title:Qo[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:$o}:null}function ic(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 ac(e){return e!=null&&`toggle`in e}function oc(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function sc(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function cc(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function lc(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function uc(e,t){return t&&lc(e)||(e.ctrlKey||e.metaKey)&&oc(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var dc=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function fc(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 pc(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 mc(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function hc(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function gc(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function _c(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 vc(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 yc(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 bc(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=yc(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 xc(e,t){return{kind:e.kind,name:Ws(e),path:t}}function Sc(e){return e==null?void 0:`${e}__tree`}function Cc(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function wc(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function Tc(e,t){if(e==null)return null;if(`text`in e)return K(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?wc(e.icon)?t(e.icon):{name:e.icon}:wc(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return K(`span`,{title:e.title,children:K(Eo,{...n})})}function Ec(e){e!=null&&rs(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function Dc(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=Us(e);return K(Qa,{children:[e.depth>0?K(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>K(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,K(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?K(Eo,{...t(`file-tree-icon-chevron`)}):K(Eo,{...t(`file-tree-icon-file`,u)})}),K(`div`,{"data-item-section":`content`,children:e.isFlattened?Hs(e,c,a):c??K(Ro,{minimumLength:5,split:`extension`,children:e.name})}),i?K(`div`,{"data-item-section":`decoration`,children:r==null?null:Tc(r,t)}):null,s?K(`div`,{"data-item-section":`git`,children:Tc(o,t)}):null,n?K(`div`,{"data-item-section":`action`,children:l?K(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:K(Eo,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function Oc(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:ee,contextMenuButtonVisibility:w,contextMenuRightClickEnabled:T,registerRenameInput:E,registerButton:te,resolveIcon:ne,renderDecorationForRow:D,openContextMenuForRow:O,onRowClick:k,onKeyDown:A}=e,j=Us(t),{isParked:M=!1,mode:re=`flow`,style:ie}=r,ae=re===`sticky`,oe=_?.get(j)??null??ic(t.ancestorPaths,v,y),se=t.kind===`directory`&&(b?.has(j)??!1),ce=D(t,j),le=rc(oe,se),ue=S&&ee,de=ce!=null||x||ue,fe=ue&&w===`always`,pe=a.getPath()===j,me=pe?a.getValue():``,N=ae||!pe?null:K(ps,{ref:E,ariaLabel:`Rename ${Ws(t)}`,isFlattened:t.isFlattened,value:me,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),he=Dc(t,ne,{actionLaneEnabled:ue,customDecoration:ce,decorationLaneEnabled:de,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:le,gitLaneActive:x,renameInput:N,showDecorativeActionAffordance:fe}),ge={...ms({ariaLabel:Ws(t),domId:t.isFocused?Cc(h,j,M):void 0,extraStyle:ie,features:{actionLaneEnabled:ue,contextMenuButtonVisibility:ue?w:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:M,itemHeight:g,mode:re,row:t,state:{containsGitChange:se,effectiveGitStatus:oe,isContextHovered:s===j,isDragTarget:l?.kind===`directory`&&l.directoryPath===j,isDragging:c?.has(j)===!0,isFocusRinged:t.isFocused&&o===j},targetPath:j}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),T&&(i.focusMountedPathFromInput(j),O(t,j,{anchorRect:mc(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ae?void 0:()=>{i.focusMountedPathFromInput(j)},onKeyDown:ae?void 0:A,ref:e=>{te(j,e)}};return!ae&&pe?K(`div`,{...ge,children:he}):K(`button`,{...ge,type:`button`,draggable:u&&!M,onDragEnd:u&&!M?p:void 0,onDragStart:u&&!M?e=>{f(e,t,j)}:void 0,onMouseDown:e=>{if(ae){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!M?e=>{m(e,t,j)}:void 0,onClick:e=>{k(e,t,j,re)},children:he})}function kc(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Us(e))).map((n,r)=>Oc(e,n,t.start+r))}function Ac({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Mi,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 _=Y(null),v=Y(null),y=Y(!1),b=Y(null),x=Y(null),S=Y(null),C=Y(null),ee=Y(null),w=Y(new Map),T=Y(new Map),E=Y(()=>{}),te=Y(null),ne=Y(0),D=Y(!1),O=Y(null);O.current!==t&&(D.current=!1,O.current=t);let k=Y(!1),A=Y(null),j=Y(null),M=Y(!1),re=Y(null),ie=Y(null),ae=Y(null),oe=Y(null),se=Y(null),ce=Y(null),le=Y(null),ue=Y(null),de=Y(!1),fe=Y(null),pe=Y(null),me=Y(null),N=Y(null),he=Ns(()=>new Map,[]),[,ge]=ks(0),[_e,ve]=ks(null),[ye,be]=ks(null),[xe,Ce]=ks(null),[we,Te]=ks(null),[Ee,De]=ks(0),[P,Oe]=ks(null),ke=Y(P);ke.current=P;let Ae=Y(null),je=Y(null),Me=Y(null),Ne=Y(null),Pe=Y(null),Fe=Y(!1),Ie=()=>{je.current=null,Me.current=null,Ne.current=null},Le=(e,t)=>{je.current=e,Me.current=null,Ne.current=t==null?null:{path:e,scrollTop:t}},Re=(e,t)=>{je.current=null,Me.current={path:e,viewportOffset:t},Ne.current=null},ze=Y(d===`retain`&&t.isSearchOpen()),[Be,Ve]=ks(p);js(()=>{p||Ve(!1)},[p]);let He=Y(!1),Ue=Ps(()=>{He.current=!0,Ve(e=>e&&!1)},[]),[We,Ge]=ks(()=>Ks({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ke,qe]=ks(!1);js(()=>{qe(!0)},[]);let Je=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ye=e?.contextMenu?.triggerMode??(Je?`right-click`:`both`),Xe=Ye===`both`||Ye===`button`,Ze=e?.contextMenu?.buttonVisibility??`when-needed`,Qe=Ye===`both`||Ye===`right-click`;Ms(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Pe.current=t,be(t),Te(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Fe.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 $e=Ps((e,t)=>{gc(w.current,e,t)},[]),et=Ps((e,t)=>{gc(T.current,e,t)},[]),tt=Ps(e=>{x.current=e},[]),at=Ps(e=>_c(e,T.current,w.current),[]),ot=n!=null||r!=null||i!=null,{resolveIcon:st}=Ns(()=>Se(a),[a]),ct=t[Ca](),lt=ct.getPath(),ut=lt!=null,dt=t.isSearchOpen(),ft=t.getSearchValue(),F=t.getFocusedPath(),I=t.getFocusedIndex(),pt=t.getScrollRequest(),mt=t.isDragAndDropEnabled(),ht=t.getDragSession(),gt=Ns(()=>ht==null?null:new Set(ht.draggedPaths),[ht]),_t=ht?.target??null,vt=ht?.primaryPath??null,yt=Sc(o),{overlayHeight:bt,overlayRows:xt,snapshot:L,visibleRows:St}=We,R=L.physical.viewportHeight,z=Ns(()=>({end:L.window.endIndex,start:L.window.startIndex}),[L.window.endIndex,L.window.startIndex]),Ct=xt,B=L.sticky.rows,wt=L.physical.totalHeight,Tt=L.sticky.height,Et=Ns(()=>new Set(B.map(e=>Us(e.row))),[B]),Dt=I>=0&&I>=z.start&&I<=z.end,Ot=Ps((e,t)=>u?.({item:xc(e,t),row:e})??null,[u]),V=Ps(e=>rs(e==null?null:w.current.get(e)??null)?!0:rs(S.current),[]),kt=Ps(e=>{V(t.focusNearestPath(e))},[t,V]),At=Y(kt);At.current=kt;let jt=Y(!0),Mt=Y(()=>{}),Nt=Ps((t=!0)=>{let n=ke.current;n!=null&&(jt.current=jt.current&&t,Oe(null),e?.contextMenu?.onClose?.(),jt.current&&kt(n.path))},[e?.contextMenu,kt]);Mt.current=Nt;let Pt=Ps(e=>{let t=e==null?null:hc(S.current,e);Ce(e=>e===t?e:t)},[]),Ft=Ps((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=at(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Le(n,e?.scrollTop??null),k.current=!0,ve(e=>e===n?e:n)}i.focus(),Pt(a),jt.current=!0,Oe({anchorRect:r?.anchorRect??null,item:xc(e,n),path:n,source:r?.source??`keyboard`})},[t,at,Pt]),It=Ps(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=as(e,R);re.current=I<0||e==null?null:Math.max(0,Math.min(I*s-e.scrollTop,Math.max(0,t-s))),M.current=!0}t.startRenaming(e)!==!1&&(Te(`focus`),ge(e=>e+1))}},[t,I,s,l,R]),Lt=Ps((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=as(i,R),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:Ks({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return k.current=!0,us(i,a,s,l,u,d),E.current(),Ae.current=n?e:null,!0},[t,s,c,R,h]),Rt=()=>y.current===!0||N.current!=null||de.current===!0,zt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Bt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Vt=()=>{oe.current!=null&&(clearTimeout(oe.current),oe.current=null),ae.current=null},Ht=()=>{ce.current?.remove(),ce.current=null},Ut=()=>{Bt(ie.current),ie.current=null,se.current=null},Wt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Gt=()=>{ue.current?.(),ue.current=null,N.current!=null&&(clearTimeout(N.current),N.current=null),de.current=!1,fe.current=null,me.current=null,pe.current!=null&&(pe.current.setAttribute(`draggable`,`true`),pe.current.style.removeProperty(`touch-action`),pe.current=null),Ht(),Vt(),Ut(),le.current=null},Kt=(e,n)=>{let r=S.current?.getRootNode(),i=$s(Zs(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},qt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Vt();return}let r=t.getItem(e.directoryPath),i=ac(r)?r:null;if(i==null||i.isExpanded()){Vt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ae.current!==a&&(Vt(),ae.current=a,oe.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Jt=()=>{ie.current=null;let e=se.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=nc(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,E.current()),qt(Kt(e.clientX,e.clientY)),ie.current=zt(Jt)},Yt=(e,t)=>{se.current={clientX:e,clientY:t},ie.current??=zt(Jt)},Xt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Gt(),Ht(),Vt(),Ut(),t.startDrag(r)===!1){e.preventDefault();return}if(le.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),tc())){let t=ec(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Wt(t),ce.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Zt=()=>{Ht(),Vt(),Ut(),le.current=null,t.cancelDrag()},Qt=(e,n,r)=>{if(N.current!=null||de.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;me.current={clientX:i.clientX,clientY:i.clientY},pe.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!de.current;N.current!=null&&(clearTimeout(N.current),N.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),ue.current===o&&(ue.current=null),t&&(a.setAttribute(`draggable`,`true`),pe.current===a&&(pe.current=null),me.current=null)},s=e=>{let t=e.touches[0],n=me.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=Js*Js||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),ue.current=o,N.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),pe.current===a&&(pe.current=null),me.current=null;return}de.current=!0,pe.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),le.current=n;let e=a.getBoundingClientRect(),s=ec(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`}),Wt(s),ce.current=s,fe.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=fe.current;n!=null&&ce.current!=null&&(ce.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),qt(Kt(t.clientX,t.clientY)),Yt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Kt(n.clientX,n.clientY),t.completeDrag(),Gt()},u=()=>{t.cancelDrag(),Gt()};ue.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)},qs)},$t=e=>{if(P!=null){if(e.key===`Escape`){Nt(),e.preventDefault(),e.stopPropagation();return}dc.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(ct.isActive()){if(e.key===`Escape`)ct.cancel();else if(e.key===`Enter`)ct.commit();else return;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){It(F??void 0),e.preventDefault(),e.stopPropagation();return}if(dt){if(e.key===`Escape`)M.current=!1,re.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=as(n,R);re.current=I<0||n==null?null:Math.max(0,Math.min(I*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;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&sc(e)){t.openSearch(e.key),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Je&&lc(e),r=uc(e,Je),i=r&&S.current!=null?is(S.current):null,a=r?new Set(vc(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==F&&a.has(o)){let e=C.current;Le(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=ac(p)?p:null,h=u!=null&&(Et.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=_c(u,T.current,w.current);e==null||n==null?y=!1:Ft(e,u)}else if((e.ctrlKey||e.metaKey)&&oc(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;Te(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Et.has(b)||a.has(b)),ee=g&&b!==u,E=n&&c&&o===u&&b===u;if((h||E)&&b!=null&&(ee&&x||E))Le(b,v?.scrollTop??null),k.current=!0,ve(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Re(b,bc(S.current,v,i,u,s,Tt,R)),k.current=!0,ve(e=>e===b?e:b)):Ie()}ge(e=>e+1),e.preventDefault(),e.stopPropagation()};Ms(()=>{if(!(!f||!dt)){if(ze.current){ze.current=!1;return}rs(ee.current)}},[dt,f]),Ms(()=>{let e=x.current;switch(fs({hasRenderedInput:e!=null,previousRenamingPath:j.current,renamingPath:lt})){case`reset`:j.current=null;return;case`reveal-canonical`:lt!=null&&Lt(lt,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Ae.current=null,j.current=lt,rs(e),e.select());return}},[z.end,z.start,lt,Lt,Et]),Ms(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=is(e)?.dataset.itemPath??null;ve(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,is(e)!=null){r();return}k.current=!1,ve(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),k.current=!1,ve(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ve(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),Ms(()=>{let e=S.current;e!=null&&(L.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[L.physical.scrollTop]),Ms(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;te.current=as(n,g);let a=()=>{let e=t.getVisibleCount(),r=os(te.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ge(Ks({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!D.current){D.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=os(te.current,g),i=t.getVisibleRows(e,e)[0]??null;cs(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}E.current=a;let o=!1,l=t.subscribe(()=>{o?ge(e=>e+1):o=!0,a()}),u=()=>{Fe.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,De(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Fe.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ke.current!=null&&y.current&&Mt.current(),Fe.current===!0){y.current=!1;return}be(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 ee=typeof ResizeObserver<`u`?new ResizeObserver(e=>{te.current=(e[0]==null?null:ss(e[0]))??as(n,g),a()}):null;return ee?.observe(n),()=>{E.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,te.current=null,ee?.disconnect()}},[t,g,s,c,h]),Ms(()=>{Je||P==null||Nt(!1)},[Nt,Je,P]);let en=Ns(()=>P==null?null:`${P.path}::${P.source}`,[P]);Ms(()=>{if(en==null){m?.clearSlotContent(rt);return}let t=ke.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??pc(n.getBoundingClientRect()),close:e=>{Mt.current(e?.restoreFocus??!0)},restoreFocus:()=>{jt.current&&At.current(ke.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(rt,i),e?.contextMenu?.onOpen?.(t.item,r),Ec(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&Ec(i)}),()=>{m?.clearSlotContent(rt)}},[en,e?.contextMenu,m]),Ms(()=>{P!=null&&t.getItem(P.path)==null&&Nt()},[Nt,P,t]),Ms(()=>{if(P==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(fc(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Nt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Nt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Nt,P]),Ms(()=>{let e=C.current,n=S.current;if(e==null||n==null){A.current=F;return}let r=F==null?null:w.current.get(F)??null,i=is(n),a=i?.dataset.itemPath??null,o=ut&&x.current===i,c=f&&ee.current===i,l=M.current&&!dt,u=re.current??0,d=Ae.current,p=je.current,m=Me.current,g=Ne.current,_=i!=null,v=k.current||_,y=A.current!==F,b=p!=null&&p===F&&F!=null,T=!1,te=!1;if(pt!=null&&pt.id!==ne.current){ne.current=pt.id;let n=pt.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,R-s))):Tt;T=!0,te=ls(e,n,s,R,wt,pt.offset,t)}t.clearScrollRequest(pt.id)}let D=!T&&l&&us(e,I,s,R,wt,u),O=!T&&d!=null&&d===F&&us(e,I,s,R,wt,Tt),j=!T&&m!=null&&m.path===F&&us(e,I,s,R,wt,m.viewportOffset),ie=!T&&g!=null&&g.path===F&&e.scrollTop!==g.scrollTop;if(ie&&(e.scrollTop=g.scrollTop),(ie||te||O||j||D||v&&y&&d!==F&&!b&&cs(e,I,s,R,Tt))&&E.current(),T){A.current=F;return}if(!v){A.current=F;return}if(o){A.current=F;return}if(c&&!l){A.current=F;return}if(r==null){l&&I>=0&&(us(e,I,s,R,wt,u),E.current()),A.current=F;return}(y||l||d===F||p===F||m?.path===F||g?.path===F||a==null||a!==F)&&(rs(r),d===F&&(Ae.current=null),p===F&&(je.current=null),m?.path===F&&(Me.current=null),g?.path===F&&(Ne.current=null),M.current=!1,re.current=null),A.current=F},[t,I,F,Dt,s,ut,dt,z,R,f,pt,h,Tt,wt,St]);let tn=I>=0&&I>=L.visible.startIndex&&I<=L.visible.endIndex,nn=F!=null&&Ct.some(e=>Us(e.row)===F),rn=tn||nn,an=Xe&&k.current===!0&&rn?F:null,on=we===`pointer`?ye:null,sn=P?.path??Pe.current??on??an??ye,cn=P?.source===`right-click`;Ms(()=>{y.current&&P==null||Pt(at(sn))},[P,at,z,R,Ee,Ct,sn,Pt,St]);let ln=Ps(e=>{if(y.current||fc(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&&Te(e=>e===`pointer`?e:`pointer`),be(e=>e===i?e:i)},[]),un=Ps(()=>{be(null)},[]);Ms(()=>{if(!mt)return;let e=()=>{Gt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Gt(),t.cancelDrag()}},[t,mt]);let dn=e=>{if(!mt||t.getDragSession()==null||de.current)return;let n=$s(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),qt(t.getDragSession()?.target??null),Yt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},fn=e=>{if(!mt||t.getDragSession()==null||de.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Vt(),Ut(),t.setDragTarget(null))},pn=e=>{!mt||t.getDragSession()==null||de.current||(e.preventDefault(),Kt(e.clientX,e.clientY),t.completeDrag(),Ht(),Vt(),Ut(),le.current=null)},mn=L.window.height,hn=L.window.offsetTop,gn=Math.min(0,R-mn),_n=Math.min(0,R-mn-Tt),vn=_e===F||M.current,yn=F!=null&&vn&&!Dt&&I>=0?St[I]??t.getVisibleRows(I,I)[0]??null:null,bn=yn==null?null:ds(I,s,z,mn),xn=le.current,Sn=vt!=null&&xn!=null&&xn.path===vt&&xn.index>=z.start&&xn.index<=z.end,Cn=vt!=null&&xn!=null&&xn.path===vt&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:ds(Cn.index,s,z,mn),Tn=cc((I>=0?St[I]??t.getVisibleRows(I,I)[0]??null:null)?.ancestorPaths.at(-1)??null),En=dt&&F!=null?Cc(o,F,!Dt):void 0,Dn=P?.path??(dt?F:_e),On=P?.path??ye,kn=at(sn),An=Je&&Xe&&!cn&&!ut&&kn!=null&&xe!=null&&sn!=null,jn=Je&&(An||P!=null),Mn=P?.anchorRect,Nn=Mn==null&&kn!=null&&xe!=null&&(P!=null||An)?xe:null,Pn=Mn==null?Nn==null?void 0:{top:`${Nn}px`}:{left:`${Mn.left}px`,position:`fixed`,right:`auto`,top:`${Mn.top}px`},Fn=cn?{opacity:`0`}:void 0,In=Ps((e,n,r,i)=>{let a=hs({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:dt,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=L.visible.startIndex&&n.index<=L.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(k.current=!0,ve(e=>e===c?e:c),Te(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Lt(c,{targetOffset:`sticky-parents`})},[t,dt,L.visible.endIndex,L.visible.startIndex,Lt]),Ln=()=>{if(y.current||!Xe||sn==null||kn==null)return;let e=t.getItem(sn);e!=null&&(Pt(kn),jt.current=!0,Oe({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:kn.getAttribute(`aria-label`)??sn,path:e.getPath()},path:e.getPath(),source:`button`}))},Rn={contextHoverPath:On,contextMenuButtonTriggerEnabled:Xe,contextMenuButtonVisibility:Ze,contextMenuEnabled:Je,contextMenuRightClickEnabled:Qe,contextMenuTriggerMode:Ye,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:mt,draggedPathSet:gt,dragTarget:_t,gitLaneActive:ot,gitStatusByPath:n,handleRowDragEnd:Zt,handleRowDragStart:Xt,handleRowTouchStart:Qt,ignoredGitDirectories:r,ignoredInheritanceCache:he,instanceId:o,itemHeight:s,onKeyDown:$t,onRowClick:In,openContextMenuForRow:Ft,registerButton:$e,registerRenameInput:tt,renameView:ct,renderDecorationForRow:Ot,resolveIcon:st,shouldSuppressContextMenu:Rt,visualFocusPath:Dn},zn={...Rn,registerButton:et};return K(`div`,{ref:S,id:yt,"data-file-tree-context-menu-button-visibility":Je&&Xe?Ze:void 0,"data-file-tree-context-menu-trigger-mode":Je?Ye:void 0,"data-file-tree-has-context-menu-action-lane":Je&&Xe?`true`:void 0,"data-file-tree-has-git-lane":ot?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:mt?fn:void 0,onDragOver:mt?dn:void 0,onDrop:mt?pn:void 0,onKeyDown:$t,onPointerLeave:Je?un:void 0,onPointerOver:Je?ln:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[K(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:Tn}}),K(`slot`,{name:nt,"data-type":`header-slot`}),f?K(`div`,{"data-file-tree-search-container":!0,"data-open":dt?`true`:`false`,children:K(`input`,{ref:ee,"aria-activedescendant":En,"aria-controls":yt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Be?`true`:void 0,value:ft,onBlur:()=>{d===`retain`&&!He.current||t.closeSearch()},onFocus:Ue,onPointerDown:Ue,onInput:e=>{Ue();let n=e.currentTarget;t.setSearch(n.value)}})}):null,K(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ke&&Ct.length>0?K(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:K(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${bt}px`},children:Ct.map((e,t)=>Oc(zn,e.row,`sticky:${Us(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${Ct.length-t}`}}))})}):null,K(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${wt}px`},children:[K(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${hn}px`}}),K(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${mn}px`,top:`${gn}px`,bottom:`${_n}px`},children:[kc(Rn,z,Et),yn!=null&&bn!=null?Oc(Rn,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:vt===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?Oc(Rn,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),Je?K(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":jn?`true`:`false`,style:Pn,children:[K(`button`,{ref:v,type:`button`,"data-type":it,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":P==null?`false`:`true`,"data-visible":An?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),P!=null){Nt();return}Ln()},tabIndex:-1,style:Fn,children:K(Eo,{...st(`file-tree-icon-ellipsis`)})}),P==null?null:K(`slot`,{name:rt})]}):null,P==null?null:K(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Nt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Nt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var jc={hydrateRoot:(e,t)=>{xo(Xa(Ac,t),e)},renderRoot:(e,t)=>{bo(Xa(Ac,t),e)},unmountRoot:e=>{bo(null,e)}};function Mc(e,t){jc.renderRoot(e,t)}function Nc(e,t){jc.hydrateRoot(e,t)}function Pc(e){jc.unmountRoot(e)}var Fc=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)}}},Ic=`__c`,Lc=`__k`,Rc=`__d`,zc=`__s`,Bc=/[\s\n\\/='"\0<>]/,Vc=/^(xlink|xmlns|xml)([A-Z])/,Hc=/^(?: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])/,Uc=/^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/,Wc=new Set([`draggable`,`spellcheck`]);function Gc(e){e.__g===void 0?e[Rc]=!0:e.__g|=8}function Kc(e){e.__g===void 0?e[Rc]=!1:e.__g&=-9}function qc(e){return e.__g===void 0?!0===e[Rc]:!!(8&e.__g)}var Jc=/["&<]/;function Yc(e){if(e.length===0||!1===Jc.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;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 Xc={},Zc=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(`.`)),Qc=/[A-Z]/g;function $c(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:Xc[n]||(Xc[n]=n.replace(Qc,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||Zc.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function el(){this.__d=!0}function tl(e,t){return{__v:e,context:t,props:e.props,setState:el,forceUpdate:el,__d:!0,__h:[]}}function nl(e,t,n){if(!e.s){if(n instanceof rl){if(!n.s)return void(n.o=nl.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(nl.bind(null,e,t),nl.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var rl=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{nl(r,1,a(this.v))}catch(e){nl(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?nl(r,1,t?t(i):i):n?nl(r,1,n(i)):nl(r,2,i)}catch(e){nl(r,2,e)}},r},e}(),il,al,ol,sl,cl={},ll=Array.isArray,ul=Object.assign,dl=``,fl=`<!--$s-->`,pl=`<!--/$s-->`;function ml(e,t){var n,r=e.type,i=!0;return e[Ic]?(i=!1,(n=e[Ic]).state=n[zc]):n=new r(e.props,t),e[Ic]=n,n.__v=e,n.props=e.props,n.context=t,Gc(n),n.state??=cl,n[zc]??(n[zc]=n.state),r.getDerivedStateFromProps?n.state=ul({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[zc]===n.state?n.state:n[zc]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),ol&&ol(e),n.render(n.props,n.state,t)}function hl(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===dl)return dl;var s=typeof e;if(s!=`object`)return s==`function`?dl:s==`string`?Yc(e):e+dl;if(ll(e)){var c,l=dl;i[Lc]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=hl(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=dl,ll(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return dl;e.__=i,il&&il(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===Qa){if(`tpl`in g){for(var x=dl,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&&!ll(C)?x+=C:x+=hl(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+Yc(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var ee=t[_.__c];b=ee?ee.props.value:_.__}var w=h.prototype&&typeof h.prototype.render==`function`;if(w)v=ml(e,b),y=e[Ic];else{e[Ic]=y=tl(e,b);for(var T=0;qc(y)&&T++<25;){Kc(y),ol&&ol(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}Gc(y)}if(y.getChildContext!=null&&(t=ul({},t,y.getChildContext())),w&&G.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===Qa&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return hl(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[zc]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,cl),qc(y)?(v=ml(e,t),(y=e[Ic]).getChildContext!=null&&(t=ul({},t,y.getChildContext())),hl(v=v!=null&&v.type===Qa&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):dl}finally{al&&al(e),sl&&sl(e)}}}v=v!=null&&v.type===Qa&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var E=hl(v,t,n,r,e,a,o);return al&&al(e),G.unmount&&G.unmount(e),e._suspended?typeof E==`string`?fl+E+pl:ll(E)?(E.unshift(fl),E.push(pl),E):E.then(function(e){return fl+e+pl}):E}catch(i){if(!a&&o&&o.onError){var te=function i(s){return o.onError(s,e,function(e,s){try{return hl(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(te!==void 0)return te;var ne=G.__e;return ne&&ne(i,e),dl}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=hl(v,t,n,r,e,a,o);return e._suspended?fl+s+pl:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var D,O=`<`+h,k=dl;for(var A in g){var j=g[A];if(typeof(j=_l(j)?j.value:j)!=`function`||A===`class`||A===`className`){switch(A){case`children`:D=j;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;A=`for`;break;case`className`:if(`class`in g)continue;A=`class`;break;case`defaultChecked`:A=`checked`;break;case`defaultSelected`:A=`selected`;break;case`defaultValue`:case`value`:switch(A=`value`,h){case`textarea`:D=j;continue;case`select`:r=j;continue;case`option`:r!=j||`selected`in g||(O+=` selected`)}break;case`dangerouslySetInnerHTML`:k=j&&j.__html;continue;case`style`:typeof j==`object`&&(j=$c(j));break;case`acceptCharset`:A=`accept-charset`;break;case`httpEquiv`:A=`http-equiv`;break;default:if(Vc.test(A))A=A.replace(Vc,`$1:$2`).toLowerCase();else{if(Bc.test(A))continue;A[4]!==`-`&&!Wc.has(A)||j==null?n?Uc.test(A)&&(A=A===`panose1`?`panose-1`:A.replace(/([A-Z])/g,`-$1`).toLowerCase()):Hc.test(A)&&(A=A.toLowerCase()):j+=dl}}j!=null&&!1!==j&&(O=!0===j||j===dl?O+` `+A:O+` `+A+`="`+(typeof j==`string`?Yc(j):j+dl)+`"`)}}if(Bc.test(h))throw Error(h+` is not a valid HTML tag name in `+O+`>`);if(k||(typeof D==`string`?k=Yc(D):D!=null&&!1!==D&&!0!==D&&(k=hl(D,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),al&&al(e),sl&&sl(e),!k&&gl.has(h))return O+`/>`;var M=`</`+h+`>`,re=O+`>`;return ll(k)?[re].concat(k,[M]):typeof k==`string`?re+k+M:[re,k,M]}var gl=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function _l(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var vl=0;function yl(e){return e!=null&&e.length>0?e:(vl+=1,`pst_ft_${vl}`)}function bl({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Mi)}function xl(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 Sl(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 Cl(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var wl=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new Fc;#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=yl(a),this.#p=Pa(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=ji(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new ka({...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&&(Pc(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),Mc(t.wrapper,this.#w()))}setGitStatus(e){this.#p=Pa(e,this.#p);let t=this.#T();t!=null&&Mc(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),Mc(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),Nc(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),Mc(r,this.#w())}#C(){return{initialViewportHeight:bl({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(nt,e());return}this.#l.setSlotHtml(nt,this.#e?.header?.html??null)}#k(e){let t=Cl(e).find(e=>Sl(e)),n=xl(fe(He(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=Cl(e),n=t.find(e=>Sl(e)),r=t.filter(e=>e!==n),i=He(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=xl(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=He(this.#m);t.colored&&D(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${Qe}]`);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(Qe,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=Ii(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 Hi(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)}},X=g(v(),1),Tl=typeof window>`u`?X.useEffect:X.useLayoutEffect;function El({file:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c,contentEditable:l}){let u=Ue(),d=r!==void 0,f=(0,X.useContext)(ne),p=de(),m=(0,X.useRef)(null),h=Be(r=>{if(r!=null){if(m.current!=null)throw Error(`File: An instance should not already exist when a node is created`);u==null?m.current=new S(Dl({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),c?void 0:f,!0):m.current=new E(Dl({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),u,a,c?void 0:f,!0),m.current.hydrate({file:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(m.current==null)throw Error(`File: A File instance should exist when unmounting`);m.current.cleanUp(),m.current=null}});return Tl(()=>{if(m.current==null)return;let i=Dl({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),a=!le(m.current.options,i);m.current.setOptions(i),m.current.render({file:e,lineAnnotations:n,forceRender:a}),r!==void 0&&m.current.setSelectedLines(r)}),Tl(()=>{if(l&&m.current!=null){if(p===void 0)throw Error(`File: Editor is not attached`);return p.edit(m.current)}},[l,p]),{ref:h,getHoveredLine:(0,X.useCallback)(()=>m.current?.getHoveredLine(),[])}}function Dl({options:e,controlledSelection:t,contentEditable:n,hasCustomHeader:r,hasEditor:i,hasGutterRenderUtility:a}){let o=n&&i,s=t||a||r;if(!s&&!o)return e;let c={...e};return s&&(c={...c,controlledSelection:t,renderCustomHeader:r?k:e?.renderCustomHeader,renderGutterUtility:a?k:e?.renderGutterUtility}),o&&(c={...c,useTokenTransformer:!0}),c}var Z=u();function Ol({file:e,lineAnnotations:t,selectedLines:n,options:r,metrics:i,className:a,style:o,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderMetadata:u,prerenderedHTML:d,renderGutterUtility:f,disableWorkerPool:p=!1,contentEditable:m=!1}){let{ref:h,getHoveredLine:g}=El({file:e,options:r,metrics:i,lineAnnotations:t,selectedLines:n,prerenderedHTML:d,hasGutterRenderUtility:f!=null,hasCustomHeader:c!=null,disableWorkerPool:p,contentEditable:m});return(0,Z.jsx)(Ne,{ref:h,className:a,style:o,children:xe(w({file:e,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderMetadata:u,renderGutterUtility:f,lineAnnotations:t,getHoveredLine:g}),d)})}var kl=s(),Al=[`.avif`,`.gif`,`.ico`,`.jpeg`,`.jpg`,`.png`,`.svg`,`.webp`];function jl(e,t){let n=e.split(/[?#]/,1)[0]?.toLowerCase()??``;return t.some(e=>n.endsWith(e))}function Ml(e){return jl(e,Al)}var Nl=100,Pl=class{#e=[];#t=[];#n;constructor(e){this.#n=Math.max(1,e?.maxEntries??Nl)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo()}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),e}};function Fl(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[];for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice()}}function Il(e,t){if(e===void 0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=zl(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
|
|
1672
|
+
`)&&!a.text.includes(`
|
|
1673
|
+
`),u=o.start===o.end&&o.text.length>0&&s.text.length===0;if(l&&u){if(c!==i.end||(n??=`insert`,n!==`insert`))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){if(c===i.end){if(n??=`delete`,n!==`delete`)return!1;continue}if(c+(o.end-o.start)!==i.start||(n??=`backspace`,n!==`backspace`))return!1;continue}return!1}return n!==void 0}function Ll(e,t){let n=[],r=[];for(let i=0;i<e.forwardEdits.length;i++){let a=e.forwardEdits[i],o=e.inverseEdits[i],s=t.forwardEdits[i],c=t.inverseEdits[i],l=zl(s.start,e.forwardEdits);if(a.text.length>0){n.push({start:a.start,end:a.end,text:a.text+s.text}),r.push(o.text);continue}if(l===a.end){n.push({start:a.start,end:l+(s.end-s.start),text:``}),r.push(o.text+c.text);continue}n.push({start:Math.min(a.start,l),end:a.end,text:``}),r.push(c.text+o.text)}return{forwardEdits:n,inverseEdits:Rl(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice()}}function Rl(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function zl(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;if(!(n<e.start)){if(n>=e.start+r){n-=i;continue}n=e.start+Math.min(n-e.start,t)}}return n}var Bl=1e5,Vl=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Hl=class{static Original=0;static Added=1;constructor(e,t,n,r,i){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart}},Ul=class{lineOffsets;constructor(e){this.text=e,this.lineOffsets=O(e)}append(e){let t=this.text.length,n=O(e);for(let e=1;e<n.length;e++)this.lineOffsets.push(t+n[e]);return this.text+=e,t}},Wl=class{left=null;right=null;parent=null;constructor(e,t=e.length,n=e.lineBreakCount){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)}},Gl=class{#e;#t=new Ul(``);#n=null;#r=[];#i=0;#a=0;#o=null;#s=null;constructor(e){this.#e=new Ul(e),this.#y([this.#_(Hl.Original,0,e.length)])}get lineCount(){return this.#a}getText(e){if(e===void 0)return this.#m();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#o!==null&&this.#o[0]===e&&this.#o[1]===t)return this.#o[2];let n=this.#d(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#o=[e,t,r],this.#s=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#s,r=this.#o;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#s=[e,t,n],n}let i=this.#d(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&Kl(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#s=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=ql(e,0,this.#i),i=ql(t,r,this.#i);if(r>=i)return``;let a=this.#l(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#g(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&Kl(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#u(s)}return o.join(``)}charAt(e){let t=this.#l(e);if(t===void 0)return``;let[n,r]=t;return this.#g(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=Jl(e),n=0,r=!1;return this.#h(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#i)return;let n=Yl(t,this.#i),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=Jl(e),a=0,o=0,s,c;return this.#h(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!Xl(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#i===0||e.text.includes(`
|
|
1674
|
+
`)||e.text.includes(`\r`)||e.regex&&(e.text.includes(`\\n`)||e.text.includes(`\\r`)))return[];let t;try{t=ru(e.text,e.regex,e.caseSensitive)}catch{return[]}return this.#c(t,e.wholeWord,Bl)}#c(e,t,n){let r=[],i=this.#i,a=e=>this.charAt(e);for(let o=0;o<this.#a;o++){let s=this.getLineText(o),c=this.offsetAt({line:o,character:0}),l=new RegExp(e.source,e.flags);l.lastIndex=0;let u;for(;(u=l.exec(s))!==null;){let e=u.index,o=u[0];if(o.length===0){l.lastIndex=ou(s,e);continue}let d=c+e;if((!t||tu(d,o.length,i,a))&&(r.push([d,d+o.length]),r.length>=n))return r;e===l.lastIndex&&(l.lastIndex=ou(s,e))}}return r}insert(e,t){if(e.length===0)return;let n=ql(t,0,this.#i),r=this.#t.append(e),i=this.#_(Hl.Added,r,e.length),a=this.#v(),o=[],s=0,c=!1;for(let e of a){let t=s+e.length;if(!c&&n<=t){let t=n-s;t>0&&o.push(this.#_(e.source,e.offset,t)),o.push(i),t<e.length&&o.push(this.#_(e.source,e.offset+t,e.length-t)),c=!0}else o.push(e);s=t}c||o.push(i),this.#y(o),this.#o=null,this.#s=null}delete(e,t){if(t<=0||this.#i===0)return;let n=ql(e,0,this.#i),r=ql(n+t,n,this.#i);if(n===r)return;let i=[],a=0;for(let e of this.#v()){let t=a,o=a+e.length,s=ql(n-t,0,e.length),c=ql(o-r,0,e.length);s>0&&i.push(this.#_(e.source,e.offset,s)),c>0&&i.push(this.#_(e.source,e.offset+e.length-c,c)),a=o}this.#y(i),this.#o=null,this.#s=null}applyEdits(e){if(e.length===0)return;let t=0,n=0,r=0,i=this.#v(),a=e.map(e=>e.text.length===0?void 0:this.#_(Hl.Added,this.#t.append(e.text),e.text.length)),o=[],s=()=>{let e=i[t];e!==void 0&&(n+=e.length,t++)},c=(e,r)=>{let a=ql(e,0,this.#i),c=ql(r,a,this.#i);for(;t<i.length&&n+i[t].length<=a;)s();for(;t<i.length&&a<c;){let e=i[t],r=n+e.length,l=ql(a-n,0,e.length),u=Math.min(r,c),d=u-(n+l);d>0&&o.push(l===0&&d===e.length?e:this.#_(e.source,e.offset+l,d)),a=u,a>=r&&s()}};for(let t=0;t<e.length;t++){let n=e[t],i=ql(n.start,r,this.#i),s=ql(n.end,i,this.#i);c(r,i);let l=a[t];l!==void 0&&o.push(l),r=s}c(r,this.#i),this.#y(o),this.#o=null,this.#s=null}positionAt(e){let t=ql(e,0,this.#i);if(this.#i===0)return{line:0,character:0};let n=this.#f(t);return{line:n,character:t-(n===0?0:this.#p(n-1))}}positionsAt(e){let t=Array.from({length:e.length});if(e.length===0)return t;if(this.#i===0)return t.fill({line:0,character:0});for(let n=0;n<e.length;n++)t[n]=this.positionAt(e[n]);return t}offsetAt(e){if(e.line<0||this.#i===0)return 0;if(e.line>=this.#a)throw Error(`Line index out of range: ${e.line}`);let t=this.#d(e.line);if(t===void 0)throw Error(`Line index out of range: ${e.line}`);let n=ql(e.character,0,t[1]-t[0]);return t[0]+n}#l(e){if(e<0||e>=this.#i)return;let t=this.#n,n=e;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(n-=e,n<t.piece.length)return[t,n];n-=t.piece.length,t=t.right}}#u(e){if(e.right!==null){let t=e.right;for(;t.left!==null;)t=t.left;return t}let t=e;for(;t.parent!==null&&t===t.parent.right;)t=t.parent;return t.parent}#d(e){if(e<0)throw Error(`Line index out of range: ${e}`);if(this.#i===0){if(e===0)return[0,0];throw Error(`Line index out of range: ${e}`)}if(e>=this.#a)throw Error(`Line index out of range: ${e}`);return[e===0?0:this.#p(e-1),e<this.#a-1?this.#p(e):this.#i]}#f(e){let t=this.#n,n=ql(e,0,this.#i),r=0;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(r+=t.left?.subtreeLineBreakCount??0,n-=e,n<=t.piece.length){let e=this.#g(t.piece.source);return r+=Ql(e.lineOffsets,t.piece.offset+n)-t.piece.lineOffsetStart,r}r+=t.piece.lineBreakCount,n-=t.piece.length,t=t.right}return this.#a-1}#p(e){let t=this.#n,n=e,r=0;for(;t!==null;){let e=t.left?.subtreeLineBreakCount??0;if(n<e){t=t.left;continue}let i=t.left?.subtreeLength??0;if(r+=i,n-=e,n<t.piece.lineBreakCount){let e=this.#g(t.piece.source).lineOffsets[t.piece.lineOffsetStart+n];return r+(e-t.piece.offset)}r+=t.piece.length,n-=t.piece.lineBreakCount,t=t.right}return this.#i}#m(){let e=[];return this.#h(t=>{e.push(t.text.slice(t.start,t.end))}),e.join(``)}#h(e){this.#x(this.#n,t=>{let n=this.#g(t.piece.source);return e({text:n.text,lineOffsets:n.lineOffsets,lineOffsetStart:t.piece.lineOffsetStart,lineOffsetEnd:t.piece.lineOffsetEnd,start:t.piece.offset,end:t.piece.offset+t.piece.length})})}#g(e){return e===Hl.Original?this.#e:this.#t}#_(e,t,n){let r=this.#g(e);return new Hl(e,t,n,Ql(r.lineOffsets,t),Ql(r.lineOffsets,t+n))}#v(){return this.#r}#y(e){let t=Zl(e);this.#r=t;let n=0,r=0;for(let e of t)n+=e.length,r+=e.lineBreakCount;this.#n=this.#b(t,0,t.length,null),this.#i=n,this.#a=r+1}#b(e,t,n,r){if(t>=n)return null;let i=t+Math.floor((n-t)/2),a=new Wl(e[i]);return a.parent=r,a.left=this.#b(e,t,i,a),a.right=this.#b(e,i+1,n,a),a.updateSubtreeLength(),a}#x(e,t){return e===null?!0:!this.#x(e.left,t)||t(e)===!1?!1:this.#x(e.right,t)}};function Kl(e){return e===10||e===13}function ql(e,t,n){return Math.min(Math.max(e,t),n)}function Jl(e){let t=Array.from({length:e.length}).fill(0),n=0;for(let r=1;r<e.length;r++){let i=e.charCodeAt(r);for(;n>0&&i!==e.charCodeAt(n);)n=t[n-1];i===e.charCodeAt(n)&&n++,t[r]=n}return t}function Yl(e,t){let n=[];for(let[r,i]of e){let e=ql(r,0,t),a=ql(i,e,t);e<a&&n.push([e,a])}n.sort((e,t)=>e[0]-t[0]);let r=[];for(let e of n){let t=r[r.length-1];if(t!==void 0&&e[0]<=t[1]){t[1]=Math.max(t[1],e[1]);continue}r.push(e)}return r}function Xl(e,t,n){let r=0,i=e.length;for(;r<i;){let n=r+Math.floor((i-r)/2);e[n][1]<=t?r=n+1:i=n}let a=e[r];return a!==void 0&&a[0]<n}function Zl(e){let t=[];for(let n of e){if(n.length===0)continue;let e=t[t.length-1];if(e!==void 0&&e.source===n.source&&e.offset+e.length===n.offset){t[t.length-1]=new Hl(e.source,e.offset,e.length+n.length,e.lineOffsetStart,n.lineOffsetEnd);continue}t.push(n)}return t}function Ql(e,t){let n=0,r=e.length;for(;n<r;){let i=n+Math.floor((r-n)/2);e[i]<=t?n=i+1:r=i}return n}function $l(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function eu(e){if(e<=32||e===127)return!0;let t=String.fromCharCode(e);return Vl.includes(t)}function tu(e,t,n,r){let i=e<=0||eu(nu(r,e-1)),a=e+t>=n||eu(nu(r,e+t));return i&&a}function nu(e,t){let n=e(t);return n.length===0?0:n.charCodeAt(0)}function ru(e,t,n){let r=t?e:$l(e);return new RegExp(r,`g${n?``:`i`}${t?`m`:``}`)}function iu(e,t){return e.replace(/\$([$&]|\d+)/g,(e,n)=>n===`$`?`$`:n===`&`?t[0]??``:t[Number(n)]??``)}function au(e,t,n,r,i,a){if(!r.regex)return r.replaceText;let o=e(i),s=n(o.line),c=i-t({line:o.line,character:0}),l=s.slice(c,c+(a-i)),u;try{u=ru(r.text,!0,r.caseSensitive)}catch{return r.replaceText}let d=new RegExp(u.source,u.flags.replace(`g`,``)).exec(l);return d===null||d[0].length!==l.length?r.replaceText:iu(r.replaceText,d)}function ou(e,t){if(t+1<e.length){let n=e.charCodeAt(t),r=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&r>=56320&&r<=57343)return t+2}return t+1}var su=class{#e;#t;#n;#r;#i;constructor(e,t,n=`plaintext`,r=0,i=new Pl){this.#e=new URL(e,`file://`).toString(),this.#t=n,this.#n=r,this.#r=new Gl(t),this.#i=i}get uri(){return this.#e}get languageId(){return this.#t}get version(){return this.#n}get lineCount(){return this.#r.lineCount}get canUndo(){return this.#i.canUndo}get canRedo(){return this.#i.canRedo}positionAt(e){return this.#r.positionAt(e)}positionsAt(e){return this.#r.positionsAt(e)}offsetAt(e){return this.#r.offsetAt(this.normalizePosition(e))}getText(e){return this.#r.getText(e)}getLineText(e,t){return this.#r.getLineText(e,t)}getLineLength(e,t){return this.#r.getLineLength(e,t)}charAt(e){return typeof e==`number`?this.#r.charAt(e):this.#r.charAt(this.offsetAt(e))}getTextSlice(e,t){return this.#r.getTextSlice(e,t)}findNextNonOverlappingSubstring(e,t){return this.#r.findNextNonOverlappingSubstring(e,t)}search(e){return this.#r.search(e)}applyEdits(e,t=!1,n,r){if(e.length!==0)return this.applyResolvedEdits(e.map(e=>this.#a(e)),t,n,r)}applyResolvedEdits(e,t=!1,n,r){if(e.length===0)return;let i=this.#o(e);if(t){let e=Fl(this,i,this.#n,this.#n+1,n,r),t=this.#i.peekUndo(),a=this.#s(i);return this.#n++,a.lineDelta===0&&Il(t,e)?this.#i.replaceLastUndo(Ll(t,e)):this.#i.push(e),a}let a=this.#s(i);return this.#n++,a}setLastUndoSelectionsAfter(e){this.#i.setLastUndoSelectionsAfter(e)}setLastUndoLineAnnotations(e,t){this.#i.setLastUndoLineAnnotations(e,t)}undo(){let e=this.#i.popUndoToRedo();if(e===void 0)return;let t=this.#s(e.inverseEdits);if(t!==void 0)return this.#n=e.versionBefore,[t,e.selectionsBefore?.slice(),e.lineAnnotationsBefore?.slice()]}redo(){let e=this.#i.popRedoToUndo();if(e===void 0)return;let t=this.#s(e.forwardEdits);if(t!==void 0)return this.#n=e.versionAfter,[t,e.selectionsAfter?.slice(),e.lineAnnotationsAfter?.slice()]}normalizePosition(e){let t=Math.max(0,Math.min(e.line,this.lineCount-1));return{line:t,character:Math.max(0,Math.min(e.character,this.getLineLength(t)))}}#a(e){let t=this.offsetAt(e.range.start),n=this.offsetAt(e.range.end);if(t>n){let e=t;t=n,n=e}return{start:t,end:n,text:e.newText}}#o(e){let t=[...e].sort((e,t)=>e.start-t.start);for(let e=0;e<t.length-1;e++)if(t[e].end>t[e+1].start)throw Error(`Overlapping text edits are not supported`);return t}#s(e){let t=this.#r.lineCount,n=this.positionsAt(e.flatMap(e=>[e.start,e.end])),r=this.#c(e,n),i=n[0];this.#r.applyEdits(e);let a=this.#r.lineCount;return{startLine:r.startLine,startCharacter:i.character,endLine:Math.min(r.endLine,Math.max(0,a-1)),previousLineCount:t,lineCount:a,lineDelta:a-t,changedLineRanges:r.ranges}}#c(e,t){let n=1/0,r=0,i=0,a=[];for(let o=0;o<e.length;o++){let s=e[o],c=t[o*2].line,l=t[o*2+1].line,u=cu(s.text),d=c+i,f=d+u;n=Math.min(n,c),r=Math.max(r,f);let p=a[a.length-1];p!==void 0&&d<=p[1]+1?a[a.length-1]=[p[0],Math.max(p[1],f)]:a.push([d,f]),i+=u-(l-c)}return n===1/0?{startLine:0,endLine:0,ranges:[[0,0]]}:{startLine:n,endLine:r,ranges:a}}};function cu(e){let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}var lu=void 0,uu=void 0,du=void 0;function fu(){return lu??=/macOS|MacIntel|iPhone|iPad|iPod/i.test(_u())}function pu(){return uu??=/Linux/i.test(_u())}function mu(){return du??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function hu({metaKey:e,ctrlKey:t},n=fu()){return n?e&&!t:t&&!e}function gu(e){if((fu()||pu())&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`}if(hu(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}function _u(){let e=globalThis.navigator;return e?.platform??e?.userAgentData?.platform??`unknown`}var vu={a:`selectAll`,d:`findNextMatch`};function yu(e,t=fu()){let n=hu(e,t),{shiftKey:r,altKey:i,key:a}=e,o=a.length===1?a.toLowerCase():a;if(n&&(o===`f`||e.code===`KeyF`))return i?`openSearchReplacePanel`:`openSearchPanel`;if(!i){if(!n&&o===`Tab`)return r?`outdent`:`indent`;if(n)return o===`z`?r?`redo`:`undo`:!t&&o===`y`?`redo`:o===`Home`||t&&o===`ArrowUp`?r?`expandSelectionDocStart`:`moveCursorToDocStart`:o===`End`||t&&o===`ArrowDown`?r?`expandSelectionDocEnd`:`moveCursorToDocEnd`:vu[o]}}var bu=`@layer base,theme,rendered,unsafe;::selection{background-color:#0000}@keyframes blinking{0%{opacity:1}50%{opacity:0}to{opacity:1}}:host,[data-code],[data-content]{position:relative}[data-content]{caret-color:var(--diffs-bg-caret);background-color:#0000;outline:none}[data-gutter-buffer],[data-line]:not([data-selected-line]),[data-line]:not([data-selected-line]) span,[data-line-annotation]{background-color:#0000}[data-column-number]{color:var(--diffs-editor-line-number-fg)}[data-column-number][data-selected-line]{background-color:var(--diffs-editor-line-number-active-bg);color:var(--diffs-editor-line-number-active-fg)}[data-column-number][data-active]{color:var(--diffs-editor-line-number-active-fg)}[data-line]{cursor:text}[data-line][data-selected-line]{background-color:var(--diffs-editor-line-highlight-bg)}[data-line][data-line-type=change-deletion]{background-color:var(--diffs-line-bg)}[data-editor-overlay]{display:contents}[data-caret],[data-selection-range],[data-match-range],[data-marker-range]{height:1lh;line-height:var(--diffs-line-height);pointer-events:none;position:absolute;top:0;left:0}[data-caret]{background-color:var(--diffs-bg-caret-override,var(--diffs-editor-cursor-fg,light-dark(color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg)),color-mix(in lab, var(--diffs-fg) 75%, var(--diffs-bg)))));visibility:hidden;width:2px;animation:1.2s .8s infinite blinking}[data-selection-range]{z-index:-10;background-color:var(--diffs-editor-selection-bg)}[data-selection-corner]{background-color:var(--diffs-bg);width:100%;height:100%}[data-match-range]{z-index:-10;background-color:var(--diffs-editor-match-bg,var(--diffs-editor-selection-bg))}[data-match-range]:not([data-focus]){background-color:var(--diffs-editor-match-highlight-bg,light-dark(#ff963288,#ff963266))}[data-marker-range]{z-index:1;mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2IiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0wIDIuNSBsMiAtMS41IGwxIDAgbDIgMS41IGwxIDAiIHN0cm9rZT0iI2ZmZiIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9zdmc+);mask-position:0 100%;mask-size:6px 3px;mask-repeat:repeat-x}[data-marker-error]{background-color:var(--diffs-editor-error-fg,red)}[data-marker-warning]{background-color:var(--diffs-editor-warning-fg,#cca700)}[data-marker-info]{background-color:var(--diffs-editor-info-fg,#3794ff)}[data-marker-hint]{background-color:var(--diffs-editor-hint-fg,#6a6a6a)}[data-rtl]{border-top-left-radius:3px}[data-rtr]{border-top-right-radius:3px}[data-rbl]{border-bottom-left-radius:3px}[data-rbr]{border-bottom-right-radius:3px}@media (width>=480px){[data-content]{caret-color:#0000}[data-selection-action]{caret-color:currentColor}[data-content]:focus~[data-editor-overlay] [data-caret]{visibility:visible}}[data-editor-widget]{--diffs-widget-bg:color-mix(in lab, var(--diffs-fg) 4%, var(--diffs-bg));--diffs-widget-border:color-mix(in lab, var(--diffs-fg) 20%, transparent);--diffs-widget-shadow:inset 0 0 0 1px var(--diffs-bg), 0 4px 8px #00000013, 0 6px 18px #00000013;z-index:100;border:1px solid var(--diffs-widget-border);background-color:var(--diffs-widget-bg);width:fit-content;max-width:calc(100% - 24px);box-shadow:var(--diffs-widget-shadow);background-clip:padding-box;border-radius:9px;position:absolute;top:0;left:0}[data-marker-popup]{pointer-events:auto;min-width:180px;font-family:var(--diffs-header-font-fallback);padding:8px 12px;font-size:14px;line-height:1.4}[data-marker-popup] code{background-color:#0000;display:inline}[data-selection-action-icon]{z-index:10;width:1lh;height:1lh;color:color-mix(in lab, var(--diffs-fg) 40%, var(--diffs-bg));cursor:pointer;visibility:hidden;border-radius:4px;justify-content:center;align-items:center;transition:background-color .1s ease-in-out,color .1s ease-in-out;display:flex;position:absolute;top:0;left:-1lh}[data-selection-action-icon][data-visible=true]{visibility:visible}[data-selection-action-icon]:hover{background-color:color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg));color:var(--diffs-fg)}[data-selection-action]{padding-inline-end:1ch}[data-search-panel]{z-index:100;flex-direction:column;justify-content:right;width:100%;height:fit-content;margin-bottom:4px;display:flex;position:sticky;top:12px;right:12px}[data-search-panel] [data-editor-widget]{z-index:100;max-width:100%;font-family:var(--diffs-header-font-fallback);align-items:flex-start;gap:8px;margin-inline:auto 12px;padding:4px;font-size:14px;display:flex;position:relative}[data-search-grid]{grid-template-columns:auto auto auto;align-items:center;gap:4px 6px;display:grid}[data-search-grid][data-mode=find] [data-replace-cell]{display:none}[data-input-box]{align-items:center;width:200px;display:flex;position:relative}[data-input-box] input{width:100%;min-width:0;color:var(--diffs-fg);background-color:var(--diffs-bg);border:1px solid color-mix(in lab, var(--diffs-fg) 12%, var(--diffs-bg));border-radius:6px;outline:none;flex-grow:1;padding-inline:6px;font-size:13px;line-height:24px}[data-input-box][data-find] input{padding-inline-end:72px}[data-input-box] input::selection{background-color:color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg))}[data-search-toggles]{align-items:center;gap:1px;display:flex;position:absolute;top:50%;right:4px;transform:translateY(-50%)}[data-matches]{white-space:nowrap;min-width:50px;color:color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg));flex-shrink:0;font-size:12px;font-weight:500;line-height:20px}[data-matches][data-no-matches]{color:color-mix(in lab, var(--diffs-fg) 35%, var(--diffs-bg))}[data-replace-actions],[data-search-nav]{align-items:center;display:flex}[data-search-panel] svg{fill:currentColor;display:block}[data-search-panel] [data-icon]{width:24px;height:24px;color:color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg));cursor:pointer;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .1s ease-in-out,color .1s ease-in-out;display:flex}[data-search-panel] [data-icon][data-disabled=true]{opacity:.25;pointer-events:none}[data-search-panel] [data-icon]:hover{color:var(--diffs-fg)}[data-search-panel] [data-icon][data-active=true]{color:light-dark(var(--diffs-modified-light),var(--diffs-modified-dark))}`;function Q(e,t,n){let{style:r,dataset:i,children:a,...o}=t??{},s=document.createElement(e);return Object.assign(s,o),r!==void 0&&(typeof r==`string`?s.style.cssText=r:Object.assign(s.style,r)),i!==void 0&&(typeof i==`string`?s.dataset[i]=``:Array.isArray(i)?i.forEach(e=>{s.dataset[e]=``}):Object.assign(s.dataset,i)),a!==void 0&&s.replaceChildren(...a),n!==void 0&&n.appendChild(s),s}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function xu(e,t=`line`){let n=e.dataset[t];if(n===void 0)return;let r=parseInt(n,10);if(!Number.isNaN(r))return r}function Su(e,t){if(e.nodeType===3){let n=e.textContent?.length??0;return Math.max(0,Math.min(t,n))}return e.nodeType===1?Math.max(0,Math.min(t,e.childNodes.length)):0}function Cu(e,t){return Object.assign(e,t)}function wu(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Tu(e,t=1e3){return Math.round(e*t)/t}function Eu(e,t){if(e.lineDelta===0)return;let n=e.startCharacter,r=Math.max(0,-e.lineDelta),i=r===0?void 0:e.startLine+(n===0?0:1),a=i===void 0?void 0:i+r,o=r>0?e.startLine+r:e.startLine+(n===0?0:1),s=[],c=!1;for(let n of t){if(n.side===`deletions`){s.push(n);continue}let t=n.lineNumber-1;if(i!==void 0&&a!==void 0&&t>=i&&t<a){c=!0;continue}if(t>=o){s.push({...n,lineNumber:t+e.lineDelta+1}),c=!0;continue}s.push(n)}return c?s:void 0}function Du(e,t,n){let r=new Map,i=new Map;for(let t of e){let e=t.lineNumber;r.has(e)||r.set(e,[]),i.has(e)||i.set(e,[]),(t.side===`deletions`?i:r).get(e).push(he(t))}let a=t.parentElement?.previousElementSibling,o,s;if(a!=null&&a instanceof HTMLElement&&a.dataset.deletions!==void 0)for(let e of a.children){let t=e,{gutter:n,content:r}=t.dataset;n===void 0?r!==void 0&&(s=t):o=t}Ou(t,n),s!==void 0&&Ou(s,o);let c=ku(r,t,n);if(s===void 0)return;let l=ku(i,s,o);requestAnimationFrame(()=>{Au(r,i,c,l)})}function Ou(e,t){let n=[];for(let r=1;r<e.childElementCount;r++){let i=e.children[r];i.dataset.lineAnnotation!==void 0&&(n.push(i),t!==void 0&&n.push(t.children[r]))}for(let e of n)e.remove()}function ku(e,t,n){let r=new Map;for(let n of t.children){let t=xu(n);if(t!==void 0){let i=e.get(t);if(i!==void 0){let e=Q(`div`,{dataset:{lineAnnotation:`0,`+(t-1)},children:[Q(`div`,{dataset:`annotationContent`,children:i.map(e=>Q(`slot`,{name:e}))})]});n.after(e),r.set(t,e)}}}if(n!==void 0)for(let t of n.children){let n=xu(t,`columnNumber`);if(n!==void 0&&e.has(n)){let e=Q(`div`,{dataset:{gutterBuffer:`annotation`,bufferSize:`1`},style:{gridRow:`span 1`}});t.after(e)}}return r}function Au(e,t,n,r){let i=new Map;for(let[t,n]of e.entries()){let e=r.get(t);if(n.length===0&&e!==void 0){let n=ju(e);n>0&&i.set(t,n)}}for(let[e,r]of t.entries()){let t=n.get(e);if(r.length===0&&t!==void 0){let n=ju(t);n>0&&i.set(e,n)}}Mu(e,n,i),Mu(t,r,i)}function ju(e){let t=e.firstElementChild;return t instanceof HTMLElement?t.getBoundingClientRect().height:0}function Mu(e,t,n){for(let[r,i]of t.entries()){let t=e.get(r),a=n.get(r);t?.length===0&&a!==void 0&&i.style.setProperty(`--diffs-annotation-min-height`,`${a}px`)}}function Nu(e,t=0){let n=md(e.startContainer,e.startOffset),r=md(e.endContainer,e.endOffset);if(!(n===null||r===null))return{start:n,end:r,direction:t}}function Pu(e,t,n,r){if(e===void 0)return[[],t];let{start:i,end:a}=t,o=[],s={...t},c=a.line;i.line<a.line&&a.character===0&&c--;for(let t=i.line;t<=c;t++){let c=e.getLineText(t);if(c===void 0)continue;let l=c.startsWith(` `)?` `:` `.repeat(n),u=0,d=l;if(r){if(c.startsWith(` `))u=1;else if(c.startsWith(` `)){let e=c.length-c.trimStart().length;u=Math.min(l.length,e)}if(u===0)continue;d=``}o.push({range:{start:{line:t,character:0},end:{line:t,character:u}},newText:d});let f=d.length-u;t===i.line&&(s={...s,start:{...i,character:Math.max(0,i.character+f)}}),t===a.line&&(s={...s,end:{...a,character:Math.max(0,a.character+f)}})}return[o,s]}function Fu(e,t,n){let r=e.lineCount;return t.map(t=>{let{line:i,character:a}=n===`up`||n===`left`?t.start:t.end;if(n===`textStart`||n===`start`||n===`end`){if(n===`textStart`){let t=dd(e.getLineText(i));a=a===t?0:t}else a=n===`start`?0:e.getLineLength(i);i=t.direction===-1?t.start.line:t.end.line}else if(n===`up`)i=Math.max(0,i-1);else if(n===`down`)i=Math.min(Math.max(r-1,0),i+1);else if(Uu(t)){let t=e.getLineLength(i);a=Math.min(a,t),n===`left`?(a--,a<0&&(i===0?a=0:(i=Math.max(0,i-1),a=e.getLineLength(i)))):(a++,a>t&&(i===r-1?a--:(i=Math.min(Math.max(r-1,0),i+1),a=0)))}let o={line:i,character:a};return{start:o,end:o,direction:0}})}function Iu(e,t,n){return t.map(t=>{let[r,i]=cd(e,t),a=e.positionAt(i),[o]=Fu(e,[{start:a,end:a,direction:0}],n);return Ju(e,r,e.offsetAt(o.start))})}function Lu(e,t,n,r,i=2){if(t[t.length-1]===void 0)return{nextSelections:[]};let a=[];for(let e of t)a.push(e.start,e.end);let o=a.map(t=>e.offsetAt(t)),s=o[(t.length-1)*2],c=o[(t.length-1)*2+1],l=[],u=!0;for(let e=0;e<t.length;e++){let t={index:e,start:o[e*2],end:o[e*2+1]},n=l[l.length-1];n!==void 0&&(t.start<n.start||t.start===n.start&&t.end<n.end)&&(u=!1),l.push(t)}u||l.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let d=pd(e,n,i),f=[],p=Array.from({length:t.length}),m=0,h,g=()=>{if(h===void 0)return;let t=pd(e,{start:h.start,end:h.end,text:d.text},i),n=ud(e,t.text,t.start);f.push({start:t.start,end:t.end,text:n});let r=[h.start+m+n.length,h.start+m+n.length];for(let e of h.indices)p[e]=r;m+=n.length-(t.end-t.start),h=void 0};for(let e of l){let t=Math.max(0,e.start+(d.start-s)),n=Math.max(t,e.end+(d.end-c));if(h!==void 0&&t<h.end){h.end=Math.max(h.end,n),h.indices.push(e.index);continue}g(),h={start:t,end:n,indices:[e.index]}}g();let _=e.applyResolvedEdits(f,!0,t),v=fd(e,p.map(e=>{if(e===void 0)throw Error(`Missing next selection offsets`);return e}));if(e.setLastUndoSelectionsAfter(v),_!==void 0&&r!==void 0){let t=Eu(_,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:v,change:_}}function Ru(e,t,n,r){if(t.length!==n.length)throw Error(`Selection text replacements must match the selection count`);let i=[];for(let e of t)i.push(e.start,e.end);let a=i.map(t=>e.offsetAt(t)),o=[],s=!0;for(let e=0;e<t.length;e++){let t={index:e,start:a[e*2],end:a[e*2+1],text:n[e]},r=o[o.length-1];r!==void 0&&(t.start<r.start||t.start===r.start&&t.end<r.end)&&(s=!1),o.push(t)}s||o.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let c=n.every(e=>e===``),l,u=Array.from({length:t.length});if(c){l=[];let e=!1;for(let t of o){if(u[t.index]=t.end,t.start>=t.end)continue;e=!0;let n=l[l.length-1];n!==void 0&&t.start<n.end?l[l.length-1]={start:n.start,end:Math.max(n.end,t.end),text:``}:l.push({start:t.start,end:t.end,text:``})}if(!e)return{nextSelections:t};for(let e of o){let t=e.end,n=0,r=t;for(let e of l){if(t<=e.start)break;if(t>=e.end){n-=e.end-e.start;continue}r=e.start+n;break}r===t&&(r+=n),u[e.index]=r}}else{l=[];let t=0,n=-1;for(let r of o){if(r.start<n)throw Error(`Overlapping multi-selection edits are not supported`);n=r.end;let i=ud(e,r.text,r.start);l.push({start:r.start,end:r.end,text:i}),u[r.index]=r.start+t+i.length,t+=i.length-(r.end-r.start)}}let d=e.applyResolvedEdits(l,!0,t),f=fd(e,u.map(e=>[e,e]));if(e.setLastUndoSelectionsAfter(f),d!==void 0&&r!==void 0){let t=Eu(d,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:f,change:d}}function zu(e,t,n){let r=e.getText(),i=[],a=[];for(let n of t){let[t,o]=cd(e,n);if(!Uu(n)){a.push([t,o]);continue}let{line:s,character:c}=n.start,l=t,u=e.getLineLength(s),d;if(c>0&&c<u)d={start:l-1,end:l+1,text:r[l]+r[l-1]},a.push([l+1,l+1]);else if(c===u&&u>=2)d={start:l-2,end:l,text:r[l-1]+r[l-2]},a.push([l,l]);else if(c===0&&s>0&&u>0){let t=s-1,n=e.getLineLength(t),i=e.offsetAt({line:t,character:n}),o=n>0?i-1:i;d={start:o,end:l+1,text:r[l]+r.slice(i,l)+r.slice(o,i)},a.push([l+1,l+1])}else{a.push([t,o]);continue}i.push(d)}if(i.length===0)return{nextSelections:t};i.sort((e,t)=>e.start-t.start);for(let e=1;e<i.length;e++)if(i[e].start<i[e-1].end)throw Error(`Overlapping multi-selection edits are not supported`);let o=e.applyResolvedEdits(i,!0,t),s=fd(e,a);if(e.setLastUndoSelectionsAfter(s),o!==void 0&&n!==void 0){let t=Eu(o,n);t!==void 0&&e.setLastUndoLineAnnotations(n,t)}return{nextSelections:s,change:o}}function Bu(e,t,n){let r=t.map(t=>{let n=ld(e,t);return{start:n.start,end:n.end,direction:0}});return Ru(e,r,r.map(()=>``),n)}function Vu(e,t,n,r){let i=t.map(t=>{if(!Uu(t))return{start:t.start,end:t.end,direction:0};let r=Wu(t),{line:i,character:a}=r,o=n?.(i,a)??0;if(a>o)return{start:{line:i,character:o},end:{line:i,character:a},direction:0};if(i===0)return{start:r,end:r,direction:0};let s=e.getLineLength(i-1);return{start:{line:i-1,character:s},end:{line:i,character:0},direction:0}});return Ru(e,i,i.map(()=>``),r)}function Hu(e,t,n){let r=t.map(t=>{let[n,r]=od(e,t);return{start:n,end:r,direction:0}});return Ru(e,r,r.map(()=>``),n)}function Uu(e){return e.start.line===e.end.line&&e.start.character===e.end.character}function Wu(e){let{start:t,end:n,direction:r}=e;return r===-1?t:n}function Gu(e){return e===`context`||e===`context-expanded`||e===`change-addition`}function Ku(e,t){let n=Uu(e),r=Uu(t);return n&&r?qu(e.start,t.start)===0:n?qu(t.start,e.start)<=0&&qu(e.start,t.end)<=0:r?qu(e.start,t.start)<=0&&qu(t.start,e.end)<=0:qu(e.start,t.end)<0&&qu(t.start,e.end)<0}function qu(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function Ju(e,t,n){let r=t===n?0:t<n?1:-1,i=Math.min(t,n),a=Math.max(t,n);return{start:e.positionAt(i),end:e.positionAt(a),direction:r}}function Yu(e,t){let n=e.direction===-1?e.end:e.start,r=qu(n,t.start),i=qu(n,t.end),a=t.end;a=r<=0?t.end:i>=0?t.start:r===0?t.end:t.start;let o=qu(n,a);return{start:o<=0?n:a,end:o<=0?a:n,direction:o===0?0:o<0?1:-1}}function Xu(e,t){let n=qu(t.start,e.start)<0,r=qu(t.end,e.end)>0;return n&&!r?{start:t.start,end:e.end,direction:-1}:r&&!n?{start:e.start,end:t.end,direction:1}:e.direction===-1?{start:t.start,end:e.end,direction:qu(t.start,e.end)===0?0:-1}:{start:e.start,end:t.end,direction:qu(e.start,t.end)===0?0:1}}function Zu(e,t){return Qu(e.map(e=>Xu(e,t)))}function Qu(e){if(e.length<=1)return e;let t=new Set,n=[];for(let r=e.length-1;r>=0;r--){let i=e[r];if(i===void 0)continue;let a=0,o=n.length;for(;a<o;){let e=Math.floor((a+o)/2),t=n[e]?.selection;if(t===void 0)break;qu(t.start,i.start)<0?a=e+1:o=e}let s=n[a-1]?.selection,c=n[a]?.selection;s!==void 0&&Ku(s,i)||c!==void 0&&Ku(c,i)||(n.splice(a,0,{index:r,selection:i}),t.add(r))}return e.filter((e,n)=>t.has(n))}function $u(e,t){if(t.length===0)return;let n=t.map(t=>Uu(t)?id(e,t):t),r=n.map(t=>e.getText(t)),i=r[0];if(i.length===0||r.some(e=>e!==i))return;let a=n.map(t=>[e.offsetAt(t.start),e.offsetAt(t.end)]),o=e.findNextNonOverlappingSubstring(i,a);if(o===void 0)return n.some((e,n)=>{let r=t[n];return qu(e.start,r.start)!==0||qu(e.end,r.end)!==0||e.direction!==r.direction})?n:void 0;let s=Ju(e,o,o+i.length);return[...n,s]}function ed(e){let t=e.lineCount-1;return{start:{line:0,character:0},end:{line:t,character:e.getLineLength(t)},direction:1}}function td(e,t){let n=t?e.lineCount-1:0,r={line:n,character:t?e.getLineLength(n):0};return{start:r,end:r,direction:1}}function nd(e,t){return[...t].sort((e,t)=>{let n=qu(e.start,t.start);return n===0?qu(e.end,t.end):n}).map(t=>Uu(t)?e.getLineText(t.start.line,!1):e.getText(t)).join(`
|
|
1675
|
+
`)}function rd(e,t){let n=Math.max(0,t),r=hd(e),i=null;for(let e of r){i=e;let t=Cd(e);if(n<=t+(e.textContent?.length??0)){let r=gd(e,n<t?0:n-t);if(r!==null)return r}}if(i!==null){let e=gd(i,i.textContent?.length??0);return e===null?[i,0]:e}let a=0,o=null;for(let t of e.childNodes){if(t.nodeType===1&&t.tagName===`BR`)return[t,0];if(t.nodeType!==3)continue;o=t;let e=wd(o.textContent,o.textContent?.length??0);if(n<=a+e)return[o,wd(o.textContent,n-a)];a+=e}return o===null?[e,0]:[o,wd(o.textContent,o.textContent?.length??0)]}function id(e,t){let{line:n,character:r}=t.start,i=e.getLineText(n),a=ad(i,Math.max(0,Math.min(r,i.length)));return a===void 0?t:{start:{line:n,character:a.start},end:{line:n,character:a.end},direction:1}}function ad(e,t){let n=new Intl.Segmenter(void 0,{granularity:`word`});for(let r of n.segment(e)){if(r.isWordLike!==!0)continue;let e=r.index,n=e+r.segment.length;if(t>=e&&t<=n)return{start:e,end:n}}}function od(e,t){if(!Uu(t))return[t.start,t.end];let n=Wu(t),{line:r,character:i}=n;if(i===0){if(r===0)return[n,n];let t=e.getLineLength(r-1);return[{line:r-1,character:t},{line:r,character:0}]}let a=e.getLineText(r),o=[0],s=new Intl.Segmenter(void 0,{granularity:`grapheme`});for(let e of s.segment(a))e.index>0&&o.push(e.index);let c=i,l;for(;c>0;){let e=sd(a,c,!1,o),t=a.slice(e,c),n=/\S/.test(t)?/\p{Alphabetic}|\p{Number}|_/u.test(t)?1:2:0;if(l!==void 0&&n!==l)break;(t!==` `||c!==i)&&(l=n),c=e}return[{line:r,character:c},{line:r,character:i}]}function sd(e,t,n,r){if(n){for(let e of r)if(e>t)return e;return e.length}for(let e=r.length-1;e>=0;e--){let n=r[e];if(n<t)return n}return 0}function cd(e,t){let n=t.direction===-1;return[e.offsetAt(n?t.end:t.start),e.offsetAt(Wu(t))]}function ld(e,t){if(!Uu(t))return{start:t.start,end:t.end};let{line:n,character:r}=t.start,i=e.getLineText(n).length;return r<i?{start:{line:n,character:r},end:{line:n,character:i}}:n<e.lineCount-1?{start:{line:n,character:r},end:{line:n+1,character:0}}:{start:{line:n,character:r},end:{line:n,character:r}}}function ud(e,t,n){if(t!==`
|
|
1676
|
+
`&&t!==`\r
|
|
1677
|
+
`)return t;let r=e.positionAt(n).line,i=e.getLineText(r),a=dd(i);return a===0?t:t+i.slice(0,a)}function dd(e){let t=0;for(;t<e.length;t++){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}return t}function fd(e,t){let n=[];for(let[e,r]of t)n.push(Math.min(e,r),Math.max(e,r));let r=e.positionsAt(n);return t.map(([e,t],n)=>{let i=e===t?0:e<t?1:-1;return{start:r[n*2],end:r[n*2+1],direction:i}})}function pd(e,t,n){if(t.text!==``||t.start!==t.end-1)return t;let r=e.positionAt(t.end);if(r.character===0)return t;let i=e.getLineText(r.line),a=i.slice(0,r.character);if(/[^ \t]/.test(a)||i[r.character-1]===` `)return t;let o=Math.max(0,r.character-n),s=i.slice(o,r.character);return s.length===n&&/^ +$/.test(s)?{...t,start:t.end-s.length}:t}function md(e,t){let n=e.nodeType===1?e:e.parentElement;for(;n!==null&&Sd(n)===void 0;)n=n.parentElement;if(n===null)return null;let r=Sd(n);if(r===void 0)return null;if(e.nodeType===3)return e.parentElement===null?null:bd(e.parentElement)===null?{line:r,character:yd(n,e)+wd(e.textContent,t)}:{line:r,character:xd(e,t)};if(e.nodeType===1){let i=e;if(i.tagName===`DIV`){let e=0;for(let n=0;n<t;n++)e=xd(i.childNodes[n]);return{line:r,character:e}}if(i.tagName===`BR`)return{line:r,character:0};if(i.tagName===`SPAN`){if(t<i.childNodes.length){let e=i.childNodes[t];if(e?.nodeType===1){let t=Cd(e);if(t!==void 0)return{line:r,character:t};let n=bd(e),i=n===null?void 0:Cd(n);if(i!==void 0)return{line:r,character:i}}}return{line:r,character:t>0?xd(i.childNodes[t-1]):yd(n,i)}}return{line:r,character:yd(n,i)}}return null}function hd(e){let t=[];for(let n of e.childNodes){if(n.nodeType!==1)continue;let e=n;if(e.tagName===`SPAN`){if(Cd(e)!==void 0){t.push(e);continue}for(let n of e.childNodes)n.nodeType===1&&Cd(n)!==void 0&&t.push(n)}}return t}function gd(e,t){let n=Math.max(0,t),r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let t=e.container.childNodes[e.index];if(e.index++,t.nodeType===3){let e=wd(t.textContent,t.textContent?.length??0);if(n<=e)return[t,n];n-=e}else t.nodeType===1&&r.push({container:t,index:0})}return null}function _d(e,t){let n=0,r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let i=e.container.childNodes[e.index];if(i===t)return n;e.index++,i.nodeType===3?n+=wd(i.textContent,i.textContent?.length??0):i.nodeType===1&&r.push({container:i,index:0})}return n}function vd(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=n.parentElement}return!1}function yd(e,t){if(t.parentElement===e){let n=0,r=Array.prototype.indexOf.call(e.childNodes,t);for(let t=0;t<r;t++)n=xd(e.childNodes[t]);return n}for(let n of hd(e))if(vd(n,t))return Cd(n)+(t.nodeType===3?_d(n,t):0);let n=0,r=t.nodeType===1?t:t.parentElement;for(;r!==null&&r.parentElement!==null&&Sd(r.parentElement)===void 0;){let e=r.parentElement,t=Array.prototype.indexOf.call(e.childNodes,r);for(let r=0;r<t;r++)n=xd(e.childNodes[r]);r=e}return n}function bd(e){let t=e;for(;t!==null;){if(Sd(t)!==void 0)return null;if(Cd(t)!==void 0)return t;t=t.parentElement}return null}function xd(e,t){if(e===void 0)return 0;if(e.nodeType===3){let n=e.parentElement;if(n===null)return 0;let r=bd(n);if(r===null)return 0;let i=Cd(r);if(i===void 0)return 0;let a=t===void 0?wd(e.textContent,e.textContent?.length??0):wd(e.textContent,t);return i+_d(r,e)+a}if(e.nodeType!==1)return 0;let n=e;if(n.tagName!==`SPAN`&&n.tagName!==`BR`)return 0;let r=Cd(n);if(r!==void 0)return r+(n.textContent?.length??0);let i=0;for(let e of n.childNodes)i=Math.max(i,xd(e));return i}function Sd(e){let{line:t}=e.dataset;if(t!==void 0){let e=parseInt(t,10);if(!Number.isNaN(e))return e-1}}function Cd(e){let{char:t}=e.dataset;if(t!==void 0){let e=parseInt(t,10);if(!Number.isNaN(e))return e}}function wd(e,t){let n=e??``,r=n.search(/[\r\n]/);return Math.min(t,r===-1?n.length:r)}var Td=300,Ed=100,Dd=class{#e;#t=[];#n;#r;#i;#a;#o;#s;#c;#l=!1;constructor(e){this.#e=e}get markers(){return this.#t}isPopupVisible(){return this.#c!==void 0}setMarkers(e,t){this.#t=e.map(e=>({...e,start:t.normalizePosition(e.start),end:t.normalizePosition(e.end)})),this.removePopup()}listenHover(e){this.#i?.forEach(e=>e()),this.#i=void 0,this.#t.length!==0&&(this.#i=[$(e,`mouseover`,e=>{if(this.#e.isMouseDown())return;let t=e.composedPath()[0];if(t===void 0)return;let n=this.#u(t);n===void 0?(this.#d(),this.#m()):this.#p(n)}),$(e,`mouseleave`,()=>{this.#d(),this.#m()})])}removePopup(){this.#d(),this.#f(),this.#h()}cleanup(){this.#i?.forEach(e=>e()),this.#i=void 0,this.removePopup(),this.#t=[]}#u(e){let t=e.closest(`[data-line]`);if(t==null)return;let n=xu(t);if(n===void 0)return;let r;if(e.tagName===`SPAN`){let t=e.dataset.char;if(t===void 0||(r=parseInt(t,10),Number.isNaN(r)))return}else if(e.tagName===`BR`)r=0;else return;let i={line:n-1,character:r};for(let e=this.#t.length-1;e>=0;e--)if(Ku({start:i,end:i},this.#t[e]))return e}#d(){this.#a!==void 0&&(clearTimeout(this.#a),this.#a=void 0),this.#s=void 0}#f(){this.#o!==void 0&&(clearTimeout(this.#o),this.#o=void 0)}#p(e){if(e===this.#c||e===this.#s){this.#f();return}if(this.#d(),this.#f(),this.#n!==void 0){this.#g(e);return}this.#s=e,this.#a=setTimeout(()=>{this.#a=void 0,this.#s=void 0,this.#g(e)},Td)}#m(){this.#l||(this.#f(),this.#o=setTimeout(()=>{this.#o=void 0,this.#l||this.removePopup()},Ed))}#h(){this.#r?.forEach(e=>e()),this.#r=void 0,this.#n?.remove(),this.#n=void 0,this.#c=void 0,this.#l=!1}#g(e){if(e===this.#c)return;let t=this.#e.getFileContainer()?.shadowRoot?.querySelector(`pre`),n=t?.querySelector(`[data-code]`);if(e>=this.#t.length||t==null||n==null)return;let{start:r,message:i}=this.#t[e],{line:a,character:o}=r,{getCharX:s,getLineY:c,getLineHeight:l}=this.#e,[u,d]=s(a,o),f=l(),p=c(a)+d*f+f,m=`translateX(${n.offsetLeft+u}px) translateY(${n.offsetTop+p}px)`,h=this.#n;if(h!==void 0){h.style.transform=m;let t=h.firstElementChild;t?.dataset.markerMessage!==void 0&&(typeof i==`string`?t.textContent=i:i instanceof HTMLElement?t.replaceChildren(i):t.innerHTML=i.html),this.#c=e;return}this.#n=Q(`div`,{dataset:[`editorWidget`,`markerPopup`],style:{transform:m},children:[Q(`div`,{dataset:`markerMessage`,...typeof i==`string`?{textContent:i}:i instanceof HTMLElement?{children:[i]}:{innerHTML:i.html}})]},t),this.#c=e,this.#r=[$(this.#n,`mouseenter`,()=>{this.#l=!0,this.#f()}),$(this.#n,`mouseleave`,()=>{this.#l=!1,this.#m()})]}};function Od(e){switch(e){case`error`:return`markerError`;case`warning`:return`markerWarning`;case`info`:return`markerInfo`;case`hint`:return`markerHint`}}var kd=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
1678
|
+
<symbol id="diffs-editor-icon-close" viewBox="0 0 16 16">
|
|
1679
|
+
<path fill="currentColor" d="M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z"></path>
|
|
1680
|
+
</symbol>
|
|
1681
|
+
<symbol id="diffs-editor-icon-arrow-up" viewBox="0 0 16 16">
|
|
1682
|
+
<path fill="currentColor" transform="rotate(-90 8 8)" d="M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z"></path>
|
|
1683
|
+
</symbol>
|
|
1684
|
+
<symbol id="diffs-editor-icon-arrow-down" viewBox="0 0 16 16">
|
|
1685
|
+
<path fill="currentColor" transform="rotate(90 8 8)" d="M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L10.4393 7.25H3.75C3.33579 7.25 3 7.58579 3 8C3 8.41421 3.33579 8.75 3.75 8.75H10.4393L8.46967 10.7197C8.17678 11.0126 8.17678 11.4874 8.46967 11.7803C8.76256 12.0732 9.23744 12.0732 9.53033 11.7803L12.7803 8.53033C13.0732 8.23744 13.0732 7.76256 12.7803 7.46967L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z"></path>
|
|
1686
|
+
</symbol>
|
|
1687
|
+
<symbol id="diffs-editor-icon-case" viewBox="0 0 16 16">
|
|
1688
|
+
<path fill="currentColor" d="M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z"></path>
|
|
1689
|
+
<path fill="currentColor" d="M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z"></path>
|
|
1690
|
+
</symbol>
|
|
1691
|
+
<symbol id="diffs-editor-icon-whole-word" viewBox="0 0 16 16">
|
|
1692
|
+
<path fill="currentColor" d="M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z"></path>
|
|
1693
|
+
<path fill="currentColor" d="M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z"></path>
|
|
1694
|
+
<path fill="currentColor" d="M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z"></path>
|
|
1695
|
+
</symbol>
|
|
1696
|
+
<symbol id="diffs-editor-icon-regex" viewBox="0 0 16 16">
|
|
1697
|
+
<path fill="currentColor" d="M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z"></path>
|
|
1698
|
+
<path fill="currentColor" d="M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z"></path>
|
|
1699
|
+
</symbol>
|
|
1700
|
+
<symbol id="diffs-editor-icon-quick" viewBox="0 0 20 20">
|
|
1701
|
+
<polygon points="11 3 9 9 16 9 9 17 11 11 4 11 11 3" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></polygon>
|
|
1702
|
+
</symbol>
|
|
1703
|
+
<symbol id="diffs-editor-icon-replace" viewBox="0 0 20 20">
|
|
1704
|
+
<path d="m3,11h11c1.657,0,3-1.343,3-3v-3" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
1705
|
+
<polyline points="7 7 3 11 7 15" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></polyline>
|
|
1706
|
+
</symbol>
|
|
1707
|
+
<symbol id="diffs-editor-icon-replace-all" viewBox="0 0 20 20">
|
|
1708
|
+
<path d="m16,6H6c-1.657,0-3,1.343-3,3v1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
1709
|
+
<polyline points="13.25 8.75 16 6 13.25 3.25" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></polyline>
|
|
1710
|
+
<path d="m4,14h10c1.657,0,3-1.343,3-3v-1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
1711
|
+
<polyline points="6.75 11.25 4 14 6.75 16.75" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></polyline>
|
|
1712
|
+
</symbol>
|
|
1713
|
+
</svg>`,Ad=()=>{let e=document.createElement(`div`);e.innerHTML=kd;let t=e.firstElementChild;if(t===null||!(t instanceof SVGSVGElement))throw Error(`Failed to create sprite element`);return t},jd=(e,t=16)=>`<svg width="${t}" height="${t}" aria-hidden="true" focusable="false">
|
|
1714
|
+
<use href="#diffs-editor-icon-${e}"></use>
|
|
1715
|
+
</svg>`,Md=class{#e;#t;#n;#r;constructor(e){let{textDocument:t,containerElement:n,defaultQuery:r,mode:i=`find`,initialMatch:a,scrollToMatch:o,applyReplace:s,onUpdate:c,onClose:l}=e,u={text:r,replaceText:``,caseSensitive:!1,wholeWord:!1,regex:!1},d={all:[],current:void 0},f=Q(`div`,{dataset:{matches:``,noMatches:``},textContent:`No results`}),p=e=>{if(d.all=u.text===``?[]:t.search(u),this.#e.querySelectorAll(`[data-icon][data-disabled]`).forEach(e=>{e.dataset.disabled=String(d.all.length===0)}),u.text===``){f.textContent=`No results`,f.dataset.noMatches=``;return}if(d.all.length===0){f.textContent=`No results`,f.dataset.noMatches=``,d.current=void 0,c([]);return}if(delete f.dataset.noMatches,e?.syncSelection===!1){m(c(d.all,{syncSelection:!1}));return}m(c(d.all))};this.#n=p;let m=e=>{if(e===void 0)f.textContent=`${d.all.length} results`;else{let[t,n]=e;f.textContent=`${d.all.findIndex(e=>e[0]===t&&e[1]===n)+1} of ${d.all.length}`}d.current=e},h=(e,t)=>{u[e]=t,p()},g=(e=!1,t=!1)=>{let n=d.all,r=n[0];if(n.length>0)if(e){let e=d.current?.[0]??0;r=n.at(-1);for(let t of n)if(t[1]<=e)r=t;else break}else{let e=d.current?.[1]??0;for(let t of n)if(t[0]>=e){r=t;break}}r!==void 0&&(m(r),o(r,t)),d.current=r},_=(e,n)=>({start:e,end:n,text:au(e=>t.positionAt(e),e=>t.offsetAt(e),e=>t.getLineText(e),u,e,n)}),v=()=>{if(u.text===``||d.all.length===0)return;let e=d.current;if(e===void 0&&(g(!1,!0),e=d.current,e===void 0))return;let[t,n]=e,r=_(t,n);s([r]),o([t+r.text.length,t+r.text.length],!0),d.current=void 0,p()},y=()=>{u.text===``||d.all.length===0||(s(d.all.map(([e,t])=>_(e,t))),d.current=void 0,p())},b=()=>{this.cleanup(),l()},x=(e,t,n)=>{let r=Q(`div`,{dataset:{icon:e,active:String(u[n])},title:t,innerHTML:jd(e),onclick:()=>{let e=!u[n];r.dataset.active=String(e),h(n,e)}});return r},S=x(`case`,`Match Case`,`caseSensitive`),C=x(`whole-word`,`Whole Word`,`wholeWord`),ee=x(`regex`,`Regexp`,`regex`),w=Q(`input`,{type:`text`,placeholder:`Replace`,dataset:`replace`,value:``,oninput:e=>{u.replaceText=e.target.value}});this.#t=Q(`input`,{type:`text`,placeholder:`Search`,dataset:`search`,value:r,oninput:e=>{u.text=e.target.value,d.current=void 0,p()},onkeydown:e=>{e.key===`Escape`?(e.preventDefault(),b()):e.key===`Enter`?(e.preventDefault(),g(!1,!0)):hu(e)&&(e.key===`f`||e.code===`KeyF`)&&(e.preventDefault(),k(e.altKey?`replace`:`find`))}});let T=Q(`div`,{dataset:`searchToggles`,children:[S,C,ee]}),E=Q(`div`,{dataset:{inputBox:``,find:``},children:[this.#t,T]}),te=Q(`div`,{dataset:{inputBox:``,replace:``,replaceCell:``},children:[w]}),ne=Q(`div`,{dataset:{replaceActions:``,replaceCell:``},children:[Q(`div`,{dataset:{icon:`replace`},title:`Replace`,innerHTML:jd(`replace`),onclick:()=>{v()}}),Q(`div`,{dataset:{icon:`replace-all`},title:`Replace All`,innerHTML:jd(`replace-all`),onclick:()=>{y()}})]}),D=Q(`div`,{dataset:`searchNav`,children:[Q(`div`,{dataset:{icon:`arrow-up`,disabled:`true`},title:`Previous`,innerHTML:jd(`arrow-up`),onclick:()=>{g(!0)}}),Q(`div`,{dataset:{icon:`arrow-down`,disabled:`true`},title:`Next`,innerHTML:jd(`arrow-down`),onclick:()=>{g()}}),Q(`div`,{dataset:{icon:`close`},title:`Close`,innerHTML:jd(`close`),onclick:b})]}),O=Q(`div`,{dataset:{searchGrid:``,mode:i},children:[E,f,D,te,ne]}),k=e=>{O.dataset.mode=e,this.#t.focus(),this.#t.select()};this.#r=k,this.#e=Q(`div`,{dataset:`searchPanel`,children:[Q(`div`,{dataset:`editorWidget`,children:[O]})]}),d.current=a,n.before(this.#e),requestAnimationFrame(()=>{a===void 0?c([]):p(),this.#t.select()})}focus(){this.#t.focus()}updateMatches(e){this.#n?.(e)}setMode(e){this.#r?.(e)}cleanup(){this.#e.remove()}},Nd=class{static renderIcon(e,t,n,r){return Q(`div`,{dataset:{selectionActionIcon:``,visible:`false`},title:`Selection Action`,style:{transform:`translateY(${t}px) translateX(${e}px)`},innerHTML:jd(`quick`),onclick:r},n)}#e;#t;#n;#r;#i;constructor(e,t,n,r=0,i){this.line=e;let a=`selection-action-`+e;this.#n=Q(`div`,{dataset:`selectionActionSlot`,slot:a,style:`white-space: normal`,children:[t]},n),this.#e=Q(`div`,{dataset:{gutterBuffer:`selectionAction`,bufferSize:`1`},style:`grid-row: span 1`}),this.#t=Q(`div`,{dataset:{selectionAction:String(e)},style:{paddingInlineStart:r+1+`ch`},contentEditable:`false`,children:[Q(`slot`,{name:a})]}),this.#r=new ResizeObserver(i),this.#r.observe(this.#n),this.#i=i}render(e){let t=e.previousElementSibling,n=this.line+1,r=t?.querySelector(`[data-column-number="${n}"]`),i=e.querySelector(`[data-line="${n}"]`);t!=null&&r!=null&&i!=null&&(r.after(this.#e),i.after(this.#t),t.style.gridRow=`span `+t.children.length,e.style.gridRow=`span `+e.children.length,this.#i())}cleanup(){let e=this.#e.parentElement,t=this.#t.parentElement;this.#e.remove(),this.#t.remove(),e!=null&&t!=null&&(e.style.gridRow=`span `+e.children.length,t.style.gridRow=`span `+t.children.length),this.#i(),this.#n.remove(),this.#r.disconnect()}},Pd=class{#e;#t;#n;ch=-1;tabSize=2;lineHeight=20;paddingTop=0;init(e){if(this.#e===e&&this.#t!==void 0&&this.ch!==-1)return;if(this.#e=e,this.#t??=document.createElement(`canvas`).getContext(`2d`)??void 0,this.#t===void 0)throw Error(`Could not get canvas context`);let t=e.parentElement;if(t!==null){let{paddingTop:e}=getComputedStyle(t);e.endsWith(`px`)&&(this.paddingTop=parseFloat(e.slice(0,-2)))}let{fontSize:n,fontFamily:r,tabSize:i,lineHeight:a}=getComputedStyle(e);a.endsWith(`px`)?this.lineHeight=parseFloat(a.slice(0,-2)):n.endsWith(`px`)&&(this.lineHeight=Tu(parseFloat(n.slice(0,-2))*parseFloat(a)));let o=n+` `+r;(this.#n!==o||this.ch===-1)&&(this.#n=o,this.#t.font=o,this.ch=this.canvasMeasureTextWidth(`0`)),this.tabSize=parseInt(i,10)}measureTextWidth(e){let t=e.replaceAll(` `,` `.repeat(this.tabSize));return Fd(t)?this.domMeasureTextWidth(t):this.canvasMeasureTextWidth(t)}canvasMeasureTextWidth(e){if(this.#t===void 0)throw Error(`Metrics not initialized`);return Tu(this.#t.measureText(e).width)}domMeasureTextWidth(e){if(this.#e===void 0)throw Error(`Metrics not initialized`);let t=Q(`span`,{style:{position:`absolute`,top:`0`,left:`0`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,font:`inherit`},textContent:e},this.#e);try{return t.getBoundingClientRect().width}finally{t.remove()}}};function Fd(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=57343||n===8205||n===65038||n===65039)return!0}return!1}function Id(e,t){let n=Math.max(0,Math.min(t,e.length));if(n===0||n===e.length||!Fd(e))return n;let r=new Intl.Segmenter(void 0,{granularity:`grapheme`});for(let t of r.segment(e)){let e=t.index,r=e+t.segment.length;if(n>e&&n<r)return r;if(n<=e)break}return n}function Ld(e){if(!Fd(e))return;let t=[0],n=new Intl.Segmenter(void 0,{granularity:`grapheme`});for(let r of n.segment(e))t.push(r.index+r.segment.length);return t}function Rd(e,t){let n=0;for(let r=0;r<e.length;r++){if(e.charCodeAt(r)>127)return-1;n+=e.charCodeAt(r)===9?t:1}return n}var zd=class e{static TOKENIZE_TIME_LIMIT=500;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d=[qe];#f=-1;#p=!0;#m=!1;#h=0;#g;#_=0;#v=!1;#y=wu(async e=>{let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#a.lineCount);this.#t===void 0&&!Hd(this.#a.languageId)&&(await this.#e.loadLanguage(this.#a.languageId),this.#t=this.#e.getLanguage(this.#a.languageId)),this.#O(r)},500);#b=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,jobId:n}=e;t===`tokenize`&&typeof n==`number`&&n===this.#h&&this.#k(n)};get themeType(){return this.#r}constructor({codeOptions:e,highlighter:t,textDocument:n,setStyle:r,onDeferTokenize:i,__debug:a}){let{themeType:o=`system`,theme:s=Oe,tokenizeMaxLineLength:c=1e3}=e;if(this.#n=window.matchMedia(`(prefers-color-scheme: dark)`),o===`system`?this.#r=this.#n.matches?`dark`:`light`:this.#r=o,typeof s!=`string`){let e=new MutationObserver(e=>{for(let{type:t,attributeName:n}of e)if(t===`attributes`&&n!==null&&(n===`class`||n.startsWith(`data-`))){let e=getComputedStyle(document.body).colorScheme===`dark`?`dark`:`light`;this.#x(s[e],e);break}});e.observe(document.documentElement,{attributes:!0}),e.observe(document.body,{attributes:!0}),this.#u=[$(this.#n,`change`,e=>{let t=e.matches?`dark`:`light`;this.#x(s[t],t)}),()=>e.disconnect()]}this.#e=t,this.#a=n,this.#o=c,this.#s=r,this.#c=i,this.#l=a??!1,!Hd(n.languageId)&&t.getLoadedLanguages().includes(n.languageId)&&(this.#t=t.getLanguage(n.languageId)),this.#i=[],this.#S(typeof s==`string`?s:s[this.#r])}#x(e,t){this.#r=t,this.#S(e),this.stopBackgroundTokenize(),this.#d=[qe],this.#t!==void 0&&this.#a.lineCount>0&&this.#E(0)}#S(e){this.#i=this.#e.setTheme(e).colorMap;let{colors:t={}}=this.#e.getTheme(e),n=t[`editor.selectionBackground`],r=t[`editor.lineHighlightBackground`],i=t[`editorLineNumber.foreground`],a=t[`editorLineNumber.activeForeground`],o=t[`editorCursor.foreground`],s=t[`editor.findMatchBackground`],c=t[`editor.findMatchHighlightBackground`],l=t[`editorHint.foreground`],u=t[`editorInfo.foreground`],d=t[`editorWarning.foreground`],f=t[`editorError.foreground`];this.#s(`:host {
|
|
1716
|
+
--diffs-editor-selection-bg: ${n??`var(--diffs-line-bg)`};
|
|
1717
|
+
--diffs-editor-line-highlight-bg: ${r??`var(--diffs-line-bg)`};
|
|
1718
|
+
--diffs-editor-line-number-fg: ${i??`var(--diffs-fg-number)`};
|
|
1719
|
+
--diffs-editor-line-number-active-bg: ${r??`var(--diffs-line-bg, var(--diffs-bg))`};
|
|
1720
|
+
--diffs-editor-line-number-active-fg: ${a??`var(--diffs-selection-number-fg)`};
|
|
1721
|
+
--diffs-editor-match-bg: ${s??`unset`};
|
|
1722
|
+
--diffs-editor-match-highlight-bg: ${c??`unset`};
|
|
1723
|
+
--diffs-editor-cursor-fg: ${o??`unset`};
|
|
1724
|
+
--diffs-editor-hint-fg: ${l??`unset`};
|
|
1725
|
+
--diffs-editor-info-fg: ${u??`unset`};
|
|
1726
|
+
--diffs-editor-warning-fg: ${d??`unset`};
|
|
1727
|
+
--diffs-editor-error-fg: ${f??`unset`};
|
|
1728
|
+
}`)}cleanUp(){this.stopBackgroundTokenize(),this.#w(),this.#u?.forEach(e=>e()),this.#u=void 0}tokenize(e,t){if(this.#t===void 0&&!Hd(this.#a.languageId))throw Error(`Grammar not loaded`);let{lineCount:n}=this.#a,{startingLine:r=0,totalLines:i=1/0}=t??{},a=i===1/0?n:Math.min(r+i,n),o=e.startLine,s=Math.max(r,o),c=t!==void 0&&i!==1/0&&e.lineDelta>0&&o<a&&e.endLine>=a,l=e.lineDelta===0,u=l||t===void 0||o>=s,d=l?e.changedLineRanges??[[o,e.endLine]]:[[o,e.endLine]],f=-1;if(o<s)for(let[e,t]of d)e<s&&(f=Math.max(f,Math.min(t,s-1)));let p=f>=o&&(l||e.lineDelta<0);l?this.#O(o):(this.#d.length=Math.min(this.#d.length,o+1),(t===void 0||o>=s)&&this.#O(s));let m=0,h=d[m][1],g,_=0,v=l?d[m][0]:s,y=this.#d[v]??qe,b=!1,x=new Map,S=p?new Map:void 0;if(S!==void 0&&!l){let e=Math.min(f+1,s,a);if(e>o){this.#O(e);let t=o,n=this.#d[t]??qe;for(;t<e;t++){let e=this.#D(t,n);n=e.state,S.set(t,e.resolvedTokens)}u&&(this.#d[e]=n)}}for(;v<a;){let e=l?this.#d[v+1]:void 0;u&&(this.#d[v]=y);let{resolvedTokens:t,state:n}=this.#D(v,y);if(y=n,v>=s?x.set(v,t):S?.set(v,t),u&&(this.#d[v+1]=y),b=v>=h&&l&&e!==void 0&&y.equals(e),b){m++;let e=d[m];if(e===void 0)break;if(e[0]>=a){g=e[0],_=m;break}this.#d[e[0]]===void 0?(h=e[1],v++):(v=e[0],y=this.#d[v]??y,h=e[1]),b=!1;continue}v++}if(u&&(v<a?this.#d[v+1]=y:this.#d[v]=y),S!==void 0&&S.size>0&&this.#c(S,this.#r),g!==void 0)this.#E(g,d,_);else if(!b&&v<n){let e=c&&o>=s?a:o<s&&!l?o:v;this.#E(e,l?d:void 0,m)}return x}prebuildStateStack(e){this.#y(e)}stopBackgroundTokenize(){this.#p||(this.#p=!0,this.#m=!1,this.#f=-1,this.#g=void 0,this.#_=0,this.#w())}pauseBackgroundTokenize(){this.#p||this.#m||(this.#l&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#h}),this.#m=!0)}resumeBackgroundTokenize(){this.#p||!this.#m||this.#t===void 0||this.#f<0||(this.#l&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#h}),this.#m=!1,this.#T(this.#h))}#C(){this.#v||=(globalThis.addEventListener(`message`,this.#b),!0)}#w(){this.#v&&=(globalThis.removeEventListener(`message`,this.#b),!1)}#T(e){globalThis.postMessage({type:`tokenize`,jobId:e})}#E(e,t,n=0){if(Hd(this.#a.languageId))return;let r=++this.#h;this.#l&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#p=!1,this.#m=!1,this.#f=e,this.#g=t,this.#_=n,this.#C(),this.#T(r)}#D(t,n){let r=this.#a.getLineText(t);if(r.length>this.#o)return console.warn(`[diffs] Line(${t}) too long to tokenize: ${r.length}`),{resolvedTokens:[[0,``,r]],state:n};if(this.#t===void 0||r===``||r.trim()===``)return{resolvedTokens:[[0,``,r]],state:n};let i=Bd(this.#t,this.#i,r,n,e.TOKENIZE_TIME_LIMIT);return{resolvedTokens:i.resolvedTokens,state:i.ruleStack}}#O(t){let n=Math.min(Math.max(0,t),this.#a.lineCount);if(this.#d.length>n||this.#t===void 0)return;let r=this.#d.length-1,i=this.#d[r]??qe;for(;r<n;r++){this.#d[r]=i;let t=this.#a.getLineText(r);t.length<=this.#o&&t!==``&&t.trim()!==``&&(i=this.#t.tokenizeLine2(t,i,e.TOKENIZE_TIME_LIMIT).ruleStack)}this.#d[r]=i}#k(t){if(this.#p||this.#m||this.#t===void 0||t!==this.#h)return;let n=performance.now(),r=new Map,i=this.#a.lineCount,a=this.#g,o=this.#f,s=this.#d[o]??qe,c=!1,l=this.#_,u=a?.[l]?.[1];for(;o<i;){this.#d[o]=s;let t=u===void 0?void 0:this.#d[o+1],i=this.#a.getLineText(o);if(i.length>this.#o)console.warn(`[diffs] Line(${o}) too long to tokenize: ${i.length}`),r.set(o,[[0,``,i]]);else if(i===``||i.trim()===``)r.set(o,[[0,``,i]]);else{let t=Bd(this.#t,this.#i,i,s,e.TOKENIZE_TIME_LIMIT);r.set(o,t.resolvedTokens),s=t.ruleStack}if(this.#d[o+1]=s,c=u!==void 0&&o>=u&&t!==void 0&&s.equals(t),o++,c){l++;let e=a?.[l];if(e===void 0)break;if(u=e[1],this.#d[e[0]]===void 0)c=!1;else{o=e[0],s=this.#d[o]??s,c=!1;continue}}if(performance.now()-n>1)break}if(this.#c(r,this.#r),!(this.#p||this.#m||t!==this.#h)){if(c||o>=i){this.stopBackgroundTokenize();return}this.#f=o,this.#_=l,this.#T(t)}}};function Bd(e,t,n,r,i){let a=e.tokenizeLine2(n,r,i);a.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);let o=a.tokens,s=o.length/2,c=[];for(let e=0;e<s;e++){let r=o[2*e],i=e+1<s?o[2*e+2]:n.length;if(r===i)continue;let a=o[2*e+1],l=t[ue.getForeground(a)],u=n.slice(r,i);c.push([r,l,u])}return{ruleStack:a.ruleStack,resolvedTokens:c}}function Vd(e,t){return e.map(([e,n,r])=>e===0&&n===``?r===``?Q(`br`):r:Q(`span`,{dataset:{char:e.toString()},style:`--diffs-token-${t}:${n};`,textContent:r}))}function Hd(e){return e===`text`||e===`ansi`}var Ud=class{#e;#t=!1;#n=new Pd;#r;#i;#a;#o;#s;#c;#l;#u=new Map;#d=new Map;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;#M;#N=!1;#P=!1;#F=!1;#I=!1;#L;#R;#z;#B;#V;#H;#U;#W=!1;#G=!1;#K=(e,t)=>{if(this.#T?.updateRenderCache(e,t),this.#k!==void 0&&this.#k.totalLines!==1/0){let{startingLine:n,totalLines:r}=this.#k,i=Math.min(n+r,this.#O?.lineCount??0);for(let[r,a]of e)if(r>=n&&r<i){let e=this.#Te(r);e!==void 0&&e.replaceChildren(...Vd(a,t))}}};constructor(e={}){this.#e=e}edit(e){let{useTokenTransformer:t,expandUnchanged:n,diffStyle:r,...i}=e.options,a=e.type===`file-diff`;return(t!==!0||n!==!0&&a||r===`unified`&&a)&&(e.setOptions({...i,useTokenTransformer:!0,expandUnchanged:!0,diffStyle:`split`}),e.rerender()),this.#T=e,this.#Y(),this.#s=e.attachEditor(this),()=>this.cleanUp()}applyEdits(e,t=!1){let n=this.#O;if(n==null)throw Error(`Editor is not attached`);let r=n.applyEdits(e,t,this.#B);r!==void 0&&this.#Ce(r,void 0,this.#we(r))}getState(){let e=this.#Se();if(e===void 0)throw Error(`Editor is not attached`);return{file:{...e,cacheKey:`edited-at-`+Date.now()},selections:this.#B,lineAnnotations:this.#D,renderRange:this.#k}}setState({file:e,lineAnnotations:t,renderRange:n,selections:r}){this.#q(),this.#J(),this.#z=r,this.#T?.render({file:{...e,cacheKey:`edited-at-`+Date.now()},lineAnnotations:t,renderRange:n})}setSelections(e){let t=this.#O;if(t===void 0)throw Error(`Text document is not initialized`);let n=e.map(e=>{let n=t.normalizePosition(e.start),r=t.normalizePosition(e.end);return{direction:e.direction===`none`?0:e.direction===`backward`?-1:1,start:n,end:r}});this.#oe(n),this.#re(!1,`center`)}setMarkers(e){let t=this.#O;if(t===void 0)throw Error(`Text document is not initialized`);if(e.length===0){this.#A?.cleanup(),this.#A=void 0,this.#oe(this.#B??[]);return}this.#A??=new Dd({getLineHeight:()=>this.#n.lineHeight,getFileContainer:()=>this.#v,getCharX:(e,t)=>this.#ke(e,t),getLineY:e=>this.#Oe(e),isMouseDown:()=>this.#F||this.#P}),this.#A.setMarkers(e,t),this.#b!==void 0&&this.#A.listenHover(this.#b),this.#oe(this.#B??[])}focus(e){let t=e?.preventScroll??!1,n=this.#B?.at(-1);if(n!==void 0){let e=n.direction===-1?n.end:n.start;this.#te(e,t)}else this.#te(void 0,t)}blur(){this.#b?.blur()}cleanUp(){this.#r?.cleanUp(),this.#r=void 0,this.#a?.forEach(e=>e()),this.#a=void 0,this.#i?.forEach(e=>e()),this.#i=void 0,this.#o?.forEach(e=>e()),this.#o=void 0,this.#s?.(),this.#s=void 0,this.#c=void 0,this.#l=void 0,this.#u.clear(),this.#d.clear(),this.#f=void 0,this.#p=void 0,this.#m?.remove(),this.#m=void 0,this.#h?.remove(),this.#h=void 0,this.#g?.remove(),this.#g=void 0,this.#_?.remove(),this.#_=void 0,this.#v=void 0,this.#y=void 0,this.#b?.removeAttribute(`contentEditable`),this.#b=void 0,this.#x?.remove(),this.#x=void 0,this.#w?.disconnect(),this.#w=void 0,this.#J()}__postponeBackgroundTokenizeToNextFrame(){let e=this.#r;e!==void 0&&(e.pauseBackgroundTokenize(),requestAnimationFrame(()=>{e.resumeBackgroundTokenize()}))}__syncRenderView=(e,t,n,r,i)=>{let a=t.shadowRoot;if(a==null){console.error(`[editor] Could not find the shadow root.`);return}let o,s,c;for(let e of a.querySelectorAll(`[data-code]`))if(e.dataset.deletions===void 0){o=e;for(let t of e.children){let e=t,{gutter:n,content:r}=e.dataset;n===void 0?r!==void 0&&(c=e):s=e}break}if(!(o===void 0||c===void 0)){if(this.#v!==t&&(this.#v=t,this.#m!==void 0&&t.appendChild(this.#m),this.#h!==void 0&&a.appendChild(this.#h),this.#g!==void 0&&a.appendChild(this.#g),this.#_!==void 0&&a.prepend(this.#_)),this.#O===void 0||this.#E===void 0||this.#E.name!==n.name||this.#E.contents!==n.contents||this.#E.lang!==n.lang||this.#E.cacheKey!==n.cacheKey){let t=new Pl({maxEntries:this.#e.historyMaxEntries}),r=new su(n.name,n.contents,n.lang??j(n.name),0,t);this.#E=n,this.#O=r,this.#r?.cleanUp(),this.#r=new zd({highlighter:e,textDocument:r,codeOptions:this.#T?.options??{},onDeferTokenize:this.#K,setStyle:e=>{this.#g.textContent=e},__debug:this.#e.__debug}),this.#J(),this.#B=this.#z,this.#e.onAttach?.(this,this.#T),this.#O!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] text document changed !!!`)}if(this.#b!==c&&(this.#y=s,this.#b=Cu(c,{contentEditable:`true`,role:`textbox`,ariaMultiLine:`true`,autocapitalize:`off`,writingSuggestions:`off`,autocorrect:!1,spellcheck:!1,translate:!1}),this.#x!==void 0&&c.after(this.#x),this.#n.init(c),this.#X(c,s),this.#b!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] full re-render triggered !!!`)),this.#q(),this.#t=this.#T?.options.overflow===`wrap`,this.#D=r,this.#k=i,this.#r?.prebuildStateStack(i),(this.#B!==void 0||this.#V!==void 0||this.#A!==void 0)&&this.#oe(this.#B??[]),this.#z!==void 0&&this.#C!==void 0?(this.#z=void 0,this.#re(!1,`center`)):this.#H===void 0?this.#B!==void 0&&this.#B.length>0&&!this.#G&&this.focus({preventScroll:!0}):this.#ae(this.#H,this.#U,this.#W),this.#G&&this.#j?.focus(),this.#M!==void 0&&this.#Me(this.#M.line)&&this.#b!==void 0&&this.#M.render(this.#b),this.#e.__debug===!0&&i!==void 0){let{startingLine:e,totalLines:t}=i;console.log(`[diffs/editor] render file:`,n.name,`RenderRange:`,e+`-`+(e+t),`of`,this.#O.lineCount,`lines`)}}};#q(){this.#u.clear(),this.#d.clear(),this.#f=void 0,this.#p=void 0}#J(){this.#c=void 0,this.#l=void 0,this.#T?.setSelectedLines(null),this.#N=!1,this.#S?.forEach(e=>e.remove()),this.#S=void 0,this.#B=void 0,this.#R=void 0,this.#H=void 0,this.#A?.cleanup(),this.#A=void 0,this.#j?.cleanup(),this.#j=void 0,this.#M?.cleanup(),this.#M=void 0}#Y(){this.#m=Q(`style`,{dataset:`editorGlobalCss`,textContent:`
|
|
1729
|
+
[data-annotation-slot] {
|
|
1730
|
+
user-select: none;
|
|
1731
|
+
-webkit-user-select: none;
|
|
1732
|
+
}
|
|
1733
|
+
`}),this.#h=Q(`style`,{dataset:`editorCss`,textContent:bu}),this.#g=Q(`style`,{dataset:`editorThemeCss`}),this.#_=Ad(),this.#x=Q(`div`,{dataset:`editorOverlay`}),this.#a=[$(document,`selectionchange`,()=>{let e=this.#v?.shadowRoot;if(this.#N||e==null||this.#B!==void 0&&this.#B.length>1&&!this.#F)return;let t=document.getSelection()?.getComposedRanges({shadowRoots:[e]})?.[0];if(t===void 0||!this.#je(t))return;let n=Nu(t,0);if(n!==void 0){if(this.#F&&this.#I&&this.#B!==void 0&&this.#B.length>0){let e=this.#B.at(-1);this.#oe([Xu(e,n)]);return}this.#F?this.#L===void 0?this.#L=n:n=Yu(this.#L,n):this.#L!==void 0&&(n.direction=Yu(this.#L,n).direction),this.#R===void 0?this.#oe([n]):this.#oe([...this.#R.filter(e=>!Ku(e,n)),n])}},{passive:!0}),$(document,`pointerup`,e=>{e.pointerType===`mouse`&&(this.#o?.forEach(e=>e()),this.#o=void 0,this.#P&&(this.#P=!1,this.#te()),this.#N=!1,this.#F=!1,this.#I=!1,this.#L=void 0,this.#R=void 0,this.#S?.forEach((e,t)=>{t.startsWith(`selectionActionIcon-`)&&(e.dataset.visible=`true`)}))},{passive:!0}),$(document,`keydown`,e=>{e.key===`Shift`&&(this.#L=this.#B?.at(-1))},{passive:!0}),$(document,`keyup`,e=>{e.key===`Shift`&&(this.#L=void 0)},{passive:!0})]}#X(e,t){let n=t=>{let n=t.composedPath()[0];return n!==void 0&&(n===e||e.contains(n))};if(this.#i?.forEach(e=>e()),this.#i=[$(e,`pointerdown`,t=>{if(t.pointerType===`mouse`&&(this.#A?.removePopup(),mu()&&this.#D!==void 0&&this.#D.length>0&&(this.#o=[...e.querySelectorAll(`[data-line-annotation]`)].map(e=>[$(e,`mouseenter`,()=>{this.#N=!0}),$(e,`mouseleave`,()=>{this.#N=!1})]).flat()),this.#F=!0,this.#L=void 0,t.button===0&&hu(t)&&(this.#R=this.#B?.map(e=>({...e}))),t.shiftKey)){let e=this.#B?.at(-1);if(e!==void 0){let t=e.direction===-1?e.end:e.start;this.#ne({start:t,end:t,direction:0})}this.#I=!0}},{passive:!0}),$(e,`keydown`,e=>{if(e.key===`Escape`){if(e.preventDefault(),this.#j?.cleanup(),this.#j=void 0,this.#G=!1,this.#M?.cleanup(),this.#M=void 0,this.#B!==void 0&&this.#B.length>0){let e=this.#B.at(-1);if(!Uu(e)||this.#B.length>1){let t=Wu(e);this.#oe([{start:t,end:t,direction:0}]),this.#te(t)}}return}if(!n(e))return;let t=gu(e),r=this.#O;if(this.#B!==void 0&&this.#B.length>0&&t!==void 0&&r!==void 0){e.shiftKey?this.#oe(Iu(r,this.#B,t)):this.#oe(Fu(r,this.#B,t)),this.#re(),e.preventDefault();return}let i=yu(e);i!==void 0&&(e.preventDefault(),this.#Z(i))}),$(e,`copy`,e=>{n(e)&&(e.preventDefault(),e.clipboardData?.setData(`text`,this.#me()))}),$(e,`cut`,e=>{n(e)&&(e.preventDefault(),e.clipboardData?.setData(`text`,this.#me()),this.#he(``))}),$(e,`paste`,e=>{if(!n(e))return;e.preventDefault();let t=e.clipboardData?.getData(`text`);t!==void 0&&this.#he(t)}),$(e,`beforeinput`,e=>{n(e)&&(e.preventDefault(),this.#ee(e.inputType,e.data))}),$(e,`drop`,e=>{n(e)&&e.preventDefault()}),$(e,`compositionstart`,e=>{n(e)&&(this.#N=!0)},{passive:!0}),$(e,`compositionend`,e=>{n(e)&&(this.#N=!1,this.#ee(`insertText`,e.data))},{passive:!0})],t!==void 0){let e=(e,t=!1)=>{let n=e;return n?.dataset.lineNumberContent===void 0?t&&n?.tagName===`SPAN`&&(n=n.closest(`[data-line]`)):n=n.parentElement??void 0,n},n=e=>{if(e===void 0)return;let t=e.dataset.lineType,n=xu(e)??xu(e,`columnNumber`);if(!(n===void 0||t===void 0||!Gu(t)))return n-1};this.#i.push($(t,`pointerdown`,t=>{if(this.#T?.options.enableLineSelection===!0)return;let r=this.#O,i=n(e(t.composedPath()[0]));if(i===void 0||r===void 0)return;this.#A?.removePopup();let a={start:{line:i,character:0},end:{line:i,character:r.getLineText(i).length},direction:1};this.#P=!0,this.#L=a,this.#oe([a]),this.#te(a.end),this.#o=[$(document,`mousemove`,t=>{if(!this.#P)return;let r=this.#O,i=n(e(t.composedPath()[0],!0));if(i===void 0||r===void 0)return;let a={start:{line:i,character:0},end:{line:i,character:r.getLineText(i).length},direction:1};this.#L===void 0?this.#L=a:a=Yu(this.#L,a),this.#oe([a]),this.#te(a.end)},{passive:!0})]},{passive:!0}))}this.#A?.listenHover(e),this.#w?.disconnect(),this.#w=new ResizeObserver(()=>{this.#Q()}),this.#w.observe(e),this.#w.observe(e.parentElement)}#Z(e){let t=this.#O;if(t!==void 0)switch(e){case`openSearchPanel`:this.#fe(`find`);break;case`openSearchReplacePanel`:this.#fe(`replace`);break;case`findNextMatch`:{let e=this.#B;if(e===void 0)break;if(e.some(Uu)){let n=e.map(e=>Uu(e)?id(t,e):e);this.#oe(n),this.focus()}else{let n=$u(t,e);n!==void 0&&(this.#oe(n),this.#re())}break}case`indent`:case`outdent`:if(this.#B!==void 0){let n=[],r=[];for(let i of this.#B){let a=i.start.line,o=e===`outdent`;if(a!==i.end.line||o){let e=Pu(t,i,this.#n.tabSize,o);n.push(...e[0]),r.push(e[1])}else{let e=t.charAt({line:a,character:0});this.#he(e===` `?` `:` `.repeat(this.#n.tabSize))}}let i=t.applyEdits(n,!0,this.#B,r);i!==void 0&&this.#Ce(i,r)}break;case`selectAll`:this.#oe([ed(t)]),this.focus();break;case`moveCursorToDocStart`:case`moveCursorToDocEnd`:{let n=e===`moveCursorToDocEnd`;this.#oe([td(t,n)]),this.#re()}break;case`expandSelectionDocStart`:case`expandSelectionDocEnd`:{let n=e===`expandSelectionDocEnd`,r=this.#B;r!==void 0&&(this.#oe(Zu(r,td(t,n))),this.#re())}break;case`undo`:if(this.#O?.canUndo===!0){let e=this.#O.undo();e!==void 0&&this.#Ce(...e)}break;case`redo`:if(this.#O?.canRedo===!0){let e=this.#O.redo();e!==void 0&&this.#Ce(...e)}break}}#Q(){let e=this.#D?.length??0,t=this.#c,n=this.#l;this.#c=void 0,this.#l=void 0;let r=this.#Ee()!==t,i=this.#De()!==n;!r&&!i||(this.#f=void 0,this.#p=void 0,i&&(this.#t||e>0)&&(this.#u.clear(),this.#d.clear()),(this.#B!==void 0||this.#V!==void 0||this.#A!==void 0)&&(this.#oe(this.#B??[]),this.#B!==void 0&&this.focus()),this.#A?.removePopup())}#$(e,t,n=this.#k,r){let i=this.#r,a=this.#T,o=this.#E,s=this.#O,c=this.#y,l=this.#b;if(i===void 0||a===void 0||o===void 0||s===void 0||l===void 0)return;i.stopBackgroundTokenize();let u=performance.now(),d=i.tokenize(e,n),f=performance.now();if(d.size>0){let t=l.children,r=new Set(d.keys()),a=n?.startingLine??0;for(let n=e.startLine-a;n<t.length;n++){let e=t[n];if(e!==void 0){let t=xu(e);if(t!==void 0){let n=t-1;if(d.has(n)){let t=d.get(n);if(e.replaceChildren(...Vd(t,i.themeType)),r.delete(n),r.size===0)break}}}}if(r.size>0)for(let e of r){let t=d.get(e),n=String(e+1);Q(`div`,{dataset:{line:n,lineType:`context`,lineIndex:e.toString()},children:Vd(t,i.themeType)},l),c!==void 0&&Q(`div`,{dataset:{lineType:`context`,columnNumber:n,lineIndex:e.toString()},children:[Q(`span`,{dataset:{lineNumberContent:``},textContent:n})]},c)}}if(e.lineDelta<0)for(let t of[l.children,c?.children??[]])for(let n=t.length-1;n>=0;n--){let r=t[n],i=xu(r)??xu(r,`columnNumber`);if(i!==void 0){if(i-1<e.lineCount)break;r.remove()}}let p=Object.hasOwn(a,`fileDiff`),m=e.lineDelta!==0;if(m){let e=l.children.length;for(let t of l.children){let{bufferSize:n}=t.dataset;n!==void 0&&(e+=parseInt(n)-1)}l.style.gridRow=`span `+e,c!==void 0&&(c.style.gridRow=`span `+e)}a.updateRenderCache(d,i.themeType,p?!m:void 0),m&&a.applyDocumentChange(s,t,r),t!==void 0&&(this.#D=t,Du(t,l,c)),this.#e.__debug===!0&&console.log(`[diffs/editor] re-render in: ${Tu(performance.now()-f)}ms,`,`tokenize in: ${Tu(f-u)}ms (${d.size} dirty lines)`)}#ee(e,t){switch(e){case`insertText`:this.#he(t??``);break;case`insertParagraph`:this.#he(`
|
|
1734
|
+
`);break;case`deleteContentBackward`:this.#ge();break;case`deleteContentForward`:this.#ge(!0);break;case`deleteSoftLineBackward`:this.#_e();break;case`deleteHardLineForward`:this.#ye();break;case`deleteWordBackward`:this.#ve();break;case`insertTranspose`:this.#be();break;default:console.warn(`[diffs] Unknown input type: ${e}`,t);break}}#te(e,t=!0){e===void 0?this.#b?.focus({preventScroll:t}):(this.#N=!0,this.#ne({start:e,end:e,direction:0}),requestAnimationFrame(()=>{this.#b?.focus({preventScroll:t}),requestAnimationFrame(()=>{this.#N=!1})}))}#ne(e){let t=window.getSelection();if(t===null)return;let{start:n,end:r,direction:i}=e;qu(n,r)>0&&([n,r]=[r,n]);let a=this.#Te(n.line),o=this.#Te(r.line);if(a===void 0||o===void 0)return;let[s,c]=rd(a,n.character),[l,u]=rd(o,r.character);i===-1&&([s,c,l,u]=[l,u,s,c]);try{t.setBaseAndExtent(s,Su(s,c),l,Su(l,u))}catch(e){console.error(`[diffs/editor] failed to update window selection:`,e)}}#re(e=!1,t=`nearest`){let n=this.#B?.at(-1);if(n===void 0)return;let r=this.#C;if(r!==void 0)r.scrollIntoView({block:t,inline:`nearest`}),e||this.#te(n.direction===-1?n.end:n.start);else{let t=Wu(n);this.#ae(t.line,t.character,e)}}#ie(){let e=this.#T?.top??0,t=this.#j===void 0?0:48,n=this.#Ee()+this.#n.ch,r=this.#n.ch;return`${e+t}px ${r}px 0 ${n}px`}#ae(e,t=0,n=!1){this.__postponeBackgroundTokenizeToNextFrame();let r=Q(`div`,{style:{position:`absolute`,left:`0`,width:`2px`,height:this.#n.lineHeight+`px`,scrollMargin:this.#ie()}});if(this.#Te(e)!==void 0){let[i,a]=this.#ke(e,t),o=this.#Oe(e)+a*this.#n.lineHeight;r.style.top=o+`px`,r.style.left=i+`px`,this.#x?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),n||this.#te({line:e,character:t}),this.#H=void 0,this.#U=void 0,this.#W=!1}else{let i=0;if(this.#H===e&&this.#b!==void 0)for(let t=this.#b.childElementCount-1;t>=0;t--){let n=this.#b.children[t],r=n.dataset.lineType,a=xu(n);if(r!==void 0&&Gu(r)&&a!==void 0){i=(e-a)*this.#n.lineHeight;break}}let a=((this.#D??[]).filter(t=>t.lineNumber<e).length+e)*this.#n.lineHeight+i;r.style.top=a+`px`,this.#v?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),this.#H===e&&i===0?(this.#H=void 0,this.#U=void 0,this.#W=!1):(this.#H=e,this.#U=t,this.#W=n)}r.remove()}#oe(e){if(this.__postponeBackgroundTokenizeToNextFrame(),this.#C=void 0,this.#T?.setSelectedLines(null),this.#y?.querySelectorAll(`[data-active]`).forEach(e=>e.removeAttribute(`data-active`)),e.length===0&&this.#V===void 0&&this.#A===void 0){this.#B=void 0,this.#S?.forEach(e=>e.remove()),this.#S?.clear();return}let t=document.createDocumentFragment(),n={fragment:t,elements:new Map};if(e.length>0){let t=Qu(e),r=t.at(-1);if(this.#B=t,Uu(r)){let e=r.start.line+1;this.#T?.setSelectedLines({start:e,end:e})}else if(this.#y!==void 0){let e=Wu(r);this.#y.querySelector(`[data-column-number="${e.line+1}"]`)?.setAttribute(`data-active`,``)}for(let e of t)Uu(e)||this.#se(n,`selection`,e),this.#ue(n,e,e===r);this.#e.enabledSelectionAction===!0&&!Uu(r)&&this.#de(n,r)}let r=this.#O;if(this.#V!==void 0&&r!==void 0){let e=this.#B?.at(-1),t=e===void 0?-1:r.offsetAt(e.start),i=e===void 0?-1:r.offsetAt(e.end);for(let[e,a]of this.#V){let o={start:r.positionAt(e),end:r.positionAt(a)},s=t===e&&i===a;this.#se(n,`match`,o,s?`focus`:void 0)}}if(this.#A!==void 0&&r!==void 0)for(let e of this.#A.markers)this.#se(n,`marker`,e,Od(e.severity));this.#x?.appendChild(t),this.#S?.forEach(e=>e.remove()),this.#S?.clear(),this.#S=n.elements}#se(e,t,n,r){if(this.#O===void 0)return;let{start:i,end:a}=n;for(let n=i.line;n<=a.line;n++){if(!this.#Me(n))continue;let o=n===a.line,s=this.#O.getLineText(n),c=n===i.line?i.character:0,l=o?a.character:s.length;if(this.#t){let i=this.#De();if(2*this.#n.ch+this.#n.measureTextWidth(s)>i){this.#ce(e,n,s,c,l,o,t,r);continue}}let u=0,d=0,f=0;u=c===0?this.#Ee()+this.#n.ch:this.#ke(n,c)[0],!o&&t===`selection`&&(f=this.#n.ch),d=c===l?f:this.#ke(n,l)[0]-u+f,this.#le(e,t,n,0,u,d,r)}}#ce(e,t,n,r,i,a,o,s){let c=this.#Ae(t),l=c.length-1,u=this.#Ee()+this.#n.ch;for(let d=0;d<l;d++){let f=c[d],p=c[d+1],m=Math.max(r,f),h=Math.min(i,p);if(m>h)continue;let g,_,v=0;if(m===0)g=u;else{let e=n.slice(f,m),t=Rd(e,this.#n.tabSize);g=u+(t===-1?this.#n.measureTextWidth(e):t*this.#n.ch)}if(!a&&d===l-1&&o===`selection`&&(v=this.#n.ch),m===h)_=v;else{let e=n.slice(m,h),t=Rd(e,this.#n.tabSize);_=t===-1?this.#n.measureTextWidth(e):t*this.#n.ch,_+=v}this.#le(e,o,t,d,g,_,s)}}#le(e,t,n,r,i,a,o){if(a===0)return;let{ch:s,lineHeight:c}=this.#n,l=this.#Oe(n)+r*c,u=`width:${a}px;transform:translateX(${i}px) translateY(${l}px);`,d=`${t}-${i}-${l}-${a}${o??``}`,f=this.#S,p=(this.#e.roundedSelection??!0)&&t===`selection`,m=(n,r,i,a)=>{let o=this.#Oe(n)+r*c,l=`width:${s}px;transform:translateX(${i}px) translateY(${o}px);`,u={selectionCorner:``,[a]:``},d=`${t}-block-${i}-${o}-1ch`,p=d+`-`+a;if(a===`rbl`){let t=d+`-rtl`,n=e.elements.get(t);n!==void 0&&(n.remove(),e.elements.delete(t),p+=`-rtl`,u.rtl=``)}let m=e.elements.get(p);m===void 0&&(f?.has(p)===!0?(m=f.get(p),f.delete(p)):m=Q(`div`,{dataset:`selectionRange`,style:{cssText:l},children:[Q(`div`,{dataset:u})]},e.fragment),e.elements.set(p,m))},h=t=>{let o=i+a,c=t.dataset,l=e.previousSelectionRange;if((l===void 0||l.line!==n||l.wrapLine!==r)&&(e.previousSelectionRange={element:t,line:n,wrapLine:r,left:i,width:a}),l===void 0||o<=l.left)[`rtl`,`rtr`,`rbl`,`rbr`].forEach(e=>{c[e]=``});else{let e=l.line,t=l.wrapLine,a=l.left,u=l.element.dataset,d=a+l.width;a>i&&m(e,t,a-s,`rbr`),delete u.rbl,delete c.rtl,delete c.rtr,o>=d&&delete u.rbr,o>d&&(m(e,t,d,`rbl`),c.rtr=``),o<d&&m(n,r,o,`rtl`),i<a&&(c.rtl=``),c.rbl=``,c.rbr=``}},g=e.elements.get(d);if(g!==void 0){p&&h(g);return}f?.has(d)===!0?(g=f.get(d),f.delete(d)):g=Q(`div`,{dataset:o?[t+`Range`,o]:t+`Range`,style:{cssText:u}},e.fragment),p&&h(g),e.elements.set(d,g)}#ue(e,t,n){let{line:r,character:i}=Wu(t);if(!this.#Me(r))return;let[a,o]=this.#ke(r,i),s=`caret-`+r+`/`+o+`:`+i;if(e.elements.has(s))return;let c=Q(`div`,{dataset:`caret`,style:{transform:`translateX(${a-1}px) translateY(${this.#Oe(r)+o*this.#n.lineHeight}px)`}},e.fragment);e.elements.set(s,c),n&&(c.style.scrollMargin=this.#ie(),this.#C=c)}#de(e,t){let n=Wu(t).line;if(!this.#Me(n))return;let[r,i]=this.#ke(n,0),a=`selectionActionIcon-`+n+`(`+i+`)`;if(e.elements.has(a))return;let o=Nd.renderIcon(r,this.#Oe(n)+i*this.#n.lineHeight,e.fragment,()=>{let e=()=>{this.#M?.cleanup(),this.#M=void 0},n=()=>{this.#u.clear(),this.#B!==void 0&&this.#oe(this.#B)};e();let r=this.#O,i=this.#e.renderSelectionAction,a=this.#v;if(r===void 0||i===void 0||a==null)return;let o=t.end.line,s=r.getLineText(o),c=i({textDocument:r,selection:t,applyEdits:e=>this.applyEdits(e,!0),getSelectionText:()=>this.#O?.getText(t)??``,replaceSelectionText:e=>{this.#he(e,[t])},close:()=>{e(),n(),this.#re()}}),l=0;for(let e=0;e<s.length;e++){let t=s.charCodeAt(e);if(t===32)l++;else if(t===9)l+=this.#n.tabSize;else break}this.#M=new Nd(o,c,a,l,n),this.#oe([t]),this.#Me(o)&&this.#b!==void 0&&this.#M.render(this.#b)});e.elements.set(a,o)}#fe(e){if(this.#j!==void 0){this.#j.setMode(e);return}this.#pe(e)}#pe(e){this.#j?.cleanup();let t=this.#O,n=this.#v?.shadowRoot?.querySelector(`pre`),r=this.#B;if(t===void 0||n==null)return;let i=``,a;if(r!==void 0&&r.length>0){let e=r.at(-1);if(Uu(e)){e=id(t,e),this.#oe([...r.slice(0,-1),e]);let n=t.getText(e);n!==``&&!n.includes(`
|
|
1735
|
+
`)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=Ju(t,e,n);this.#oe([i]),this.#re(!0),this.#G=r};this.#j=new Md({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#B);n!==void 0&&this.#Ce(n,void 0,this.#we(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#V=void 0,this.#oe(this.#B??[]);return}if(this.#V=e,n?.syncSelection===!1){this.#oe(this.#B??[]);let n=this.#B?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#B?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#oe(this.#B??[]):o(a,!0),a},onClose:()=>{this.#j=void 0,this.#G=!1,this.#V=void 0,this.#oe(this.#B??[])}}),this.#G=!1}#me(){let e=this.#O,t=this.#B;return e===void 0||t===void 0?``:nd(e,t)}#he(e,t=this.#B){if(t===void 0)return;let n=this.#O,r=t.at(-1);if(n===void 0||r===void 0)return;let{nextSelections:i,change:a}=Array.isArray(e)&&e.length===t.length?Ru(n,t,e,this.#D):Lu(n,t,{start:n.offsetAt(r.start),end:n.offsetAt(r.end),text:Array.isArray(e)?e.join(`
|
|
1736
|
+
`):e},this.#D);a!==void 0&&this.#Ce(a,i,this.#we(a))}#ge(e=!1){let t=this.#B,n=this.#O;if(t===void 0||n===void 0)return;let r=t.at(-1);if(r===void 0)return;let i;if(Uu(r)){let t=n.offsetAt(r.start),a=e?Math.min(n.getText().length,t+1):Math.max(0,t-1);i={start:Math.min(t,a),end:Math.max(t,a),text:``}}else i={start:n.offsetAt(r.start),end:n.offsetAt(r.end),text:``};this.#xe(i)}#_e(){let e=this.#B,t=this.#O;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Vu(t,e,this.#t?(e,t)=>{let n=this.#Ae(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#D);r!==void 0&&this.#Ce(r,n,this.#we(r))}#ve(){let e=this.#B,t=this.#O;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Hu(t,e,this.#D);r!==void 0&&this.#Ce(r,n,this.#we(r))}#ye(){let e=this.#B,t=this.#O;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Bu(t,e,this.#D);r!==void 0&&this.#Ce(r,n,this.#we(r))}#be(){let e=this.#B,t=this.#O;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=zu(t,e,this.#D);r!==void 0&&this.#Ce(r,n,this.#we(r))}#xe(e){if(this.#B===void 0||this.#O===void 0)return;let{nextSelections:t,change:n}=Lu(this.#O,this.#B,e,this.#D,this.#n.tabSize);n!==void 0&&this.#Ce(n,t,this.#we(n))}#Se(){let e=this.#E,t=this.#O;if(e===void 0||t===void 0)return;let{contents:n,...r}=e;return Object.defineProperty(r,"contents",{enumerable:!0,get:()=>t.getText()}),r}#Ce(e,t,n,r){let i=this.#Se(),a=this.#e.onChange;if(i!==void 0&&a!==void 0&&a(i,n??this.#D),e.lineDelta!==0)for(let t of this.#u.keys())t>=e.startLine&&this.#u.delete(t);if(this.#t)for(let t of this.#d.keys())t>=e.startLine&&this.#d.delete(t);this.#p=void 0;let o=this.#k,s;if(o!==void 0&&t!==void 0&&t.length>0){let e=t.at(-1),n=o.startingLine+o.totalLines;e.end.line===n?o={...o,totalLines:o.totalLines+1}:e.end.line>n&&(s=!0)}if(this.#$(e,n,o,s),r?.skipSearchRefresh!==!0&&this.#j!==void 0&&this.#V!==void 0&&this.#j.updateMatches({syncSelection:!1}),t!==void 0){if(this.#oe(t),this.#C!==void 0)this.#C.scrollIntoView({block:`nearest`,inline:`nearest`});else if(t.length>0){let e=Wu(t.at(-1));this.#ae(e.line,e.character)}this.focus({preventScroll:!0})}}#we(e){if(this.#D!==void 0){let t=Eu(e,this.#D);if(t!==void 0)return this.#O?.setLastUndoLineAnnotations(this.#D,t),t}}#Te(e){let t=this.#f;if(t!==void 0&&t[0]===e)return t[1];let n=this.#b;if(n===void 0)return;let r=null;if(this.#k!==void 0){let{startingLine:t}=this.#k,{children:i}=n;for(let n=e-t;n<=i.length;n++){let t=i[n];if(t===void 0)break;let a=xu(t),o=t.dataset.lineType;if(a!==void 0&&a===e+1&&o!==void 0&&Gu(o)){r=t;break}}}if(r??=n.querySelector(`[data-line="${e+1}"]`),r!==null)return t===void 0?this.#f=[e,r]:(t[0]=e,t[1]=r),r}#Ee(){if(this.#y===void 0)return 0;if(this.#c===void 0){let e=this.#b?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#c=parseInt(e.slice(0,-2),10):this.#c=this.#y.offsetWidth}return this.#c}#De(){if(this.#b===void 0)return 0;if(this.#l===void 0){let e=this.#b.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#l=parseFloat(e.slice(0,-2)):this.#l=this.#b.offsetWidth}return this.#l}#Oe(e){let t=this.#u.get(e);if(t!==void 0)return t;let n=this.#Te(e);if(n===void 0)return-1;let r=n.offsetTop+this.#n.paddingTop;return this.#u.set(e,r),r}#ke(e,t){if(this.#p!==void 0&&this.#p[0]===e&&this.#p[1]===t)return[this.#p[2],this.#p[3]];let n=this.#O?.getLineText(e),r=this.#Ee()+this.#n.ch;if(n===void 0||n.length===0||t<=0)return[r,0];let i=Id(n,Math.min(t,n.length)),a=n.slice(0,i),o=Rd(a,this.#n.tabSize),s=0,c=0;if(s=o===-1?r+this.#n.measureTextWidth(a):r+o*this.#n.ch,this.#t){let t=this.#De();if(2*this.#n.ch+this.#n.measureTextWidth(n)>t){let t=this.#Ae(e);for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=Rd(t,this.#n.tabSize);s=o===-1?r+this.#n.measureTextWidth(t):r+o*this.#n.ch;break}}}}return this.#p===void 0?this.#p=[e,t,s,c]:(this.#p[0]=e,this.#p[1]=t,this.#p[2]=s,this.#p[3]=c),[s,c]}#Ae(e){let t=this.#d.get(e);if(t!==void 0)return t;let n=this.#O?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#d.set(e,t),t}let r=Q(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#n.tabSize.toString()},textContent:n},this.#b),i=r.firstChild,a=document.createRange(),o=[];try{let t=Ld(n),s=r.getBoundingClientRect().left+this.#n.ch,c=0,l=-1/0;for(let e=0,r=0;e<n.length;){let n=t===void 0?e+1:t[r+1];a.setStart(i,e),a.setEnd(i,n);let{left:u,top:d}=a.getBoundingClientRect();if(d>l){let t=mu()&&o.length>0&&u-s>this.#n.ch/2;o.push(t?c:e),l=d}c=e,e=n,r++}let u=new Uint32Array(o.length+1);for(let e=0;e<o.length;e++)u[e]=o[e];return u[o.length]=n.length,this.#d.set(e,u),u}finally{r.remove()}}#je({startContainer:e,endContainer:t}){let n=this.#b;return n===void 0?!1:n.contains(e)&&n.contains(t)}#Me(e){let t=this.#O?.lineCount??0;if(e<0||e>=t)return!1;if(this.#k===void 0)return!0;let{startingLine:n,totalLines:r}=this.#k;return e<n?!1:r===1/0?!0:e<n+r}},Wd=typeof window>`u`?X.useEffect:X.useLayoutEffect;function Gd(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:nt,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:rt,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function Kd(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function qd(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 Jd(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 Yd({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(null),u=(0,X.useRef)(n.getComposition()),d=(0,X.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,X.useCallback)(()=>{s(null)},[]),m=(0,X.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,X.useMemo)(()=>Jd(h,e,f,p,m),[h,p,m,f,e]),_=(0,X.useCallback)(e=>{l(e)},[]);(0,X.useEffect)(()=>{f||s(null)},[f]),Wd(()=>{n.setComposition(g)},[g,n]),Wd(()=>{if(c!=null)return r!=null&&qd(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=Kd(Gd(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,Z.jsx)(Xe,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function Xd(e){let[t]=(0,X.useState)(()=>new wl(e)),n=(0,X.useRef)({timeout:null,model:t});return(0,X.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var Zd=e=>{if(typeof e!=`object`||!e)return null;let t=e;return typeof t.getAttribute==`function`?t.getAttribute(`data-item-path`):null};function Qd(e){let t=[],n=[];return{isDragInProgress:()=>n.length>0,handleSelectionChange(e){t=e},handleDragStart(e){if(e.dataTransfer===null)return;let r=null;for(let t of e.composedPath())if(r=Zd(t),r!==null)break;if(r===null)return;let i=t.includes(r)?t:[r],a=i.map(e=>M(e)).filter(e=>e!==null);a.length!==0&&(n=i,e.dataTransfer.setData(me,a.join(` `)))},handleDragEnd(){if(n.length!==0){for(let t of n)e.deselect(t);n=[]}}}}var $d=`
|
|
1737
|
+
:host {
|
|
1738
|
+
--trees-bg-override: transparent;
|
|
1739
|
+
--trees-selected-bg-override: color-mix(in srgb, currentColor 12%, transparent);
|
|
1740
|
+
--trees-hover-bg-override: color-mix(in srgb, currentColor 7%, transparent);
|
|
1741
|
+
--trees-border-color-override: color-mix(in srgb, currentColor 14%, transparent);
|
|
1742
|
+
--trees-font-family-override: var(--font-sans);
|
|
1743
|
+
--trees-font-size-override: 12px;
|
|
1744
|
+
}
|
|
1745
|
+
button[data-type='item'] { border-radius: 5px; }
|
|
1746
|
+
`;function ef(e){return e.kind===`directory`?`${e.path}/`:e.path}function tf({environmentId:e,cwd:t,projectName:r,onOpenFile:i}){let{resolvedTheme:a}=oe(),o=ye(),s=Te(e,t),l=s.data?.entries??[],u=(0,X.useMemo)(()=>new Map(l.map(e=>[e.path,e.kind])),[l]),d=(0,X.useRef)(u),f=(0,X.useMemo)(()=>l.map(ef),[l]),p=(0,X.useRef)([]),m=(0,X.useRef)(null);(0,X.useEffect)(()=>{let e=e=>{m.current={x:e.clientX,y:e.clientY,at:e.timeStamp}};return document.addEventListener(`contextmenu`,e,!0),()=>document.removeEventListener(`contextmenu`,e,!0)},[]);let h=async(e,t)=>{let r=n();if(!r){t.close();return}let i=e.path.replace(/\/$/,``),a=A(i),s=m.current,c=s!==null&&performance.now()-s.at<1e3,l=t.anchorElement.getBoundingClientRect(),u=c?{x:s.x,y:s.y}:{x:l.left,y:l.bottom};try{let e=await r.contextMenu.show([{id:`copy-mention`,label:`Copy mention`},{id:`add-to-chat`,label:`Add to chat`}],u);if(e===`copy-mention`){try{await Ee(a),Le.add({type:`success`,title:`Mention copied`,description:i})}catch(e){Le.add({type:`error`,title:`Failed to copy mention`,description:e instanceof Error?e.message:`An error occurred.`})}return}if(e===`add-to-chat`){let e=o?.current;if(!e){Le.add({type:`error`,title:`Unable to add to chat`,description:`Open a chat for this project and try again.`});return}e.insertTextAtEnd(`${a} `,{ensureLeadingBoundary:!0})||Le.add({type:`error`,title:`Unable to add to chat`,description:`The chat isn't ready to accept input right now.`})}}finally{t.close()}},g=(0,X.useRef)(h);(0,X.useEffect)(()=>{g.current=h});let _=(0,X.useRef)(null),v=(0,X.useMemo)(()=>Qd({deselect:e=>_.current?.getItem(e)?.deselect()}),[]),{model:y}=Xd({composition:{contextMenu:{triggerMode:`right-click`,onOpen:(e,t)=>{g.current(e,t)}}},dragAndDrop:{canDrop:()=>!1},density:`compact`,fileTreeSearchMode:`hide-non-matches`,flattenEmptyDirectories:!0,initialExpansion:1,icons:We,onSelectionChange:e=>{if(v.handleSelectionChange(e),v.isDragInProgress())return;let t=e.at(-1)?.replace(/\/$/,``);t&&d.current.get(t)===`file`&&i(t)},paths:[],search:!0,unsafeCSS:$d});(0,X.useEffect)(()=>{p.current!==f&&(d.current=u,p.current=f,y.resetPaths(f))},[u,y,f]);let b=(0,X.useMemo)(()=>l.reduce((e,t)=>e+ +(t.kind===`file`),0),[l]),x=(0,X.useRef)(null);return(0,X.useEffect)(()=>{_.current=y},[y]),(0,X.useEffect)(()=>{let e=x.current;if(e===null)return;let t=e=>v.handleDragStart(e),n=()=>v.handleDragEnd();return e.addEventListener(`dragstart`,t,!0),e.addEventListener(`dragend`,n),()=>{e.removeEventListener(`dragstart`,t,!0),e.removeEventListener(`dragend`,n)}},[v]),(0,Z.jsxs)(`div`,{ref:x,className:`flex min-h-0 flex-1 flex-col bg-background`,"data-file-browser-panel":`${e}:${t}`,children:[(0,Z.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-border/60 px-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate text-xs font-medium text-foreground`,children:r}),(0,Z.jsxs)(`div`,{className:`truncate text-[10px] leading-none text-muted-foreground`,children:[s.isPending&&s.data===null?`Indexing…`:`${b.toLocaleString()} files`,s.data?.truncated?` · partial`:``]})]}),(0,Z.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-foreground`,"aria-label":`Search workspace files`,onClick:()=>y.openSearch(),children:(0,Z.jsx)(pe,{className:`size-3.5`})}),(0,Z.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-foreground`,"aria-label":`Refresh workspace files`,onClick:s.refresh,children:(0,Z.jsx)(N,{className:c(`size-3.5`,s.isPending&&`animate-spin`)})})]}),s.error&&s.data===null?(0,Z.jsx)(`div`,{className:`p-4 text-xs leading-relaxed text-destructive`,children:s.error}):(0,Z.jsx)(Yd,{model:y,"aria-label":`${r} files`,className:`min-h-0 flex-1 overflow-hidden`,style:{colorScheme:a,"--trees-fg-override":`var(--foreground)`}})]})}function nf({root:e,editor:t,onDismiss:n}){n(),t.setSelections([]);let r=e.querySelector(`diffs-container`)?.shadowRoot?.activeElement;r instanceof HTMLElement&&r.blur()}function rf(e){return e.querySelector(`diffs-container`)?.shadowRoot?.activeElement?.hasAttribute(`data-content`)===!0}function af({root:e,editor:t,isBlocked:n,onDismiss:r}){let i=i=>{n()||i.composedPath().includes(e)||nf({root:e,editor:t,onDismiss:r})},a=i=>{i.key!==`Escape`||n()||!rf(e)||(i.preventDefault(),i.stopImmediatePropagation(),nf({root:e,editor:t,onDismiss:r}))};return document.addEventListener(`pointerdown`,i,!0),document.addEventListener(`keydown`,a,!0),()=>{document.removeEventListener(`pointerdown`,i,!0),document.removeEventListener(`keydown`,a,!0)}}function of(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function sf(e,t,n){return`${e}:${t}:${of(n)}`}function cf(e,t){let n=t.split(`/`).filter(Boolean);return[{label:e,path:``,kind:`project`},...n.map((e,t)=>({label:e,path:n.slice(0,t+1).join(`/`),kind:t===n.length-1?`file`:`directory`}))]}var lf=e=>/\.(?:md|mdx)$/i.test(e);function uf(e,t,n){return t<0||e[t]!==`[`||!/[ xX]/.test(e[t+1]??``)||e[t+2]!==`]`?e:`${e.slice(0,t+1)}${n?`x`:` `}${e.slice(t+2)}`}var df=class{options;timer=null;latestContents=``;latestRevision=0;lastChangeAt=0;saving=!1;disposed=!1;constructor(e){this.options=e}change(e){this.latestContents=e,this.latestRevision+=1,this.lastChangeAt=Date.now(),this.options.onPendingChange(!0),this.schedule(this.options.debounceMs)}dispose(){this.disposed=!0,this.clearTimer(),this.latestRevision>0&&this.persistLatest()}schedule(e){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.persistLatest()},e)}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}async persistLatest(){if(this.saving||this.latestRevision===0)return;this.saving=!0;let e=this.latestContents,t=this.latestRevision,n=(await this.options.persist(e))._tag===`Success`;if(n&&this.options.onConfirmed(e),this.saving=!1,t===this.latestRevision){n&&this.options.onPendingChange(!1);return}let r=Math.max(0,this.options.debounceMs-(Date.now()-this.lastChangeAt));this.disposed?this.persistLatest():this.schedule(r)}},ff=`p4code.fileExplorerOpen`,pf=500,mf=`data-file-link-reveal`,hf=`
|
|
1747
|
+
[${mf}][data-line] {
|
|
1748
|
+
background-color: light-dark(
|
|
1749
|
+
color-mix(
|
|
1750
|
+
in lab,
|
|
1751
|
+
var(--diffs-computed-diff-line-bg) 82%,
|
|
1752
|
+
var(--diffs-bg-selection-override, var(--diffs-selection-base))
|
|
1753
|
+
),
|
|
1754
|
+
color-mix(
|
|
1755
|
+
in lab,
|
|
1756
|
+
var(--diffs-computed-diff-line-bg) 75%,
|
|
1757
|
+
var(--diffs-bg-selection-override, var(--diffs-selection-base))
|
|
1758
|
+
)
|
|
1759
|
+
) !important;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
[${mf}][data-column-number] {
|
|
1763
|
+
background-color: light-dark(
|
|
1764
|
+
color-mix(
|
|
1765
|
+
in lab,
|
|
1766
|
+
var(--diffs-computed-diff-line-bg) 75%,
|
|
1767
|
+
var(--diffs-bg-selection-number-override, var(--diffs-selection-base))
|
|
1768
|
+
),
|
|
1769
|
+
color-mix(
|
|
1770
|
+
in lab,
|
|
1771
|
+
var(--diffs-computed-diff-line-bg) 60%,
|
|
1772
|
+
var(--diffs-bg-selection-number-override, var(--diffs-selection-base))
|
|
1773
|
+
)
|
|
1774
|
+
) !important;
|
|
1775
|
+
color: var(--diffs-selection-number-fg) !important;
|
|
1776
|
+
}
|
|
1777
|
+
`;function gf(e){let t=(0,kl.c)(8),n;t[0]!==e.absolutePath||t[1]!==e.threadRef.threadId?(n={_tag:`workspace-file`,threadId:e.threadRef.threadId,path:e.absolutePath},t[0]=e.absolutePath,t[1]=e.threadRef.threadId,t[2]=n):n=t[2];let r=Pe(e.environmentId,n),[i,a]=(0,X.useState)(null);if(r._tag===`Failure`||r._tag===`Success`&&i===r.url){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load workspace image.`}),t[3]=e):e=t[3],e}let o;return t[4]!==r._tag||t[5]!==r.url||t[6]!==e.alt?(o=r._tag===`Success`?(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,Z.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:r.url,alt:e.alt,onError:()=>a(r.url)})}):(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,Z.jsx)(De,{className:`size-5 animate-spin`})}),t[4]=r._tag,t[5]=r.url,t[6]=e.alt,t[7]=o):o=t[7],o}function _f(e,t){let n=1;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);r===10?n+=1:r===13&&(n+=1,e.charCodeAt(t+1)===10&&(t+=1))}return Math.min(Math.max(1,t),n)}function vf(e,t){let n=e.shadowRoot??e;for(let e of n.querySelectorAll(`[${mf}]`))e.removeAttribute(mf);t!==null&&(n.querySelector(`[data-line="${t}"]`)?.setAttribute(mf,``),n.querySelector(`[data-column-number="${t}"]`)?.setAttribute(mf,``))}function yf(e,t,n){let r=(0,kl.c)(7),[i]=(0,X.useState)(Sf),[a]=(0,X.useState)(xf),[o]=(0,X.useState)(bf),s;return r[0]!==i||r[1]!==a||r[2]!==o||r[3]!==e||r[4]!==t||r[5]!==n?(s=(r,s,c)=>{if(e===null)return;let l=()=>{let t=o.get(e);t!==void 0&&(cancelAnimationFrame(t),o.delete(e))};if(c===`unmount`){l();return}let u=t===null?null:_f(s.file?.contents??``,t);if(vf(r,u),!(s instanceof E))return;if(a.get(e)!==n&&(l(),a.set(e,n)),u===null){r.style.minHeight=``;return}let d=r.closest(`.file-preview-virtualizer`);!d||(r.style.minHeight=`${Math.ceil(Math.max(s.height,d.clientHeight))}px`,i.get(e)===n||o.has(e))||o.set(e,requestAnimationFrame(()=>{if(o.delete(e),a.get(e)!==n||!r.isConnected)return;let t=s.getLinePosition(u);if(!t)return;let c=d.scrollTop+r.getBoundingClientRect().top-d.getBoundingClientRect().top,l=Math.max(0,c+t.top-Math.max(0,(d.clientHeight-t.height)/2)),f=Math.max(0,d.scrollHeight-d.clientHeight);d.scrollTop=Math.min(l,f),i.set(e,n)}))},r[0]=i,r[1]=a,r[2]=o,r[3]=e,r[4]=t,r[5]=n,r[6]=s):s=r[6],s}function bf(){return new Map}function xf(){return new Map}function Sf(){return new Map}function Cf(e){let t=(0,kl.c)(19),{environmentId:n,cwd:r,relativePath:i,onPendingChange:a}=e,o=b(ze.writeFile),s;t[0]!==a||t[1]!==i?(s=e=>a(i,e),t[0]=a,t[1]=i,t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==n||t[5]!==i||t[6]!==o?(c=e=>o({environmentId:n,input:{cwd:r,relativePath:i,contents:e}}),t[3]=r,t[4]=n,t[5]=i,t[6]=o,t[7]=c):c=t[7];let l;t[8]!==r||t[9]!==n||t[10]!==i?(l=e=>{P(n,r,i,e)},t[8]=r,t[9]=n,t[10]=i,t[11]=l):l=t[11];let u;t[12]!==s||t[13]!==c||t[14]!==l?(u=new df({debounceMs:pf,onPendingChange:s,persist:c,onConfirmed:l}),t[12]=s,t[13]=c,t[14]=l,t[15]=u):u=t[15];let d=u,f,p;return t[16]===d?(f=t[17],p=t[18]):(f=()=>()=>d.dispose(),p=[d],t[16]=d,t[17]=f,t[18]=p),(0,X.useEffect)(f,p),d}function wf(t){let n=(0,kl.c)(74),{environmentId:r,cwd:i,relativePath:o,composerDraftTarget:s,contents:c,resolvedTheme:l,revealRequestId:u,wordWrap:d,onPostRender:f,onPendingChange:p}=t,m=a(jf),h=a(Af),g;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],n[0]=g):g=n[0];let[_,v]=(0,X.useState)(g),[y,b]=(0,X.useState)(null),S=y?.revealRequestId===u?y.range:null,w;n[1]===u?w=n[2]:(w=e=>{b({revealRequestId:u,range:e})},n[1]=u,n[2]=w);let E=w,ne=(0,X.useRef)(null),D=(0,X.useRef)(null),O;n[3]!==i||n[4]!==r||n[5]!==p||n[6]!==o?(O={environmentId:r,cwd:i,relativePath:o,onPendingChange:p},n[3]=i,n[4]=r,n[5]=p,n[6]=o,n[7]=O):O=n[7];let k=Cf(O),A;n[8]!==m||n[9]!==s||n[10]!==i||n[11]!==r||n[12]!==o||n[13]!==k?(A=new Ud({onChange:(t,n)=>{if(Ce(r,i,o,t.contents),k.change(t.contents),n){let r=C(n);v(r);for(let n of r)for(let r of n.metadata.entries)r.kind===`comment`&&m(s,e({id:r.id,filePath:o,startLine:r.startLine,endLine:r.endLine,text:r.text,contents:t.contents}))}}}),n[8]=m,n[9]=s,n[10]=i,n[11]=r,n[12]=o,n[13]=k,n[14]=A):A=n[14];let j=A,M,re;n[15]===j?(M=n[16],re=n[17]):(M=()=>()=>{j.cleanUp()},re=[j],n[15]=j,n[16]=M,n[17]=re),(0,X.useEffect)(M,re);let ie;n[18]!==s||n[19]!==h||n[20]!==E?(ie=e=>{E(null),h(s,e),v(t=>t.flatMap(t=>{let n=t.metadata.entries.filter(t=>t.id!==e);return n.length>0?[{...t,metadata:{entries:n}}]:[]}))},n[18]=s,n[19]=h,n[20]=E,n[21]=ie):ie=n[21];let ae=ie,oe;n[22]!==m||n[23]!==s||n[24]!==c||n[25]!==_||n[26]!==o||n[27]!==E?(oe=(t,n)=>{E(null);let r=_.flatMap(kf).find(e=>e.id===t);r&&m(s,e({id:r.id,filePath:o,startLine:r.startLine,endLine:r.endLine,text:n,contents:c})),v(e=>e.map(e=>({...e,metadata:{entries:e.metadata.entries.map(e=>e.id===t?{...e,kind:`comment`,text:n}:e)}})))},n[22]=m,n[23]=s,n[24]=c,n[25]=_,n[26]=o,n[27]=E,n[28]=oe):oe=n[28];let se=oe,ce;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(ce=e=>{let{startLine:t,endLine:n}=T(e),r={id:ee(),kind:`draft`,startLine:t,endLine:n,text:``};v(e=>{let t=e.flatMap(Df),i=t.findIndex(e=>e.lineNumber===n);return i<0?[...t,{lineNumber:n,metadata:{entries:[r]}}]:t.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,r]}}:e)})},n[29]=ce):ce=n[29];let le=ce,ue;n[30]===_?ue=n[31]:(ue=_.some(Tf),n[30]=_,n[31]=ue);let de=ue,fe,pe;n[32]!==j||n[33]!==de||n[34]!==E?(fe=()=>{let e=ne.current;if(e)return af({root:e,editor:j,isBlocked:()=>de,onDismiss:()=>E(null)})},pe=[j,de,E],n[32]=j,n[33]=de,n[34]=E,n[35]=fe,n[36]=pe):(fe=n[35],pe=n[36]),(0,X.useEffect)(fe,pe);let me;n[37]===E?me=n[38]:(me=e=>{E(e),e&&le(e)},n[37]=E,n[38]=me);let N=me,he;n[39]!==f||n[40]!==S?(he=(e,t,n)=>{f(e,t,n),D.current!==null&&(cancelAnimationFrame(D.current),D.current=null),n!==`unmount`&&(D.current=requestAnimationFrame(()=>{D.current=null,e.isConnected&&t.setSelectedLines(S,{notify:!1})}))},n[39]=f,n[40]=S,n[41]=he):he=n[41];let ge=he,_e;n[42]===Symbol.for(`react.memo_cache_sentinel`)?(_e={overscrollSize:600,intersectionObserverMargin:1200},n[42]=_e):_e=n[42];let ve;n[43]!==c||n[44]!==i||n[45]!==o?(ve=sf(i,o,c),n[43]=c,n[44]=i,n[45]=o,n[46]=ve):ve=n[46];let ye;n[47]!==c||n[48]!==o||n[49]!==ve?(ye={name:o,contents:c,cacheKey:ve},n[47]=c,n[48]=o,n[49]=ve,n[50]=ye):ye=n[50];let xe=!de,Se=!de,we=d?`wrap`:`scroll`,Te;n[51]===l?Te=n[52]:(Te=be(l),n[51]=l,n[52]=Te);let Ee;n[53]!==N||n[54]!==ge||n[55]!==l||n[56]!==E||n[57]!==xe||n[58]!==Se||n[59]!==we||n[60]!==Te?(Ee={disableFileHeader:!0,enableGutterUtility:xe,enableLineSelection:Se,onGutterUtilityClick:E,onLineSelectionChange:E,onLineSelectionEnd:N,overflow:we,theme:Te,themeType:l,unsafeCSS:hf,onPostRender:ge},n[53]=N,n[54]=ge,n[55]=l,n[56]=E,n[57]=xe,n[58]=Se,n[59]=we,n[60]=Te,n[61]=Ee):Ee=n[61];let De;n[62]!==ae||n[63]!==se?(De=e=>(0,Z.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,Z.jsx)(x,{kind:e.kind,rangeLabel:te(e.startLine,e.endLine),text:e.text,onCancel:()=>ae(e.id),onComment:t=>se(e.id,t),onDelete:()=>ae(e.id)},e.id))}),n[62]=ae,n[63]=se,n[64]=De):De=n[64];let P;n[65]!==_||n[66]!==S||n[67]!==ye||n[68]!==Ee||n[69]!==De?(P=(0,Z.jsx)(`div`,{ref:ne,className:`flex min-h-0 flex-1`,children:(0,Z.jsx)(Re,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:_e,children:(0,Z.jsx)(Ol,{file:ye,options:Ee,selectedLines:S,lineAnnotations:_,renderAnnotation:De,className:`min-h-full`,contentEditable:!0})})}),n[65]=_,n[66]=S,n[67]=ye,n[68]=Ee,n[69]=De,n[70]=P):P=n[70];let Oe;return n[71]!==j||n[72]!==P?(Oe=(0,Z.jsx)(Ve,{editor:j,children:P}),n[71]=j,n[72]=P,n[73]=Oe):Oe=n[73],Oe}function Tf(e){return e.metadata.entries.some(Ef)}function Ef(e){return e.kind===`draft`}function Df(e){let t=e.metadata.entries.filter(Of);return t.length>0?[{...e,metadata:{entries:t}}]:[]}function Of(e){return e.kind!==`draft`}function kf(e){return e.metadata.entries}function Af(e){return e.removeReviewComment}function jf(e){return e.addReviewComment}function Mf(e){let t=(0,kl.c)(16),{environmentId:n,cwd:r,relativePath:i,contents:a,threadRef:o,onPendingChange:s}=e,c;t[0]!==r||t[1]!==n||t[2]!==s||t[3]!==i?(c={environmentId:n,cwd:r,relativePath:i,onPendingChange:s},t[0]=r,t[1]=n,t[2]=s,t[3]=i,t[4]=c):c=t[4];let l=Cf(c),u;t[5]!==a||t[6]!==r||t[7]!==n||t[8]!==i||t[9]!==l?(u=e=>{let{markerOffset:t,checked:o}=e,s=Ie(n,r,i)?.contents??a,c=uf(s,t,o);c!==s&&(Ce(n,r,i,c),l.change(c))},t[5]=a,t[6]=r,t[7]=n,t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==a||t[12]!==r||t[13]!==u||t[14]!==o?(d=(0,Z.jsx)(Fe,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(_e,{text:a,cwd:r,threadRef:o,className:`mx-auto max-w-4xl px-6 py-5`,onTaskListChange:u})}),t[11]=a,t[12]=r,t[13]=u,t[14]=o,t[15]=d):d=t[15],d}function Nf(){try{return h(ff,o)??!0}catch(e){return console.error(e),!0}}function Pf(e){let n=(0,kl.c)(78),{environmentId:r,cwd:a,projectName:o,relativePath:s,threadRef:u,composerDraftTarget:d,keybindings:h,availableEditors:g,revealLine:v,revealRequestId:x,onOpenFile:S,onPendingChange:C}=e,{resolvedTheme:ee}=oe(),w=Ge(If),T=t(),E=f(r),te;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(te={reportFailure:!1},n[0]=te):te=n[0];let ne=ie(je.createUrl,te),D;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(D={reportFailure:!1},n[1]=D):D=n[1];let O=b(ke.open,D),k;n[2]===s?k=n[3]:(k=s!==null&&Ml(s),n[2]=s,n[3]=k);let A=k,j=Me(r,a,s,!A),[M,le]=(0,X.useState)(Nf),ue;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(ue={path:null,revealRequestId:null},n[4]=ue):ue=n[4];let[de,fe]=(0,X.useState)(ue),pe=(0,X.useRef)(null),me;n[5]===s?me=n[6]:(me=s?lf(s):!1,n[5]=s,n[6]=me);let N=me,he=N&&de.path===s&&(v===null||de.revealRequestId===x),_e;n[7]===s?_e=n[8]:(_e=s!==null&&ce()&&ae(s),n[7]=s,n[8]=_e);let ye=_e,xe;n[9]!==a||n[10]!==s?(xe=s?ve(s,a):null,n[9]=a,n[10]=s,n[11]=xe):xe=n[11];let Se=xe,Ce;n[12]!==o||n[13]!==s?(Ce=s?cf(o,s):[],n[12]=o,n[13]=s,n[14]=Ce):Ce=n[14];let Te=Ce,Ee=yf(s,v,x),P;n[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{(pe.current?.querySelector(`[data-current-file-crumb='true']`))?.scrollIntoView({block:`nearest`,inline:`end`})},n[15]=P):P=n[15];let Oe;n[16]===s?Oe=n[17]:(Oe=[s],n[16]=s,n[17]=Oe),(0,X.useEffect)(P,Oe);let Ne;n[18]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>{le(Ff)},n[18]=Ne):Ne=n[18];let Pe=Ne,Ie;n[19]!==Se||n[20]!==ne||n[21]!==E||n[22]!==O||n[23]!==u?(Ie=()=>{!Se||!E||(async()=>{let e=await ge({threadRef:u,filePath:Se,httpBaseUrl:E,createAssetUrl:ne,openPreview:O});if(e._tag===`Success`||p(e))return;let t=l(e);Le.add(we({type:`error`,title:`Unable to open file in browser`,description:t instanceof Error?t.message:`An error occurred.`}))})()},n[19]=Se,n[20]=ne,n[21]=E,n[22]=O,n[23]=u,n[24]=Ie):Ie=n[24];let ze=Ie,Be;n[25]!==Se||n[26]!==g||n[27]!==Te||n[28]!==ye||n[29]!==r||n[30]!==M||n[31]!==ze||n[32]!==N||n[33]!==h||n[34]!==T||n[35]!==o||n[36]!==s||n[37]!==he||n[38]!==x?(Be=s?(0,Z.jsxs)(`div`,{className:`surface-subheader gap-2 px-3`,"data-surface-subheader":!0,children:[(0,Z.jsx)(Fe,{ref:pe,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1 rounded-none`,"data-file-breadcrumbs":!0,children:(0,Z.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center text-xs`,children:Te.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center`,"data-current-file-crumb":e.kind===`file`,children:[t>0?(0,Z.jsx)(i,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}):null,(0,Z.jsx)(`span`,{className:c(`max-w-40 truncate`,e.kind===`file`?`font-medium text-foreground`:`text-muted-foreground`),title:e.path||o,children:e.label})]},e.path||`project`))})}),Se&&r===T?(0,Z.jsx)(Ae,{environmentId:r,keybindings:h,availableEditors:g,openInCwd:Se,compact:!0,enableShortcut:!1}):null,N?(0,Z.jsxs)(y,{children:[(0,Z.jsx)(m,{render:(0,Z.jsx)(Ke,{className:`shrink-0`,pressed:he,onPressedChange:e=>{fe({path:e?s:null,revealRequestId:e?x:null})},"aria-label":he?`Show markdown source`:`Show rendered markdown`,variant:`ghost`,size:`sm`,children:he?(0,Z.jsx)(Je,{className:`size-3.5`}):(0,Z.jsx)(se,{className:`size-3.5`})})}),(0,Z.jsx)(_,{children:he?`Show markdown source`:`Show rendered markdown`})]}):null,ye?(0,Z.jsxs)(y,{children:[(0,Z.jsx)(m,{render:(0,Z.jsx)(Ke,{className:`shrink-0`,pressed:!1,onPressedChange:ze,"aria-label":`Open file in preview browser`,variant:`ghost`,size:`sm`,children:(0,Z.jsx)(re,{className:`size-3.5`})})}),(0,Z.jsx)(_,{children:`Open file in preview browser`})]}):null,(0,Z.jsxs)(y,{children:[(0,Z.jsx)(m,{render:(0,Z.jsx)(Ke,{className:`shrink-0`,pressed:M,onPressedChange:Pe,"aria-label":M?`Hide file explorer`:`Show file explorer`,variant:`ghost`,size:`sm`,children:(0,Z.jsx)(Ye,{className:`size-3.5`})})}),(0,Z.jsx)(_,{children:M?`Hide file explorer`:`Show file explorer`})]})]}):null,n[25]=Se,n[26]=g,n[27]=Te,n[28]=ye,n[29]=r,n[30]=M,n[31]=ze,n[32]=N,n[33]=h,n[34]=T,n[35]=o,n[36]=s,n[37]=he,n[38]=x,n[39]=Be):Be=n[39];let Ve;n[40]!==j||n[41]!==s?(Ve=s&&j.data?.truncated?(0,Z.jsxs)(`div`,{className:`shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-1.5 text-[11px] text-amber-700 dark:text-amber-300`,children:[`Preview limited to the first 1 MB of a `,j.data.byteLength.toLocaleString(),` byte file.`]}):null,n[40]=j,n[41]=s,n[42]=Ve):Ve=n[42];let He=s?`flex`:`hidden`,Ue;n[43]===He?Ue=n[44]:(Ue=c(`min-w-0 flex-1 flex-col overflow-hidden`,He),n[43]=He,n[44]=Ue);let We;n[45]!==Se||n[46]!==d||n[47]!==a||n[48]!==r||n[49]!==j||n[50]!==A||n[51]!==N||n[52]!==Ee||n[53]!==C||n[54]!==s||n[55]!==he||n[56]!==ee||n[57]!==x||n[58]!==u||n[59]!==w?(We=s&&A&&Se?(0,Z.jsx)(gf,{environmentId:r,threadRef:u,absolutePath:Se,alt:s},Se):s&&j.error&&j.data===null?(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:j.error}):s&&j.data===null?(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,Z.jsx)(De,{className:`size-5 animate-spin`})}):s&&j.data?N&&he?(0,Z.jsx)(Mf,{environmentId:r,cwd:a,relativePath:s,threadRef:u,contents:j.data.contents,onPendingChange:C}):j.data.truncated?(0,Z.jsx)(Re,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:(0,Z.jsx)(Ol,{file:{name:s,contents:j.data.contents,cacheKey:sf(a,s,j.data.contents)},options:{disableFileHeader:!0,overflow:w?`wrap`:`scroll`,theme:be(ee),themeType:ee,unsafeCSS:hf,onPostRender:Ee},className:`min-h-full`})},`${s}:${ee}:${j.data.byteLength}`):(0,Z.jsx)(wf,{environmentId:r,cwd:a,relativePath:s,composerDraftTarget:d,contents:j.data.contents,resolvedTheme:ee,revealRequestId:x,wordWrap:w,onPostRender:Ee,onPendingChange:C},`${s}:${ee}`):null,n[45]=Se,n[46]=d,n[47]=a,n[48]=r,n[49]=j,n[50]=A,n[51]=N,n[52]=Ee,n[53]=C,n[54]=s,n[55]=he,n[56]=ee,n[57]=x,n[58]=u,n[59]=w,n[60]=We):We=n[60];let qe;n[61]!==Ue||n[62]!==We?(qe=(0,Z.jsx)(`div`,{className:Ue,children:We}),n[61]=Ue,n[62]=We,n[63]=qe):qe=n[63];let Xe;n[64]!==a||n[65]!==r||n[66]!==M||n[67]!==S||n[68]!==o||n[69]!==s?(Xe=M||s===null?(0,Z.jsx)(`aside`,{className:c(`flex min-h-0 shrink-0 bg-background`,s?`w-[min(22rem,46%)] min-w-64 border-l border-border/60`:`min-w-0 flex-1`),children:(0,Z.jsx)(tf,{environmentId:r,cwd:a,projectName:o,onOpenFile:S},`${r}:${a}`)}):null,n[64]=a,n[65]=r,n[66]=M,n[67]=S,n[68]=o,n[69]=s,n[70]=Xe):Xe=n[70];let Ze;n[71]!==qe||n[72]!==Xe?(Ze=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[qe,Xe]}),n[71]=qe,n[72]=Xe,n[73]=Ze):Ze=n[73];let Qe;return n[74]!==Be||n[75]!==Ve||n[76]!==Ze?(Qe=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[Be,Ve,Ze]}),n[74]=Be,n[75]=Ve,n[76]=Ze,n[77]=Qe):Qe=n[77],Qe}function Ff(e){let t=!e;try{d(ff,t,o)}catch(e){console.error(e)}return t}function If(e){return e.wordWrap}export{Pf as default};
|
|
1778
|
+
//# sourceMappingURL=FilePreviewPanel-DdLy8b8b.js.map
|