@xano/xanoscript-monaco-editor 0.1.2 → 0.1.4

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.
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layout.contribution.darwin-gdaUfoJf.js","./_.contribution-BThlLkzn.js","./layout.contribution.linux-xMjRz7iy.js","./layout.contribution.win-DZRWibbm.js"])))=>i.map(i=>d[i]);
2
- import{Z as Pe,bK as b,bL as X,gs as cb,bO as xe,aj as x,bA as He,ck as P,bN as G,bP as N,$ as y,ce as js,cp as Y,eu as Z,cR as L,gt as Rs,D as R,E,a7 as M,N as oi,gu as Ne,gv as Ht,gw as Vi,d as O,cG as ea,t as ae,gx as lb,bc as Er,A as Bo,gy as hb,gz as ub,gA as pb,eU as gb,gB as Ip,d5 as hs,f as D,g as u,m as mt,bx as ce,W as F,c0 as me,dl as at,bw as At,ch as bs,aH as z,gC as fb,ee as Lm,f3 as Ie,aJ as H,f7 as mb,gD as wb,gE as yb,dx as Ee,gF as vb,go as ta,gG as bb,aK as Re,fI as ia,b$ as Ec,q as c,fC as Hn,fH as sa,a8 as ge,eY as Dp,fn as Fo,dd as Ap,eV as Tp,d6 as Cb,d7 as Sb,fl as Wl,dw as jt,d8 as je,gH as Vm,bY as w,dr as zn,gI as md,db as ke,gJ as _b,da as J,fw as $a,ds as St,dc as te,di as Eg,dj as Ig,eT as Pm,f9 as Mm,gK as Eb,dS as Ko,gL as Ib,eX as wd,gM as Om,j as Ke,dn as it,dp as Tt,cf as Ye,dC as se,fD as Cs,gN as yd,g6 as $s,gO as Db,gP as Ab,gQ as Tb,gR as Nm,cx as qa,dR as Wt,gS as Cn,gT as Bm,cl as Ot,gU as xb,gV as kb,fh as $n,gW as Fm,gX as Km,gY as Wm,gZ as Gm,g_ as Um,g$ as Hm,d_ as Oe,h0 as Rb,h as ie,fi as Lb,ff as Vb,h1 as Ys,h2 as Pb,h3 as Mb,h4 as Ob,h5 as ll,h6 as vd,h7 as zm,h8 as Nb,h9 as Bb,ha as $m,hb as qm,hc as jm,hd as bd,d4 as cs,he as Dg,hf as Fb,d0 as wt,dv as Ym,hg as Sn,hh as Ds,hi as to,hj as Kb,hk as Wb,hl as Gl,hm as Pr,fe as Ul,bo as Ca,hn as Gb,eq as ut,g8 as Ub,ho as Hb,hp as zb,hq as $b,hr as qb,cz as Ag,hs as Jm,ht as jb,hu as ao,hv as Yb,hw as Jb,cv as Zb,G as Wo,hx as we,dt as Xb,bW as Q,cc as Je,hy as Zm,bu as re,hz as Hl,hA as Xm,hB as Tg,hC as Qb,cy as tn,co as Ge,cr as Ss,hD as Ls,hE as Nt,hF as _s,dH as Ic,du as eC,hG as ja,hH as tC,hI as nd,hJ as iC,a9 as qn,hK as sC,as as oC,hL as nC,cq as xp,hM as Js,hN as kp,hO as Rp,hP as rC,z as jn,dN as Zt,hQ as aC,hR as dC,hS as xg,hT as hl,hU as Lp,e5 as kg,e0 as Qm,f6 as cC,hV as lC,dF as Ui,eF as hC,hW as uC,hX as pC,ec as Go,cY as I,bE as k,f4 as ew,dU as Vp,an as or,dV as gC,e_ as fC,eb as Cd,hY as nr,hZ as Ut,h_ as xs,h$ as ot,i0 as Vs,i1 as mC,p as jo,i2 as zl,bh as Ce,x as is,gb as $l,bZ as S,ba as Dc,ak as ee,i3 as co,bb as wi,i4 as wC,i5 as yC,cS as ne,i6 as tw,i7 as ul,i8 as pl,e7 as Rg,dh as Yn,i9 as vC,ia as bC,ib as CC,ic as $t,id as SC,ie as Ya,ig as yi,ih as A,ii as _C,ij as si,aV as EC,bU as Te,ik as ho,aU as iw,il as sw,aR as ow,im as IC,io as Pp,bz as Le,ip as rr,O as Ue,iq as Sa,cj as _a,e1 as Uo,e2 as nw,be as Zs,bf as ql,ir as Lg,ah as _,is as DC,it as rw,iu as AC,iv as Vg,aT as TC,iw as Pg,_ as gl,cg as Mp,ix as Mg,eQ as Ho,iy as xC,iz as kC,u as aw,iA as RC,dP as jl,iB as LC,dg as Yl,iC as xi,iD as rd,R as ve,iE as VC,bD as le,V as ri,iF as $i,i as ar,iG as dr,eW as PC,br as dt,cu as Ir,iH as Ac,a0 as pe,d2 as cr,cO as _t,bd as Qe,iI as MC,U as $,iJ as _n,iK as OC,iL as dw,iM as NC,iN as BC,iO as FC,iP as KC,iQ as Tc,a4 as es,dD as WC,iR as Og,iS as Ng,iT as ft,iU as GC,iV as UC,dy as HC,ad as xc,ae as kc,iW as zC,iX as cw,iY as $C,iZ as lr,i_ as Op,i$ as Sd,j0 as qC,j1 as jC,j2 as Bg,al as YC,j3 as JC,j4 as Np,j5 as Bp,j6 as Fp,j7 as Kp,j8 as pt,j9 as lw,ja as ZC,jb as ji,jc as Wp,jd as br,cA as Ea,je as XC,jf as Fg,jg as gt,jh as q,ji as Kg,jj as Lt,jk as Bt,jl as Ni,jm as ad,jn as hw,jo as Ct,jp as fl,jq as Wg,jr as Ia,js as QC,jt as dd,ju as Gg,cC as De,jv as ii,jw as uw,jx as eS,jy as tS,jz as iS,aQ as Pi,bX as Se,jA as us,jB as sS,bH as Xt,jC as ps,jD as oS,jE as Vt,jF as nS,jG as rS,jH as aS,jI as dS,jJ as cS,jK as Jl,jL as Mr,jM as tt,jN as qe,jO as ml,jP as Ug,jQ as lS,jR as hS,ct as Zl,jS as Hg,bs as zg,ao as Da,jT as fi,jU as $g,jV as _d,jW as uS,jX as pS,jY as gS,jZ as Gp,j_ as Rc,j$ as Up,s as fS,k0 as pw,k1 as ct,k2 as gw,k3 as fw,k4 as Pt,em as Aa,k5 as Ta,k6 as cd,bm as mS,k7 as wS,aL as ln,k8 as yS,k9 as vS,ka as bS,kb as Or,kc as mw,kd as Dr,ke as qg,kf as Nr,kg as jg,kh as CS,ki as SS,bS as Hp,kj as _S,kk as wl,kl as ES,km as IS,gl as DS,kn as AS,ko as Yg,kp as Ar,kq as TS,kr as xS,ks as Jg,kt as he,ku as ww,kv as zp,kw as Lc,a3 as qs,b_ as kS,kx as RS,ky as yw,F as Br,kz as LS,kA as VS,kB as PS,kC as MS,kD as OS,kE as NS,eN as Zg,kF as BS,kG as Jt,kH as FS,kI as KS,kJ as vw,kK as bw,kL as Yo,kM as bi,kN as Cw,kO as Sw,kP as WS,de as _w,kQ as Xg,kR as GS,kS as US,kT as HS,kU as Xl,kV as zS,kW as $S,kX as qS,df as oa,kY as jS,P as Es,cJ as sn,cK as Qg,cL as YS,kZ as Ew,k_ as ef,dE as et,k$ as JS,cN as Ed,l0 as ZS,l1 as tf,l2 as XS,gm as Vc,l3 as sf,l4 as of,l5 as nf,l6 as QS,l7 as e_,dQ as Iw,l8 as rf,l9 as Dw,gq as t_,bJ as Jo,la as Fr,dm as xt,lb as i_,by as s_,eh as Id,lc as yl,eO as Aw,ld as o_,le as af,lf as df,et as n_,cn as pi,lg as r_,lh as a_,li as Ql,lj as cf,lk as d_,ll as Tw,lm as lf,ln as c_,lo as l_,lp as h_,lq as u_,ek as p_,lr as vl,ls as g_,lt as f_,lu as m_,bv as w_,lv as ld,lw as y_,aq as Dd,lx as Ci,ly as v_,lz as xw,lA as Pc,lB as hr,lC as $p,lD as hf,lE as b_,lF as gs,lG as Mc,lH as eh,lI as C_,lJ as Oc,lK as ur,lL as S_,J as __,lM as kw,ev as E_,lN as I_,lO as Mt,lP as D_,lQ as A_,lR as ni,lS as Ad,lT as T_,lU as Rw,lV as x_,lW as k_,lX as R_,lY as uf,b2 as ss,lZ as Jn,l_ as pf,l$ as Td,m0 as Nc,m1 as Tr,m2 as L_,m3 as Bc,m4 as Fc,m5 as V_,m6 as P_,m7 as Lw,m8 as Kc,m9 as M_,ma as Vw,mb as be,X as yt,Y as vt,mc as Pw,md as Mw,me as Ow,mf as nt,mg as Nw,mh as Bw,mi as Fw,mj as Kw,mk as Ww,ml as Gw,mm as Uw,mn as Hw,mo as zw,mp as $w,mq as Wc,mr as qw,ms as bl,mt as Zo,mu as qi,mv as na,mw as xd,mx as jw,my as rt,mz as Cl,cW as ue,mA as qp,mB as _i,mC as Ei,mD as kt,mE as O_,mF as N_,mG as jp,mH as xa,mI as ka,mJ as Ra,mK as Yw,mL as B_,mM as F_,mN as K_,bM as Jw,mO as Zw,mP as W_,mQ as Gc,mR as Sl,mS as _l,mT as Xw,mU as G_,mV as U_,mW as H_,mX as z_,bR as Qw,mY as $_,Q as Uc,fT as q_,mZ as ey,m_ as j_,m$ as th,n0 as gf,n1 as Bi,n2 as ff,n3 as Hc,n4 as Y_,n5 as J_,n6 as Z_,n7 as ty,fK as mf,gi as X_,n8 as Q_,n9 as eE,na as tE,nb as iE,nc as wf,nd as sE,ne as oE,c_ as iy,nf as ze,ng as Ve,nh as ls,ni as lo,nj as nE,nk as Et,nl as uo,nm as rE,nn as kd,no as Yp,np as It,nq as Ja,nr as aE,ns as dE,nt as El,nu as zo,nv as sy,d1 as ih,nw as En,nx as cE,ny as lE,nz as hE,nA as uE,nB as pE,bQ as zc,nC as hn,nD as Jp,nE as Il,nF as yf,nG as Ji,nH as Za,nI as Yi,nJ as sh,nK as vf,nL as Kr,nM as oy,nN as ny,nO as gE,nP as fE,nQ as ry,nR as mE,nS as wE,nT as bf,ge as ay,nU as Wr,nV as Cf,nW as dy,nX as cy,nY as La,nZ as pr,n_ as Hi,n$ as yE,o0 as vE,o1 as ly,o2 as hy,o3 as bE,o4 as uy,o5 as Zp,o6 as oh,o7 as CE,o8 as SE,bF as _E,o9 as EE,oa as mi,ob as Sf,oc as IE,od as _f,oe as DE,of as Dl,og as AE,oh as TE,oi as xE,oj as kE,ok as RE,ol as LE,om as VE,on as py,oo as PE,op as gy,oq as Zi,or as ME,os as Ef,ot as eo,ou as If,ov as OE,ow as Df,ox as Af,oy as $c,oz as nh,oA as fy,oB as qc,oC as Va,oD as my,oE as xr,oF as NE,oG as Tf,oH as BE,oI as FE,oJ as xf,oK as KE,oL as WE,oM as wy,oN as kf,oO as yy,oP as Rf,oQ as vy,oR as Lf,oS as rh,oT as ah,oU as GE,oV as UE,oW as HE,oX as zE,oY as $E,oZ as qE,o_ as jE,o$ as YE,p0 as JE,p1 as ZE,p2 as by,p3 as Cy,p4 as XE,p5 as QE,p6 as eI,p7 as tI,p8 as iI,p9 as sI,pa as oI,pb as nI,pc as rI,pd as aI,pe as dI,pf as cI,pg as lI,ph as hI,pi as uI,pj as pI,pk as gI,pl as fI,pm as mI,pn as wI,po as yI,pp as vI,pq as bI,pr as CI,ps as SI,pt as _I,pu as EI,pv as II,pw as DI,px as AI,py as TI,pz as xI,pA as kI,pB as RI,pC as LI,pD as VI,pE as PI,pF as MI,pG as OI,pH as NI,pI as BI,pJ as FI,pK as KI,pL as WI,pM as GI,pN as UI,pO as HI,pP as zI,pQ as $I,pR as qI,pS as jI,pT as YI,pU as JI,pV as ZI,pW as XI,pX as QI,pY as eD,pZ as tD,p_ as iD,p$ as sD,q0 as oD,q1 as nD,q2 as rD,q3 as aD,q4 as dD,q5 as cD,q6 as lD,q7 as hD,q8 as uD,q9 as pD,qa as Sy,qb as _y,qc as Ey,qd as Iy,qe as Dy,qf as Ay,qg as Ty,qh as xy,qi as gD,qj as fD,qk as mD,ql as wD,qm as yD,qn as vD,qo as bD,qp as CD,qq as SD,qr as _D,qs as ED,qt as ID,qu as DD,qv as ky,qw as AD,qx as Ry,qy as gr,qz as Ly,qA as Vy,qB as jc,qC as Pa,qD as Yc,qE as Ma,qF as TD,qG as Py,qH as Ii,qI as xD,qJ as kD,qK as My,qL as RD,qM as LD,qN as VD,qO as PD,qP as MD,qQ as OD,qR as ND,qS as BD,qT as FD,qU as KD,qV as fr,qW as WD,qX as Oy,qY as Oa,qZ as Ny,q_ as By,q$ as Jc,r0 as Xp,r1 as Na,r2 as Fy,r3 as Ky,r4 as GD,r5 as Wy,r6 as mr,r7 as Gy,r8 as Zc,r9 as Uy,ra as Hy,rb as Ba,rc as zy,rd as $y,re as qy,rf as UD,rg as HD,rh as zD,ri as jy,rj as $D,rk as Xc,rl as $o,rm as qD,rn as jD,ro as YD,rp as JD,rq as ZD,rr as XD,rs as QD,rt as Yy,ru as eA,rv as tA,rw as iA,rx as sA,ry as oA,rz as Zn,rA as Qp,rB as nA,ci as rA,rC as Jy,rD as ra,rE as Al,rF as Cr,gc as aA,rG as Vf,rH as dA,rI as cA,fL as lA,fS as Ki,gk as Pf,rJ as Mf,rK as Zy,rL as hA,rM as qo,rN as uA,rO as pA,M as Gr,rP as Of,rQ as gA,rR as ht,rS as Ae,c as Si,a6 as Wi,rT as Qc,eS as fA,rU as Nf,rV as Bf,rW as mA,o as hd,rX as wA,rY as Xy,rZ as yA,r_ as Ft,r$ as eg,s0 as tg,s1 as el,s2 as ig,s3 as vA,s4 as os,s5 as Xa,s6 as ts,s7 as bA,s8 as Ff,fX as CA,s9 as SA,sa as io,sb as Kf,sc as _A,sd as dh,se as Tl,sf as Wf,sg as Qa,sh as EA,si as IA,sj as Gf,sk as Qy,sl as ev,sm as ed,sn as DA,so as AA,sp as TA,sq as xA,sr as kA,ss as RA,st as LA,su as tv,sv as iv,sw as sv,sx as Rd,sy as VA,sz as Uf,sA as PA,sB as un,sC as xl,sD as MA,sE as Ld,sF as OA,sG as ye,sH as wr,sI as tl,sJ as sg,sK as NA,sL as BA,sM as ov,sN as FA,sO as Hf,sP as Ps,sQ as KA,sR as WA,sS as td,sT as Ur,sU as GA,sV as nv,sW as rv,sX as UA,ex as zf,sY as HA,ez as zA,eA as $A,sZ as qA,eP as jA,s_ as ch,s$ as lh,t0 as hh,t1 as YA,t2 as JA,t3 as ZA,t4 as XA,t5 as QA,t6 as eT,t7 as aa,t8 as og,t9 as tT,ta as iT,tb as $f,tc as sT,td as oT,te as nT,tf as rT,tg as qf,th as av,ti as aT,tj as dT,tk as jf,tl as cT,fs as lT,tm as hT,fr as uT,tn as pT,to as dv,tp as gT,tq as fT,tr as mT,ts as wT,tt as yT,tu as vT,tv as bT,tw as CT,tx as ST,ty as id,fE as _T}from"./index-DSexFukl.js";import{f as cv,T as ET}from"./files.contribution._fileEditorFactory-YNF_vxMj.js";import{I as IT}from"./workbenchThemeService.service-CXlQNmVU.js";const lv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Pe(lv);b(class extends X{constructor(){super({id:"workbench.action.closeSidebar",title:x(3479,"Close Primary Side Bar"),category:xe.View,f1:!0,precondition:cb})}run(a){a.get(He).setPartHidden(!0,P.SIDEBAR_PART)}});class DT extends X{constructor(){super({id:"workbench.action.focusSideBar",title:x(3480,"Focus into Primary Side Bar"),category:xe.View,f1:!0,keybinding:{weight:G.WorkbenchContrib,when:null,primary:N.CtrlCmd|y.Digit0}})}async run(e){const t=e.get(He),i=e.get(js);t.isVisible(P.SIDEBAR_PART)||t.setPartHidden(!1,P.SIDEBAR_PART),i.getActivePaneComposite(Y.Sidebar)?.focus()}}b(DT);const hv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Pe(hv);const AT={separatorBorder:oi.transparent};function Fi(a){return a===Z.VERTICAL?Z.HORIZONTAL:Z.VERTICAL}class TT{constructor(e){this.isLayoutEnabled=e}}function xT(a,e){return e===Z.HORIZONTAL?{left:a.start,right:a.end,top:a.orthogonalStart,bottom:a.orthogonalEnd}:{top:a.start,bottom:a.end,left:a.orthogonalStart,right:a.orthogonalEnd}}function kT(a,e){return e===Z.HORIZONTAL?{start:a.left,end:a.right,orthogonalStart:a.top,orthogonalEnd:a.bottom}:{start:a.top,end:a.bottom,orthogonalStart:a.left,orthogonalEnd:a.right}}function hi(a,e){if(Math.abs(a)>e)throw new Error("Invalid index");return lb(a,e+1)}class _e{get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}get absoluteOffset(){return this._absoluteOffset}get absoluteOrthogonalOffset(){return this._absoluteOrthogonalOffset}get styles(){return this._styles}get width(){return this.orientation===Z.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===Z.HORIZONTAL?this.orthogonalSize:this.size}get top(){return this.orientation===Z.HORIZONTAL?this._absoluteOffset:this._absoluteOrthogonalOffset}get left(){return this.orientation===Z.HORIZONTAL?this._absoluteOrthogonalOffset:this._absoluteOffset}get minimumSize(){return this.children.length===0?0:Math.max(...this.children.map((e,t)=>this.splitview.isViewVisible(t)?e.minimumOrthogonalSize:0))}get maximumSize(){return Math.min(...this.children.map((e,t)=>this.splitview.isViewVisible(t)?e.maximumOrthogonalSize:Number.POSITIVE_INFINITY))}get priority(){if(this.children.length===0)return Vi.Normal;const e=this.children.map(t=>typeof t.priority>"u"?Vi.Normal:t.priority);return e.some(t=>t===Vi.High)?Vi.High:e.some(t=>t===Vi.Low)?Vi.Low:Vi.Normal}get proportionalLayout(){return this.children.length===0?!0:this.children.every(e=>e.proportionalLayout)}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get minimumWidth(){return this.orientation===Z.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===Z.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===Z.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===Z.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){if(!(this._boundarySashes.start===e.start&&this._boundarySashes.end===e.end&&this._boundarySashes.orthogonalStart===e.orthogonalStart&&this._boundarySashes.orthogonalEnd===e.orthogonalEnd)){this._boundarySashes=e,this.splitview.orthogonalStartSash=e.orthogonalStart,this.splitview.orthogonalEndSash=e.orthogonalEnd;for(let t=0;t<this.children.length;t++){const i=this.children[t],s=t===0,o=t===this.children.length-1;i.boundarySashes={start:e.orthogonalStart,end:e.orthogonalEnd,orthogonalStart:s?e.start:i.boundarySashes.orthogonalStart,orthogonalEnd:o?e.end:i.boundarySashes.orthogonalEnd}}}}get edgeSnapping(){return this._edgeSnapping}set edgeSnapping(e){if(this._edgeSnapping!==e){this._edgeSnapping=e;for(const t of this.children)t instanceof _e&&(t.edgeSnapping=e);this.updateSplitviewEdgeSnappingEnablement()}}constructor(e,t,i,s,o=0,n=0,r=!1,d){if(this.orientation=e,this.layoutController=t,this.splitviewProportionalLayout=s,this.children=[],this._absoluteOffset=0,this._absoluteOrthogonalOffset=0,this.absoluteOrthogonalSize=0,this._onDidChange=new E,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new E,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this.childrenVisibilityChangeDisposable=new O,this._onDidScroll=new E,this.onDidScrollDisposable=R.None,this.onDidScroll=this._onDidScroll.event,this.childrenChangeDisposable=R.None,this._onDidSashReset=new E,this.onDidSashReset=this._onDidSashReset.event,this.splitviewSashResetDisposable=R.None,this.childrenSashResetDisposable=R.None,this._boundarySashes={},this._edgeSnapping=!1,this._styles=i,this._size=o,this._orthogonalSize=n,this.element=M(".monaco-grid-branch-node"),!d)this.splitview=new ea(this.element,{orientation:e,styles:i,proportionalLayout:s}),this.splitview.layout(o,{orthogonalSize:n,absoluteOffset:0,absoluteOrthogonalOffset:0,absoluteSize:o,absoluteOrthogonalSize:n});else{const h={views:d.map(f=>({view:f.node,size:f.node.size,visible:f.visible!==!1})),size:this.orthogonalSize},p={proportionalLayout:s,orientation:e,styles:i};this.children=d.map(f=>f.node),this.splitview=new ea(this.element,{...p,descriptor:h}),this.children.forEach((f,g)=>{const m=g===0,v=g===this.children.length;f.boundarySashes={start:this.boundarySashes.orthogonalStart,end:this.boundarySashes.orthogonalEnd,orthogonalStart:m?this.boundarySashes.start:this.splitview.sashes[g-1],orthogonalEnd:v?this.boundarySashes.end:this.splitview.sashes[g]}})}const l=L.map(this.splitview.onDidSashReset,h=>[h]);this.splitviewSashResetDisposable=l(this._onDidSashReset.fire,this._onDidSashReset),this.updateChildrenEvents()}style(e){this._styles=e,this.splitview.style(e);for(const t of this.children)t instanceof _e&&t.style(e)}layout(e,t,i){if(this.layoutController.isLayoutEnabled){if(typeof i>"u")throw new Error("Invalid state");this._size=i.orthogonalSize,this._orthogonalSize=e,this._absoluteOffset=i.absoluteOffset+t,this._absoluteOrthogonalOffset=i.absoluteOrthogonalOffset,this.absoluteOrthogonalSize=i.absoluteOrthogonalSize,this.splitview.layout(i.orthogonalSize,{orthogonalSize:e,absoluteOffset:this._absoluteOrthogonalOffset,absoluteOrthogonalOffset:this._absoluteOffset,absoluteSize:i.absoluteOrthogonalSize,absoluteOrthogonalSize:i.absoluteSize}),this.updateSplitviewEdgeSnappingEnablement()}}setVisible(e){for(const t of this.children)t.setVisible(e)}addChild(e,t,i,s){i=hi(i,this.children.length),this.splitview.addView(e,t,i,s),this.children.splice(i,0,e),this.updateBoundarySashes(),this.onDidChildrenChange()}removeChild(e,t){e=hi(e,this.children.length);const i=this.splitview.removeView(e,t);return this.children.splice(e,1),this.updateBoundarySashes(),this.onDidChildrenChange(),i}removeAllChildren(){const e=this.splitview.removeAllViews();return this.children.splice(0,this.children.length),this.updateBoundarySashes(),this.onDidChildrenChange(),e}moveChild(e,t){e=hi(e,this.children.length),t=hi(t,this.children.length),e!==t&&(e<t&&(t-=1),this.splitview.moveView(e,t),this.children.splice(t,0,this.children.splice(e,1)[0]),this.updateBoundarySashes(),this.onDidChildrenChange())}swapChildren(e,t){e=hi(e,this.children.length),t=hi(t,this.children.length),e!==t&&(this.splitview.swapViews(e,t),[this.children[e].boundarySashes,this.children[t].boundarySashes]=[this.children[e].boundarySashes,this.children[t].boundarySashes],[this.children[e],this.children[t]]=[this.children[t],this.children[e]],this.onDidChildrenChange())}resizeChild(e,t){e=hi(e,this.children.length),this.splitview.resizeView(e,t)}isChildExpanded(e){return this.splitview.isViewExpanded(e)}distributeViewSizes(e=!1){if(this.splitview.distributeViewSizes(),e)for(const t of this.children)t instanceof _e&&t.distributeViewSizes(!0)}getChildSize(e){return e=hi(e,this.children.length),this.splitview.getViewSize(e)}isChildVisible(e){return e=hi(e,this.children.length),this.splitview.isViewVisible(e)}setChildVisible(e,t){if(e=hi(e,this.children.length),this.splitview.isViewVisible(e)===t)return;const i=this.splitview.contentSize===0;this.splitview.setViewVisible(e,t);const s=this.splitview.contentSize===0;(t&&i||!t&&s)&&this._onDidVisibilityChange.fire(t)}getChildCachedVisibleSize(e){return e=hi(e,this.children.length),this.splitview.getViewCachedVisibleSize(e)}updateBoundarySashes(){for(let e=0;e<this.children.length;e++)this.children[e].boundarySashes={start:this.boundarySashes.orthogonalStart,end:this.boundarySashes.orthogonalEnd,orthogonalStart:e===0?this.boundarySashes.start:this.splitview.sashes[e-1],orthogonalEnd:e===this.children.length-1?this.boundarySashes.end:this.splitview.sashes[e]}}onDidChildrenChange(){this.updateChildrenEvents(),this._onDidChange.fire(void 0)}updateChildrenEvents(){const e=L.map(L.any(...this.children.map(s=>s.onDidChange)),()=>{});this.childrenChangeDisposable.dispose(),this.childrenChangeDisposable=e(this._onDidChange.fire,this._onDidChange);const t=L.any(...this.children.map((s,o)=>L.map(s.onDidSashReset,n=>[o,...n])));this.childrenSashResetDisposable.dispose(),this.childrenSashResetDisposable=t(this._onDidSashReset.fire,this._onDidSashReset);const i=L.any(L.signal(this.splitview.onDidScroll),...this.children.map(s=>s.onDidScroll));this.onDidScrollDisposable.dispose(),this.onDidScrollDisposable=i(this._onDidScroll.fire,this._onDidScroll),this.childrenVisibilityChangeDisposable.clear(),this.children.forEach((s,o)=>{s instanceof _e&&this.childrenVisibilityChangeDisposable.add(s.onDidVisibilityChange(n=>{this.setChildVisible(o,n)}))})}trySet2x2(e){if(this.children.length!==2||e.children.length!==2)return R.None;if(this.getChildSize(0)!==e.getChildSize(0))return R.None;const[t,i]=this.children,[s,o]=e.children;if(!(t instanceof We)||!(i instanceof We))return R.None;if(!(s instanceof We)||!(o instanceof We))return R.None;this.orientation===Z.VERTICAL?(i.linkedWidthNode=s.linkedHeightNode=t,t.linkedWidthNode=o.linkedHeightNode=i,o.linkedWidthNode=t.linkedHeightNode=s,s.linkedWidthNode=i.linkedHeightNode=o):(s.linkedWidthNode=i.linkedHeightNode=t,o.linkedWidthNode=t.linkedHeightNode=i,t.linkedWidthNode=o.linkedHeightNode=s,i.linkedWidthNode=s.linkedHeightNode=o);const n=this.splitview.sashes[0],r=e.splitview.sashes[0];return n.linkedSash=r,r.linkedSash=n,this._onDidChange.fire(void 0),e._onDidChange.fire(void 0),ae(()=>{n.linkedSash=r.linkedSash=void 0,t.linkedHeightNode=t.linkedWidthNode=void 0,i.linkedHeightNode=i.linkedWidthNode=void 0,s.linkedHeightNode=s.linkedWidthNode=void 0,o.linkedHeightNode=o.linkedWidthNode=void 0})}updateSplitviewEdgeSnappingEnablement(){this.splitview.startSnappingEnabled=this._edgeSnapping||this._absoluteOrthogonalOffset>0,this.splitview.endSnappingEnabled=this._edgeSnapping||this._absoluteOrthogonalOffset+this._size<this.absoluteOrthogonalSize}dispose(){for(const e of this.children)e.dispose();this._onDidChange.dispose(),this._onDidSashReset.dispose(),this._onDidVisibilityChange.dispose(),this.childrenVisibilityChangeDisposable.dispose(),this.splitviewSashResetDisposable.dispose(),this.childrenSashResetDisposable.dispose(),this.childrenChangeDisposable.dispose(),this.onDidScrollDisposable.dispose(),this.splitview.dispose()}}function RT(a){const[e,t]=L.split(a.onDidChange,Er);return L.any(t,L.map(L.latch(L.map(e,i=>[a.minimumWidth,a.maximumWidth,a.minimumHeight,a.maximumHeight]),Bo),i=>{}))}class We{get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}get linkedWidthNode(){return this._linkedWidthNode}set linkedWidthNode(e){this._onDidLinkedWidthNodeChange.input=e?e._onDidViewChange:L.None,this._linkedWidthNode=e,this._onDidSetLinkedNode.fire(void 0)}get linkedHeightNode(){return this._linkedHeightNode}set linkedHeightNode(e){this._onDidLinkedHeightNodeChange.input=e?e._onDidViewChange:L.None,this._linkedHeightNode=e,this._onDidSetLinkedNode.fire(void 0)}constructor(e,t,i,s,o=0){this.view=e,this.orientation=t,this.layoutController=i,this._size=0,this.absoluteOffset=0,this.absoluteOrthogonalOffset=0,this.onDidScroll=L.None,this.onDidSashReset=L.None,this._onDidLinkedWidthNodeChange=new Rs,this._linkedWidthNode=void 0,this._onDidLinkedHeightNodeChange=new Rs,this._linkedHeightNode=void 0,this._onDidSetLinkedNode=new E,this.disposables=new O,this._boundarySashes={},this.cachedWidth=0,this.cachedHeight=0,this.cachedTop=0,this.cachedLeft=0,this._orthogonalSize=s,this._size=o;const n=RT(e);this._onDidViewChange=L.map(n,r=>r&&(this.orientation===Z.VERTICAL?r.width:r.height),this.disposables),this.onDidChange=L.any(this._onDidViewChange,this._onDidSetLinkedNode.event,this._onDidLinkedWidthNodeChange.event,this._onDidLinkedHeightNodeChange.event)}get width(){return this.orientation===Z.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===Z.HORIZONTAL?this.size:this.orthogonalSize}get top(){return this.orientation===Z.HORIZONTAL?this.absoluteOffset:this.absoluteOrthogonalOffset}get left(){return this.orientation===Z.HORIZONTAL?this.absoluteOrthogonalOffset:this.absoluteOffset}get element(){return this.view.element}get minimumWidth(){return this.linkedWidthNode?Math.max(this.linkedWidthNode.view.minimumWidth,this.view.minimumWidth):this.view.minimumWidth}get maximumWidth(){return this.linkedWidthNode?Math.min(this.linkedWidthNode.view.maximumWidth,this.view.maximumWidth):this.view.maximumWidth}get minimumHeight(){return this.linkedHeightNode?Math.max(this.linkedHeightNode.view.minimumHeight,this.view.minimumHeight):this.view.minimumHeight}get maximumHeight(){return this.linkedHeightNode?Math.min(this.linkedHeightNode.view.maximumHeight,this.view.maximumHeight):this.view.maximumHeight}get minimumSize(){return this.orientation===Z.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===Z.HORIZONTAL?this.maximumHeight:this.maximumWidth}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return this.view.snap}get minimumOrthogonalSize(){return this.orientation===Z.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===Z.HORIZONTAL?this.maximumWidth:this.maximumHeight}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.view.setBoundarySashes?.(xT(e,this.orientation))}layout(e,t,i){if(this.layoutController.isLayoutEnabled){if(typeof i>"u")throw new Error("Invalid state");this._size=e,this._orthogonalSize=i.orthogonalSize,this.absoluteOffset=i.absoluteOffset+t,this.absoluteOrthogonalOffset=i.absoluteOrthogonalOffset,this._layout(this.width,this.height,this.top,this.left)}}_layout(e,t,i,s){this.cachedWidth===e&&this.cachedHeight===t&&this.cachedTop===i&&this.cachedLeft===s||(this.cachedWidth=e,this.cachedHeight=t,this.cachedTop=i,this.cachedLeft=s,this.view.layout(e,t,i,s))}setVisible(e){this.view.setVisible?.(e)}dispose(){this.disposables.dispose()}}function uv(a,e,t){if(a instanceof _e){const i=new _e(Fi(a.orientation),a.layoutController,a.styles,a.splitviewProportionalLayout,e,t,a.edgeSnapping);let s=0;for(let o=a.children.length-1;o>=0;o--){const n=a.children[o],r=n instanceof _e?n.orthogonalSize:n.size;let d=a.size===0?0:Math.round(e*r/a.size);s+=d,o===0&&(d+=e-s),i.addChild(uv(n,t,d),d,0,!0)}return a.dispose(),i}else{const i=new We(a.view,Fi(a.orientation),a.layoutController,t);return a.dispose(),i}}class In{get root(){return this._root}set root(e){const t=this._root;t&&(t.element.remove(),t.dispose()),this._root=e,this.element.appendChild(e.element),this.onDidSashResetRelay.input=e.onDidSashReset,this._onDidChange.input=L.map(e.onDidChange,()=>{}),this._onDidScroll.input=e.onDidScroll}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get orientation(){return this._root.orientation}get boundarySashes(){return this._boundarySashes}set orientation(e){if(this._root.orientation===e)return;const{size:t,orthogonalSize:i,absoluteOffset:s,absoluteOrthogonalOffset:o}=this._root;this.root=uv(this._root,i,t),this.root.layout(t,0,{orthogonalSize:i,absoluteOffset:o,absoluteOrthogonalOffset:s,absoluteSize:t,absoluteOrthogonalSize:i}),this.boundarySashes=this.boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.root.boundarySashes=kT(e,this.orientation)}set edgeSnapping(e){this.root.edgeSnapping=e}constructor(e={}){this.onDidSashResetRelay=new Rs,this._onDidScroll=new Rs,this._onDidChange=new Rs,this._boundarySashes={},this.disposable2x2=R.None,this.onDidSashReset=this.onDidSashResetRelay.event,this.onDidScroll=this._onDidScroll.event,this.onDidChange=this._onDidChange.event,this.maximizedNode=void 0,this._onDidChangeViewMaximized=new E,this.onDidChangeViewMaximized=this._onDidChangeViewMaximized.event,this.element=M(".monaco-grid-view"),this.styles=e.styles||AT,this.proportionalLayout=typeof e.proportionalLayout<"u"?!!e.proportionalLayout:!0,this.layoutController=new TT(!1),this.root=new _e(Z.VERTICAL,this.layoutController,this.styles,this.proportionalLayout)}style(e){this.styles=e,this.root.style(e)}layout(e,t,i=0,s=0){this.layoutController.isLayoutEnabled=!0;const[o,n,r,d]=this.root.orientation===Z.HORIZONTAL?[t,e,i,s]:[e,t,s,i];this.root.layout(o,0,{orthogonalSize:n,absoluteOffset:r,absoluteOrthogonalOffset:d,absoluteSize:o,absoluteOrthogonalSize:n})}addView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView(),this.disposable2x2.dispose(),this.disposable2x2=R.None;const[s,o]=Ne(i),[n,r]=this.getNode(s);if(r instanceof _e){const d=new We(e,Fi(r.orientation),this.layoutController,r.orthogonalSize);try{r.addChild(d,t,o)}catch(l){throw d.dispose(),l}}else{const[,d]=Ne(n),[,l]=Ne(s);let h=0;const p=d.getChildCachedVisibleSize(l);typeof p=="number"&&(h=Ht.Invisible(p)),d.removeChild(l).dispose();const g=new _e(r.orientation,r.layoutController,this.styles,this.proportionalLayout,r.size,r.orthogonalSize,d.edgeSnapping);d.addChild(g,r.size,l);const m=new We(r.view,d.orientation,this.layoutController,r.size);g.addChild(m,h,0),typeof t!="number"&&t.type==="split"&&(t=Ht.Split(0));const v=new We(e,d.orientation,this.layoutController,r.size);g.addChild(v,t,o)}this.trySet2x2()}removeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView(),this.disposable2x2.dispose(),this.disposable2x2=R.None;const[i,s]=Ne(e),[o,n]=this.getNode(i);if(!(n instanceof _e))throw new Error("Invalid location");const r=n.children[s];if(!(r instanceof We))throw new Error("Invalid location");if(n.removeChild(s,t),r.dispose(),n.children.length===0)throw new Error("Invalid grid state");if(n.children.length>1)return this.trySet2x2(),r.view;if(o.length===0){const g=n.children[0];return g instanceof We||(n.removeChild(0),n.dispose(),this.root=g,this.boundarySashes=this.boundarySashes,this.trySet2x2()),r.view}const[,d]=Ne(o),[,l]=Ne(i),h=n.isChildVisible(0),p=n.removeChild(0),f=d.children.map((g,m)=>d.getChildSize(m));if(d.removeChild(l,t),n.dispose(),p instanceof _e){f.splice(l,1,...p.children.map(m=>m.size));const g=p.removeAllChildren();for(let m=0;m<g.length;m++)d.addChild(g[m],g[m].size,l+m)}else{const g=new We(p.view,Fi(p.orientation),this.layoutController,p.size),m=h?p.orthogonalSize:Ht.Invisible(p.orthogonalSize);d.addChild(g,m,l)}p.dispose();for(let g=0;g<f.length;g++)d.resizeChild(g,f[g]);return this.trySet2x2(),r.view}moveView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,s]=this.getNode(e);if(!(s instanceof _e))throw new Error("Invalid location");s.moveChild(t,i),this.trySet2x2()}swapViews(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=Ne(e),[,o]=this.getNode(i);if(!(o instanceof _e))throw new Error("Invalid from location");const n=o.getChildSize(s),r=o.children[s];if(!(r instanceof We))throw new Error("Invalid from location");const[d,l]=Ne(t),[,h]=this.getNode(d);if(!(h instanceof _e))throw new Error("Invalid to location");const p=h.getChildSize(l),f=h.children[l];if(!(f instanceof We))throw new Error("Invalid to location");o===h?o.swapChildren(s,l):(o.removeChild(s),h.removeChild(l),o.addChild(f,n,s),h.addChild(r,p,l)),this.trySet2x2()}resizeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=Ne(e),[o,n]=this.getNode(i);if(!(n instanceof _e))throw new Error("Invalid location");if(!t.width&&!t.height)return;const[r,d]=n.orientation===Z.HORIZONTAL?[t.width,t.height]:[t.height,t.width];if(typeof d=="number"&&o.length>0){const[,l]=Ne(o),[,h]=Ne(i);l.resizeChild(h,d)}typeof r=="number"&&n.resizeChild(s,r),this.trySet2x2()}getViewSize(e){if(!e)return{width:this.root.width,height:this.root.height};const[,t]=this.getNode(e);return{width:t.width,height:t.height}}getViewCachedVisibleSize(e){const[t,i]=Ne(e),[,s]=this.getNode(t);if(!(s instanceof _e))throw new Error("Invalid location");return s.getChildCachedVisibleSize(i)}expandView(e){this.hasMaximizedView()&&this.exitMaximizedView();const[t,i]=this.getNode(e);if(!(i instanceof We))throw new Error("Invalid location");for(let s=0;s<t.length;s++)t[s].resizeChild(e[s],Number.POSITIVE_INFINITY)}isViewExpanded(e){if(this.hasMaximizedView())return!1;const[t,i]=this.getNode(e);if(!(i instanceof We))throw new Error("Invalid location");for(let s=0;s<t.length;s++)if(!t[s].isChildExpanded(e[s]))return!1;return!0}maximizeView(e){const[,t]=this.getNode(e);if(!(t instanceof We))throw new Error("Location is not a LeafNode");if(this.maximizedNode===t)return;this.hasMaximizedView()&&this.exitMaximizedView();function i(s,o){for(let n=0;n<s.children.length;n++){const r=s.children[n];r instanceof We?r!==o&&s.setChildVisible(n,!1):i(r,o)}}i(this.root,t),this.maximizedNode=t,this._onDidChangeViewMaximized.fire(!0)}exitMaximizedView(){if(!this.maximizedNode)return;this.maximizedNode=void 0;function e(t){for(let i=t.children.length-1;i>=0;i--){const s=t.children[i];s instanceof We?t.setChildVisible(i,!0):e(s)}}e(this.root),this._onDidChangeViewMaximized.fire(!1)}hasMaximizedView(){return this.maximizedNode!==void 0}isViewMaximized(e){const[,t]=this.getNode(e);if(!(t instanceof We))throw new Error("Location is not a LeafNode");return t===this.maximizedNode}distributeViewSizes(e){if(this.hasMaximizedView()&&this.exitMaximizedView(),!e){this.root.distributeViewSizes(!0);return}const[,t]=this.getNode(e);if(!(t instanceof _e))throw new Error("Invalid location");t.distributeViewSizes(),this.trySet2x2()}isViewVisible(e){const[t,i]=Ne(e),[,s]=this.getNode(t);if(!(s instanceof _e))throw new Error("Invalid from location");return s.isChildVisible(i)}setViewVisible(e,t){if(this.hasMaximizedView()){this.exitMaximizedView();return}const[i,s]=Ne(e),[,o]=this.getNode(i);if(!(o instanceof _e))throw new Error("Invalid from location");o.setChildVisible(s,t)}getView(e){const t=e?this.getNode(e)[1]:this._root;return this._getViews(t,this.orientation)}static deserialize(e,t,i={}){if(typeof e.orientation!="number")throw new Error("Invalid JSON: 'orientation' property must be a number.");if(typeof e.width!="number")throw new Error("Invalid JSON: 'width' property must be a number.");if(typeof e.height!="number")throw new Error("Invalid JSON: 'height' property must be a number.");if(e.root?.type!=="branch")throw new Error("Invalid JSON: 'root' property must have 'type' value of branch.");const s=e.orientation,o=e.height,n=new In(i);return n._deserialize(e.root,s,t,o),n}_deserialize(e,t,i,s){this.root=this._deserializeNode(e,t,i,s)}_deserializeNode(e,t,i,s){let o;if(e.type==="branch"){const r=e.data.map(d=>({node:this._deserializeNode(d,Fi(t),i,e.size),visible:d.visible}));o=new _e(t,this.layoutController,this.styles,this.proportionalLayout,e.size,s,void 0,r)}else o=new We(i.fromJSON(e.data),t,this.layoutController,s,e.size),e.maximized&&!this.maximizedNode&&(this.maximizedNode=o,this._onDidChangeViewMaximized.fire(!0));return o}_getViews(e,t,i){const s={top:e.top,left:e.left,width:e.width,height:e.height};if(e instanceof We)return{view:e.view,box:s,cachedVisibleSize:i,maximized:this.maximizedNode===e};const o=[];for(let n=0;n<e.children.length;n++){const r=e.children[n],d=e.getChildCachedVisibleSize(n);o.push(this._getViews(r,Fi(t),d))}return{children:o,box:s}}getNode(e,t=this.root,i=[]){if(e.length===0)return[i,t];if(!(t instanceof _e))throw new Error("Invalid location");const[s,...o]=e;if(s<0||s>=t.children.length)throw new Error("Invalid location");const n=t.children[s];return i.push(t),this.getNode(o,n,i)}trySet2x2(){if(this.disposable2x2.dispose(),this.disposable2x2=R.None,this.root.children.length!==2)return;const[e,t]=this.root.children;!(e instanceof _e)||!(t instanceof _e)||(this.disposable2x2=e.trySet2x2(t))}getViewMap(e,t){t||(t=this.root),t instanceof _e?t.children.forEach(i=>this.getViewMap(e,i)):e.set(t.view,t.element)}dispose(){this.onDidSashResetRelay.dispose(),this.root.dispose(),this.element.remove()}}Pe(hv);var de;(function(a){a[a.Up=0]="Up",a[a.Down=1]="Down",a[a.Left=2]="Left",a[a.Right=3]="Right"})(de||(de={}));function LT(a){switch(a){case de.Up:return de.Down;case de.Down:return de.Up;case de.Left:return de.Right;case de.Right:return de.Left}}function po(a){return!!a.children}function pv(a,e){if(e.length===0)return a;if(!po(a))throw new Error("Invalid location");const[t,...i]=e;return pv(a.children[t],i)}function VT(a,e){return!(a.start>=e.end||e.start>=a.end)}function gv(a,e){const t=ng(e),i=e===de.Up?a.top:e===de.Right?a.left+a.width:e===de.Down?a.top+a.height:a.left,s={start:t===Z.HORIZONTAL?a.top:a.left,end:t===Z.HORIZONTAL?a.top+a.height:a.left+a.width};return{offset:i,range:s}}function PT(a,e,t){const i=[];function s(o,n,r){if(po(o))for(const d of o.children)s(d,n,r);else{const{offset:d,range:l}=gv(o.box,n);d===r.offset&&VT(l,r.range)&&i.push(o)}}return s(a,e,t),i}function uh(a,e){return e.length%2===0?Fi(a):a}function ng(a){return a===de.Up||a===de.Down?Z.VERTICAL:Z.HORIZONTAL}function Yf(a,e,t){const i=uh(a,e),s=ng(t);if(i===s){let[o,n]=Ne(e);return(t===de.Right||t===de.Down)&&(n+=1),[...o,n]}else{const o=t===de.Right||t===de.Down?1:0;return[...e,o]}}function MT(a){const e=a.parentElement;if(!e)throw new Error("Invalid grid element");let t=e.firstElementChild,i=0;for(;t!==a&&t!==e.lastElementChild&&t;)t=t.nextElementSibling,i++;return i}function fv(a){const e=a.parentElement;if(!e)throw new Error("Invalid grid element");if(/\bmonaco-grid-view\b/.test(e.className))return[];const t=MT(e),i=e.parentElement.parentElement.parentElement.parentElement;return[...fv(i),t]}var Dn;(function(a){a.Distribute={type:"distribute"},a.Split={type:"split"},a.Auto={type:"auto"};function e(t){return{type:"invisible",cachedVisibleSize:t}}a.Invisible=e})(Dn||(Dn={}));class OT extends R{get orientation(){return this.gridview.orientation}set orientation(e){this.gridview.orientation=e}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumWidth(){return this.gridview.minimumWidth}get minimumHeight(){return this.gridview.minimumHeight}get maximumWidth(){return this.gridview.maximumWidth}get maximumHeight(){return this.gridview.maximumHeight}get boundarySashes(){return this.gridview.boundarySashes}set boundarySashes(e){this.gridview.boundarySashes=e}set edgeSnapping(e){this.gridview.edgeSnapping=e}get element(){return this.gridview.element}constructor(e,t={}){super(),this.views=new Map,this.didLayout=!1,e instanceof In?(this.gridview=e,this.gridview.getViewMap(this.views)):this.gridview=new In(t),this._register(this.gridview),this._register(this.gridview.onDidSashReset(this.onDidSashReset,this)),e instanceof In||this._addView(e,0,[0]),this.onDidChange=this.gridview.onDidChange,this.onDidScroll=this.gridview.onDidScroll,this.onDidChangeViewMaximized=this.gridview.onDidChangeViewMaximized}style(e){this.gridview.style(e)}layout(e,t,i=0,s=0){this.gridview.layout(e,t,i,s),this.didLayout=!0}addView(e,t,i,s){if(this.views.has(e))throw new Error("Can't add same view twice");const o=ng(s);this.views.size===1&&this.orientation!==o&&(this.orientation=o);const n=this.getViewLocation(i),r=Yf(this.gridview.orientation,n,s);let d;if(typeof t=="number")d=t;else if(t.type==="split"){const[,l]=Ne(n);d=Ht.Split(l)}else if(t.type==="distribute")d=Ht.Distribute;else if(t.type==="auto"){const[,l]=Ne(n);d=Ht.Auto(l)}else d=t;this._addView(e,d,r)}addViewAt(e,t,i){if(this.views.has(e))throw new Error("Can't add same view twice");let s;typeof t=="number"?s=t:t.type==="distribute"?s=Ht.Distribute:s=t,this._addView(e,s,i)}_addView(e,t,i){this.views.set(e,e.element),this.gridview.addView(e,t,i)}removeView(e,t){if(this.views.size===1)throw new Error("Can't remove last view");const i=this.getViewLocation(e);let s;if(t?.type==="distribute")s=Ht.Distribute;else if(t?.type==="auto"){const o=i[i.length-1];s=Ht.Auto(o===0?1:o-1)}this.gridview.removeView(i,s),this.views.delete(e)}moveView(e,t,i,s){const o=this.getViewLocation(e),[n,r]=Ne(o),d=this.getViewLocation(i),l=Yf(this.gridview.orientation,d,s),[h,p]=Ne(l);Bo(n,h)?this.gridview.moveView(n,r,p):(this.removeView(e,typeof t=="number"?void 0:t),this.addView(e,t,i,s))}moveViewTo(e,t){const i=this.getViewLocation(e),[s,o]=Ne(i),[n,r]=Ne(t);if(Bo(s,n))this.gridview.moveView(s,o,r);else{const d=this.getViewSize(e),l=uh(this.gridview.orientation,i),h=this.getViewCachedVisibleSize(e),p=typeof h>"u"?l===Z.HORIZONTAL?d.width:d.height:Dn.Invisible(h);this.removeView(e),this.addViewAt(e,p,t)}}swapViews(e,t){const i=this.getViewLocation(e),s=this.getViewLocation(t);return this.gridview.swapViews(i,s)}resizeView(e,t){const i=this.getViewLocation(e);return this.gridview.resizeView(i,t)}isViewExpanded(e){const t=this.getViewLocation(e);return this.gridview.isViewExpanded(t)}isViewMaximized(e){const t=this.getViewLocation(e);return this.gridview.isViewMaximized(t)}hasMaximizedView(){return this.gridview.hasMaximizedView()}getViewSize(e){if(!e)return this.gridview.getViewSize();const t=this.getViewLocation(e);return this.gridview.getViewSize(t)}getViewCachedVisibleSize(e){const t=this.getViewLocation(e);return this.gridview.getViewCachedVisibleSize(t)}maximizeView(e){if(this.views.size<2)throw new Error("At least two views are required to maximize a view");const t=this.getViewLocation(e);this.gridview.maximizeView(t)}exitMaximizedView(){this.gridview.exitMaximizedView()}expandView(e){const t=this.getViewLocation(e);this.gridview.expandView(t)}distributeViewSizes(){this.gridview.distributeViewSizes()}isViewVisible(e){const t=this.getViewLocation(e);return this.gridview.isViewVisible(t)}setViewVisible(e,t){const i=this.getViewLocation(e);this.gridview.setViewVisible(i,t)}getViews(){return this.gridview.getView()}getNeighborViews(e,t,i=!1){if(!this.didLayout)throw new Error("Can't call getNeighborViews before first layout");const s=this.getViewLocation(e),o=this.getViews(),n=pv(o,s);let r=gv(n.box,t);return i&&(t===de.Up&&n.box.top===0?r={offset:o.box.top+o.box.height,range:r.range}:t===de.Right&&n.box.left+n.box.width===o.box.width?r={offset:0,range:r.range}:t===de.Down&&n.box.top+n.box.height===o.box.height?r={offset:0,range:r.range}:t===de.Left&&n.box.left===0&&(r={offset:o.box.left+o.box.width,range:r.range})),PT(o,LT(t),r).map(d=>d.view)}getViewLocation(e){const t=this.views.get(e);if(!t)throw new Error("View not found");return fv(t)}onDidSashReset(e){const t=o=>{const n=this.gridview.getView(o);if(po(n))return!1;const r=uh(this.orientation,o),d=r===Z.HORIZONTAL?n.view.preferredWidth:n.view.preferredHeight;if(typeof d!="number")return!1;const l=r===Z.HORIZONTAL?{width:Math.round(d)}:{height:Math.round(d)};return this.gridview.resizeView(o,l),!0};if(t(e))return;const[i,s]=Ne(e);t([...i,s+1])||this.gridview.distributeViewSizes(i)}}class ks extends OT{constructor(){super(...arguments),this.initialLayoutContext=!0}static serializeNode(e,t){const i=t===Z.VERTICAL?e.box.width:e.box.height;if(!po(e)){const o={type:"leaf",data:e.view.toJSON(),size:i};return typeof e.cachedVisibleSize=="number"?(o.size=e.cachedVisibleSize,o.visible=!1):e.maximized&&(o.maximized=!0),o}const s=e.children.map(o=>ks.serializeNode(o,Fi(t)));return s.some(o=>o.visible!==!1)?{type:"branch",data:s,size:i}:{type:"branch",data:s,size:i,visible:!1}}static deserialize(e,t,i={}){if(typeof e.orientation!="number")throw new Error("Invalid JSON: 'orientation' property must be a number.");if(typeof e.width!="number")throw new Error("Invalid JSON: 'width' property must be a number.");if(typeof e.height!="number")throw new Error("Invalid JSON: 'height' property must be a number.");const s=In.deserialize(e,t,i);return new ks(s,i)}static from(e,t={}){return ks.deserialize(bv(e),{fromJSON:i=>i},t)}serialize(){return{root:ks.serializeNode(this.getViews(),this.orientation),orientation:this.orientation,width:this.width,height:this.height}}layout(e,t,i=0,s=0){super.layout(e,t,i,s),this.initialLayoutContext&&(this.initialLayoutContext=!1,this.gridview.trySet2x2())}}function mv(a){return!!a.groups}function wv(a,e){if(!e&&a.groups&&a.groups.length<=1&&(a.groups=void 0),!mv(a))return;let t=0,i=0;for(const r of a.groups)wv(r,!1),r.size&&(t+=r.size,i++);const s=i>0?t:1,o=a.groups.length-i,n=s/o;for(const r of a.groups)r.size||(r.size=n)}function yv(a){return mv(a)?{type:"branch",data:a.groups.map(e=>yv(e)),size:a.size}:{type:"leaf",data:a.data,size:a.size}}function vv(a,e){if(a.type==="branch"){const t=a.data.map(i=>vv(i,Fi(e)));if(e===Z.VERTICAL){const i=a.size||(t.length===0?void 0:Math.max(...t.map(o=>o.width||0))),s=t.length===0?void 0:t.reduce((o,n)=>o+(n.height||0),0);return{width:i,height:s}}else{const i=t.length===0?void 0:t.reduce((o,n)=>o+(n.width||0),0),s=a.size||(t.length===0?void 0:Math.max(...t.map(o=>o.height||0)));return{width:i,height:s}}}else{const t=e===Z.VERTICAL?a.size:void 0,i=e===Z.VERTICAL?void 0:a.size;return{width:t,height:i}}}function bv(a){wv(a,!0);const e=yv(a),{width:t,height:i}=vv(e,a.orientation);return{root:e,orientation:a.orientation,width:t||1,height:i||1}}const NT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));let ph=class extends ub{constructor(e,t,i,s,o,n,r,d){super(e,t,o,i),this.storageService=i,this.instantiationService=s,this.contextMenuService=n,this.extensionService=r,this.contextService=d}create(e){super.create(e),this.viewPaneContainer=this._register(this.createViewPaneContainer(e)),this._register(this.viewPaneContainer.onTitleAreaUpdate(()=>this.updateTitleArea())),this.viewPaneContainer.create(e)}setVisible(e){super.setVisible(e),this.viewPaneContainer?.setVisible(e)}layout(e){this.viewPaneContainer?.layout(e)}setBoundarySashes(e){this.viewPaneContainer?.setBoundarySashes(e)}getOptimalWidth(){return this.viewPaneContainer?.getOptimalWidth()??0}openView(e,t){return this.viewPaneContainer?.openView(e,t)}getViewPaneContainer(){return this.viewPaneContainer}getActionsContext(){return this.getViewPaneContainer()?.getActionsContext()}getContextMenuActions(){return this.viewPaneContainer?.menuActions?.getContextMenuActions()??[]}getMenuIds(){const e=[];return this.viewPaneContainer?.menuActions&&(e.push(this.viewPaneContainer.menuActions.menuId),this.viewPaneContainer.isViewMergedWithContainer()&&e.push(this.viewPaneContainer.panes[0].menuActions.menuId)),e}getActions(){const e=[];if(this.viewPaneContainer?.menuActions&&(e.push(...this.viewPaneContainer.menuActions.getPrimaryActions()),this.viewPaneContainer.isViewMergedWithContainer())){const t=this.viewPaneContainer.panes[0];t.shouldShowFilterInHeader()&&e.push(pb),e.push(...t.menuActions.getPrimaryActions())}return e}getSecondaryActions(){if(!this.viewPaneContainer?.menuActions)return[];const e=this.viewPaneContainer.isViewMergedWithContainer()?this.viewPaneContainer.panes[0].menuActions.getSecondaryActions():[];let t=this.viewPaneContainer.menuActions.getSecondaryActions();const i=t.findIndex(s=>s instanceof gb&&s.item.submenu===Ip);if(i!==-1){const s=t[i];s.actions.some(({enabled:o})=>o)?t.length===1&&e.length===0?t=s.actions.slice():i!==0&&(t=[s,...t.slice(0,i),...t.slice(i+1)]):t.splice(i,1)}return t.length&&e.length?[...t,new hs,...e]:t.length?t:e}getActionViewItem(e,t){return this.viewPaneContainer?.getActionViewItem(e,t)}getTitle(){return this.viewPaneContainer?.getTitle()??""}focus(){super.focus(),this.viewPaneContainer?.focus()}};ph=D([u(1,mt),u(2,ce),u(3,F),u(4,me),u(5,at),u(6,At),u(7,bs)],ph);class rg extends hb{static create(e,t,i,s,o,n,r){return new rg(e,t,i,s,o,n,r)}constructor(e,t,i,s,o,n,r){super(e,t,i,s,o,n),this.iconUrl=r}}const Gi={Viewlets:"workbench.contributions.viewlets",Panels:"workbench.contributions.panels",Auxiliary:"workbench.contributions.auxiliary"};class ag extends fb{registerPaneComposite(e){super.registerComposite(e)}deregisterPaneComposite(e){super.deregisterComposite(e)}getPaneComposite(e){return this.getComposite(e)}getPaneComposites(){return this.getComposites()}}z.add(Gi.Viewlets,new ag);z.add(Gi.Panels,new ag);z.add(Gi.Auxiliary,new ag);const BT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Pe(BT);class FT extends Lm{constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m,v,C,T){super(C,T,d,t,s),this.notificationService=e,this.storageService=t,this.contextMenuService=i,this.keybindingService=o,this.hoverService=n,this.instantiationService=r,this.registry=l,this.activeCompositeSettingsKey=h,this.defaultCompositeId=p,this.nameForTelemetry=f,this.compositeCSSClass=g,this.titleForegroundColor=m,this.titleBorderColor=v,this.onDidCompositeOpen=this._register(new E),this.onDidCompositeClose=this._register(new E),this.mapCompositeToCompositeContainer=new Map,this.mapActionsBindingToComposite=new Map,this.instantiatedCompositeItems=new Map,this.actionsListener=this._register(new Ie),this.lastActiveCompositeId=t.get(h,H.WORKSPACE,this.defaultCompositeId),this.toolbarHoverDelegate=this._register(mb())}openComposite(e,t){if(this.activeComposite?.getId()===e)return t&&this.activeComposite.focus(),this.activeComposite;if(this.element)return this.doOpenComposite(e,t)}doOpenComposite(e,t=!1){const i=wb.nextId();this.currentCompositeOpenToken=i,this.activeComposite&&this.hideActiveComposite(),this.updateTitle(e);const s=this.createComposite(e,!0);if(!(this.currentCompositeOpenToken!==i||this.activeComposite&&this.activeComposite.getId()!==s.getId()))return this.activeComposite?.getId()===s.getId()?(t&&s.focus(),this.onDidCompositeOpen.fire({composite:s,focus:t}),s):(this.showComposite(s),t&&s.focus(),s&&this.onDidCompositeOpen.fire({composite:s,focus:t}),s)}createComposite(e,t){const i=this.instantiatedCompositeItems.get(e);if(i)return i.composite;const s=this.registry.getComposite(e);if(s){const o=this,n=new yb(Ee(this.progressBar),new class extends vb{constructor(){super(s.id,!!t),this._register(o.onDidCompositeOpen.event(h=>this.onScopeOpened(h.composite.getId()))),this._register(o.onDidCompositeClose.event(h=>this.onScopeClosed(h.getId())))}}),r=this._register(this.instantiationService.createChild(new ta([bb,n]))),d=s.instantiate(r),l=new O;return this.instantiatedCompositeItems.set(e,{composite:d,disposable:l,progress:n}),l.add(d.onTitleAreaUpdate(()=>this.onTitleAreaUpdate(d.getId()),this)),l.add(r),d}throw new Error(`Unable to find composite with id ${e}`)}showComposite(e){this.activeComposite=e;const t=this.activeComposite.getId();t!==this.defaultCompositeId?this.storageService.store(this.activeCompositeSettingsKey,t,H.WORKSPACE,Re.MACHINE):this.storageService.remove(this.activeCompositeSettingsKey,H.WORKSPACE),this.lastActiveCompositeId=this.activeComposite.getId();let i=this.mapCompositeToCompositeContainer.get(e.getId());if(i||(i=M(".composite"),i.classList.add(...this.compositeCSSClass.split(" ")),i.id=e.getId(),e.create(i),e.updateStyles(),this.mapCompositeToCompositeContainer.set(e.getId(),i)),!this.activeComposite||e.getId()!==this.activeComposite.getId())return;this.getContentArea()?.appendChild(i),ia(i);const o=Ee(this.toolBar);o.actionRunner=e.getActionRunner();const n=this.registry.getComposite(e.getId());n&&n.name!==e.getTitle()&&this.updateTitle(e.getId(),e.getTitle());let r=this.mapActionsBindingToComposite.get(e.getId());r||(r=this.collectCompositeActions(e),this.mapActionsBindingToComposite.set(e.getId(),r)),r(),this.actionsListener.value=o.actionRunner.onDidRun(d=>{d.error&&!Ec(d.error)&&this.notificationService.error(d.error)}),e.setVisible(!0),!(!this.activeComposite||e.getId()!==this.activeComposite.getId())&&(this.contentAreaSize&&e.layout(this.contentAreaSize),this.boundarySashes&&e.setBoundarySashes(this.boundarySashes))}onTitleAreaUpdate(e){const t=this.instantiatedCompositeItems.get(e);if(t&&this.updateTitle(e,t.composite.getTitle()),this.activeComposite?.getId()===e){const i=this.collectCompositeActions(this.activeComposite);this.mapActionsBindingToComposite.set(this.activeComposite.getId(),i),i()}else this.mapActionsBindingToComposite.delete(e)}updateTitle(e,t){const i=this.registry.getComposite(e);if(!i||!this.titleLabel)return;t||(t=i.name);const s=this.keybindingService.lookupKeybinding(e);this.titleLabel.updateTitle(e,t,s?.getLabel()??void 0),Ee(this.toolBar).setAriaLabel(c(2899,"{0} actions",t))}collectCompositeActions(e){const t=e?.getMenuIds(),i=e?.getActions().slice(0)||[],s=e?.getSecondaryActions().slice(0)||[],o=Ee(this.toolBar);return o.context=this.actionsContextProvider(),()=>o.setActions(Hn(i),Hn(s),t)}getActiveComposite(){return this.activeComposite}getLastActiveCompositeId(){return this.lastActiveCompositeId}hideActiveComposite(){if(!this.activeComposite)return;const e=this.activeComposite;this.activeComposite=void 0;const t=this.mapCompositeToCompositeContainer.get(e.getId());return e.setVisible(!1),t&&(t.remove(),sa(t)),this.progressBar?.stop().hide(),this.toolBar&&this.collectCompositeActions()(),this.onDidCompositeClose.fire(e),e}createTitleArea(e){const t=ge(e,M(".composite"));t.classList.add("title"),this.titleLabel=this.createTitleLabel(t);const i=ge(t,M(".title-actions"));return this.toolBar=this._register(this.instantiationService.createInstance(Dp,i,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Fo.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(2900,"Views and More Actions..."),telemetrySource:this.nameForTelemetry,hoverDelegate:this.toolbarHoverDelegate})),this.collectCompositeActions()(),t}createTitleLabel(e){const t=ge(e,M(".title-label")),i=ge(t,M("h2"));this.titleLabelElement=i;const s=this._register(this.hoverService.setupManagedHover(Ap("mouse"),i,"")),o=this;return{updateTitle:(n,r,d)=>{(!this.activeComposite||this.activeComposite.getId()===n)&&(i.innerText=r,s.update(d?c(2901,"{0} ({1})",r,d):r))},updateStyles:()=>{i.style.color=o.titleForegroundColor&&o.getColor(o.titleForegroundColor)||"";const n=o.titleBorderColor?o.getColor(o.titleBorderColor):void 0;e.style.borderBottom=n?`1px solid ${n}`:""}}}createHeaderArea(){return M(".composite")}createFooterArea(){return M(".composite")}updateStyles(){super.updateStyles(),Ee(this.titleLabel).updateStyles()}actionViewItemProvider(e,t){return this.activeComposite?this.activeComposite.getActionViewItem(e,t):Tp(this.instantiationService,e,t)}actionsContextProvider(){return this.activeComposite?this.activeComposite.getActionsContext():null}createContentArea(e){const t=ge(e,M(".content"));return this.progressBar=this._register(new Cb(t,Sb)),this.progressBar.hide(),t}getProgressIndicator(e){const t=this.instantiatedCompositeItems.get(e);return t?t.progress:void 0}getTitleAreaDropDownAnchorAlignment(){return Wl.RIGHT}layout(e,t,i,s){super.layout(e,t,i,s),this.contentAreaSize=jt.lift(super.layoutContents(e,t).contentSize),this.activeComposite?.layout(this.contentAreaSize)}setBoundarySashes(e){this.boundarySashes=e,this.activeComposite?.setBoundarySashes(e)}removeComposite(e){if(this.activeComposite?.getId()===e)return!1;this.mapCompositeToCompositeContainer.delete(e),this.mapActionsBindingToComposite.delete(e);const t=this.instantiatedCompositeItems.get(e);return t&&(t.composite.dispose(),je(t.disposable),this.instantiatedCompositeItems.delete(e)),!0}dispose(){this.mapCompositeToCompositeContainer.clear(),this.mapActionsBindingToComposite.clear(),this.instantiatedCompositeItems.forEach(e=>{e.composite.dispose(),je(e.disposable)}),this.instantiatedCompositeItems.clear(),super.dispose()}}var gh;Pe(NT);var fe;(function(a){a[a.TOP=0]="TOP",a[a.TITLE=1]="TITLE",a[a.BOTTOM=2]="BOTTOM"})(fe||(fe={}));var wo;let da=(wo=class extends FT{get snap(){return this.layoutService.isVisible(this.partId)||!!this.paneCompositeBar.value?.getVisiblePaneCompositeIds().length}get onDidPaneCompositeOpen(){return L.map(this.onDidCompositeOpen.event,e=>e.composite)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m,v,C,T,B,V,U,W){let K=Y.Sidebar,j=Gi.Viewlets,oe=w.SidebarTitle;e===P.PANEL_PART?(K=Y.Panel,j=Gi.Panels,oe=w.PanelTitle):e===P.AUXILIARYBAR_PART&&(K=Y.AuxiliaryBar,j=Gi.Auxiliary,oe=w.AuxiliaryBarTitle),super(h,p,f,g,m,v,C,T,z.as(j),i,B.getDefaultViewContainer(K)?.id||"",n,r,d,l,e,t),this.partId=e,this.activePaneContextKey=s,this.paneFocusContextKey=o,this.viewDescriptorService=B,this.contextKeyService=V,this.extensionService=U,this.menuService=W,this.onDidPaneCompositeClose=this.onDidCompositeClose.event,this.headerFooterCompositeBarDispoables=this._register(new O),this.paneCompositeBar=this._register(new Ie),this.compositeBarPosition=void 0,this.blockOpening=void 0,this.location=K,this.globalActions=this._register(this.instantiationService.createInstance(Vm,oe,void 0,void 0)),this.registerListeners()}registerListeners(){this._register(this.onDidPaneCompositeOpen(e=>this.onDidOpen(e))),this._register(this.onDidPaneCompositeClose(this.onDidClose,this)),this._register(this.globalActions.onDidChange(()=>this.updateGlobalToolbarActions())),this._register(this.registry.onDidDeregister(e=>{const t=this.viewDescriptorService.getViewContainersByLocation(this.location).filter(i=>this.viewDescriptorService.getViewContainerModel(i).activeViewDescriptors.length>0);if(t.length){if(this.getActiveComposite()?.getId()===e.id){const i=this.viewDescriptorService.getDefaultViewContainer(this.location)?.id,s=t.filter(o=>o.id===i)[0]||t[0];this.doOpenPaneComposite(s.id)}}else this.layoutService.setPartHidden(!0,this.partId);this.removeComposite(e.id)})),this._register(this.extensionService.onDidRegisterExtensions(()=>{this.layoutCompositeBar()}))}onDidOpen(e){this.activePaneContextKey.set(e.getId())}onDidClose(e){const t=e.getId();this.activePaneContextKey.get()===t&&this.activePaneContextKey.reset()}showComposite(e){super.showComposite(e),this.layoutCompositeBar(),this.layoutEmptyMessage()}hideActiveComposite(){const e=super.hideActiveComposite();return this.layoutCompositeBar(),this.layoutEmptyMessage(),e}create(e){this.element=e,this.element.classList.add("pane-composite-part"),super.create(e);const t=this.getContentArea();t&&this.createEmptyPaneMessage(t),this.updateCompositeBar();const i=this._register(zn(e));this._register(i.onDidFocus(()=>this.paneFocusContextKey.set(!0))),this._register(i.onDidBlur(()=>this.paneFocusContextKey.set(!1)))}createEmptyPaneMessage(e){this.emptyPaneMessageElement=M(".empty-pane-message-area");const t=M(".empty-pane-message");t.innerText=c(3434,"Drag a view here to display."),this.emptyPaneMessageElement.appendChild(t),e.appendChild(this.emptyPaneMessageElement);const i=s=>{const o=!this.getActiveComposite()||!s,n=s&&this.theme.getColor(Om)?.toString()||"";this.titleContainer&&o&&(this.titleContainer.style.backgroundColor=n),this.headerFooterCompositeBarContainer&&o&&(this.headerFooterCompositeBarContainer.style.backgroundColor=n),this.emptyPaneMessageElement.style.backgroundColor=n};this._register(md.INSTANCE.registerTarget(this.element,{onDragOver:s=>{if(ke.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);_b(s.eventData.dataTransfer,"move",o)}},onDragEnter:s=>{if(ke.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);i(o)}},onDragLeave:s=>{ke.stop(s.eventData,!0),i(!1)},onDragEnd:s=>{ke.stop(s.eventData,!0),i(!1)},onDrop:s=>{if(ke.stop(s.eventData,!0),i(!1),this.paneCompositeBar.value)this.paneCompositeBar.value.dndHandler.drop(s.dragAndDropData,void 0,s.eventData);else{const o=s.dragAndDropData.getData();if(o.type==="composite"){const n=this.viewDescriptorService.getViewContainerById(o.id);this.viewDescriptorService.moveViewContainerToLocation(n,this.location,void 0,"dnd"),this.openPaneComposite(n.id,!0)}else if(o.type==="view"){const n=this.viewDescriptorService.getViewDescriptorById(o.id);if(n&&n.canMoveView){this.viewDescriptorService.moveViewToLocation(n,this.location,"dnd");const r=this.viewDescriptorService.getViewContainerByViewId(n.id);this.openPaneComposite(r.id,!0).then(d=>{d?.openView(n.id,!0)})}}}}}))}createTitleArea(e){const t=super.createTitleArea(e);this._register(J(t,te.CONTEXT_MENU,s=>{this.onTitleAreaContextMenu(new $a(St(t),s))})),this._register(Eg.addTarget(t)),this._register(J(t,Ig.Contextmenu,s=>{this.onTitleAreaContextMenu(new $a(St(t),s))}));const i=t.appendChild(M(".global-actions"));return this.globalToolBar=this._register(this.instantiationService.createInstance(Dp,i,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Fo.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(3435,"More Actions..."),hoverDelegate:this.toolbarHoverDelegate,hiddenItemStrategy:Pm.NoHide})),this.updateGlobalToolbarActions(),t}createTitleLabel(e){this.titleContainer=e;const t=super.createTitleLabel(e);this.titleLabelElement.draggable=!0;const i=()=>({type:"composite",id:this.getActivePaneComposite().getId()});return this._register(md.INSTANCE.registerDraggable(this.titleLabelElement,i,{})),t}updateCompositeBar(e=!1){const t=this.compositeBarPosition!==void 0,i=this.shouldShowCompositeBar(),s=this.compositeBarPosition,o=i?this.getCompositeBarPosition():void 0;if(!e&&s===o)return;if(t){const r=s===fe.TITLE?this.titleContainer:this.headerFooterCompositeBarContainer;if(!this.paneCompositeBarContainer||!this.paneCompositeBar.value||!r)throw new Error("Composite bar containers should exist when removing the previous composite bar");this.paneCompositeBarContainer.remove(),this.paneCompositeBarContainer=void 0,this.paneCompositeBar.value=void 0,r.classList.remove("has-composite-bar"),s===fe.TOP?this.removeFooterHeaderArea(!0):s===fe.BOTTOM&&this.removeFooterHeaderArea(!1)}let n;switch(o){case fe.TOP:n=this.createHeaderArea();break;case fe.TITLE:n=this.titleContainer;break;case fe.BOTTOM:n=this.createFooterArea();break}if(i){if(this.paneCompositeBarContainer||this.paneCompositeBar.value||!n)throw new Error("Invalid composite bar state when creating the new composite bar");n.classList.add("has-composite-bar"),this.paneCompositeBarContainer=Mm(n,M(".composite-bar-container")),this.paneCompositeBar.value=this.createCompositeBar(),this.paneCompositeBar.value.create(this.paneCompositeBarContainer),o===fe.TOP?this.setHeaderArea(n):o===fe.BOTTOM&&this.setFooterArea(n)}this.compositeBarPosition=o,e&&this.layoutCompositeBar()}createHeaderArea(){const e=super.createHeaderArea();return this.createHeaderFooterCompositeBarArea(e)}createFooterArea(){const e=super.createFooterArea();return this.createHeaderFooterCompositeBarArea(e)}createHeaderFooterCompositeBarArea(e){if(this.headerFooterCompositeBarContainer)throw new Error("Header or Footer composite bar already exists");return this.headerFooterCompositeBarContainer=e,this.headerFooterCompositeBarDispoables.add(J(e,te.CONTEXT_MENU,t=>{this.onCompositeBarAreaContextMenu(new $a(St(e),t))})),this.headerFooterCompositeBarDispoables.add(Eg.addTarget(e)),this.headerFooterCompositeBarDispoables.add(J(e,Ig.Contextmenu,t=>{this.onCompositeBarAreaContextMenu(new $a(St(e),t))})),e}removeFooterHeaderArea(e){this.headerFooterCompositeBarContainer=void 0,this.headerFooterCompositeBarDispoables.clear(),e?this.removeHeaderArea():this.removeFooterArea()}createCompositeBar(){return this.instantiationService.createInstance(Eb,this.getCompositeBarOptions(),this.partId,this)}onTitleAreaUpdate(e){super.onTitleAreaUpdate(e),this.layoutCompositeBar()}async openPaneComposite(e,t){if(typeof e=="string"&&this.getPaneComposite(e))return this.doOpenPaneComposite(e,t);if(await this.extensionService.whenInstalledExtensionsRegistered(),typeof e=="string"&&this.getPaneComposite(e))return this.doOpenPaneComposite(e,t)}async doOpenPaneComposite(e,t){if(this.blockOpening)return this.blockOpening.p;let i;if(!this.layoutService.isVisible(this.partId))try{i=this.blockOpening=new Ko,this.layoutService.setPartHidden(!1,this.partId)}finally{this.blockOpening=void 0}try{const s=this.openComposite(e,t);return i?.complete(s),s}catch(s){throw i?.error(s),s}}getPaneComposite(e){return this.registry.getPaneComposite(e)}getPaneComposites(){return this.registry.getPaneComposites().sort((e,t)=>typeof e.order!="number"?1:typeof t.order!="number"?-1:e.order-t.order)}getPinnedPaneCompositeIds(){return this.paneCompositeBar.value?.getPinnedPaneCompositeIds()??[]}getVisiblePaneCompositeIds(){return this.paneCompositeBar.value?.getVisiblePaneCompositeIds()??[]}getPaneCompositeIds(){return this.paneCompositeBar.value?.getPaneCompositeIds()??[]}getActivePaneComposite(){return this.getActiveComposite()}getLastActivePaneCompositeId(){return this.getLastActiveCompositeId()}hideActivePaneComposite(){this.layoutService.isVisible(this.partId)&&this.layoutService.setPartHidden(!0,this.partId),this.hideActiveComposite()}focusCompositeBar(){this.paneCompositeBar.value?.focus()}layout(e,t,i,s){this.layoutService.isVisible(this.partId)&&(this.contentDimension=new jt(e,t),super.layout(this.contentDimension.width,this.contentDimension.height,i,s),this.layoutCompositeBar(),this.layoutEmptyMessage())}layoutCompositeBar(){if(this.contentDimension&&this.dimension&&this.paneCompositeBar.value){const e=this.compositeBarPosition===fe.TITLE?16:8,t=this.partId===P.PANEL_PART?0:1;let i=this.contentDimension.width-e-t;i=Math.max(gh.MIN_COMPOSITE_BAR_WIDTH,i-this.getToolbarWidth()),this.paneCompositeBar.value.layout(i,this.dimension.height)}}layoutEmptyMessage(){const e=!this.getActiveComposite();this.element.classList.toggle("empty",e),e&&this.titleLabel?.updateTitle("","")}updateGlobalToolbarActions(){const e=this.globalActions.getPrimaryActions(),t=this.globalActions.getSecondaryActions();this.globalToolBar?.setActions(Hn(e),Hn(t))}getToolbarWidth(){if(!this.toolBar||this.compositeBarPosition!==fe.TITLE||!this.getActivePaneComposite())return 0;const t=this.toolBar.getItemsWidth()+this.toolBar.getItemsLength()*4,i=this.globalToolBar?this.globalToolBar.getItemsWidth()+this.globalToolBar.getItemsLength()*4:0;return t+i+5}onTitleAreaContextMenu(e){if(this.shouldShowCompositeBar()&&this.getCompositeBarPosition()===fe.TITLE)return this.onCompositeBarContextMenu(e);{const t=this.getActivePaneComposite(),i=t?t.getContextMenuActions():[];i.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>i,getActionViewItem:(s,o)=>this.actionViewItemProvider(s,o),actionRunner:t.getActionRunner(),skipTelemetry:!0})}}onCompositeBarAreaContextMenu(e){return this.onCompositeBarContextMenu(e)}onCompositeBarContextMenu(e){if(this.paneCompositeBar.value){const t=[...this.paneCompositeBar.value.getContextMenuActions()];t.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>t,skipTelemetry:!0})}}getViewsSubmenuAction(){const e=this.getActivePaneComposite()?.getViewPaneContainer();if(e){const t=new O,i=t.add(this.contextKeyService.createScoped(this.element));i.createKey("viewContainer",e.viewContainer.id);const s=this.menuService.getMenuActions(Ip,i,{shouldForwardArgs:!0,renderShortTitle:!0}),o=Ib(s,()=>!0).primary;return t.dispose(),o.length>1&&o.some(n=>n.enabled)?new wd("views",c(3436,"Views"),o):void 0}}},gh=wo,wo.MIN_COMPOSITE_BAR_WIDTH=50,wo);da=gh=D([u(9,Ke),u(10,ce),u(11,at),u(12,He),u(13,it),u(14,Tt),u(15,F),u(16,me),u(17,Ye),u(18,se),u(19,At),u(20,Cs)],da);var fh;Pe(lv);var yo;let mh=(yo=class extends da{get snap(){return!0}get preferredWidth(){const e=this.getActivePaneComposite();if(!e)return;const t=e.getOptimalWidth();if(typeof t=="number")return Math.max(t,300)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g){super(P.SIDEBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(yd)||this.getColor($s)?1:0},fh.activeViewletSettingsKey,Db.bindTo(h),Ab.bindTo(h),"sideBar","viewlet",Tb,Nm,e,t,i,s,o,n,r,d,l,h,p,g),this.configurationService=f,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Vi.Low,this.activityBarPart=this._register(this.instantiationService.createInstance(qa,this)),this.rememberActivityBarVisiblePosition(),this._register(f.onDidChangeConfiguration(m=>{m.affectsConfiguration(Wt.ACTIVITY_BAR_LOCATION)&&this.onDidChangeActivityBarLocation()})),this.registerActions()}onDidChangeActivityBarLocation(){this.activityBarPart.hide(),this.updateCompositeBar();const e=this.getActiveComposite()?.getId();e&&this.onTitleAreaUpdate(e),this.shouldShowActivityBar()&&this.activityBarPart.show(),this.rememberActivityBarVisiblePosition()}updateStyles(){super.updateStyles();const e=Ee(this.getContainer());e.style.backgroundColor=this.getColor(Cn)||"",e.style.color=this.getColor(Bm)||"";const t=this.getColor(yd)||this.getColor($s),i=this.layoutService.getSideBarPosition()===Ot.LEFT;e.style.borderRightWidth=t&&i?"1px":"",e.style.borderRightStyle=t&&i?"solid":"",e.style.borderRightColor=i&&t||"",e.style.borderLeftWidth=t&&!i?"1px":"",e.style.borderLeftStyle=t&&!i?"solid":"",e.style.borderLeftColor=i?"":t||"",e.style.outlineColor=this.getColor(xb)??""}layout(e,t,i,s){this.layoutService.isVisible(P.SIDEBAR_PART)&&super.layout(e,t,i,s)}getTitleAreaDropDownAnchorAlignment(){return this.layoutService.getSideBarPosition()===Ot.LEFT?Wl.LEFT:Wl.RIGHT}createCompositeBar(){return this.instantiationService.createInstance(kb,this.getCompositeBarOptions(),this.partId,this,!1)}getCompositeBarOptions(){return{partContainerClass:"sidebar",pinnedViewContainersKey:qa.pinnedViewContainersKey,placeholderViewContainersKey:qa.placeholderViewContainersKey,viewContainersWorkspaceStateKey:qa.viewContainersWorkspaceStateKey,icon:!0,orientation:Fo.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===fe.BOTTOM?$n.ABOVE:$n.BELOW},fillExtraContextMenuActions:e=>{if(this.getCompositeBarPosition()===fe.TITLE){const t=this.getViewsSubmenuAction();t&&(e.push(new hs),e.push(t))}},compositeSize:0,iconSize:16,overflowActionSize:30,colors:e=>({activeBackgroundColor:e.getColor(Cn),inactiveBackgroundColor:e.getColor(Cn),activeBorderBottomColor:e.getColor(Hm),activeForegroundColor:e.getColor(Um),inactiveForegroundColor:e.getColor(Gm),badgeBackground:e.getColor(Wm),badgeForeground:e.getColor(Km),dragAndDropBorder:e.getColor(Fm)}),compact:!0}}shouldShowCompositeBar(){const e=this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION);return e===Oe.TOP||e===Oe.BOTTOM}shouldShowActivityBar(){return this.shouldShowCompositeBar()?!1:this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)!==Oe.HIDDEN}getCompositeBarPosition(){switch(this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)){case Oe.TOP:return fe.TOP;case Oe.BOTTOM:return fe.BOTTOM;case Oe.HIDDEN:case Oe.DEFAULT:default:return fe.TITLE}}rememberActivityBarVisiblePosition(){const e=this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION);e!==Oe.HIDDEN&&this.storageService.store(Wt.ACTIVITY_BAR_LOCATION,e,H.PROFILE,Re.USER)}getRememberedActivityBarVisiblePosition(){switch(this.storageService.get(Wt.ACTIVITY_BAR_LOCATION,H.PROFILE)){case Oe.TOP:return Oe.TOP;case Oe.BOTTOM:return Oe.BOTTOM;default:return Oe.DEFAULT}}getPinnedPaneCompositeIds(){return this.shouldShowCompositeBar()?super.getPinnedPaneCompositeIds():this.activityBarPart.getPinnedPaneCompositeIds()}getVisiblePaneCompositeIds(){return this.shouldShowCompositeBar()?super.getVisiblePaneCompositeIds():this.activityBarPart.getVisiblePaneCompositeIds()}getPaneCompositeIds(){return this.shouldShowCompositeBar()?super.getPaneCompositeIds():this.activityBarPart.getPaneCompositeIds()}async focusActivityBar(){this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)===Oe.HIDDEN&&(await this.configurationService.updateValue(Wt.ACTIVITY_BAR_LOCATION,this.getRememberedActivityBarVisiblePosition()),this.onDidChangeActivityBarLocation()),this.shouldShowCompositeBar()?this.focusCompositeBar():(this.layoutService.isVisible(P.ACTIVITYBAR_PART)||this.layoutService.setPartHidden(!1,P.ACTIVITYBAR_PART),this.activityBarPart.show(!0))}registerActions(){const e=this;this._register(b(class extends X{constructor(){super({id:Rb,title:x(3481,"Toggle Activity Bar Visibility")})}run(){const t=e.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)===Oe.HIDDEN?e.getRememberedActivityBarVisiblePosition():Oe.HIDDEN;return e.configurationService.updateValue(Wt.ACTIVITY_BAR_LOCATION,t)}}))}toJSON(){return{type:P.SIDEBAR_PART}}},fh=yo,yo.activeViewletSettingsKey="workbench.sidebar.activeviewletid",yo);mh=fh=D([u(0,Ke),u(1,ce),u(2,at),u(3,He),u(4,it),u(5,Tt),u(6,F),u(7,me),u(8,Ye),u(9,se),u(10,At),u(11,ie),u(12,Cs)],mh);let wh=class extends R{constructor(e,t,i){super(),this.viewId=e,this.viewDescriptorService=t,this.activityService=i,this.activity=void 0,this.activityDisposable=R.None,this._register(L.filter(this.viewDescriptorService.onDidChangeContainer,s=>s.views.some(o=>o.id===e))(()=>this.update())),this._register(L.filter(this.viewDescriptorService.onDidChangeLocation,s=>s.views.some(o=>o.id===e))(()=>this.update()))}setActivity(e){this.activity=e,this.update()}clearActivity(){this.activity=void 0,this.update()}update(){this.activityDisposable.dispose();const e=this.viewDescriptorService.getViewContainerByViewId(this.viewId);e&&this.activity&&(this.activityDisposable=this.activityService.showViewContainerActivity(e.id,this.activity))}dispose(){this.activityDisposable.dispose(),super.dispose()}};wh=D([u(1,Ye),u(2,Ys)],wh);let yh=class extends R{constructor(e,t){super(),this.viewDescriptorService=e,this.instantiationService=t,this.viewActivities=new Map,this._onDidChangeActivity=this._register(new E),this.onDidChangeActivity=this._onDidChangeActivity.event,this.viewContainerActivities=new Map,this.globalActivities=new Map}showViewContainerActivity(e,t){const i=this.viewDescriptorService.getViewContainerById(e);if(!i)return R.None;let s=this.viewContainerActivities.get(e);return s||(s=[],this.viewContainerActivities.set(e,s)),s.push(t),this._onDidChangeActivity.fire(i),ae(()=>{s.splice(s.indexOf(t),1),s.length===0&&this.viewContainerActivities.delete(e),this._onDidChangeActivity.fire(i)})}getViewContainerActivities(e){return this.viewDescriptorService.getViewContainerById(e)?this.viewContainerActivities.get(e)??[]:[]}showViewActivity(e,t){let i=this.viewActivities.get(e);i?i.id++:(i={id:1,activity:this.instantiationService.createInstance(wh,e)},this.viewActivities.set(e,i));const s=i.id;i.activity.setActivity(t);const o=i;return ae(()=>{o.id===s&&(o.activity.dispose(),this.viewActivities.delete(e))})}showAccountsActivity(e){return this.showActivity(Lb,e)}showGlobalActivity(e){return this.showActivity(Vb,e)}getActivity(e){return this.globalActivities.get(e)??[]}showActivity(e,t){let i=this.globalActivities.get(e);return i||(i=[],this.globalActivities.set(e,i)),i.push(t),this._onDidChangeActivity.fire(e),ae(()=>{i.splice(i.indexOf(t),1),i.length===0&&this.globalActivities.delete(e),this._onDidChangeActivity.fire(e)})}};yh=D([u(0,Ye),u(1,F)],yh);var vh;Pe(Fb);var vo;let bh=(vo=class extends da{get preferredHeight(){return this.layoutService.mainContainerDimension.height*.4}get preferredWidth(){const e=this.getActivePaneComposite();if(!e)return;const t=e.getOptimalWidth();if(typeof t=="number")return Math.max(t,300)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m){super(P.PANEL_PART,{hasTitle:!0},vh.activePanelSettingsKey,Pb.bindTo(h),Mb.bindTo(h),"panel","panel",void 0,Ob,e,t,i,s,o,n,r,d,l,h,p,g),this.commandService=f,this.configurationService=m,this.minimumWidth=300,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=77,this.maximumHeight=Number.POSITIVE_INFINITY,this._register(this.configurationService.onDidChangeConfiguration(v=>{v.affectsConfiguration("workbench.panel.showLabels")&&this.updateCompositeBar(!0)}))}updateStyles(){super.updateStyles();const e=Ee(this.getContainer());e.style.backgroundColor=this.getColor(ll)||"";const t=this.getColor(vd)||this.getColor($s)||"";e.style.borderLeftColor=t,e.style.borderRightColor=t,e.style.borderBottomColor=t;const i=this.getTitleArea();i&&(i.style.borderTopColor=this.getColor(vd)||this.getColor($s)||"")}getCompositeBarOptions(){return{partContainerClass:"panel",pinnedViewContainersKey:"workbench.panel.pinnedPanels",placeholderViewContainersKey:"workbench.panel.placeholderPanels",viewContainersWorkspaceStateKey:"workbench.panel.viewContainersWorkspaceState",icon:this.configurationService.getValue("workbench.panel.showLabels")===!1,orientation:Fo.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.layoutService.getPanelPosition()===Ot.BOTTOM&&!this.layoutService.isPanelMaximized()?$n.ABOVE:$n.BELOW},fillExtraContextMenuActions:e=>this.fillExtraContextMenuActions(e),compositeSize:0,iconSize:16,compact:!0,overflowActionSize:44,colors:e=>({activeBackgroundColor:e.getColor(ll),inactiveBackgroundColor:e.getColor(ll),activeBorderBottomColor:e.getColor(jm),activeForegroundColor:e.getColor(qm),inactiveForegroundColor:e.getColor($m),badgeBackground:e.getColor(Bb),badgeForeground:e.getColor(Nb),dragAndDropBorder:e.getColor(zm)})}}fillExtraContextMenuActions(e){if(this.getCompositeBarPosition()===fe.TITLE){const d=this.getViewsSubmenuAction();d&&(e.push(new hs),e.push(d))}const t=this.menuService.getMenuActions(w.PanelPositionMenu,this.contextKeyService,{shouldForwardArgs:!0}),i=this.menuService.getMenuActions(w.PanelAlignmentMenu,this.contextKeyService,{shouldForwardArgs:!0}),s=bd(t).secondary,o=bd(i).secondary,n=this.configurationService.getValue("workbench.panel.showLabels"),r=cs({id:"workbench.action.panel.toggleShowLabels",label:n?c(3474,"Show Icons"):c(3475,"Show Labels"),run:()=>this.configurationService.updateValue("workbench.panel.showLabels",!n)});e.push(new hs,new wd("workbench.action.panel.position",c(3476,"Panel Position"),s),new wd("workbench.action.panel.align",c(3477,"Align Panel"),o),r,cs({id:Dg.ID,label:c(3478,"Hide Panel"),run:()=>this.commandService.executeCommand(Dg.ID)}))}layout(e,t,i,s){let o;switch(this.layoutService.getPanelPosition()){case Ot.RIGHT:o=new jt(e-1,t);break;case Ot.TOP:o=new jt(e,t-1);break;default:o=new jt(e,t);break}super.layout(o.width,o.height,i,s)}shouldShowCompositeBar(){return!0}getCompositeBarPosition(){return fe.TITLE}toJSON(){return{type:P.PANEL_PART}}},vh=vo,vo.activePanelSettingsKey="workbench.panelpart.activepanelid",vo);bh=vh=D([u(0,Ke),u(1,ce),u(2,at),u(3,He),u(4,it),u(5,Tt),u(6,F),u(7,me),u(8,Ye),u(9,se),u(10,At),u(11,wt),u(12,Cs),u(13,ie)],bh);const KT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ch;Pe(KT);function Cv(a){return a.getValue("editor.dropIntoEditor.enabled")}function Sv(a){return a.shiftKey}var bo;let Sh=(bo=class extends Ym{get disposed(){return!!this._disposed}constructor(e,t,i,s,o,n,r,d){super(t),this.groupView=e,this.configurationService=i,this.instantiationService=s,this.editorService=o,this.editorGroupService=n,this.treeViewsDragAndDropService=r,this.contextService=d,this.editorTransfer=Sn.getInstance(),this.groupTransfer=Sn.getInstance(),this.treeItemsTransfer=Sn.getInstance(),this.cleanupOverlayScheduler=this._register(new Ca(()=>this.dispose(),300)),this.enableDropIntoEditor=Cv(this.configurationService)&&this.isDropIntoActiveEditorEnabled(),this.create()}create(){const e=this.getOverlayOffsetHeight(),t=this.container=M("div",{id:Ch.OVERLAY_ID});t.style.top=`${e}px`,this.groupView.element.appendChild(t),this.groupView.element.classList.add("dragged-over"),this._register(ae(()=>{t.remove(),this.groupView.element.classList.remove("dragged-over")})),this.overlay=M(".editor-group-overlay-indicator"),t.appendChild(this.overlay),this.enableDropIntoEditor&&(this.dropIntoPromptElement=Gb(c(3250,"Hold __{0}__ to drop into editor",ut?"⇧":"Shift"),{}),this.dropIntoPromptElement.classList.add("editor-group-overlay-drop-into-prompt"),this.overlay.appendChild(this.dropIntoPromptElement)),this.registerListeners(t),this.updateStyles()}updateStyles(){const e=Ee(this.overlay);e.style.backgroundColor=this.getColor(Om)||"";const t=this.getColor(Ub);if(e.style.outlineColor=t||"",e.style.outlineOffset=t?"-2px":"",e.style.outlineStyle=t?"dashed":"",e.style.outlineWidth=t?"2px":"",this.dropIntoPromptElement){this.dropIntoPromptElement.style.backgroundColor=this.getColor(Hb)??"",this.dropIntoPromptElement.style.color=this.getColor(zb)??"";const i=this.getColor($b);i?(this.dropIntoPromptElement.style.borderWidth="1px",this.dropIntoPromptElement.style.borderStyle="solid",this.dropIntoPromptElement.style.borderColor=i):this.dropIntoPromptElement.style.borderWidth="0"}}registerListeners(e){this._register(new qb(e,{onDragOver:t=>{if(this.enableDropIntoEditor&&Sv(t)){this.dispose();return}const i=this.groupTransfer.hasData(to.prototype),s=this.editorTransfer.hasData(Ds.prototype);!s&&!i&&t.dataTransfer&&(t.dataTransfer.dropEffect="copy");let o=!0;if(i)o=this.isCopyOperation(t);else if(s){const r=this.editorTransfer.getData(Ds.prototype);Array.isArray(r)&&r.length>0&&(o=this.isCopyOperation(t,r[0].identifier))}if(!o){const r=this.findSourceGroupView();if(r===this.groupView&&(i||s&&r.count<2)){this.hideOverlay();return}}let n=!!this.editorGroupService.partOptions.splitOnDragAndDrop;this.isToggleSplitOperation(t)&&(n=!n),this.positionOverlay(t.offsetX,t.offsetY,i,n),this.cleanupOverlayScheduler.isScheduled()&&this.cleanupOverlayScheduler.cancel()},onDragLeave:t=>this.dispose(),onDragEnd:t=>this.dispose(),onDrop:t=>{ke.stop(t,!0),this.dispose(),this.currentDropOperation&&this.handleDrop(t,this.currentDropOperation.splitDirection)}})),this._register(J(e,te.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}isDropIntoActiveEditorEnabled(){return!!this.groupView.activeEditor?.hasCapability(Ag.CanDropIntoEditor)}findSourceGroupView(){if(this.groupTransfer.hasData(to.prototype)){const e=this.groupTransfer.getData(to.prototype);if(Array.isArray(e)&&e.length>0)return this.editorGroupService.getGroup(e[0].identifier)}else if(this.editorTransfer.hasData(Ds.prototype)){const e=this.editorTransfer.getData(Ds.prototype);if(Array.isArray(e)&&e.length>0)return this.editorGroupService.getGroup(e[0].identifier.groupId)}}async handleDrop(e,t){const i=()=>{let s;return typeof t=="number"?s=this.editorGroupService.addGroup(this.groupView,t):s=this.groupView,s};if(this.groupTransfer.hasData(to.prototype)){const s=this.groupTransfer.getData(to.prototype);if(Array.isArray(s)&&s.length>0){const o=this.editorGroupService.getGroup(s[0].identifier);if(o){if(typeof t!="number"&&o===this.groupView)return;let n;if(typeof t=="number")this.isCopyOperation(e)?n=this.editorGroupService.copyGroup(o,this.groupView,t):n=this.editorGroupService.moveGroup(o,this.groupView,t);else{let r;this.isCopyOperation(e)&&(r={mode:Jm.COPY_EDITORS}),this.editorGroupService.mergeGroup(o,this.groupView,r)}n&&this.editorGroupService.activateGroup(n)}this.groupTransfer.clearData(to.prototype)}}else if(this.editorTransfer.hasData(Ds.prototype)){const s=this.editorTransfer.getData(Ds.prototype);if(Array.isArray(s)&&s.length>0){const o=s,n=s[0].identifier,r=this.editorGroupService.getGroup(n.groupId);if(r){const d=this.isCopyOperation(e,n);let l;if(this.editorGroupService.partOptions.closeEmptyGroups&&r.count===1&&typeof t=="number"&&!d)l=this.editorGroupService.moveGroup(r,this.groupView,t);else{if(l=i(),r===l)return;const h=jb(this.groupView,o.map(p=>p.identifier.editor));d?r.copyEditors(h,l):r.moveEditors(h,l)}l.focus()}this.editorTransfer.clearData(Ds.prototype)}}else if(this.treeItemsTransfer.hasData(ao.prototype)){const s=this.treeItemsTransfer.getData(ao.prototype);if(Array.isArray(s)&&s.length>0){const o=[];for(const n of s){const r=await this.treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(r){const d=await Yb(r);o.push(...d.map(l=>({...l,options:{...l.options,pinned:!0}})))}}o.length&&this.editorService.openEditors(o,i(),{validateTrust:!0})}this.treeItemsTransfer.clearData(ao.prototype)}else this.instantiationService.createInstance(Jb,{allowWorkspaceOpen:!Wo||Zb(this.contextService.getWorkspace())}).handleDrop(e,St(this.groupView.element),()=>i(),o=>o?.focus())}isCopyOperation(e,t){return t?.editor.hasCapability(Ag.Singleton)?!1:e.ctrlKey&&!ut||e.altKey&&ut}isToggleSplitOperation(e){return e.altKey&&!ut||e.shiftKey&&ut}positionOverlay(e,t,i,s){const o=this.editorGroupService.partOptions.openSideBySideDirection==="right",n=this.groupView.element.clientWidth,r=this.groupView.element.clientHeight-this.getOverlayOffsetHeight();let d,l;s?(i?d=o?.3:.1:d=.1,i?l=o?.1:.3:l=.1):(d=0,l=0);const h=n*d,p=r*l,f=n/3,g=r/3;let m;switch(e>h&&e<n-h&&t>p&&t<r-p?m=void 0:o?e<f?m=we.LEFT:e>f*2?m=we.RIGHT:t<r/2?m=we.UP:m=we.DOWN:t<g?m=we.UP:t>g*2?m=we.DOWN:e<n/2?m=we.LEFT:m=we.RIGHT,m){case we.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case we.DOWN:this.doPositionOverlay({top:"50%",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case we.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"}),this.toggleDropIntoPrompt(!1);break;case we.RIGHT:this.doPositionOverlay({top:"0",left:"50%",width:"50%",height:"100%"}),this.toggleDropIntoPrompt(!1);break;default:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"100%"}),this.toggleDropIntoPrompt(!0)}const v=Ee(this.overlay);v.style.opacity="1",setTimeout(()=>v.classList.add("overlay-move-transition"),0),this.currentDropOperation={splitDirection:m}}doPositionOverlay(e){const[t,i]=Xb(this.container,this.overlay),s=this.getOverlayOffsetHeight();s?t.style.height=`calc(100% - ${s}px)`:t.style.height="100%",i.style.top=e.top,i.style.left=e.left,i.style.width=e.width,i.style.height=e.height}getOverlayOffsetHeight(){return!this.groupView.isEmpty&&this.editorGroupService.partOptions.showTabs==="multiple"?this.groupView.titleHeight.offset:0}hideOverlay(){const e=Ee(this.overlay);this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"100%"}),e.style.opacity="0",e.classList.remove("overlay-move-transition"),this.currentDropOperation=void 0}toggleDropIntoPrompt(e){this.dropIntoPromptElement&&(this.dropIntoPromptElement.style.opacity=e?"1":"0")}contains(e){return e===this.container||e===this.overlay}dispose(){super.dispose(),this._disposed=!0}},Ch=bo,bo.OVERLAY_ID="monaco-workbench-editor-drop-overlay",bo);Sh=Ch=D([u(1,me),u(2,ie),u(3,F),u(4,Q),u(5,Je),u(6,Zm),u(7,bs)],Sh);let _h=class extends Ym{constructor(e,t,i,s,o,n){super(s),this.container=e,this.delegate=t,this.editorGroupService=i,this.configurationService=o,this.instantiationService=n,this.counter=0,this.editorTransfer=Sn.getInstance(),this.groupTransfer=Sn.getInstance(),this.registerListeners()}get overlay(){if(this._overlay&&!this._overlay.disposed)return this._overlay}registerListeners(){this._register(J(this.container,te.DRAG_ENTER,e=>this.onDragEnter(e))),this._register(J(this.container,te.DRAG_LEAVE,()=>this.onDragLeave()));for(const e of[this.container,St(this.container)])this._register(J(e,te.DRAG_END,()=>this.onDragEnd()))}onDragEnter(e){if(Cv(this.configurationService)&&Sv(e))return;if(this.counter++,!this.editorTransfer.hasData(Ds.prototype)&&!this.groupTransfer.hasData(to.prototype)&&e.dataTransfer){const i=z.as(Kb.DragAndDropContribution).getAll(),s=Array.from(i).map(o=>o.dataFormatKey);if(!Wb(e,Pr.FILES,Gl.FILES,Pr.RESOURCES,Gl.EDITORS,...s)){e.dataTransfer.dropEffect="none";return}}this.updateContainer(!0);const t=e.target;if(t&&(this.overlay&&!this.overlay.contains(t)&&this.disposeOverlay(),!this.overlay)){const i=this.findTargetGroupView(t);i&&(this._overlay=this.instantiationService.createInstance(Sh,i))}}onDragLeave(){this.counter--,this.counter===0&&this.updateContainer(!1)}onDragEnd(){this.counter=0,this.updateContainer(!1),this.disposeOverlay()}findTargetGroupView(e){return this.editorGroupService.groups.find(i=>Ul(e,i.element)||this.delegate.containsGroup?.(i))}updateContainer(e){this.container.classList.toggle("dragged-over",e)}dispose(){super.dispose(),this.disposeOverlay()}disposeOverlay(){this.overlay&&(this.overlay.dispose(),this._overlay=void 0)}};_h=D([u(2,Je),u(3,me),u(4,ie),u(5,F)],_h);const Sr={targetWidth:900,leftMarginRatio:.1909,rightMarginRatio:.1909},kl={type:"distribute"};function Jf(a){const e=M(".centered-layout-margin");return e.style.height="100%",a&&(e.style.backgroundColor=a.toString()),{element:e,layout:()=>{},minimumSize:60,maximumSize:Number.POSITIVE_INFINITY,onDidChange:L.None}}function WT(a,e){return{element:a.element,get maximumSize(){return a.maximumWidth},get minimumSize(){return a.minimumWidth},onDidChange:L.map(a.onDidChange,t=>t&&t.width),layout:(t,i,s)=>a.layout(t,e(),s?.top??0,(s?.left??0)+i)}}class GT{constructor(e,t,i={...Sr},s=!1){this.container=e,this.view=t,this.state=i,this.centeredLayoutFixedWidth=s,this.lastLayoutPosition={width:0,height:0,left:0,top:0},this.didLayout=!1,this.splitViewDisposables=new O,this._boundarySashes={},this.container.appendChild(this.view.element),this.container.style.overflow="hidden"}get minimumWidth(){return this.splitView?this.splitView.minimumSize:this.view.minimumWidth}get maximumWidth(){return this.splitView?this.splitView.maximumSize:this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get onDidChange(){return this.view.onDidChange}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.splitView&&(this.splitView.orthogonalStartSash=e.top,this.splitView.orthogonalEndSash=e.bottom)}layout(e,t,i,s){this.lastLayoutPosition={width:e,height:t,top:i,left:s},this.splitView?(this.splitView.layout(e,this.lastLayoutPosition),(!this.didLayout||this.centeredLayoutFixedWidth)&&this.resizeSplitViews()):this.view.layout(e,t,i,s),this.didLayout=!0}resizeSplitViews(){if(this.splitView)if(this.centeredLayoutFixedWidth){const e=Math.min(this.lastLayoutPosition.width,this.state.targetWidth),t=(this.lastLayoutPosition.width-e)/2;this.splitView.resizeView(0,Math.floor(t)),this.splitView.resizeView(1,e),this.splitView.resizeView(2,Math.ceil(t))}else{const e=this.state.leftMarginRatio*this.lastLayoutPosition.width,t=this.state.rightMarginRatio*this.lastLayoutPosition.width,i=this.lastLayoutPosition.width-e-t;this.splitView.resizeView(0,e),this.splitView.resizeView(1,i),this.splitView.resizeView(2,t)}}setFixedWidth(e){this.centeredLayoutFixedWidth=e,this.splitView&&(this.updateState(),this.resizeSplitViews())}updateState(){this.splitView&&(this.state.targetWidth=this.splitView.getViewSize(1),this.state.leftMarginRatio=this.splitView.getViewSize(0)/this.lastLayoutPosition.width,this.state.rightMarginRatio=this.splitView.getViewSize(2)/this.lastLayoutPosition.width)}isActive(){return!!this.splitView}styles(e){this.style=e,this.splitView&&this.emptyViews&&(this.splitView.style(this.style),this.emptyViews[0].element.style.backgroundColor=this.style.background.toString(),this.emptyViews[1].element.style.backgroundColor=this.style.background.toString())}activate(e){if(e!==this.isActive())if(e){this.view.element.remove(),this.splitView=new ea(this.container,{inverseAltBehavior:!0,orientation:Z.HORIZONTAL,styles:this.style}),this.splitView.orthogonalStartSash=this.boundarySashes.top,this.splitView.orthogonalEndSash=this.boundarySashes.bottom,this.splitViewDisposables.add(this.splitView.onDidSashChange(()=>{this.splitView&&this.updateState()})),this.splitViewDisposables.add(this.splitView.onDidSashReset(()=>{this.state={...Sr},this.resizeSplitViews()})),this.splitView.layout(this.lastLayoutPosition.width,this.lastLayoutPosition);const t=this.style?this.style.background:void 0;this.emptyViews=[Jf(t),Jf(t)],this.splitView.addView(this.emptyViews[0],kl,0),this.splitView.addView(WT(this.view,()=>this.lastLayoutPosition.height),kl,1),this.splitView.addView(this.emptyViews[1],kl,2),this.resizeSplitViews()}else this.splitView?.el.remove(),this.splitViewDisposables.clear(),this.splitView?.dispose(),this.splitView=void 0,this.emptyViews=void 0,this.container.appendChild(this.view.element),this.view.layout(this.lastLayoutPosition.width,this.lastLayoutPosition.height,this.lastLayoutPosition.top,this.lastLayoutPosition.left)}isDefault(e){return this.centeredLayoutFixedWidth?e.targetWidth===Sr.targetWidth:e.leftMarginRatio===Sr.leftMarginRatio&&e.rightMarginRatio===Sr.rightMarginRatio}dispose(){this.splitViewDisposables.dispose(),this.splitView&&(this.splitView.dispose(),this.splitView=void 0)}}var Xi;class UT{constructor(){this.element=M(".grid-view-container"),this._onDidChange=new Rs,this.onDidChange=this._onDidChange.event}get minimumWidth(){return this.gridWidget?this.gridWidget.minimumWidth:0}get maximumWidth(){return this.gridWidget?this.gridWidget.maximumWidth:Number.POSITIVE_INFINITY}get minimumHeight(){return this.gridWidget?this.gridWidget.minimumHeight:0}get maximumHeight(){return this.gridWidget?this.gridWidget.maximumHeight:Number.POSITIVE_INFINITY}get gridWidget(){return this._gridWidget}set gridWidget(e){this.element.innerText="",e?(this.element.appendChild(e.element),this._onDidChange.input=e.onDidChange):this._onDidChange.input=L.None,this._gridWidget=e}layout(e,t,i,s){this.gridWidget?.layout(e,t,i,s)}dispose(){this._onDidChange.dispose()}}var Ms;let Vd=(Ms=class extends Lm{constructor(e,t,i,s,o,n,r,d,l,h,p){super(t,{hasTitle:!1},n,d,l),this.editorPartsView=e,this.groupsLabel=i,this.windowId=s,this.instantiationService=o,this.configurationService=r,this.hostService=h,this.contextKeyService=p,this._onDidFocus=this._register(new E),this.onDidFocus=this._onDidFocus.event,this._onDidLayout=this._register(new E),this.onDidLayout=this._onDidLayout.event,this._onDidChangeActiveGroup=this._register(new E),this.onDidChangeActiveGroup=this._onDidChangeActiveGroup.event,this._onDidChangeGroupIndex=this._register(new E),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLabel=this._register(new E),this.onDidChangeGroupLabel=this._onDidChangeGroupLabel.event,this._onDidChangeGroupLocked=this._register(new E),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new E),this.onDidChangeGroupMaximized=this._onDidChangeGroupMaximized.event,this._onDidActivateGroup=this._register(new E),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidAddGroup=this._register(new Hl),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new Hl),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new E),this.onDidMoveGroup=this._onDidMoveGroup.event,this.onDidSetGridWidget=this._register(new E),this._onDidChangeSizeConstraints=this._register(new Rs),this.onDidChangeSizeConstraints=L.any(this.onDidSetGridWidget.event,this._onDidChangeSizeConstraints.event),this._onDidScroll=this._register(new Rs),this.onDidScroll=L.any(this.onDidSetGridWidget.event,this._onDidScroll.event),this._onDidChangeEditorPartOptions=this._register(new E),this.onDidChangeEditorPartOptions=this._onDidChangeEditorPartOptions.event,this._onWillDispose=this._register(new E),this.onWillDispose=this._onWillDispose.event,this.workspaceMemento=this.getMemento(H.WORKSPACE,Re.USER),this.profileMemento=this.getMemento(H.PROFILE,Re.MACHINE),this.groupViews=new Map,this.mostRecentActiveGroups=[],this.container=M(".content"),this.gridWidgetDisposables=this._register(new O),this.gridWidgetView=this._register(new UT),this.enforcedPartOptions=[],this.top=0,this.left=0,this.sideGroup={openEditor:(f,g)=>{const[m]=this.scopedInstantiationService.invokeFunction(v=>cv(v,{editor:f,options:g},Xm));return m.openEditor(f,g)}},this._isReady=!1,this.whenReadyPromise=new Ko,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Ko,this.whenRestored=this.whenRestoredPromise.p,this._willRestoreState=!1,this.priority=Vi.High,this.scopedContextKeyService=this._register(this.contextKeyService.createScoped(this.container)),this.scopedInstantiationService=this._register(this.instantiationService.createChild(new ta([se,this.scopedContextKeyService]))),this._partOptions=Tg(this.configurationService,this.themeService),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e))),this._register(this.themeService.onDidFileIconThemeChange(()=>this.handleChangedPartOptions())),this._register(this.onDidChangeMementoValue(H.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e)))}onConfigurationUpdated(e){Qb(e)&&this.handleChangedPartOptions()}handleChangedPartOptions(){const e=this._partOptions,t=Tg(this.configurationService,this.themeService);for(const i of this.enforcedPartOptions)Object.assign(t,i);this._partOptions=t,this._onDidChangeEditorPartOptions.fire({oldPartOptions:e,newPartOptions:t})}get partOptions(){return this._partOptions}enforcePartOptions(e){return this.enforcedPartOptions.push(e),this.handleChangedPartOptions(),ae(()=>{this.enforcedPartOptions.splice(this.enforcedPartOptions.indexOf(e),1),this.handleChangedPartOptions()})}get contentDimension(){return this._contentDimension}get activeGroup(){return this._activeGroup}get groups(){return Array.from(this.groupViews.values())}get count(){return this.groupViews.size}get orientation(){return this.gridWidget&&this.gridWidget.orientation===Z.VERTICAL?tn.VERTICAL:tn.HORIZONTAL}get isReady(){return this._isReady}get hasRestorableState(){return!!this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]}get willRestoreState(){return this._willRestoreState}getGroups(e=Ge.CREATION_TIME){switch(e){case Ge.CREATION_TIME:return this.groups;case Ge.MOST_RECENTLY_ACTIVE:{const t=Ss(this.mostRecentActiveGroups.map(i=>this.getGroup(i)));return Ls([...t,...this.groups])}case Ge.GRID_APPEARANCE:{const t=[];return this.gridWidget&&this.fillGridNodes(t,this.gridWidget.getViews()),t}}}fillGridNodes(e,t){po(t)?t.children.forEach(i=>this.fillGridNodes(e,i)):e.push(t.view)}hasGroup(e){return this.groupViews.has(e)}getGroup(e){return this.groupViews.get(e)}findGroup(e,t=this.activeGroup,i){if(typeof e.direction=="number")return this.doFindGroupByDirection(e.direction,t,i);if(typeof e.location=="number")return this.doFindGroupByLocation(e.location,t,i);throw new Error("invalid arguments")}doFindGroupByDirection(e,t,i){const s=this.assertGroupView(t),o=this.gridWidget.getNeighborViews(s,this.toGridViewDirection(e),i);return o.sort(((n,r)=>this.mostRecentActiveGroups.indexOf(n.id)-this.mostRecentActiveGroups.indexOf(r.id))),o[0]}doFindGroupByLocation(e,t,i){const s=this.assertGroupView(t),o=this.getGroups(Ge.GRID_APPEARANCE),n=o.indexOf(s);switch(e){case Nt.FIRST:return o[0];case Nt.LAST:return o[o.length-1];case Nt.NEXT:{let r=o[n+1];return!r&&i&&(r=this.doFindGroupByLocation(Nt.FIRST,t)),r}case Nt.PREVIOUS:{let r=o[n-1];return!r&&i&&(r=this.doFindGroupByLocation(Nt.LAST,t)),r}}}activateGroup(e,t){const i=this.assertGroupView(e);return this.doSetGroupActive(i),t||this.hostService.moveTop(St(this.element)),i}restoreGroup(e){const t=this.assertGroupView(e);return this.doRestoreGroup(t),t}getSize(e){const t=this.assertGroupView(e);return this.gridWidget.getViewSize(t)}setSize(e,t){const i=this.assertGroupView(e);this.gridWidget.resizeView(i,t)}arrangeGroups(e,t=this.activeGroup){if(this.count<2||!this.gridWidget)return;const i=this.assertGroupView(t);switch(e){case _s.EVEN:this.gridWidget.distributeViewSizes();break;case _s.MAXIMIZE:if(this.groups.length<2)return;this.gridWidget.maximizeView(i),i.focus();break;case _s.EXPAND:this.gridWidget.expandView(i);break}}toggleMaximizeGroup(e=this.activeGroup){this.hasMaximizedGroup()?this.unmaximizeGroup():this.arrangeGroups(_s.MAXIMIZE,e)}toggleExpandGroup(e=this.activeGroup){this.isGroupExpanded(this.activeGroup)?this.arrangeGroups(_s.EVEN):this.arrangeGroups(_s.EXPAND,e)}unmaximizeGroup(){this.gridWidget.exitMaximizedView(),this._activeGroup.focus()}hasMaximizedGroup(){return this.gridWidget.hasMaximizedView()}isGroupMaximized(e){return this.gridWidget.isViewMaximized(e)}isGroupExpanded(e){return this.gridWidget.isViewExpanded(e)}setGroupOrientation(e){if(!this.gridWidget)return;const t=e===tn.HORIZONTAL?Z.HORIZONTAL:Z.VERTICAL;this.gridWidget.orientation!==t&&(this.gridWidget.orientation=t)}applyLayout(e){const t=this.shouldRestoreFocus(this.container);let i=0;function s(d){for(const l of d)Array.isArray(l.groups)?s(l.groups):i++}s(e.groups);let o=this.getGroups(Ge.GRID_APPEARANCE);if(i<o.length){const d=o[i-1];o.forEach((l,h)=>{h>=i&&this.mergeGroup(l,d)}),o=this.getGroups(Ge.GRID_APPEARANCE)}const n=this.activeGroup,r=bv({orientation:this.toGridViewOrientation(e.orientation,this.isTwoDimensionalGrid()?this.gridWidget.orientation:Fi(this.gridWidget.orientation)),groups:e.groups});this.doApplyGridState(r,n.id,o),t&&this._activeGroup.focus()}getLayout(){const e=this.gridWidget.serialize(),t=e.orientation===Z.HORIZONTAL?tn.HORIZONTAL:tn.VERTICAL,i=this.serializedNodeToGroupLayoutArgument(e.root);return{orientation:t,groups:i.groups}}serializedNodeToGroupLayoutArgument(e){return e.type==="branch"?{size:e.size,groups:e.data.map(t=>this.serializedNodeToGroupLayoutArgument(t))}:{size:e.size}}shouldRestoreFocus(e){return e?Ic()===e.ownerDocument.body?!0:eC(e):!1}isTwoDimensionalGrid(){const e=this.gridWidget.getViews();return po(e)?e.children.some(t=>po(t)):!1}addGroup(e,t,i){const s=this.assertGroupView(e);let o;if(s.groupsView===this){const n=this.shouldRestoreFocus(s.element),r=this.groupViews.size>1&&this.isGroupExpanded(s);o=this.doCreateGroupView(i),this.gridWidget.addView(o,this.getSplitSizingStyle(),s,this.toGridViewDirection(t)),this.updateContainer(),this._onDidAddGroup.fire(o),this.notifyGroupIndexChange(),r&&this.arrangeGroups(_s.EXPAND,o),n&&s.focus()}else o=s.groupsView.addGroup(s,t,i);return o}getSplitSizingStyle(){switch(this._partOptions.splitSizing){case"distribute":return Dn.Distribute;case"split":return Dn.Split;default:return Dn.Auto}}doCreateGroupView(e,t){let i;e instanceof ja?i=ja.createCopy(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):tC(e)?i=ja.createFromSerialized(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):i=ja.createNew(this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t),this.groupViews.set(i.id,i);const s=new O;return s.add(i.onDidFocus(()=>{this.doSetGroupActive(i),this._onDidFocus.fire()})),s.add(i.onDidModelChange(o=>{switch(o.kind){case nd.GROUP_LOCKED:this._onDidChangeGroupLocked.fire(i);break;case nd.GROUP_INDEX:this._onDidChangeGroupIndex.fire(i);break;case nd.GROUP_LABEL:this._onDidChangeGroupLabel.fire(i);break}})),s.add(i.onDidActiveEditorChange(()=>{this.updateContainer()})),L.once(i.onWillDispose)(()=>{je(s),this.groupViews.delete(i.id),this.doUpdateMostRecentActive(i)}),i}doSetGroupActive(e){if(this._activeGroup!==e){const t=this._activeGroup;this._activeGroup=e,this.doUpdateMostRecentActive(e,!0),t&&!t.disposed&&t.setActive(!1),e.setActive(!0),this.doRestoreGroup(e),this._onDidChangeActiveGroup.fire(e)}this._onDidActivateGroup.fire(e)}doRestoreGroup(e){if(this.gridWidget)try{this.hasMaximizedGroup()&&!this.isGroupMaximized(e)&&this.unmaximizeGroup();const t=this.gridWidget.getViewSize(e);(t.width===e.minimumWidth||t.height===e.minimumHeight)&&this.arrangeGroups(_s.EXPAND,e)}catch{}}doUpdateMostRecentActive(e,t){const i=this.mostRecentActiveGroups.indexOf(e.id);i!==-1&&this.mostRecentActiveGroups.splice(i,1),t&&this.mostRecentActiveGroups.unshift(e.id)}toGridViewDirection(e){switch(e){case we.UP:return de.Up;case we.DOWN:return de.Down;case we.LEFT:return de.Left;case we.RIGHT:return de.Right}}toGridViewOrientation(e,t){return typeof e=="number"?e===tn.HORIZONTAL?Z.HORIZONTAL:Z.VERTICAL:t}removeGroup(e,t){const i=this.assertGroupView(e);this.count!==1&&(i.isEmpty?this.doRemoveEmptyGroup(i,t):this.doRemoveGroupWithEditors(i))}doRemoveGroupWithEditors(e){const t=this.getGroups(Ge.MOST_RECENTLY_ACTIVE);let i;this._activeGroup===e?i=t[1]:i=t[0],this.mergeGroup(e,i)}doRemoveEmptyGroup(e,t){const i=!t&&this.shouldRestoreFocus(this.container);if(this._activeGroup===e){const o=this.getGroups(Ge.MOST_RECENTLY_ACTIVE)[1];this.doSetGroupActive(o)}this.gridWidget.removeView(e,this.getSplitSizingStyle()),e.dispose(),i&&this._activeGroup.focus(),this.notifyGroupIndexChange(),this.updateContainer(),this._onDidRemoveGroup.fire(e)}moveGroup(e,t,i){const s=this.assertGroupView(e),o=this.assertGroupView(t);if(s.id===o.id)throw new Error("Cannot move group into its own");const n=this.shouldRestoreFocus(s.element);let r;return s.groupsView===o.groupsView?(this.gridWidget.moveView(s,this.getSplitSizingStyle(),o,this.toGridViewDirection(i)),r=s):(r=o.groupsView.addGroup(o,i,s),s.closeAllEditors(),this.removeGroup(s,n)),n&&r.focus(),this._onDidMoveGroup.fire(r),this.notifyGroupIndexChange(),r}copyGroup(e,t,i){const s=this.assertGroupView(e),o=this.assertGroupView(t),n=this.shouldRestoreFocus(s.element),r=this.addGroup(o,i,s);return n&&r.focus(),r}mergeGroup(e,t,i){const s=this.assertGroupView(e),o=this.assertGroupView(t),n=[];let r=i&&typeof i.index=="number"?i.index:o.count;for(const l of s.editors){const h=!s.isActive(l)||this._activeGroup!==s;let p;o.contains(l)&&(o.isSticky(l)||i?.preserveExistingIndex)||(p=r,r++),n.push({editor:l,options:{index:p,inactive:h,preserveFocus:h}})}let d=!0;return i?.mode===Jm.COPY_EDITORS?s.copyEditors(n,o):d=s.moveEditors(n,o),s.isEmpty&&!s.disposed&&this.removeGroup(s,!0),d}mergeAllGroups(e,t){const i=this.assertGroupView(e);let s=!0;for(const o of this.getGroups(Ge.MOST_RECENTLY_ACTIVE)){if(o===i)continue;this.mergeGroup(o,i,t)||(s=!1)}return s}assertGroupView(e){let t;if(typeof e=="number"?t=this.editorPartsView.getGroup(e):t=e,!t)throw new Error("Invalid editor group provided!");return t}createEditorDropTarget(e,t){return iC(qn(e)),this.scopedInstantiationService.createInstance(_h,e,t)}get minimumWidth(){return Math.min(this.centeredLayoutWidget.minimumWidth,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(St(this.container))).width)}get maximumWidth(){return this.centeredLayoutWidget.maximumWidth}get minimumHeight(){return Math.min(this.centeredLayoutWidget.minimumHeight,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(St(this.container))).height)}get maximumHeight(){return this.centeredLayoutWidget.maximumHeight}get snap(){return this.layoutService.getPanelAlignment()==="center"}get onDidChange(){return L.any(this.centeredLayoutWidget.onDidChange,this.onDidSetGridWidget.event)}get gridSeparatorBorder(){return this.theme.getColor(sC)||this.theme.getColor($s)||oi.transparent}updateStyles(){this.container.style.backgroundColor=this.getColor(oC)||"";const e={separatorBorder:this.gridSeparatorBorder,background:this.theme.getColor(nC)||oi.transparent};this.gridWidget.style(e),this.centeredLayoutWidget.styles(e)}createContentArea(e,t){return this.element=e,this.windowId!==re.vscodeWindowId&&this.container.classList.add("auxiliary"),e.appendChild(this.container),this._willRestoreState=!t||t.restorePreviousState,this.doCreateGridControl(),this.centeredLayoutWidget=this._register(new GT(this.container,this.gridWidgetView,this.profileMemento[Xi.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY],this._partOptions.centeredLayoutFixedWidth)),this._register(this.onDidChangeEditorPartOptions(i=>this.centeredLayoutWidget.setFixedWidth(i.newPartOptions.centeredLayoutFixedWidth??!1))),this.setupDragAndDropSupport(e,this.container),this.handleContextKeys(),this.whenReadyPromise.complete(),this._isReady=!0,xp.settled(this.groups.map(i=>i.whenRestored)).finally(()=>{this.whenRestoredPromise.complete()}),this.container}handleContextKeys(){Js.bindTo(this.scopedContextKeyService).set(this.windowId!==re.vscodeWindowId);const t=kp.bindTo(this.scopedContextKeyService),i=Rp.bindTo(this.scopedContextKeyService),s=()=>{this.count>1?t.set(!0):t.reset(),this.hasMaximizedGroup()?i.set(!0):i.reset()};s(),this._register(this.onDidAddGroup(()=>s())),this._register(this.onDidRemoveGroup(()=>s())),this._register(this.onDidChangeGroupMaximized(()=>s()))}setupDragAndDropSupport(e,t){this._register(this.createEditorDropTarget(t,Object.create(null)));const i=M(".drop-block-overlay");e.appendChild(i),this._register(rC(i,()=>i.classList.remove("visible"))),this._register(md.INSTANCE.registerTarget(this.element,{onDragStart:h=>i.classList.add("visible"),onDragEnd:h=>i.classList.remove("visible")}));let s,o,n,r;const d=h=>{!this.layoutService.isVisible(P.PANEL_PART)&&h===this.layoutService.getPanelPosition()?this.layoutService.setPartHidden(!1,P.PANEL_PART):!this.layoutService.isVisible(P.AUXILIARYBAR_PART)&&h===(this.layoutService.getSideBarPosition()===Ot.RIGHT?Ot.LEFT:Ot.RIGHT)&&this.layoutService.setPartHidden(!1,P.AUXILIARYBAR_PART)},l=()=>{s&&(clearTimeout(s),s=void 0),o&&(clearTimeout(o),o=void 0)};this._register(md.INSTANCE.registerTarget(i,{onDragOver:h=>{ke.stop(h.eventData,!0),h.eventData.dataTransfer&&(h.eventData.dataTransfer.dropEffect="none");const p=i.getBoundingClientRect();let f,g;const m=100;h.eventData.clientX<p.left+m&&(f=Ot.LEFT),h.eventData.clientX>p.right-m&&(f=Ot.RIGHT),h.eventData.clientY>p.bottom-m&&(g=Ot.BOTTOM),h.eventData.clientY<p.top+m&&(g=Ot.TOP),s&&f!==n&&(clearTimeout(s),s=void 0),o&&g!==r&&(clearTimeout(o),o=void 0),!s&&f!==void 0&&(n=f,s=setTimeout(()=>d(f),200)),!o&&g!==void 0&&(r=g,o=setTimeout(()=>d(g),200))},onDragLeave:()=>l(),onDragEnd:()=>l(),onDrop:()=>l()}))}centerLayout(e){this.centeredLayoutWidget.activate(e)}isLayoutCentered(){return this.centeredLayoutWidget?this.centeredLayoutWidget.isActive():!1}doCreateGridControl(){let e=!1;if(this._willRestoreState&&(e=!this.doCreateGridControlWithPreviousState()),!this.gridWidget||e){const t=this.doCreateGroupView();this.doSetGridWidget(new ks(t)),this.doSetGroupActive(t)}this.updateContainer(),this.notifyGroupIndexChange()}doCreateGridControlWithPreviousState(){const e=this.loadState();if(e?.serializedGrid)try{this.mostRecentActiveGroups=e.mostRecentActiveGroups,this.doCreateGridControlWithState(e.serializedGrid,e.activeGroup)}catch(t){return jn(new Error(`Error restoring editor grid widget: ${t} (with state: ${JSON.stringify(e)})`)),this.disposeGroups(),!1}return!0}doCreateGridControlWithState(e,t,i,s){let o;i?o=i.slice(0):o=[];const n=[],r=ks.deserialize(e,{fromJSON:d=>{let l;return o.length>0?l=o.shift():l=this.doCreateGroupView(d,s),n.push(l),l.id===t&&this.doSetGroupActive(l),l}},{styles:{separatorBorder:this.gridSeparatorBorder}});this._activeGroup||this.doSetGroupActive(n[0]),this.mostRecentActiveGroups.some(d=>!this.getGroup(d))&&(this.mostRecentActiveGroups=n.map(d=>d.id)),this.doSetGridWidget(r)}doSetGridWidget(e){let t={};this.gridWidget&&(t=this.gridWidget.boundarySashes,this.gridWidget.dispose()),this.gridWidget=e,this.gridWidget.boundarySashes=t,this.gridWidgetView.gridWidget=e,this._onDidChangeSizeConstraints.input=e.onDidChange,this._onDidScroll.input=e.onDidScroll,this.gridWidgetDisposables.clear(),this.gridWidgetDisposables.add(e.onDidChangeViewMaximized(i=>this._onDidChangeGroupMaximized.fire(i))),this.onDidSetGridWidget.fire(void 0)}updateContainer(){this.container.classList.toggle("empty",this.isEmpty)}notifyGroupIndexChange(){this.getGroups(Ge.GRID_APPEARANCE).forEach((e,t)=>e.notifyIndexChanged(t))}notifyGroupsLabelChange(e){for(const t of this.groups)t.notifyLabelChanged(e)}get isEmpty(){return this.count===1&&this._activeGroup.isEmpty}setBoundarySashes(e){this.gridWidget.boundarySashes=e,this.centeredLayoutWidget.boundarySashes=e}layout(e,t,i,s){this.top=i,this.left=s;const o=super.layoutContents(e,t).contentSize;this.doLayout(jt.lift(o),i,s)}doLayout(e,t=this.top,i=this.left){this._contentDimension=e,this.centeredLayoutWidget.layout(this._contentDimension.width,this._contentDimension.height,t,i),this._onDidLayout.fire(e)}saveState(){if(this.gridWidget&&(this.isEmpty?delete this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]:this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]=this.createState()),this.centeredLayoutWidget){const e=this.centeredLayoutWidget.state;this.centeredLayoutWidget.isDefault(e)?delete this.profileMemento[Xi.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]:this.profileMemento[Xi.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]=e}super.saveState()}loadState(){return this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]}createState(){return{serializedGrid:this.gridWidget.serialize(),activeGroup:this._activeGroup.id,mostRecentActiveGroups:this.mostRecentActiveGroups}}applyState(e,t){return e==="empty"?this.doApplyEmptyState():this.doApplyState(e,t)}async doApplyState(e,t){const i=await this.doPrepareApplyState();this._onDidAddGroup.pause(),this._onDidRemoveGroup.pause(),this.disposeGroups(),this.mostRecentActiveGroups=e.mostRecentActiveGroups;try{this.doApplyGridState(e.serializedGrid,e.activeGroup,void 0,t)}finally{this._onDidRemoveGroup.resume(),this._onDidAddGroup.resume()}await this.activeGroup.openEditors(i.flatMap(s=>s.editors).filter(s=>this.editorPartsView.groups.every(o=>!o.contains(s))).map(s=>({editor:s,options:{pinned:!0,preserveFocus:!0,inactive:!0}})))}async doApplyEmptyState(){await this.doPrepareApplyState(),this.mergeAllGroups(this.activeGroup)}async doPrepareApplyState(){const e=this.getGroups(Ge.MOST_RECENTLY_ACTIVE);for(const t of e)await t.closeAllEditors({excludeConfirming:!0});return e}doApplyGridState(e,t,i,s){this.doCreateGridControlWithState(e,t,i,s),this.doLayout(this._contentDimension),this.updateContainer();for(const o of this.getGroups(Ge.GRID_APPEARANCE))i?.includes(o)||this._onDidAddGroup.fire(o);this.notifyGroupIndexChange()}onDidChangeMementoState(e){if(e.external&&e.scope===H.WORKSPACE){this.reloadMemento(e.scope);const t=this.loadState();t&&this.applyState(t)}}toJSON(){return{type:P.EDITOR_PART}}disposeGroups(){for(const e of this.groups)e.dispose(),this._onDidRemoveGroup.fire(e);this.groupViews.clear(),this.mostRecentActiveGroups=[]}dispose(){this._onWillDispose.fire(),this.disposeGroups(),this.gridWidget?.dispose(),super.dispose()}},Xi=Ms,Ms.EDITOR_PART_UI_STATE_STORAGE_KEY="editorpart.state",Ms.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY="editorpart.centeredview",Ms);Vd=Xi=D([u(4,F),u(5,me),u(6,ie),u(7,ce),u(8,He),u(9,Zt),u(10,se)],Vd);let Eh=class extends Vd{constructor(e,t,i,s,o,n,r,d){super(e,P.EDITOR_PART,"",re.vscodeWindowId,t,i,s,o,n,r,d)}};Eh=D([u(1,F),u(2,me),u(3,ie),u(4,ce),u(5,He),u(6,Zt),u(7,se)],Eh);const HT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var on;Pe(HT);var Mi;let Ih=(Mi=class extends da{get preferredHeight(){return this.layoutService.mainContainerDimension.height*.4}get preferredWidth(){const e=this.getActivePaneComposite();if(!e)return;const t=e.getOptimalWidth();if(typeof t=="number")return Math.max(t,300)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m){super(P.AUXILIARYBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(yd)||this.getColor($s)?1:0},on.activeViewSettingsKey,aC.bindTo(h),dC.bindTo(h),"auxiliarybar","auxiliarybar",void 0,Nm,e,t,i,s,o,n,r,d,l,h,p,g),this.commandService=f,this.configurationService=m,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Vi.Low,this.configuration=this.resolveConfiguration(),this._register(m.onDidChangeConfiguration(v=>{v.affectsConfiguration(Wt.ACTIVITY_BAR_LOCATION)?(this.configuration=this.resolveConfiguration(),this.onDidChangeActivityBarLocation()):v.affectsConfiguration("workbench.secondarySideBar.showLabels")&&(this.configuration=this.resolveConfiguration(),this.updateCompositeBar(!0))}))}resolveConfiguration(){const e=this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION),t=e!==Oe.TOP,i=t&&this.configurationService.getValue("workbench.secondarySideBar.showLabels")!==!1;return{position:e,canShowLabels:t,showLabels:i}}onDidChangeActivityBarLocation(){this.updateCompositeBar();const e=this.getActiveComposite()?.getId();e&&this.onTitleAreaUpdate(e)}updateStyles(){super.updateStyles();const e=Ee(this.getContainer());e.style.backgroundColor=this.getColor(Cn)||"";const t=this.getColor(yd)||this.getColor($s),i=this.layoutService.getSideBarPosition()===Ot.RIGHT;e.style.color=this.getColor(Bm)||"",e.style.borderLeftColor=t??"",e.style.borderRightColor=t??"",e.style.borderLeftStyle=t&&!i?"solid":"none",e.style.borderRightStyle=t&&i?"solid":"none",e.style.borderLeftWidth=t&&!i?"1px":"0px",e.style.borderRightWidth=t&&i?"1px":"0px"}getCompositeBarOptions(){const e=this;return{partContainerClass:"auxiliarybar",pinnedViewContainersKey:on.pinnedViewsKey,placeholderViewContainersKey:on.placeholdeViewContainersKey,viewContainersWorkspaceStateKey:on.viewContainersWorkspaceStateKey,icon:!this.configuration.showLabels,orientation:Fo.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===fe.BOTTOM?$n.ABOVE:$n.BELOW},fillExtraContextMenuActions:t=>this.fillExtraContextMenuActions(t),compositeSize:0,iconSize:16,get overflowActionSize(){return e.getCompositeBarPosition()===fe.TITLE?40:30},colors:t=>({activeBackgroundColor:t.getColor(Cn),inactiveBackgroundColor:t.getColor(Cn),get activeBorderBottomColor(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor(jm):t.getColor(Hm)},get activeForegroundColor(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor(qm):t.getColor(Um)},get inactiveForegroundColor(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor($m):t.getColor(Gm)},badgeBackground:t.getColor(Wm),badgeForeground:t.getColor(Km),get dragAndDropBorder(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor(zm):t.getColor(Fm)}}),compact:!0}}fillExtraContextMenuActions(e){const t=this.layoutService.getSideBarPosition()===Ot.LEFT;if(this.getCompositeBarPosition()===fe.TITLE){const n=this.getViewsSubmenuAction();n&&(e.push(new hs),e.push(n))}const i=this.menuService.getMenuActions(w.ActivityBarPositionMenu,this.contextKeyService,{shouldForwardArgs:!0,renderShortTitle:!0}),s=bd(i).secondary,o=cs({id:"workbench.action.auxiliarybar.toggleShowLabels",label:this.configuration.showLabels?c(2881,"Show Icons"):c(2882,"Show Labels"),enabled:this.configuration.canShowLabels,run:()=>this.configurationService.updateValue("workbench.secondarySideBar.showLabels",!this.configuration.showLabels)});e.push(new hs,new wd("workbench.action.panel.position",c(2883,"Activity Bar Position"),s),cs({id:xg.ID,label:t?c(2884,"Move Secondary Side Bar Left"):c(2885,"Move Secondary Side Bar Right"),run:()=>this.commandService.executeCommand(xg.ID)}),o,cs({id:hl.ID,label:c(2886,"Hide Secondary Side Bar"),run:()=>this.commandService.executeCommand(hl.ID)}))}shouldShowCompositeBar(){return this.configuration.position!==Oe.HIDDEN}getCompositeBarPosition(){switch(this.configuration.position){case Oe.TOP:return fe.TOP;case Oe.BOTTOM:return fe.BOTTOM;case Oe.HIDDEN:return fe.TITLE;case Oe.DEFAULT:return fe.TITLE;default:return fe.TITLE}}createHeaderArea(){const e=super.createHeaderArea(),t=M(".auxiliary-bar-global-header"),i=this.headerFooterCompositeBarDispoables.add(this.instantiationService.createInstance(Vm,w.AuxiliaryBarHeader,void 0,void 0)),s=this.headerFooterCompositeBarDispoables.add(this.instantiationService.createInstance(Dp,t,{actionViewItemProvider:(o,n)=>this.headerActionViewItemProvider(o,n),orientation:Fo.HORIZONTAL,hiddenItemStrategy:Pm.NoHide,getKeyBinding:o=>this.keybindingService.lookupKeybinding(o.id)}));return s.setActions(Hn(i.getPrimaryActions())),this.headerFooterCompositeBarDispoables.add(i.onDidChange(()=>s.setActions(Hn(i.getPrimaryActions())))),e.appendChild(t),e}headerActionViewItemProvider(e,t){if(e.id===hl.ID)return this.instantiationService.createInstance(Lp,void 0,e,t)}toJSON(){return{type:P.AUXILIARYBAR_PART}}},on=Mi,Mi.activeViewSettingsKey="workbench.auxiliarybar.activepanelid",Mi.pinnedViewsKey="workbench.auxiliarybar.pinnedPanels",Mi.placeholdeViewContainersKey="workbench.auxiliarybar.placeholderPanels",Mi.viewContainersWorkspaceStateKey="workbench.auxiliarybar.viewContainersWorkspaceState",Mi);Ih=on=D([u(0,Ke),u(1,ce),u(2,at),u(3,He),u(4,it),u(5,Tt),u(6,F),u(7,me),u(8,Ye),u(9,se),u(10,At),u(11,wt),u(12,Cs),u(13,ie)],Ih);var nn,Dh;const il=lC(new E);b(class extends X{constructor(){super({id:"workbench.action.toggleCompactAuxiliaryWindow",title:x(2905,"Toggle Window Compact Mode"),category:xe.View,f1:!0,precondition:pC})}async run(){il.fire({windowId:Go().vscodeWindowId,compact:"toggle"})}});b(class extends X{constructor(){super({id:"workbench.action.enableCompactAuxiliaryWindow",title:c(2906,"Turn On Compact Mode"),icon:k.screenFull,menu:{id:w.LayoutControlMenu,when:I.and(ew.toNegated(),Js),order:0}})}async run(){il.fire({windowId:Go().vscodeWindowId,compact:!0})}});b(class extends X{constructor(){super({id:"workbench.action.disableCompactAuxiliaryWindow",title:c(2907,"Turn Off Compact Mode"),icon:k.screenNormal,menu:{id:w.LayoutControlMenu,when:I.and(ew,Js),order:0}})}async run(){il.fire({windowId:Go().vscodeWindowId,compact:!1})}});var Co;let Ah=(Co=class{constructor(e,t,i,s,o,n,r,d,l){this.editorPartsView=e,this.instantiationService=t,this.auxiliaryWindowService=i,this.lifecycleService=s,this.configurationService=o,this.statusbarService=n,this.titleService=r,this.editorService=d,this.layoutService=l}async create(e,t){const i=this,s=new O;let o=!!t?.compact;function n(){let W=0;return B&&(W+=T.height),m&&v&&(W+=m.height),W}function r(W){B?ia(T.container):sa(T.container),W&&h.layout()}function d(W){m&&(v?ia(m.container):sa(m.container),W&&h.layout())}function l(W){if(W===o)return;o=W,h.updateOptions({compact:o}),m?.updateOptions({compact:o}),f.updateOptions({compact:o});const K=B;B=!o&&i.configurationService.getValue(nn.STATUS_BAR_VISIBILITY)!==!1,K!==B&&r(!0)}const h=s.add(await this.auxiliaryWindowService.open(t)),p=M(".part.editor",{role:"main"});p.style.position="relative",h.container.appendChild(p);const f=s.add(this.instantiationService.createInstance(Th,h.window.vscodeWindowId,this.editorPartsView,t?.state,e));f.updateOptions({compact:o}),s.add(this.editorPartsView.registerPart(f)),f.create(p);const g=s.add(f.scopedInstantiationService.createChild(new ta([Q,this.editorService.createScoped(f,s)])));let m,v=!1;if(hC&&uC()){m=s.add(this.titleService.createAuxiliaryTitlebarPart(h.container,f,g)),m.updateOptions({compact:o}),v=kg(this.configurationService,h.window,void 0);const W=()=>{const K=v;v=kg(this.configurationService,h.window,void 0),K!==v&&d(!0)};s.add(m.onDidChange(()=>h.layout())),s.add(this.layoutService.onDidChangePartVisibility(()=>W())),s.add(Qm(K=>{K===h.window.vscodeWindowId&&W()})),d(!1)}else s.add(g.createInstance(cC,h.window));const T=s.add(this.statusbarService.createAuxiliaryStatusbarPart(h.container,g));let B=!o&&this.configurationService.getValue(nn.STATUS_BAR_VISIBILITY)!==!1;s.add(this.configurationService.onDidChangeConfiguration(W=>{W.affectsConfiguration(nn.STATUS_BAR_VISIBILITY)&&(B=!o&&this.configurationService.getValue(nn.STATUS_BAR_VISIBILITY)!==!1,r(!0))})),r(!1);const V=s.add(L.once(f.onWillClose)(()=>h.window.close()));s.add(L.once(h.onUnload)(()=>{s.isDisposed||(V.dispose(),f.close(),s.dispose())})),s.add(L.once(this.lifecycleService.onDidShutdown)(()=>s.dispose())),s.add(h.onBeforeUnload(W=>{for(const K of f.groups)for(const j of K.editors){const oe=j.canMove(K.id,this.editorPartsView.mainPart.activeGroup.id);if(typeof oe=="string"){K.openEditor(j),W.veto(oe);break}}})),s.add(h.onWillLayout(W=>{const K=m?.height??0;m?.layout(W.width,K,0,0);const j=W.height-n();f.layout(W.width,j,K,0),T.layout(W.width,T.height,W.height-T.height,0)})),h.layout(),s.add(il.event(W=>{if(W.windowId===h.window.vscodeWindowId){let K;typeof W.compact=="boolean"?K=W.compact:K=!o,l(K)}}));const U=s.add(g.createChild(new ta([Ui,this.statusbarService.createScoped(T,s)])));return{part:f,instantiationService:U,disposables:s}}},nn=Co,Co.STATUS_BAR_VISIBILITY="workbench.statusBar.visible",Co);Ah=nn=D([u(1,F),u(2,Vp),u(3,or),u(4,ie),u(5,Ui),u(6,gC),u(7,Q),u(8,He)],Ah);var So;let Th=(So=class extends Vd{constructor(e,t,i,s,o,n,r,d,l,h,p){const f=Dh.COUNTER++;super(t,`workbench.parts.auxiliaryEditor.${f}`,s,e,o,n,r,d,l,h,p),this.state=i,this._onWillClose=this._register(new E),this.onWillClose=this._onWillClose.event,this.optionsDisposable=this._register(new Ie),this.isCompact=!1}updateOptions(e){this.isCompact=e.compact,e.compact?this.optionsDisposable.value||(this.optionsDisposable.value=this.enforcePartOptions({showTabs:"none",closeEmptyGroups:!0})):this.optionsDisposable.clear()}addGroup(e,t,i){return this.isCompact&&(e=this.editorPartsView.mainPart.activeGroup),super.addGroup(e,t,i)}removeGroup(e,t){const i=this.assertGroupView(e);this.count===1&&this.activeGroup===i?this.doRemoveLastGroup(t):super.removeGroup(e,t)}doRemoveLastGroup(e){const t=!e&&this.shouldRestoreFocus(this.container),s=this.editorPartsView.getGroups(Ge.MOST_RECENTLY_ACTIVE)[1];s&&(s.groupsView.activateGroup(s),t&&s.focus()),this.doClose(!1)}loadState(){return this.state}saveState(){}close(){return this.doClose(!0)}doClose(e){let t=!0;if(e){for(const i of this.groups)i.closeAllEditors({excludeConfirming:!0});t=this.mergeGroupsToMainPart()}return this._onWillClose.fire(),t}mergeGroupsToMainPart(){if(!this.groups.some(i=>i.count>0))return!0;let e;for(const i of this.editorPartsView.mainPart.getGroups(Ge.MOST_RECENTLY_ACTIVE))if(!i.isLocked){e=i;break}e||(e=this.editorPartsView.mainPart.addGroup(this.editorPartsView.mainPart.activeGroup,this.partOptions.openSideBySideDirection==="right"?we.RIGHT:we.DOWN));const t=this.mergeAllGroups(e,{preserveExistingIndex:!0});return e.focus(),t}},Dh=So,So.COUNTER=1,So);Th=Dh=D([u(4,F),u(5,me),u(6,ie),u(7,ce),u(8,He),u(9,Zt),u(10,se)],Th);var so,Os;let Zf=(Os=class extends fC{constructor(e,t,i,s,o){super("workbench.editorParts",i,t),this.instantiationService=e,this.storageService=t,this.auxiliaryWindowService=s,this.contextKeyService=o,this.mapPartToInstantiationService=new Map,this._onDidCreateAuxiliaryEditorPart=this._register(new E),this.onDidCreateAuxiliaryEditorPart=this._onDidCreateAuxiliaryEditorPart.event,this.workspaceMemento=this.getMemento(H.WORKSPACE,Re.USER),this._isReady=!1,this.whenReadyPromise=new Ko,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Ko,this.whenRestored=this.whenRestoredPromise.p,this._onDidActiveGroupChange=this._register(new E),this.onDidChangeActiveGroup=this._onDidActiveGroupChange.event,this._onDidAddGroup=this._register(new E),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new E),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new E),this.onDidMoveGroup=this._onDidMoveGroup.event,this._onDidActivateGroup=this._register(new E),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidChangeGroupIndex=this._register(new E),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLocked=this._register(new E),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new E),this.onDidChangeGroupMaximized=this._onDidChangeGroupMaximized.event,this.globalContextKeys=new Map,this.scopedContextKeys=new Map,this.contextKeyProviders=new Map,this.registeredContextKeys=new Map,this.contextKeyProviderDisposables=this._register(new Cd),this.editorWorkingSets=(()=>{const n=this.storageService.get(so.EDITOR_WORKING_SETS_STORAGE_KEY,H.WORKSPACE);return n?JSON.parse(n):[]})(),this.mainPart=this._register(this.createMainEditorPart()),this._register(this.registerPart(this.mainPart)),this.mostRecentActiveParts=[this.mainPart],this.restoreParts(),this.registerListeners()}registerListeners(){this._register(this.onDidChangeMementoValue(H.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e))),this.whenReady.then(()=>this.registerGroupsContextKeyListeners())}createMainEditorPart(){return this.instantiationService.createInstance(Eh,this)}getScopedInstantiationService(e){return e===this.mainPart&&(this.mapPartToInstantiationService.has(e.windowId)||this.instantiationService.invokeFunction(t=>{const i=t.get(Q),s=t.get(Ui);this.mapPartToInstantiationService.set(e.windowId,this._register(this.mainPart.scopedInstantiationService.createChild(new ta([Q,i.createScoped(this.mainPart,this._store)],[Ui,s.createScoped(s,this._store)]))))})),this.mapPartToInstantiationService.get(e.windowId)??this.instantiationService}async createAuxiliaryEditorPart(e){const{part:t,instantiationService:i,disposables:s}=await this.instantiationService.createInstance(Ah,this).create(this.getGroupsLabel(this._parts.size),e);return this.mapPartToInstantiationService.set(t.windowId,i),s.add(ae(()=>this.mapPartToInstantiationService.delete(t.windowId))),this._onDidAddGroup.fire(t.activeGroup),this._onDidCreateAuxiliaryEditorPart.fire(t),t}registerPart(e){const t=this._register(new O);return t.add(super.registerPart(e)),this.registerEditorPartListeners(e,t),t}unregisterPart(e){super.unregisterPart(e),this.parts.forEach((t,i)=>{t!==this.mainPart&&t.notifyGroupsLabelChange(this.getGroupsLabel(i))})}registerEditorPartListeners(e,t){t.add(e.onDidFocus(()=>{this.doUpdateMostRecentActive(e,!0),this._parts.size>1&&this._onDidActiveGroupChange.fire(this.activeGroup)})),t.add(ae(()=>this.doUpdateMostRecentActive(e))),t.add(e.onDidChangeActiveGroup(i=>this._onDidActiveGroupChange.fire(i))),t.add(e.onDidAddGroup(i=>this._onDidAddGroup.fire(i))),t.add(e.onDidRemoveGroup(i=>this._onDidRemoveGroup.fire(i))),t.add(e.onDidMoveGroup(i=>this._onDidMoveGroup.fire(i))),t.add(e.onDidActivateGroup(i=>this._onDidActivateGroup.fire(i))),t.add(e.onDidChangeGroupMaximized(i=>this._onDidChangeGroupMaximized.fire(i))),t.add(e.onDidChangeGroupIndex(i=>this._onDidChangeGroupIndex.fire(i))),t.add(e.onDidChangeGroupLocked(i=>this._onDidChangeGroupLocked.fire(i)))}doUpdateMostRecentActive(e,t){const i=this.mostRecentActiveParts.indexOf(e);i!==-1&&this.mostRecentActiveParts.splice(i,1),t&&this.mostRecentActiveParts.unshift(e)}getGroupsLabel(e){return c(3273,"Window {0}",e+1)}getPart(e){if(this._parts.size>1)if(qn(e)){const t=e;return this.getPartByDocument(t.ownerDocument)}else{const t=e;let i;typeof t=="number"?i=t:i=t.id;for(const s of this._parts)if(s.hasGroup(i))return s}return this.mainPart}get isReady(){return this._isReady}async restoreParts(){if(await this.mainPart.whenReady,this.mainPart.willRestoreState){const t=this.loadState();t&&await this.restoreState(t)}this.mostRecentActiveParts.at(0)?.activeGroup.focus(),this._isReady=!0,this.whenReadyPromise.complete(),await Promise.allSettled(this.parts.map(t=>t.whenRestored)),this.whenRestoredPromise.complete()}loadState(){return this.workspaceMemento[so.EDITOR_PARTS_UI_STATE_STORAGE_KEY]}saveState(){const e=this.createState();e.auxiliary.length===0?delete this.workspaceMemento[so.EDITOR_PARTS_UI_STATE_STORAGE_KEY]:this.workspaceMemento[so.EDITOR_PARTS_UI_STATE_STORAGE_KEY]=e}createState(){return{auxiliary:this.parts.filter(e=>e!==this.mainPart).map(e=>{const t=this.auxiliaryWindowService.getWindow(e.windowId);return{state:e.createState(),...t?.createState()}}),mru:this.mostRecentActiveParts.map(e=>this.parts.indexOf(e))}}async restoreState(e){if(e.auxiliary.length){const t=[];for(const i of e.auxiliary)t.push(this.createAuxiliaryEditorPart(i));await Promise.allSettled(t),e.mru.length===this.parts.length?this.mostRecentActiveParts=e.mru.map(i=>this.parts[i]):this.mostRecentActiveParts=[...this.parts],await Promise.allSettled(this.parts.map(i=>i.whenReady))}}get hasRestorableState(){return this.parts.some(e=>e.hasRestorableState)}onDidChangeMementoState(e){if(e.external&&e.scope===H.WORKSPACE){this.reloadMemento(e.scope);const t=this.loadState();t&&this.applyState(t)}}async applyState(e){for(const t of this.parts){if(t===this.mainPart)continue;for(const s of t.getGroups(Ge.MOST_RECENTLY_ACTIVE))await s.closeAllEditors({excludeConfirming:!0});if(!t.close())return!1}return e!=="empty"&&await this.restoreState(e),!0}saveWorkingSet(e){const t={id:nr(),name:e,main:this.mainPart.createState(),auxiliary:this.createState()};return this.editorWorkingSets.push(t),this.saveWorkingSets(),{id:t.id,name:t.name}}getWorkingSets(){return this.editorWorkingSets.map(e=>({id:e.id,name:e.name}))}deleteWorkingSet(e){const t=this.indexOfWorkingSet(e);typeof t=="number"&&(this.editorWorkingSets.splice(t,1),this.saveWorkingSets())}async applyWorkingSet(e,t){let i;if(e==="empty"?i="empty":i=this.editorWorkingSets[this.indexOfWorkingSet(e)??-1],!i||!await this.applyState(i==="empty"?i:i.auxiliary))return!1;if(await this.mainPart.applyState(i==="empty"?i:i.main,t),!t?.preserveFocus){const o=this.mostRecentActiveParts.at(0);o&&(await o.whenReady,o.activeGroup.focus())}return!0}indexOfWorkingSet(e){for(let t=0;t<this.editorWorkingSets.length;t++)if(this.editorWorkingSets[t].id===e.id)return t}saveWorkingSets(){this.storageService.store(so.EDITOR_WORKING_SETS_STORAGE_KEY,JSON.stringify(this.editorWorkingSets),H.WORKSPACE,Re.MACHINE)}get activeGroup(){return this.activePart.activeGroup}get sideGroup(){return this.activePart.sideGroup}get groups(){return this.getGroups()}get count(){return this.groups.length}getGroups(e=Ge.CREATION_TIME){if(this._parts.size>1){let t;switch(e){case Ge.GRID_APPEARANCE:case Ge.CREATION_TIME:t=this.parts;break;case Ge.MOST_RECENTLY_ACTIVE:t=Ls([...this.mostRecentActiveParts,...this.parts]);break}return t.map(i=>i.getGroups(e)).flat()}return this.mainPart.getGroups(e)}getGroup(e){if(this._parts.size>1)for(const t of this._parts){const i=t.getGroup(e);if(i)return i}return this.mainPart.getGroup(e)}assertGroupView(e){let t;if(typeof e=="number"?t=this.getGroup(e):t=e,!t)throw new Error("Invalid editor group provided!");return t}activateGroup(e){return this.getPart(e).activateGroup(e)}getSize(e){return this.getPart(e).getSize(e)}setSize(e,t){this.getPart(e).setSize(e,t)}arrangeGroups(e,t=this.activePart.activeGroup){this.getPart(t).arrangeGroups(e,t)}toggleMaximizeGroup(e=this.activePart.activeGroup){this.getPart(e).toggleMaximizeGroup(e)}toggleExpandGroup(e=this.activePart.activeGroup){this.getPart(e).toggleExpandGroup(e)}restoreGroup(e){return this.getPart(e).restoreGroup(e)}applyLayout(e){this.activePart.applyLayout(e)}getLayout(){return this.activePart.getLayout()}get orientation(){return this.activePart.orientation}setGroupOrientation(e){this.activePart.setGroupOrientation(e)}findGroup(e,t=this.activeGroup,i){const s=this.getPart(t);if(this._parts.size>1){const o=this.getGroups(Ge.GRID_APPEARANCE);if(e.location===Nt.FIRST||e.location===Nt.LAST)return e.location===Nt.FIRST?o[0]:o[o.length-1];const n=s.findGroup(e,t,!1);if(n)return n;if(e.location===Nt.NEXT||e.location===Nt.PREVIOUS){const r=this.assertGroupView(t),d=o.indexOf(r);if(e.location===Nt.NEXT){let l=o[d+1];return!l&&i&&(l=o[0]),l}else{let l=o[d-1];return!l&&i&&(l=o[o.length-1]),l}}}return s.findGroup(e,t,i)}addGroup(e,t){return this.getPart(e).addGroup(e,t)}removeGroup(e){this.getPart(e).removeGroup(e)}moveGroup(e,t,i){return this.getPart(e).moveGroup(e,t,i)}mergeGroup(e,t,i){return this.getPart(e).mergeGroup(e,t,i)}mergeAllGroups(e,t){return this.activePart.mergeAllGroups(e,t)}copyGroup(e,t,i){return this.getPart(e).copyGroup(e,t,i)}createEditorDropTarget(e,t){return this.getPart(e).createEditorDropTarget(e,t)}registerGroupsContextKeyListeners(){this._register(this.onDidChangeActiveGroup(()=>this.updateGlobalContextKeys())),this.groups.forEach(e=>this.registerGroupContextKeyProvidersListeners(e)),this._register(this.onDidAddGroup(e=>this.registerGroupContextKeyProvidersListeners(e))),this._register(this.onDidRemoveGroup(e=>{this.scopedContextKeys.delete(e.id),this.registeredContextKeys.delete(e.id),this.contextKeyProviderDisposables.deleteAndDispose(e.id)}))}updateGlobalContextKeys(){const e=this.scopedContextKeys.get(this.activeGroup.id);if(e)for(const[t,i]of this.globalContextKeys){const s=e.get(t);s?i.set(s.get()):i.reset()}}bind(e,t){let i=this.globalContextKeys.get(e.key);i||(i=e.bindTo(this.contextKeyService),this.globalContextKeys.set(e.key,i));let s=this.scopedContextKeys.get(t.id);s||(s=new Map,this.scopedContextKeys.set(t.id,s));let o=s.get(e.key);o||(o=e.bindTo(t.scopedContextKeyService),s.set(e.key,o));const n=this;return{get(){return o.get()},set(r){n.activeGroup===t&&i.set(r),o.set(r)},reset(){n.activeGroup===t&&i.reset(),o.reset()}}}registerContextKeyProvider(e){if(this.contextKeyProviders.has(e.contextKey.key)||this.globalContextKeys.has(e.contextKey.key))throw new Error(`A context key provider for key ${e.contextKey.key} already exists.`);this.contextKeyProviders.set(e.contextKey.key,e);const t=()=>{for(const s of this.groups)this.updateRegisteredContextKey(s,e)};t();const i=e.onDidChange?.(()=>t());return ae(()=>{i?.dispose(),this.globalContextKeys.delete(e.contextKey.key),this.scopedContextKeys.forEach(s=>s.delete(e.contextKey.key)),this.contextKeyProviders.delete(e.contextKey.key),this.registeredContextKeys.forEach(s=>s.delete(e.contextKey.key))})}registerGroupContextKeyProvidersListeners(e){const t=e.onDidActiveEditorChange(()=>{for(const i of this.contextKeyProviders.values())this.updateRegisteredContextKey(e,i)});this.contextKeyProviderDisposables.set(e.id,t)}updateRegisteredContextKey(e,t){let i=this.registeredContextKeys.get(e.id);i||(i=new Map,this.registeredContextKeys.set(e.id,i));let s=i.get(t.contextKey.key);s||(s=this.bind(t.contextKey,e),i.set(t.contextKey.key,s)),s.set(t.getGroupContextKeyValue(e))}get partOptions(){return this.mainPart.partOptions}get onDidChangeEditorPartOptions(){return this.mainPart.onDidChangeEditorPartOptions}enforcePartOptions(e){return this.mainPart.enforcePartOptions(e)}},so=Os,Os.EDITOR_PARTS_UI_STATE_STORAGE_KEY="editorparts.state",Os.EDITOR_WORKING_SETS_STORAGE_KEY="editor.workingSets",Os);Zf=so=D([u(0,F),u(1,ce),u(2,me),u(3,Vp),u(4,se)],Zf);class ca{static _readModifiers(e){e=e.toLowerCase().trim();let t=!1,i=!1,s=!1,o=!1,n;do n=!1,/^ctrl(\+|\-)/.test(e)&&(t=!0,e=e.substr(5),n=!0),/^shift(\+|\-)/.test(e)&&(i=!0,e=e.substr(6),n=!0),/^alt(\+|\-)/.test(e)&&(s=!0,e=e.substr(4),n=!0),/^meta(\+|\-)/.test(e)&&(o=!0,e=e.substr(5),n=!0),/^win(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),n=!0),/^cmd(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),n=!0);while(n);let r;const d=e.indexOf(" ");return d>0?(r=e.substring(0,d),e=e.substring(d)):(r=e,e=""),{remains:e,ctrl:t,shift:i,alt:s,meta:o,key:r}}static parseChord(e){const t=this._readModifiers(e),i=t.key.match(/^\[([^\]]+)\]$/);if(i){const o=i[1],n=Ut.lowerCaseToEnum(o);return[new xs(t.ctrl,t.shift,t.alt,t.meta,n),t.remains]}const s=ot.fromUserSettings(t.key);return[new Vs(t.ctrl,t.shift,t.alt,t.meta,s),t.remains]}static parseKeybinding(e){if(!e)return null;const t=[];let i;for(;e.length>0;)[i,e]=this.parseChord(e),t.push(i);return t.length>0?new mC(t):null}}const _v=[{key:"commandPalette",id:w.CommandPalette,description:c(12182,"The Command Palette"),supportsSubmenus:!1},{key:"touchBar",id:w.TouchBarContext,description:c(12183,"The touch bar (macOS only)"),supportsSubmenus:!1},{key:"editor/title",id:w.EditorTitle,description:c(12184,"The editor title menu")},{key:"editor/title/run",id:w.EditorTitleRun,description:c(12185,"Run submenu inside the editor title menu")},{key:"editor/context",id:w.EditorContext,description:c(12186,"The editor context menu")},{key:"editor/context/copy",id:w.EditorContextCopy,description:c(12187,"'Copy as' submenu in the editor context menu")},{key:"editor/context/share",id:w.EditorContextShare,description:c(12188,"'Share' submenu in the editor context menu"),proposed:"contribShareMenu"},{key:"explorer/context",id:w.ExplorerContext,description:c(12189,"The file explorer context menu")},{key:"explorer/context/share",id:w.ExplorerContextShare,description:c(12190,"'Share' submenu in the file explorer context menu"),proposed:"contribShareMenu"},{key:"editor/title/context",id:w.EditorTitleContext,description:c(12191,"The editor tabs context menu")},{key:"editor/title/context/share",id:w.EditorTitleContextShare,description:c(12192,"'Share' submenu inside the editor title context menu"),proposed:"contribShareMenu"},{key:"debug/callstack/context",id:w.DebugCallStackContext,description:c(12193,"The debug callstack view context menu")},{key:"debug/variables/context",id:w.DebugVariablesContext,description:c(12194,"The debug variables view context menu")},{key:"debug/toolBar",id:w.DebugToolBar,description:c(12195,"The debug toolbar menu")},{key:"debug/createConfiguration",id:w.DebugCreateConfiguration,proposed:"contribDebugCreateConfiguration",description:c(12196,"The debug create configuration menu")},{key:"notebook/variables/context",id:w.NotebookVariablesContext,description:c(12197,"The notebook variables view context menu")},{key:"menuBar/home",id:w.MenubarHomeMenu,description:c(12198,"The home indicator context menu (web only)"),proposed:"contribMenuBarHome",supportsSubmenus:!1},{key:"menuBar/edit/copy",id:w.MenubarCopy,description:c(12199,"'Copy as' submenu in the top level Edit menu")},{key:"scm/title",id:w.SCMTitle,description:c(12200,"The Source Control title menu")},{key:"scm/sourceControl",id:w.SCMSourceControl,description:c(12201,"The Source Control menu")},{key:"scm/sourceControl/title",id:w.SCMSourceControlTitle,description:c(12202,"The Source Control title menu"),proposed:"contribSourceControlTitleMenu"},{key:"scm/resourceState/context",id:w.SCMResourceContext,description:c(12203,"The Source Control resource state context menu")},{key:"scm/resourceFolder/context",id:w.SCMResourceFolderContext,description:c(12204,"The Source Control resource folder context menu")},{key:"scm/resourceGroup/context",id:w.SCMResourceGroupContext,description:c(12205,"The Source Control resource group context menu")},{key:"scm/change/title",id:w.SCMChangeContext,description:c(12206,"The Source Control inline change menu")},{key:"scm/inputBox",id:w.SCMInputBox,description:c(12207,"The Source Control input box menu"),proposed:"contribSourceControlInputBoxMenu"},{key:"scm/history/title",id:w.SCMHistoryTitle,description:c(12208,"The Source Control History title menu"),proposed:"contribSourceControlHistoryTitleMenu"},{key:"scm/historyItem/context",id:w.SCMHistoryItemContext,description:c(12209,"The Source Control history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItem/hover",id:w.SCMHistoryItemHover,description:c(12210,"The Source Control history item hover menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItemRef/context",id:w.SCMHistoryItemRefContext,description:c(12211,"The Source Control history item reference context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"statusBar/remoteIndicator",id:w.StatusBarRemoteIndicatorMenu,description:c(12212,"The remote indicator menu in the status bar"),supportsSubmenus:!1},{key:"terminal/context",id:w.TerminalInstanceContext,description:c(12213,"The terminal context menu")},{key:"terminal/title/context",id:w.TerminalTabContext,description:c(12214,"The terminal tabs context menu")},{key:"view/title",id:w.ViewTitle,description:c(12215,"The contributed view title menu")},{key:"viewContainer/title",id:w.ViewContainerTitle,description:c(12216,"The contributed view container title menu"),proposed:"contribViewContainerTitle"},{key:"view/item/context",id:w.ViewItemContext,description:c(12217,"The contributed view item context menu")},{key:"comments/comment/editorActions",id:w.CommentEditorActions,description:c(12218,"The contributed comment editor actions"),proposed:"contribCommentEditorActionsMenu"},{key:"comments/commentThread/title",id:w.CommentThreadTitle,description:c(12219,"The contributed comment thread title menu")},{key:"comments/commentThread/context",id:w.CommentThreadActions,description:c(12220,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/additionalActions",id:w.CommentThreadAdditionalActions,description:c(12220,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!0,proposed:"contribCommentThreadAdditionalMenu"},{key:"comments/commentThread/title/context",id:w.CommentThreadTitleContext,description:c(12221,"The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."),proposed:"contribCommentPeekContext"},{key:"comments/comment/title",id:w.CommentTitle,description:c(12222,"The contributed comment title menu")},{key:"comments/comment/context",id:w.CommentActions,description:c(12223,"The contributed comment context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/comment/context",id:w.CommentThreadCommentContext,description:c(12224,"The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."),proposed:"contribCommentPeekContext"},{key:"commentsView/commentThread/context",id:w.CommentsViewThreadActions,description:c(12225,"The contributed comment thread context menu in the comments view"),proposed:"contribCommentsViewThreadMenus"},{key:"notebook/toolbar",id:w.NotebookToolbar,description:c(12226,"The contributed notebook toolbar menu")},{key:"notebook/kernelSource",id:w.NotebookKernelSource,description:c(12227,"The contributed notebook kernel sources menu"),proposed:"notebookKernelSource"},{key:"notebook/cell/title",id:w.NotebookCellTitle,description:c(12228,"The contributed notebook cell title menu")},{key:"notebook/cell/execute",id:w.NotebookCellExecute,description:c(12229,"The contributed notebook cell execution menu")},{key:"interactive/toolbar",id:w.InteractiveToolbar,description:c(12230,"The contributed interactive toolbar menu")},{key:"interactive/cell/title",id:w.InteractiveCellTitle,description:c(12231,"The contributed interactive cell title menu")},{key:"issue/reporter",id:w.IssueReporter,description:c(12232,"The contributed issue reporter menu")},{key:"testing/item/context",id:w.TestItem,description:c(12233,"The contributed test item menu")},{key:"testing/item/gutter",id:w.TestItemGutter,description:c(12234,"The menu for a gutter decoration for a test item")},{key:"testing/profiles/context",id:w.TestProfilesContext,description:c(12235,"The menu for configuring testing profiles.")},{key:"testing/item/result",id:w.TestPeekElement,description:c(12236,"The menu for an item in the Test Results view or peek.")},{key:"testing/message/context",id:w.TestMessageContext,description:c(12237,"A prominent button overlaying editor content where the message is displayed")},{key:"testing/message/content",id:w.TestMessageContent,description:c(12238,"Context menu for the message in the results tree")},{key:"extension/context",id:w.ExtensionContext,description:c(12239,"The extension context menu")},{key:"timeline/title",id:w.TimelineTitle,description:c(12240,"The Timeline view title menu")},{key:"timeline/item/context",id:w.TimelineItemContext,description:c(12241,"The Timeline view item context menu")},{key:"ports/item/context",id:w.TunnelContext,description:c(12242,"The Ports view item context menu")},{key:"ports/item/origin/inline",id:w.TunnelOriginInline,description:c(12243,"The Ports view item origin inline menu")},{key:"ports/item/port/inline",id:w.TunnelPortInline,description:c(12244,"The Ports view item port inline menu")},{key:"file/newFile",id:w.NewFile,description:c(12245,"The 'New File...' quick pick, shown on welcome page and File menu."),supportsSubmenus:!1},{key:"webview/context",id:w.WebviewContext,description:c(12246,"The webview context menu")},{key:"file/share",id:w.MenubarShare,description:c(12247,"Share submenu shown in the top level File menu."),proposed:"contribShareMenu"},{key:"editor/inlineCompletions/actions",id:w.InlineCompletionsActions,description:c(12248,"The actions shown when hovering on an inline completion"),supportsSubmenus:!1,proposed:"inlineCompletionsAdditions"},{key:"editor/content",id:w.EditorContent,description:c(12249,"The prominent button in an editor, overlays its content"),proposed:"contribEditorContentMenu"},{key:"editor/lineNumber/context",id:w.EditorLineNumberContext,description:c(12250,"The contributed editor line number context menu")},{key:"mergeEditor/result/title",id:w.MergeInputResultToolbar,description:c(12251,"The result toolbar of the merge editor"),proposed:"contribMergeEditorMenus"},{key:"multiDiffEditor/resource/title",id:w.MultiDiffEditorFileToolbar,description:c(12252,"The resource toolbar in the multi diff editor"),proposed:"contribMultiDiffEditorMenus"},{key:"diffEditor/gutter/hunk",id:w.DiffEditorHunkToolbar,description:c(12253,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"diffEditor/gutter/selection",id:w.DiffEditorSelectionToolbar,description:c(12253,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"searchPanel/aiResults/commands",id:w.SearchActionMenu,description:c(12254,"The commands that will contribute to the menu rendered as buttons next to the AI search title")},{key:"chat/modelPicker",id:w.ChatModelPicker,description:c(12255,"The chat model picker dropdown menu"),supportsSubmenus:!1,proposed:"chatParticipantPrivate"}];var fs;(function(a){function e(g){return typeof g.command=="string"}a.isMenuItem=e;function t(g,m){return typeof g.command!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","command")),!1):g.alt&&typeof g.alt!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","alt")),!1):g.when&&typeof g.when!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","when")),!1):g.group&&typeof g.group!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidMenuItem=t;function i(g,m){return typeof g.submenu!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","submenu")),!1):g.when&&typeof g.when!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","when")),!1):g.group&&typeof g.group!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidSubmenuItem=i;function s(g,m){if(!Array.isArray(g))return m.error(c(12258,"submenu items must be an array")),!1;for(const v of g)if(e(v)){if(!t(v,m))return!1}else if(!i(v,m))return!1;return!0}a.isValidItems=s;function o(g,m){return typeof g!="object"?(m.error(c(12259,"submenu items must be an object")),!1):typeof g.id!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","id")),!1):typeof g.label!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","label")),!1):!0}a.isValidSubmenu=o;const n={type:"object",required:["command"],properties:{command:{description:c(12260,"Identifier of the command to execute. The command must be declared in the 'commands'-section"),type:"string"},alt:{description:c(12261,"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"),type:"string"},when:{description:c(12262,"Condition which must be true to show this item"),type:"string"},group:{description:c(12263,"Group into which this item belongs"),type:"string"}}},r={type:"object",required:["submenu"],properties:{submenu:{description:c(12264,"Identifier of the submenu to display in this item."),type:"string"},when:{description:c(12262,"Condition which must be true to show this item"),type:"string"},group:{description:c(12263,"Group into which this item belongs"),type:"string"}}},d={type:"object",required:["id","label"],properties:{id:{description:c(12265,"Identifier of the menu to display as a submenu."),type:"string"},label:{description:c(12266,"The label of the menu item which leads to this submenu."),type:"string"},icon:{description:c(12267,"(Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:c(12268,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12269,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.menusContribution={description:c(12270,"Contributes menu items to the editor"),type:"object",properties:zl(_v,g=>g.key,g=>({markdownDescription:g.proposed?c(12271,'Proposed API, requires `enabledApiProposal: ["{0}"]` - {1}',g.proposed,g.description):g.description,type:"array",items:g.supportsSubmenus===!1?n:{oneOf:[n,r]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[n,r]}}},a.submenusContribution={description:c(12272,"Contributes submenu items to the editor"),type:"array",items:d};function l(g,m){return g?co(g.command)?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","command")),!1):!p(g.title,m,"title")||g.shortTitle&&!p(g.shortTitle,m,"shortTitle")?!1:g.enablement&&typeof g.enablement!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","precondition")),!1):!(g.category&&!p(g.category,m,"category")||!h(g.icon,m)):(m.error(c(12273,"expected non-empty value.")),!1)}a.isValidCommand=l;function h(g,m){return typeof g>"u"||typeof g=="string"||typeof g.dark=="string"&&typeof g.light=="string"?!0:(m.error(c(12274,"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")),!1)}function p(g,m,v){return typeof g>"u"?(m.error(c(12275,"property `{0}` is mandatory and must be of type `string` or `object`",v)),!1):typeof g=="string"&&co(g)?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`",v)),!1):typeof g!="string"&&(co(g.original)||co(g.value))?(m.error(c(12276,"properties `{0}` and `{1}` are mandatory and must be of type `string`",`${v}.value`,`${v}.original`)),!1):!0}const f={type:"object",required:["command","title"],properties:{command:{description:c(12277,"Identifier of the command to execute"),type:"string"},title:{description:c(12278,"Title by which the command is represented in the UI"),type:"string"},shortTitle:{markdownDescription:c(12279,"(Optional) Short title by which the command is represented in the UI. Menus pick either `title` or `shortTitle` depending on the context in which they show commands."),type:"string"},category:{description:c(12280,"(Optional) Category string by which the command is grouped in the UI"),type:"string"},enablement:{description:c(12281,"(Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api."),type:"string"},icon:{description:c(12282,"(Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:c(12283,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12284,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.commandsContribution={description:c(12285,"Contributes commands to the command palette."),oneOf:[f,{type:"array",items:f}]}})(fs||(fs={}));const Xf=new O,Ev=jo.registerExtensionPoint({extensionPoint:"commands",jsonSchema:fs.commandsContribution,activationEventsGenerator:(a,e)=>{for(const t of a)t.command&&e.push(`onCommand:${t.command}`)}});Ev.setHandler(a=>{function e(t,i){if(!fs.isValidCommand(t,i.collector))return;const{icon:s,enablement:o,category:n,title:r,shortTitle:d,command:l}=t;let h;s&&(typeof s=="string"?h=Ce.fromString(s)??{dark:is(i.description.extensionLocation,s),light:is(i.description.extensionLocation,s)}:h={dark:is(i.description.extensionLocation,s.dark),light:is(i.description.extensionLocation,s.light)});const p=S.getCommand(l);p&&(p.source?i.collector.info(c(12286,"Command `{0}` already registered by {1} ({2})",t.command,p.source.title,p.source.id)):i.collector.info(c(12287,"Command `{0}` already registered",t.command))),Xf.add(S.addCommand({id:l,title:r,source:{id:i.description.identifier.value,title:i.description.displayName??i.description.name},shortTitle:d,tooltip:r,category:n,precondition:I.deserialize(o),icon:h}))}Xf.clear();for(const t of a){const{value:i}=t;if(Array.isArray(i))for(const s of i)e(s,t);else e(i,t)}});const Hr=new Map,Iv=jo.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:fs.submenusContribution});Iv.setHandler(a=>{Hr.clear();for(const e of a){const{value:t,collector:i}=e;for(const[,s]of Object.entries(t)){if(!fs.isValidSubmenu(s,i))continue;if(!s.id){i.warn(c(12288,"`{0}` is not a valid submenu identifier",s.id));continue}if(Hr.has(s.id)){i.info(c(12289,"The `{0}` submenu was already previously registered.",s.id));continue}if(!s.label){i.warn(c(12290,"`{0}` is not a valid submenu label",s.label));continue}let o;s.icon&&(typeof s.icon=="string"?o=Ce.fromString(s.icon)||{dark:is(e.description.extensionLocation,s.icon)}:o={dark:is(e.description.extensionLocation,s.icon.dark),light:is(e.description.extensionLocation,s.icon.light)});const n={id:w.for(`api:${s.id}`),label:s.label,icon:o};Hr.set(s.id,n)}}});const zT=new Map(_v.map(a=>[a.key,a])),Qf=new O,Rl=new Map,$T=jo.registerExtensionPoint({extensionPoint:"menus",jsonSchema:fs.menusContribution,deps:[Iv]});$T.setHandler(a=>{Qf.clear(),Rl.clear();for(const e of a){const{value:t,collector:i}=e;for(const s of Object.entries(t)){if(!fs.isValidItems(s[1],i))continue;let o=zT.get(s[0]);if(!o){const n=Hr.get(s[0]);n&&(o={key:s[0],id:n.id,description:""})}if(o){if(o.proposed&&!$l(e.description,o.proposed)){i.error(c(12291,`{0} is a proposed menu identifier. It requires 'package.json#enabledApiProposals: ["{1}"]' and is only available when running out of dev or with the following command line switch: --enable-proposed-api {2}`,s[0],o.proposed,e.description.identifier.value));continue}for(const n of s[1]){let r;if(fs.isMenuItem(n)){const d=S.getCommand(n.command),l=n.alt&&S.getCommand(n.alt)||void 0;if(!d){i.error(c(12292,"Menu item references a command `{0}` which is not defined in the 'commands' section.",n.command));continue}n.alt&&!l&&i.warn(c(12293,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",n.alt)),n.command===n.alt&&i.info(c(12294,"Menu item references the same command as default and alt-command")),r={command:d,alt:l,group:void 0,order:void 0,when:void 0}}else{if(o.supportsSubmenus===!1){i.error(c(12295,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const d=Hr.get(n.submenu);if(!d){i.error(c(12296,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",n.submenu));continue}let l=Rl.get(o.id.id);if(l||(l=new Set,Rl.set(o.id.id,l)),l.has(d.id.id)){i.warn(c(12297,"The `{0}` submenu was already contributed to the `{1}` menu.",n.submenu,s[0]));continue}l.add(d.id.id),r={submenu:d.id,icon:d.icon,title:d.label,group:void 0,order:void 0,when:void 0}}if(n.group){const d=n.group.lastIndexOf("@");d>0?(r.group=n.group.substr(0,d),r.order=Number(n.group.substr(d+1))||void 0):r.group=n.group}if(o.id===w.ViewContainerTitle&&!n.when?.includes("viewContainer == workbench.view.debug")){i.error(c(12298,"The {0} menu contribution must check {1} in its {2} clause.","`viewContainer/title`","`viewContainer == workbench.view.debug`",'"when"'));continue}r.when=I.deserialize(n.when),Qf.add(S.appendMenuItem(o.id,r))}}}}});let xh=class extends R{constructor(e){super(),this._keybindingService=e,this.type="table"}shouldRender(e){return!!e.contributes?.commands}render(e){const i=(e.contributes?.commands||[]).map(h=>({id:h.command,title:h.title,keybindings:[],menus:[]})),s=zl(i,h=>h.id),o=e.contributes?.menus||{},n=zl(i,h=>h.id);if(o.commandPalette)for(const h of o.commandPalette)delete n[h.command];if(Object.keys(n).length){o.commandPalette||(o.commandPalette=[]);for(const h in n)o.commandPalette.push({command:h})}for(const h in o)for(const p of o[h])if(p.when!=="false"&&p.command){let f=s[p.command];f?f.menus.includes(h)||f.menus.push(h):(f={id:p.command,title:"",keybindings:[],menus:[h]},s[f.id]=f,i.push(f))}if((e.contributes?.keybindings?Array.isArray(e.contributes.keybindings)?e.contributes.keybindings:[e.contributes.keybindings]:[]).forEach(h=>{const p=this.resolveKeybinding(h);if(!p)return;let f=s[h.command];f?f.keybindings.push(p):(f={id:h.command,title:"",keybindings:[p],menus:[]},s[f.id]=f,i.push(f))}),!i.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const d=[c(12299,"ID"),c(12300,"Title"),c(12301,"Keyboard Shortcuts"),c(12302,"Menu Contexts")],l=i.sort((h,p)=>h.id.localeCompare(p.id)).map(h=>[new wi().appendMarkdown(`\`${h.id}\``),typeof h.title=="string"?h.title:h.title.value,h.keybindings,new wi().appendMarkdown(`${h.menus.sort((p,f)=>p.localeCompare(f)).map(p=>`\`${p}\``).join("&nbsp;")}`)]);return{data:{headers:d,rows:l},dispose:()=>{}}}resolveKeybinding(e){let t;switch(wC){case"win32":t=e.win;break;case"linux":t=e.linux;break;case"darwin":t=e.mac;break}return this._keybindingService.resolveUserBinding(t??e.key)[0]}};xh=D([u(0,it)],xh);z.as(Dc.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:c(12303,"Commands"),access:{canToggle:!1},renderer:new ee(xh)});class Dv{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${qT(i+",",25)} "command": `);const s=t.when?JSON.stringify(t.when.serialize()):"",o=JSON.stringify(t.command);s.length>0?(e.write(`${o},`),e.writeLine(),e.write(` "when": ${s}`)):e.write(`${o}`),t.commandArgs&&(e.write(","),e.writeLine(),e.write(` "args": ${JSON.stringify(t.commandArgs)}`)),e.write(" }")}static readUserKeybindingItem(e){const t="key"in e&&typeof e.key=="string"?ca.parseKeybinding(e.key):null,i="when"in e&&typeof e.when=="string"?I.deserialize(e.when):void 0,s="command"in e&&typeof e.command=="string"?e.command:null,o="args"in e&&typeof e.args<"u"?e.args:void 0;return{keybinding:t,command:s,commandArgs:o,when:i,_sourceKey:"key"in e&&typeof e.key=="string"?e.key:void 0}}}function qT(a,e){return a.length<e?a+new Array(e-a.length).join(" "):a}class jT{constructor(){this._lines=[],this._currentLine=""}write(e){this._currentLine+=e}writeLine(e=""){this._lines.push(this._currentLine+e),this._currentLine=""}toString(){return this.writeLine(),this._lines.join(`
2
+ import{Z as Pe,bK as b,bL as X,gs as cb,bO as xe,aj as x,bA as He,ck as P,bN as G,bP as N,$ as y,ce as js,cp as Y,eu as Z,cR as L,gt as Rs,D as R,E,a7 as M,N as oi,gu as Ne,gv as Ht,gw as Vi,d as O,cG as ea,t as ae,gx as lb,bc as Er,A as Bo,gy as hb,gz as ub,gA as pb,eU as gb,gB as Ip,d5 as hs,f as D,g as u,m as mt,bx as ce,W as F,c0 as me,dl as at,bw as At,ch as bs,aH as z,gC as fb,ee as Lm,f3 as Ie,aJ as H,f7 as mb,gD as wb,gE as yb,dx as Ee,gF as vb,go as ta,gG as bb,aK as Re,fI as ia,b$ as Ec,q as c,fC as Hn,fH as sa,a8 as ge,eY as Dp,fn as Fo,dd as Ap,eV as Tp,d6 as Cb,d7 as Sb,fl as Wl,dw as jt,d8 as je,gH as Vm,bY as w,dr as zn,gI as md,db as ke,gJ as _b,da as J,fw as $a,ds as St,dc as te,di as Eg,dj as Ig,eT as Pm,f9 as Mm,gK as Eb,dS as Ko,gL as Ib,eX as wd,gM as Om,j as Ke,dn as it,dp as Tt,cf as Ye,dC as se,fD as Cs,gN as yd,g6 as $s,gO as Db,gP as Ab,gQ as Tb,gR as Nm,cx as qa,dR as Wt,gS as Cn,gT as Bm,cl as Ot,gU as xb,gV as kb,fh as $n,gW as Fm,gX as Km,gY as Wm,gZ as Gm,g_ as Um,g$ as Hm,d_ as Oe,h0 as Rb,h as ie,fi as Lb,ff as Vb,h1 as Ys,h2 as Pb,h3 as Mb,h4 as Ob,h5 as ll,h6 as vd,h7 as zm,h8 as Nb,h9 as Bb,ha as $m,hb as qm,hc as jm,hd as bd,d4 as cs,he as Dg,hf as Fb,d0 as wt,dv as Ym,hg as Sn,hh as Ds,hi as to,hj as Kb,hk as Wb,hl as Gl,hm as Pr,fe as Ul,bo as Ca,hn as Gb,eq as ut,g8 as Ub,ho as Hb,hp as zb,hq as $b,hr as qb,cz as Ag,hs as Jm,ht as jb,hu as ao,hv as Yb,hw as Jb,cv as Zb,G as Wo,hx as we,dt as Xb,bW as Q,cc as Je,hy as Zm,bu as re,hz as Hl,hA as Xm,hB as Tg,hC as Qb,cy as tn,co as Ge,cr as Ss,hD as Ls,hE as Nt,hF as _s,dH as Ic,du as eC,hG as ja,hH as tC,hI as nd,hJ as iC,a9 as qn,hK as sC,as as oC,hL as nC,cq as xp,hM as Js,hN as kp,hO as Rp,hP as rC,z as jn,dN as Zt,hQ as aC,hR as dC,hS as xg,hT as hl,hU as Lp,e5 as kg,e0 as Qm,f6 as cC,hV as lC,dF as Ui,eF as hC,hW as uC,hX as pC,ec as Go,cY as I,bE as k,f4 as ew,dU as Vp,an as or,dV as gC,e_ as fC,eb as Cd,hY as nr,hZ as Ut,h_ as xs,h$ as ot,i0 as Vs,i1 as mC,p as jo,i2 as zl,bh as Ce,x as is,gb as $l,bZ as S,ba as Dc,ak as ee,i3 as co,bb as wi,i4 as wC,i5 as yC,cS as ne,i6 as tw,i7 as ul,i8 as pl,e7 as Rg,dh as Yn,i9 as vC,ia as bC,ib as CC,ic as $t,id as SC,ie as Ya,ig as yi,ih as A,ii as _C,ij as si,aV as EC,bU as Te,ik as ho,aU as iw,il as sw,aR as ow,im as IC,io as Pp,bz as Le,ip as rr,O as Ue,iq as Sa,cj as _a,e1 as Uo,e2 as nw,be as Zs,bf as ql,ir as Lg,ah as _,is as DC,it as rw,iu as AC,iv as Vg,aT as TC,iw as Pg,_ as gl,cg as Mp,ix as Mg,eQ as Ho,iy as xC,iz as kC,u as aw,iA as RC,dP as jl,iB as LC,dg as Yl,iC as xi,iD as rd,R as ve,iE as VC,bD as le,V as ri,iF as $i,i as ar,iG as dr,eW as PC,br as dt,cu as Ir,iH as Ac,a0 as pe,d2 as cr,cO as _t,bd as Qe,iI as MC,U as $,iJ as _n,iK as OC,iL as dw,iM as NC,iN as BC,iO as FC,iP as KC,iQ as Tc,a4 as es,dD as WC,iR as Og,iS as Ng,iT as ft,iU as GC,iV as UC,dy as HC,ad as xc,ae as kc,iW as zC,iX as cw,iY as $C,iZ as lr,i_ as Op,i$ as Sd,j0 as qC,j1 as jC,j2 as Bg,al as YC,j3 as JC,j4 as Np,j5 as Bp,j6 as Fp,j7 as Kp,j8 as pt,j9 as lw,ja as ZC,jb as ji,jc as Wp,jd as br,cA as Ea,je as XC,jf as Fg,jg as gt,jh as q,ji as Kg,jj as Lt,jk as Bt,jl as Ni,jm as ad,jn as hw,jo as Ct,jp as fl,jq as Wg,jr as Ia,js as QC,jt as dd,ju as Gg,cC as De,jv as ii,jw as uw,jx as eS,jy as tS,jz as iS,aQ as Pi,bX as Se,jA as us,jB as sS,bH as Xt,jC as ps,jD as oS,jE as Vt,jF as nS,jG as rS,jH as aS,jI as dS,jJ as cS,jK as Jl,jL as Mr,jM as tt,jN as qe,jO as ml,jP as Ug,jQ as lS,jR as hS,ct as Zl,jS as Hg,bs as zg,ao as Da,jT as fi,jU as $g,jV as _d,jW as uS,jX as pS,jY as gS,jZ as Gp,j_ as Rc,j$ as Up,s as fS,k0 as pw,k1 as ct,k2 as gw,k3 as fw,k4 as Pt,em as Aa,k5 as Ta,k6 as cd,bm as mS,k7 as wS,aL as ln,k8 as yS,k9 as vS,ka as bS,kb as Or,kc as mw,kd as Dr,ke as qg,kf as Nr,kg as jg,kh as CS,ki as SS,bS as Hp,kj as _S,kk as wl,kl as ES,km as IS,gl as DS,kn as AS,ko as Yg,kp as Ar,kq as TS,kr as xS,ks as Jg,kt as he,ku as ww,kv as zp,kw as Lc,a3 as qs,b_ as kS,kx as RS,ky as yw,F as Br,kz as LS,kA as VS,kB as PS,kC as MS,kD as OS,kE as NS,eN as Zg,kF as BS,kG as Jt,kH as FS,kI as KS,kJ as vw,kK as bw,kL as Yo,kM as bi,kN as Cw,kO as Sw,kP as WS,de as _w,kQ as Xg,kR as GS,kS as US,kT as HS,kU as Xl,kV as zS,kW as $S,kX as qS,df as oa,kY as jS,P as Es,cJ as sn,cK as Qg,cL as YS,kZ as Ew,k_ as ef,dE as et,k$ as JS,cN as Ed,l0 as ZS,l1 as tf,l2 as XS,gm as Vc,l3 as sf,l4 as of,l5 as nf,l6 as QS,l7 as e_,dQ as Iw,l8 as rf,l9 as Dw,gq as t_,bJ as Jo,la as Fr,dm as xt,lb as i_,by as s_,eh as Id,lc as yl,eO as Aw,ld as o_,le as af,lf as df,et as n_,cn as pi,lg as r_,lh as a_,li as Ql,lj as cf,lk as d_,ll as Tw,lm as lf,ln as c_,lo as l_,lp as h_,lq as u_,ek as p_,lr as vl,ls as g_,lt as f_,lu as m_,bv as w_,lv as ld,lw as y_,aq as Dd,lx as Ci,ly as v_,lz as xw,lA as Pc,lB as hr,lC as $p,lD as hf,lE as b_,lF as gs,lG as Mc,lH as eh,lI as C_,lJ as Oc,lK as ur,lL as S_,J as __,lM as kw,ev as E_,lN as I_,lO as Mt,lP as D_,lQ as A_,lR as ni,lS as Ad,lT as T_,lU as Rw,lV as x_,lW as k_,lX as R_,lY as uf,b2 as ss,lZ as Jn,l_ as pf,l$ as Td,m0 as Nc,m1 as Tr,m2 as L_,m3 as Bc,m4 as Fc,m5 as V_,m6 as P_,m7 as Lw,m8 as Kc,m9 as M_,ma as Vw,mb as be,X as yt,Y as vt,mc as Pw,md as Mw,me as Ow,mf as nt,mg as Nw,mh as Bw,mi as Fw,mj as Kw,mk as Ww,ml as Gw,mm as Uw,mn as Hw,mo as zw,mp as $w,mq as Wc,mr as qw,ms as bl,mt as Zo,mu as qi,mv as na,mw as xd,mx as jw,my as rt,mz as Cl,cW as ue,mA as qp,mB as _i,mC as Ei,mD as kt,mE as O_,mF as N_,mG as jp,mH as xa,mI as ka,mJ as Ra,mK as Yw,mL as B_,mM as F_,mN as K_,bM as Jw,mO as Zw,mP as W_,mQ as Gc,mR as Sl,mS as _l,mT as Xw,mU as G_,mV as U_,mW as H_,mX as z_,bR as Qw,mY as $_,Q as Uc,fT as q_,mZ as ey,m_ as j_,m$ as th,n0 as gf,n1 as Bi,n2 as ff,n3 as Hc,n4 as Y_,n5 as J_,n6 as Z_,n7 as ty,fK as mf,gi as X_,n8 as Q_,n9 as eE,na as tE,nb as iE,nc as wf,nd as sE,ne as oE,c_ as iy,nf as ze,ng as Ve,nh as ls,ni as lo,nj as nE,nk as Et,nl as uo,nm as rE,nn as kd,no as Yp,np as It,nq as Ja,nr as aE,ns as dE,nt as El,nu as zo,nv as sy,d1 as ih,nw as En,nx as cE,ny as lE,nz as hE,nA as uE,nB as pE,bQ as zc,nC as hn,nD as Jp,nE as Il,nF as yf,nG as Ji,nH as Za,nI as Yi,nJ as sh,nK as vf,nL as Kr,nM as oy,nN as ny,nO as gE,nP as fE,nQ as ry,nR as mE,nS as wE,nT as bf,ge as ay,nU as Wr,nV as Cf,nW as dy,nX as cy,nY as La,nZ as pr,n_ as Hi,n$ as yE,o0 as vE,o1 as ly,o2 as hy,o3 as bE,o4 as uy,o5 as Zp,o6 as oh,o7 as CE,o8 as SE,bF as _E,o9 as EE,oa as mi,ob as Sf,oc as IE,od as _f,oe as DE,of as Dl,og as AE,oh as TE,oi as xE,oj as kE,ok as RE,ol as LE,om as VE,on as py,oo as PE,op as gy,oq as Zi,or as ME,os as Ef,ot as eo,ou as If,ov as OE,ow as Df,ox as Af,oy as $c,oz as nh,oA as fy,oB as qc,oC as Va,oD as my,oE as xr,oF as NE,oG as Tf,oH as BE,oI as FE,oJ as xf,oK as KE,oL as WE,oM as wy,oN as kf,oO as yy,oP as Rf,oQ as vy,oR as Lf,oS as rh,oT as ah,oU as GE,oV as UE,oW as HE,oX as zE,oY as $E,oZ as qE,o_ as jE,o$ as YE,p0 as JE,p1 as ZE,p2 as by,p3 as Cy,p4 as XE,p5 as QE,p6 as eI,p7 as tI,p8 as iI,p9 as sI,pa as oI,pb as nI,pc as rI,pd as aI,pe as dI,pf as cI,pg as lI,ph as hI,pi as uI,pj as pI,pk as gI,pl as fI,pm as mI,pn as wI,po as yI,pp as vI,pq as bI,pr as CI,ps as SI,pt as _I,pu as EI,pv as II,pw as DI,px as AI,py as TI,pz as xI,pA as kI,pB as RI,pC as LI,pD as VI,pE as PI,pF as MI,pG as OI,pH as NI,pI as BI,pJ as FI,pK as KI,pL as WI,pM as GI,pN as UI,pO as HI,pP as zI,pQ as $I,pR as qI,pS as jI,pT as YI,pU as JI,pV as ZI,pW as XI,pX as QI,pY as eD,pZ as tD,p_ as iD,p$ as sD,q0 as oD,q1 as nD,q2 as rD,q3 as aD,q4 as dD,q5 as cD,q6 as lD,q7 as hD,q8 as uD,q9 as pD,qa as Sy,qb as _y,qc as Ey,qd as Iy,qe as Dy,qf as Ay,qg as Ty,qh as xy,qi as gD,qj as fD,qk as mD,ql as wD,qm as yD,qn as vD,qo as bD,qp as CD,qq as SD,qr as _D,qs as ED,qt as ID,qu as DD,qv as ky,qw as AD,qx as Ry,qy as gr,qz as Ly,qA as Vy,qB as jc,qC as Pa,qD as Yc,qE as Ma,qF as TD,qG as Py,qH as Ii,qI as xD,qJ as kD,qK as My,qL as RD,qM as LD,qN as VD,qO as PD,qP as MD,qQ as OD,qR as ND,qS as BD,qT as FD,qU as KD,qV as fr,qW as WD,qX as Oy,qY as Oa,qZ as Ny,q_ as By,q$ as Jc,r0 as Xp,r1 as Na,r2 as Fy,r3 as Ky,r4 as GD,r5 as Wy,r6 as mr,r7 as Gy,r8 as Zc,r9 as Uy,ra as Hy,rb as Ba,rc as zy,rd as $y,re as qy,rf as UD,rg as HD,rh as zD,ri as jy,rj as $D,rk as Xc,rl as $o,rm as qD,rn as jD,ro as YD,rp as JD,rq as ZD,rr as XD,rs as QD,rt as Yy,ru as eA,rv as tA,rw as iA,rx as sA,ry as oA,rz as Zn,rA as Qp,rB as nA,ci as rA,rC as Jy,rD as ra,rE as Al,rF as Cr,gc as aA,rG as Vf,rH as dA,rI as cA,fL as lA,fS as Ki,gk as Pf,rJ as Mf,rK as Zy,rL as hA,rM as qo,rN as uA,rO as pA,M as Gr,rP as Of,rQ as gA,rR as ht,rS as Ae,c as Si,a6 as Wi,rT as Qc,eS as fA,rU as Nf,rV as Bf,rW as mA,o as hd,rX as wA,rY as Xy,rZ as yA,r_ as Ft,r$ as eg,s0 as tg,s1 as el,s2 as ig,s3 as vA,s4 as os,s5 as Xa,s6 as ts,s7 as bA,s8 as Ff,fX as CA,s9 as SA,sa as io,sb as Kf,sc as _A,sd as dh,se as Tl,sf as Wf,sg as Qa,sh as EA,si as IA,sj as Gf,sk as Qy,sl as ev,sm as ed,sn as DA,so as AA,sp as TA,sq as xA,sr as kA,ss as RA,st as LA,su as tv,sv as iv,sw as sv,sx as Rd,sy as VA,sz as Uf,sA as PA,sB as un,sC as xl,sD as MA,sE as Ld,sF as OA,sG as ye,sH as wr,sI as tl,sJ as sg,sK as NA,sL as BA,sM as ov,sN as FA,sO as Hf,sP as Ps,sQ as KA,sR as WA,sS as td,sT as Ur,sU as GA,sV as nv,sW as rv,sX as UA,ex as zf,sY as HA,ez as zA,eA as $A,sZ as qA,eP as jA,s_ as ch,s$ as lh,t0 as hh,t1 as YA,t2 as JA,t3 as ZA,t4 as XA,t5 as QA,t6 as eT,t7 as aa,t8 as og,t9 as tT,ta as iT,tb as $f,tc as sT,td as oT,te as nT,tf as rT,tg as qf,th as av,ti as aT,tj as dT,tk as jf,tl as cT,fs as lT,tm as hT,fr as uT,tn as pT,to as dv,tp as gT,tq as fT,tr as mT,ts as wT,tt as yT,tu as vT,tv as bT,tw as CT,tx as ST,ty as id,fE as _T}from"./index-By7ErQ-m.js";import{f as cv,T as ET}from"./files.contribution._fileEditorFactory-C85bkWoZ.js";import{I as IT}from"./workbenchThemeService.service-CipP-eMQ.js";const lv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Pe(lv);b(class extends X{constructor(){super({id:"workbench.action.closeSidebar",title:x(3479,"Close Primary Side Bar"),category:xe.View,f1:!0,precondition:cb})}run(a){a.get(He).setPartHidden(!0,P.SIDEBAR_PART)}});class DT extends X{constructor(){super({id:"workbench.action.focusSideBar",title:x(3480,"Focus into Primary Side Bar"),category:xe.View,f1:!0,keybinding:{weight:G.WorkbenchContrib,when:null,primary:N.CtrlCmd|y.Digit0}})}async run(e){const t=e.get(He),i=e.get(js);t.isVisible(P.SIDEBAR_PART)||t.setPartHidden(!1,P.SIDEBAR_PART),i.getActivePaneComposite(Y.Sidebar)?.focus()}}b(DT);const hv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Pe(hv);const AT={separatorBorder:oi.transparent};function Fi(a){return a===Z.VERTICAL?Z.HORIZONTAL:Z.VERTICAL}class TT{constructor(e){this.isLayoutEnabled=e}}function xT(a,e){return e===Z.HORIZONTAL?{left:a.start,right:a.end,top:a.orthogonalStart,bottom:a.orthogonalEnd}:{top:a.start,bottom:a.end,left:a.orthogonalStart,right:a.orthogonalEnd}}function kT(a,e){return e===Z.HORIZONTAL?{start:a.left,end:a.right,orthogonalStart:a.top,orthogonalEnd:a.bottom}:{start:a.top,end:a.bottom,orthogonalStart:a.left,orthogonalEnd:a.right}}function hi(a,e){if(Math.abs(a)>e)throw new Error("Invalid index");return lb(a,e+1)}class _e{get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}get absoluteOffset(){return this._absoluteOffset}get absoluteOrthogonalOffset(){return this._absoluteOrthogonalOffset}get styles(){return this._styles}get width(){return this.orientation===Z.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===Z.HORIZONTAL?this.orthogonalSize:this.size}get top(){return this.orientation===Z.HORIZONTAL?this._absoluteOffset:this._absoluteOrthogonalOffset}get left(){return this.orientation===Z.HORIZONTAL?this._absoluteOrthogonalOffset:this._absoluteOffset}get minimumSize(){return this.children.length===0?0:Math.max(...this.children.map((e,t)=>this.splitview.isViewVisible(t)?e.minimumOrthogonalSize:0))}get maximumSize(){return Math.min(...this.children.map((e,t)=>this.splitview.isViewVisible(t)?e.maximumOrthogonalSize:Number.POSITIVE_INFINITY))}get priority(){if(this.children.length===0)return Vi.Normal;const e=this.children.map(t=>typeof t.priority>"u"?Vi.Normal:t.priority);return e.some(t=>t===Vi.High)?Vi.High:e.some(t=>t===Vi.Low)?Vi.Low:Vi.Normal}get proportionalLayout(){return this.children.length===0?!0:this.children.every(e=>e.proportionalLayout)}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get minimumWidth(){return this.orientation===Z.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===Z.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===Z.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===Z.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){if(!(this._boundarySashes.start===e.start&&this._boundarySashes.end===e.end&&this._boundarySashes.orthogonalStart===e.orthogonalStart&&this._boundarySashes.orthogonalEnd===e.orthogonalEnd)){this._boundarySashes=e,this.splitview.orthogonalStartSash=e.orthogonalStart,this.splitview.orthogonalEndSash=e.orthogonalEnd;for(let t=0;t<this.children.length;t++){const i=this.children[t],s=t===0,o=t===this.children.length-1;i.boundarySashes={start:e.orthogonalStart,end:e.orthogonalEnd,orthogonalStart:s?e.start:i.boundarySashes.orthogonalStart,orthogonalEnd:o?e.end:i.boundarySashes.orthogonalEnd}}}}get edgeSnapping(){return this._edgeSnapping}set edgeSnapping(e){if(this._edgeSnapping!==e){this._edgeSnapping=e;for(const t of this.children)t instanceof _e&&(t.edgeSnapping=e);this.updateSplitviewEdgeSnappingEnablement()}}constructor(e,t,i,s,o=0,n=0,r=!1,d){if(this.orientation=e,this.layoutController=t,this.splitviewProportionalLayout=s,this.children=[],this._absoluteOffset=0,this._absoluteOrthogonalOffset=0,this.absoluteOrthogonalSize=0,this._onDidChange=new E,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new E,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this.childrenVisibilityChangeDisposable=new O,this._onDidScroll=new E,this.onDidScrollDisposable=R.None,this.onDidScroll=this._onDidScroll.event,this.childrenChangeDisposable=R.None,this._onDidSashReset=new E,this.onDidSashReset=this._onDidSashReset.event,this.splitviewSashResetDisposable=R.None,this.childrenSashResetDisposable=R.None,this._boundarySashes={},this._edgeSnapping=!1,this._styles=i,this._size=o,this._orthogonalSize=n,this.element=M(".monaco-grid-branch-node"),!d)this.splitview=new ea(this.element,{orientation:e,styles:i,proportionalLayout:s}),this.splitview.layout(o,{orthogonalSize:n,absoluteOffset:0,absoluteOrthogonalOffset:0,absoluteSize:o,absoluteOrthogonalSize:n});else{const h={views:d.map(f=>({view:f.node,size:f.node.size,visible:f.visible!==!1})),size:this.orthogonalSize},p={proportionalLayout:s,orientation:e,styles:i};this.children=d.map(f=>f.node),this.splitview=new ea(this.element,{...p,descriptor:h}),this.children.forEach((f,g)=>{const m=g===0,v=g===this.children.length;f.boundarySashes={start:this.boundarySashes.orthogonalStart,end:this.boundarySashes.orthogonalEnd,orthogonalStart:m?this.boundarySashes.start:this.splitview.sashes[g-1],orthogonalEnd:v?this.boundarySashes.end:this.splitview.sashes[g]}})}const l=L.map(this.splitview.onDidSashReset,h=>[h]);this.splitviewSashResetDisposable=l(this._onDidSashReset.fire,this._onDidSashReset),this.updateChildrenEvents()}style(e){this._styles=e,this.splitview.style(e);for(const t of this.children)t instanceof _e&&t.style(e)}layout(e,t,i){if(this.layoutController.isLayoutEnabled){if(typeof i>"u")throw new Error("Invalid state");this._size=i.orthogonalSize,this._orthogonalSize=e,this._absoluteOffset=i.absoluteOffset+t,this._absoluteOrthogonalOffset=i.absoluteOrthogonalOffset,this.absoluteOrthogonalSize=i.absoluteOrthogonalSize,this.splitview.layout(i.orthogonalSize,{orthogonalSize:e,absoluteOffset:this._absoluteOrthogonalOffset,absoluteOrthogonalOffset:this._absoluteOffset,absoluteSize:i.absoluteOrthogonalSize,absoluteOrthogonalSize:i.absoluteSize}),this.updateSplitviewEdgeSnappingEnablement()}}setVisible(e){for(const t of this.children)t.setVisible(e)}addChild(e,t,i,s){i=hi(i,this.children.length),this.splitview.addView(e,t,i,s),this.children.splice(i,0,e),this.updateBoundarySashes(),this.onDidChildrenChange()}removeChild(e,t){e=hi(e,this.children.length);const i=this.splitview.removeView(e,t);return this.children.splice(e,1),this.updateBoundarySashes(),this.onDidChildrenChange(),i}removeAllChildren(){const e=this.splitview.removeAllViews();return this.children.splice(0,this.children.length),this.updateBoundarySashes(),this.onDidChildrenChange(),e}moveChild(e,t){e=hi(e,this.children.length),t=hi(t,this.children.length),e!==t&&(e<t&&(t-=1),this.splitview.moveView(e,t),this.children.splice(t,0,this.children.splice(e,1)[0]),this.updateBoundarySashes(),this.onDidChildrenChange())}swapChildren(e,t){e=hi(e,this.children.length),t=hi(t,this.children.length),e!==t&&(this.splitview.swapViews(e,t),[this.children[e].boundarySashes,this.children[t].boundarySashes]=[this.children[e].boundarySashes,this.children[t].boundarySashes],[this.children[e],this.children[t]]=[this.children[t],this.children[e]],this.onDidChildrenChange())}resizeChild(e,t){e=hi(e,this.children.length),this.splitview.resizeView(e,t)}isChildExpanded(e){return this.splitview.isViewExpanded(e)}distributeViewSizes(e=!1){if(this.splitview.distributeViewSizes(),e)for(const t of this.children)t instanceof _e&&t.distributeViewSizes(!0)}getChildSize(e){return e=hi(e,this.children.length),this.splitview.getViewSize(e)}isChildVisible(e){return e=hi(e,this.children.length),this.splitview.isViewVisible(e)}setChildVisible(e,t){if(e=hi(e,this.children.length),this.splitview.isViewVisible(e)===t)return;const i=this.splitview.contentSize===0;this.splitview.setViewVisible(e,t);const s=this.splitview.contentSize===0;(t&&i||!t&&s)&&this._onDidVisibilityChange.fire(t)}getChildCachedVisibleSize(e){return e=hi(e,this.children.length),this.splitview.getViewCachedVisibleSize(e)}updateBoundarySashes(){for(let e=0;e<this.children.length;e++)this.children[e].boundarySashes={start:this.boundarySashes.orthogonalStart,end:this.boundarySashes.orthogonalEnd,orthogonalStart:e===0?this.boundarySashes.start:this.splitview.sashes[e-1],orthogonalEnd:e===this.children.length-1?this.boundarySashes.end:this.splitview.sashes[e]}}onDidChildrenChange(){this.updateChildrenEvents(),this._onDidChange.fire(void 0)}updateChildrenEvents(){const e=L.map(L.any(...this.children.map(s=>s.onDidChange)),()=>{});this.childrenChangeDisposable.dispose(),this.childrenChangeDisposable=e(this._onDidChange.fire,this._onDidChange);const t=L.any(...this.children.map((s,o)=>L.map(s.onDidSashReset,n=>[o,...n])));this.childrenSashResetDisposable.dispose(),this.childrenSashResetDisposable=t(this._onDidSashReset.fire,this._onDidSashReset);const i=L.any(L.signal(this.splitview.onDidScroll),...this.children.map(s=>s.onDidScroll));this.onDidScrollDisposable.dispose(),this.onDidScrollDisposable=i(this._onDidScroll.fire,this._onDidScroll),this.childrenVisibilityChangeDisposable.clear(),this.children.forEach((s,o)=>{s instanceof _e&&this.childrenVisibilityChangeDisposable.add(s.onDidVisibilityChange(n=>{this.setChildVisible(o,n)}))})}trySet2x2(e){if(this.children.length!==2||e.children.length!==2)return R.None;if(this.getChildSize(0)!==e.getChildSize(0))return R.None;const[t,i]=this.children,[s,o]=e.children;if(!(t instanceof We)||!(i instanceof We))return R.None;if(!(s instanceof We)||!(o instanceof We))return R.None;this.orientation===Z.VERTICAL?(i.linkedWidthNode=s.linkedHeightNode=t,t.linkedWidthNode=o.linkedHeightNode=i,o.linkedWidthNode=t.linkedHeightNode=s,s.linkedWidthNode=i.linkedHeightNode=o):(s.linkedWidthNode=i.linkedHeightNode=t,o.linkedWidthNode=t.linkedHeightNode=i,t.linkedWidthNode=o.linkedHeightNode=s,i.linkedWidthNode=s.linkedHeightNode=o);const n=this.splitview.sashes[0],r=e.splitview.sashes[0];return n.linkedSash=r,r.linkedSash=n,this._onDidChange.fire(void 0),e._onDidChange.fire(void 0),ae(()=>{n.linkedSash=r.linkedSash=void 0,t.linkedHeightNode=t.linkedWidthNode=void 0,i.linkedHeightNode=i.linkedWidthNode=void 0,s.linkedHeightNode=s.linkedWidthNode=void 0,o.linkedHeightNode=o.linkedWidthNode=void 0})}updateSplitviewEdgeSnappingEnablement(){this.splitview.startSnappingEnabled=this._edgeSnapping||this._absoluteOrthogonalOffset>0,this.splitview.endSnappingEnabled=this._edgeSnapping||this._absoluteOrthogonalOffset+this._size<this.absoluteOrthogonalSize}dispose(){for(const e of this.children)e.dispose();this._onDidChange.dispose(),this._onDidSashReset.dispose(),this._onDidVisibilityChange.dispose(),this.childrenVisibilityChangeDisposable.dispose(),this.splitviewSashResetDisposable.dispose(),this.childrenSashResetDisposable.dispose(),this.childrenChangeDisposable.dispose(),this.onDidScrollDisposable.dispose(),this.splitview.dispose()}}function RT(a){const[e,t]=L.split(a.onDidChange,Er);return L.any(t,L.map(L.latch(L.map(e,i=>[a.minimumWidth,a.maximumWidth,a.minimumHeight,a.maximumHeight]),Bo),i=>{}))}class We{get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}get linkedWidthNode(){return this._linkedWidthNode}set linkedWidthNode(e){this._onDidLinkedWidthNodeChange.input=e?e._onDidViewChange:L.None,this._linkedWidthNode=e,this._onDidSetLinkedNode.fire(void 0)}get linkedHeightNode(){return this._linkedHeightNode}set linkedHeightNode(e){this._onDidLinkedHeightNodeChange.input=e?e._onDidViewChange:L.None,this._linkedHeightNode=e,this._onDidSetLinkedNode.fire(void 0)}constructor(e,t,i,s,o=0){this.view=e,this.orientation=t,this.layoutController=i,this._size=0,this.absoluteOffset=0,this.absoluteOrthogonalOffset=0,this.onDidScroll=L.None,this.onDidSashReset=L.None,this._onDidLinkedWidthNodeChange=new Rs,this._linkedWidthNode=void 0,this._onDidLinkedHeightNodeChange=new Rs,this._linkedHeightNode=void 0,this._onDidSetLinkedNode=new E,this.disposables=new O,this._boundarySashes={},this.cachedWidth=0,this.cachedHeight=0,this.cachedTop=0,this.cachedLeft=0,this._orthogonalSize=s,this._size=o;const n=RT(e);this._onDidViewChange=L.map(n,r=>r&&(this.orientation===Z.VERTICAL?r.width:r.height),this.disposables),this.onDidChange=L.any(this._onDidViewChange,this._onDidSetLinkedNode.event,this._onDidLinkedWidthNodeChange.event,this._onDidLinkedHeightNodeChange.event)}get width(){return this.orientation===Z.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===Z.HORIZONTAL?this.size:this.orthogonalSize}get top(){return this.orientation===Z.HORIZONTAL?this.absoluteOffset:this.absoluteOrthogonalOffset}get left(){return this.orientation===Z.HORIZONTAL?this.absoluteOrthogonalOffset:this.absoluteOffset}get element(){return this.view.element}get minimumWidth(){return this.linkedWidthNode?Math.max(this.linkedWidthNode.view.minimumWidth,this.view.minimumWidth):this.view.minimumWidth}get maximumWidth(){return this.linkedWidthNode?Math.min(this.linkedWidthNode.view.maximumWidth,this.view.maximumWidth):this.view.maximumWidth}get minimumHeight(){return this.linkedHeightNode?Math.max(this.linkedHeightNode.view.minimumHeight,this.view.minimumHeight):this.view.minimumHeight}get maximumHeight(){return this.linkedHeightNode?Math.min(this.linkedHeightNode.view.maximumHeight,this.view.maximumHeight):this.view.maximumHeight}get minimumSize(){return this.orientation===Z.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===Z.HORIZONTAL?this.maximumHeight:this.maximumWidth}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return this.view.snap}get minimumOrthogonalSize(){return this.orientation===Z.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===Z.HORIZONTAL?this.maximumWidth:this.maximumHeight}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.view.setBoundarySashes?.(xT(e,this.orientation))}layout(e,t,i){if(this.layoutController.isLayoutEnabled){if(typeof i>"u")throw new Error("Invalid state");this._size=e,this._orthogonalSize=i.orthogonalSize,this.absoluteOffset=i.absoluteOffset+t,this.absoluteOrthogonalOffset=i.absoluteOrthogonalOffset,this._layout(this.width,this.height,this.top,this.left)}}_layout(e,t,i,s){this.cachedWidth===e&&this.cachedHeight===t&&this.cachedTop===i&&this.cachedLeft===s||(this.cachedWidth=e,this.cachedHeight=t,this.cachedTop=i,this.cachedLeft=s,this.view.layout(e,t,i,s))}setVisible(e){this.view.setVisible?.(e)}dispose(){this.disposables.dispose()}}function uv(a,e,t){if(a instanceof _e){const i=new _e(Fi(a.orientation),a.layoutController,a.styles,a.splitviewProportionalLayout,e,t,a.edgeSnapping);let s=0;for(let o=a.children.length-1;o>=0;o--){const n=a.children[o],r=n instanceof _e?n.orthogonalSize:n.size;let d=a.size===0?0:Math.round(e*r/a.size);s+=d,o===0&&(d+=e-s),i.addChild(uv(n,t,d),d,0,!0)}return a.dispose(),i}else{const i=new We(a.view,Fi(a.orientation),a.layoutController,t);return a.dispose(),i}}class In{get root(){return this._root}set root(e){const t=this._root;t&&(t.element.remove(),t.dispose()),this._root=e,this.element.appendChild(e.element),this.onDidSashResetRelay.input=e.onDidSashReset,this._onDidChange.input=L.map(e.onDidChange,()=>{}),this._onDidScroll.input=e.onDidScroll}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get orientation(){return this._root.orientation}get boundarySashes(){return this._boundarySashes}set orientation(e){if(this._root.orientation===e)return;const{size:t,orthogonalSize:i,absoluteOffset:s,absoluteOrthogonalOffset:o}=this._root;this.root=uv(this._root,i,t),this.root.layout(t,0,{orthogonalSize:i,absoluteOffset:o,absoluteOrthogonalOffset:s,absoluteSize:t,absoluteOrthogonalSize:i}),this.boundarySashes=this.boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.root.boundarySashes=kT(e,this.orientation)}set edgeSnapping(e){this.root.edgeSnapping=e}constructor(e={}){this.onDidSashResetRelay=new Rs,this._onDidScroll=new Rs,this._onDidChange=new Rs,this._boundarySashes={},this.disposable2x2=R.None,this.onDidSashReset=this.onDidSashResetRelay.event,this.onDidScroll=this._onDidScroll.event,this.onDidChange=this._onDidChange.event,this.maximizedNode=void 0,this._onDidChangeViewMaximized=new E,this.onDidChangeViewMaximized=this._onDidChangeViewMaximized.event,this.element=M(".monaco-grid-view"),this.styles=e.styles||AT,this.proportionalLayout=typeof e.proportionalLayout<"u"?!!e.proportionalLayout:!0,this.layoutController=new TT(!1),this.root=new _e(Z.VERTICAL,this.layoutController,this.styles,this.proportionalLayout)}style(e){this.styles=e,this.root.style(e)}layout(e,t,i=0,s=0){this.layoutController.isLayoutEnabled=!0;const[o,n,r,d]=this.root.orientation===Z.HORIZONTAL?[t,e,i,s]:[e,t,s,i];this.root.layout(o,0,{orthogonalSize:n,absoluteOffset:r,absoluteOrthogonalOffset:d,absoluteSize:o,absoluteOrthogonalSize:n})}addView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView(),this.disposable2x2.dispose(),this.disposable2x2=R.None;const[s,o]=Ne(i),[n,r]=this.getNode(s);if(r instanceof _e){const d=new We(e,Fi(r.orientation),this.layoutController,r.orthogonalSize);try{r.addChild(d,t,o)}catch(l){throw d.dispose(),l}}else{const[,d]=Ne(n),[,l]=Ne(s);let h=0;const p=d.getChildCachedVisibleSize(l);typeof p=="number"&&(h=Ht.Invisible(p)),d.removeChild(l).dispose();const g=new _e(r.orientation,r.layoutController,this.styles,this.proportionalLayout,r.size,r.orthogonalSize,d.edgeSnapping);d.addChild(g,r.size,l);const m=new We(r.view,d.orientation,this.layoutController,r.size);g.addChild(m,h,0),typeof t!="number"&&t.type==="split"&&(t=Ht.Split(0));const v=new We(e,d.orientation,this.layoutController,r.size);g.addChild(v,t,o)}this.trySet2x2()}removeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView(),this.disposable2x2.dispose(),this.disposable2x2=R.None;const[i,s]=Ne(e),[o,n]=this.getNode(i);if(!(n instanceof _e))throw new Error("Invalid location");const r=n.children[s];if(!(r instanceof We))throw new Error("Invalid location");if(n.removeChild(s,t),r.dispose(),n.children.length===0)throw new Error("Invalid grid state");if(n.children.length>1)return this.trySet2x2(),r.view;if(o.length===0){const g=n.children[0];return g instanceof We||(n.removeChild(0),n.dispose(),this.root=g,this.boundarySashes=this.boundarySashes,this.trySet2x2()),r.view}const[,d]=Ne(o),[,l]=Ne(i),h=n.isChildVisible(0),p=n.removeChild(0),f=d.children.map((g,m)=>d.getChildSize(m));if(d.removeChild(l,t),n.dispose(),p instanceof _e){f.splice(l,1,...p.children.map(m=>m.size));const g=p.removeAllChildren();for(let m=0;m<g.length;m++)d.addChild(g[m],g[m].size,l+m)}else{const g=new We(p.view,Fi(p.orientation),this.layoutController,p.size),m=h?p.orthogonalSize:Ht.Invisible(p.orthogonalSize);d.addChild(g,m,l)}p.dispose();for(let g=0;g<f.length;g++)d.resizeChild(g,f[g]);return this.trySet2x2(),r.view}moveView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,s]=this.getNode(e);if(!(s instanceof _e))throw new Error("Invalid location");s.moveChild(t,i),this.trySet2x2()}swapViews(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=Ne(e),[,o]=this.getNode(i);if(!(o instanceof _e))throw new Error("Invalid from location");const n=o.getChildSize(s),r=o.children[s];if(!(r instanceof We))throw new Error("Invalid from location");const[d,l]=Ne(t),[,h]=this.getNode(d);if(!(h instanceof _e))throw new Error("Invalid to location");const p=h.getChildSize(l),f=h.children[l];if(!(f instanceof We))throw new Error("Invalid to location");o===h?o.swapChildren(s,l):(o.removeChild(s),h.removeChild(l),o.addChild(f,n,s),h.addChild(r,p,l)),this.trySet2x2()}resizeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=Ne(e),[o,n]=this.getNode(i);if(!(n instanceof _e))throw new Error("Invalid location");if(!t.width&&!t.height)return;const[r,d]=n.orientation===Z.HORIZONTAL?[t.width,t.height]:[t.height,t.width];if(typeof d=="number"&&o.length>0){const[,l]=Ne(o),[,h]=Ne(i);l.resizeChild(h,d)}typeof r=="number"&&n.resizeChild(s,r),this.trySet2x2()}getViewSize(e){if(!e)return{width:this.root.width,height:this.root.height};const[,t]=this.getNode(e);return{width:t.width,height:t.height}}getViewCachedVisibleSize(e){const[t,i]=Ne(e),[,s]=this.getNode(t);if(!(s instanceof _e))throw new Error("Invalid location");return s.getChildCachedVisibleSize(i)}expandView(e){this.hasMaximizedView()&&this.exitMaximizedView();const[t,i]=this.getNode(e);if(!(i instanceof We))throw new Error("Invalid location");for(let s=0;s<t.length;s++)t[s].resizeChild(e[s],Number.POSITIVE_INFINITY)}isViewExpanded(e){if(this.hasMaximizedView())return!1;const[t,i]=this.getNode(e);if(!(i instanceof We))throw new Error("Invalid location");for(let s=0;s<t.length;s++)if(!t[s].isChildExpanded(e[s]))return!1;return!0}maximizeView(e){const[,t]=this.getNode(e);if(!(t instanceof We))throw new Error("Location is not a LeafNode");if(this.maximizedNode===t)return;this.hasMaximizedView()&&this.exitMaximizedView();function i(s,o){for(let n=0;n<s.children.length;n++){const r=s.children[n];r instanceof We?r!==o&&s.setChildVisible(n,!1):i(r,o)}}i(this.root,t),this.maximizedNode=t,this._onDidChangeViewMaximized.fire(!0)}exitMaximizedView(){if(!this.maximizedNode)return;this.maximizedNode=void 0;function e(t){for(let i=t.children.length-1;i>=0;i--){const s=t.children[i];s instanceof We?t.setChildVisible(i,!0):e(s)}}e(this.root),this._onDidChangeViewMaximized.fire(!1)}hasMaximizedView(){return this.maximizedNode!==void 0}isViewMaximized(e){const[,t]=this.getNode(e);if(!(t instanceof We))throw new Error("Location is not a LeafNode");return t===this.maximizedNode}distributeViewSizes(e){if(this.hasMaximizedView()&&this.exitMaximizedView(),!e){this.root.distributeViewSizes(!0);return}const[,t]=this.getNode(e);if(!(t instanceof _e))throw new Error("Invalid location");t.distributeViewSizes(),this.trySet2x2()}isViewVisible(e){const[t,i]=Ne(e),[,s]=this.getNode(t);if(!(s instanceof _e))throw new Error("Invalid from location");return s.isChildVisible(i)}setViewVisible(e,t){if(this.hasMaximizedView()){this.exitMaximizedView();return}const[i,s]=Ne(e),[,o]=this.getNode(i);if(!(o instanceof _e))throw new Error("Invalid from location");o.setChildVisible(s,t)}getView(e){const t=e?this.getNode(e)[1]:this._root;return this._getViews(t,this.orientation)}static deserialize(e,t,i={}){if(typeof e.orientation!="number")throw new Error("Invalid JSON: 'orientation' property must be a number.");if(typeof e.width!="number")throw new Error("Invalid JSON: 'width' property must be a number.");if(typeof e.height!="number")throw new Error("Invalid JSON: 'height' property must be a number.");if(e.root?.type!=="branch")throw new Error("Invalid JSON: 'root' property must have 'type' value of branch.");const s=e.orientation,o=e.height,n=new In(i);return n._deserialize(e.root,s,t,o),n}_deserialize(e,t,i,s){this.root=this._deserializeNode(e,t,i,s)}_deserializeNode(e,t,i,s){let o;if(e.type==="branch"){const r=e.data.map(d=>({node:this._deserializeNode(d,Fi(t),i,e.size),visible:d.visible}));o=new _e(t,this.layoutController,this.styles,this.proportionalLayout,e.size,s,void 0,r)}else o=new We(i.fromJSON(e.data),t,this.layoutController,s,e.size),e.maximized&&!this.maximizedNode&&(this.maximizedNode=o,this._onDidChangeViewMaximized.fire(!0));return o}_getViews(e,t,i){const s={top:e.top,left:e.left,width:e.width,height:e.height};if(e instanceof We)return{view:e.view,box:s,cachedVisibleSize:i,maximized:this.maximizedNode===e};const o=[];for(let n=0;n<e.children.length;n++){const r=e.children[n],d=e.getChildCachedVisibleSize(n);o.push(this._getViews(r,Fi(t),d))}return{children:o,box:s}}getNode(e,t=this.root,i=[]){if(e.length===0)return[i,t];if(!(t instanceof _e))throw new Error("Invalid location");const[s,...o]=e;if(s<0||s>=t.children.length)throw new Error("Invalid location");const n=t.children[s];return i.push(t),this.getNode(o,n,i)}trySet2x2(){if(this.disposable2x2.dispose(),this.disposable2x2=R.None,this.root.children.length!==2)return;const[e,t]=this.root.children;!(e instanceof _e)||!(t instanceof _e)||(this.disposable2x2=e.trySet2x2(t))}getViewMap(e,t){t||(t=this.root),t instanceof _e?t.children.forEach(i=>this.getViewMap(e,i)):e.set(t.view,t.element)}dispose(){this.onDidSashResetRelay.dispose(),this.root.dispose(),this.element.remove()}}Pe(hv);var de;(function(a){a[a.Up=0]="Up",a[a.Down=1]="Down",a[a.Left=2]="Left",a[a.Right=3]="Right"})(de||(de={}));function LT(a){switch(a){case de.Up:return de.Down;case de.Down:return de.Up;case de.Left:return de.Right;case de.Right:return de.Left}}function po(a){return!!a.children}function pv(a,e){if(e.length===0)return a;if(!po(a))throw new Error("Invalid location");const[t,...i]=e;return pv(a.children[t],i)}function VT(a,e){return!(a.start>=e.end||e.start>=a.end)}function gv(a,e){const t=ng(e),i=e===de.Up?a.top:e===de.Right?a.left+a.width:e===de.Down?a.top+a.height:a.left,s={start:t===Z.HORIZONTAL?a.top:a.left,end:t===Z.HORIZONTAL?a.top+a.height:a.left+a.width};return{offset:i,range:s}}function PT(a,e,t){const i=[];function s(o,n,r){if(po(o))for(const d of o.children)s(d,n,r);else{const{offset:d,range:l}=gv(o.box,n);d===r.offset&&VT(l,r.range)&&i.push(o)}}return s(a,e,t),i}function uh(a,e){return e.length%2===0?Fi(a):a}function ng(a){return a===de.Up||a===de.Down?Z.VERTICAL:Z.HORIZONTAL}function Yf(a,e,t){const i=uh(a,e),s=ng(t);if(i===s){let[o,n]=Ne(e);return(t===de.Right||t===de.Down)&&(n+=1),[...o,n]}else{const o=t===de.Right||t===de.Down?1:0;return[...e,o]}}function MT(a){const e=a.parentElement;if(!e)throw new Error("Invalid grid element");let t=e.firstElementChild,i=0;for(;t!==a&&t!==e.lastElementChild&&t;)t=t.nextElementSibling,i++;return i}function fv(a){const e=a.parentElement;if(!e)throw new Error("Invalid grid element");if(/\bmonaco-grid-view\b/.test(e.className))return[];const t=MT(e),i=e.parentElement.parentElement.parentElement.parentElement;return[...fv(i),t]}var Dn;(function(a){a.Distribute={type:"distribute"},a.Split={type:"split"},a.Auto={type:"auto"};function e(t){return{type:"invisible",cachedVisibleSize:t}}a.Invisible=e})(Dn||(Dn={}));class OT extends R{get orientation(){return this.gridview.orientation}set orientation(e){this.gridview.orientation=e}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumWidth(){return this.gridview.minimumWidth}get minimumHeight(){return this.gridview.minimumHeight}get maximumWidth(){return this.gridview.maximumWidth}get maximumHeight(){return this.gridview.maximumHeight}get boundarySashes(){return this.gridview.boundarySashes}set boundarySashes(e){this.gridview.boundarySashes=e}set edgeSnapping(e){this.gridview.edgeSnapping=e}get element(){return this.gridview.element}constructor(e,t={}){super(),this.views=new Map,this.didLayout=!1,e instanceof In?(this.gridview=e,this.gridview.getViewMap(this.views)):this.gridview=new In(t),this._register(this.gridview),this._register(this.gridview.onDidSashReset(this.onDidSashReset,this)),e instanceof In||this._addView(e,0,[0]),this.onDidChange=this.gridview.onDidChange,this.onDidScroll=this.gridview.onDidScroll,this.onDidChangeViewMaximized=this.gridview.onDidChangeViewMaximized}style(e){this.gridview.style(e)}layout(e,t,i=0,s=0){this.gridview.layout(e,t,i,s),this.didLayout=!0}addView(e,t,i,s){if(this.views.has(e))throw new Error("Can't add same view twice");const o=ng(s);this.views.size===1&&this.orientation!==o&&(this.orientation=o);const n=this.getViewLocation(i),r=Yf(this.gridview.orientation,n,s);let d;if(typeof t=="number")d=t;else if(t.type==="split"){const[,l]=Ne(n);d=Ht.Split(l)}else if(t.type==="distribute")d=Ht.Distribute;else if(t.type==="auto"){const[,l]=Ne(n);d=Ht.Auto(l)}else d=t;this._addView(e,d,r)}addViewAt(e,t,i){if(this.views.has(e))throw new Error("Can't add same view twice");let s;typeof t=="number"?s=t:t.type==="distribute"?s=Ht.Distribute:s=t,this._addView(e,s,i)}_addView(e,t,i){this.views.set(e,e.element),this.gridview.addView(e,t,i)}removeView(e,t){if(this.views.size===1)throw new Error("Can't remove last view");const i=this.getViewLocation(e);let s;if(t?.type==="distribute")s=Ht.Distribute;else if(t?.type==="auto"){const o=i[i.length-1];s=Ht.Auto(o===0?1:o-1)}this.gridview.removeView(i,s),this.views.delete(e)}moveView(e,t,i,s){const o=this.getViewLocation(e),[n,r]=Ne(o),d=this.getViewLocation(i),l=Yf(this.gridview.orientation,d,s),[h,p]=Ne(l);Bo(n,h)?this.gridview.moveView(n,r,p):(this.removeView(e,typeof t=="number"?void 0:t),this.addView(e,t,i,s))}moveViewTo(e,t){const i=this.getViewLocation(e),[s,o]=Ne(i),[n,r]=Ne(t);if(Bo(s,n))this.gridview.moveView(s,o,r);else{const d=this.getViewSize(e),l=uh(this.gridview.orientation,i),h=this.getViewCachedVisibleSize(e),p=typeof h>"u"?l===Z.HORIZONTAL?d.width:d.height:Dn.Invisible(h);this.removeView(e),this.addViewAt(e,p,t)}}swapViews(e,t){const i=this.getViewLocation(e),s=this.getViewLocation(t);return this.gridview.swapViews(i,s)}resizeView(e,t){const i=this.getViewLocation(e);return this.gridview.resizeView(i,t)}isViewExpanded(e){const t=this.getViewLocation(e);return this.gridview.isViewExpanded(t)}isViewMaximized(e){const t=this.getViewLocation(e);return this.gridview.isViewMaximized(t)}hasMaximizedView(){return this.gridview.hasMaximizedView()}getViewSize(e){if(!e)return this.gridview.getViewSize();const t=this.getViewLocation(e);return this.gridview.getViewSize(t)}getViewCachedVisibleSize(e){const t=this.getViewLocation(e);return this.gridview.getViewCachedVisibleSize(t)}maximizeView(e){if(this.views.size<2)throw new Error("At least two views are required to maximize a view");const t=this.getViewLocation(e);this.gridview.maximizeView(t)}exitMaximizedView(){this.gridview.exitMaximizedView()}expandView(e){const t=this.getViewLocation(e);this.gridview.expandView(t)}distributeViewSizes(){this.gridview.distributeViewSizes()}isViewVisible(e){const t=this.getViewLocation(e);return this.gridview.isViewVisible(t)}setViewVisible(e,t){const i=this.getViewLocation(e);this.gridview.setViewVisible(i,t)}getViews(){return this.gridview.getView()}getNeighborViews(e,t,i=!1){if(!this.didLayout)throw new Error("Can't call getNeighborViews before first layout");const s=this.getViewLocation(e),o=this.getViews(),n=pv(o,s);let r=gv(n.box,t);return i&&(t===de.Up&&n.box.top===0?r={offset:o.box.top+o.box.height,range:r.range}:t===de.Right&&n.box.left+n.box.width===o.box.width?r={offset:0,range:r.range}:t===de.Down&&n.box.top+n.box.height===o.box.height?r={offset:0,range:r.range}:t===de.Left&&n.box.left===0&&(r={offset:o.box.left+o.box.width,range:r.range})),PT(o,LT(t),r).map(d=>d.view)}getViewLocation(e){const t=this.views.get(e);if(!t)throw new Error("View not found");return fv(t)}onDidSashReset(e){const t=o=>{const n=this.gridview.getView(o);if(po(n))return!1;const r=uh(this.orientation,o),d=r===Z.HORIZONTAL?n.view.preferredWidth:n.view.preferredHeight;if(typeof d!="number")return!1;const l=r===Z.HORIZONTAL?{width:Math.round(d)}:{height:Math.round(d)};return this.gridview.resizeView(o,l),!0};if(t(e))return;const[i,s]=Ne(e);t([...i,s+1])||this.gridview.distributeViewSizes(i)}}class ks extends OT{constructor(){super(...arguments),this.initialLayoutContext=!0}static serializeNode(e,t){const i=t===Z.VERTICAL?e.box.width:e.box.height;if(!po(e)){const o={type:"leaf",data:e.view.toJSON(),size:i};return typeof e.cachedVisibleSize=="number"?(o.size=e.cachedVisibleSize,o.visible=!1):e.maximized&&(o.maximized=!0),o}const s=e.children.map(o=>ks.serializeNode(o,Fi(t)));return s.some(o=>o.visible!==!1)?{type:"branch",data:s,size:i}:{type:"branch",data:s,size:i,visible:!1}}static deserialize(e,t,i={}){if(typeof e.orientation!="number")throw new Error("Invalid JSON: 'orientation' property must be a number.");if(typeof e.width!="number")throw new Error("Invalid JSON: 'width' property must be a number.");if(typeof e.height!="number")throw new Error("Invalid JSON: 'height' property must be a number.");const s=In.deserialize(e,t,i);return new ks(s,i)}static from(e,t={}){return ks.deserialize(bv(e),{fromJSON:i=>i},t)}serialize(){return{root:ks.serializeNode(this.getViews(),this.orientation),orientation:this.orientation,width:this.width,height:this.height}}layout(e,t,i=0,s=0){super.layout(e,t,i,s),this.initialLayoutContext&&(this.initialLayoutContext=!1,this.gridview.trySet2x2())}}function mv(a){return!!a.groups}function wv(a,e){if(!e&&a.groups&&a.groups.length<=1&&(a.groups=void 0),!mv(a))return;let t=0,i=0;for(const r of a.groups)wv(r,!1),r.size&&(t+=r.size,i++);const s=i>0?t:1,o=a.groups.length-i,n=s/o;for(const r of a.groups)r.size||(r.size=n)}function yv(a){return mv(a)?{type:"branch",data:a.groups.map(e=>yv(e)),size:a.size}:{type:"leaf",data:a.data,size:a.size}}function vv(a,e){if(a.type==="branch"){const t=a.data.map(i=>vv(i,Fi(e)));if(e===Z.VERTICAL){const i=a.size||(t.length===0?void 0:Math.max(...t.map(o=>o.width||0))),s=t.length===0?void 0:t.reduce((o,n)=>o+(n.height||0),0);return{width:i,height:s}}else{const i=t.length===0?void 0:t.reduce((o,n)=>o+(n.width||0),0),s=a.size||(t.length===0?void 0:Math.max(...t.map(o=>o.height||0)));return{width:i,height:s}}}else{const t=e===Z.VERTICAL?a.size:void 0,i=e===Z.VERTICAL?void 0:a.size;return{width:t,height:i}}}function bv(a){wv(a,!0);const e=yv(a),{width:t,height:i}=vv(e,a.orientation);return{root:e,orientation:a.orientation,width:t||1,height:i||1}}const NT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));let ph=class extends ub{constructor(e,t,i,s,o,n,r,d){super(e,t,o,i),this.storageService=i,this.instantiationService=s,this.contextMenuService=n,this.extensionService=r,this.contextService=d}create(e){super.create(e),this.viewPaneContainer=this._register(this.createViewPaneContainer(e)),this._register(this.viewPaneContainer.onTitleAreaUpdate(()=>this.updateTitleArea())),this.viewPaneContainer.create(e)}setVisible(e){super.setVisible(e),this.viewPaneContainer?.setVisible(e)}layout(e){this.viewPaneContainer?.layout(e)}setBoundarySashes(e){this.viewPaneContainer?.setBoundarySashes(e)}getOptimalWidth(){return this.viewPaneContainer?.getOptimalWidth()??0}openView(e,t){return this.viewPaneContainer?.openView(e,t)}getViewPaneContainer(){return this.viewPaneContainer}getActionsContext(){return this.getViewPaneContainer()?.getActionsContext()}getContextMenuActions(){return this.viewPaneContainer?.menuActions?.getContextMenuActions()??[]}getMenuIds(){const e=[];return this.viewPaneContainer?.menuActions&&(e.push(this.viewPaneContainer.menuActions.menuId),this.viewPaneContainer.isViewMergedWithContainer()&&e.push(this.viewPaneContainer.panes[0].menuActions.menuId)),e}getActions(){const e=[];if(this.viewPaneContainer?.menuActions&&(e.push(...this.viewPaneContainer.menuActions.getPrimaryActions()),this.viewPaneContainer.isViewMergedWithContainer())){const t=this.viewPaneContainer.panes[0];t.shouldShowFilterInHeader()&&e.push(pb),e.push(...t.menuActions.getPrimaryActions())}return e}getSecondaryActions(){if(!this.viewPaneContainer?.menuActions)return[];const e=this.viewPaneContainer.isViewMergedWithContainer()?this.viewPaneContainer.panes[0].menuActions.getSecondaryActions():[];let t=this.viewPaneContainer.menuActions.getSecondaryActions();const i=t.findIndex(s=>s instanceof gb&&s.item.submenu===Ip);if(i!==-1){const s=t[i];s.actions.some(({enabled:o})=>o)?t.length===1&&e.length===0?t=s.actions.slice():i!==0&&(t=[s,...t.slice(0,i),...t.slice(i+1)]):t.splice(i,1)}return t.length&&e.length?[...t,new hs,...e]:t.length?t:e}getActionViewItem(e,t){return this.viewPaneContainer?.getActionViewItem(e,t)}getTitle(){return this.viewPaneContainer?.getTitle()??""}focus(){super.focus(),this.viewPaneContainer?.focus()}};ph=D([u(1,mt),u(2,ce),u(3,F),u(4,me),u(5,at),u(6,At),u(7,bs)],ph);class rg extends hb{static create(e,t,i,s,o,n,r){return new rg(e,t,i,s,o,n,r)}constructor(e,t,i,s,o,n,r){super(e,t,i,s,o,n),this.iconUrl=r}}const Gi={Viewlets:"workbench.contributions.viewlets",Panels:"workbench.contributions.panels",Auxiliary:"workbench.contributions.auxiliary"};class ag extends fb{registerPaneComposite(e){super.registerComposite(e)}deregisterPaneComposite(e){super.deregisterComposite(e)}getPaneComposite(e){return this.getComposite(e)}getPaneComposites(){return this.getComposites()}}z.add(Gi.Viewlets,new ag);z.add(Gi.Panels,new ag);z.add(Gi.Auxiliary,new ag);const BT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Pe(BT);class FT extends Lm{constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m,v,C,T){super(C,T,d,t,s),this.notificationService=e,this.storageService=t,this.contextMenuService=i,this.keybindingService=o,this.hoverService=n,this.instantiationService=r,this.registry=l,this.activeCompositeSettingsKey=h,this.defaultCompositeId=p,this.nameForTelemetry=f,this.compositeCSSClass=g,this.titleForegroundColor=m,this.titleBorderColor=v,this.onDidCompositeOpen=this._register(new E),this.onDidCompositeClose=this._register(new E),this.mapCompositeToCompositeContainer=new Map,this.mapActionsBindingToComposite=new Map,this.instantiatedCompositeItems=new Map,this.actionsListener=this._register(new Ie),this.lastActiveCompositeId=t.get(h,H.WORKSPACE,this.defaultCompositeId),this.toolbarHoverDelegate=this._register(mb())}openComposite(e,t){if(this.activeComposite?.getId()===e)return t&&this.activeComposite.focus(),this.activeComposite;if(this.element)return this.doOpenComposite(e,t)}doOpenComposite(e,t=!1){const i=wb.nextId();this.currentCompositeOpenToken=i,this.activeComposite&&this.hideActiveComposite(),this.updateTitle(e);const s=this.createComposite(e,!0);if(!(this.currentCompositeOpenToken!==i||this.activeComposite&&this.activeComposite.getId()!==s.getId()))return this.activeComposite?.getId()===s.getId()?(t&&s.focus(),this.onDidCompositeOpen.fire({composite:s,focus:t}),s):(this.showComposite(s),t&&s.focus(),s&&this.onDidCompositeOpen.fire({composite:s,focus:t}),s)}createComposite(e,t){const i=this.instantiatedCompositeItems.get(e);if(i)return i.composite;const s=this.registry.getComposite(e);if(s){const o=this,n=new yb(Ee(this.progressBar),new class extends vb{constructor(){super(s.id,!!t),this._register(o.onDidCompositeOpen.event(h=>this.onScopeOpened(h.composite.getId()))),this._register(o.onDidCompositeClose.event(h=>this.onScopeClosed(h.getId())))}}),r=this._register(this.instantiationService.createChild(new ta([bb,n]))),d=s.instantiate(r),l=new O;return this.instantiatedCompositeItems.set(e,{composite:d,disposable:l,progress:n}),l.add(d.onTitleAreaUpdate(()=>this.onTitleAreaUpdate(d.getId()),this)),l.add(r),d}throw new Error(`Unable to find composite with id ${e}`)}showComposite(e){this.activeComposite=e;const t=this.activeComposite.getId();t!==this.defaultCompositeId?this.storageService.store(this.activeCompositeSettingsKey,t,H.WORKSPACE,Re.MACHINE):this.storageService.remove(this.activeCompositeSettingsKey,H.WORKSPACE),this.lastActiveCompositeId=this.activeComposite.getId();let i=this.mapCompositeToCompositeContainer.get(e.getId());if(i||(i=M(".composite"),i.classList.add(...this.compositeCSSClass.split(" ")),i.id=e.getId(),e.create(i),e.updateStyles(),this.mapCompositeToCompositeContainer.set(e.getId(),i)),!this.activeComposite||e.getId()!==this.activeComposite.getId())return;this.getContentArea()?.appendChild(i),ia(i);const o=Ee(this.toolBar);o.actionRunner=e.getActionRunner();const n=this.registry.getComposite(e.getId());n&&n.name!==e.getTitle()&&this.updateTitle(e.getId(),e.getTitle());let r=this.mapActionsBindingToComposite.get(e.getId());r||(r=this.collectCompositeActions(e),this.mapActionsBindingToComposite.set(e.getId(),r)),r(),this.actionsListener.value=o.actionRunner.onDidRun(d=>{d.error&&!Ec(d.error)&&this.notificationService.error(d.error)}),e.setVisible(!0),!(!this.activeComposite||e.getId()!==this.activeComposite.getId())&&(this.contentAreaSize&&e.layout(this.contentAreaSize),this.boundarySashes&&e.setBoundarySashes(this.boundarySashes))}onTitleAreaUpdate(e){const t=this.instantiatedCompositeItems.get(e);if(t&&this.updateTitle(e,t.composite.getTitle()),this.activeComposite?.getId()===e){const i=this.collectCompositeActions(this.activeComposite);this.mapActionsBindingToComposite.set(this.activeComposite.getId(),i),i()}else this.mapActionsBindingToComposite.delete(e)}updateTitle(e,t){const i=this.registry.getComposite(e);if(!i||!this.titleLabel)return;t||(t=i.name);const s=this.keybindingService.lookupKeybinding(e);this.titleLabel.updateTitle(e,t,s?.getLabel()??void 0),Ee(this.toolBar).setAriaLabel(c(2899,"{0} actions",t))}collectCompositeActions(e){const t=e?.getMenuIds(),i=e?.getActions().slice(0)||[],s=e?.getSecondaryActions().slice(0)||[],o=Ee(this.toolBar);return o.context=this.actionsContextProvider(),()=>o.setActions(Hn(i),Hn(s),t)}getActiveComposite(){return this.activeComposite}getLastActiveCompositeId(){return this.lastActiveCompositeId}hideActiveComposite(){if(!this.activeComposite)return;const e=this.activeComposite;this.activeComposite=void 0;const t=this.mapCompositeToCompositeContainer.get(e.getId());return e.setVisible(!1),t&&(t.remove(),sa(t)),this.progressBar?.stop().hide(),this.toolBar&&this.collectCompositeActions()(),this.onDidCompositeClose.fire(e),e}createTitleArea(e){const t=ge(e,M(".composite"));t.classList.add("title"),this.titleLabel=this.createTitleLabel(t);const i=ge(t,M(".title-actions"));return this.toolBar=this._register(this.instantiationService.createInstance(Dp,i,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Fo.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(2900,"Views and More Actions..."),telemetrySource:this.nameForTelemetry,hoverDelegate:this.toolbarHoverDelegate})),this.collectCompositeActions()(),t}createTitleLabel(e){const t=ge(e,M(".title-label")),i=ge(t,M("h2"));this.titleLabelElement=i;const s=this._register(this.hoverService.setupManagedHover(Ap("mouse"),i,"")),o=this;return{updateTitle:(n,r,d)=>{(!this.activeComposite||this.activeComposite.getId()===n)&&(i.innerText=r,s.update(d?c(2901,"{0} ({1})",r,d):r))},updateStyles:()=>{i.style.color=o.titleForegroundColor&&o.getColor(o.titleForegroundColor)||"";const n=o.titleBorderColor?o.getColor(o.titleBorderColor):void 0;e.style.borderBottom=n?`1px solid ${n}`:""}}}createHeaderArea(){return M(".composite")}createFooterArea(){return M(".composite")}updateStyles(){super.updateStyles(),Ee(this.titleLabel).updateStyles()}actionViewItemProvider(e,t){return this.activeComposite?this.activeComposite.getActionViewItem(e,t):Tp(this.instantiationService,e,t)}actionsContextProvider(){return this.activeComposite?this.activeComposite.getActionsContext():null}createContentArea(e){const t=ge(e,M(".content"));return this.progressBar=this._register(new Cb(t,Sb)),this.progressBar.hide(),t}getProgressIndicator(e){const t=this.instantiatedCompositeItems.get(e);return t?t.progress:void 0}getTitleAreaDropDownAnchorAlignment(){return Wl.RIGHT}layout(e,t,i,s){super.layout(e,t,i,s),this.contentAreaSize=jt.lift(super.layoutContents(e,t).contentSize),this.activeComposite?.layout(this.contentAreaSize)}setBoundarySashes(e){this.boundarySashes=e,this.activeComposite?.setBoundarySashes(e)}removeComposite(e){if(this.activeComposite?.getId()===e)return!1;this.mapCompositeToCompositeContainer.delete(e),this.mapActionsBindingToComposite.delete(e);const t=this.instantiatedCompositeItems.get(e);return t&&(t.composite.dispose(),je(t.disposable),this.instantiatedCompositeItems.delete(e)),!0}dispose(){this.mapCompositeToCompositeContainer.clear(),this.mapActionsBindingToComposite.clear(),this.instantiatedCompositeItems.forEach(e=>{e.composite.dispose(),je(e.disposable)}),this.instantiatedCompositeItems.clear(),super.dispose()}}var gh;Pe(NT);var fe;(function(a){a[a.TOP=0]="TOP",a[a.TITLE=1]="TITLE",a[a.BOTTOM=2]="BOTTOM"})(fe||(fe={}));var wo;let da=(wo=class extends FT{get snap(){return this.layoutService.isVisible(this.partId)||!!this.paneCompositeBar.value?.getVisiblePaneCompositeIds().length}get onDidPaneCompositeOpen(){return L.map(this.onDidCompositeOpen.event,e=>e.composite)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m,v,C,T,B,V,U,W){let K=Y.Sidebar,j=Gi.Viewlets,oe=w.SidebarTitle;e===P.PANEL_PART?(K=Y.Panel,j=Gi.Panels,oe=w.PanelTitle):e===P.AUXILIARYBAR_PART&&(K=Y.AuxiliaryBar,j=Gi.Auxiliary,oe=w.AuxiliaryBarTitle),super(h,p,f,g,m,v,C,T,z.as(j),i,B.getDefaultViewContainer(K)?.id||"",n,r,d,l,e,t),this.partId=e,this.activePaneContextKey=s,this.paneFocusContextKey=o,this.viewDescriptorService=B,this.contextKeyService=V,this.extensionService=U,this.menuService=W,this.onDidPaneCompositeClose=this.onDidCompositeClose.event,this.headerFooterCompositeBarDispoables=this._register(new O),this.paneCompositeBar=this._register(new Ie),this.compositeBarPosition=void 0,this.blockOpening=void 0,this.location=K,this.globalActions=this._register(this.instantiationService.createInstance(Vm,oe,void 0,void 0)),this.registerListeners()}registerListeners(){this._register(this.onDidPaneCompositeOpen(e=>this.onDidOpen(e))),this._register(this.onDidPaneCompositeClose(this.onDidClose,this)),this._register(this.globalActions.onDidChange(()=>this.updateGlobalToolbarActions())),this._register(this.registry.onDidDeregister(e=>{const t=this.viewDescriptorService.getViewContainersByLocation(this.location).filter(i=>this.viewDescriptorService.getViewContainerModel(i).activeViewDescriptors.length>0);if(t.length){if(this.getActiveComposite()?.getId()===e.id){const i=this.viewDescriptorService.getDefaultViewContainer(this.location)?.id,s=t.filter(o=>o.id===i)[0]||t[0];this.doOpenPaneComposite(s.id)}}else this.layoutService.setPartHidden(!0,this.partId);this.removeComposite(e.id)})),this._register(this.extensionService.onDidRegisterExtensions(()=>{this.layoutCompositeBar()}))}onDidOpen(e){this.activePaneContextKey.set(e.getId())}onDidClose(e){const t=e.getId();this.activePaneContextKey.get()===t&&this.activePaneContextKey.reset()}showComposite(e){super.showComposite(e),this.layoutCompositeBar(),this.layoutEmptyMessage()}hideActiveComposite(){const e=super.hideActiveComposite();return this.layoutCompositeBar(),this.layoutEmptyMessage(),e}create(e){this.element=e,this.element.classList.add("pane-composite-part"),super.create(e);const t=this.getContentArea();t&&this.createEmptyPaneMessage(t),this.updateCompositeBar();const i=this._register(zn(e));this._register(i.onDidFocus(()=>this.paneFocusContextKey.set(!0))),this._register(i.onDidBlur(()=>this.paneFocusContextKey.set(!1)))}createEmptyPaneMessage(e){this.emptyPaneMessageElement=M(".empty-pane-message-area");const t=M(".empty-pane-message");t.innerText=c(3434,"Drag a view here to display."),this.emptyPaneMessageElement.appendChild(t),e.appendChild(this.emptyPaneMessageElement);const i=s=>{const o=!this.getActiveComposite()||!s,n=s&&this.theme.getColor(Om)?.toString()||"";this.titleContainer&&o&&(this.titleContainer.style.backgroundColor=n),this.headerFooterCompositeBarContainer&&o&&(this.headerFooterCompositeBarContainer.style.backgroundColor=n),this.emptyPaneMessageElement.style.backgroundColor=n};this._register(md.INSTANCE.registerTarget(this.element,{onDragOver:s=>{if(ke.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);_b(s.eventData.dataTransfer,"move",o)}},onDragEnter:s=>{if(ke.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);i(o)}},onDragLeave:s=>{ke.stop(s.eventData,!0),i(!1)},onDragEnd:s=>{ke.stop(s.eventData,!0),i(!1)},onDrop:s=>{if(ke.stop(s.eventData,!0),i(!1),this.paneCompositeBar.value)this.paneCompositeBar.value.dndHandler.drop(s.dragAndDropData,void 0,s.eventData);else{const o=s.dragAndDropData.getData();if(o.type==="composite"){const n=this.viewDescriptorService.getViewContainerById(o.id);this.viewDescriptorService.moveViewContainerToLocation(n,this.location,void 0,"dnd"),this.openPaneComposite(n.id,!0)}else if(o.type==="view"){const n=this.viewDescriptorService.getViewDescriptorById(o.id);if(n&&n.canMoveView){this.viewDescriptorService.moveViewToLocation(n,this.location,"dnd");const r=this.viewDescriptorService.getViewContainerByViewId(n.id);this.openPaneComposite(r.id,!0).then(d=>{d?.openView(n.id,!0)})}}}}}))}createTitleArea(e){const t=super.createTitleArea(e);this._register(J(t,te.CONTEXT_MENU,s=>{this.onTitleAreaContextMenu(new $a(St(t),s))})),this._register(Eg.addTarget(t)),this._register(J(t,Ig.Contextmenu,s=>{this.onTitleAreaContextMenu(new $a(St(t),s))}));const i=t.appendChild(M(".global-actions"));return this.globalToolBar=this._register(this.instantiationService.createInstance(Dp,i,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Fo.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(3435,"More Actions..."),hoverDelegate:this.toolbarHoverDelegate,hiddenItemStrategy:Pm.NoHide})),this.updateGlobalToolbarActions(),t}createTitleLabel(e){this.titleContainer=e;const t=super.createTitleLabel(e);this.titleLabelElement.draggable=!0;const i=()=>({type:"composite",id:this.getActivePaneComposite().getId()});return this._register(md.INSTANCE.registerDraggable(this.titleLabelElement,i,{})),t}updateCompositeBar(e=!1){const t=this.compositeBarPosition!==void 0,i=this.shouldShowCompositeBar(),s=this.compositeBarPosition,o=i?this.getCompositeBarPosition():void 0;if(!e&&s===o)return;if(t){const r=s===fe.TITLE?this.titleContainer:this.headerFooterCompositeBarContainer;if(!this.paneCompositeBarContainer||!this.paneCompositeBar.value||!r)throw new Error("Composite bar containers should exist when removing the previous composite bar");this.paneCompositeBarContainer.remove(),this.paneCompositeBarContainer=void 0,this.paneCompositeBar.value=void 0,r.classList.remove("has-composite-bar"),s===fe.TOP?this.removeFooterHeaderArea(!0):s===fe.BOTTOM&&this.removeFooterHeaderArea(!1)}let n;switch(o){case fe.TOP:n=this.createHeaderArea();break;case fe.TITLE:n=this.titleContainer;break;case fe.BOTTOM:n=this.createFooterArea();break}if(i){if(this.paneCompositeBarContainer||this.paneCompositeBar.value||!n)throw new Error("Invalid composite bar state when creating the new composite bar");n.classList.add("has-composite-bar"),this.paneCompositeBarContainer=Mm(n,M(".composite-bar-container")),this.paneCompositeBar.value=this.createCompositeBar(),this.paneCompositeBar.value.create(this.paneCompositeBarContainer),o===fe.TOP?this.setHeaderArea(n):o===fe.BOTTOM&&this.setFooterArea(n)}this.compositeBarPosition=o,e&&this.layoutCompositeBar()}createHeaderArea(){const e=super.createHeaderArea();return this.createHeaderFooterCompositeBarArea(e)}createFooterArea(){const e=super.createFooterArea();return this.createHeaderFooterCompositeBarArea(e)}createHeaderFooterCompositeBarArea(e){if(this.headerFooterCompositeBarContainer)throw new Error("Header or Footer composite bar already exists");return this.headerFooterCompositeBarContainer=e,this.headerFooterCompositeBarDispoables.add(J(e,te.CONTEXT_MENU,t=>{this.onCompositeBarAreaContextMenu(new $a(St(e),t))})),this.headerFooterCompositeBarDispoables.add(Eg.addTarget(e)),this.headerFooterCompositeBarDispoables.add(J(e,Ig.Contextmenu,t=>{this.onCompositeBarAreaContextMenu(new $a(St(e),t))})),e}removeFooterHeaderArea(e){this.headerFooterCompositeBarContainer=void 0,this.headerFooterCompositeBarDispoables.clear(),e?this.removeHeaderArea():this.removeFooterArea()}createCompositeBar(){return this.instantiationService.createInstance(Eb,this.getCompositeBarOptions(),this.partId,this)}onTitleAreaUpdate(e){super.onTitleAreaUpdate(e),this.layoutCompositeBar()}async openPaneComposite(e,t){if(typeof e=="string"&&this.getPaneComposite(e))return this.doOpenPaneComposite(e,t);if(await this.extensionService.whenInstalledExtensionsRegistered(),typeof e=="string"&&this.getPaneComposite(e))return this.doOpenPaneComposite(e,t)}async doOpenPaneComposite(e,t){if(this.blockOpening)return this.blockOpening.p;let i;if(!this.layoutService.isVisible(this.partId))try{i=this.blockOpening=new Ko,this.layoutService.setPartHidden(!1,this.partId)}finally{this.blockOpening=void 0}try{const s=this.openComposite(e,t);return i?.complete(s),s}catch(s){throw i?.error(s),s}}getPaneComposite(e){return this.registry.getPaneComposite(e)}getPaneComposites(){return this.registry.getPaneComposites().sort((e,t)=>typeof e.order!="number"?1:typeof t.order!="number"?-1:e.order-t.order)}getPinnedPaneCompositeIds(){return this.paneCompositeBar.value?.getPinnedPaneCompositeIds()??[]}getVisiblePaneCompositeIds(){return this.paneCompositeBar.value?.getVisiblePaneCompositeIds()??[]}getPaneCompositeIds(){return this.paneCompositeBar.value?.getPaneCompositeIds()??[]}getActivePaneComposite(){return this.getActiveComposite()}getLastActivePaneCompositeId(){return this.getLastActiveCompositeId()}hideActivePaneComposite(){this.layoutService.isVisible(this.partId)&&this.layoutService.setPartHidden(!0,this.partId),this.hideActiveComposite()}focusCompositeBar(){this.paneCompositeBar.value?.focus()}layout(e,t,i,s){this.layoutService.isVisible(this.partId)&&(this.contentDimension=new jt(e,t),super.layout(this.contentDimension.width,this.contentDimension.height,i,s),this.layoutCompositeBar(),this.layoutEmptyMessage())}layoutCompositeBar(){if(this.contentDimension&&this.dimension&&this.paneCompositeBar.value){const e=this.compositeBarPosition===fe.TITLE?16:8,t=this.partId===P.PANEL_PART?0:1;let i=this.contentDimension.width-e-t;i=Math.max(gh.MIN_COMPOSITE_BAR_WIDTH,i-this.getToolbarWidth()),this.paneCompositeBar.value.layout(i,this.dimension.height)}}layoutEmptyMessage(){const e=!this.getActiveComposite();this.element.classList.toggle("empty",e),e&&this.titleLabel?.updateTitle("","")}updateGlobalToolbarActions(){const e=this.globalActions.getPrimaryActions(),t=this.globalActions.getSecondaryActions();this.globalToolBar?.setActions(Hn(e),Hn(t))}getToolbarWidth(){if(!this.toolBar||this.compositeBarPosition!==fe.TITLE||!this.getActivePaneComposite())return 0;const t=this.toolBar.getItemsWidth()+this.toolBar.getItemsLength()*4,i=this.globalToolBar?this.globalToolBar.getItemsWidth()+this.globalToolBar.getItemsLength()*4:0;return t+i+5}onTitleAreaContextMenu(e){if(this.shouldShowCompositeBar()&&this.getCompositeBarPosition()===fe.TITLE)return this.onCompositeBarContextMenu(e);{const t=this.getActivePaneComposite(),i=t?t.getContextMenuActions():[];i.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>i,getActionViewItem:(s,o)=>this.actionViewItemProvider(s,o),actionRunner:t.getActionRunner(),skipTelemetry:!0})}}onCompositeBarAreaContextMenu(e){return this.onCompositeBarContextMenu(e)}onCompositeBarContextMenu(e){if(this.paneCompositeBar.value){const t=[...this.paneCompositeBar.value.getContextMenuActions()];t.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>t,skipTelemetry:!0})}}getViewsSubmenuAction(){const e=this.getActivePaneComposite()?.getViewPaneContainer();if(e){const t=new O,i=t.add(this.contextKeyService.createScoped(this.element));i.createKey("viewContainer",e.viewContainer.id);const s=this.menuService.getMenuActions(Ip,i,{shouldForwardArgs:!0,renderShortTitle:!0}),o=Ib(s,()=>!0).primary;return t.dispose(),o.length>1&&o.some(n=>n.enabled)?new wd("views",c(3436,"Views"),o):void 0}}},gh=wo,wo.MIN_COMPOSITE_BAR_WIDTH=50,wo);da=gh=D([u(9,Ke),u(10,ce),u(11,at),u(12,He),u(13,it),u(14,Tt),u(15,F),u(16,me),u(17,Ye),u(18,se),u(19,At),u(20,Cs)],da);var fh;Pe(lv);var yo;let mh=(yo=class extends da{get snap(){return!0}get preferredWidth(){const e=this.getActivePaneComposite();if(!e)return;const t=e.getOptimalWidth();if(typeof t=="number")return Math.max(t,300)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g){super(P.SIDEBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(yd)||this.getColor($s)?1:0},fh.activeViewletSettingsKey,Db.bindTo(h),Ab.bindTo(h),"sideBar","viewlet",Tb,Nm,e,t,i,s,o,n,r,d,l,h,p,g),this.configurationService=f,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Vi.Low,this.activityBarPart=this._register(this.instantiationService.createInstance(qa,this)),this.rememberActivityBarVisiblePosition(),this._register(f.onDidChangeConfiguration(m=>{m.affectsConfiguration(Wt.ACTIVITY_BAR_LOCATION)&&this.onDidChangeActivityBarLocation()})),this.registerActions()}onDidChangeActivityBarLocation(){this.activityBarPart.hide(),this.updateCompositeBar();const e=this.getActiveComposite()?.getId();e&&this.onTitleAreaUpdate(e),this.shouldShowActivityBar()&&this.activityBarPart.show(),this.rememberActivityBarVisiblePosition()}updateStyles(){super.updateStyles();const e=Ee(this.getContainer());e.style.backgroundColor=this.getColor(Cn)||"",e.style.color=this.getColor(Bm)||"";const t=this.getColor(yd)||this.getColor($s),i=this.layoutService.getSideBarPosition()===Ot.LEFT;e.style.borderRightWidth=t&&i?"1px":"",e.style.borderRightStyle=t&&i?"solid":"",e.style.borderRightColor=i&&t||"",e.style.borderLeftWidth=t&&!i?"1px":"",e.style.borderLeftStyle=t&&!i?"solid":"",e.style.borderLeftColor=i?"":t||"",e.style.outlineColor=this.getColor(xb)??""}layout(e,t,i,s){this.layoutService.isVisible(P.SIDEBAR_PART)&&super.layout(e,t,i,s)}getTitleAreaDropDownAnchorAlignment(){return this.layoutService.getSideBarPosition()===Ot.LEFT?Wl.LEFT:Wl.RIGHT}createCompositeBar(){return this.instantiationService.createInstance(kb,this.getCompositeBarOptions(),this.partId,this,!1)}getCompositeBarOptions(){return{partContainerClass:"sidebar",pinnedViewContainersKey:qa.pinnedViewContainersKey,placeholderViewContainersKey:qa.placeholderViewContainersKey,viewContainersWorkspaceStateKey:qa.viewContainersWorkspaceStateKey,icon:!0,orientation:Fo.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===fe.BOTTOM?$n.ABOVE:$n.BELOW},fillExtraContextMenuActions:e=>{if(this.getCompositeBarPosition()===fe.TITLE){const t=this.getViewsSubmenuAction();t&&(e.push(new hs),e.push(t))}},compositeSize:0,iconSize:16,overflowActionSize:30,colors:e=>({activeBackgroundColor:e.getColor(Cn),inactiveBackgroundColor:e.getColor(Cn),activeBorderBottomColor:e.getColor(Hm),activeForegroundColor:e.getColor(Um),inactiveForegroundColor:e.getColor(Gm),badgeBackground:e.getColor(Wm),badgeForeground:e.getColor(Km),dragAndDropBorder:e.getColor(Fm)}),compact:!0}}shouldShowCompositeBar(){const e=this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION);return e===Oe.TOP||e===Oe.BOTTOM}shouldShowActivityBar(){return this.shouldShowCompositeBar()?!1:this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)!==Oe.HIDDEN}getCompositeBarPosition(){switch(this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)){case Oe.TOP:return fe.TOP;case Oe.BOTTOM:return fe.BOTTOM;case Oe.HIDDEN:case Oe.DEFAULT:default:return fe.TITLE}}rememberActivityBarVisiblePosition(){const e=this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION);e!==Oe.HIDDEN&&this.storageService.store(Wt.ACTIVITY_BAR_LOCATION,e,H.PROFILE,Re.USER)}getRememberedActivityBarVisiblePosition(){switch(this.storageService.get(Wt.ACTIVITY_BAR_LOCATION,H.PROFILE)){case Oe.TOP:return Oe.TOP;case Oe.BOTTOM:return Oe.BOTTOM;default:return Oe.DEFAULT}}getPinnedPaneCompositeIds(){return this.shouldShowCompositeBar()?super.getPinnedPaneCompositeIds():this.activityBarPart.getPinnedPaneCompositeIds()}getVisiblePaneCompositeIds(){return this.shouldShowCompositeBar()?super.getVisiblePaneCompositeIds():this.activityBarPart.getVisiblePaneCompositeIds()}getPaneCompositeIds(){return this.shouldShowCompositeBar()?super.getPaneCompositeIds():this.activityBarPart.getPaneCompositeIds()}async focusActivityBar(){this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)===Oe.HIDDEN&&(await this.configurationService.updateValue(Wt.ACTIVITY_BAR_LOCATION,this.getRememberedActivityBarVisiblePosition()),this.onDidChangeActivityBarLocation()),this.shouldShowCompositeBar()?this.focusCompositeBar():(this.layoutService.isVisible(P.ACTIVITYBAR_PART)||this.layoutService.setPartHidden(!1,P.ACTIVITYBAR_PART),this.activityBarPart.show(!0))}registerActions(){const e=this;this._register(b(class extends X{constructor(){super({id:Rb,title:x(3481,"Toggle Activity Bar Visibility")})}run(){const t=e.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION)===Oe.HIDDEN?e.getRememberedActivityBarVisiblePosition():Oe.HIDDEN;return e.configurationService.updateValue(Wt.ACTIVITY_BAR_LOCATION,t)}}))}toJSON(){return{type:P.SIDEBAR_PART}}},fh=yo,yo.activeViewletSettingsKey="workbench.sidebar.activeviewletid",yo);mh=fh=D([u(0,Ke),u(1,ce),u(2,at),u(3,He),u(4,it),u(5,Tt),u(6,F),u(7,me),u(8,Ye),u(9,se),u(10,At),u(11,ie),u(12,Cs)],mh);let wh=class extends R{constructor(e,t,i){super(),this.viewId=e,this.viewDescriptorService=t,this.activityService=i,this.activity=void 0,this.activityDisposable=R.None,this._register(L.filter(this.viewDescriptorService.onDidChangeContainer,s=>s.views.some(o=>o.id===e))(()=>this.update())),this._register(L.filter(this.viewDescriptorService.onDidChangeLocation,s=>s.views.some(o=>o.id===e))(()=>this.update()))}setActivity(e){this.activity=e,this.update()}clearActivity(){this.activity=void 0,this.update()}update(){this.activityDisposable.dispose();const e=this.viewDescriptorService.getViewContainerByViewId(this.viewId);e&&this.activity&&(this.activityDisposable=this.activityService.showViewContainerActivity(e.id,this.activity))}dispose(){this.activityDisposable.dispose(),super.dispose()}};wh=D([u(1,Ye),u(2,Ys)],wh);let yh=class extends R{constructor(e,t){super(),this.viewDescriptorService=e,this.instantiationService=t,this.viewActivities=new Map,this._onDidChangeActivity=this._register(new E),this.onDidChangeActivity=this._onDidChangeActivity.event,this.viewContainerActivities=new Map,this.globalActivities=new Map}showViewContainerActivity(e,t){const i=this.viewDescriptorService.getViewContainerById(e);if(!i)return R.None;let s=this.viewContainerActivities.get(e);return s||(s=[],this.viewContainerActivities.set(e,s)),s.push(t),this._onDidChangeActivity.fire(i),ae(()=>{s.splice(s.indexOf(t),1),s.length===0&&this.viewContainerActivities.delete(e),this._onDidChangeActivity.fire(i)})}getViewContainerActivities(e){return this.viewDescriptorService.getViewContainerById(e)?this.viewContainerActivities.get(e)??[]:[]}showViewActivity(e,t){let i=this.viewActivities.get(e);i?i.id++:(i={id:1,activity:this.instantiationService.createInstance(wh,e)},this.viewActivities.set(e,i));const s=i.id;i.activity.setActivity(t);const o=i;return ae(()=>{o.id===s&&(o.activity.dispose(),this.viewActivities.delete(e))})}showAccountsActivity(e){return this.showActivity(Lb,e)}showGlobalActivity(e){return this.showActivity(Vb,e)}getActivity(e){return this.globalActivities.get(e)??[]}showActivity(e,t){let i=this.globalActivities.get(e);return i||(i=[],this.globalActivities.set(e,i)),i.push(t),this._onDidChangeActivity.fire(e),ae(()=>{i.splice(i.indexOf(t),1),i.length===0&&this.globalActivities.delete(e),this._onDidChangeActivity.fire(e)})}};yh=D([u(0,Ye),u(1,F)],yh);var vh;Pe(Fb);var vo;let bh=(vo=class extends da{get preferredHeight(){return this.layoutService.mainContainerDimension.height*.4}get preferredWidth(){const e=this.getActivePaneComposite();if(!e)return;const t=e.getOptimalWidth();if(typeof t=="number")return Math.max(t,300)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m){super(P.PANEL_PART,{hasTitle:!0},vh.activePanelSettingsKey,Pb.bindTo(h),Mb.bindTo(h),"panel","panel",void 0,Ob,e,t,i,s,o,n,r,d,l,h,p,g),this.commandService=f,this.configurationService=m,this.minimumWidth=300,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=77,this.maximumHeight=Number.POSITIVE_INFINITY,this._register(this.configurationService.onDidChangeConfiguration(v=>{v.affectsConfiguration("workbench.panel.showLabels")&&this.updateCompositeBar(!0)}))}updateStyles(){super.updateStyles();const e=Ee(this.getContainer());e.style.backgroundColor=this.getColor(ll)||"";const t=this.getColor(vd)||this.getColor($s)||"";e.style.borderLeftColor=t,e.style.borderRightColor=t,e.style.borderBottomColor=t;const i=this.getTitleArea();i&&(i.style.borderTopColor=this.getColor(vd)||this.getColor($s)||"")}getCompositeBarOptions(){return{partContainerClass:"panel",pinnedViewContainersKey:"workbench.panel.pinnedPanels",placeholderViewContainersKey:"workbench.panel.placeholderPanels",viewContainersWorkspaceStateKey:"workbench.panel.viewContainersWorkspaceState",icon:this.configurationService.getValue("workbench.panel.showLabels")===!1,orientation:Fo.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.layoutService.getPanelPosition()===Ot.BOTTOM&&!this.layoutService.isPanelMaximized()?$n.ABOVE:$n.BELOW},fillExtraContextMenuActions:e=>this.fillExtraContextMenuActions(e),compositeSize:0,iconSize:16,compact:!0,overflowActionSize:44,colors:e=>({activeBackgroundColor:e.getColor(ll),inactiveBackgroundColor:e.getColor(ll),activeBorderBottomColor:e.getColor(jm),activeForegroundColor:e.getColor(qm),inactiveForegroundColor:e.getColor($m),badgeBackground:e.getColor(Bb),badgeForeground:e.getColor(Nb),dragAndDropBorder:e.getColor(zm)})}}fillExtraContextMenuActions(e){if(this.getCompositeBarPosition()===fe.TITLE){const d=this.getViewsSubmenuAction();d&&(e.push(new hs),e.push(d))}const t=this.menuService.getMenuActions(w.PanelPositionMenu,this.contextKeyService,{shouldForwardArgs:!0}),i=this.menuService.getMenuActions(w.PanelAlignmentMenu,this.contextKeyService,{shouldForwardArgs:!0}),s=bd(t).secondary,o=bd(i).secondary,n=this.configurationService.getValue("workbench.panel.showLabels"),r=cs({id:"workbench.action.panel.toggleShowLabels",label:n?c(3474,"Show Icons"):c(3475,"Show Labels"),run:()=>this.configurationService.updateValue("workbench.panel.showLabels",!n)});e.push(new hs,new wd("workbench.action.panel.position",c(3476,"Panel Position"),s),new wd("workbench.action.panel.align",c(3477,"Align Panel"),o),r,cs({id:Dg.ID,label:c(3478,"Hide Panel"),run:()=>this.commandService.executeCommand(Dg.ID)}))}layout(e,t,i,s){let o;switch(this.layoutService.getPanelPosition()){case Ot.RIGHT:o=new jt(e-1,t);break;case Ot.TOP:o=new jt(e,t-1);break;default:o=new jt(e,t);break}super.layout(o.width,o.height,i,s)}shouldShowCompositeBar(){return!0}getCompositeBarPosition(){return fe.TITLE}toJSON(){return{type:P.PANEL_PART}}},vh=vo,vo.activePanelSettingsKey="workbench.panelpart.activepanelid",vo);bh=vh=D([u(0,Ke),u(1,ce),u(2,at),u(3,He),u(4,it),u(5,Tt),u(6,F),u(7,me),u(8,Ye),u(9,se),u(10,At),u(11,wt),u(12,Cs),u(13,ie)],bh);const KT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ch;Pe(KT);function Cv(a){return a.getValue("editor.dropIntoEditor.enabled")}function Sv(a){return a.shiftKey}var bo;let Sh=(bo=class extends Ym{get disposed(){return!!this._disposed}constructor(e,t,i,s,o,n,r,d){super(t),this.groupView=e,this.configurationService=i,this.instantiationService=s,this.editorService=o,this.editorGroupService=n,this.treeViewsDragAndDropService=r,this.contextService=d,this.editorTransfer=Sn.getInstance(),this.groupTransfer=Sn.getInstance(),this.treeItemsTransfer=Sn.getInstance(),this.cleanupOverlayScheduler=this._register(new Ca(()=>this.dispose(),300)),this.enableDropIntoEditor=Cv(this.configurationService)&&this.isDropIntoActiveEditorEnabled(),this.create()}create(){const e=this.getOverlayOffsetHeight(),t=this.container=M("div",{id:Ch.OVERLAY_ID});t.style.top=`${e}px`,this.groupView.element.appendChild(t),this.groupView.element.classList.add("dragged-over"),this._register(ae(()=>{t.remove(),this.groupView.element.classList.remove("dragged-over")})),this.overlay=M(".editor-group-overlay-indicator"),t.appendChild(this.overlay),this.enableDropIntoEditor&&(this.dropIntoPromptElement=Gb(c(3250,"Hold __{0}__ to drop into editor",ut?"⇧":"Shift"),{}),this.dropIntoPromptElement.classList.add("editor-group-overlay-drop-into-prompt"),this.overlay.appendChild(this.dropIntoPromptElement)),this.registerListeners(t),this.updateStyles()}updateStyles(){const e=Ee(this.overlay);e.style.backgroundColor=this.getColor(Om)||"";const t=this.getColor(Ub);if(e.style.outlineColor=t||"",e.style.outlineOffset=t?"-2px":"",e.style.outlineStyle=t?"dashed":"",e.style.outlineWidth=t?"2px":"",this.dropIntoPromptElement){this.dropIntoPromptElement.style.backgroundColor=this.getColor(Hb)??"",this.dropIntoPromptElement.style.color=this.getColor(zb)??"";const i=this.getColor($b);i?(this.dropIntoPromptElement.style.borderWidth="1px",this.dropIntoPromptElement.style.borderStyle="solid",this.dropIntoPromptElement.style.borderColor=i):this.dropIntoPromptElement.style.borderWidth="0"}}registerListeners(e){this._register(new qb(e,{onDragOver:t=>{if(this.enableDropIntoEditor&&Sv(t)){this.dispose();return}const i=this.groupTransfer.hasData(to.prototype),s=this.editorTransfer.hasData(Ds.prototype);!s&&!i&&t.dataTransfer&&(t.dataTransfer.dropEffect="copy");let o=!0;if(i)o=this.isCopyOperation(t);else if(s){const r=this.editorTransfer.getData(Ds.prototype);Array.isArray(r)&&r.length>0&&(o=this.isCopyOperation(t,r[0].identifier))}if(!o){const r=this.findSourceGroupView();if(r===this.groupView&&(i||s&&r.count<2)){this.hideOverlay();return}}let n=!!this.editorGroupService.partOptions.splitOnDragAndDrop;this.isToggleSplitOperation(t)&&(n=!n),this.positionOverlay(t.offsetX,t.offsetY,i,n),this.cleanupOverlayScheduler.isScheduled()&&this.cleanupOverlayScheduler.cancel()},onDragLeave:t=>this.dispose(),onDragEnd:t=>this.dispose(),onDrop:t=>{ke.stop(t,!0),this.dispose(),this.currentDropOperation&&this.handleDrop(t,this.currentDropOperation.splitDirection)}})),this._register(J(e,te.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}isDropIntoActiveEditorEnabled(){return!!this.groupView.activeEditor?.hasCapability(Ag.CanDropIntoEditor)}findSourceGroupView(){if(this.groupTransfer.hasData(to.prototype)){const e=this.groupTransfer.getData(to.prototype);if(Array.isArray(e)&&e.length>0)return this.editorGroupService.getGroup(e[0].identifier)}else if(this.editorTransfer.hasData(Ds.prototype)){const e=this.editorTransfer.getData(Ds.prototype);if(Array.isArray(e)&&e.length>0)return this.editorGroupService.getGroup(e[0].identifier.groupId)}}async handleDrop(e,t){const i=()=>{let s;return typeof t=="number"?s=this.editorGroupService.addGroup(this.groupView,t):s=this.groupView,s};if(this.groupTransfer.hasData(to.prototype)){const s=this.groupTransfer.getData(to.prototype);if(Array.isArray(s)&&s.length>0){const o=this.editorGroupService.getGroup(s[0].identifier);if(o){if(typeof t!="number"&&o===this.groupView)return;let n;if(typeof t=="number")this.isCopyOperation(e)?n=this.editorGroupService.copyGroup(o,this.groupView,t):n=this.editorGroupService.moveGroup(o,this.groupView,t);else{let r;this.isCopyOperation(e)&&(r={mode:Jm.COPY_EDITORS}),this.editorGroupService.mergeGroup(o,this.groupView,r)}n&&this.editorGroupService.activateGroup(n)}this.groupTransfer.clearData(to.prototype)}}else if(this.editorTransfer.hasData(Ds.prototype)){const s=this.editorTransfer.getData(Ds.prototype);if(Array.isArray(s)&&s.length>0){const o=s,n=s[0].identifier,r=this.editorGroupService.getGroup(n.groupId);if(r){const d=this.isCopyOperation(e,n);let l;if(this.editorGroupService.partOptions.closeEmptyGroups&&r.count===1&&typeof t=="number"&&!d)l=this.editorGroupService.moveGroup(r,this.groupView,t);else{if(l=i(),r===l)return;const h=jb(this.groupView,o.map(p=>p.identifier.editor));d?r.copyEditors(h,l):r.moveEditors(h,l)}l.focus()}this.editorTransfer.clearData(Ds.prototype)}}else if(this.treeItemsTransfer.hasData(ao.prototype)){const s=this.treeItemsTransfer.getData(ao.prototype);if(Array.isArray(s)&&s.length>0){const o=[];for(const n of s){const r=await this.treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(r){const d=await Yb(r);o.push(...d.map(l=>({...l,options:{...l.options,pinned:!0}})))}}o.length&&this.editorService.openEditors(o,i(),{validateTrust:!0})}this.treeItemsTransfer.clearData(ao.prototype)}else this.instantiationService.createInstance(Jb,{allowWorkspaceOpen:!Wo||Zb(this.contextService.getWorkspace())}).handleDrop(e,St(this.groupView.element),()=>i(),o=>o?.focus())}isCopyOperation(e,t){return t?.editor.hasCapability(Ag.Singleton)?!1:e.ctrlKey&&!ut||e.altKey&&ut}isToggleSplitOperation(e){return e.altKey&&!ut||e.shiftKey&&ut}positionOverlay(e,t,i,s){const o=this.editorGroupService.partOptions.openSideBySideDirection==="right",n=this.groupView.element.clientWidth,r=this.groupView.element.clientHeight-this.getOverlayOffsetHeight();let d,l;s?(i?d=o?.3:.1:d=.1,i?l=o?.1:.3:l=.1):(d=0,l=0);const h=n*d,p=r*l,f=n/3,g=r/3;let m;switch(e>h&&e<n-h&&t>p&&t<r-p?m=void 0:o?e<f?m=we.LEFT:e>f*2?m=we.RIGHT:t<r/2?m=we.UP:m=we.DOWN:t<g?m=we.UP:t>g*2?m=we.DOWN:e<n/2?m=we.LEFT:m=we.RIGHT,m){case we.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case we.DOWN:this.doPositionOverlay({top:"50%",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case we.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"}),this.toggleDropIntoPrompt(!1);break;case we.RIGHT:this.doPositionOverlay({top:"0",left:"50%",width:"50%",height:"100%"}),this.toggleDropIntoPrompt(!1);break;default:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"100%"}),this.toggleDropIntoPrompt(!0)}const v=Ee(this.overlay);v.style.opacity="1",setTimeout(()=>v.classList.add("overlay-move-transition"),0),this.currentDropOperation={splitDirection:m}}doPositionOverlay(e){const[t,i]=Xb(this.container,this.overlay),s=this.getOverlayOffsetHeight();s?t.style.height=`calc(100% - ${s}px)`:t.style.height="100%",i.style.top=e.top,i.style.left=e.left,i.style.width=e.width,i.style.height=e.height}getOverlayOffsetHeight(){return!this.groupView.isEmpty&&this.editorGroupService.partOptions.showTabs==="multiple"?this.groupView.titleHeight.offset:0}hideOverlay(){const e=Ee(this.overlay);this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"100%"}),e.style.opacity="0",e.classList.remove("overlay-move-transition"),this.currentDropOperation=void 0}toggleDropIntoPrompt(e){this.dropIntoPromptElement&&(this.dropIntoPromptElement.style.opacity=e?"1":"0")}contains(e){return e===this.container||e===this.overlay}dispose(){super.dispose(),this._disposed=!0}},Ch=bo,bo.OVERLAY_ID="monaco-workbench-editor-drop-overlay",bo);Sh=Ch=D([u(1,me),u(2,ie),u(3,F),u(4,Q),u(5,Je),u(6,Zm),u(7,bs)],Sh);let _h=class extends Ym{constructor(e,t,i,s,o,n){super(s),this.container=e,this.delegate=t,this.editorGroupService=i,this.configurationService=o,this.instantiationService=n,this.counter=0,this.editorTransfer=Sn.getInstance(),this.groupTransfer=Sn.getInstance(),this.registerListeners()}get overlay(){if(this._overlay&&!this._overlay.disposed)return this._overlay}registerListeners(){this._register(J(this.container,te.DRAG_ENTER,e=>this.onDragEnter(e))),this._register(J(this.container,te.DRAG_LEAVE,()=>this.onDragLeave()));for(const e of[this.container,St(this.container)])this._register(J(e,te.DRAG_END,()=>this.onDragEnd()))}onDragEnter(e){if(Cv(this.configurationService)&&Sv(e))return;if(this.counter++,!this.editorTransfer.hasData(Ds.prototype)&&!this.groupTransfer.hasData(to.prototype)&&e.dataTransfer){const i=z.as(Kb.DragAndDropContribution).getAll(),s=Array.from(i).map(o=>o.dataFormatKey);if(!Wb(e,Pr.FILES,Gl.FILES,Pr.RESOURCES,Gl.EDITORS,...s)){e.dataTransfer.dropEffect="none";return}}this.updateContainer(!0);const t=e.target;if(t&&(this.overlay&&!this.overlay.contains(t)&&this.disposeOverlay(),!this.overlay)){const i=this.findTargetGroupView(t);i&&(this._overlay=this.instantiationService.createInstance(Sh,i))}}onDragLeave(){this.counter--,this.counter===0&&this.updateContainer(!1)}onDragEnd(){this.counter=0,this.updateContainer(!1),this.disposeOverlay()}findTargetGroupView(e){return this.editorGroupService.groups.find(i=>Ul(e,i.element)||this.delegate.containsGroup?.(i))}updateContainer(e){this.container.classList.toggle("dragged-over",e)}dispose(){super.dispose(),this.disposeOverlay()}disposeOverlay(){this.overlay&&(this.overlay.dispose(),this._overlay=void 0)}};_h=D([u(2,Je),u(3,me),u(4,ie),u(5,F)],_h);const Sr={targetWidth:900,leftMarginRatio:.1909,rightMarginRatio:.1909},kl={type:"distribute"};function Jf(a){const e=M(".centered-layout-margin");return e.style.height="100%",a&&(e.style.backgroundColor=a.toString()),{element:e,layout:()=>{},minimumSize:60,maximumSize:Number.POSITIVE_INFINITY,onDidChange:L.None}}function WT(a,e){return{element:a.element,get maximumSize(){return a.maximumWidth},get minimumSize(){return a.minimumWidth},onDidChange:L.map(a.onDidChange,t=>t&&t.width),layout:(t,i,s)=>a.layout(t,e(),s?.top??0,(s?.left??0)+i)}}class GT{constructor(e,t,i={...Sr},s=!1){this.container=e,this.view=t,this.state=i,this.centeredLayoutFixedWidth=s,this.lastLayoutPosition={width:0,height:0,left:0,top:0},this.didLayout=!1,this.splitViewDisposables=new O,this._boundarySashes={},this.container.appendChild(this.view.element),this.container.style.overflow="hidden"}get minimumWidth(){return this.splitView?this.splitView.minimumSize:this.view.minimumWidth}get maximumWidth(){return this.splitView?this.splitView.maximumSize:this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get onDidChange(){return this.view.onDidChange}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.splitView&&(this.splitView.orthogonalStartSash=e.top,this.splitView.orthogonalEndSash=e.bottom)}layout(e,t,i,s){this.lastLayoutPosition={width:e,height:t,top:i,left:s},this.splitView?(this.splitView.layout(e,this.lastLayoutPosition),(!this.didLayout||this.centeredLayoutFixedWidth)&&this.resizeSplitViews()):this.view.layout(e,t,i,s),this.didLayout=!0}resizeSplitViews(){if(this.splitView)if(this.centeredLayoutFixedWidth){const e=Math.min(this.lastLayoutPosition.width,this.state.targetWidth),t=(this.lastLayoutPosition.width-e)/2;this.splitView.resizeView(0,Math.floor(t)),this.splitView.resizeView(1,e),this.splitView.resizeView(2,Math.ceil(t))}else{const e=this.state.leftMarginRatio*this.lastLayoutPosition.width,t=this.state.rightMarginRatio*this.lastLayoutPosition.width,i=this.lastLayoutPosition.width-e-t;this.splitView.resizeView(0,e),this.splitView.resizeView(1,i),this.splitView.resizeView(2,t)}}setFixedWidth(e){this.centeredLayoutFixedWidth=e,this.splitView&&(this.updateState(),this.resizeSplitViews())}updateState(){this.splitView&&(this.state.targetWidth=this.splitView.getViewSize(1),this.state.leftMarginRatio=this.splitView.getViewSize(0)/this.lastLayoutPosition.width,this.state.rightMarginRatio=this.splitView.getViewSize(2)/this.lastLayoutPosition.width)}isActive(){return!!this.splitView}styles(e){this.style=e,this.splitView&&this.emptyViews&&(this.splitView.style(this.style),this.emptyViews[0].element.style.backgroundColor=this.style.background.toString(),this.emptyViews[1].element.style.backgroundColor=this.style.background.toString())}activate(e){if(e!==this.isActive())if(e){this.view.element.remove(),this.splitView=new ea(this.container,{inverseAltBehavior:!0,orientation:Z.HORIZONTAL,styles:this.style}),this.splitView.orthogonalStartSash=this.boundarySashes.top,this.splitView.orthogonalEndSash=this.boundarySashes.bottom,this.splitViewDisposables.add(this.splitView.onDidSashChange(()=>{this.splitView&&this.updateState()})),this.splitViewDisposables.add(this.splitView.onDidSashReset(()=>{this.state={...Sr},this.resizeSplitViews()})),this.splitView.layout(this.lastLayoutPosition.width,this.lastLayoutPosition);const t=this.style?this.style.background:void 0;this.emptyViews=[Jf(t),Jf(t)],this.splitView.addView(this.emptyViews[0],kl,0),this.splitView.addView(WT(this.view,()=>this.lastLayoutPosition.height),kl,1),this.splitView.addView(this.emptyViews[1],kl,2),this.resizeSplitViews()}else this.splitView?.el.remove(),this.splitViewDisposables.clear(),this.splitView?.dispose(),this.splitView=void 0,this.emptyViews=void 0,this.container.appendChild(this.view.element),this.view.layout(this.lastLayoutPosition.width,this.lastLayoutPosition.height,this.lastLayoutPosition.top,this.lastLayoutPosition.left)}isDefault(e){return this.centeredLayoutFixedWidth?e.targetWidth===Sr.targetWidth:e.leftMarginRatio===Sr.leftMarginRatio&&e.rightMarginRatio===Sr.rightMarginRatio}dispose(){this.splitViewDisposables.dispose(),this.splitView&&(this.splitView.dispose(),this.splitView=void 0)}}var Xi;class UT{constructor(){this.element=M(".grid-view-container"),this._onDidChange=new Rs,this.onDidChange=this._onDidChange.event}get minimumWidth(){return this.gridWidget?this.gridWidget.minimumWidth:0}get maximumWidth(){return this.gridWidget?this.gridWidget.maximumWidth:Number.POSITIVE_INFINITY}get minimumHeight(){return this.gridWidget?this.gridWidget.minimumHeight:0}get maximumHeight(){return this.gridWidget?this.gridWidget.maximumHeight:Number.POSITIVE_INFINITY}get gridWidget(){return this._gridWidget}set gridWidget(e){this.element.innerText="",e?(this.element.appendChild(e.element),this._onDidChange.input=e.onDidChange):this._onDidChange.input=L.None,this._gridWidget=e}layout(e,t,i,s){this.gridWidget?.layout(e,t,i,s)}dispose(){this._onDidChange.dispose()}}var Ms;let Vd=(Ms=class extends Lm{constructor(e,t,i,s,o,n,r,d,l,h,p){super(t,{hasTitle:!1},n,d,l),this.editorPartsView=e,this.groupsLabel=i,this.windowId=s,this.instantiationService=o,this.configurationService=r,this.hostService=h,this.contextKeyService=p,this._onDidFocus=this._register(new E),this.onDidFocus=this._onDidFocus.event,this._onDidLayout=this._register(new E),this.onDidLayout=this._onDidLayout.event,this._onDidChangeActiveGroup=this._register(new E),this.onDidChangeActiveGroup=this._onDidChangeActiveGroup.event,this._onDidChangeGroupIndex=this._register(new E),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLabel=this._register(new E),this.onDidChangeGroupLabel=this._onDidChangeGroupLabel.event,this._onDidChangeGroupLocked=this._register(new E),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new E),this.onDidChangeGroupMaximized=this._onDidChangeGroupMaximized.event,this._onDidActivateGroup=this._register(new E),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidAddGroup=this._register(new Hl),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new Hl),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new E),this.onDidMoveGroup=this._onDidMoveGroup.event,this.onDidSetGridWidget=this._register(new E),this._onDidChangeSizeConstraints=this._register(new Rs),this.onDidChangeSizeConstraints=L.any(this.onDidSetGridWidget.event,this._onDidChangeSizeConstraints.event),this._onDidScroll=this._register(new Rs),this.onDidScroll=L.any(this.onDidSetGridWidget.event,this._onDidScroll.event),this._onDidChangeEditorPartOptions=this._register(new E),this.onDidChangeEditorPartOptions=this._onDidChangeEditorPartOptions.event,this._onWillDispose=this._register(new E),this.onWillDispose=this._onWillDispose.event,this.workspaceMemento=this.getMemento(H.WORKSPACE,Re.USER),this.profileMemento=this.getMemento(H.PROFILE,Re.MACHINE),this.groupViews=new Map,this.mostRecentActiveGroups=[],this.container=M(".content"),this.gridWidgetDisposables=this._register(new O),this.gridWidgetView=this._register(new UT),this.enforcedPartOptions=[],this.top=0,this.left=0,this.sideGroup={openEditor:(f,g)=>{const[m]=this.scopedInstantiationService.invokeFunction(v=>cv(v,{editor:f,options:g},Xm));return m.openEditor(f,g)}},this._isReady=!1,this.whenReadyPromise=new Ko,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Ko,this.whenRestored=this.whenRestoredPromise.p,this._willRestoreState=!1,this.priority=Vi.High,this.scopedContextKeyService=this._register(this.contextKeyService.createScoped(this.container)),this.scopedInstantiationService=this._register(this.instantiationService.createChild(new ta([se,this.scopedContextKeyService]))),this._partOptions=Tg(this.configurationService,this.themeService),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e))),this._register(this.themeService.onDidFileIconThemeChange(()=>this.handleChangedPartOptions())),this._register(this.onDidChangeMementoValue(H.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e)))}onConfigurationUpdated(e){Qb(e)&&this.handleChangedPartOptions()}handleChangedPartOptions(){const e=this._partOptions,t=Tg(this.configurationService,this.themeService);for(const i of this.enforcedPartOptions)Object.assign(t,i);this._partOptions=t,this._onDidChangeEditorPartOptions.fire({oldPartOptions:e,newPartOptions:t})}get partOptions(){return this._partOptions}enforcePartOptions(e){return this.enforcedPartOptions.push(e),this.handleChangedPartOptions(),ae(()=>{this.enforcedPartOptions.splice(this.enforcedPartOptions.indexOf(e),1),this.handleChangedPartOptions()})}get contentDimension(){return this._contentDimension}get activeGroup(){return this._activeGroup}get groups(){return Array.from(this.groupViews.values())}get count(){return this.groupViews.size}get orientation(){return this.gridWidget&&this.gridWidget.orientation===Z.VERTICAL?tn.VERTICAL:tn.HORIZONTAL}get isReady(){return this._isReady}get hasRestorableState(){return!!this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]}get willRestoreState(){return this._willRestoreState}getGroups(e=Ge.CREATION_TIME){switch(e){case Ge.CREATION_TIME:return this.groups;case Ge.MOST_RECENTLY_ACTIVE:{const t=Ss(this.mostRecentActiveGroups.map(i=>this.getGroup(i)));return Ls([...t,...this.groups])}case Ge.GRID_APPEARANCE:{const t=[];return this.gridWidget&&this.fillGridNodes(t,this.gridWidget.getViews()),t}}}fillGridNodes(e,t){po(t)?t.children.forEach(i=>this.fillGridNodes(e,i)):e.push(t.view)}hasGroup(e){return this.groupViews.has(e)}getGroup(e){return this.groupViews.get(e)}findGroup(e,t=this.activeGroup,i){if(typeof e.direction=="number")return this.doFindGroupByDirection(e.direction,t,i);if(typeof e.location=="number")return this.doFindGroupByLocation(e.location,t,i);throw new Error("invalid arguments")}doFindGroupByDirection(e,t,i){const s=this.assertGroupView(t),o=this.gridWidget.getNeighborViews(s,this.toGridViewDirection(e),i);return o.sort(((n,r)=>this.mostRecentActiveGroups.indexOf(n.id)-this.mostRecentActiveGroups.indexOf(r.id))),o[0]}doFindGroupByLocation(e,t,i){const s=this.assertGroupView(t),o=this.getGroups(Ge.GRID_APPEARANCE),n=o.indexOf(s);switch(e){case Nt.FIRST:return o[0];case Nt.LAST:return o[o.length-1];case Nt.NEXT:{let r=o[n+1];return!r&&i&&(r=this.doFindGroupByLocation(Nt.FIRST,t)),r}case Nt.PREVIOUS:{let r=o[n-1];return!r&&i&&(r=this.doFindGroupByLocation(Nt.LAST,t)),r}}}activateGroup(e,t){const i=this.assertGroupView(e);return this.doSetGroupActive(i),t||this.hostService.moveTop(St(this.element)),i}restoreGroup(e){const t=this.assertGroupView(e);return this.doRestoreGroup(t),t}getSize(e){const t=this.assertGroupView(e);return this.gridWidget.getViewSize(t)}setSize(e,t){const i=this.assertGroupView(e);this.gridWidget.resizeView(i,t)}arrangeGroups(e,t=this.activeGroup){if(this.count<2||!this.gridWidget)return;const i=this.assertGroupView(t);switch(e){case _s.EVEN:this.gridWidget.distributeViewSizes();break;case _s.MAXIMIZE:if(this.groups.length<2)return;this.gridWidget.maximizeView(i),i.focus();break;case _s.EXPAND:this.gridWidget.expandView(i);break}}toggleMaximizeGroup(e=this.activeGroup){this.hasMaximizedGroup()?this.unmaximizeGroup():this.arrangeGroups(_s.MAXIMIZE,e)}toggleExpandGroup(e=this.activeGroup){this.isGroupExpanded(this.activeGroup)?this.arrangeGroups(_s.EVEN):this.arrangeGroups(_s.EXPAND,e)}unmaximizeGroup(){this.gridWidget.exitMaximizedView(),this._activeGroup.focus()}hasMaximizedGroup(){return this.gridWidget.hasMaximizedView()}isGroupMaximized(e){return this.gridWidget.isViewMaximized(e)}isGroupExpanded(e){return this.gridWidget.isViewExpanded(e)}setGroupOrientation(e){if(!this.gridWidget)return;const t=e===tn.HORIZONTAL?Z.HORIZONTAL:Z.VERTICAL;this.gridWidget.orientation!==t&&(this.gridWidget.orientation=t)}applyLayout(e){const t=this.shouldRestoreFocus(this.container);let i=0;function s(d){for(const l of d)Array.isArray(l.groups)?s(l.groups):i++}s(e.groups);let o=this.getGroups(Ge.GRID_APPEARANCE);if(i<o.length){const d=o[i-1];o.forEach((l,h)=>{h>=i&&this.mergeGroup(l,d)}),o=this.getGroups(Ge.GRID_APPEARANCE)}const n=this.activeGroup,r=bv({orientation:this.toGridViewOrientation(e.orientation,this.isTwoDimensionalGrid()?this.gridWidget.orientation:Fi(this.gridWidget.orientation)),groups:e.groups});this.doApplyGridState(r,n.id,o),t&&this._activeGroup.focus()}getLayout(){const e=this.gridWidget.serialize(),t=e.orientation===Z.HORIZONTAL?tn.HORIZONTAL:tn.VERTICAL,i=this.serializedNodeToGroupLayoutArgument(e.root);return{orientation:t,groups:i.groups}}serializedNodeToGroupLayoutArgument(e){return e.type==="branch"?{size:e.size,groups:e.data.map(t=>this.serializedNodeToGroupLayoutArgument(t))}:{size:e.size}}shouldRestoreFocus(e){return e?Ic()===e.ownerDocument.body?!0:eC(e):!1}isTwoDimensionalGrid(){const e=this.gridWidget.getViews();return po(e)?e.children.some(t=>po(t)):!1}addGroup(e,t,i){const s=this.assertGroupView(e);let o;if(s.groupsView===this){const n=this.shouldRestoreFocus(s.element),r=this.groupViews.size>1&&this.isGroupExpanded(s);o=this.doCreateGroupView(i),this.gridWidget.addView(o,this.getSplitSizingStyle(),s,this.toGridViewDirection(t)),this.updateContainer(),this._onDidAddGroup.fire(o),this.notifyGroupIndexChange(),r&&this.arrangeGroups(_s.EXPAND,o),n&&s.focus()}else o=s.groupsView.addGroup(s,t,i);return o}getSplitSizingStyle(){switch(this._partOptions.splitSizing){case"distribute":return Dn.Distribute;case"split":return Dn.Split;default:return Dn.Auto}}doCreateGroupView(e,t){let i;e instanceof ja?i=ja.createCopy(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):tC(e)?i=ja.createFromSerialized(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):i=ja.createNew(this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t),this.groupViews.set(i.id,i);const s=new O;return s.add(i.onDidFocus(()=>{this.doSetGroupActive(i),this._onDidFocus.fire()})),s.add(i.onDidModelChange(o=>{switch(o.kind){case nd.GROUP_LOCKED:this._onDidChangeGroupLocked.fire(i);break;case nd.GROUP_INDEX:this._onDidChangeGroupIndex.fire(i);break;case nd.GROUP_LABEL:this._onDidChangeGroupLabel.fire(i);break}})),s.add(i.onDidActiveEditorChange(()=>{this.updateContainer()})),L.once(i.onWillDispose)(()=>{je(s),this.groupViews.delete(i.id),this.doUpdateMostRecentActive(i)}),i}doSetGroupActive(e){if(this._activeGroup!==e){const t=this._activeGroup;this._activeGroup=e,this.doUpdateMostRecentActive(e,!0),t&&!t.disposed&&t.setActive(!1),e.setActive(!0),this.doRestoreGroup(e),this._onDidChangeActiveGroup.fire(e)}this._onDidActivateGroup.fire(e)}doRestoreGroup(e){if(this.gridWidget)try{this.hasMaximizedGroup()&&!this.isGroupMaximized(e)&&this.unmaximizeGroup();const t=this.gridWidget.getViewSize(e);(t.width===e.minimumWidth||t.height===e.minimumHeight)&&this.arrangeGroups(_s.EXPAND,e)}catch{}}doUpdateMostRecentActive(e,t){const i=this.mostRecentActiveGroups.indexOf(e.id);i!==-1&&this.mostRecentActiveGroups.splice(i,1),t&&this.mostRecentActiveGroups.unshift(e.id)}toGridViewDirection(e){switch(e){case we.UP:return de.Up;case we.DOWN:return de.Down;case we.LEFT:return de.Left;case we.RIGHT:return de.Right}}toGridViewOrientation(e,t){return typeof e=="number"?e===tn.HORIZONTAL?Z.HORIZONTAL:Z.VERTICAL:t}removeGroup(e,t){const i=this.assertGroupView(e);this.count!==1&&(i.isEmpty?this.doRemoveEmptyGroup(i,t):this.doRemoveGroupWithEditors(i))}doRemoveGroupWithEditors(e){const t=this.getGroups(Ge.MOST_RECENTLY_ACTIVE);let i;this._activeGroup===e?i=t[1]:i=t[0],this.mergeGroup(e,i)}doRemoveEmptyGroup(e,t){const i=!t&&this.shouldRestoreFocus(this.container);if(this._activeGroup===e){const o=this.getGroups(Ge.MOST_RECENTLY_ACTIVE)[1];this.doSetGroupActive(o)}this.gridWidget.removeView(e,this.getSplitSizingStyle()),e.dispose(),i&&this._activeGroup.focus(),this.notifyGroupIndexChange(),this.updateContainer(),this._onDidRemoveGroup.fire(e)}moveGroup(e,t,i){const s=this.assertGroupView(e),o=this.assertGroupView(t);if(s.id===o.id)throw new Error("Cannot move group into its own");const n=this.shouldRestoreFocus(s.element);let r;return s.groupsView===o.groupsView?(this.gridWidget.moveView(s,this.getSplitSizingStyle(),o,this.toGridViewDirection(i)),r=s):(r=o.groupsView.addGroup(o,i,s),s.closeAllEditors(),this.removeGroup(s,n)),n&&r.focus(),this._onDidMoveGroup.fire(r),this.notifyGroupIndexChange(),r}copyGroup(e,t,i){const s=this.assertGroupView(e),o=this.assertGroupView(t),n=this.shouldRestoreFocus(s.element),r=this.addGroup(o,i,s);return n&&r.focus(),r}mergeGroup(e,t,i){const s=this.assertGroupView(e),o=this.assertGroupView(t),n=[];let r=i&&typeof i.index=="number"?i.index:o.count;for(const l of s.editors){const h=!s.isActive(l)||this._activeGroup!==s;let p;o.contains(l)&&(o.isSticky(l)||i?.preserveExistingIndex)||(p=r,r++),n.push({editor:l,options:{index:p,inactive:h,preserveFocus:h}})}let d=!0;return i?.mode===Jm.COPY_EDITORS?s.copyEditors(n,o):d=s.moveEditors(n,o),s.isEmpty&&!s.disposed&&this.removeGroup(s,!0),d}mergeAllGroups(e,t){const i=this.assertGroupView(e);let s=!0;for(const o of this.getGroups(Ge.MOST_RECENTLY_ACTIVE)){if(o===i)continue;this.mergeGroup(o,i,t)||(s=!1)}return s}assertGroupView(e){let t;if(typeof e=="number"?t=this.editorPartsView.getGroup(e):t=e,!t)throw new Error("Invalid editor group provided!");return t}createEditorDropTarget(e,t){return iC(qn(e)),this.scopedInstantiationService.createInstance(_h,e,t)}get minimumWidth(){return Math.min(this.centeredLayoutWidget.minimumWidth,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(St(this.container))).width)}get maximumWidth(){return this.centeredLayoutWidget.maximumWidth}get minimumHeight(){return Math.min(this.centeredLayoutWidget.minimumHeight,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(St(this.container))).height)}get maximumHeight(){return this.centeredLayoutWidget.maximumHeight}get snap(){return this.layoutService.getPanelAlignment()==="center"}get onDidChange(){return L.any(this.centeredLayoutWidget.onDidChange,this.onDidSetGridWidget.event)}get gridSeparatorBorder(){return this.theme.getColor(sC)||this.theme.getColor($s)||oi.transparent}updateStyles(){this.container.style.backgroundColor=this.getColor(oC)||"";const e={separatorBorder:this.gridSeparatorBorder,background:this.theme.getColor(nC)||oi.transparent};this.gridWidget.style(e),this.centeredLayoutWidget.styles(e)}createContentArea(e,t){return this.element=e,this.windowId!==re.vscodeWindowId&&this.container.classList.add("auxiliary"),e.appendChild(this.container),this._willRestoreState=!t||t.restorePreviousState,this.doCreateGridControl(),this.centeredLayoutWidget=this._register(new GT(this.container,this.gridWidgetView,this.profileMemento[Xi.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY],this._partOptions.centeredLayoutFixedWidth)),this._register(this.onDidChangeEditorPartOptions(i=>this.centeredLayoutWidget.setFixedWidth(i.newPartOptions.centeredLayoutFixedWidth??!1))),this.setupDragAndDropSupport(e,this.container),this.handleContextKeys(),this.whenReadyPromise.complete(),this._isReady=!0,xp.settled(this.groups.map(i=>i.whenRestored)).finally(()=>{this.whenRestoredPromise.complete()}),this.container}handleContextKeys(){Js.bindTo(this.scopedContextKeyService).set(this.windowId!==re.vscodeWindowId);const t=kp.bindTo(this.scopedContextKeyService),i=Rp.bindTo(this.scopedContextKeyService),s=()=>{this.count>1?t.set(!0):t.reset(),this.hasMaximizedGroup()?i.set(!0):i.reset()};s(),this._register(this.onDidAddGroup(()=>s())),this._register(this.onDidRemoveGroup(()=>s())),this._register(this.onDidChangeGroupMaximized(()=>s()))}setupDragAndDropSupport(e,t){this._register(this.createEditorDropTarget(t,Object.create(null)));const i=M(".drop-block-overlay");e.appendChild(i),this._register(rC(i,()=>i.classList.remove("visible"))),this._register(md.INSTANCE.registerTarget(this.element,{onDragStart:h=>i.classList.add("visible"),onDragEnd:h=>i.classList.remove("visible")}));let s,o,n,r;const d=h=>{!this.layoutService.isVisible(P.PANEL_PART)&&h===this.layoutService.getPanelPosition()?this.layoutService.setPartHidden(!1,P.PANEL_PART):!this.layoutService.isVisible(P.AUXILIARYBAR_PART)&&h===(this.layoutService.getSideBarPosition()===Ot.RIGHT?Ot.LEFT:Ot.RIGHT)&&this.layoutService.setPartHidden(!1,P.AUXILIARYBAR_PART)},l=()=>{s&&(clearTimeout(s),s=void 0),o&&(clearTimeout(o),o=void 0)};this._register(md.INSTANCE.registerTarget(i,{onDragOver:h=>{ke.stop(h.eventData,!0),h.eventData.dataTransfer&&(h.eventData.dataTransfer.dropEffect="none");const p=i.getBoundingClientRect();let f,g;const m=100;h.eventData.clientX<p.left+m&&(f=Ot.LEFT),h.eventData.clientX>p.right-m&&(f=Ot.RIGHT),h.eventData.clientY>p.bottom-m&&(g=Ot.BOTTOM),h.eventData.clientY<p.top+m&&(g=Ot.TOP),s&&f!==n&&(clearTimeout(s),s=void 0),o&&g!==r&&(clearTimeout(o),o=void 0),!s&&f!==void 0&&(n=f,s=setTimeout(()=>d(f),200)),!o&&g!==void 0&&(r=g,o=setTimeout(()=>d(g),200))},onDragLeave:()=>l(),onDragEnd:()=>l(),onDrop:()=>l()}))}centerLayout(e){this.centeredLayoutWidget.activate(e)}isLayoutCentered(){return this.centeredLayoutWidget?this.centeredLayoutWidget.isActive():!1}doCreateGridControl(){let e=!1;if(this._willRestoreState&&(e=!this.doCreateGridControlWithPreviousState()),!this.gridWidget||e){const t=this.doCreateGroupView();this.doSetGridWidget(new ks(t)),this.doSetGroupActive(t)}this.updateContainer(),this.notifyGroupIndexChange()}doCreateGridControlWithPreviousState(){const e=this.loadState();if(e?.serializedGrid)try{this.mostRecentActiveGroups=e.mostRecentActiveGroups,this.doCreateGridControlWithState(e.serializedGrid,e.activeGroup)}catch(t){return jn(new Error(`Error restoring editor grid widget: ${t} (with state: ${JSON.stringify(e)})`)),this.disposeGroups(),!1}return!0}doCreateGridControlWithState(e,t,i,s){let o;i?o=i.slice(0):o=[];const n=[],r=ks.deserialize(e,{fromJSON:d=>{let l;return o.length>0?l=o.shift():l=this.doCreateGroupView(d,s),n.push(l),l.id===t&&this.doSetGroupActive(l),l}},{styles:{separatorBorder:this.gridSeparatorBorder}});this._activeGroup||this.doSetGroupActive(n[0]),this.mostRecentActiveGroups.some(d=>!this.getGroup(d))&&(this.mostRecentActiveGroups=n.map(d=>d.id)),this.doSetGridWidget(r)}doSetGridWidget(e){let t={};this.gridWidget&&(t=this.gridWidget.boundarySashes,this.gridWidget.dispose()),this.gridWidget=e,this.gridWidget.boundarySashes=t,this.gridWidgetView.gridWidget=e,this._onDidChangeSizeConstraints.input=e.onDidChange,this._onDidScroll.input=e.onDidScroll,this.gridWidgetDisposables.clear(),this.gridWidgetDisposables.add(e.onDidChangeViewMaximized(i=>this._onDidChangeGroupMaximized.fire(i))),this.onDidSetGridWidget.fire(void 0)}updateContainer(){this.container.classList.toggle("empty",this.isEmpty)}notifyGroupIndexChange(){this.getGroups(Ge.GRID_APPEARANCE).forEach((e,t)=>e.notifyIndexChanged(t))}notifyGroupsLabelChange(e){for(const t of this.groups)t.notifyLabelChanged(e)}get isEmpty(){return this.count===1&&this._activeGroup.isEmpty}setBoundarySashes(e){this.gridWidget.boundarySashes=e,this.centeredLayoutWidget.boundarySashes=e}layout(e,t,i,s){this.top=i,this.left=s;const o=super.layoutContents(e,t).contentSize;this.doLayout(jt.lift(o),i,s)}doLayout(e,t=this.top,i=this.left){this._contentDimension=e,this.centeredLayoutWidget.layout(this._contentDimension.width,this._contentDimension.height,t,i),this._onDidLayout.fire(e)}saveState(){if(this.gridWidget&&(this.isEmpty?delete this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]:this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]=this.createState()),this.centeredLayoutWidget){const e=this.centeredLayoutWidget.state;this.centeredLayoutWidget.isDefault(e)?delete this.profileMemento[Xi.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]:this.profileMemento[Xi.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]=e}super.saveState()}loadState(){return this.workspaceMemento[Xi.EDITOR_PART_UI_STATE_STORAGE_KEY]}createState(){return{serializedGrid:this.gridWidget.serialize(),activeGroup:this._activeGroup.id,mostRecentActiveGroups:this.mostRecentActiveGroups}}applyState(e,t){return e==="empty"?this.doApplyEmptyState():this.doApplyState(e,t)}async doApplyState(e,t){const i=await this.doPrepareApplyState();this._onDidAddGroup.pause(),this._onDidRemoveGroup.pause(),this.disposeGroups(),this.mostRecentActiveGroups=e.mostRecentActiveGroups;try{this.doApplyGridState(e.serializedGrid,e.activeGroup,void 0,t)}finally{this._onDidRemoveGroup.resume(),this._onDidAddGroup.resume()}await this.activeGroup.openEditors(i.flatMap(s=>s.editors).filter(s=>this.editorPartsView.groups.every(o=>!o.contains(s))).map(s=>({editor:s,options:{pinned:!0,preserveFocus:!0,inactive:!0}})))}async doApplyEmptyState(){await this.doPrepareApplyState(),this.mergeAllGroups(this.activeGroup)}async doPrepareApplyState(){const e=this.getGroups(Ge.MOST_RECENTLY_ACTIVE);for(const t of e)await t.closeAllEditors({excludeConfirming:!0});return e}doApplyGridState(e,t,i,s){this.doCreateGridControlWithState(e,t,i,s),this.doLayout(this._contentDimension),this.updateContainer();for(const o of this.getGroups(Ge.GRID_APPEARANCE))i?.includes(o)||this._onDidAddGroup.fire(o);this.notifyGroupIndexChange()}onDidChangeMementoState(e){if(e.external&&e.scope===H.WORKSPACE){this.reloadMemento(e.scope);const t=this.loadState();t&&this.applyState(t)}}toJSON(){return{type:P.EDITOR_PART}}disposeGroups(){for(const e of this.groups)e.dispose(),this._onDidRemoveGroup.fire(e);this.groupViews.clear(),this.mostRecentActiveGroups=[]}dispose(){this._onWillDispose.fire(),this.disposeGroups(),this.gridWidget?.dispose(),super.dispose()}},Xi=Ms,Ms.EDITOR_PART_UI_STATE_STORAGE_KEY="editorpart.state",Ms.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY="editorpart.centeredview",Ms);Vd=Xi=D([u(4,F),u(5,me),u(6,ie),u(7,ce),u(8,He),u(9,Zt),u(10,se)],Vd);let Eh=class extends Vd{constructor(e,t,i,s,o,n,r,d){super(e,P.EDITOR_PART,"",re.vscodeWindowId,t,i,s,o,n,r,d)}};Eh=D([u(1,F),u(2,me),u(3,ie),u(4,ce),u(5,He),u(6,Zt),u(7,se)],Eh);const HT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var on;Pe(HT);var Mi;let Ih=(Mi=class extends da{get preferredHeight(){return this.layoutService.mainContainerDimension.height*.4}get preferredWidth(){const e=this.getActivePaneComposite();if(!e)return;const t=e.getOptimalWidth();if(typeof t=="number")return Math.max(t,300)}constructor(e,t,i,s,o,n,r,d,l,h,p,f,g,m){super(P.AUXILIARYBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(yd)||this.getColor($s)?1:0},on.activeViewSettingsKey,aC.bindTo(h),dC.bindTo(h),"auxiliarybar","auxiliarybar",void 0,Nm,e,t,i,s,o,n,r,d,l,h,p,g),this.commandService=f,this.configurationService=m,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Vi.Low,this.configuration=this.resolveConfiguration(),this._register(m.onDidChangeConfiguration(v=>{v.affectsConfiguration(Wt.ACTIVITY_BAR_LOCATION)?(this.configuration=this.resolveConfiguration(),this.onDidChangeActivityBarLocation()):v.affectsConfiguration("workbench.secondarySideBar.showLabels")&&(this.configuration=this.resolveConfiguration(),this.updateCompositeBar(!0))}))}resolveConfiguration(){const e=this.configurationService.getValue(Wt.ACTIVITY_BAR_LOCATION),t=e!==Oe.TOP,i=t&&this.configurationService.getValue("workbench.secondarySideBar.showLabels")!==!1;return{position:e,canShowLabels:t,showLabels:i}}onDidChangeActivityBarLocation(){this.updateCompositeBar();const e=this.getActiveComposite()?.getId();e&&this.onTitleAreaUpdate(e)}updateStyles(){super.updateStyles();const e=Ee(this.getContainer());e.style.backgroundColor=this.getColor(Cn)||"";const t=this.getColor(yd)||this.getColor($s),i=this.layoutService.getSideBarPosition()===Ot.RIGHT;e.style.color=this.getColor(Bm)||"",e.style.borderLeftColor=t??"",e.style.borderRightColor=t??"",e.style.borderLeftStyle=t&&!i?"solid":"none",e.style.borderRightStyle=t&&i?"solid":"none",e.style.borderLeftWidth=t&&!i?"1px":"0px",e.style.borderRightWidth=t&&i?"1px":"0px"}getCompositeBarOptions(){const e=this;return{partContainerClass:"auxiliarybar",pinnedViewContainersKey:on.pinnedViewsKey,placeholderViewContainersKey:on.placeholdeViewContainersKey,viewContainersWorkspaceStateKey:on.viewContainersWorkspaceStateKey,icon:!this.configuration.showLabels,orientation:Fo.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===fe.BOTTOM?$n.ABOVE:$n.BELOW},fillExtraContextMenuActions:t=>this.fillExtraContextMenuActions(t),compositeSize:0,iconSize:16,get overflowActionSize(){return e.getCompositeBarPosition()===fe.TITLE?40:30},colors:t=>({activeBackgroundColor:t.getColor(Cn),inactiveBackgroundColor:t.getColor(Cn),get activeBorderBottomColor(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor(jm):t.getColor(Hm)},get activeForegroundColor(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor(qm):t.getColor(Um)},get inactiveForegroundColor(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor($m):t.getColor(Gm)},badgeBackground:t.getColor(Wm),badgeForeground:t.getColor(Km),get dragAndDropBorder(){return e.getCompositeBarPosition()===fe.TITLE?t.getColor(zm):t.getColor(Fm)}}),compact:!0}}fillExtraContextMenuActions(e){const t=this.layoutService.getSideBarPosition()===Ot.LEFT;if(this.getCompositeBarPosition()===fe.TITLE){const n=this.getViewsSubmenuAction();n&&(e.push(new hs),e.push(n))}const i=this.menuService.getMenuActions(w.ActivityBarPositionMenu,this.contextKeyService,{shouldForwardArgs:!0,renderShortTitle:!0}),s=bd(i).secondary,o=cs({id:"workbench.action.auxiliarybar.toggleShowLabels",label:this.configuration.showLabels?c(2881,"Show Icons"):c(2882,"Show Labels"),enabled:this.configuration.canShowLabels,run:()=>this.configurationService.updateValue("workbench.secondarySideBar.showLabels",!this.configuration.showLabels)});e.push(new hs,new wd("workbench.action.panel.position",c(2883,"Activity Bar Position"),s),cs({id:xg.ID,label:t?c(2884,"Move Secondary Side Bar Left"):c(2885,"Move Secondary Side Bar Right"),run:()=>this.commandService.executeCommand(xg.ID)}),o,cs({id:hl.ID,label:c(2886,"Hide Secondary Side Bar"),run:()=>this.commandService.executeCommand(hl.ID)}))}shouldShowCompositeBar(){return this.configuration.position!==Oe.HIDDEN}getCompositeBarPosition(){switch(this.configuration.position){case Oe.TOP:return fe.TOP;case Oe.BOTTOM:return fe.BOTTOM;case Oe.HIDDEN:return fe.TITLE;case Oe.DEFAULT:return fe.TITLE;default:return fe.TITLE}}createHeaderArea(){const e=super.createHeaderArea(),t=M(".auxiliary-bar-global-header"),i=this.headerFooterCompositeBarDispoables.add(this.instantiationService.createInstance(Vm,w.AuxiliaryBarHeader,void 0,void 0)),s=this.headerFooterCompositeBarDispoables.add(this.instantiationService.createInstance(Dp,t,{actionViewItemProvider:(o,n)=>this.headerActionViewItemProvider(o,n),orientation:Fo.HORIZONTAL,hiddenItemStrategy:Pm.NoHide,getKeyBinding:o=>this.keybindingService.lookupKeybinding(o.id)}));return s.setActions(Hn(i.getPrimaryActions())),this.headerFooterCompositeBarDispoables.add(i.onDidChange(()=>s.setActions(Hn(i.getPrimaryActions())))),e.appendChild(t),e}headerActionViewItemProvider(e,t){if(e.id===hl.ID)return this.instantiationService.createInstance(Lp,void 0,e,t)}toJSON(){return{type:P.AUXILIARYBAR_PART}}},on=Mi,Mi.activeViewSettingsKey="workbench.auxiliarybar.activepanelid",Mi.pinnedViewsKey="workbench.auxiliarybar.pinnedPanels",Mi.placeholdeViewContainersKey="workbench.auxiliarybar.placeholderPanels",Mi.viewContainersWorkspaceStateKey="workbench.auxiliarybar.viewContainersWorkspaceState",Mi);Ih=on=D([u(0,Ke),u(1,ce),u(2,at),u(3,He),u(4,it),u(5,Tt),u(6,F),u(7,me),u(8,Ye),u(9,se),u(10,At),u(11,wt),u(12,Cs),u(13,ie)],Ih);var nn,Dh;const il=lC(new E);b(class extends X{constructor(){super({id:"workbench.action.toggleCompactAuxiliaryWindow",title:x(2905,"Toggle Window Compact Mode"),category:xe.View,f1:!0,precondition:pC})}async run(){il.fire({windowId:Go().vscodeWindowId,compact:"toggle"})}});b(class extends X{constructor(){super({id:"workbench.action.enableCompactAuxiliaryWindow",title:c(2906,"Turn On Compact Mode"),icon:k.screenFull,menu:{id:w.LayoutControlMenu,when:I.and(ew.toNegated(),Js),order:0}})}async run(){il.fire({windowId:Go().vscodeWindowId,compact:!0})}});b(class extends X{constructor(){super({id:"workbench.action.disableCompactAuxiliaryWindow",title:c(2907,"Turn Off Compact Mode"),icon:k.screenNormal,menu:{id:w.LayoutControlMenu,when:I.and(ew,Js),order:0}})}async run(){il.fire({windowId:Go().vscodeWindowId,compact:!1})}});var Co;let Ah=(Co=class{constructor(e,t,i,s,o,n,r,d,l){this.editorPartsView=e,this.instantiationService=t,this.auxiliaryWindowService=i,this.lifecycleService=s,this.configurationService=o,this.statusbarService=n,this.titleService=r,this.editorService=d,this.layoutService=l}async create(e,t){const i=this,s=new O;let o=!!t?.compact;function n(){let W=0;return B&&(W+=T.height),m&&v&&(W+=m.height),W}function r(W){B?ia(T.container):sa(T.container),W&&h.layout()}function d(W){m&&(v?ia(m.container):sa(m.container),W&&h.layout())}function l(W){if(W===o)return;o=W,h.updateOptions({compact:o}),m?.updateOptions({compact:o}),f.updateOptions({compact:o});const K=B;B=!o&&i.configurationService.getValue(nn.STATUS_BAR_VISIBILITY)!==!1,K!==B&&r(!0)}const h=s.add(await this.auxiliaryWindowService.open(t)),p=M(".part.editor",{role:"main"});p.style.position="relative",h.container.appendChild(p);const f=s.add(this.instantiationService.createInstance(Th,h.window.vscodeWindowId,this.editorPartsView,t?.state,e));f.updateOptions({compact:o}),s.add(this.editorPartsView.registerPart(f)),f.create(p);const g=s.add(f.scopedInstantiationService.createChild(new ta([Q,this.editorService.createScoped(f,s)])));let m,v=!1;if(hC&&uC()){m=s.add(this.titleService.createAuxiliaryTitlebarPart(h.container,f,g)),m.updateOptions({compact:o}),v=kg(this.configurationService,h.window,void 0);const W=()=>{const K=v;v=kg(this.configurationService,h.window,void 0),K!==v&&d(!0)};s.add(m.onDidChange(()=>h.layout())),s.add(this.layoutService.onDidChangePartVisibility(()=>W())),s.add(Qm(K=>{K===h.window.vscodeWindowId&&W()})),d(!1)}else s.add(g.createInstance(cC,h.window));const T=s.add(this.statusbarService.createAuxiliaryStatusbarPart(h.container,g));let B=!o&&this.configurationService.getValue(nn.STATUS_BAR_VISIBILITY)!==!1;s.add(this.configurationService.onDidChangeConfiguration(W=>{W.affectsConfiguration(nn.STATUS_BAR_VISIBILITY)&&(B=!o&&this.configurationService.getValue(nn.STATUS_BAR_VISIBILITY)!==!1,r(!0))})),r(!1);const V=s.add(L.once(f.onWillClose)(()=>h.window.close()));s.add(L.once(h.onUnload)(()=>{s.isDisposed||(V.dispose(),f.close(),s.dispose())})),s.add(L.once(this.lifecycleService.onDidShutdown)(()=>s.dispose())),s.add(h.onBeforeUnload(W=>{for(const K of f.groups)for(const j of K.editors){const oe=j.canMove(K.id,this.editorPartsView.mainPart.activeGroup.id);if(typeof oe=="string"){K.openEditor(j),W.veto(oe);break}}})),s.add(h.onWillLayout(W=>{const K=m?.height??0;m?.layout(W.width,K,0,0);const j=W.height-n();f.layout(W.width,j,K,0),T.layout(W.width,T.height,W.height-T.height,0)})),h.layout(),s.add(il.event(W=>{if(W.windowId===h.window.vscodeWindowId){let K;typeof W.compact=="boolean"?K=W.compact:K=!o,l(K)}}));const U=s.add(g.createChild(new ta([Ui,this.statusbarService.createScoped(T,s)])));return{part:f,instantiationService:U,disposables:s}}},nn=Co,Co.STATUS_BAR_VISIBILITY="workbench.statusBar.visible",Co);Ah=nn=D([u(1,F),u(2,Vp),u(3,or),u(4,ie),u(5,Ui),u(6,gC),u(7,Q),u(8,He)],Ah);var So;let Th=(So=class extends Vd{constructor(e,t,i,s,o,n,r,d,l,h,p){const f=Dh.COUNTER++;super(t,`workbench.parts.auxiliaryEditor.${f}`,s,e,o,n,r,d,l,h,p),this.state=i,this._onWillClose=this._register(new E),this.onWillClose=this._onWillClose.event,this.optionsDisposable=this._register(new Ie),this.isCompact=!1}updateOptions(e){this.isCompact=e.compact,e.compact?this.optionsDisposable.value||(this.optionsDisposable.value=this.enforcePartOptions({showTabs:"none",closeEmptyGroups:!0})):this.optionsDisposable.clear()}addGroup(e,t,i){return this.isCompact&&(e=this.editorPartsView.mainPart.activeGroup),super.addGroup(e,t,i)}removeGroup(e,t){const i=this.assertGroupView(e);this.count===1&&this.activeGroup===i?this.doRemoveLastGroup(t):super.removeGroup(e,t)}doRemoveLastGroup(e){const t=!e&&this.shouldRestoreFocus(this.container),s=this.editorPartsView.getGroups(Ge.MOST_RECENTLY_ACTIVE)[1];s&&(s.groupsView.activateGroup(s),t&&s.focus()),this.doClose(!1)}loadState(){return this.state}saveState(){}close(){return this.doClose(!0)}doClose(e){let t=!0;if(e){for(const i of this.groups)i.closeAllEditors({excludeConfirming:!0});t=this.mergeGroupsToMainPart()}return this._onWillClose.fire(),t}mergeGroupsToMainPart(){if(!this.groups.some(i=>i.count>0))return!0;let e;for(const i of this.editorPartsView.mainPart.getGroups(Ge.MOST_RECENTLY_ACTIVE))if(!i.isLocked){e=i;break}e||(e=this.editorPartsView.mainPart.addGroup(this.editorPartsView.mainPart.activeGroup,this.partOptions.openSideBySideDirection==="right"?we.RIGHT:we.DOWN));const t=this.mergeAllGroups(e,{preserveExistingIndex:!0});return e.focus(),t}},Dh=So,So.COUNTER=1,So);Th=Dh=D([u(4,F),u(5,me),u(6,ie),u(7,ce),u(8,He),u(9,Zt),u(10,se)],Th);var so,Os;let Zf=(Os=class extends fC{constructor(e,t,i,s,o){super("workbench.editorParts",i,t),this.instantiationService=e,this.storageService=t,this.auxiliaryWindowService=s,this.contextKeyService=o,this.mapPartToInstantiationService=new Map,this._onDidCreateAuxiliaryEditorPart=this._register(new E),this.onDidCreateAuxiliaryEditorPart=this._onDidCreateAuxiliaryEditorPart.event,this.workspaceMemento=this.getMemento(H.WORKSPACE,Re.USER),this._isReady=!1,this.whenReadyPromise=new Ko,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Ko,this.whenRestored=this.whenRestoredPromise.p,this._onDidActiveGroupChange=this._register(new E),this.onDidChangeActiveGroup=this._onDidActiveGroupChange.event,this._onDidAddGroup=this._register(new E),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new E),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new E),this.onDidMoveGroup=this._onDidMoveGroup.event,this._onDidActivateGroup=this._register(new E),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidChangeGroupIndex=this._register(new E),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLocked=this._register(new E),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new E),this.onDidChangeGroupMaximized=this._onDidChangeGroupMaximized.event,this.globalContextKeys=new Map,this.scopedContextKeys=new Map,this.contextKeyProviders=new Map,this.registeredContextKeys=new Map,this.contextKeyProviderDisposables=this._register(new Cd),this.editorWorkingSets=(()=>{const n=this.storageService.get(so.EDITOR_WORKING_SETS_STORAGE_KEY,H.WORKSPACE);return n?JSON.parse(n):[]})(),this.mainPart=this._register(this.createMainEditorPart()),this._register(this.registerPart(this.mainPart)),this.mostRecentActiveParts=[this.mainPart],this.restoreParts(),this.registerListeners()}registerListeners(){this._register(this.onDidChangeMementoValue(H.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e))),this.whenReady.then(()=>this.registerGroupsContextKeyListeners())}createMainEditorPart(){return this.instantiationService.createInstance(Eh,this)}getScopedInstantiationService(e){return e===this.mainPart&&(this.mapPartToInstantiationService.has(e.windowId)||this.instantiationService.invokeFunction(t=>{const i=t.get(Q),s=t.get(Ui);this.mapPartToInstantiationService.set(e.windowId,this._register(this.mainPart.scopedInstantiationService.createChild(new ta([Q,i.createScoped(this.mainPart,this._store)],[Ui,s.createScoped(s,this._store)]))))})),this.mapPartToInstantiationService.get(e.windowId)??this.instantiationService}async createAuxiliaryEditorPart(e){const{part:t,instantiationService:i,disposables:s}=await this.instantiationService.createInstance(Ah,this).create(this.getGroupsLabel(this._parts.size),e);return this.mapPartToInstantiationService.set(t.windowId,i),s.add(ae(()=>this.mapPartToInstantiationService.delete(t.windowId))),this._onDidAddGroup.fire(t.activeGroup),this._onDidCreateAuxiliaryEditorPart.fire(t),t}registerPart(e){const t=this._register(new O);return t.add(super.registerPart(e)),this.registerEditorPartListeners(e,t),t}unregisterPart(e){super.unregisterPart(e),this.parts.forEach((t,i)=>{t!==this.mainPart&&t.notifyGroupsLabelChange(this.getGroupsLabel(i))})}registerEditorPartListeners(e,t){t.add(e.onDidFocus(()=>{this.doUpdateMostRecentActive(e,!0),this._parts.size>1&&this._onDidActiveGroupChange.fire(this.activeGroup)})),t.add(ae(()=>this.doUpdateMostRecentActive(e))),t.add(e.onDidChangeActiveGroup(i=>this._onDidActiveGroupChange.fire(i))),t.add(e.onDidAddGroup(i=>this._onDidAddGroup.fire(i))),t.add(e.onDidRemoveGroup(i=>this._onDidRemoveGroup.fire(i))),t.add(e.onDidMoveGroup(i=>this._onDidMoveGroup.fire(i))),t.add(e.onDidActivateGroup(i=>this._onDidActivateGroup.fire(i))),t.add(e.onDidChangeGroupMaximized(i=>this._onDidChangeGroupMaximized.fire(i))),t.add(e.onDidChangeGroupIndex(i=>this._onDidChangeGroupIndex.fire(i))),t.add(e.onDidChangeGroupLocked(i=>this._onDidChangeGroupLocked.fire(i)))}doUpdateMostRecentActive(e,t){const i=this.mostRecentActiveParts.indexOf(e);i!==-1&&this.mostRecentActiveParts.splice(i,1),t&&this.mostRecentActiveParts.unshift(e)}getGroupsLabel(e){return c(3273,"Window {0}",e+1)}getPart(e){if(this._parts.size>1)if(qn(e)){const t=e;return this.getPartByDocument(t.ownerDocument)}else{const t=e;let i;typeof t=="number"?i=t:i=t.id;for(const s of this._parts)if(s.hasGroup(i))return s}return this.mainPart}get isReady(){return this._isReady}async restoreParts(){if(await this.mainPart.whenReady,this.mainPart.willRestoreState){const t=this.loadState();t&&await this.restoreState(t)}this.mostRecentActiveParts.at(0)?.activeGroup.focus(),this._isReady=!0,this.whenReadyPromise.complete(),await Promise.allSettled(this.parts.map(t=>t.whenRestored)),this.whenRestoredPromise.complete()}loadState(){return this.workspaceMemento[so.EDITOR_PARTS_UI_STATE_STORAGE_KEY]}saveState(){const e=this.createState();e.auxiliary.length===0?delete this.workspaceMemento[so.EDITOR_PARTS_UI_STATE_STORAGE_KEY]:this.workspaceMemento[so.EDITOR_PARTS_UI_STATE_STORAGE_KEY]=e}createState(){return{auxiliary:this.parts.filter(e=>e!==this.mainPart).map(e=>{const t=this.auxiliaryWindowService.getWindow(e.windowId);return{state:e.createState(),...t?.createState()}}),mru:this.mostRecentActiveParts.map(e=>this.parts.indexOf(e))}}async restoreState(e){if(e.auxiliary.length){const t=[];for(const i of e.auxiliary)t.push(this.createAuxiliaryEditorPart(i));await Promise.allSettled(t),e.mru.length===this.parts.length?this.mostRecentActiveParts=e.mru.map(i=>this.parts[i]):this.mostRecentActiveParts=[...this.parts],await Promise.allSettled(this.parts.map(i=>i.whenReady))}}get hasRestorableState(){return this.parts.some(e=>e.hasRestorableState)}onDidChangeMementoState(e){if(e.external&&e.scope===H.WORKSPACE){this.reloadMemento(e.scope);const t=this.loadState();t&&this.applyState(t)}}async applyState(e){for(const t of this.parts){if(t===this.mainPart)continue;for(const s of t.getGroups(Ge.MOST_RECENTLY_ACTIVE))await s.closeAllEditors({excludeConfirming:!0});if(!t.close())return!1}return e!=="empty"&&await this.restoreState(e),!0}saveWorkingSet(e){const t={id:nr(),name:e,main:this.mainPart.createState(),auxiliary:this.createState()};return this.editorWorkingSets.push(t),this.saveWorkingSets(),{id:t.id,name:t.name}}getWorkingSets(){return this.editorWorkingSets.map(e=>({id:e.id,name:e.name}))}deleteWorkingSet(e){const t=this.indexOfWorkingSet(e);typeof t=="number"&&(this.editorWorkingSets.splice(t,1),this.saveWorkingSets())}async applyWorkingSet(e,t){let i;if(e==="empty"?i="empty":i=this.editorWorkingSets[this.indexOfWorkingSet(e)??-1],!i||!await this.applyState(i==="empty"?i:i.auxiliary))return!1;if(await this.mainPart.applyState(i==="empty"?i:i.main,t),!t?.preserveFocus){const o=this.mostRecentActiveParts.at(0);o&&(await o.whenReady,o.activeGroup.focus())}return!0}indexOfWorkingSet(e){for(let t=0;t<this.editorWorkingSets.length;t++)if(this.editorWorkingSets[t].id===e.id)return t}saveWorkingSets(){this.storageService.store(so.EDITOR_WORKING_SETS_STORAGE_KEY,JSON.stringify(this.editorWorkingSets),H.WORKSPACE,Re.MACHINE)}get activeGroup(){return this.activePart.activeGroup}get sideGroup(){return this.activePart.sideGroup}get groups(){return this.getGroups()}get count(){return this.groups.length}getGroups(e=Ge.CREATION_TIME){if(this._parts.size>1){let t;switch(e){case Ge.GRID_APPEARANCE:case Ge.CREATION_TIME:t=this.parts;break;case Ge.MOST_RECENTLY_ACTIVE:t=Ls([...this.mostRecentActiveParts,...this.parts]);break}return t.map(i=>i.getGroups(e)).flat()}return this.mainPart.getGroups(e)}getGroup(e){if(this._parts.size>1)for(const t of this._parts){const i=t.getGroup(e);if(i)return i}return this.mainPart.getGroup(e)}assertGroupView(e){let t;if(typeof e=="number"?t=this.getGroup(e):t=e,!t)throw new Error("Invalid editor group provided!");return t}activateGroup(e){return this.getPart(e).activateGroup(e)}getSize(e){return this.getPart(e).getSize(e)}setSize(e,t){this.getPart(e).setSize(e,t)}arrangeGroups(e,t=this.activePart.activeGroup){this.getPart(t).arrangeGroups(e,t)}toggleMaximizeGroup(e=this.activePart.activeGroup){this.getPart(e).toggleMaximizeGroup(e)}toggleExpandGroup(e=this.activePart.activeGroup){this.getPart(e).toggleExpandGroup(e)}restoreGroup(e){return this.getPart(e).restoreGroup(e)}applyLayout(e){this.activePart.applyLayout(e)}getLayout(){return this.activePart.getLayout()}get orientation(){return this.activePart.orientation}setGroupOrientation(e){this.activePart.setGroupOrientation(e)}findGroup(e,t=this.activeGroup,i){const s=this.getPart(t);if(this._parts.size>1){const o=this.getGroups(Ge.GRID_APPEARANCE);if(e.location===Nt.FIRST||e.location===Nt.LAST)return e.location===Nt.FIRST?o[0]:o[o.length-1];const n=s.findGroup(e,t,!1);if(n)return n;if(e.location===Nt.NEXT||e.location===Nt.PREVIOUS){const r=this.assertGroupView(t),d=o.indexOf(r);if(e.location===Nt.NEXT){let l=o[d+1];return!l&&i&&(l=o[0]),l}else{let l=o[d-1];return!l&&i&&(l=o[o.length-1]),l}}}return s.findGroup(e,t,i)}addGroup(e,t){return this.getPart(e).addGroup(e,t)}removeGroup(e){this.getPart(e).removeGroup(e)}moveGroup(e,t,i){return this.getPart(e).moveGroup(e,t,i)}mergeGroup(e,t,i){return this.getPart(e).mergeGroup(e,t,i)}mergeAllGroups(e,t){return this.activePart.mergeAllGroups(e,t)}copyGroup(e,t,i){return this.getPart(e).copyGroup(e,t,i)}createEditorDropTarget(e,t){return this.getPart(e).createEditorDropTarget(e,t)}registerGroupsContextKeyListeners(){this._register(this.onDidChangeActiveGroup(()=>this.updateGlobalContextKeys())),this.groups.forEach(e=>this.registerGroupContextKeyProvidersListeners(e)),this._register(this.onDidAddGroup(e=>this.registerGroupContextKeyProvidersListeners(e))),this._register(this.onDidRemoveGroup(e=>{this.scopedContextKeys.delete(e.id),this.registeredContextKeys.delete(e.id),this.contextKeyProviderDisposables.deleteAndDispose(e.id)}))}updateGlobalContextKeys(){const e=this.scopedContextKeys.get(this.activeGroup.id);if(e)for(const[t,i]of this.globalContextKeys){const s=e.get(t);s?i.set(s.get()):i.reset()}}bind(e,t){let i=this.globalContextKeys.get(e.key);i||(i=e.bindTo(this.contextKeyService),this.globalContextKeys.set(e.key,i));let s=this.scopedContextKeys.get(t.id);s||(s=new Map,this.scopedContextKeys.set(t.id,s));let o=s.get(e.key);o||(o=e.bindTo(t.scopedContextKeyService),s.set(e.key,o));const n=this;return{get(){return o.get()},set(r){n.activeGroup===t&&i.set(r),o.set(r)},reset(){n.activeGroup===t&&i.reset(),o.reset()}}}registerContextKeyProvider(e){if(this.contextKeyProviders.has(e.contextKey.key)||this.globalContextKeys.has(e.contextKey.key))throw new Error(`A context key provider for key ${e.contextKey.key} already exists.`);this.contextKeyProviders.set(e.contextKey.key,e);const t=()=>{for(const s of this.groups)this.updateRegisteredContextKey(s,e)};t();const i=e.onDidChange?.(()=>t());return ae(()=>{i?.dispose(),this.globalContextKeys.delete(e.contextKey.key),this.scopedContextKeys.forEach(s=>s.delete(e.contextKey.key)),this.contextKeyProviders.delete(e.contextKey.key),this.registeredContextKeys.forEach(s=>s.delete(e.contextKey.key))})}registerGroupContextKeyProvidersListeners(e){const t=e.onDidActiveEditorChange(()=>{for(const i of this.contextKeyProviders.values())this.updateRegisteredContextKey(e,i)});this.contextKeyProviderDisposables.set(e.id,t)}updateRegisteredContextKey(e,t){let i=this.registeredContextKeys.get(e.id);i||(i=new Map,this.registeredContextKeys.set(e.id,i));let s=i.get(t.contextKey.key);s||(s=this.bind(t.contextKey,e),i.set(t.contextKey.key,s)),s.set(t.getGroupContextKeyValue(e))}get partOptions(){return this.mainPart.partOptions}get onDidChangeEditorPartOptions(){return this.mainPart.onDidChangeEditorPartOptions}enforcePartOptions(e){return this.mainPart.enforcePartOptions(e)}},so=Os,Os.EDITOR_PARTS_UI_STATE_STORAGE_KEY="editorparts.state",Os.EDITOR_WORKING_SETS_STORAGE_KEY="editor.workingSets",Os);Zf=so=D([u(0,F),u(1,ce),u(2,me),u(3,Vp),u(4,se)],Zf);class ca{static _readModifiers(e){e=e.toLowerCase().trim();let t=!1,i=!1,s=!1,o=!1,n;do n=!1,/^ctrl(\+|\-)/.test(e)&&(t=!0,e=e.substr(5),n=!0),/^shift(\+|\-)/.test(e)&&(i=!0,e=e.substr(6),n=!0),/^alt(\+|\-)/.test(e)&&(s=!0,e=e.substr(4),n=!0),/^meta(\+|\-)/.test(e)&&(o=!0,e=e.substr(5),n=!0),/^win(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),n=!0),/^cmd(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),n=!0);while(n);let r;const d=e.indexOf(" ");return d>0?(r=e.substring(0,d),e=e.substring(d)):(r=e,e=""),{remains:e,ctrl:t,shift:i,alt:s,meta:o,key:r}}static parseChord(e){const t=this._readModifiers(e),i=t.key.match(/^\[([^\]]+)\]$/);if(i){const o=i[1],n=Ut.lowerCaseToEnum(o);return[new xs(t.ctrl,t.shift,t.alt,t.meta,n),t.remains]}const s=ot.fromUserSettings(t.key);return[new Vs(t.ctrl,t.shift,t.alt,t.meta,s),t.remains]}static parseKeybinding(e){if(!e)return null;const t=[];let i;for(;e.length>0;)[i,e]=this.parseChord(e),t.push(i);return t.length>0?new mC(t):null}}const _v=[{key:"commandPalette",id:w.CommandPalette,description:c(12182,"The Command Palette"),supportsSubmenus:!1},{key:"touchBar",id:w.TouchBarContext,description:c(12183,"The touch bar (macOS only)"),supportsSubmenus:!1},{key:"editor/title",id:w.EditorTitle,description:c(12184,"The editor title menu")},{key:"editor/title/run",id:w.EditorTitleRun,description:c(12185,"Run submenu inside the editor title menu")},{key:"editor/context",id:w.EditorContext,description:c(12186,"The editor context menu")},{key:"editor/context/copy",id:w.EditorContextCopy,description:c(12187,"'Copy as' submenu in the editor context menu")},{key:"editor/context/share",id:w.EditorContextShare,description:c(12188,"'Share' submenu in the editor context menu"),proposed:"contribShareMenu"},{key:"explorer/context",id:w.ExplorerContext,description:c(12189,"The file explorer context menu")},{key:"explorer/context/share",id:w.ExplorerContextShare,description:c(12190,"'Share' submenu in the file explorer context menu"),proposed:"contribShareMenu"},{key:"editor/title/context",id:w.EditorTitleContext,description:c(12191,"The editor tabs context menu")},{key:"editor/title/context/share",id:w.EditorTitleContextShare,description:c(12192,"'Share' submenu inside the editor title context menu"),proposed:"contribShareMenu"},{key:"debug/callstack/context",id:w.DebugCallStackContext,description:c(12193,"The debug callstack view context menu")},{key:"debug/variables/context",id:w.DebugVariablesContext,description:c(12194,"The debug variables view context menu")},{key:"debug/toolBar",id:w.DebugToolBar,description:c(12195,"The debug toolbar menu")},{key:"debug/createConfiguration",id:w.DebugCreateConfiguration,proposed:"contribDebugCreateConfiguration",description:c(12196,"The debug create configuration menu")},{key:"notebook/variables/context",id:w.NotebookVariablesContext,description:c(12197,"The notebook variables view context menu")},{key:"menuBar/home",id:w.MenubarHomeMenu,description:c(12198,"The home indicator context menu (web only)"),proposed:"contribMenuBarHome",supportsSubmenus:!1},{key:"menuBar/edit/copy",id:w.MenubarCopy,description:c(12199,"'Copy as' submenu in the top level Edit menu")},{key:"scm/title",id:w.SCMTitle,description:c(12200,"The Source Control title menu")},{key:"scm/sourceControl",id:w.SCMSourceControl,description:c(12201,"The Source Control menu")},{key:"scm/sourceControl/title",id:w.SCMSourceControlTitle,description:c(12202,"The Source Control title menu"),proposed:"contribSourceControlTitleMenu"},{key:"scm/resourceState/context",id:w.SCMResourceContext,description:c(12203,"The Source Control resource state context menu")},{key:"scm/resourceFolder/context",id:w.SCMResourceFolderContext,description:c(12204,"The Source Control resource folder context menu")},{key:"scm/resourceGroup/context",id:w.SCMResourceGroupContext,description:c(12205,"The Source Control resource group context menu")},{key:"scm/change/title",id:w.SCMChangeContext,description:c(12206,"The Source Control inline change menu")},{key:"scm/inputBox",id:w.SCMInputBox,description:c(12207,"The Source Control input box menu"),proposed:"contribSourceControlInputBoxMenu"},{key:"scm/history/title",id:w.SCMHistoryTitle,description:c(12208,"The Source Control History title menu"),proposed:"contribSourceControlHistoryTitleMenu"},{key:"scm/historyItem/context",id:w.SCMHistoryItemContext,description:c(12209,"The Source Control history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItem/hover",id:w.SCMHistoryItemHover,description:c(12210,"The Source Control history item hover menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItemRef/context",id:w.SCMHistoryItemRefContext,description:c(12211,"The Source Control history item reference context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"statusBar/remoteIndicator",id:w.StatusBarRemoteIndicatorMenu,description:c(12212,"The remote indicator menu in the status bar"),supportsSubmenus:!1},{key:"terminal/context",id:w.TerminalInstanceContext,description:c(12213,"The terminal context menu")},{key:"terminal/title/context",id:w.TerminalTabContext,description:c(12214,"The terminal tabs context menu")},{key:"view/title",id:w.ViewTitle,description:c(12215,"The contributed view title menu")},{key:"viewContainer/title",id:w.ViewContainerTitle,description:c(12216,"The contributed view container title menu"),proposed:"contribViewContainerTitle"},{key:"view/item/context",id:w.ViewItemContext,description:c(12217,"The contributed view item context menu")},{key:"comments/comment/editorActions",id:w.CommentEditorActions,description:c(12218,"The contributed comment editor actions"),proposed:"contribCommentEditorActionsMenu"},{key:"comments/commentThread/title",id:w.CommentThreadTitle,description:c(12219,"The contributed comment thread title menu")},{key:"comments/commentThread/context",id:w.CommentThreadActions,description:c(12220,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/additionalActions",id:w.CommentThreadAdditionalActions,description:c(12220,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!0,proposed:"contribCommentThreadAdditionalMenu"},{key:"comments/commentThread/title/context",id:w.CommentThreadTitleContext,description:c(12221,"The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."),proposed:"contribCommentPeekContext"},{key:"comments/comment/title",id:w.CommentTitle,description:c(12222,"The contributed comment title menu")},{key:"comments/comment/context",id:w.CommentActions,description:c(12223,"The contributed comment context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/comment/context",id:w.CommentThreadCommentContext,description:c(12224,"The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."),proposed:"contribCommentPeekContext"},{key:"commentsView/commentThread/context",id:w.CommentsViewThreadActions,description:c(12225,"The contributed comment thread context menu in the comments view"),proposed:"contribCommentsViewThreadMenus"},{key:"notebook/toolbar",id:w.NotebookToolbar,description:c(12226,"The contributed notebook toolbar menu")},{key:"notebook/kernelSource",id:w.NotebookKernelSource,description:c(12227,"The contributed notebook kernel sources menu"),proposed:"notebookKernelSource"},{key:"notebook/cell/title",id:w.NotebookCellTitle,description:c(12228,"The contributed notebook cell title menu")},{key:"notebook/cell/execute",id:w.NotebookCellExecute,description:c(12229,"The contributed notebook cell execution menu")},{key:"interactive/toolbar",id:w.InteractiveToolbar,description:c(12230,"The contributed interactive toolbar menu")},{key:"interactive/cell/title",id:w.InteractiveCellTitle,description:c(12231,"The contributed interactive cell title menu")},{key:"issue/reporter",id:w.IssueReporter,description:c(12232,"The contributed issue reporter menu")},{key:"testing/item/context",id:w.TestItem,description:c(12233,"The contributed test item menu")},{key:"testing/item/gutter",id:w.TestItemGutter,description:c(12234,"The menu for a gutter decoration for a test item")},{key:"testing/profiles/context",id:w.TestProfilesContext,description:c(12235,"The menu for configuring testing profiles.")},{key:"testing/item/result",id:w.TestPeekElement,description:c(12236,"The menu for an item in the Test Results view or peek.")},{key:"testing/message/context",id:w.TestMessageContext,description:c(12237,"A prominent button overlaying editor content where the message is displayed")},{key:"testing/message/content",id:w.TestMessageContent,description:c(12238,"Context menu for the message in the results tree")},{key:"extension/context",id:w.ExtensionContext,description:c(12239,"The extension context menu")},{key:"timeline/title",id:w.TimelineTitle,description:c(12240,"The Timeline view title menu")},{key:"timeline/item/context",id:w.TimelineItemContext,description:c(12241,"The Timeline view item context menu")},{key:"ports/item/context",id:w.TunnelContext,description:c(12242,"The Ports view item context menu")},{key:"ports/item/origin/inline",id:w.TunnelOriginInline,description:c(12243,"The Ports view item origin inline menu")},{key:"ports/item/port/inline",id:w.TunnelPortInline,description:c(12244,"The Ports view item port inline menu")},{key:"file/newFile",id:w.NewFile,description:c(12245,"The 'New File...' quick pick, shown on welcome page and File menu."),supportsSubmenus:!1},{key:"webview/context",id:w.WebviewContext,description:c(12246,"The webview context menu")},{key:"file/share",id:w.MenubarShare,description:c(12247,"Share submenu shown in the top level File menu."),proposed:"contribShareMenu"},{key:"editor/inlineCompletions/actions",id:w.InlineCompletionsActions,description:c(12248,"The actions shown when hovering on an inline completion"),supportsSubmenus:!1,proposed:"inlineCompletionsAdditions"},{key:"editor/content",id:w.EditorContent,description:c(12249,"The prominent button in an editor, overlays its content"),proposed:"contribEditorContentMenu"},{key:"editor/lineNumber/context",id:w.EditorLineNumberContext,description:c(12250,"The contributed editor line number context menu")},{key:"mergeEditor/result/title",id:w.MergeInputResultToolbar,description:c(12251,"The result toolbar of the merge editor"),proposed:"contribMergeEditorMenus"},{key:"multiDiffEditor/resource/title",id:w.MultiDiffEditorFileToolbar,description:c(12252,"The resource toolbar in the multi diff editor"),proposed:"contribMultiDiffEditorMenus"},{key:"diffEditor/gutter/hunk",id:w.DiffEditorHunkToolbar,description:c(12253,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"diffEditor/gutter/selection",id:w.DiffEditorSelectionToolbar,description:c(12253,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"searchPanel/aiResults/commands",id:w.SearchActionMenu,description:c(12254,"The commands that will contribute to the menu rendered as buttons next to the AI search title")},{key:"chat/modelPicker",id:w.ChatModelPicker,description:c(12255,"The chat model picker dropdown menu"),supportsSubmenus:!1,proposed:"chatParticipantPrivate"}];var fs;(function(a){function e(g){return typeof g.command=="string"}a.isMenuItem=e;function t(g,m){return typeof g.command!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","command")),!1):g.alt&&typeof g.alt!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","alt")),!1):g.when&&typeof g.when!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","when")),!1):g.group&&typeof g.group!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidMenuItem=t;function i(g,m){return typeof g.submenu!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","submenu")),!1):g.when&&typeof g.when!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","when")),!1):g.group&&typeof g.group!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidSubmenuItem=i;function s(g,m){if(!Array.isArray(g))return m.error(c(12258,"submenu items must be an array")),!1;for(const v of g)if(e(v)){if(!t(v,m))return!1}else if(!i(v,m))return!1;return!0}a.isValidItems=s;function o(g,m){return typeof g!="object"?(m.error(c(12259,"submenu items must be an object")),!1):typeof g.id!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","id")),!1):typeof g.label!="string"?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","label")),!1):!0}a.isValidSubmenu=o;const n={type:"object",required:["command"],properties:{command:{description:c(12260,"Identifier of the command to execute. The command must be declared in the 'commands'-section"),type:"string"},alt:{description:c(12261,"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"),type:"string"},when:{description:c(12262,"Condition which must be true to show this item"),type:"string"},group:{description:c(12263,"Group into which this item belongs"),type:"string"}}},r={type:"object",required:["submenu"],properties:{submenu:{description:c(12264,"Identifier of the submenu to display in this item."),type:"string"},when:{description:c(12262,"Condition which must be true to show this item"),type:"string"},group:{description:c(12263,"Group into which this item belongs"),type:"string"}}},d={type:"object",required:["id","label"],properties:{id:{description:c(12265,"Identifier of the menu to display as a submenu."),type:"string"},label:{description:c(12266,"The label of the menu item which leads to this submenu."),type:"string"},icon:{description:c(12267,"(Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:c(12268,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12269,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.menusContribution={description:c(12270,"Contributes menu items to the editor"),type:"object",properties:zl(_v,g=>g.key,g=>({markdownDescription:g.proposed?c(12271,'Proposed API, requires `enabledApiProposal: ["{0}"]` - {1}',g.proposed,g.description):g.description,type:"array",items:g.supportsSubmenus===!1?n:{oneOf:[n,r]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[n,r]}}},a.submenusContribution={description:c(12272,"Contributes submenu items to the editor"),type:"array",items:d};function l(g,m){return g?co(g.command)?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`","command")),!1):!p(g.title,m,"title")||g.shortTitle&&!p(g.shortTitle,m,"shortTitle")?!1:g.enablement&&typeof g.enablement!="string"?(m.error(c(12257,"property `{0}` can be omitted or must be of type `string`","precondition")),!1):!(g.category&&!p(g.category,m,"category")||!h(g.icon,m)):(m.error(c(12273,"expected non-empty value.")),!1)}a.isValidCommand=l;function h(g,m){return typeof g>"u"||typeof g=="string"||typeof g.dark=="string"&&typeof g.light=="string"?!0:(m.error(c(12274,"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")),!1)}function p(g,m,v){return typeof g>"u"?(m.error(c(12275,"property `{0}` is mandatory and must be of type `string` or `object`",v)),!1):typeof g=="string"&&co(g)?(m.error(c(12256,"property `{0}` is mandatory and must be of type `string`",v)),!1):typeof g!="string"&&(co(g.original)||co(g.value))?(m.error(c(12276,"properties `{0}` and `{1}` are mandatory and must be of type `string`",`${v}.value`,`${v}.original`)),!1):!0}const f={type:"object",required:["command","title"],properties:{command:{description:c(12277,"Identifier of the command to execute"),type:"string"},title:{description:c(12278,"Title by which the command is represented in the UI"),type:"string"},shortTitle:{markdownDescription:c(12279,"(Optional) Short title by which the command is represented in the UI. Menus pick either `title` or `shortTitle` depending on the context in which they show commands."),type:"string"},category:{description:c(12280,"(Optional) Category string by which the command is grouped in the UI"),type:"string"},enablement:{description:c(12281,"(Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api."),type:"string"},icon:{description:c(12282,"(Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:c(12283,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12284,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.commandsContribution={description:c(12285,"Contributes commands to the command palette."),oneOf:[f,{type:"array",items:f}]}})(fs||(fs={}));const Xf=new O,Ev=jo.registerExtensionPoint({extensionPoint:"commands",jsonSchema:fs.commandsContribution,activationEventsGenerator:(a,e)=>{for(const t of a)t.command&&e.push(`onCommand:${t.command}`)}});Ev.setHandler(a=>{function e(t,i){if(!fs.isValidCommand(t,i.collector))return;const{icon:s,enablement:o,category:n,title:r,shortTitle:d,command:l}=t;let h;s&&(typeof s=="string"?h=Ce.fromString(s)??{dark:is(i.description.extensionLocation,s),light:is(i.description.extensionLocation,s)}:h={dark:is(i.description.extensionLocation,s.dark),light:is(i.description.extensionLocation,s.light)});const p=S.getCommand(l);p&&(p.source?i.collector.info(c(12286,"Command `{0}` already registered by {1} ({2})",t.command,p.source.title,p.source.id)):i.collector.info(c(12287,"Command `{0}` already registered",t.command))),Xf.add(S.addCommand({id:l,title:r,source:{id:i.description.identifier.value,title:i.description.displayName??i.description.name},shortTitle:d,tooltip:r,category:n,precondition:I.deserialize(o),icon:h}))}Xf.clear();for(const t of a){const{value:i}=t;if(Array.isArray(i))for(const s of i)e(s,t);else e(i,t)}});const Hr=new Map,Iv=jo.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:fs.submenusContribution});Iv.setHandler(a=>{Hr.clear();for(const e of a){const{value:t,collector:i}=e;for(const[,s]of Object.entries(t)){if(!fs.isValidSubmenu(s,i))continue;if(!s.id){i.warn(c(12288,"`{0}` is not a valid submenu identifier",s.id));continue}if(Hr.has(s.id)){i.info(c(12289,"The `{0}` submenu was already previously registered.",s.id));continue}if(!s.label){i.warn(c(12290,"`{0}` is not a valid submenu label",s.label));continue}let o;s.icon&&(typeof s.icon=="string"?o=Ce.fromString(s.icon)||{dark:is(e.description.extensionLocation,s.icon)}:o={dark:is(e.description.extensionLocation,s.icon.dark),light:is(e.description.extensionLocation,s.icon.light)});const n={id:w.for(`api:${s.id}`),label:s.label,icon:o};Hr.set(s.id,n)}}});const zT=new Map(_v.map(a=>[a.key,a])),Qf=new O,Rl=new Map,$T=jo.registerExtensionPoint({extensionPoint:"menus",jsonSchema:fs.menusContribution,deps:[Iv]});$T.setHandler(a=>{Qf.clear(),Rl.clear();for(const e of a){const{value:t,collector:i}=e;for(const s of Object.entries(t)){if(!fs.isValidItems(s[1],i))continue;let o=zT.get(s[0]);if(!o){const n=Hr.get(s[0]);n&&(o={key:s[0],id:n.id,description:""})}if(o){if(o.proposed&&!$l(e.description,o.proposed)){i.error(c(12291,`{0} is a proposed menu identifier. It requires 'package.json#enabledApiProposals: ["{1}"]' and is only available when running out of dev or with the following command line switch: --enable-proposed-api {2}`,s[0],o.proposed,e.description.identifier.value));continue}for(const n of s[1]){let r;if(fs.isMenuItem(n)){const d=S.getCommand(n.command),l=n.alt&&S.getCommand(n.alt)||void 0;if(!d){i.error(c(12292,"Menu item references a command `{0}` which is not defined in the 'commands' section.",n.command));continue}n.alt&&!l&&i.warn(c(12293,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",n.alt)),n.command===n.alt&&i.info(c(12294,"Menu item references the same command as default and alt-command")),r={command:d,alt:l,group:void 0,order:void 0,when:void 0}}else{if(o.supportsSubmenus===!1){i.error(c(12295,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const d=Hr.get(n.submenu);if(!d){i.error(c(12296,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",n.submenu));continue}let l=Rl.get(o.id.id);if(l||(l=new Set,Rl.set(o.id.id,l)),l.has(d.id.id)){i.warn(c(12297,"The `{0}` submenu was already contributed to the `{1}` menu.",n.submenu,s[0]));continue}l.add(d.id.id),r={submenu:d.id,icon:d.icon,title:d.label,group:void 0,order:void 0,when:void 0}}if(n.group){const d=n.group.lastIndexOf("@");d>0?(r.group=n.group.substr(0,d),r.order=Number(n.group.substr(d+1))||void 0):r.group=n.group}if(o.id===w.ViewContainerTitle&&!n.when?.includes("viewContainer == workbench.view.debug")){i.error(c(12298,"The {0} menu contribution must check {1} in its {2} clause.","`viewContainer/title`","`viewContainer == workbench.view.debug`",'"when"'));continue}r.when=I.deserialize(n.when),Qf.add(S.appendMenuItem(o.id,r))}}}}});let xh=class extends R{constructor(e){super(),this._keybindingService=e,this.type="table"}shouldRender(e){return!!e.contributes?.commands}render(e){const i=(e.contributes?.commands||[]).map(h=>({id:h.command,title:h.title,keybindings:[],menus:[]})),s=zl(i,h=>h.id),o=e.contributes?.menus||{},n=zl(i,h=>h.id);if(o.commandPalette)for(const h of o.commandPalette)delete n[h.command];if(Object.keys(n).length){o.commandPalette||(o.commandPalette=[]);for(const h in n)o.commandPalette.push({command:h})}for(const h in o)for(const p of o[h])if(p.when!=="false"&&p.command){let f=s[p.command];f?f.menus.includes(h)||f.menus.push(h):(f={id:p.command,title:"",keybindings:[],menus:[h]},s[f.id]=f,i.push(f))}if((e.contributes?.keybindings?Array.isArray(e.contributes.keybindings)?e.contributes.keybindings:[e.contributes.keybindings]:[]).forEach(h=>{const p=this.resolveKeybinding(h);if(!p)return;let f=s[h.command];f?f.keybindings.push(p):(f={id:h.command,title:"",keybindings:[p],menus:[]},s[f.id]=f,i.push(f))}),!i.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const d=[c(12299,"ID"),c(12300,"Title"),c(12301,"Keyboard Shortcuts"),c(12302,"Menu Contexts")],l=i.sort((h,p)=>h.id.localeCompare(p.id)).map(h=>[new wi().appendMarkdown(`\`${h.id}\``),typeof h.title=="string"?h.title:h.title.value,h.keybindings,new wi().appendMarkdown(`${h.menus.sort((p,f)=>p.localeCompare(f)).map(p=>`\`${p}\``).join("&nbsp;")}`)]);return{data:{headers:d,rows:l},dispose:()=>{}}}resolveKeybinding(e){let t;switch(wC){case"win32":t=e.win;break;case"linux":t=e.linux;break;case"darwin":t=e.mac;break}return this._keybindingService.resolveUserBinding(t??e.key)[0]}};xh=D([u(0,it)],xh);z.as(Dc.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:c(12303,"Commands"),access:{canToggle:!1},renderer:new ee(xh)});class Dv{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${qT(i+",",25)} "command": `);const s=t.when?JSON.stringify(t.when.serialize()):"",o=JSON.stringify(t.command);s.length>0?(e.write(`${o},`),e.writeLine(),e.write(` "when": ${s}`)):e.write(`${o}`),t.commandArgs&&(e.write(","),e.writeLine(),e.write(` "args": ${JSON.stringify(t.commandArgs)}`)),e.write(" }")}static readUserKeybindingItem(e){const t="key"in e&&typeof e.key=="string"?ca.parseKeybinding(e.key):null,i="when"in e&&typeof e.when=="string"?I.deserialize(e.when):void 0,s="command"in e&&typeof e.command=="string"?e.command:null,o="args"in e&&typeof e.args<"u"?e.args:void 0;return{keybinding:t,command:s,commandArgs:o,when:i,_sourceKey:"key"in e&&typeof e.key=="string"?e.key:void 0}}}function qT(a,e){return a.length<e?a+new Array(e-a.length).join(" "):a}class jT{constructor(){this._lines=[],this._currentLine=""}write(e){this._currentLine+=e}writeLine(e=""){this._lines.push(this._currentLine+e),this._currentLine=""}toString(){return this.writeLine(),this._lines.join(`
3
3
  `)}}var kr;function YT(a,e){return a?typeof a.command!="string"?(e.push(c(12693,"property `{0}` is mandatory and must be of type `string`","command")),!1):a.key&&typeof a.key!="string"?(e.push(c(12694,"property `{0}` can be omitted or must be of type `string`","key")),!1):a.when&&typeof a.when!="string"?(e.push(c(12694,"property `{0}` can be omitted or must be of type `string`","when")),!1):a.mac&&typeof a.mac!="string"?(e.push(c(12694,"property `{0}` can be omitted or must be of type `string`","mac")),!1):a.linux&&typeof a.linux!="string"?(e.push(c(12694,"property `{0}` can be omitted or must be of type `string`","linux")),!1):a.win&&typeof a.win!="string"?(e.push(c(12694,"property `{0}` can be omitted or must be of type `string`","win")),!1):!0:(e.push(c(12692,"expected non-empty value.")),!1)}const em={type:"object",default:{command:"",key:""},properties:{command:{description:c(12695,"Identifier of the command to run when keybinding is triggered."),type:"string"},args:{description:c(12696,"Arguments to pass to the command to execute.")},key:{description:c(12697,"Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord)."),type:"string"},mac:{description:c(12698,"Mac specific key or key sequence."),type:"string"},linux:{description:c(12699,"Linux specific key or key sequence."),type:"string"},win:{description:c(12700,"Windows specific key or key sequence."),type:"string"},when:{description:c(12701,"Condition when the key is active."),type:"string"}}},tm=jo.registerExtensionPoint({extensionPoint:"keybindings",deps:[Ev],jsonSchema:{description:c(12702,"Contributes keybindings."),oneOf:[em,{type:"array",items:em}]}}),JT=[A.NumpadDivide,A.NumpadMultiply,A.NumpadSubtract,A.NumpadAdd,A.Numpad1,A.Numpad2,A.Numpad3,A.Numpad4,A.Numpad5,A.Numpad6,A.Numpad7,A.Numpad8,A.Numpad9,A.Numpad0,A.NumpadDecimal],Di=new Map;Di.set(A.Numpad1,y.Digit1);Di.set(A.Numpad2,y.Digit2);Di.set(A.Numpad3,y.Digit3);Di.set(A.Numpad4,y.Digit4);Di.set(A.Numpad5,y.Digit5);Di.set(A.Numpad6,y.Digit6);Di.set(A.Numpad7,y.Digit7);Di.set(A.Numpad8,y.Digit8);Di.set(A.Numpad9,y.Digit9);Di.set(A.Numpad0,y.Digit0);let kh=kr=class extends yC{constructor(e,t,i,s,o,n,r,d,l,h,p,f){super(e,t,i,s,h),this.hostService=n,this.keyboardLayoutService=p,this.layoutService=f,this._contributions=[],this.isComposingGlobalContextKey=e.createKey("isComposing",!1),this.kbsJsonSchema=new Rh,this.updateKeybindingsJsonSchema(),this._keyboardMapper=this.keyboardLayoutService.getKeyboardMapper(),this._register(this.keyboardLayoutService.onDidChangeKeyboardLayout(()=>{this._keyboardMapper=this.keyboardLayoutService.getKeyboardMapper(),this.updateResolver()})),this._keybindingHoldMode=null,this._cachedResolver=null,this.userKeybindings=this._register(new ZT(o,l,d,h)),this.userKeybindings.initialize().then(()=>{this.userKeybindings.keybindings.length&&this.updateResolver()}),this._register(this.userKeybindings.onDidChange(()=>{h.debug("User keybindings changed"),this.updateResolver()})),tm.setHandler(g=>{const m=[];for(const v of g)this._handleKeybindingsExtensionPointUser(v.description.identifier,v.description.isBuiltin,v.value,v.collector,m);ne.setExtensionKeybindings(m),this.updateResolver()}),this.updateKeybindingsJsonSchema(),this._register(r.onDidRegisterExtensions(()=>this.updateKeybindingsJsonSchema())),this._register(L.runAndSubscribe(tw,({window:g,disposables:m})=>m.add(this._registerKeyListeners(g)),{window:re,disposables:this._store})),this._register(Qm(g=>{if(g!==re.vscodeWindowId)return;const m=navigator.keyboard;ul.keyboard!==pl.None&&(Rg(re)?m?.lock(["Escape"]):m?.unlock(),this._cachedResolver=null,this._onDidUpdateKeybindings.fire())}))}_registerKeyListeners(e){const t=new O,i=this.layoutService.getContainer(e);return t.add(J(i,te.KEY_DOWN,s=>{if(this._keybindingHoldMode)return;this.isComposingGlobalContextKey.set(s.isComposing);const o=new Yn(s);this._log(`/ Received keydown event - ${vC(s)}`),this._log(`| Converted keydown event - ${bC(o)}`),this._dispatch(o,o.target)&&o.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t.add(J(i,te.KEY_UP,s=>{this._resetKeybindingHoldMode(),this.isComposingGlobalContextKey.set(s.isComposing);const o=new Yn(s);this._singleModifierDispatch(o,o.target)&&o.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t}registerSchemaContribution(e){this._contributions.push(e),e.onDidChange&&this._register(e.onDidChange(()=>this.updateKeybindingsJsonSchema())),this.updateKeybindingsJsonSchema()}updateKeybindingsJsonSchema(){this.kbsJsonSchema.updateSchema(this._contributions.flatMap(e=>e.getSchemaAdditions()))}_printKeybinding(e){return CC.toLabel($t,e.chords,t=>t instanceof Vs?ot.toString(t.keyCode):Ut.toString(t.scanCode))||"[null]"}_printResolvedKeybinding(e){return e.getDispatchChords().map(t=>t||"[null]").join(" ")}_printResolvedKeybindings(e,t,i){const o=`${t.padStart(35," ")} => `;if(i.length===0){e.push(`${o}${"[NO BINDING]".padStart(35," ")}`);return}for(const n of i)e.push(`${o}${this._printResolvedKeybinding(n).padStart(35," ")}`)}_dumpResolveKeybindingDebugInfo(){const e=new Set,t=[];t.push("Default Resolved Keybindings (unique only):");for(const i of ne.getDefaultKeybindings()){if(!i.keybinding)continue;const s=this._printKeybinding(i.keybinding);if(e.has(s))continue;e.add(s);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,s,o)}t.push("User Resolved Keybindings (unique only):");for(const i of this.userKeybindings.keybindings){if(!i.keybinding)continue;const s=i._sourceKey??"Impossible: missing source key, but has keybinding";if(e.has(s))continue;e.add(s);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,s,o)}return t.join(`
4
4
  `)}_dumpDebugInfo(){const e=JSON.stringify(this.keyboardLayoutService.getCurrentKeyboardLayout(),null," "),t=this._keyboardMapper.dumpDebugInfo(),i=this._dumpResolveKeybindingDebugInfo(),s=JSON.stringify(this.keyboardLayoutService.getRawKeyboardMapping(),null," ");return`Layout info:
5
5
  ${e}