@xano/xanoscript-monaco-editor 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +49 -49
- package/dist/assets/{editor-Q-H44Xk5.js → editor-CTk4XCQG.js} +1 -1
- package/dist/assets/{fileCommands._save-_f7KuzoK.js → fileCommands._save-BslznhnO.js} +3 -3
- package/dist/assets/{iconv-lite-umd-D8Xc-NRZ.js → iconv-lite-umd-vDmZu3o7.js} +1 -1
- package/dist/assets/{index-kz8GV9yO.js → index-B9LREvGB.js} +1 -1
- package/dist/assets/{index-BQHo-Z-Y.js → index-BMTVGxzX.js} +2 -2
- package/dist/assets/{index-fzRRQ7Qh.js → index-Be1WCD4s.js} +1 -1
- package/dist/assets/{index-DcZHpPDm.js → index-BfLChBOe.js} +1 -1
- package/dist/assets/{index-CQIJkuYI.js → index-BpdMCZU7.js} +1 -1
- package/dist/assets/{index-GR_3sv6M.js → index-Ca2GOtQx.js} +2 -2
- package/dist/assets/{index-CLAWxbMR.js → index-CzmSOBI6.js} +1 -1
- package/dist/assets/{index-CHwATtBn.js → index-DqIUrgd9.js} +3 -3
- package/dist/assets/{index-D9lSNsHR.js → index-GPQU4rv1.js} +3 -3
- package/dist/assets/{main-BtCp5aH0.js → main-CuAxLb8K.js} +1 -1
- package/dist/assets/{main-BnV5RNdt.js → main-kYU-Ynn2.js} +1 -1
- package/dist/assets/{tokenClassificationRegistry-BP6RVP9u.js → tokenClassificationRegistry-BA6yuF5K.js} +2 -2
- package/dist/assets/{views-Hn-QKMUh.js → views-Dck1c7fK.js} +2 -2
- package/dist/assets/workbenchThemeService.service-DlXrxy4t.js +1 -0
- package/dist/index.html +1 -1
- package/dist/logic-assistant-script.js +60 -62
- package/dist/worker.js +92 -94
- package/package.json +3 -2
- package/dist/assets/workbenchThemeService.service-CDwCNsAv.js +0 -1
|
@@ -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{gx as U_,gy as H_,gz as z_,e$ as $_,gA as tw,d5 as go,f as _,g as u,m as rt,by as pe,W as K,c1 as me,dl as bt,bx as Qt,ci as fi,aI as ie,gB as q_,ej as Wy,E as A,fg as ke,aK as te,fj as j_,gC as Y_,gD as X_,dy as ge,gE as J_,gt as fr,gF as iw,d as F,aL as Ze,a8 as M,fO as Ra,c0 as $a,q as c,fI as hl,fN as mr,a9 as ye,f3 as Ky,fw as Ar,dd as bc,f0 as du,d6 as Uy,d7 as Hy,fv as ul,dx as Ne,d8 as qe,Z as Te,cR as W,cp as ae,ck as H,bZ as b,dr as fo,gG as pl,db as be,gH as Z_,da as z,fE as Vo,ds as Ue,dc as ee,di as qd,dj as Ni,eZ as zy,e_ as Q_,fl as $y,gI as eI,dW as tn,gJ as Tp,f2 as gl,gK as sw,j as Qe,bB as st,dn as ot,dp as ei,cg as _t,dD as re,fJ as Ks,gL as fl,gb as zi,gM as tI,gN as iI,gO as qy,gP as Ds,dV as vi,e3 as dt,gQ as ra,cl as di,gR as jy,fs as La,gS as Yy,gT as Xy,gU as Jy,gV as Zy,gW as Qy,gX as eC,gY as tC,gZ as iC,g_ as sC,g$ as oC,h0 as ml,d4 as lo,h1 as Lb,h2 as Vb,d0 as Xe,h as se,ez as de,h3 as ho,D as N,N as Ii,h4 as ct,h5 as Ei,cG as jd,t as he,h6 as sI,bd as An,A as wr,a7 as cs,fX as ls,h7 as oI,h8 as ki,h9 as ks,ha as yd,bY as Ae,cM as wl,hb as nC,bt as bl,hc as nI,hd as rI,fu as ow,cH as rC,dM as Va,dt as Po,a5 as Bt,he as aI,hf as nw,de as rw,df as Pa,eq as dI,bA as Ve,bK as Ji,hg as vl,hh as yl,hi as At,hj as cI,cy as $t,dI as sn,hk as vc,dJ as lI,fq as Oa,hl as hI,O as it,dO as Nt,hm as Ct,eN as uI,cr as xi,cY as D,G as Wi,cu as Oo,bV as fe,hn as pI,ho as kp,hp as li,hq as xp,ev as Ke,hr as Ce,au as Wc,hs as mo,a3 as we,ht as aw,u as dw,hu as gI,hv as Pb,du as aC,hw as fI,bi as De,bf as _o,bg as Pe,hx as mI,a0 as ue,bs as Je,hy as Yt,aV as cu,a4 as wo,hz as wI,z as on,hA as bI,hB as yc,hC as cw,hD as qa,hE as dC,hF as Os,hG as br,hH as cC,dz as lC,hI as vI,hJ as vr,U as $,hK as Rp,hL as yI,hM as CI,hN as Et,hO as hC,hP as SI,bX as O,hQ as ps,dP as oe,hR as uC,bE as Se,hS as Ge,hT as xe,hU as pC,eQ as EI,hV as Lp,hW as gC,bF as P,hX as Vp,hY as _I,hZ as Yd,h_ as Cl,h$ as II,i0 as Vs,i1 as mt,i2 as lw,i3 as Tr,bI as ut,i4 as fs,i5 as Us,bL as E,bM as V,bP as R,ak as y,bO as x,bQ as S,$ as m,cS as J,eX as nn,cd as U,i6 as Le,cW as ne,i7 as un,i as Hs,i8 as _e,co as Oe,i9 as DI,ia as AI,ib as TI,ic as Ob,id as kI,ie as xI,ig as Mb,J as lu,ih as hw,ii as Wt,ij as Ju,ik as RI,il as Mo,im as LI,io as fC,ip as Nb,iq as VI,ir as uw,is as yr,it as Lt,S as PI,iu as mC,iv as hu,iw as wC,er as qt,ix as to,iy as bC,iz as St,iA as Fb,bR as ja,iB as Pp,b_ as I,iC as Ai,iD as pw,iE as rn,iF as Ye,iG as uu,iH as Y,iI as pu,dm as Ft,iJ as Ya,iK as gw,iL as Cd,iM as Zu,bN as Ie,iN as fw,iO as mi,iP as mw,iQ as aa,iR as zs,iS as Op,aR as Fi,iT as Ms,iU as Ns,iV as vC,iW as xn,iX as hi,iY as jt,ar as Ma,iZ as OI,c_ as ww,dw as Cc,i_ as yC,i$ as bw,j0 as CC,j1 as gu,j2 as Xa,j3 as Gt,eU as Mp,j4 as da,j5 as SC,j6 as Cr,eh as an,j7 as EC,j8 as $r,j9 as ts,bc as Ki,cO as He,ja as gt,jb as Me,jc as _C,jd as IC,cz as ci,Q as Sc,je as Ja,jf as fu,jg as Sl,eM as vw,e6 as pi,e7 as Ec,cB as Ci,jh as Gi,P as Xs,ji as Oi,jj as No,jk as _c,jl as yw,jm as DC,jn as Rt,jo as AC,dS as MI,jp as TC,jq as NI,bp as Za,jr as FI,js as mu,d2 as pn,jt as kC,ju as xC,jv as RC,dh as dn,dL as Bb,jw as Na,jx as Qu,jy as BI,jz as GI,bU as LC,jA as Np,jB as WI,jC as KI,jD as UI,jE as HI,jF as zI,jG as $I,jH as qI,jI,jJ as YI,jK as XI,jL as JI,gd as Cw,jM as El,jN as xs,jO as VC,jP as PC,jQ as Sw,jR as Ew,jS as ZI,jT as QI,jU as eD,jV as tD,jW as iD,jX as sD,eV as _w,fA as OC,at as Iw,jY as MC,jZ as oD,j_ as nD,j$ as rD,k0 as aD,k1 as dD,aa as Sr,k2 as cD,k3 as lD,k4 as NC,k5 as FC,k6 as Gb,k7 as hD,k8 as Ic,k9 as BC,ka as Dc,kb as uD,kc as pD,kd as gD,ke as fD,kf as mD,kg as at,kh as Wb,ki as _l,kj as wD,kk as bD,g0 as wu,kl as GC,km as vD,cq as bu,kn as _n,ko as yD,kp as CD,kq as SD,kr as ED,ks as WC,kt as kr,ku as _D,kv as ID,kw as Fp,kx as DD,ky as AD,kz as TD,kA as kD,cv as xD,bv as ve,kB as Bp,kC as Kb,kD as RD,kE as Go,kF as LD,kG as VD,kH as PD,kI as gn,kJ as OD,ea as Ub,e5 as KC,fi as MD,kK as ND,dG as Fs,kL as FD,f7 as UC,dY as Dw,ao as Qa,dZ as BD,fc as GD,eg as Il,kM as ed,kN as WD,kO as KD,kP as UD,kQ as ep,kR as Dl,kS as HD,kT as zD,kU as Hb,kV as $D,cf as fn,kW as qD,kX as jD,kY as YD,cx as Kc,kZ as XD,k_ as JD,k$ as ZD,f5 as QD,f6 as eA,l0 as mn,l1 as Si,l2 as Fo,l3 as Pt,l4 as Wo,l5 as tA,p as xr,l6 as Gp,x as io,gg as Wp,bb as vu,al as le,l7 as Tn,l8 as iA,l9 as sA,la as HC,lb as tp,lc as ip,ec as zb,ld as oA,le as nA,lf as rA,lg as aA,lh as Uc,li as hs,lj as L,lk as dA,ll as Bi,aW as cA,lm as Rn,aS as zC,ln as lA,lo as Aw,lp as Ac,lq as $C,lr as $b,ai as k,ls as hA,lt as qC,lu as uA,lv as qb,aU as pA,lw as jb,_ as sp,ch as Tw,lx as Yb,ly as gA,lz as fA,cj as kw,lA as mA,dT as Kp,dg as Up,lB as Cs,lC as Qc,R as We,lD as wA,V as $i,f1 as bA,lE as yu,be as kt,lF as ca,lG as vA,lH as jC,lI as yA,lJ as CA,lK as SA,lL as EA,lM as Cu,dE as _A,lN as IA,lO as DA,ae as Su,af as Eu,lP as YC,lQ as AA,lR as td,lS as xw,lT as Al,lU as TA,lV as kA,lW as Xb,am as xA,lX as RA,eC as Rw,lY as Lw,lZ as Vw,l_ as Pw,l$ as Kt,m0 as XC,m1 as LA,m2 as js,m3 as Ow,m4 as cd,cA as Tc,m5 as VA,m6 as Jb,m7 as Ut,m8 as Zb,m9 as si,ma as JC,mb as op,mc as el,md as Qb,cC as et,me as Mi,mf as PA,mg as OA,mh as MA,mi as NA,mj as Bs,mk as FA,ml as oi,mm as BA,mn as GA,mo as WA,mp as KA,mq as UA,mr as Hp,ms as Sd,mt as HA,ct as zp,mu as ev,ap as kc,mv as tv,mw as zA,mx as $A,my as Mw,s as qA,mz as ZC,mA as QC,mB as eS,mC as ni,mD as tl,mE as jA,bn as YA,mF as XA,aM as qr,mG as JA,mH as ZA,mI as QA,mJ as Ed,mK as tS,mL as iv,mM as _d,mN as sv,mO as eT,mP as tT,bT as Nw,mQ as iT,mR as np,mS as sT,mT as oT,gq as nT,mU as rT,mV as ov,mW as pd,mX as aT,mY as dT,mZ as nv,m_ as Fw,b$ as cT,m$ as ss,n0 as lT,n1 as iS,F as Id,n2 as hT,n3 as uT,n4 as pT,n5 as gT,n6 as fT,n7 as mT,n8 as wT,n9 as Ri,na as bT,nb as vT,nc as sS,nd as oS,c as qi,ne as Rr,nf as gs,ng as nS,nh as yT,ni as rv,nj as CT,nk as ST,nl as ET,nm as _T,nn as IT,no as DT,np as AT,cJ as Br,cK as av,cL as TT,nq as rS,nr as dv,dF as xt,ns as kT,cN as Tl,nt as xT,nu as cv,nv as RT,gr as _u,nw as lv,nx as hv,ny as uv,nz as LT,nA as VT,dU as aS,nB as pv,nC as dS,gw as PT,nD as Dd,dQ as cS,bz as OT,em as kl,nE as MT,nF as gv,nG as fv,ey as NT,cn as is,nH as FT,nI as BT,nJ as $p,nK as mv,bw as GT,nL as lS,nM as wv,nN as WT,nO as KT,nP as UT,nQ as HT,ep as zT,nR as rp,nS as $T,nT as qT,nU as jT,nV as YT,nW as il,nX as XT,nY as hS,nZ as Iu,n_ as Lr,n$ as Bw,o0 as bv,o1 as JT,o2 as bo,o3 as Du,o4 as qp,o5 as ZT,o6 as Vr,o7 as QT,o8 as uS,eA as ek,o9 as ri,oa as tk,ob as ik,oc as Ui,od as xl,oe as sk,of as pS,og as ok,oh as nk,oi as rk,b3 as so,oj as vv,ok as Rl,ol as Au,om as ak,on as Tu,oo as ku,op as dk,oq as ck,or as gS,X as Ht,Y as zt,os as fS,ot as mS,ou as wS,ov as Ot,ow as bS,ox as vS,oy as yS,oz as CS,oA as SS,oB as ES,oC as _S,oD as IS,oE as DS,oF as AS,oG as xu,oH as TS,oI as ap,oJ as Pr,oK as $s,oL as Ll,oM as kS,oN as Mt,oO as dp,oP as Gw,oQ as ms,oR as ws,oS as ti,oT as lk,oU as hk,oV as Ww,oW as xc,oX as Rc,oY as Lc,oZ as xS,o_ as uk,o$ as pk,p0 as gk,p1 as RS,p2 as fk,p3 as Ru,p4 as cp,p5 as lp,p6 as LS,p7 as mk,p8 as wk,p9 as bk,pa as vk,bS as VS,pb as yk,fY as Ck,pc as PS,pd as Sk,pe as jp,pf as yv,pg as Rs,ph as Cv,pi as Lu,pj as Ek,pk as OS,pl as MS,fQ as Sv,gn as _k,pm as Ik,pn as Dk,po as Ev,pp as Ak,pq as Tk,pr as vt,ps as nt,pt as uo,pu as kn,pv as kk,pw as Xt,px as Ln,py as xk,pz as Vl,pA as Kw,pB as Jt,pC as Hc,pD as Rk,pE as Lk,pF as hp,pG as Er,pH as NS,d1 as Yp,pI as la,pJ as Vk,pK as Pk,pL as Ok,pM as Mk,pN as Nk,pO as jr,pP as Uw,pQ as up,pR as _v,pS as Js,pT as zc,pU as Ys,pV as Xp,pW as Iv,pX as Ad,pY as FS,pZ as BS,p_ as Fk,p$ as Bk,q0 as GS,q1 as Gk,q2 as Dv,gj as WS,q3 as Td,q4 as Av,q5 as KS,q6 as Wk,q7 as Kk,q8 as US,q9 as Uk,qa as Hk,bG as zk,qb as $k,qc as ds,qd as Tv,qe as qk,qf as kv,qg as pp,qh as jk,qi as Yk,qj as Xk,qk as Jk,ql as Zk,qm as Qk,qn as ex,qo as HS,qp as tx,qq as zS,qr as Zs,qs as ix,qt as xv,qu as yn,qv as Rv,qw as sx,qx as Lv,qy as Vv,qz as Jp,qA as $S,qB as Vu,qC as Vc,qD as gd,qE as ox,qF as nx,qG as rx,qH as Pv,qI as ax,qJ as dx,qK as qS,qL as jS,qM as cx,qN as lx,qO as hx,qP as ux,qQ as px,qR as gx,qS as fx,qT as mx,qU as wx,qV as bx,qW as Pc,qX as Pu,qY as vx,qZ as yx,q_ as Cx,q$ as Fa,r0 as Hw,r1 as Sx,r2 as Ex,r3 as YS,r4 as Xd,r5 as gp,r6 as ld,gh as _x,r7 as Ov,r8 as Ix,r9 as Dx,fR as Ax,gp as Mv,ra as Nv,rb as XS,rc as Tx,rd as kx,re as xx,M as kd,rf as Fv,rg as Rx,rh as tt,ri as Ou,rj as Lx,o as sl,rk as Vx,rl as JS,rm as Px,rn as ui,ro as zw,rp as $w,rq as qw,rr as Ox,rs as oo,rt as $c,ru as Mx,rv as Bv,rw as Nx,rx as Cn,ry as Gv,rz as Fx,rA as Zp,rB as fp,rC as Wv,rD as qc,rE as Bx,rF as Gx,rG as Kv,rH as ZS,rI as QS,rJ as jc,rK as Wx,rL as Kx,rM as Ux,rN as Hx,rO as zx,rP as $x,rQ as qx,rR as eE,rS as tE,rT as iE,rU as Pl,rV as jx,rW as Uv,rX as Yx,rY as Yr,rZ as mp,r_ as Xx,r$ as Ol,s0 as Jx,s1 as Fe,s2 as id,s3 as Mu,s4 as jw,s5 as Zx,s6 as Qx,s7 as sE,s8 as eR,s9 as Hv,sa as Ko,sb as tR,sc as iR,sd as Yc,se as xd,sf as sR,sg as oE,sh as oR,eE as zv,si as nR,eG as rR,eH as aR,sj as dR,eW as cR,sk as Qp,sl as eg,sm as tg,sn as lR,so as hR,sp as uR,sq as pR,sr as gR,ss as fR,st as Yw,su as mR,sv as $v,sw as wR,sx as qv,sy as nE,sz as rE,sA as bR,sB as vR,sC as yR,sD as CR,sE as SR,fz as ER,sF as _R,sG as aE,sH as IR,sI as DR,sJ as AR,sK as TR,sL as kR,sM as xR,sN as RR,sO as Xc,fK as LR}from"./index-D9lSNsHR.js";import{A as VR,r as wt,S as po,f as dE,U as Gs,B as cE,F as Ba,T as PR}from"./fileCommands._save-_f7KuzoK.js";import{I as OR}from"./workbenchThemeService.service-CDwCNsAv.js";const MR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),NR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));let ig=class extends H_{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(z_),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 $_&&s.item.submenu===tw);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 go,...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()}};ig=_([u(1,rt),u(2,pe),u(3,K),u(4,me),u(5,bt),u(6,Qt),u(7,fi)],ig);class Xw extends U_{static create(e,t,i,s,o,n,r){return new Xw(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 Ps={Viewlets:"workbench.contributions.viewlets",Panels:"workbench.contributions.panels",Auxiliary:"workbench.contributions.auxiliary"};class Jw extends q_{registerPaneComposite(e){super.registerComposite(e)}deregisterPaneComposite(e){super.deregisterComposite(e)}getPaneComposite(e){return this.getComposite(e)}getPaneComposites(){return this.getComposites()}}ie.add(Ps.Viewlets,new Jw);ie.add(Ps.Panels,new Jw);ie.add(Ps.Auxiliary,new Jw);const FR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(FR);class BR extends Wy{constructor(e,t,i,s,o,n,r,d,l,h,p,g,f,w,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=g,this.compositeCSSClass=f,this.titleForegroundColor=w,this.titleBorderColor=v,this.onDidCompositeOpen=this._register(new A),this.onDidCompositeClose=this._register(new A),this.mapCompositeToCompositeContainer=new Map,this.mapActionsBindingToComposite=new Map,this.instantiatedCompositeItems=new Map,this.actionsListener=this._register(new ke),this.lastActiveCompositeId=t.get(h,te.WORKSPACE,this.defaultCompositeId),this.toolbarHoverDelegate=this._register(j_())}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=Y_.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 X_(ge(this.progressBar),new class extends J_{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 fr([iw,n]))),d=s.instantiate(r),l=new F;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,te.WORKSPACE,Ze.MACHINE):this.storageService.remove(this.activeCompositeSettingsKey,te.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),Ra(i);const o=ge(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&&!$a(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),ge(this.toolBar).setAriaLabel(c(2953,"{0} actions",t))}collectCompositeActions(e){const t=e?.getMenuIds(),i=e?.getActions().slice(0)||[],s=e?.getSecondaryActions().slice(0)||[],o=ge(this.toolBar);return o.context=this.actionsContextProvider(),()=>o.setActions(hl(i),hl(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(),mr(t)),this.progressBar?.stop().hide(),this.toolBar&&this.collectCompositeActions()(),this.onDidCompositeClose.fire(e),e}createTitleArea(e){const t=ye(e,M(".composite"));t.classList.add("title"),this.titleLabel=this.createTitleLabel(t);const i=ye(t,M(".title-actions"));return this.toolBar=this._register(this.instantiationService.createInstance(Ky,i,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Ar.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(2954,"Views and More Actions..."),telemetrySource:this.nameForTelemetry,hoverDelegate:this.toolbarHoverDelegate})),this.collectCompositeActions()(),t}createTitleLabel(e){const t=ye(e,M(".title-label")),i=ye(t,M("h2"));this.titleLabelElement=i;const s=this._register(this.hoverService.setupManagedHover(bc("mouse"),i,"")),o=this;return{updateTitle:(n,r,d)=>{(!this.activeComposite||this.activeComposite.getId()===n)&&(i.innerText=r,s.update(d?c(2955,"{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(),ge(this.titleLabel).updateStyles()}actionViewItemProvider(e,t){return this.activeComposite?this.activeComposite.getActionViewItem(e,t):du(this.instantiationService,e,t)}actionsContextProvider(){return this.activeComposite?this.activeComposite.getActionsContext():null}createContentArea(e){const t=ye(e,M(".content"));return this.progressBar=this._register(new Uy(t,Hy)),this.progressBar.hide(),t}getProgressIndicator(e){const t=this.instantiatedCompositeItems.get(e);return t?t.progress:void 0}getTitleAreaDropDownAnchorAlignment(){return ul.RIGHT}layout(e,t,i,s){super.layout(e,t,i,s),this.contentAreaSize=Ne.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(),qe(t.disposable),this.instantiatedCompositeItems.delete(e)),!0}dispose(){this.mapCompositeToCompositeContainer.clear(),this.mapActionsBindingToComposite.clear(),this.instantiatedCompositeItems.forEach(e=>{e.composite.dispose(),qe(e.disposable)}),this.instantiatedCompositeItems.clear(),super.dispose()}}var sg;Te(NR);var Re;(function(a){a[a.TOP=0]="TOP",a[a.TITLE=1]="TITLE",a[a.BOTTOM=2]="BOTTOM"})(Re||(Re={}));var Nn;let Jd=(Nn=class extends BR{get snap(){return this.layoutService.isVisible(this.partId)||!!this.paneCompositeBar.value?.getVisiblePaneCompositeIds().length}get onDidPaneCompositeOpen(){return W.map(this.onDidCompositeOpen.event,e=>e.composite)}constructor(e,t,i,s,o,n,r,d,l,h,p,g,f,w,v,C,T,G,B,X,Z){let j=ae.Sidebar,Q=Ps.Viewlets,q=b.SidebarTitle;e===H.PANEL_PART?(j=ae.Panel,Q=Ps.Panels,q=b.PanelTitle):e===H.AUXILIARYBAR_PART&&(j=ae.AuxiliaryBar,Q=Ps.Auxiliary,q=b.AuxiliaryBarTitle),super(h,p,g,f,w,v,C,T,ie.as(Q),i,G.getDefaultViewContainer(j)?.id||"",n,r,d,l,e,t),this.partId=e,this.activePaneContextKey=s,this.paneFocusContextKey=o,this.viewDescriptorService=G,this.contextKeyService=B,this.extensionService=X,this.menuService=Z,this.onDidPaneCompositeClose=this.onDidCompositeClose.event,this.headerFooterCompositeBarDispoables=this._register(new F),this.paneCompositeBar=this._register(new ke),this.compositeBarPosition=void 0,this.blockOpening=void 0,this.location=j,this.globalActionsMenuId=q,this.registerListeners()}registerListeners(){this._register(this.onDidPaneCompositeOpen(e=>this.onDidOpen(e))),this._register(this.onDidPaneCompositeClose(this.onDidClose,this)),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(fo(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(3493,"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(sw)?.toString()||"";this.titleContainer&&o&&(this.titleContainer.style.backgroundColor=n),this.headerFooterCompositeBarContainer&&o&&(this.headerFooterCompositeBarContainer.style.backgroundColor=n),this.emptyPaneMessageElement.style.backgroundColor=n};this._register(pl.INSTANCE.registerTarget(this.element,{onDragOver:s=>{if(be.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);Z_(s.eventData.dataTransfer,"move",o)}},onDragEnter:s=>{if(be.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);i(o)}},onDragLeave:s=>{be.stop(s.eventData,!0),i(!1)},onDragEnd:s=>{be.stop(s.eventData,!0),i(!1)},onDrop:s=>{if(be.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(z(t,ee.CONTEXT_MENU,s=>{this.onTitleAreaContextMenu(new Vo(Ue(t),s))})),this._register(qd.addTarget(t)),this._register(z(t,Ni.Contextmenu,s=>{this.onTitleAreaContextMenu(new Vo(Ue(t),s))}));const i=t.appendChild(M(".global-actions"));return this.globalToolBar=this._register(this.instantiationService.createInstance(zy,i,this.globalActionsMenuId,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Ar.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(3494,"More Actions..."),hoverDelegate:this.toolbarHoverDelegate,hiddenItemStrategy:Q_.NoHide,highlightToggledItems:!0,telemetrySource:this.nameForTelemetry,toolbarOptions:{forceLeadingSeparatorInPrimaryActions:!0}})),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(pl.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===Re.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===Re.TOP?this.removeFooterHeaderArea(!0):s===Re.BOTTOM&&this.removeFooterHeaderArea(!1)}let n;switch(o){case Re.TOP:n=this.createHeaderArea();break;case Re.TITLE:n=this.titleContainer;break;case Re.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=$y(n,M(".composite-bar-container")),this.paneCompositeBar.value=this.createCompositeBar(),this.paneCompositeBar.value.create(this.paneCompositeBarContainer),o===Re.TOP?this.setHeaderArea(n):o===Re.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(z(e,ee.CONTEXT_MENU,t=>{this.onCompositeBarAreaContextMenu(new Vo(Ue(e),t))})),this.headerFooterCompositeBarDispoables.add(qd.addTarget(e)),this.headerFooterCompositeBarDispoables.add(z(e,Ni.Contextmenu,t=>{this.onCompositeBarAreaContextMenu(new Vo(Ue(e),t))})),e}removeFooterHeaderArea(e){this.headerFooterCompositeBarContainer=void 0,this.headerFooterCompositeBarDispoables.clear(),e?this.removeHeaderArea():this.removeFooterArea()}createCompositeBar(){return this.instantiationService.createInstance(eI,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 tn,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 Ne(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===Re.TITLE?16:8,t=this.partId===H.PANEL_PART?0:1;let i=this.contentDimension.width-e-t;i=Math.max(sg.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("","")}getToolbarWidth(){if(!this.toolBar||this.compositeBarPosition!==Re.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()===Re.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 F,i=t.add(this.contextKeyService.createScoped(this.element));i.createKey("viewContainer",e.viewContainer.id);const s=this.menuService.getMenuActions(tw,i,{shouldForwardArgs:!0,renderShortTitle:!0}),o=Tp(s,()=>!0).primary;return t.dispose(),o.length>1&&o.some(n=>n.enabled)?new gl("views",c(3495,"Views"),o):void 0}}},sg=Nn,Nn.MIN_COMPOSITE_BAR_WIDTH=50,Nn);Jd=sg=_([u(9,Qe),u(10,pe),u(11,bt),u(12,st),u(13,ot),u(14,ei),u(15,K),u(16,me),u(17,_t),u(18,re),u(19,Qt),u(20,Ks)],Jd);var Gr;Te(MR);var As;let og=(As=class extends Jd{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,g,f,w){super(H.AUXILIARYBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(fl)||this.getColor(zi)?1:0},Gr.activeViewSettingsKey,tI.bindTo(h),iI.bindTo(h),"auxiliarybar","auxiliarybar",void 0,qy,e,t,i,s,o,n,r,d,l,h,p,f),this.commandService=g,this.configurationService=w,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Ds.Low,this.configuration=this.resolveConfiguration(),this._register(w.onDidChangeConfiguration(v=>{v.affectsConfiguration(vi.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(vi.ACTIVITY_BAR_LOCATION),t=e!==dt.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=ge(this.getContainer());e.style.backgroundColor=this.getColor(ra)||"";const t=this.getColor(fl)||this.getColor(zi),i=this.layoutService.getSideBarPosition()===di.RIGHT;e.style.color=this.getColor(jy)||"",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:Gr.pinnedViewsKey,placeholderViewContainersKey:Gr.placeholdeViewContainersKey,viewContainersWorkspaceStateKey:Gr.viewContainersWorkspaceStateKey,icon:!this.configuration.showLabels,orientation:Ar.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===Re.BOTTOM?La.ABOVE:La.BELOW},fillExtraContextMenuActions:t=>this.fillExtraContextMenuActions(t),compositeSize:0,iconSize:16,get overflowActionSize(){return e.getCompositeBarPosition()===Re.TITLE?40:30},colors:t=>({activeBackgroundColor:t.getColor(ra),inactiveBackgroundColor:t.getColor(ra),get activeBorderBottomColor(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(sC):t.getColor(oC)},get activeForegroundColor(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(tC):t.getColor(iC)},get inactiveForegroundColor(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(Qy):t.getColor(eC)},badgeBackground:t.getColor(Zy),badgeForeground:t.getColor(Jy),get dragAndDropBorder(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(Yy):t.getColor(Xy)}}),compact:!0}}fillExtraContextMenuActions(e){const t=this.layoutService.getSideBarPosition()===di.LEFT;if(this.getCompositeBarPosition()===Re.TITLE){const n=this.getViewsSubmenuAction();n&&(e.push(new go),e.push(n))}const i=this.menuService.getMenuActions(b.ActivityBarPositionMenu,this.contextKeyService,{shouldForwardArgs:!0,renderShortTitle:!0}),s=ml(i).secondary,o=lo({id:"workbench.action.auxiliarybar.toggleShowLabels",label:this.configuration.showLabels?c(2935,"Show Icons"):c(2936,"Show Labels"),enabled:this.configuration.canShowLabels,run:()=>this.configurationService.updateValue("workbench.secondarySideBar.showLabels",!this.configuration.showLabels)});e.push(new go,new gl("workbench.action.panel.position",c(2937,"Activity Bar Position"),s),lo({id:Lb.ID,label:t?c(2938,"Move Secondary Side Bar Left"):c(2939,"Move Secondary Side Bar Right"),run:()=>this.commandService.executeCommand(Lb.ID)}),o,lo({id:Vb.ID,label:c(2940,"Hide Secondary Side Bar"),run:()=>this.commandService.executeCommand(Vb.ID)}))}shouldShowCompositeBar(){return this.configuration.position!==dt.HIDDEN}getCompositeBarPosition(){switch(this.configuration.position){case dt.TOP:return Re.TOP;case dt.BOTTOM:return Re.BOTTOM;case dt.HIDDEN:return Re.TITLE;case dt.DEFAULT:return Re.TITLE;default:return Re.TITLE}}toJSON(){return{type:H.AUXILIARYBAR_PART}}},Gr=As,As.activeViewSettingsKey="workbench.auxiliarybar.activepanelid",As.pinnedViewsKey="workbench.auxiliarybar.pinnedPanels",As.placeholdeViewContainersKey="workbench.auxiliarybar.placeholderPanels",As.viewContainersWorkspaceStateKey="workbench.auxiliarybar.viewContainersWorkspaceState",As);og=Gr=_([u(0,Qe),u(1,pe),u(2,bt),u(3,st),u(4,ot),u(5,ei),u(6,K),u(7,me),u(8,_t),u(9,re),u(10,Qt),u(11,Xe),u(12,Ks),u(13,se)],og);const lE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(lE);const GR={separatorBorder:Ii.transparent};function Ls(a){return a===de.VERTICAL?de.HORIZONTAL:de.VERTICAL}class WR{constructor(e){this.isLayoutEnabled=e}}function KR(a,e){return e===de.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 UR(a,e){return e===de.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 Qi(a,e){if(Math.abs(a)>e)throw new Error("Invalid index");return sI(a,e+1)}class je{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===de.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===de.HORIZONTAL?this.orthogonalSize:this.size}get top(){return this.orientation===de.HORIZONTAL?this._absoluteOffset:this._absoluteOrthogonalOffset}get left(){return this.orientation===de.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 Ds.Normal;const e=this.children.map(t=>typeof t.priority>"u"?Ds.Normal:t.priority);return e.some(t=>t===Ds.High)?Ds.High:e.some(t=>t===Ds.Low)?Ds.Low:Ds.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===de.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===de.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===de.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===de.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 je&&(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 A,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new A,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this.childrenVisibilityChangeDisposable=new F,this._onDidScroll=new A,this.onDidScrollDisposable=N.None,this.onDidScroll=this._onDidScroll.event,this.childrenChangeDisposable=N.None,this._onDidSashReset=new A,this.onDidSashReset=this._onDidSashReset.event,this.splitviewSashResetDisposable=N.None,this.childrenSashResetDisposable=N.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 jd(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(g=>({view:g.node,size:g.node.size,visible:g.visible!==!1})),size:this.orthogonalSize},p={proportionalLayout:s,orientation:e,styles:i};this.children=d.map(g=>g.node),this.splitview=new jd(this.element,{...p,descriptor:h}),this.children.forEach((g,f)=>{const w=f===0,v=f===this.children.length;g.boundarySashes={start:this.boundarySashes.orthogonalStart,end:this.boundarySashes.orthogonalEnd,orthogonalStart:w?this.boundarySashes.start:this.splitview.sashes[f-1],orthogonalEnd:v?this.boundarySashes.end:this.splitview.sashes[f]}})}const l=W.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 je&&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=Qi(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=Qi(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=Qi(e,this.children.length),t=Qi(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=Qi(e,this.children.length),t=Qi(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=Qi(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 je&&t.distributeViewSizes(!0)}getChildSize(e){return e=Qi(e,this.children.length),this.splitview.getViewSize(e)}isChildVisible(e){return e=Qi(e,this.children.length),this.splitview.isViewVisible(e)}setChildVisible(e,t){if(e=Qi(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=Qi(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=W.map(W.any(...this.children.map(s=>s.onDidChange)),()=>{});this.childrenChangeDisposable.dispose(),this.childrenChangeDisposable=e(this._onDidChange.fire,this._onDidChange);const t=W.any(...this.children.map((s,o)=>W.map(s.onDidSashReset,n=>[o,...n])));this.childrenSashResetDisposable.dispose(),this.childrenSashResetDisposable=t(this._onDidSashReset.fire,this._onDidSashReset);const i=W.any(W.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 je&&this.childrenVisibilityChangeDisposable.add(s.onDidVisibilityChange(n=>{this.setChildVisible(o,n)}))})}trySet2x2(e){if(this.children.length!==2||e.children.length!==2)return N.None;if(this.getChildSize(0)!==e.getChildSize(0))return N.None;const[t,i]=this.children,[s,o]=e.children;if(!(t instanceof pt)||!(i instanceof pt))return N.None;if(!(s instanceof pt)||!(o instanceof pt))return N.None;this.orientation===de.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),he(()=>{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 HR(a){const[e,t]=W.split(a.onDidChange,An);return W.any(t,W.map(W.latch(W.map(e,i=>[a.minimumWidth,a.maximumWidth,a.minimumHeight,a.maximumHeight]),wr),i=>{}))}class pt{get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}get linkedWidthNode(){return this._linkedWidthNode}set linkedWidthNode(e){this._onDidLinkedWidthNodeChange.input=e?e._onDidViewChange:W.None,this._linkedWidthNode=e,this._onDidSetLinkedNode.fire(void 0)}get linkedHeightNode(){return this._linkedHeightNode}set linkedHeightNode(e){this._onDidLinkedHeightNodeChange.input=e?e._onDidViewChange:W.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=W.None,this.onDidSashReset=W.None,this._onDidLinkedWidthNodeChange=new ho,this._linkedWidthNode=void 0,this._onDidLinkedHeightNodeChange=new ho,this._linkedHeightNode=void 0,this._onDidSetLinkedNode=new A,this.disposables=new F,this._boundarySashes={},this.cachedWidth=0,this.cachedHeight=0,this.cachedTop=0,this.cachedLeft=0,this._orthogonalSize=s,this._size=o;const n=HR(e);this._onDidViewChange=W.map(n,r=>r&&(this.orientation===de.VERTICAL?r.width:r.height),this.disposables),this.onDidChange=W.any(this._onDidViewChange,this._onDidSetLinkedNode.event,this._onDidLinkedWidthNodeChange.event,this._onDidLinkedHeightNodeChange.event)}get width(){return this.orientation===de.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===de.HORIZONTAL?this.size:this.orthogonalSize}get top(){return this.orientation===de.HORIZONTAL?this.absoluteOffset:this.absoluteOrthogonalOffset}get left(){return this.orientation===de.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===de.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===de.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===de.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===de.HORIZONTAL?this.maximumWidth:this.maximumHeight}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.view.setBoundarySashes?.(KR(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 hE(a,e,t){if(a instanceof je){const i=new je(Ls(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 je?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(hE(n,t,d),d,0,!0)}return a.dispose(),i}else{const i=new pt(a.view,Ls(a.orientation),a.layoutController,t);return a.dispose(),i}}class ha{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=W.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=hE(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=UR(e,this.orientation)}set edgeSnapping(e){this.root.edgeSnapping=e}constructor(e={}){this.onDidSashResetRelay=new ho,this._onDidScroll=new ho,this._onDidChange=new ho,this._boundarySashes={},this.disposable2x2=N.None,this.onDidSashReset=this.onDidSashResetRelay.event,this.onDidScroll=this._onDidScroll.event,this.onDidChange=this._onDidChange.event,this.maximizedNode=void 0,this._onDidChangeViewMaximized=new A,this.onDidChangeViewMaximized=this._onDidChangeViewMaximized.event,this.element=M(".monaco-grid-view"),this.styles=e.styles||GR,this.proportionalLayout=typeof e.proportionalLayout<"u"?!!e.proportionalLayout:!0,this.layoutController=new WR(!1),this.root=new je(de.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===de.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=N.None;const[s,o]=ct(i),[n,r]=this.getNode(s);if(r instanceof je){const d=new pt(e,Ls(r.orientation),this.layoutController,r.orthogonalSize);try{r.addChild(d,t,o)}catch(l){throw d.dispose(),l}}else{const[,d]=ct(n),[,l]=ct(s);let h=0;const p=d.getChildCachedVisibleSize(l);typeof p=="number"&&(h=Ei.Invisible(p)),d.removeChild(l).dispose();const f=new je(r.orientation,r.layoutController,this.styles,this.proportionalLayout,r.size,r.orthogonalSize,d.edgeSnapping);d.addChild(f,r.size,l);const w=new pt(r.view,d.orientation,this.layoutController,r.size);f.addChild(w,h,0),typeof t!="number"&&t.type==="split"&&(t=Ei.Split(0));const v=new pt(e,d.orientation,this.layoutController,r.size);f.addChild(v,t,o)}this.trySet2x2()}removeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView(),this.disposable2x2.dispose(),this.disposable2x2=N.None;const[i,s]=ct(e),[o,n]=this.getNode(i);if(!(n instanceof je))throw new Error("Invalid location");const r=n.children[s];if(!(r instanceof pt))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 f=n.children[0];return f instanceof pt||(n.removeChild(0),n.dispose(),this.root=f,this.boundarySashes=this.boundarySashes,this.trySet2x2()),r.view}const[,d]=ct(o),[,l]=ct(i),h=n.isChildVisible(0),p=n.removeChild(0),g=d.children.map((f,w)=>d.getChildSize(w));if(d.removeChild(l,t),n.dispose(),p instanceof je){g.splice(l,1,...p.children.map(w=>w.size));const f=p.removeAllChildren();for(let w=0;w<f.length;w++)d.addChild(f[w],f[w].size,l+w)}else{const f=new pt(p.view,Ls(p.orientation),this.layoutController,p.size),w=h?p.orthogonalSize:Ei.Invisible(p.orthogonalSize);d.addChild(f,w,l)}p.dispose();for(let f=0;f<g.length;f++)d.resizeChild(f,g[f]);return this.trySet2x2(),r.view}moveView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,s]=this.getNode(e);if(!(s instanceof je))throw new Error("Invalid location");s.moveChild(t,i),this.trySet2x2()}swapViews(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=ct(e),[,o]=this.getNode(i);if(!(o instanceof je))throw new Error("Invalid from location");const n=o.getChildSize(s),r=o.children[s];if(!(r instanceof pt))throw new Error("Invalid from location");const[d,l]=ct(t),[,h]=this.getNode(d);if(!(h instanceof je))throw new Error("Invalid to location");const p=h.getChildSize(l),g=h.children[l];if(!(g instanceof pt))throw new Error("Invalid to location");o===h?o.swapChildren(s,l):(o.removeChild(s),h.removeChild(l),o.addChild(g,n,s),h.addChild(r,p,l)),this.trySet2x2()}resizeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=ct(e),[o,n]=this.getNode(i);if(!(n instanceof je))throw new Error("Invalid location");if(!t.width&&!t.height)return;const[r,d]=n.orientation===de.HORIZONTAL?[t.width,t.height]:[t.height,t.width];if(typeof d=="number"&&o.length>0){const[,l]=ct(o),[,h]=ct(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]=ct(e),[,s]=this.getNode(t);if(!(s instanceof je))throw new Error("Invalid location");return s.getChildCachedVisibleSize(i)}expandView(e){this.hasMaximizedView()&&this.exitMaximizedView();const[t,i]=this.getNode(e);if(!(i instanceof pt))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 pt))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 pt))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 pt?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 pt?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 pt))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 je))throw new Error("Invalid location");t.distributeViewSizes(),this.trySet2x2()}isViewVisible(e){const[t,i]=ct(e),[,s]=this.getNode(t);if(!(s instanceof je))throw new Error("Invalid from location");return s.isChildVisible(i)}setViewVisible(e,t){if(this.hasMaximizedView()){this.exitMaximizedView();return}const[i,s]=ct(e),[,o]=this.getNode(i);if(!(o instanceof je))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 ha(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,Ls(t),i,e.size),visible:d.visible}));o=new je(t,this.layoutController,this.styles,this.proportionalLayout,e.size,s,void 0,r)}else o=new pt(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 pt)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,Ls(t),d))}return{children:o,box:s}}getNode(e,t=this.root,i=[]){if(e.length===0)return[i,t];if(!(t instanceof je))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=N.None,this.root.children.length!==2)return;const[e,t]=this.root.children;!(e instanceof je)||!(t instanceof je)||(this.disposable2x2=e.trySet2x2(t))}getViewMap(e,t){t||(t=this.root),t instanceof je?t.children.forEach(i=>this.getViewMap(e,i)):e.set(t.view,t.element)}dispose(){this.onDidSashResetRelay.dispose(),this.root.dispose(),this.element.remove()}}Te(lE);var Ee;(function(a){a[a.Up=0]="Up",a[a.Down=1]="Down",a[a.Left=2]="Left",a[a.Right=3]="Right"})(Ee||(Ee={}));function zR(a){switch(a){case Ee.Up:return Ee.Down;case Ee.Down:return Ee.Up;case Ee.Left:return Ee.Right;case Ee.Right:return Ee.Left}}function Vn(a){return!!a.children}function uE(a,e){if(e.length===0)return a;if(!Vn(a))throw new Error("Invalid location");const[t,...i]=e;return uE(a.children[t],i)}function $R(a,e){return!(a.start>=e.end||e.start>=a.end)}function pE(a,e){const t=Zw(e),i=e===Ee.Up?a.top:e===Ee.Right?a.left+a.width:e===Ee.Down?a.top+a.height:a.left,s={start:t===de.HORIZONTAL?a.top:a.left,end:t===de.HORIZONTAL?a.top+a.height:a.left+a.width};return{offset:i,range:s}}function qR(a,e,t){const i=[];function s(o,n,r){if(Vn(o))for(const d of o.children)s(d,n,r);else{const{offset:d,range:l}=pE(o.box,n);d===r.offset&&$R(l,r.range)&&i.push(o)}}return s(a,e,t),i}function ng(a,e){return e.length%2===0?Ls(a):a}function Zw(a){return a===Ee.Up||a===Ee.Down?de.VERTICAL:de.HORIZONTAL}function jv(a,e,t){const i=ng(a,e),s=Zw(t);if(i===s){let[o,n]=ct(e);return(t===Ee.Right||t===Ee.Down)&&(n+=1),[...o,n]}else{const o=t===Ee.Right||t===Ee.Down?1:0;return[...e,o]}}function jR(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 gE(a){const e=a.parentElement;if(!e)throw new Error("Invalid grid element");if(/\bmonaco-grid-view\b/.test(e.className))return[];const t=jR(e),i=e.parentElement.parentElement.parentElement.parentElement;return[...gE(i),t]}var ua;(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})(ua||(ua={}));class YR extends N{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 ha?(this.gridview=e,this.gridview.getViewMap(this.views)):this.gridview=new ha(t),this._register(this.gridview),this._register(this.gridview.onDidSashReset(this.onDidSashReset,this)),e instanceof ha||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=Zw(s);this.views.size===1&&this.orientation!==o&&(this.orientation=o);const n=this.getViewLocation(i),r=jv(this.gridview.orientation,n,s);let d;if(typeof t=="number")d=t;else if(t.type==="split"){const[,l]=ct(n);d=Ei.Split(l)}else if(t.type==="distribute")d=Ei.Distribute;else if(t.type==="auto"){const[,l]=ct(n);d=Ei.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=Ei.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=Ei.Distribute;else if(t?.type==="auto"){const o=i[i.length-1];s=Ei.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]=ct(o),d=this.getViewLocation(i),l=jv(this.gridview.orientation,d,s),[h,p]=ct(l);wr(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]=ct(i),[n,r]=ct(t);if(wr(s,n))this.gridview.moveView(s,o,r);else{const d=this.getViewSize(e),l=ng(this.gridview.orientation,i),h=this.getViewCachedVisibleSize(e),p=typeof h>"u"?l===de.HORIZONTAL?d.width:d.height:ua.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=uE(o,s);let r=pE(n.box,t);return i&&(t===Ee.Up&&n.box.top===0?r={offset:o.box.top+o.box.height,range:r.range}:t===Ee.Right&&n.box.left+n.box.width===o.box.width?r={offset:0,range:r.range}:t===Ee.Down&&n.box.top+n.box.height===o.box.height?r={offset:0,range:r.range}:t===Ee.Left&&n.box.left===0&&(r={offset:o.box.left+o.box.width,range:r.range})),qR(o,zR(t),r).map(d=>d.view)}getViewLocation(e){const t=this.views.get(e);if(!t)throw new Error("View not found");return gE(t)}onDidSashReset(e){const t=o=>{const n=this.gridview.getView(o);if(Vn(n))return!1;const r=ng(this.orientation,o),d=r===de.HORIZONTAL?n.view.preferredWidth:n.view.preferredHeight;if(typeof d!="number")return!1;const l=r===de.HORIZONTAL?{width:Math.round(d)}:{height:Math.round(d)};return this.gridview.resizeView(o,l),!0};if(t(e))return;const[i,s]=ct(e);t([...i,s+1])||this.gridview.distributeViewSizes(i)}}class Bo extends YR{constructor(){super(...arguments),this.initialLayoutContext=!0}static serializeNode(e,t){const i=t===de.VERTICAL?e.box.width:e.box.height;if(!Vn(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=>Bo.serializeNode(o,Ls(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=ha.deserialize(e,t,i);return new Bo(s,i)}static from(e,t={}){return Bo.deserialize(vE(e),{fromJSON:i=>i},t)}serialize(){return{root:Bo.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 fE(a){return!!a.groups}function mE(a,e){if(!e&&a.groups&&a.groups.length<=1&&(a.groups=void 0),!fE(a))return;let t=0,i=0;for(const r of a.groups)mE(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 wE(a){return fE(a)?{type:"branch",data:a.groups.map(e=>wE(e)),size:a.size}:{type:"leaf",data:a.data,size:a.size}}function bE(a,e){if(a.type==="branch"){const t=a.data.map(i=>bE(i,Ls(e)));if(e===de.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===de.VERTICAL?a.size:void 0,i=e===de.VERTICAL?void 0:a.size;return{width:t,height:i}}}function vE(a){mE(a,!0);const e=wE(a),{width:t,height:i}=bE(e,a.orientation);return{root:e,orientation:a.orientation,width:t||1,height:i||1}}const XR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),JR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class ZR{constructor(e){this._container=e}set text(e){cs(this._container,...ls(e??""))}set title(e){!this.hover&&e?this.hover=oI().setupManagedHover(bc("mouse"),this._container,e):this.hover&&this.hover.update(e)}dispose(){this.hover?.dispose()}}var rg,fd,ol;Te(JR);var Fn;let Zd=(Fn=class extends ow{constructor(e,t,i,s,o){super(e,t,i,s,o),this.inputDisposable=this._register(new ke)}createEditor(e){this.container=M(".monaco-editor-pane-placeholder",{tabIndex:0}),this.container.style.outline="none",this.scrollbar=this._register(new rC(this.container,{horizontal:Va.Auto,vertical:Va.Auto})),e.appendChild(this.scrollbar.getDomNode())}async setInput(e,t,i,s){await super.setInput(e,t,i,s),!s.isCancellationRequested&&(this.inputDisposable.value=await this.renderInput(e,t))}async renderInput(e,t){const[i,s]=Po(this.container,this.scrollbar);Bt(i);const o=new F,{icon:n,label:r,actions:d}=await this.getContents(e,t,o),l=aI(r,rg.PLACEHOLDER_LABEL_MAX_LENGTH),h=i.appendChild(M(".editor-placeholder-icon-container")),p=o.add(new ZR(h));p.text=n;const g=i.appendChild(M(".editor-placeholder-label-container")),f=M("span");if(f.textContent=l,g.appendChild(f),i.setAttribute("aria-label",`${nw(e,void 0,this.group,void 0)}, ${l}`),d.length){const w=i.appendChild(M(".editor-placeholder-buttons-container")),v=o.add(new rw(w));for(let C=0;C<d.length;C++){const T=o.add(v.addButton({...Pa,secondary:C!==0}));T.label=d[C].label,o.add(T.onDidClick(G=>{G&&be.stop(G,!0),d[C].run()}))}}return s.scanDomNode(),o}clearInput(){this.container&&Bt(this.container),this.inputDisposable.clear(),super.clearInput()}layout(e){const[t,i]=Po(this.container,this.scrollbar);dI(t,e.width,e.height),i.scanDomNode(),t.classList.toggle("max-height-200px",e.height<=200)}focus(){super.focus(),this.container?.focus()}dispose(){this.container?.remove(),super.dispose()}},rg=Fn,Fn.PLACEHOLDER_LABEL_MAX_LENGTH=1024,Fn);Zd=rg=_([u(2,rt),u(3,me),u(4,pe)],Zd);var os;let ag=(os=class extends Zd{constructor(e,t,i,s,o,n){super(fd.ID,e,t,i,n),this.commandService=s,this.workspaceService=o}getTitle(){return fd.LABEL}async getContents(){return{icon:"$(workspace-untrusted)",label:nI(rI(this.workspaceService.getWorkspace()))?c(3334,"The file is not displayed in the editor because trust has not been granted to the folder."):c(3335,"The file is not displayed in the editor because trust has not been granted to the workspace."),actions:[{label:c(3336,"Manage Workspace Trust"),run:()=>this.commandService.executeCommand("workbench.trust.manage")}]}}},fd=os,os.ID="workbench.editors.workspaceTrustRequiredEditor",os.LABEL=c(3333,"Workspace Trust Required"),os.DESCRIPTOR=ki.create(fd,os.ID,os.LABEL),os);ag=fd=_([u(1,rt),u(2,me),u(3,Xe),u(4,fi),u(5,pe)],ag);var ns;let dg=(ns=class extends Zd{constructor(e,t,i,s,o,n){super(ol.ID,e,t,i,s),this.fileService=o,this.dialogService=n}async getContents(e,t,i){const s=e.resource,o=t.error,n=o?.fileOperationResult===ks.FILE_NOT_FOUND;let r;n?r=c(3338,"The editor could not be opened because the file was not found."):yd(o)&&o.forceMessage?r=o.message:o?r=c(3339,"The editor could not be opened due to an unexpected error. Please consult the log for more details."):r=c(3340,"The editor could not be opened due to an unexpected error.");let d="$(error)";yd(o)&&(o.forceSeverity===Ae.Info?d="$(info)":o.forceSeverity===Ae.Warning&&(d="$(warning)"));let l;return yd(o)&&o.actions.length>0?l=o.actions.map(h=>({label:h.label,run:()=>{const p=h.run();p instanceof Promise&&p.catch(g=>this.dialogService.error(wl(g)))}})):l=[{label:c(3341,"Try Again"),run:()=>this.group.openEditor(e,{...t,source:nC.USER})}],n&&s&&this.fileService.hasProvider(s)&&i.add(this.fileService.onDidFilesChange(h=>{h.contains(s,bl.ADDED,bl.UPDATED)&&this.group.openEditor(e,t)})),{icon:d,label:r,actions:l??[]}}},ol=ns,ns.ID="workbench.editors.errorEditor",ns.LABEL=c(3337,"Error Editor"),ns.DESCRIPTOR=ki.create(ol,ns.ID,ns.LABEL),ns);dg=ol=_([u(1,rt),u(2,me),u(3,pe),u(4,Ve),u(5,Ji)],dg);let cg=class extends N{get minimumWidth(){return this._activeEditorPane?.minimumWidth??vl.width}get minimumHeight(){return this._activeEditorPane?.minimumHeight??vl.height}get maximumWidth(){return this._activeEditorPane?.maximumWidth??yl.width}get maximumHeight(){return this._activeEditorPane?.maximumHeight??yl.height}get activeEditorPane(){return this._activeEditorPane}constructor(e,t,i,s,o,n,r,d,l,h){super(),this.editorGroupParent=e,this.editorPanesParent=t,this.groupView=i,this.layoutService=s,this.instantiationService=o,this.workspaceTrustService=r,this.logService=d,this.dialogService=l,this.hostService=h,this._onDidFocus=this._register(new A),this.onDidFocus=this._onDidFocus.event,this._onDidChangeSizeConstraints=this._register(new A),this.onDidChangeSizeConstraints=this._onDidChangeSizeConstraints.event,this._activeEditorPane=null,this.editorPanes=[],this.mapEditorPaneToPendingSetInput=new Map,this.activeEditorPaneDisposables=this._register(new F),this.editorPanesRegistry=ie.as(At.EditorPane),this.editorOperation=this._register(new cI(n)),this.registerListeners()}registerListeners(){this._register(this.workspaceTrustService.onDidChangeTrust(()=>this.onDidChangeWorkspaceTrust()))}onDidChangeWorkspaceTrust(){const e=this._activeEditorPane?.input,t=this._activeEditorPane?.options;e?.hasCapability($t.RequiresTrust)&&this.groupView.openEditor(e,t)}async openEditor(e,t,i,s=Object.create(null)){try{return await this.doOpenEditor(this.getEditorPaneDescriptor(e),e,t,i,s)}catch(o){return t?.ignoreError?{error:o}:this.doShowError(o,e,t,i,s)}}async doShowError(e,t,i,s,o){this.logService.error(e);let n=!1;if(i?.source===nC.USER&&(!yd(e)||e.allowDialog)&&(n=await this.doShowErrorDialog(e,t)),n)return{error:e};const r={...i};return $a(e)||(r.error=e),{...await this.doOpenEditor(dg.DESCRIPTOR,t,r,s,o),error:e}}async doShowErrorDialog(e,t){let i=Ae.Error,s,o=wl(e),n;yd(e)&&(n=e.actions,i=e.forceSeverity??Ae.Error,e.forceMessage&&(s=e.message,o=void 0)),s||(s=c(3330,"Unable to open '{0}'",t.getName()));const r=[];if(n&&n.length>0)for(const p of n)r.push({label:p.label,run:()=>p});else r.push({label:c(3331,"&&OK"),run:()=>{}});let d;r.length===1&&(d={run:()=>{l=!0}});let l=!1;const{result:h}=await this.dialogService.prompt({type:i,message:s,detail:o,buttons:r,cancelButton:d});if(h){const p=h.run();p instanceof Promise&&p.catch(g=>this.dialogService.error(wl(g))),l=!0}return l}async doOpenEditor(e,t,i,s,o=Object.create(null)){const n=this.doShowEditorPane(e),r=sn(),{changed:d,cancelled:l}=await this.doSetInput(n,t,i,o);return l||((!i||!i.preserveFocus)&&this.shouldRestoreFocus(r)?n.focus():s?.preserveWindowOrder||this.hostService.moveTop(vc(this.groupView.windowId,!0).window)),{pane:n,changed:d,cancelled:l}}shouldRestoreFocus(e){if(!this.layoutService.isRestored()||!e)return!0;const t=sn();return!!(!t||t===e.ownerDocument.body||e===t||!lI(t)||Oa(t,this.editorGroupParent))}getEditorPaneDescriptor(e){return e.hasCapability($t.RequiresTrust)&&!this.workspaceTrustService.isWorkspaceTrusted()?ag.DESCRIPTOR:ge(this.editorPanesRegistry.getEditorPane(e))}doShowEditorPane(e){if(this._activeEditorPane&&e.describes(this._activeEditorPane))return this._activeEditorPane;this.doHideActiveEditorPane();const t=this.doCreateEditorPane(e);this.doSetActiveEditorPane(t);const i=ge(t.getContainer());return this.editorPanesParent.appendChild(i),Ra(i),t.setVisible(!0),this.pagePosition&&t.layout(new Ne(this.pagePosition.width,this.pagePosition.height),{top:this.pagePosition.top,left:this.pagePosition.left}),this.boundarySashes&&t.setBoundarySashes(this.boundarySashes),t}doCreateEditorPane(e){const t=this.doInstantiateEditorPane(e);if(!t.getContainer()){const i=M(".editor-instance");this.editorPanesParent.appendChild(i);try{t.create(i)}catch(s){throw i.remove(),mr(i),s}}return t}doInstantiateEditorPane(e){const t=this.editorPanes.find(s=>e.describes(s));if(t)return t;const i=this._register(e.instantiate(this.instantiationService,this.groupView));return this.editorPanes.push(i),i}doSetActiveEditorPane(e){this._activeEditorPane=e,this.activeEditorPaneDisposables.clear(),e&&(this.activeEditorPaneDisposables.add(e.onDidChangeSizeConstraints(t=>this._onDidChangeSizeConstraints.fire(t))),this.activeEditorPaneDisposables.add(e.onDidFocus(()=>this._onDidFocus.fire()))),this._onDidChangeSizeConstraints.fire(void 0)}async doSetInput(e,t,i,s){let o=e.input?.matches(t);if(o&&!i?.forceReload)return this.mapEditorPaneToPendingSetInput.has(e)&&await this.mapEditorPaneToPendingSetInput.get(e),o=e.input?.matches(t),o&&e.setOptions(i),{changed:!1,cancelled:!o};const n=this.editorOperation.start(this.layoutService.isRestored()?800:3200);let r=!1;try{e.clearInput();const d=e.setInput(t,i,s,n.token);this.mapEditorPaneToPendingSetInput.set(e,d),await d,n.isCurrent()||(r=!0)}catch(d){if(!n.isCurrent())r=!0;else throw d}finally{n.isCurrent()&&this.mapEditorPaneToPendingSetInput.delete(e),n.stop()}return{changed:!o,cancelled:r}}doHideActiveEditorPane(){if(!this._activeEditorPane)return;this.editorOperation.stop(),this.safeRun(()=>this._activeEditorPane?.clearInput()),this.safeRun(()=>this._activeEditorPane?.setVisible(!1)),this.mapEditorPaneToPendingSetInput.delete(this._activeEditorPane);const e=this._activeEditorPane.getContainer();e&&(e.remove(),mr(e)),this.doSetActiveEditorPane(null)}closeEditor(e){this._activeEditorPane?.input&&e.matches(this._activeEditorPane.input)&&this.doHideActiveEditorPane()}setVisible(e){this.safeRun(()=>this._activeEditorPane?.setVisible(e))}layout(e){this.pagePosition=e,this.safeRun(()=>this._activeEditorPane?.layout(new Ne(e.width,e.height),e))}setBoundarySashes(e){this.boundarySashes=e,this.safeRun(()=>this._activeEditorPane?.setBoundarySashes(e))}safeRun(e){try{e()}catch(t){this.logService.error(t)}}};cg=_([u(3,st),u(4,K),u(5,iw),u(6,hI),u(7,it),u(8,Ji),u(9,Nt)],cg);var nl;const yE={text:c(3317,"Show All Commands"),id:"workbench.action.showCommands"},QR={text:c(3318,"Go to File"),id:"workbench.action.quickOpen"},eL={text:c(3319,"Open File"),id:"workbench.action.files.openFile"},tL={text:c(3320,"Open Folder"),id:"workbench.action.files.openFolder"},iL={text:c(3321,"Open File or Folder"),id:"workbench.action.files.openFileFolder"},sL={text:c(3322,"Open Recent"),id:"workbench.action.openRecent"},oL={text:c(3323,"New Untitled Text File"),id:"workbench.action.files.newUntitledFile"},nL={text:c(3324,"Find in Files"),id:"workbench.action.findInFiles"},rL={text:c(3325,"Toggle Terminal"),id:"workbench.action.terminal.toggleTerminal",when:{web:D.equals("terminalProcessSupported",!0)}},aL={text:c(3326,"Start Debugging"),id:"workbench.action.debug.start",when:{web:D.equals("terminalProcessSupported",!0)}},dL={text:c(3327,"Open Settings"),id:"workbench.action.openSettings"},Yv=D.and(D.equals("chatSetupHidden",!1),D.equals("chatSetupDisabled",!1)),CE={text:c(3328,"Open Chat"),id:"workbench.action.chat.open",when:{native:Yv,web:Yv}},Xv=xi([yE,...Ke&&!Wi?[iL]:[eL,tL],sL,Ke&&!Wi?oL:void 0,CE]),Jv=[],Zv=[yE,QR,CE],Qv=[nL,aL,rL,dL];var Bn;let lg=(Bn=class extends N{constructor(e,t,i,s,o,n){super(),this.keybindingService=t,this.contextService=i,this.contextKeyService=s,this.configurationService=o,this.storageService=n,this.transientDisposables=this._register(new F),this.keybindingLabels=this._register(new F),this.enabled=!1,this.cachedWhen=this.storageService.getObject(nl.CACHED_WHEN,te.PROFILE,Object.create(null)),this.workbenchState=this.contextService.getWorkbenchState();const r=Ct(".editor-group-watermark",[Ct(".letterpress"),Ct(".shortcuts@shortcuts")]);ye(e,r.root),this.shortcuts=r.shortcuts,this.registerListeners(),this.render()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.tips.enabled")&&this.enabled!==this.configurationService.getValue("workbench.tips.enabled")&&this.render()})),this._register(this.contextService.onDidChangeWorkbenchState(e=>{this.workbenchState!==e&&(this.workbenchState=e,this.render())})),this._register(this.storageService.onWillSaveState(e=>{if(e.reason===uI.SHUTDOWN){const t=[...Xv,...Jv,...Zv,...Qv];for(const i of t){const s=Wi?i.when?.web:i.when?.native;s&&(this.cachedWhen[i.id]=this.contextKeyService.contextMatchesRules(s))}this.storageService.store(nl.CACHED_WHEN,JSON.stringify(this.cachedWhen),te.PROFILE,Ze.MACHINE)}}))}render(){if(this.enabled=this.configurationService.getValue("workbench.tips.enabled"),Bt(this.shortcuts),this.transientDisposables.clear(),!this.enabled)return;const e=this.filterEntries(this.workbenchState!==Oo.EMPTY?Zv:Xv,!1),t=this.filterEntries(this.workbenchState!==Oo.EMPTY?Qv:Jv,!0).slice(0,Math.max(0,5-e.length)),i=[...e,...t],s=ye(this.shortcuts,M(".watermark-box")),o=()=>{Bt(s),this.keybindingLabels.clear();for(const n of i){const r=this.keybindingService.lookupKeybinding(n.id);if(!r)continue;const d=ye(s,M("dl")),l=ye(d,M("dt"));l.textContent=n.text;const h=ye(d,M("dd"));this.keybindingLabels.add(new kp(h,li,{renderUnboundKeybindings:!0,...xp})).set(r)}};o(),this.transientDisposables.add(this.keybindingService.onDidUpdateKeybindings(o))}filterEntries(e,t){const i=e.filter(s=>Wi&&!s.when?.web||!Wi&&!s.when?.native||this.cachedWhen[s.id]).filter(s=>!!fe.getCommand(s.id)).filter(s=>!!this.keybindingService.lookupKeybinding(s.id));return t&&pI(i),i}},nl=Bn,Bn.CACHED_WHEN="editorGroupWatermark.whenConditions",Bn);lg=nl=_([u(1,ot),u(2,fi),u(3,re),u(4,se),u(5,pe)],lg);Ce("editorWatermark.foreground",{dark:mo(Wc,.6),light:mo(Wc,.68),hcDark:Wc,hcLight:Wc},c(3329,"Foreground color for the labels in the editor watermark."));const cL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(lL);class Qw{}class hL{constructor(e,t,i,s){this._disposables=new F,this._onDidSelectItem=new A,this._onDidFocusItem=new A,this._onDidChangeFocus=new A,this.onDidSelectItem=this._onDidSelectItem.event,this.onDidFocusItem=this._onDidFocusItem.event,this.onDidChangeFocus=this._onDidChangeFocus.event,this._items=new Array,this._nodes=new Array,this._freeNodes=new Array,this._enabled=!0,this._focusedItemIdx=-1,this._selectedItemIdx=-1,this._domNode=we("div"),this._domNode.className="monaco-breadcrumbs",this._domNode.tabIndex=0,this._domNode.setAttribute("role","list"),this._scrollable=new rC(this._domNode,{vertical:Va.Hidden,horizontal:Va.Auto,horizontalScrollbarSize:t,useShadows:!1,scrollYToX:!0}),this._separatorIcon=i,this._disposables.add(this._scrollable),this._disposables.add(aw(this._domNode,"click",r=>this._onClick(r))),e.appendChild(this._scrollable.getDomNode());const o=dw(this._domNode);this._style(o,s);const n=fo(this._domNode);this._disposables.add(n),this._disposables.add(n.onDidBlur(r=>this._onDidChangeFocus.fire(!1))),this._disposables.add(n.onDidFocus(r=>this._onDidChangeFocus.fire(!0)))}setHorizontalScrollbarSize(e){this._scrollable.updateOptions({horizontalScrollbarSize:e})}dispose(){this._disposables.dispose(),this._pendingLayout?.dispose(),this._pendingDimLayout?.dispose(),this._onDidSelectItem.dispose(),this._onDidFocusItem.dispose(),this._onDidChangeFocus.dispose(),this._domNode.remove(),this._nodes.length=0,this._freeNodes.length=0}layout(e){e&&Ne.equals(e,this._dimension)||(e?(this._pendingDimLayout?.dispose(),this._pendingDimLayout=this._updateDimensions(e)):(this._pendingLayout?.dispose(),this._pendingLayout=this._updateScrollbar()))}_updateDimensions(e){const t=new F;return t.add(gI(Ue(this._domNode),()=>{this._dimension=e,this._domNode.style.width=`${e.width}px`,this._domNode.style.height=`${e.height}px`,t.add(this._updateScrollbar())})),t}_updateScrollbar(){return Pb(Ue(this._domNode),()=>{Pb(Ue(this._domNode),()=>{this._scrollable.setRevealOnScroll(!1),this._scrollable.scanDomNode(),this._scrollable.setRevealOnScroll(!0)})})}_style(e,t){let i="";t.breadcrumbsBackground&&(i+=`.monaco-breadcrumbs { background-color: ${t.breadcrumbsBackground}}`),t.breadcrumbsForeground&&(i+=`.monaco-breadcrumbs .monaco-breadcrumb-item { color: ${t.breadcrumbsForeground}}
|
|
2
|
+
import{gx as U_,gy as H_,gz as z_,e$ as $_,gA as tw,d5 as go,f as _,g as u,m as rt,by as pe,W as K,c1 as me,dl as bt,bx as Qt,ci as fi,aP as ie,gB as q_,ej as Wy,E as A,fg as ke,aJ as te,fj as j_,gC as Y_,gD as X_,dy as ge,gE as J_,gt as fr,gF as iw,d as F,aK as Ze,ai as M,fO as Ra,c0 as $a,s as c,fI as hl,fN as mr,a8 as ye,f3 as Ky,fw as Ar,dd as bc,f0 as du,d6 as Uy,d7 as Hy,fv as ul,dx as Ne,d8 as qe,Z as Te,cR as W,cp as ae,ck as H,bZ as b,dr as fo,gG as pl,db as be,gH as Z_,da as z,fE as Vo,ds as Ue,dc as ee,di as qd,dj as Ni,eZ as zy,e_ as Q_,fl as $y,gI as eI,dW as tn,gJ as Tp,f2 as gl,gK as sw,j as Qe,bB as st,dn as ot,dp as ei,cg as _t,dD as re,fJ as Ks,gL as fl,gb as zi,gM as tI,gN as iI,gO as qy,gP as Ds,dV as vi,e3 as dt,gQ as ra,cl as di,gR as jy,fs as La,gS as Yy,gT as Xy,gU as Jy,gV as Zy,gW as Qy,gX as eC,gY as tC,gZ as iC,g_ as sC,g$ as oC,h0 as ml,d4 as lo,h1 as Lb,h2 as Vb,d0 as Xe,h as se,ez as de,h3 as ho,D as N,N as Ii,h4 as ct,h5 as Ei,cG as jd,t as he,h6 as sI,bd as An,A as wr,a7 as cs,fX as ls,h7 as oI,h8 as ki,h9 as ks,ha as yd,bY as Ae,cM as wl,hb as nC,bt as bl,hc as nI,hd as rI,fu as ow,cB as rC,dM as Va,dt as Po,a5 as Bt,he as aI,hf as nw,de as rw,df as Pa,eq as dI,bA as Ve,bK as Ji,hg as vl,hh as yl,hi as At,hj as cI,cD as $t,dI as sn,hk as vc,dJ as lI,fq as Oa,hl as hI,O as it,dO as Nt,hm as Ct,eM as uI,G as Wi,cu as Oo,bV as fe,hn as pI,ho as kp,hp as li,hq as xp,cr as xi,ev as Ke,cY as D,hr as Ce,au as Wc,hs as mo,a3 as we,ht as aw,u as dw,hu as gI,hv as Pb,du as aC,hw as fI,bi as De,bf as _o,bg as Pe,hx as mI,a0 as ue,bs as Je,hy as Yt,aV as cu,a4 as wo,hz as wI,z as on,hA as bI,hB as yc,hC as cw,hD as qa,hE as dC,hF as Os,hG as br,hH as cC,dz as lC,hI as vI,hJ as vr,U as $,hK as Rp,hL as yI,hM as CI,hN as Et,hO as hC,hP as SI,bX as O,hQ as ps,dP as oe,hR as uC,hS as Ge,hT as xe,hU as pC,eP as EI,hV as Lp,hW as gC,bE as Se,bF as P,hX as Vp,hY as _I,hZ as Yd,h_ as Cl,h$ as II,i0 as mt,i1 as lw,i2 as Vs,i3 as Tr,bI as ut,i4 as fs,i5 as Us,bL as E,bM as V,bO as R,ak as y,bN as x,bQ as S,$ as m,cS as J,eW as nn,cc as U,i6 as Le,cW as ne,i7 as un,i as Hs,i8 as _e,co as Oe,i9 as DI,ia as AI,ib as TI,ic as Ob,id as kI,ie as Mb,ig as xI,J as lu,ih as hw,ii as Wt,ij as Ju,ik as RI,il as Mo,im as LI,io as fC,ip as Nb,iq as VI,ir as uw,is as yr,it as Lt,S as PI,iu as mC,iv as hu,iw as wC,er as qt,ix as to,iy as bC,iz as St,iA as Fb,bR as ja,iB as Pp,b_ as I,iC as Ai,iD as pw,iE as rn,iF as Ye,iG as uu,iH as Y,iI as pu,dm as Ft,iJ as Ya,iK as gw,iL as Cd,iM as Zu,bP as Ie,iN as fw,iO as mi,iP as mw,iQ as aa,iR as zs,iS as Op,aR as Fi,iT as Ms,iU as Ns,iV as vC,iW as xn,iX as hi,iY as jt,ar as Ma,iZ as OI,c_ as ww,dw as Cc,i_ as yC,i$ as bw,j0 as CC,j1 as gu,j2 as Xa,j3 as Gt,eT as Mp,j4 as da,j5 as SC,j6 as Cr,eh as an,j7 as EC,j8 as $r,j9 as ts,bc as Ki,cO as He,ja as gt,jb as Me,jc as _C,jd as IC,cE as ci,Q as Sc,je as Ja,jf as fu,jg as Sl,eL as vw,e6 as pi,e7 as Ec,cA as Ci,jh as Gi,P as Xs,ji as Oi,jj as No,jk as _c,jl as yw,jm as DC,jn as Rt,jo as AC,dS as MI,jp as TC,jq as NI,bp as Za,jr as FI,js as mu,d2 as pn,jt as kC,ju as xC,jv as RC,dh as dn,dL as Bb,jw as Na,jx as Qu,jy as BI,jz as GI,bU as LC,jA as Np,jB as WI,jC as KI,jD as UI,jE as HI,jF as zI,jG as $I,jH as qI,jI,jJ as YI,jK as XI,jL as JI,gd as Cw,jM as El,jN as xs,jO as VC,jP as PC,jQ as Sw,jR as Ew,jS as ZI,jT as QI,jU as eD,jV as tD,jW as iD,jX as sD,eU as _w,fA as OC,at as Iw,jY as MC,jZ as oD,j_ as nD,j$ as rD,k0 as aD,k1 as dD,a9 as Sr,k2 as cD,k3 as lD,k4 as NC,k5 as FC,k6 as Gb,k7 as hD,k8 as Ic,k9 as BC,ka as Dc,kb as uD,kc as pD,kd as gD,ke as fD,kf as mD,kg as at,kh as Wb,ki as _l,kj as wD,kk as bD,kl as GC,g0 as wu,km as vD,cq as bu,kn as _n,ko as yD,kp as CD,kq as SD,kr as ED,ks as WC,kt as kr,ku as _D,kv as ID,kw as Fp,kx as DD,ky as AD,kz as TD,kA as kD,cv as xD,bv as ve,kB as Bp,kC as Kb,kD as RD,kE as Go,kF as LD,kG as VD,kH as PD,kI as gn,kJ as OD,ea as Ub,e5 as KC,fi as MD,dG as Fs,kK as ND,kL as FD,f7 as UC,dY as Dw,ao as Qa,dZ as BD,fc as GD,eg as Il,kM as ed,kN as WD,kO as KD,kP as UD,kQ as ep,kR as Dl,kS as HD,kT as zD,kU as Hb,kV as $D,cf as fn,kW as qD,kX as jD,kY as YD,cz as Kc,kZ as XD,k_ as JD,k$ as ZD,f5 as QD,f6 as eA,l0 as mn,l1 as Si,l2 as Fo,l3 as Pt,l4 as Wo,l5 as tA,p as xr,l6 as Gp,x as io,gg as Wp,bb as vu,al as le,l7 as Tn,l8 as iA,l9 as sA,la as HC,lb as tp,lc as ip,ec as zb,ld as oA,le as nA,lf as rA,lg as aA,lh as Uc,li as hs,lj as L,lk as dA,ll as Bi,aW as cA,lm as Rn,aS as zC,ln as lA,lo as Aw,lp as Ac,lq as $C,lr as $b,ah as k,ls as hA,lt as qC,lu as uA,lv as qb,aU as pA,lw as jb,_ as sp,ch as Tw,lx as Yb,ly as gA,lz as fA,cj as kw,lA as mA,dT as Kp,dg as Up,lB as Cs,lC as Qc,R as We,lD as wA,V as $i,f1 as bA,lE as yu,be as kt,lF as ca,lG as vA,lH as yA,lI as jC,lJ as CA,lK as SA,lL as EA,lM as Cu,dE as _A,lN as IA,lO as DA,ad as Su,ae as Eu,lP as YC,lQ as AA,lR as td,lS as xw,lT as Al,lU as TA,lV as kA,lW as Xb,am as xA,lX as RA,eC as Rw,lY as Lw,lZ as Vw,l_ as Pw,l$ as Kt,m0 as XC,m1 as LA,m2 as js,m3 as Ow,m4 as cd,cH as Tc,m5 as VA,m6 as Jb,m7 as Ut,m8 as Zb,m9 as si,ma as JC,mb as op,mc as el,md as Qb,cF as et,me as Mi,mf as PA,mg as OA,mh as MA,mi as NA,mj as Bs,mk as FA,ml as oi,mm as BA,mn as GA,mo as WA,mp as KA,mq as UA,mr as Hp,ms as Sd,mt as HA,ct as zp,mu as ev,ap as kc,mv as tv,mw as zA,mx as $A,my as Mw,q as qA,mz as ZC,mA as QC,mB as eS,mC as ni,mD as tl,mE as jA,bn as YA,mF as XA,aL as qr,mG as JA,mH as ZA,mI as Ed,mJ as QA,mK as tS,mL as iv,mM as _d,mN as sv,mO as eT,mP as tT,bT as Nw,mQ as iT,mR as np,mS as sT,mT as oT,gq as nT,mU as rT,mV as ov,mW as pd,mX as aT,mY as dT,mZ as nv,m_ as Fw,b$ as cT,m$ as ss,n0 as lT,n1 as iS,F as Id,n2 as hT,n3 as uT,n4 as pT,n5 as gT,n6 as fT,n7 as mT,n8 as wT,n9 as Ri,na as bT,nb as vT,nc as sS,nd as oS,c as qi,ne as Rr,nf as gs,ng as nS,nh as yT,ni as rv,nj as CT,nk as ST,nl as ET,nm as _T,nn as IT,no as DT,np as AT,cJ as Br,cK as av,cL as TT,nq as rS,nr as dv,dF as xt,ns as kT,cN as Tl,nt as xT,nu as cv,nv as RT,gr as _u,nw as lv,nx as hv,ny as uv,nz as LT,nA as VT,dU as aS,nB as pv,nC as dS,gw as PT,nD as Dd,dQ as cS,bz as OT,em as kl,nE as MT,nF as gv,nG as fv,ey as NT,cn as is,nH as FT,nI as BT,nJ as $p,nK as mv,bw as GT,nL as lS,nM as wv,nN as WT,nO as KT,nP as UT,nQ as HT,ep as zT,nR as rp,nS as $T,nT as qT,nU as jT,nV as YT,nW as il,nX as XT,nY as hS,nZ as Iu,n_ as Lr,n$ as Bw,o0 as bv,o1 as JT,o2 as bo,o3 as Du,o4 as qp,o5 as ZT,o6 as Vr,o7 as QT,o8 as uS,eA as ek,o9 as ri,oa as tk,ob as ik,oc as Ui,od as xl,oe as sk,of as pS,og as ok,oh as nk,oi as rk,b3 as so,oj as vv,ok as Rl,ol as Au,om as ak,on as Tu,oo as ku,op as dk,oq as ck,or as gS,X as Ht,Y as zt,os as fS,ot as mS,ou as wS,ov as Ot,ow as bS,ox as vS,oy as yS,oz as CS,oA as SS,oB as ES,oC as _S,oD as IS,oE as DS,oF as AS,oG as xu,oH as TS,oI as ap,oJ as Pr,oK as $s,oL as Ll,oM as kS,oN as Mt,oO as dp,oP as Gw,oQ as ms,oR as ws,oS as ti,oT as lk,oU as hk,oV as Ww,oW as xc,oX as Rc,oY as Lc,oZ as xS,o_ as uk,o$ as pk,p0 as gk,p1 as RS,p2 as fk,p3 as Ru,p4 as cp,p5 as lp,p6 as LS,p7 as mk,p8 as wk,p9 as bk,pa as vk,bS as VS,pb as yk,fY as Ck,pc as PS,pd as Sk,pe as jp,pf as yv,pg as Rs,ph as Cv,pi as Lu,pj as Ek,pk as OS,pl as MS,fQ as Sv,gn as _k,pm as Ik,pn as Dk,po as Ev,pp as Ak,pq as Tk,pr as vt,ps as nt,pt as uo,pu as kn,pv as kk,pw as Xt,px as Ln,py as xk,pz as Vl,pA as Kw,pB as Jt,pC as Hc,pD as Rk,pE as Lk,pF as hp,pG as Er,pH as NS,d1 as Yp,pI as la,pJ as Vk,pK as Pk,pL as Ok,pM as Mk,pN as Nk,pO as jr,pP as Uw,pQ as up,pR as _v,pS as Js,pT as zc,pU as Ys,pV as Xp,pW as Iv,pX as Ad,pY as FS,pZ as BS,p_ as Fk,p$ as Bk,q0 as GS,q1 as Gk,q2 as Dv,gj as WS,q3 as Td,q4 as Av,q5 as KS,q6 as Wk,q7 as Kk,q8 as US,q9 as Uk,qa as Hk,bG as zk,qb as $k,qc as ds,qd as Tv,qe as qk,qf as kv,qg as pp,qh as jk,qi as Yk,qj as Xk,qk as Jk,ql as Zk,qm as Qk,qn as ex,qo as HS,qp as tx,qq as zS,qr as Zs,qs as ix,qt as xv,qu as yn,qv as Rv,qw as sx,qx as Lv,qy as Vv,qz as Jp,qA as $S,qB as Vu,qC as Vc,qD as gd,qE as ox,qF as nx,qG as rx,qH as Pv,qI as ax,qJ as dx,qK as qS,qL as jS,qM as cx,qN as lx,qO as hx,qP as ux,qQ as px,qR as gx,qS as fx,qT as mx,qU as wx,qV as bx,qW as Pc,qX as Pu,qY as vx,qZ as yx,q_ as Cx,q$ as Fa,r0 as Hw,r1 as Sx,r2 as Ex,r3 as YS,r4 as Xd,r5 as gp,r6 as ld,gh as _x,r7 as Ov,r8 as Ix,r9 as Dx,fR as Ax,gp as Mv,ra as Nv,rb as XS,rc as Tx,rd as kx,re as xx,M as kd,rf as Fv,rg as Rx,rh as tt,ri as Ou,rj as Lx,o as sl,rk as Vx,rl as JS,rm as Px,rn as ui,ro as zw,rp as $w,rq as qw,rr as Ox,rs as oo,rt as $c,ru as Mx,rv as Bv,rw as Nx,rx as Cn,ry as Gv,rz as Fx,rA as Zp,rB as fp,rC as Wv,rD as qc,rE as Bx,rF as Gx,rG as Kv,rH as ZS,rI as QS,rJ as jc,rK as Wx,rL as Kx,rM as Ux,rN as Hx,rO as zx,rP as $x,rQ as qx,rR as eE,rS as tE,rT as iE,rU as Pl,rV as jx,rW as Uv,rX as Yx,rY as Yr,rZ as mp,r_ as Xx,r$ as Ol,s0 as Jx,s1 as Fe,s2 as id,s3 as Mu,s4 as jw,s5 as Zx,s6 as Qx,s7 as sE,s8 as eR,s9 as Hv,sa as Ko,sb as tR,sc as iR,sd as Yc,se as xd,sf as sR,sg as oE,sh as oR,eE as zv,si as nR,eG as rR,eH as aR,sj as dR,eV as cR,sk as Qp,sl as eg,sm as tg,sn as lR,so as hR,sp as uR,sq as pR,sr as gR,ss as fR,st as Yw,su as mR,sv as $v,sw as wR,sx as qv,sy as nE,sz as rE,sA as bR,sB as vR,sC as yR,sD as CR,sE as SR,fz as ER,sF as _R,sG as aE,sH as IR,sI as DR,sJ as AR,sK as TR,sL as kR,sM as xR,sN as RR,sO as Xc,fK as LR}from"./index-GPQU4rv1.js";import{A as VR,r as wt,S as po,f as dE,U as Gs,B as cE,F as Ba,T as PR}from"./fileCommands._save-BslznhnO.js";import{I as OR}from"./workbenchThemeService.service-DlXrxy4t.js";const MR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),NR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));let ig=class extends H_{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(z_),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 $_&&s.item.submenu===tw);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 go,...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()}};ig=_([u(1,rt),u(2,pe),u(3,K),u(4,me),u(5,bt),u(6,Qt),u(7,fi)],ig);class Xw extends U_{static create(e,t,i,s,o,n,r){return new Xw(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 Ps={Viewlets:"workbench.contributions.viewlets",Panels:"workbench.contributions.panels",Auxiliary:"workbench.contributions.auxiliary"};class Jw extends q_{registerPaneComposite(e){super.registerComposite(e)}deregisterPaneComposite(e){super.deregisterComposite(e)}getPaneComposite(e){return this.getComposite(e)}getPaneComposites(){return this.getComposites()}}ie.add(Ps.Viewlets,new Jw);ie.add(Ps.Panels,new Jw);ie.add(Ps.Auxiliary,new Jw);const FR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(FR);class BR extends Wy{constructor(e,t,i,s,o,n,r,d,l,h,p,g,f,w,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=g,this.compositeCSSClass=f,this.titleForegroundColor=w,this.titleBorderColor=v,this.onDidCompositeOpen=this._register(new A),this.onDidCompositeClose=this._register(new A),this.mapCompositeToCompositeContainer=new Map,this.mapActionsBindingToComposite=new Map,this.instantiatedCompositeItems=new Map,this.actionsListener=this._register(new ke),this.lastActiveCompositeId=t.get(h,te.WORKSPACE,this.defaultCompositeId),this.toolbarHoverDelegate=this._register(j_())}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=Y_.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 X_(ge(this.progressBar),new class extends J_{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 fr([iw,n]))),d=s.instantiate(r),l=new F;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,te.WORKSPACE,Ze.MACHINE):this.storageService.remove(this.activeCompositeSettingsKey,te.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),Ra(i);const o=ge(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&&!$a(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),ge(this.toolBar).setAriaLabel(c(2953,"{0} actions",t))}collectCompositeActions(e){const t=e?.getMenuIds(),i=e?.getActions().slice(0)||[],s=e?.getSecondaryActions().slice(0)||[],o=ge(this.toolBar);return o.context=this.actionsContextProvider(),()=>o.setActions(hl(i),hl(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(),mr(t)),this.progressBar?.stop().hide(),this.toolBar&&this.collectCompositeActions()(),this.onDidCompositeClose.fire(e),e}createTitleArea(e){const t=ye(e,M(".composite"));t.classList.add("title"),this.titleLabel=this.createTitleLabel(t);const i=ye(t,M(".title-actions"));return this.toolBar=this._register(this.instantiationService.createInstance(Ky,i,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Ar.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(2954,"Views and More Actions..."),telemetrySource:this.nameForTelemetry,hoverDelegate:this.toolbarHoverDelegate})),this.collectCompositeActions()(),t}createTitleLabel(e){const t=ye(e,M(".title-label")),i=ye(t,M("h2"));this.titleLabelElement=i;const s=this._register(this.hoverService.setupManagedHover(bc("mouse"),i,"")),o=this;return{updateTitle:(n,r,d)=>{(!this.activeComposite||this.activeComposite.getId()===n)&&(i.innerText=r,s.update(d?c(2955,"{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(),ge(this.titleLabel).updateStyles()}actionViewItemProvider(e,t){return this.activeComposite?this.activeComposite.getActionViewItem(e,t):du(this.instantiationService,e,t)}actionsContextProvider(){return this.activeComposite?this.activeComposite.getActionsContext():null}createContentArea(e){const t=ye(e,M(".content"));return this.progressBar=this._register(new Uy(t,Hy)),this.progressBar.hide(),t}getProgressIndicator(e){const t=this.instantiatedCompositeItems.get(e);return t?t.progress:void 0}getTitleAreaDropDownAnchorAlignment(){return ul.RIGHT}layout(e,t,i,s){super.layout(e,t,i,s),this.contentAreaSize=Ne.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(),qe(t.disposable),this.instantiatedCompositeItems.delete(e)),!0}dispose(){this.mapCompositeToCompositeContainer.clear(),this.mapActionsBindingToComposite.clear(),this.instantiatedCompositeItems.forEach(e=>{e.composite.dispose(),qe(e.disposable)}),this.instantiatedCompositeItems.clear(),super.dispose()}}var sg;Te(NR);var Re;(function(a){a[a.TOP=0]="TOP",a[a.TITLE=1]="TITLE",a[a.BOTTOM=2]="BOTTOM"})(Re||(Re={}));var Nn;let Jd=(Nn=class extends BR{get snap(){return this.layoutService.isVisible(this.partId)||!!this.paneCompositeBar.value?.getVisiblePaneCompositeIds().length}get onDidPaneCompositeOpen(){return W.map(this.onDidCompositeOpen.event,e=>e.composite)}constructor(e,t,i,s,o,n,r,d,l,h,p,g,f,w,v,C,T,G,B,X,Z){let j=ae.Sidebar,Q=Ps.Viewlets,q=b.SidebarTitle;e===H.PANEL_PART?(j=ae.Panel,Q=Ps.Panels,q=b.PanelTitle):e===H.AUXILIARYBAR_PART&&(j=ae.AuxiliaryBar,Q=Ps.Auxiliary,q=b.AuxiliaryBarTitle),super(h,p,g,f,w,v,C,T,ie.as(Q),i,G.getDefaultViewContainer(j)?.id||"",n,r,d,l,e,t),this.partId=e,this.activePaneContextKey=s,this.paneFocusContextKey=o,this.viewDescriptorService=G,this.contextKeyService=B,this.extensionService=X,this.menuService=Z,this.onDidPaneCompositeClose=this.onDidCompositeClose.event,this.headerFooterCompositeBarDispoables=this._register(new F),this.paneCompositeBar=this._register(new ke),this.compositeBarPosition=void 0,this.blockOpening=void 0,this.location=j,this.globalActionsMenuId=q,this.registerListeners()}registerListeners(){this._register(this.onDidPaneCompositeOpen(e=>this.onDidOpen(e))),this._register(this.onDidPaneCompositeClose(this.onDidClose,this)),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(fo(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(3493,"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(sw)?.toString()||"";this.titleContainer&&o&&(this.titleContainer.style.backgroundColor=n),this.headerFooterCompositeBarContainer&&o&&(this.headerFooterCompositeBarContainer.style.backgroundColor=n),this.emptyPaneMessageElement.style.backgroundColor=n};this._register(pl.INSTANCE.registerTarget(this.element,{onDragOver:s=>{if(be.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);Z_(s.eventData.dataTransfer,"move",o)}},onDragEnter:s=>{if(be.stop(s.eventData,!0),this.paneCompositeBar.value){const o=this.paneCompositeBar.value.dndHandler.onDragEnter(s.dragAndDropData,void 0,s.eventData);i(o)}},onDragLeave:s=>{be.stop(s.eventData,!0),i(!1)},onDragEnd:s=>{be.stop(s.eventData,!0),i(!1)},onDrop:s=>{if(be.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(z(t,ee.CONTEXT_MENU,s=>{this.onTitleAreaContextMenu(new Vo(Ue(t),s))})),this._register(qd.addTarget(t)),this._register(z(t,Ni.Contextmenu,s=>{this.onTitleAreaContextMenu(new Vo(Ue(t),s))}));const i=t.appendChild(M(".global-actions"));return this.globalToolBar=this._register(this.instantiationService.createInstance(zy,i,this.globalActionsMenuId,{actionViewItemProvider:(s,o)=>this.actionViewItemProvider(s,o),orientation:Ar.HORIZONTAL,getKeyBinding:s=>this.keybindingService.lookupKeybinding(s.id),anchorAlignmentProvider:()=>this.getTitleAreaDropDownAnchorAlignment(),toggleMenuTitle:c(3494,"More Actions..."),hoverDelegate:this.toolbarHoverDelegate,hiddenItemStrategy:Q_.NoHide,highlightToggledItems:!0,telemetrySource:this.nameForTelemetry,toolbarOptions:{forceLeadingSeparatorInPrimaryActions:!0}})),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(pl.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===Re.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===Re.TOP?this.removeFooterHeaderArea(!0):s===Re.BOTTOM&&this.removeFooterHeaderArea(!1)}let n;switch(o){case Re.TOP:n=this.createHeaderArea();break;case Re.TITLE:n=this.titleContainer;break;case Re.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=$y(n,M(".composite-bar-container")),this.paneCompositeBar.value=this.createCompositeBar(),this.paneCompositeBar.value.create(this.paneCompositeBarContainer),o===Re.TOP?this.setHeaderArea(n):o===Re.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(z(e,ee.CONTEXT_MENU,t=>{this.onCompositeBarAreaContextMenu(new Vo(Ue(e),t))})),this.headerFooterCompositeBarDispoables.add(qd.addTarget(e)),this.headerFooterCompositeBarDispoables.add(z(e,Ni.Contextmenu,t=>{this.onCompositeBarAreaContextMenu(new Vo(Ue(e),t))})),e}removeFooterHeaderArea(e){this.headerFooterCompositeBarContainer=void 0,this.headerFooterCompositeBarDispoables.clear(),e?this.removeHeaderArea():this.removeFooterArea()}createCompositeBar(){return this.instantiationService.createInstance(eI,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 tn,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 Ne(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===Re.TITLE?16:8,t=this.partId===H.PANEL_PART?0:1;let i=this.contentDimension.width-e-t;i=Math.max(sg.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("","")}getToolbarWidth(){if(!this.toolBar||this.compositeBarPosition!==Re.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()===Re.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 F,i=t.add(this.contextKeyService.createScoped(this.element));i.createKey("viewContainer",e.viewContainer.id);const s=this.menuService.getMenuActions(tw,i,{shouldForwardArgs:!0,renderShortTitle:!0}),o=Tp(s,()=>!0).primary;return t.dispose(),o.length>1&&o.some(n=>n.enabled)?new gl("views",c(3495,"Views"),o):void 0}}},sg=Nn,Nn.MIN_COMPOSITE_BAR_WIDTH=50,Nn);Jd=sg=_([u(9,Qe),u(10,pe),u(11,bt),u(12,st),u(13,ot),u(14,ei),u(15,K),u(16,me),u(17,_t),u(18,re),u(19,Qt),u(20,Ks)],Jd);var Gr;Te(MR);var As;let og=(As=class extends Jd{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,g,f,w){super(H.AUXILIARYBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(fl)||this.getColor(zi)?1:0},Gr.activeViewSettingsKey,tI.bindTo(h),iI.bindTo(h),"auxiliarybar","auxiliarybar",void 0,qy,e,t,i,s,o,n,r,d,l,h,p,f),this.commandService=g,this.configurationService=w,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Ds.Low,this.configuration=this.resolveConfiguration(),this._register(w.onDidChangeConfiguration(v=>{v.affectsConfiguration(vi.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(vi.ACTIVITY_BAR_LOCATION),t=e!==dt.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=ge(this.getContainer());e.style.backgroundColor=this.getColor(ra)||"";const t=this.getColor(fl)||this.getColor(zi),i=this.layoutService.getSideBarPosition()===di.RIGHT;e.style.color=this.getColor(jy)||"",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:Gr.pinnedViewsKey,placeholderViewContainersKey:Gr.placeholdeViewContainersKey,viewContainersWorkspaceStateKey:Gr.viewContainersWorkspaceStateKey,icon:!this.configuration.showLabels,orientation:Ar.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===Re.BOTTOM?La.ABOVE:La.BELOW},fillExtraContextMenuActions:t=>this.fillExtraContextMenuActions(t),compositeSize:0,iconSize:16,get overflowActionSize(){return e.getCompositeBarPosition()===Re.TITLE?40:30},colors:t=>({activeBackgroundColor:t.getColor(ra),inactiveBackgroundColor:t.getColor(ra),get activeBorderBottomColor(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(sC):t.getColor(oC)},get activeForegroundColor(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(tC):t.getColor(iC)},get inactiveForegroundColor(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(Qy):t.getColor(eC)},badgeBackground:t.getColor(Zy),badgeForeground:t.getColor(Jy),get dragAndDropBorder(){return e.getCompositeBarPosition()===Re.TITLE?t.getColor(Yy):t.getColor(Xy)}}),compact:!0}}fillExtraContextMenuActions(e){const t=this.layoutService.getSideBarPosition()===di.LEFT;if(this.getCompositeBarPosition()===Re.TITLE){const n=this.getViewsSubmenuAction();n&&(e.push(new go),e.push(n))}const i=this.menuService.getMenuActions(b.ActivityBarPositionMenu,this.contextKeyService,{shouldForwardArgs:!0,renderShortTitle:!0}),s=ml(i).secondary,o=lo({id:"workbench.action.auxiliarybar.toggleShowLabels",label:this.configuration.showLabels?c(2935,"Show Icons"):c(2936,"Show Labels"),enabled:this.configuration.canShowLabels,run:()=>this.configurationService.updateValue("workbench.secondarySideBar.showLabels",!this.configuration.showLabels)});e.push(new go,new gl("workbench.action.panel.position",c(2937,"Activity Bar Position"),s),lo({id:Lb.ID,label:t?c(2938,"Move Secondary Side Bar Left"):c(2939,"Move Secondary Side Bar Right"),run:()=>this.commandService.executeCommand(Lb.ID)}),o,lo({id:Vb.ID,label:c(2940,"Hide Secondary Side Bar"),run:()=>this.commandService.executeCommand(Vb.ID)}))}shouldShowCompositeBar(){return this.configuration.position!==dt.HIDDEN}getCompositeBarPosition(){switch(this.configuration.position){case dt.TOP:return Re.TOP;case dt.BOTTOM:return Re.BOTTOM;case dt.HIDDEN:return Re.TITLE;case dt.DEFAULT:return Re.TITLE;default:return Re.TITLE}}toJSON(){return{type:H.AUXILIARYBAR_PART}}},Gr=As,As.activeViewSettingsKey="workbench.auxiliarybar.activepanelid",As.pinnedViewsKey="workbench.auxiliarybar.pinnedPanels",As.placeholdeViewContainersKey="workbench.auxiliarybar.placeholderPanels",As.viewContainersWorkspaceStateKey="workbench.auxiliarybar.viewContainersWorkspaceState",As);og=Gr=_([u(0,Qe),u(1,pe),u(2,bt),u(3,st),u(4,ot),u(5,ei),u(6,K),u(7,me),u(8,_t),u(9,re),u(10,Qt),u(11,Xe),u(12,Ks),u(13,se)],og);const lE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(lE);const GR={separatorBorder:Ii.transparent};function Ls(a){return a===de.VERTICAL?de.HORIZONTAL:de.VERTICAL}class WR{constructor(e){this.isLayoutEnabled=e}}function KR(a,e){return e===de.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 UR(a,e){return e===de.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 Qi(a,e){if(Math.abs(a)>e)throw new Error("Invalid index");return sI(a,e+1)}class je{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===de.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===de.HORIZONTAL?this.orthogonalSize:this.size}get top(){return this.orientation===de.HORIZONTAL?this._absoluteOffset:this._absoluteOrthogonalOffset}get left(){return this.orientation===de.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 Ds.Normal;const e=this.children.map(t=>typeof t.priority>"u"?Ds.Normal:t.priority);return e.some(t=>t===Ds.High)?Ds.High:e.some(t=>t===Ds.Low)?Ds.Low:Ds.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===de.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===de.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===de.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===de.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 je&&(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 A,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new A,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this.childrenVisibilityChangeDisposable=new F,this._onDidScroll=new A,this.onDidScrollDisposable=N.None,this.onDidScroll=this._onDidScroll.event,this.childrenChangeDisposable=N.None,this._onDidSashReset=new A,this.onDidSashReset=this._onDidSashReset.event,this.splitviewSashResetDisposable=N.None,this.childrenSashResetDisposable=N.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 jd(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(g=>({view:g.node,size:g.node.size,visible:g.visible!==!1})),size:this.orthogonalSize},p={proportionalLayout:s,orientation:e,styles:i};this.children=d.map(g=>g.node),this.splitview=new jd(this.element,{...p,descriptor:h}),this.children.forEach((g,f)=>{const w=f===0,v=f===this.children.length;g.boundarySashes={start:this.boundarySashes.orthogonalStart,end:this.boundarySashes.orthogonalEnd,orthogonalStart:w?this.boundarySashes.start:this.splitview.sashes[f-1],orthogonalEnd:v?this.boundarySashes.end:this.splitview.sashes[f]}})}const l=W.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 je&&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=Qi(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=Qi(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=Qi(e,this.children.length),t=Qi(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=Qi(e,this.children.length),t=Qi(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=Qi(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 je&&t.distributeViewSizes(!0)}getChildSize(e){return e=Qi(e,this.children.length),this.splitview.getViewSize(e)}isChildVisible(e){return e=Qi(e,this.children.length),this.splitview.isViewVisible(e)}setChildVisible(e,t){if(e=Qi(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=Qi(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=W.map(W.any(...this.children.map(s=>s.onDidChange)),()=>{});this.childrenChangeDisposable.dispose(),this.childrenChangeDisposable=e(this._onDidChange.fire,this._onDidChange);const t=W.any(...this.children.map((s,o)=>W.map(s.onDidSashReset,n=>[o,...n])));this.childrenSashResetDisposable.dispose(),this.childrenSashResetDisposable=t(this._onDidSashReset.fire,this._onDidSashReset);const i=W.any(W.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 je&&this.childrenVisibilityChangeDisposable.add(s.onDidVisibilityChange(n=>{this.setChildVisible(o,n)}))})}trySet2x2(e){if(this.children.length!==2||e.children.length!==2)return N.None;if(this.getChildSize(0)!==e.getChildSize(0))return N.None;const[t,i]=this.children,[s,o]=e.children;if(!(t instanceof pt)||!(i instanceof pt))return N.None;if(!(s instanceof pt)||!(o instanceof pt))return N.None;this.orientation===de.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),he(()=>{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 HR(a){const[e,t]=W.split(a.onDidChange,An);return W.any(t,W.map(W.latch(W.map(e,i=>[a.minimumWidth,a.maximumWidth,a.minimumHeight,a.maximumHeight]),wr),i=>{}))}class pt{get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}get linkedWidthNode(){return this._linkedWidthNode}set linkedWidthNode(e){this._onDidLinkedWidthNodeChange.input=e?e._onDidViewChange:W.None,this._linkedWidthNode=e,this._onDidSetLinkedNode.fire(void 0)}get linkedHeightNode(){return this._linkedHeightNode}set linkedHeightNode(e){this._onDidLinkedHeightNodeChange.input=e?e._onDidViewChange:W.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=W.None,this.onDidSashReset=W.None,this._onDidLinkedWidthNodeChange=new ho,this._linkedWidthNode=void 0,this._onDidLinkedHeightNodeChange=new ho,this._linkedHeightNode=void 0,this._onDidSetLinkedNode=new A,this.disposables=new F,this._boundarySashes={},this.cachedWidth=0,this.cachedHeight=0,this.cachedTop=0,this.cachedLeft=0,this._orthogonalSize=s,this._size=o;const n=HR(e);this._onDidViewChange=W.map(n,r=>r&&(this.orientation===de.VERTICAL?r.width:r.height),this.disposables),this.onDidChange=W.any(this._onDidViewChange,this._onDidSetLinkedNode.event,this._onDidLinkedWidthNodeChange.event,this._onDidLinkedHeightNodeChange.event)}get width(){return this.orientation===de.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===de.HORIZONTAL?this.size:this.orthogonalSize}get top(){return this.orientation===de.HORIZONTAL?this.absoluteOffset:this.absoluteOrthogonalOffset}get left(){return this.orientation===de.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===de.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===de.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===de.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===de.HORIZONTAL?this.maximumWidth:this.maximumHeight}get boundarySashes(){return this._boundarySashes}set boundarySashes(e){this._boundarySashes=e,this.view.setBoundarySashes?.(KR(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 hE(a,e,t){if(a instanceof je){const i=new je(Ls(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 je?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(hE(n,t,d),d,0,!0)}return a.dispose(),i}else{const i=new pt(a.view,Ls(a.orientation),a.layoutController,t);return a.dispose(),i}}class ha{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=W.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=hE(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=UR(e,this.orientation)}set edgeSnapping(e){this.root.edgeSnapping=e}constructor(e={}){this.onDidSashResetRelay=new ho,this._onDidScroll=new ho,this._onDidChange=new ho,this._boundarySashes={},this.disposable2x2=N.None,this.onDidSashReset=this.onDidSashResetRelay.event,this.onDidScroll=this._onDidScroll.event,this.onDidChange=this._onDidChange.event,this.maximizedNode=void 0,this._onDidChangeViewMaximized=new A,this.onDidChangeViewMaximized=this._onDidChangeViewMaximized.event,this.element=M(".monaco-grid-view"),this.styles=e.styles||GR,this.proportionalLayout=typeof e.proportionalLayout<"u"?!!e.proportionalLayout:!0,this.layoutController=new WR(!1),this.root=new je(de.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===de.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=N.None;const[s,o]=ct(i),[n,r]=this.getNode(s);if(r instanceof je){const d=new pt(e,Ls(r.orientation),this.layoutController,r.orthogonalSize);try{r.addChild(d,t,o)}catch(l){throw d.dispose(),l}}else{const[,d]=ct(n),[,l]=ct(s);let h=0;const p=d.getChildCachedVisibleSize(l);typeof p=="number"&&(h=Ei.Invisible(p)),d.removeChild(l).dispose();const f=new je(r.orientation,r.layoutController,this.styles,this.proportionalLayout,r.size,r.orthogonalSize,d.edgeSnapping);d.addChild(f,r.size,l);const w=new pt(r.view,d.orientation,this.layoutController,r.size);f.addChild(w,h,0),typeof t!="number"&&t.type==="split"&&(t=Ei.Split(0));const v=new pt(e,d.orientation,this.layoutController,r.size);f.addChild(v,t,o)}this.trySet2x2()}removeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView(),this.disposable2x2.dispose(),this.disposable2x2=N.None;const[i,s]=ct(e),[o,n]=this.getNode(i);if(!(n instanceof je))throw new Error("Invalid location");const r=n.children[s];if(!(r instanceof pt))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 f=n.children[0];return f instanceof pt||(n.removeChild(0),n.dispose(),this.root=f,this.boundarySashes=this.boundarySashes,this.trySet2x2()),r.view}const[,d]=ct(o),[,l]=ct(i),h=n.isChildVisible(0),p=n.removeChild(0),g=d.children.map((f,w)=>d.getChildSize(w));if(d.removeChild(l,t),n.dispose(),p instanceof je){g.splice(l,1,...p.children.map(w=>w.size));const f=p.removeAllChildren();for(let w=0;w<f.length;w++)d.addChild(f[w],f[w].size,l+w)}else{const f=new pt(p.view,Ls(p.orientation),this.layoutController,p.size),w=h?p.orthogonalSize:Ei.Invisible(p.orthogonalSize);d.addChild(f,w,l)}p.dispose();for(let f=0;f<g.length;f++)d.resizeChild(f,g[f]);return this.trySet2x2(),r.view}moveView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,s]=this.getNode(e);if(!(s instanceof je))throw new Error("Invalid location");s.moveChild(t,i),this.trySet2x2()}swapViews(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=ct(e),[,o]=this.getNode(i);if(!(o instanceof je))throw new Error("Invalid from location");const n=o.getChildSize(s),r=o.children[s];if(!(r instanceof pt))throw new Error("Invalid from location");const[d,l]=ct(t),[,h]=this.getNode(d);if(!(h instanceof je))throw new Error("Invalid to location");const p=h.getChildSize(l),g=h.children[l];if(!(g instanceof pt))throw new Error("Invalid to location");o===h?o.swapChildren(s,l):(o.removeChild(s),h.removeChild(l),o.addChild(g,n,s),h.addChild(r,p,l)),this.trySet2x2()}resizeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,s]=ct(e),[o,n]=this.getNode(i);if(!(n instanceof je))throw new Error("Invalid location");if(!t.width&&!t.height)return;const[r,d]=n.orientation===de.HORIZONTAL?[t.width,t.height]:[t.height,t.width];if(typeof d=="number"&&o.length>0){const[,l]=ct(o),[,h]=ct(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]=ct(e),[,s]=this.getNode(t);if(!(s instanceof je))throw new Error("Invalid location");return s.getChildCachedVisibleSize(i)}expandView(e){this.hasMaximizedView()&&this.exitMaximizedView();const[t,i]=this.getNode(e);if(!(i instanceof pt))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 pt))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 pt))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 pt?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 pt?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 pt))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 je))throw new Error("Invalid location");t.distributeViewSizes(),this.trySet2x2()}isViewVisible(e){const[t,i]=ct(e),[,s]=this.getNode(t);if(!(s instanceof je))throw new Error("Invalid from location");return s.isChildVisible(i)}setViewVisible(e,t){if(this.hasMaximizedView()){this.exitMaximizedView();return}const[i,s]=ct(e),[,o]=this.getNode(i);if(!(o instanceof je))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 ha(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,Ls(t),i,e.size),visible:d.visible}));o=new je(t,this.layoutController,this.styles,this.proportionalLayout,e.size,s,void 0,r)}else o=new pt(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 pt)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,Ls(t),d))}return{children:o,box:s}}getNode(e,t=this.root,i=[]){if(e.length===0)return[i,t];if(!(t instanceof je))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=N.None,this.root.children.length!==2)return;const[e,t]=this.root.children;!(e instanceof je)||!(t instanceof je)||(this.disposable2x2=e.trySet2x2(t))}getViewMap(e,t){t||(t=this.root),t instanceof je?t.children.forEach(i=>this.getViewMap(e,i)):e.set(t.view,t.element)}dispose(){this.onDidSashResetRelay.dispose(),this.root.dispose(),this.element.remove()}}Te(lE);var Ee;(function(a){a[a.Up=0]="Up",a[a.Down=1]="Down",a[a.Left=2]="Left",a[a.Right=3]="Right"})(Ee||(Ee={}));function zR(a){switch(a){case Ee.Up:return Ee.Down;case Ee.Down:return Ee.Up;case Ee.Left:return Ee.Right;case Ee.Right:return Ee.Left}}function Vn(a){return!!a.children}function uE(a,e){if(e.length===0)return a;if(!Vn(a))throw new Error("Invalid location");const[t,...i]=e;return uE(a.children[t],i)}function $R(a,e){return!(a.start>=e.end||e.start>=a.end)}function pE(a,e){const t=Zw(e),i=e===Ee.Up?a.top:e===Ee.Right?a.left+a.width:e===Ee.Down?a.top+a.height:a.left,s={start:t===de.HORIZONTAL?a.top:a.left,end:t===de.HORIZONTAL?a.top+a.height:a.left+a.width};return{offset:i,range:s}}function qR(a,e,t){const i=[];function s(o,n,r){if(Vn(o))for(const d of o.children)s(d,n,r);else{const{offset:d,range:l}=pE(o.box,n);d===r.offset&&$R(l,r.range)&&i.push(o)}}return s(a,e,t),i}function ng(a,e){return e.length%2===0?Ls(a):a}function Zw(a){return a===Ee.Up||a===Ee.Down?de.VERTICAL:de.HORIZONTAL}function jv(a,e,t){const i=ng(a,e),s=Zw(t);if(i===s){let[o,n]=ct(e);return(t===Ee.Right||t===Ee.Down)&&(n+=1),[...o,n]}else{const o=t===Ee.Right||t===Ee.Down?1:0;return[...e,o]}}function jR(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 gE(a){const e=a.parentElement;if(!e)throw new Error("Invalid grid element");if(/\bmonaco-grid-view\b/.test(e.className))return[];const t=jR(e),i=e.parentElement.parentElement.parentElement.parentElement;return[...gE(i),t]}var ua;(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})(ua||(ua={}));class YR extends N{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 ha?(this.gridview=e,this.gridview.getViewMap(this.views)):this.gridview=new ha(t),this._register(this.gridview),this._register(this.gridview.onDidSashReset(this.onDidSashReset,this)),e instanceof ha||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=Zw(s);this.views.size===1&&this.orientation!==o&&(this.orientation=o);const n=this.getViewLocation(i),r=jv(this.gridview.orientation,n,s);let d;if(typeof t=="number")d=t;else if(t.type==="split"){const[,l]=ct(n);d=Ei.Split(l)}else if(t.type==="distribute")d=Ei.Distribute;else if(t.type==="auto"){const[,l]=ct(n);d=Ei.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=Ei.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=Ei.Distribute;else if(t?.type==="auto"){const o=i[i.length-1];s=Ei.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]=ct(o),d=this.getViewLocation(i),l=jv(this.gridview.orientation,d,s),[h,p]=ct(l);wr(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]=ct(i),[n,r]=ct(t);if(wr(s,n))this.gridview.moveView(s,o,r);else{const d=this.getViewSize(e),l=ng(this.gridview.orientation,i),h=this.getViewCachedVisibleSize(e),p=typeof h>"u"?l===de.HORIZONTAL?d.width:d.height:ua.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=uE(o,s);let r=pE(n.box,t);return i&&(t===Ee.Up&&n.box.top===0?r={offset:o.box.top+o.box.height,range:r.range}:t===Ee.Right&&n.box.left+n.box.width===o.box.width?r={offset:0,range:r.range}:t===Ee.Down&&n.box.top+n.box.height===o.box.height?r={offset:0,range:r.range}:t===Ee.Left&&n.box.left===0&&(r={offset:o.box.left+o.box.width,range:r.range})),qR(o,zR(t),r).map(d=>d.view)}getViewLocation(e){const t=this.views.get(e);if(!t)throw new Error("View not found");return gE(t)}onDidSashReset(e){const t=o=>{const n=this.gridview.getView(o);if(Vn(n))return!1;const r=ng(this.orientation,o),d=r===de.HORIZONTAL?n.view.preferredWidth:n.view.preferredHeight;if(typeof d!="number")return!1;const l=r===de.HORIZONTAL?{width:Math.round(d)}:{height:Math.round(d)};return this.gridview.resizeView(o,l),!0};if(t(e))return;const[i,s]=ct(e);t([...i,s+1])||this.gridview.distributeViewSizes(i)}}class Bo extends YR{constructor(){super(...arguments),this.initialLayoutContext=!0}static serializeNode(e,t){const i=t===de.VERTICAL?e.box.width:e.box.height;if(!Vn(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=>Bo.serializeNode(o,Ls(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=ha.deserialize(e,t,i);return new Bo(s,i)}static from(e,t={}){return Bo.deserialize(vE(e),{fromJSON:i=>i},t)}serialize(){return{root:Bo.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 fE(a){return!!a.groups}function mE(a,e){if(!e&&a.groups&&a.groups.length<=1&&(a.groups=void 0),!fE(a))return;let t=0,i=0;for(const r of a.groups)mE(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 wE(a){return fE(a)?{type:"branch",data:a.groups.map(e=>wE(e)),size:a.size}:{type:"leaf",data:a.data,size:a.size}}function bE(a,e){if(a.type==="branch"){const t=a.data.map(i=>bE(i,Ls(e)));if(e===de.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===de.VERTICAL?a.size:void 0,i=e===de.VERTICAL?void 0:a.size;return{width:t,height:i}}}function vE(a){mE(a,!0);const e=wE(a),{width:t,height:i}=bE(e,a.orientation);return{root:e,orientation:a.orientation,width:t||1,height:i||1}}const XR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),JR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class ZR{constructor(e){this._container=e}set text(e){cs(this._container,...ls(e??""))}set title(e){!this.hover&&e?this.hover=oI().setupManagedHover(bc("mouse"),this._container,e):this.hover&&this.hover.update(e)}dispose(){this.hover?.dispose()}}var rg,fd,ol;Te(JR);var Fn;let Zd=(Fn=class extends ow{constructor(e,t,i,s,o){super(e,t,i,s,o),this.inputDisposable=this._register(new ke)}createEditor(e){this.container=M(".monaco-editor-pane-placeholder",{tabIndex:0}),this.container.style.outline="none",this.scrollbar=this._register(new rC(this.container,{horizontal:Va.Auto,vertical:Va.Auto})),e.appendChild(this.scrollbar.getDomNode())}async setInput(e,t,i,s){await super.setInput(e,t,i,s),!s.isCancellationRequested&&(this.inputDisposable.value=await this.renderInput(e,t))}async renderInput(e,t){const[i,s]=Po(this.container,this.scrollbar);Bt(i);const o=new F,{icon:n,label:r,actions:d}=await this.getContents(e,t,o),l=aI(r,rg.PLACEHOLDER_LABEL_MAX_LENGTH),h=i.appendChild(M(".editor-placeholder-icon-container")),p=o.add(new ZR(h));p.text=n;const g=i.appendChild(M(".editor-placeholder-label-container")),f=M("span");if(f.textContent=l,g.appendChild(f),i.setAttribute("aria-label",`${nw(e,void 0,this.group,void 0)}, ${l}`),d.length){const w=i.appendChild(M(".editor-placeholder-buttons-container")),v=o.add(new rw(w));for(let C=0;C<d.length;C++){const T=o.add(v.addButton({...Pa,secondary:C!==0}));T.label=d[C].label,o.add(T.onDidClick(G=>{G&&be.stop(G,!0),d[C].run()}))}}return s.scanDomNode(),o}clearInput(){this.container&&Bt(this.container),this.inputDisposable.clear(),super.clearInput()}layout(e){const[t,i]=Po(this.container,this.scrollbar);dI(t,e.width,e.height),i.scanDomNode(),t.classList.toggle("max-height-200px",e.height<=200)}focus(){super.focus(),this.container?.focus()}dispose(){this.container?.remove(),super.dispose()}},rg=Fn,Fn.PLACEHOLDER_LABEL_MAX_LENGTH=1024,Fn);Zd=rg=_([u(2,rt),u(3,me),u(4,pe)],Zd);var os;let ag=(os=class extends Zd{constructor(e,t,i,s,o,n){super(fd.ID,e,t,i,n),this.commandService=s,this.workspaceService=o}getTitle(){return fd.LABEL}async getContents(){return{icon:"$(workspace-untrusted)",label:nI(rI(this.workspaceService.getWorkspace()))?c(3334,"The file is not displayed in the editor because trust has not been granted to the folder."):c(3335,"The file is not displayed in the editor because trust has not been granted to the workspace."),actions:[{label:c(3336,"Manage Workspace Trust"),run:()=>this.commandService.executeCommand("workbench.trust.manage")}]}}},fd=os,os.ID="workbench.editors.workspaceTrustRequiredEditor",os.LABEL=c(3333,"Workspace Trust Required"),os.DESCRIPTOR=ki.create(fd,os.ID,os.LABEL),os);ag=fd=_([u(1,rt),u(2,me),u(3,Xe),u(4,fi),u(5,pe)],ag);var ns;let dg=(ns=class extends Zd{constructor(e,t,i,s,o,n){super(ol.ID,e,t,i,s),this.fileService=o,this.dialogService=n}async getContents(e,t,i){const s=e.resource,o=t.error,n=o?.fileOperationResult===ks.FILE_NOT_FOUND;let r;n?r=c(3338,"The editor could not be opened because the file was not found."):yd(o)&&o.forceMessage?r=o.message:o?r=c(3339,"The editor could not be opened due to an unexpected error. Please consult the log for more details."):r=c(3340,"The editor could not be opened due to an unexpected error.");let d="$(error)";yd(o)&&(o.forceSeverity===Ae.Info?d="$(info)":o.forceSeverity===Ae.Warning&&(d="$(warning)"));let l;return yd(o)&&o.actions.length>0?l=o.actions.map(h=>({label:h.label,run:()=>{const p=h.run();p instanceof Promise&&p.catch(g=>this.dialogService.error(wl(g)))}})):l=[{label:c(3341,"Try Again"),run:()=>this.group.openEditor(e,{...t,source:nC.USER})}],n&&s&&this.fileService.hasProvider(s)&&i.add(this.fileService.onDidFilesChange(h=>{h.contains(s,bl.ADDED,bl.UPDATED)&&this.group.openEditor(e,t)})),{icon:d,label:r,actions:l??[]}}},ol=ns,ns.ID="workbench.editors.errorEditor",ns.LABEL=c(3337,"Error Editor"),ns.DESCRIPTOR=ki.create(ol,ns.ID,ns.LABEL),ns);dg=ol=_([u(1,rt),u(2,me),u(3,pe),u(4,Ve),u(5,Ji)],dg);let cg=class extends N{get minimumWidth(){return this._activeEditorPane?.minimumWidth??vl.width}get minimumHeight(){return this._activeEditorPane?.minimumHeight??vl.height}get maximumWidth(){return this._activeEditorPane?.maximumWidth??yl.width}get maximumHeight(){return this._activeEditorPane?.maximumHeight??yl.height}get activeEditorPane(){return this._activeEditorPane}constructor(e,t,i,s,o,n,r,d,l,h){super(),this.editorGroupParent=e,this.editorPanesParent=t,this.groupView=i,this.layoutService=s,this.instantiationService=o,this.workspaceTrustService=r,this.logService=d,this.dialogService=l,this.hostService=h,this._onDidFocus=this._register(new A),this.onDidFocus=this._onDidFocus.event,this._onDidChangeSizeConstraints=this._register(new A),this.onDidChangeSizeConstraints=this._onDidChangeSizeConstraints.event,this._activeEditorPane=null,this.editorPanes=[],this.mapEditorPaneToPendingSetInput=new Map,this.activeEditorPaneDisposables=this._register(new F),this.editorPanesRegistry=ie.as(At.EditorPane),this.editorOperation=this._register(new cI(n)),this.registerListeners()}registerListeners(){this._register(this.workspaceTrustService.onDidChangeTrust(()=>this.onDidChangeWorkspaceTrust()))}onDidChangeWorkspaceTrust(){const e=this._activeEditorPane?.input,t=this._activeEditorPane?.options;e?.hasCapability($t.RequiresTrust)&&this.groupView.openEditor(e,t)}async openEditor(e,t,i,s=Object.create(null)){try{return await this.doOpenEditor(this.getEditorPaneDescriptor(e),e,t,i,s)}catch(o){return t?.ignoreError?{error:o}:this.doShowError(o,e,t,i,s)}}async doShowError(e,t,i,s,o){this.logService.error(e);let n=!1;if(i?.source===nC.USER&&(!yd(e)||e.allowDialog)&&(n=await this.doShowErrorDialog(e,t)),n)return{error:e};const r={...i};return $a(e)||(r.error=e),{...await this.doOpenEditor(dg.DESCRIPTOR,t,r,s,o),error:e}}async doShowErrorDialog(e,t){let i=Ae.Error,s,o=wl(e),n;yd(e)&&(n=e.actions,i=e.forceSeverity??Ae.Error,e.forceMessage&&(s=e.message,o=void 0)),s||(s=c(3330,"Unable to open '{0}'",t.getName()));const r=[];if(n&&n.length>0)for(const p of n)r.push({label:p.label,run:()=>p});else r.push({label:c(3331,"&&OK"),run:()=>{}});let d;r.length===1&&(d={run:()=>{l=!0}});let l=!1;const{result:h}=await this.dialogService.prompt({type:i,message:s,detail:o,buttons:r,cancelButton:d});if(h){const p=h.run();p instanceof Promise&&p.catch(g=>this.dialogService.error(wl(g))),l=!0}return l}async doOpenEditor(e,t,i,s,o=Object.create(null)){const n=this.doShowEditorPane(e),r=sn(),{changed:d,cancelled:l}=await this.doSetInput(n,t,i,o);return l||((!i||!i.preserveFocus)&&this.shouldRestoreFocus(r)?n.focus():s?.preserveWindowOrder||this.hostService.moveTop(vc(this.groupView.windowId,!0).window)),{pane:n,changed:d,cancelled:l}}shouldRestoreFocus(e){if(!this.layoutService.isRestored()||!e)return!0;const t=sn();return!!(!t||t===e.ownerDocument.body||e===t||!lI(t)||Oa(t,this.editorGroupParent))}getEditorPaneDescriptor(e){return e.hasCapability($t.RequiresTrust)&&!this.workspaceTrustService.isWorkspaceTrusted()?ag.DESCRIPTOR:ge(this.editorPanesRegistry.getEditorPane(e))}doShowEditorPane(e){if(this._activeEditorPane&&e.describes(this._activeEditorPane))return this._activeEditorPane;this.doHideActiveEditorPane();const t=this.doCreateEditorPane(e);this.doSetActiveEditorPane(t);const i=ge(t.getContainer());return this.editorPanesParent.appendChild(i),Ra(i),t.setVisible(!0),this.pagePosition&&t.layout(new Ne(this.pagePosition.width,this.pagePosition.height),{top:this.pagePosition.top,left:this.pagePosition.left}),this.boundarySashes&&t.setBoundarySashes(this.boundarySashes),t}doCreateEditorPane(e){const t=this.doInstantiateEditorPane(e);if(!t.getContainer()){const i=M(".editor-instance");this.editorPanesParent.appendChild(i);try{t.create(i)}catch(s){throw i.remove(),mr(i),s}}return t}doInstantiateEditorPane(e){const t=this.editorPanes.find(s=>e.describes(s));if(t)return t;const i=this._register(e.instantiate(this.instantiationService,this.groupView));return this.editorPanes.push(i),i}doSetActiveEditorPane(e){this._activeEditorPane=e,this.activeEditorPaneDisposables.clear(),e&&(this.activeEditorPaneDisposables.add(e.onDidChangeSizeConstraints(t=>this._onDidChangeSizeConstraints.fire(t))),this.activeEditorPaneDisposables.add(e.onDidFocus(()=>this._onDidFocus.fire()))),this._onDidChangeSizeConstraints.fire(void 0)}async doSetInput(e,t,i,s){let o=e.input?.matches(t);if(o&&!i?.forceReload)return this.mapEditorPaneToPendingSetInput.has(e)&&await this.mapEditorPaneToPendingSetInput.get(e),o=e.input?.matches(t),o&&e.setOptions(i),{changed:!1,cancelled:!o};const n=this.editorOperation.start(this.layoutService.isRestored()?800:3200);let r=!1;try{e.clearInput();const d=e.setInput(t,i,s,n.token);this.mapEditorPaneToPendingSetInput.set(e,d),await d,n.isCurrent()||(r=!0)}catch(d){if(!n.isCurrent())r=!0;else throw d}finally{n.isCurrent()&&this.mapEditorPaneToPendingSetInput.delete(e),n.stop()}return{changed:!o,cancelled:r}}doHideActiveEditorPane(){if(!this._activeEditorPane)return;this.editorOperation.stop(),this.safeRun(()=>this._activeEditorPane?.clearInput()),this.safeRun(()=>this._activeEditorPane?.setVisible(!1)),this.mapEditorPaneToPendingSetInput.delete(this._activeEditorPane);const e=this._activeEditorPane.getContainer();e&&(e.remove(),mr(e)),this.doSetActiveEditorPane(null)}closeEditor(e){this._activeEditorPane?.input&&e.matches(this._activeEditorPane.input)&&this.doHideActiveEditorPane()}setVisible(e){this.safeRun(()=>this._activeEditorPane?.setVisible(e))}layout(e){this.pagePosition=e,this.safeRun(()=>this._activeEditorPane?.layout(new Ne(e.width,e.height),e))}setBoundarySashes(e){this.boundarySashes=e,this.safeRun(()=>this._activeEditorPane?.setBoundarySashes(e))}safeRun(e){try{e()}catch(t){this.logService.error(t)}}};cg=_([u(3,st),u(4,K),u(5,iw),u(6,hI),u(7,it),u(8,Ji),u(9,Nt)],cg);var nl;const yE={text:c(3317,"Show All Commands"),id:"workbench.action.showCommands"},QR={text:c(3318,"Go to File"),id:"workbench.action.quickOpen"},eL={text:c(3319,"Open File"),id:"workbench.action.files.openFile"},tL={text:c(3320,"Open Folder"),id:"workbench.action.files.openFolder"},iL={text:c(3321,"Open File or Folder"),id:"workbench.action.files.openFileFolder"},sL={text:c(3322,"Open Recent"),id:"workbench.action.openRecent"},oL={text:c(3323,"New Untitled Text File"),id:"workbench.action.files.newUntitledFile"},nL={text:c(3324,"Find in Files"),id:"workbench.action.findInFiles"},rL={text:c(3325,"Toggle Terminal"),id:"workbench.action.terminal.toggleTerminal",when:{web:D.equals("terminalProcessSupported",!0)}},aL={text:c(3326,"Start Debugging"),id:"workbench.action.debug.start",when:{web:D.equals("terminalProcessSupported",!0)}},dL={text:c(3327,"Open Settings"),id:"workbench.action.openSettings"},Yv=D.and(D.equals("chatSetupHidden",!1),D.equals("chatSetupDisabled",!1)),CE={text:c(3328,"Open Chat"),id:"workbench.action.chat.open",when:{native:Yv,web:Yv}},Xv=xi([yE,...Ke&&!Wi?[iL]:[eL,tL],sL,Ke&&!Wi?oL:void 0,CE]),Jv=[],Zv=[yE,QR,CE],Qv=[nL,aL,rL,dL];var Bn;let lg=(Bn=class extends N{constructor(e,t,i,s,o,n){super(),this.keybindingService=t,this.contextService=i,this.contextKeyService=s,this.configurationService=o,this.storageService=n,this.transientDisposables=this._register(new F),this.keybindingLabels=this._register(new F),this.enabled=!1,this.cachedWhen=this.storageService.getObject(nl.CACHED_WHEN,te.PROFILE,Object.create(null)),this.workbenchState=this.contextService.getWorkbenchState();const r=Ct(".editor-group-watermark",[Ct(".letterpress"),Ct(".shortcuts@shortcuts")]);ye(e,r.root),this.shortcuts=r.shortcuts,this.registerListeners(),this.render()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.tips.enabled")&&this.enabled!==this.configurationService.getValue("workbench.tips.enabled")&&this.render()})),this._register(this.contextService.onDidChangeWorkbenchState(e=>{this.workbenchState!==e&&(this.workbenchState=e,this.render())})),this._register(this.storageService.onWillSaveState(e=>{if(e.reason===uI.SHUTDOWN){const t=[...Xv,...Jv,...Zv,...Qv];for(const i of t){const s=Wi?i.when?.web:i.when?.native;s&&(this.cachedWhen[i.id]=this.contextKeyService.contextMatchesRules(s))}this.storageService.store(nl.CACHED_WHEN,JSON.stringify(this.cachedWhen),te.PROFILE,Ze.MACHINE)}}))}render(){if(this.enabled=this.configurationService.getValue("workbench.tips.enabled"),Bt(this.shortcuts),this.transientDisposables.clear(),!this.enabled)return;const e=this.filterEntries(this.workbenchState!==Oo.EMPTY?Zv:Xv,!1),t=this.filterEntries(this.workbenchState!==Oo.EMPTY?Qv:Jv,!0).slice(0,Math.max(0,5-e.length)),i=[...e,...t],s=ye(this.shortcuts,M(".watermark-box")),o=()=>{Bt(s),this.keybindingLabels.clear();for(const n of i){const r=this.keybindingService.lookupKeybinding(n.id);if(!r)continue;const d=ye(s,M("dl")),l=ye(d,M("dt"));l.textContent=n.text;const h=ye(d,M("dd"));this.keybindingLabels.add(new kp(h,li,{renderUnboundKeybindings:!0,...xp})).set(r)}};o(),this.transientDisposables.add(this.keybindingService.onDidUpdateKeybindings(o))}filterEntries(e,t){const i=e.filter(s=>Wi&&!s.when?.web||!Wi&&!s.when?.native||this.cachedWhen[s.id]).filter(s=>!!fe.getCommand(s.id)).filter(s=>!!this.keybindingService.lookupKeybinding(s.id));return t&&pI(i),i}},nl=Bn,Bn.CACHED_WHEN="editorGroupWatermark.whenConditions",Bn);lg=nl=_([u(1,ot),u(2,fi),u(3,re),u(4,se),u(5,pe)],lg);Ce("editorWatermark.foreground",{dark:mo(Wc,.6),light:mo(Wc,.68),hcDark:Wc,hcLight:Wc},c(3329,"Foreground color for the labels in the editor watermark."));const cL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(lL);class Qw{}class hL{constructor(e,t,i,s){this._disposables=new F,this._onDidSelectItem=new A,this._onDidFocusItem=new A,this._onDidChangeFocus=new A,this.onDidSelectItem=this._onDidSelectItem.event,this.onDidFocusItem=this._onDidFocusItem.event,this.onDidChangeFocus=this._onDidChangeFocus.event,this._items=new Array,this._nodes=new Array,this._freeNodes=new Array,this._enabled=!0,this._focusedItemIdx=-1,this._selectedItemIdx=-1,this._domNode=we("div"),this._domNode.className="monaco-breadcrumbs",this._domNode.tabIndex=0,this._domNode.setAttribute("role","list"),this._scrollable=new rC(this._domNode,{vertical:Va.Hidden,horizontal:Va.Auto,horizontalScrollbarSize:t,useShadows:!1,scrollYToX:!0}),this._separatorIcon=i,this._disposables.add(this._scrollable),this._disposables.add(aw(this._domNode,"click",r=>this._onClick(r))),e.appendChild(this._scrollable.getDomNode());const o=dw(this._domNode);this._style(o,s);const n=fo(this._domNode);this._disposables.add(n),this._disposables.add(n.onDidBlur(r=>this._onDidChangeFocus.fire(!1))),this._disposables.add(n.onDidFocus(r=>this._onDidChangeFocus.fire(!0)))}setHorizontalScrollbarSize(e){this._scrollable.updateOptions({horizontalScrollbarSize:e})}dispose(){this._disposables.dispose(),this._pendingLayout?.dispose(),this._pendingDimLayout?.dispose(),this._onDidSelectItem.dispose(),this._onDidFocusItem.dispose(),this._onDidChangeFocus.dispose(),this._domNode.remove(),this._nodes.length=0,this._freeNodes.length=0}layout(e){e&&Ne.equals(e,this._dimension)||(e?(this._pendingDimLayout?.dispose(),this._pendingDimLayout=this._updateDimensions(e)):(this._pendingLayout?.dispose(),this._pendingLayout=this._updateScrollbar()))}_updateDimensions(e){const t=new F;return t.add(gI(Ue(this._domNode),()=>{this._dimension=e,this._domNode.style.width=`${e.width}px`,this._domNode.style.height=`${e.height}px`,t.add(this._updateScrollbar())})),t}_updateScrollbar(){return Pb(Ue(this._domNode),()=>{Pb(Ue(this._domNode),()=>{this._scrollable.setRevealOnScroll(!1),this._scrollable.scanDomNode(),this._scrollable.setRevealOnScroll(!0)})})}_style(e,t){let i="";t.breadcrumbsBackground&&(i+=`.monaco-breadcrumbs { background-color: ${t.breadcrumbsBackground}}`),t.breadcrumbsForeground&&(i+=`.monaco-breadcrumbs .monaco-breadcrumb-item { color: ${t.breadcrumbsForeground}}
|
|
3
3
|
`),t.breadcrumbsFocusForeground&&(i+=`.monaco-breadcrumbs .monaco-breadcrumb-item.focused { color: ${t.breadcrumbsFocusForeground}}
|
|
4
4
|
`),t.breadcrumbsFocusAndSelectionForeground&&(i+=`.monaco-breadcrumbs .monaco-breadcrumb-item.focused.selected { color: ${t.breadcrumbsFocusAndSelectionForeground}}
|
|
5
5
|
`),t.breadcrumbsHoverForeground&&(i+=`.monaco-breadcrumbs:not(.disabled ) .monaco-breadcrumb-item:hover:not(.focused):not(.selected) { color: ${t.breadcrumbsHoverForeground}}
|
|
@@ -122,7 +122,7 @@ import{gx as U_,gy as H_,gz as z_,e$ as $_,gA as tw,d5 as go,f as _,g as u,m as
|
|
|
122
122
|
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container${ce?".active":":not(.active)"} > .title .tabs-container > .tab.sizing-fixed${$e?".active":""}:not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after {
|
|
123
123
|
background: linear-gradient(to left, ${q}, transparent);
|
|
124
124
|
}
|
|
125
|
-
`,B=a.getColor(oD);if(B&&v&&C){const Q=B.flatten(v),q=B.flatten(C);e.addRule(G(Q,q,!0,!0))}const X=a.getColor(nD);if(X&&v&&C){const Q=X.flatten(v),q=X.flatten(C);e.addRule(G(Q,q,!1,!0))}const Z=a.getColor(rD);if(Z&&v&&C){const Q=Z.flatten(v),q=Z.flatten(C);e.addRule(G(Q,q,!0,!1))}const j=a.getColor(aD);if(j&&v&&C){const Q=j.flatten(v),q=j.flatten(C);e.addRule(G(Q,q,!1,!1))}}});const ZE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(ZE);class IP extends ic{constructor(){super(...arguments),this.activeLabel=Object.create(null)}get breadcrumbsControl(){return this.breadcrumbsControlFactory?.control}create(e){super.create(e);const t=this.titleContainer=e;t.draggable=!0,this.registerContainerListeners(t),this._register(qd.addTarget(t));const i=M(".label-container");return t.appendChild(i),this.editorLabel=this._register(this.instantiationService.createInstance(dD,i,{})).element,this._register(z(this.editorLabel.element,ee.CLICK,s=>this.onTitleLabelClick(s))),this.breadcrumbsControlFactory=this._register(this.instantiationService.createInstance(Gl,i,this.groupView,{showFileIcons:!1,showSymbolIcons:!0,showDecorationColors:!1,widgetStyles:{...uC,breadcrumbsBackground:Ii.transparent.toString()},showPlaceholder:!1,dragEditor:!0})),this._register(this.breadcrumbsControlFactory.onDidEnablementChange(()=>this.handleBreadcrumbsEnablementChange())),t.classList.toggle("breadcrumbs",!!this.breadcrumbsControl),this._register(he(()=>t.classList.remove("breadcrumbs"))),this.createEditorActionsToolBar(t,["title-actions"]),t}registerContainerListeners(e){let t,i=!1;this._register(new Yd(e,{onDragStart:s=>{i=this.onGroupDragStart(s,e)},onDrag:s=>{t=s},onDragEnd:s=>{this.onGroupDragEnd(s,t,e,i)}})),this._register(z(e,ee.DBLCLICK,s=>this.onTitleDoubleClick(s))),this._register(z(e,ee.AUXCLICK,s=>this.onTitleAuxClick(s))),this._register(z(e,Ni.Tap,s=>this.onTitleTap(s)));for(const s of[ee.CONTEXT_MENU,Ni.Contextmenu])this._register(z(e,s,o=>{this.tabsModel.activeEditor&&this.onTabContextMenu(this.tabsModel.activeEditor,o,e)}))}onTitleLabelClick(e){be.stop(e,!1),setTimeout(()=>this.quickInputService.quickAccess.show())}onTitleDoubleClick(e){be.stop(e),this.groupView.pinEditor()}onTitleAuxClick(e){e.button===1&&this.tabsModel.activeEditor&&(be.stop(e,!0),xC(this.tabsModel,this.tabsModel.activeEditor,RC.MOUSE,this.groupsView.partOptions)||this.groupView.closeEditor(this.tabsModel.activeEditor))}onTitleTap(e){const t=e.initialTarget;!Sr(t)||!this.editorLabel||!Oa(t,this.editorLabel.element)||setTimeout(()=>this.quickInputService.quickAccess.show(),50)}openEditor(e){return this.doHandleOpenEditor()}openEditors(e){return this.doHandleOpenEditor()}doHandleOpenEditor(){const e=this.ifActiveEditorChanged(()=>this.redraw());return e||this.ifActiveEditorPropertiesChanged(()=>this.redraw()),e}beforeCloseEditor(e){}closeEditor(e){this.ifActiveEditorChanged(()=>this.redraw())}closeEditors(e){this.ifActiveEditorChanged(()=>this.redraw())}moveEditor(e,t,i){this.ifActiveEditorChanged(()=>this.redraw())}pinEditor(e){this.ifEditorIsActive(e,()=>this.redraw())}stickEditor(e){}unstickEditor(e){}setActive(e){this.redraw()}updateEditorSelections(){}updateEditorLabel(e){this.ifEditorIsActive(e,()=>this.redraw())}updateEditorDirty(e){this.ifEditorIsActive(e,()=>{const t=ge(this.titleContainer);e.isDirty()&&!e.isSaving()?t.classList.add("dirty"):t.classList.remove("dirty")})}updateOptions(e,t){super.updateOptions(e,t),(e.labelFormat!==t.labelFormat||!mu(e.decorations,t.decorations))&&this.redraw()}updateStyles(){this.redraw()}handleBreadcrumbsEnablementChange(){ge(this.titleContainer).classList.toggle("breadcrumbs",!!this.breadcrumbsControl),this.redraw()}ifActiveEditorChanged(e){return!this.activeLabel.editor&&this.tabsModel.activeEditor||this.activeLabel.editor&&!this.tabsModel.activeEditor||!this.activeLabel.editor||!this.tabsModel.isActive(this.activeLabel.editor)?(e(),!0):!1}ifActiveEditorPropertiesChanged(e){!this.activeLabel.editor||!this.tabsModel.activeEditor||this.activeLabel.pinned!==this.tabsModel.isPinned(this.tabsModel.activeEditor)&&e()}ifEditorIsActive(e,t){this.tabsModel.isActive(e)&&t()}redraw(){const e=this.tabsModel.activeEditor??void 0,t=this.groupsView.partOptions,i=e?this.tabsModel.isPinned(e):!1,s=this.groupsView.activeGroup===this.groupView;this.activeLabel={editor:e,pinned:i},this.breadcrumbsControl&&(s?(this.breadcrumbsControl.update(),this.breadcrumbsControl.domNode.classList.toggle("preview",!i)):this.breadcrumbsControl.hide());const[o,n]=Po(this.titleContainer,this.editorLabel);if(!e)o.classList.remove("dirty"),n.clear(),this.clearEditorActionsToolbar();else{this.updateEditorDirty(e);const{labelFormat:r}=this.groupsView.partOptions;let d;this.breadcrumbsControl&&!this.breadcrumbsControl.isHidden()||r==="default"&&!s?d="":d=e.getDescription(this.getVerbosity(r))||"",n.setResource({resource:Ge.getOriginalUri(e,{supportSideBySide:xe.BOTH}),name:e.getName(),description:d},{title:this.getHoverTitle(e),italic:!i,extraClasses:["single-tab","title-label"].concat(e.getLabelExtraClasses()),fileDecorations:{colors:!!t.decorations?.colors,badges:!!t.decorations?.badges},icon:e.getIcon(),hideIcon:t.showIcons===!1}),s?o.style.color=this.getColor(cD)||"":o.style.color=this.getColor(lD)||"",this.updateEditorActionsToolbar()}}getVerbosity(e){switch(e){case"short":return ts.SHORT;case"long":return ts.LONG;default:return ts.MEDIUM}}prepareEditorActions(e){return this.groupsView.activeGroup===this.groupView?e:{primary:this.groupsView.partOptions.alwaysShowEditorActions?e.primary:e.primary.filter(i=>i.id===qs||i.id===od),secondary:e.secondary}}getHeight(){return this.tabHeight}layout(e){return this.breadcrumbsControl?.layout(void 0),new Ne(e.container.width,this.getHeight())}}let Fg=class extends N{constructor(e,t,i,s,o,n){super(),this.parent=e,this.groupsView=i,this.groupView=s,this.model=o,this.instantiationService=n;const r=this._register(new XE(this.model)),d=this._register(new JE(this.model));this.stickyEditorTabsControl=this._register(this.instantiationService.createInstance(nc,this.parent,t,this.groupsView,this.groupView,r)),this.unstickyEditorTabsControl=this._register(this.instantiationService.createInstance(nc,this.parent,t,this.groupsView,this.groupView,d)),this.handleTabBarsStateChange()}handleTabBarsStateChange(){this.activeControl=this.model.activeEditor?this.getEditorTabsController(this.model.activeEditor):void 0,this.handleTabBarsLayoutChange()}handleTabBarsLayoutChange(){if(this.groupView.count===0)return;const e=this.parent.classList.contains("two-tab-bars"),t=this.groupView.count!==this.groupView.stickyCount&&this.groupView.stickyCount>0;this.parent.classList.toggle("two-tab-bars",t),e!==t&&this.groupView.relayout()}didActiveControlChange(){return this.activeControl!==(this.model.activeEditor?this.getEditorTabsController(this.model.activeEditor):void 0)}getEditorTabsController(e){return this.model.isSticky(e)?this.stickyEditorTabsControl:this.unstickyEditorTabsControl}openEditor(e,t){const i=this.didActiveControlChange(),o=this.getEditorTabsController(e).openEditor(e,t)||i;return o&&this.handleOpenedEditors(),o}openEditors(e){const t=e.filter(d=>this.model.isSticky(d)),i=e.filter(d=>!this.model.isSticky(d)),s=this.didActiveControlChange(),o=this.stickyEditorTabsControl.openEditors(t),n=this.unstickyEditorTabsControl.openEditors(i),r=o||n||s;return r&&this.handleOpenedEditors(),r}handleOpenedEditors(){this.handleTabBarsStateChange()}beforeCloseEditor(e){this.getEditorTabsController(e).beforeCloseEditor(e)}closeEditor(e){this.stickyEditorTabsControl.closeEditor(e),this.unstickyEditorTabsControl.closeEditor(e),this.handleClosedEditors()}closeEditors(e){const t=e.filter(s=>this.model.isSticky(s)),i=e.filter(s=>!this.model.isSticky(s));this.stickyEditorTabsControl.closeEditors(t),this.unstickyEditorTabsControl.closeEditors(i),this.handleClosedEditors()}handleClosedEditors(){this.handleTabBarsStateChange()}moveEditor(e,t,i,s){s?(this.model.isSticky(e)?(this.stickyEditorTabsControl.openEditor(e),this.unstickyEditorTabsControl.closeEditor(e)):(this.stickyEditorTabsControl.closeEditor(e),this.unstickyEditorTabsControl.openEditor(e)),this.handleTabBarsStateChange()):this.model.isSticky(e)?this.stickyEditorTabsControl.moveEditor(e,t,i,s):this.unstickyEditorTabsControl.moveEditor(e,t-this.model.stickyCount,i-this.model.stickyCount,s)}pinEditor(e){this.getEditorTabsController(e).pinEditor(e)}stickEditor(e){this.unstickyEditorTabsControl.closeEditor(e),this.stickyEditorTabsControl.openEditor(e),this.handleTabBarsStateChange()}unstickEditor(e){this.stickyEditorTabsControl.closeEditor(e),this.unstickyEditorTabsControl.openEditor(e),this.handleTabBarsStateChange()}setActive(e){this.stickyEditorTabsControl.setActive(e),this.unstickyEditorTabsControl.setActive(e)}updateEditorSelections(){this.stickyEditorTabsControl.updateEditorSelections(),this.unstickyEditorTabsControl.updateEditorSelections()}updateEditorLabel(e){this.getEditorTabsController(e).updateEditorLabel(e)}updateEditorDirty(e){this.getEditorTabsController(e).updateEditorDirty(e)}updateOptions(e,t){this.stickyEditorTabsControl.updateOptions(e,t),this.unstickyEditorTabsControl.updateOptions(e,t)}layout(e){const t=this.stickyEditorTabsControl.layout(e),i={container:e.container,available:new Ne(e.available.width,e.available.height-t.height)},s=this.unstickyEditorTabsControl.layout(i);return new Ne(e.container.width,t.height+s.height)}getHeight(){return this.stickyEditorTabsControl.getHeight()+this.unstickyEditorTabsControl.getHeight()}dispose(){this.parent.classList.toggle("two-tab-bars",!1),super.dispose()}};Fg=_([u(5,K)],Fg);Te(ZE);class DP extends ic{constructor(){super(...arguments),this.activeEditor=null}prepareEditorActions(e){return{primary:[],secondary:[]}}openEditor(e){return this.handleOpenedEditors()}openEditors(e){return this.handleOpenedEditors()}handleOpenedEditors(){const e=this.activeEditorChanged();return this.activeEditor=this.tabsModel.activeEditor,e}activeEditorChanged(){return!!(!this.activeEditor&&this.tabsModel.activeEditor||this.activeEditor&&!this.tabsModel.activeEditor||!this.activeEditor||!this.tabsModel.isActive(this.activeEditor))}beforeCloseEditor(e){}closeEditor(e){this.handleClosedEditors()}closeEditors(e){this.handleClosedEditors()}handleClosedEditors(){this.activeEditor=this.tabsModel.activeEditor}moveEditor(e,t,i){}pinEditor(e){}stickEditor(e){}unstickEditor(e){}setActive(e){}updateEditorSelections(){}updateEditorLabel(e){}updateEditorDirty(e){}getHeight(){return 0}layout(e){return new Ne(e.container.width,this.getHeight())}}Te(cL);let Bg=class extends Cc{get breadcrumbsControl(){return this.breadcrumbsControlFactory?.control}constructor(e,t,i,s,o,n,r){super(r),this.parent=e,this.editorPartsView=t,this.groupsView=i,this.groupView=s,this.model=o,this.instantiationService=n,this.editorTabsControlDisposable=this._register(new F),this.breadcrumbsControlDisposables=this._register(new F),this.editorTabsControl=this.createEditorTabsControl(),this.breadcrumbsControlFactory=this.createBreadcrumbsControl()}createEditorTabsControl(){let e;switch(this.groupsView.partOptions.showTabs){case"none":e=DP;break;case"single":e=IP;break;default:e=this.groupsView.partOptions.pinnedTabsOnSeparateRow?Fg:nc;break}const t=this.instantiationService.createInstance(e,this.parent,this.editorPartsView,this.groupsView,this.groupView,this.model);return this.editorTabsControlDisposable.add(t)}createBreadcrumbsControl(){if(this.groupsView.partOptions.showTabs==="single")return;const e=M(".breadcrumbs-below-tabs");this.parent.appendChild(e);const t=this.breadcrumbsControlDisposables.add(this.instantiationService.createInstance(Gl,e,this.groupView,{showFileIcons:!0,showSymbolIcons:!0,showDecorationColors:!1,showPlaceholder:!0,dragEditor:!1}));return this.breadcrumbsControlDisposables.add(t.onDidEnablementChange(()=>this.groupView.relayout())),this.breadcrumbsControlDisposables.add(t.onDidVisibilityChange(()=>this.groupView.relayout())),t}openEditor(e,t){const i=this.editorTabsControl.openEditor(e,t);this.handleOpenedEditors(i)}openEditors(e){const t=this.editorTabsControl.openEditors(e);this.handleOpenedEditors(t)}handleOpenedEditors(e){e?this.breadcrumbsControl?.update():this.breadcrumbsControl?.revealLast()}beforeCloseEditor(e){return this.editorTabsControl.beforeCloseEditor(e)}closeEditor(e){this.editorTabsControl.closeEditor(e),this.handleClosedEditors()}closeEditors(e){this.editorTabsControl.closeEditors(e),this.handleClosedEditors()}handleClosedEditors(){this.groupView.activeEditor||this.breadcrumbsControl?.update()}moveEditor(e,t,i,s){return this.editorTabsControl.moveEditor(e,t,i,s)}pinEditor(e){return this.editorTabsControl.pinEditor(e)}stickEditor(e){return this.editorTabsControl.stickEditor(e)}unstickEditor(e){return this.editorTabsControl.unstickEditor(e)}setActive(e){return this.editorTabsControl.setActive(e)}updateEditorSelections(){this.editorTabsControl.updateEditorSelections()}updateEditorLabel(e){return this.editorTabsControl.updateEditorLabel(e)}updateEditorDirty(e){return this.editorTabsControl.updateEditorDirty(e)}updateOptions(e,t){e.showTabs!==t.showTabs||t.showTabs!=="single"&&e.pinnedTabsOnSeparateRow!==t.pinnedTabsOnSeparateRow?(this.editorTabsControlDisposable.clear(),this.breadcrumbsControlDisposables.clear(),Bt(this.parent),this.editorTabsControl=this.createEditorTabsControl(),this.breadcrumbsControlFactory=this.createBreadcrumbsControl()):this.editorTabsControl.updateOptions(e,t)}layout(e){const t=this.editorTabsControl.layout(e);let i;return this.breadcrumbsControl?.isHidden()===!1&&(i=new Ne(e.container.width,ze.HEIGHT),this.breadcrumbsControl.layout(i)),new Ne(e.container.width,t.height+(i?i.height:0))}getHeight(){const e=this.editorTabsControl.getHeight(),t=this.breadcrumbsControl?.isHidden()===!1?ze.HEIGHT:0;return{total:e+t,offset:e}}};Bg=_([u(5,K),u(6,me)],Bg);var ko;Te(XR);let Xr=ko=class extends Cc{static createNew(e,t,i,s,o,n){return o.createInstance(ko,null,e,t,i,s,n)}static createFromSerialized(e,t,i,s,o,n,r){return n.createInstance(ko,e,t,i,s,o,r)}static createCopy(e,t,i,s,o,n,r){return n.createInstance(ko,e,t,i,s,o,r)}constructor(e,t,i,s,o,n,r,d,l,h,p,g,f,w,v,C,T,G,B,X,Z,j){super(l),this.editorPartsView=t,this.groupsView=i,this.groupsLabel=s,this._index=o,this.instantiationService=r,this.contextKeyService=d,this.telemetryService=h,this.keybindingService=p,this.menuService=g,this.contextMenuService=f,this.fileDialogService=w,this.editorService=v,this.filesConfigurationService=C,this.uriIdentityService=T,this.logService=G,this.editorResolverService=B,this.hostService=X,this.dialogService=Z,this.fileService=j,this._onDidFocus=this._register(new A),this.onDidFocus=this._onDidFocus.event,this._onWillDispose=this._register(new A),this.onWillDispose=this._onWillDispose.event,this._onDidModelChange=this._register(new A),this.onDidModelChange=this._onDidModelChange.event,this._onDidActiveEditorChange=this._register(new A),this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this._onDidOpenEditorFail=this._register(new A),this.onDidOpenEditorFail=this._onDidOpenEditorFail.event,this._onWillCloseEditor=this._register(new A),this.onWillCloseEditor=this._onWillCloseEditor.event,this._onDidCloseEditor=this._register(new A),this.onDidCloseEditor=this._onDidCloseEditor.event,this._onWillMoveEditor=this._register(new A),this.onWillMoveEditor=this._onWillMoveEditor.event,this._onWillOpenEditor=this._register(new A),this.onWillOpenEditor=this._onWillOpenEditor.event,this.disposedEditorsWorker=this._register(new NC(q=>this.handleDisposedEditors(q),0)),this.mapEditorToPendingConfirmation=new Map,this.containerToolBarMenuDisposable=this._register(new ke),this.whenRestoredPromise=new tn,this.whenRestored=this.whenRestoredPromise.p,this._disposed=!1,this.element=M("div"),this._onDidChange=this._register(new ho),this.onDidChange=this._onDidChange.event,e instanceof ko?this.model=this._register(e.model.clone()):FC(e)?this.model=this._register(r.createInstance(Gb,e)):this.model=this._register(r.createInstance(Gb,void 0)),this.scopedContextKeyService=this._register(this.contextKeyService.createScoped(this.element)),this.element.classList.add(...xi(["editor-group-container",this.model.isLocked?"locked":void 0])),this.registerContainerListeners(),this.createContainerToolbar(),this.createContainerContextMenu(),this._register(this.instantiationService.createInstance(lg,this.element)),this.progressBar=this._register(new Uy(this.element,Hy)),this.progressBar.hide(),this.scopedInstantiationService=this._register(this.instantiationService.createChild(new fr([re,this.scopedContextKeyService],[iw,this._register(new hD(this.progressBar,this))]))),this.resourceContext=this._register(this.scopedInstantiationService.createInstance(yC)),this.handleGroupContextKeys(),this.titleContainer=M(".title"),this.element.appendChild(this.titleContainer),this.titleControl=this._register(this.scopedInstantiationService.createInstance(Bg,this.titleContainer,this.editorPartsView,this.groupsView,this,this.model)),this.editorContainer=M(".editor-container"),this.element.appendChild(this.editorContainer),this.editorPane=this._register(this.scopedInstantiationService.createInstance(cg,this.element,this.editorContainer,this)),this._onDidChange.input=this.editorPane.onDidChangeSizeConstraints,this.doTrackFocus(),this.updateTitleContainer(),this.updateContainer(),this.updateStyles(),(this.restoreEditors(e,n)??Promise.resolve()).finally(()=>{this.whenRestoredPromise.complete()}),this.registerListeners()}handleGroupContextKeys(){const e=this.editorPartsView.bind(Ic,this),t=this.editorPartsView.bind(bw,this),i=this.editorPartsView.bind(CC,this),s=this.editorPartsView.bind(gu,this),o=this.editorPartsView.bind(Ns,this),n=this.editorPartsView.bind(BC,this),r=this.editorPartsView.bind(Ms,this),d=Dc.bindTo(this.scopedContextKeyService),l=uD.bindTo(this.scopedContextKeyService),h=pD.bindTo(this.scopedContextKeyService),p=this.editorPartsView.bind(TC,this),g=this.editorPartsView.bind(gD,this),f=this.editorPartsView.bind(fD,this),w=this.editorPartsView.bind(mD,this),v=this.editorPartsView.bind(pw,this),C=this.editorPartsView.bind(Pp,this),T=this.editorPartsView.bind(Ai,this),G=this.editorPartsView.bind(Xa,this),B=this.editorPartsView.bind(xn,this),X=this.editorPartsView.bind(hi,this),Z=this._register(new ke),j=()=>{Z.clear(),this.scopedContextKeyService.bufferChangeEvents(()=>{const q=this.activeEditor,ce=this.activeEditorPane;if(this.resourceContext.set(Ge.getOriginalUri(q,{supportSideBySide:xe.PRIMARY})),EC(G,q,this.editorResolverService),q?(B.set(q.hasCapability($t.CanSplitInGroup)),X.set(q.typeId===jt.ID),e.set(q.isDirty()&&!q.isSaving()),Z.value=q.onDidChangeDirty(()=>{e.set(q.isDirty()&&!q.isSaving())})):(B.set(!1),X.set(!1),e.set(!1)),ce){p.set(ce.getId()),f.set(!ce.input.hasCapability($t.Untitled)),g.set(!!ce.input.isReadonly());const $e=Ge.getOriginalUri(ce.input,{supportSideBySide:xe.PRIMARY}),ft=Ge.getOriginalUri(ce.input,{supportSideBySide:xe.SECONDARY});v.set(ce.input instanceof qt&&!ce.input.original.isReadonly()&&!!$e&&(this.fileService.hasProvider($e)||$e.scheme===ue.untitled)&&!!ft&&(this.fileService.hasProvider(ft)||ft.scheme===ue.untitled)),w.set(!!$e&&this.fileService.hasProvider($e)&&!this.fileService.hasCapability($e,WC.Readonly));const wi=ce?.getId()===fC;T.set(wi),C.set(wi)}else p.reset(),f.reset(),g.reset(),v.reset(),w.reset()})},Q=q=>{switch(q.kind){case at.GROUP_LOCKED:r.set(this.isLocked);break;case at.EDITOR_ACTIVE:i.set(this.model.isFirst(this.model.activeEditor)),s.set(this.model.isLast(this.model.activeEditor)),t.set(this.model.activeEditor?this.model.isPinned(this.model.activeEditor):!1),o.set(this.model.activeEditor?this.model.isSticky(this.model.activeEditor):!1);break;case at.EDITOR_CLOSE:t.set(this.model.activeEditor?this.model.isPinned(this.model.activeEditor):!1),o.set(this.model.activeEditor?this.model.isSticky(this.model.activeEditor):!1);case at.EDITOR_OPEN:case at.EDITOR_MOVE:i.set(this.model.isFirst(this.model.activeEditor)),s.set(this.model.isLast(this.model.activeEditor));break;case at.EDITOR_PIN:q.editor&&q.editor===this.model.activeEditor&&t.set(this.model.isPinned(this.model.activeEditor));break;case at.EDITOR_STICKY:q.editor&&q.editor===this.model.activeEditor&&o.set(this.model.isSticky(this.model.activeEditor));break;case at.EDITORS_SELECTION:d.set(this.model.selectedEditors.length>1),l.set(this.model.selectedEditors.length===2),h.set(this.model.selectedEditors.every(ce=>ce.resource&&(this.fileService.hasProvider(ce.resource)||ce.resource.scheme===ue.untitled)));break}n.set(this.count)};this._register(this.onDidModelChange(q=>Q(q))),this._register(this.onDidActiveEditorChange(()=>j())),j(),Q({kind:at.EDITOR_ACTIVE}),Q({kind:at.GROUP_LOCKED})}registerContainerListeners(){this._register(z(this.element,ee.DBLCLICK,e=>{this.isEmpty&&(be.stop(e),this.editorService.openEditor({resource:void 0,options:{pinned:!0,override:Rt.id}},this.id))})),this._register(z(this.element,ee.AUXCLICK,e=>{this.isEmpty&&e.button===1&&(be.stop(e,!0),this.groupsView.removeGroup(this))}))}createContainerToolbar(){const e=M(".editor-group-container-toolbar");this.element.appendChild(e);const t=this._register(new pn(e,{ariaLabel:c(3310,"Empty editor group actions"),highlightToggledItems:!0})),i=this._register(this.menuService.createMenu(b.EmptyEditorGroup,this.scopedContextKeyService)),s=()=>{this.containerToolBarMenuDisposable.value=he(()=>t.clear());const o=Tp(i.getActions({arg:{groupId:this.id},shouldForwardArgs:!0}),"navigation");for(const n of[...o.primary,...o.secondary]){const r=this.keybindingService.lookupKeybinding(n.id);t.push(n,{icon:!0,label:!1,keybinding:r?.getLabel()})}};s(),this._register(i.onDidChange(s))}createContainerContextMenu(){this._register(z(this.element,ee.CONTEXT_MENU,e=>this.onShowContainerContextMenu(e))),this._register(z(this.element,Ni.Contextmenu,()=>this.onShowContainerContextMenu()))}onShowContainerContextMenu(e){if(!this.isEmpty)return;let t=this.element;e&&(t=new Vo(Ue(this.element),e)),this.contextMenuService.showContextMenu({menuId:b.EmptyEditorGroupContext,contextKeyService:this.contextKeyService,getAnchor:()=>t,onHide:()=>this.focus()})}doTrackFocus(){const e=this._register(fo(this.element));this._register(e.onDidFocus(()=>{this.isEmpty&&this._onDidFocus.fire()}));const t=i=>{let s;if($r(i)){if(i.button!==0||Ke&&i.ctrlKey)return;s=i.target}else s=i.initialTarget;El(s,"monaco-action-bar",this.titleContainer)||El(s,"monaco-breadcrumb-item",this.titleContainer)||setTimeout(()=>{this.focus()})};this._register(z(this.titleContainer,ee.MOUSE_DOWN,i=>t(i))),this._register(z(this.titleContainer,Ni.Tap,i=>t(i))),this._register(this.editorPane.onDidFocus(()=>{this._onDidFocus.fire()}))}updateContainer(){this.isEmpty?(this.element.classList.add("empty"),this.element.tabIndex=0,this.element.setAttribute("aria-label",c(3311,"{0} (empty)",this.ariaLabel))):(this.element.classList.remove("empty"),this.element.removeAttribute("tabIndex"),this.element.removeAttribute("aria-label")),this.updateStyles()}updateTitleContainer(){this.titleContainer.classList.toggle("tabs",this.groupsView.partOptions.showTabs==="multiple"),this.titleContainer.classList.toggle("show-file-icons",this.groupsView.partOptions.showIcons)}restoreEditors(e,t){if(this.count===0)return;let i;e instanceof ko?i=Wb(e):i=Object.create(null);const s=this.model.activeEditor;if(!s)return;i.pinned=this.model.isPinned(s),i.sticky=this.model.isSticky(s),i.preserveFocus=!0;const o={preserveWindowOrder:!0,skipTitleUpdate:!0},n=sn(),r=this.doShowEditor(s,{active:!0,isNew:!1},i,o).then(()=>{this.groupsView.activeGroup===this&&n&&_l(n)&&!t?.preserveFocus&&this.focus()});return this.titleControl.openEditors(this.editors),r}registerListeners(){this._register(this.model.onDidModelChange(e=>this.onDidGroupModelChange(e))),this._register(this.groupsView.onDidChangeEditorPartOptions(e=>this.onDidChangeEditorPartOptions(e))),this._register(this.groupsView.onDidVisibilityChange(e=>this.onDidVisibilityChange(e))),this._register(this.onDidFocus(()=>this.onDidGainFocus()))}onDidGroupModelChange(e){switch(this._onDidModelChange.fire(e),e.kind){case at.GROUP_LOCKED:this.element.classList.toggle("locked",this.isLocked);break;case at.EDITORS_SELECTION:this.onDidChangeEditorSelection();break}if(e.editor)switch(e.kind){case at.EDITOR_OPEN:bD(e)&&this.onDidOpenEditor(e.editor,e.editorIndex);break;case at.EDITOR_CLOSE:wD(e)&&this.handleOnDidCloseEditor(e.editor,e.editorIndex,e.context,e.sticky);break;case at.EDITOR_WILL_DISPOSE:this.onWillDisposeEditor(e.editor);break;case at.EDITOR_DIRTY:this.onDidChangeEditorDirty(e.editor);break;case at.EDITOR_TRANSIENT:this.onDidChangeEditorTransient(e.editor);break;case at.EDITOR_LABEL:this.onDidChangeEditorLabel(e.editor);break}}onDidOpenEditor(e,t){this.telemetryService.publicLog("editorOpened",this.toEditorTelemetryDescriptor(e)),this.updateContainer()}handleOnDidCloseEditor(e,t,i,s){this._onWillCloseEditor.fire({groupId:this.id,editor:e,context:i,index:t,sticky:s});const o=[e];e instanceof jt&&o.push(e.primary,e.secondary);for(const n of o)this.canDispose(n)&&n.dispose();this.updateContainer(),this._onDidCloseEditor.fire({groupId:this.id,editor:e,context:i,index:t,sticky:s})}canDispose(e){for(const t of this.editorPartsView.groups)if(t instanceof ko&&t.model.contains(e,{strictEquals:!0,supportSideBySide:xe.ANY}))return!1;return!0}toResourceTelemetryDescriptor(e){if(!e)return;const t=e?e.scheme===ue.file?e.fsPath:e.path:void 0;if(!t)return;let i=Fi(e);const s=i.indexOf("?");return i=s!==-1?i.substr(0,s):i,{mimeType:new GC(vD(e).join(", ")),scheme:e.scheme,ext:i,path:wu(t)}}toEditorTelemetryDescriptor(e){const t=e.getTelemetryDescriptor(),i=Ge.getOriginalUri(e,{supportSideBySide:xe.BOTH});return $.isUri(i)?(t.resource=this.toResourceTelemetryDescriptor(i),t):(i&&(i.primary&&(t.resource=this.toResourceTelemetryDescriptor(i.primary)),i.secondary&&(t.resourceSecondary=this.toResourceTelemetryDescriptor(i.secondary))),t)}onWillDisposeEditor(e){this.disposedEditorsWorker.work(e)}handleDisposedEditors(e){let t;const i=[];for(const s of e){const o=this.model.findEditor(s);if(!o)continue;const n=o[0];n.isDisposed()&&(this.model.isActive(n)?t=n:i.push(n))}for(const s of i)this.doCloseEditor(s,!0);t&&this.doCloseEditor(t,!0)}onDidChangeEditorPartOptions(e){this.updateTitleContainer(),this.titleControl.updateOptions(e.oldPartOptions,e.newPartOptions),(e.oldPartOptions.showTabs!==e.newPartOptions.showTabs||e.oldPartOptions.tabHeight!==e.newPartOptions.tabHeight||e.oldPartOptions.showTabs==="multiple"&&e.oldPartOptions.pinnedTabsOnSeparateRow!==e.newPartOptions.pinnedTabsOnSeparateRow)&&(this.relayout(),this.model.activeEditor&&this.titleControl.openEditors(this.model.getEditors(_e.SEQUENTIAL))),this.updateStyles(),e.oldPartOptions.enablePreview&&!e.newPartOptions.enablePreview&&this.model.previewEditor&&this.pinEditor(this.model.previewEditor)}onDidChangeEditorDirty(e){this.pinEditor(e),this.titleControl.updateEditorDirty(e)}onDidChangeEditorTransient(e){!this.model.isTransient(e)&&!this.groupsView.partOptions.enablePreview&&this.pinEditor(e)}onDidChangeEditorLabel(e){this.titleControl.updateEditorLabel(e)}onDidChangeEditorSelection(){this.titleControl.updateEditorSelections()}onDidVisibilityChange(e){this.editorPane.setVisible(e)}onDidGainFocus(){this.activeEditor&&this.model.setTransient(this.activeEditor,!1)}get index(){return this._index}get label(){return this.groupsLabel?c(3312,"{0}: Group {1}",this.groupsLabel,this._index+1):c(3313,"Group {0}",this._index+1)}get ariaLabel(){return this.groupsLabel?c(3314,"{0}: Editor Group {1}",this.groupsLabel,this._index+1):c(3315,"Editor Group {0}",this._index+1)}get disposed(){return this._disposed}get isEmpty(){return this.count===0}get titleHeight(){return this.titleControl.getHeight()}notifyIndexChanged(e){this._index!==e&&(this._index=e,this.model.setIndex(e))}notifyLabelChanged(e){this.groupsLabel!==e&&(this.groupsLabel=e,this.model.setLabel(e))}setActive(e){this.active=e,!e&&this.activeEditor&&this.selectedEditors.length>1&&this.setSelection(this.activeEditor,[]),this.element.classList.toggle("active",e),this.element.classList.toggle("inactive",!e),this.titleControl.setActive(e),this.updateStyles(),this.model.setActive(void 0)}get id(){return this.model.id}get windowId(){return this.groupsView.windowId}get editors(){return this.model.getEditors(_e.SEQUENTIAL)}get count(){return this.model.count}get stickyCount(){return this.model.stickyCount}get activeEditorPane(){return this.editorPane?this.editorPane.activeEditorPane??void 0:void 0}get activeEditor(){return this.model.activeEditor}get selectedEditors(){return this.model.selectedEditors}get previewEditor(){return this.model.previewEditor}isPinned(e){return this.model.isPinned(e)}isSticky(e){return this.model.isSticky(e)}isSelected(e){return this.model.isSelected(e)}isTransient(e){return this.model.isTransient(e)}isActive(e){return this.model.isActive(e)}async setSelection(e,t){this.isActive(e)?this.model.setSelection(e,t):await this.openEditor(e,{activation:to.ACTIVATE},{inactiveSelection:t})}contains(e,t){return this.model.contains(e,t)}getEditors(e,t){return this.model.getEditors(e,t)}findEditors(e,t){const i=this.uriIdentityService.asCanonicalUri(e);return this.getEditors(t?.order??_e.SEQUENTIAL).filter(s=>{if(s.resource&&Je(s.resource,i))return!0;if(t?.supportSideBySide===xe.PRIMARY||t?.supportSideBySide===xe.ANY){const o=Ge.getCanonicalUri(s,{supportSideBySide:xe.PRIMARY});if(o&&Je(o,i))return!0}if(t?.supportSideBySide===xe.SECONDARY||t?.supportSideBySide===xe.ANY){const o=Ge.getCanonicalUri(s,{supportSideBySide:xe.SECONDARY});if(o&&Je(o,i))return!0}return!1})}getEditorByIndex(e){return this.model.getEditorByIndex(e)}getIndexOfEditor(e){return this.model.indexOf(e)}isFirst(e){return this.model.isFirst(e)}isLast(e){return this.model.isLast(e)}focus(){this.activeEditorPane?this.activeEditorPane.focus():this.element.focus(),this._onDidFocus.fire()}pinEditor(e=this.activeEditor||void 0){if(e&&!this.model.isPinned(e)){const t=this.model.pin(e);t&&this.titleControl.pinEditor(t)}}stickEditor(e=this.activeEditor||void 0){this.doStickEditor(e,!0)}unstickEditor(e=this.activeEditor||void 0){this.doStickEditor(e,!1)}doStickEditor(e,t){if(e&&this.model.isSticky(e)!==t){const i=this.getIndexOfEditor(e),s=t?this.model.stick(e):this.model.unstick(e);if(!s)return;const o=this.getIndexOfEditor(s);o!==i&&this.titleControl.moveEditor(s,i,o,!0),t?this.titleControl.stickEditor(s):this.titleControl.unstickEditor(s)}}async openEditor(e,t,i){return this.doOpenEditor(e,t,{...i,supportSideBySide:xe.BOTH})}async doOpenEditor(e,t,i){if(!e||e.isDisposed())return;this._onWillOpenEditor.fire({editor:e,groupId:this.id});const s=t?.sticky||!this.groupsView.partOptions.enablePreview&&!t?.transient||e.isDirty()||(t?.pinned??typeof t?.index=="number")||typeof t?.index=="number"&&this.model.isSticky(t.index)||e.hasCapability($t.Scratchpad),o={index:t?t.index:void 0,pinned:s,sticky:t?.sticky||typeof t?.index=="number"&&this.model.isSticky(t.index),transient:!!t?.transient,inactiveSelection:i?.inactiveSelection,active:this.count===0||!t||!t.inactive,supportSideBySide:i?.supportSideBySide};!o.active&&!o.pinned&&this.model.activeEditor&&!this.model.isPinned(this.model.activeEditor)&&(o.active=!0);let n=!1,r=!1;if(t?.activation===to.ACTIVATE?n=!0:t?.activation===to.RESTORE?r=!0:t?.activation===to.PRESERVE?(n=!1,r=!1):o.active&&(n=!t||!t.preserveFocus,r=!n),typeof o.index=="number"){const p=this.model.indexOf(e);p!==-1&&p!==o.index&&this.doMoveEditorInsideGroup(e,o)}const{editor:d,isNew:l}=this.model.openEditor(e,o);l&&this.count===1&&this.editorPartsView.groups.length>1&&d.editorId&&this.groupsView.partOptions.autoLockGroups?.has(d.editorId)&&this.lock(!0);const h=this.doShowEditor(d,{active:!!o.active,isNew:l},t,i);return n?this.groupsView.activateGroup(this):r&&this.groupsView.restoreGroup(this),h}doShowEditor(e,t,i,s){let o;return t.active?o=(async()=>{const{pane:n,changed:r,cancelled:d,error:l}=await this.editorPane.openEditor(e,i,s,{newInGroup:t.isNew});if(!d)return r&&this._onDidActiveEditorChange.fire({editor:e}),l&&this._onDidOpenEditorFail.fire(e),!n&&this.activeEditor===e&&this.doCloseEditor(e,i?.preserveFocus,{fromError:!0}),n})():o=Promise.resolve(void 0),s?.skipTitleUpdate||this.titleControl.openEditor(e,s),o}async openEditors(e){const t=xi(e).filter(({editor:r})=>!r.isDisposed()),i=t.at(0);if(!i)return;const s={supportSideBySide:xe.BOTH};await this.doOpenEditor(i.editor,i.options,s);const o=t.slice(1),n=this.getIndexOfEditor(i.editor)+1;return await bu.settled(o.map(({editor:r,options:d},l)=>this.doOpenEditor(r,{...d,inactive:!0,pinned:!0,index:n+l},{...s,skipTitleUpdate:!0}))),this.titleControl.openEditors(o.map(({editor:r})=>r)),this.editorPane.activeEditorPane??void 0}moveEditors(e,t){const i={skipTitleUpdate:this!==t};let s=!1;const o=new Set;for(const{editor:n,options:r}of e)this.moveEditor(n,t,r,i)?o.add(n):s=!0;return i.skipTitleUpdate&&(t.titleControl.openEditors(Array.from(o)),this.titleControl.closeEditors(Array.from(o))),!s}moveEditor(e,t,i,s){return this===t?(this.doMoveEditorInsideGroup(e,i),!0):this.doMoveOrCopyEditorAcrossGroups(e,t,i,{...s,keepCopy:!1})}doMoveEditorInsideGroup(e,t){const i=t?t.index:void 0;if(typeof i!="number")return;const s=this.model.indexOf(e),o=this.model.getEditorByIndex(s);if(o){if(s!==i){const n=this.model.stickyCount;this.model.moveEditor(o,i),this.model.pin(o),this.titleControl.moveEditor(o,s,i,n!==this.model.stickyCount),this.titleControl.pinEditor(o)}t?.sticky&&this.stickEditor(o)}}doMoveOrCopyEditorAcrossGroups(e,t,i,s){const o=s?.keepCopy;if(!o||e.hasCapability($t.Singleton)){const r=e.canMove(this.id,t.id);if(typeof r=="string")return this.dialogService.error(r,c(3316,"Try saving or reverting the editor first and then try again.")),!1}const n=Wb(this,e,{...i,pinned:!0,sticky:i?.sticky??(!o&&this.model.isSticky(e))});return o||this._onWillMoveEditor.fire({groupId:this.id,editor:e,target:t.id}),t.doOpenEditor(o?e.copy():e,n,s),o||this.doCloseEditor(e,!0,{...s,context:_n.MOVE}),!0}copyEditors(e,t){const i={skipTitleUpdate:this!==t};for(const{editor:s,options:o}of e)this.copyEditor(s,t,o,i);if(i.skipTitleUpdate){const s=e.map(({editor:o})=>o);t.titleControl.openEditors(s)}}copyEditor(e,t,i,s){this===t?this.doMoveEditorInsideGroup(e,i):this.doMoveOrCopyEditorAcrossGroups(e,t,i,{...s,keepCopy:!0})}async closeEditor(e=this.activeEditor||void 0,t){return this.doCloseEditorWithConfirmationHandling(e,t)}async doCloseEditorWithConfirmationHandling(e=this.activeEditor||void 0,t,i){return!e||await this.handleCloseConfirmation([e])?!1:(this.doCloseEditor(e,t?.preserveFocus,i),!0)}doCloseEditor(e,t=this.groupsView.activeGroup!==this,i){i?.skipTitleUpdate||this.titleControl.beforeCloseEditor(e),this.model.isActive(e)?this.doCloseActiveEditor(t,i):this.doCloseInactiveEditor(e,i),i?.skipTitleUpdate||this.titleControl.closeEditor(e)}doCloseActiveEditor(e=this.groupsView.activeGroup!==this,t){const i=this.activeEditor,s=!e&&this.shouldRestoreFocus(this.element),o=this.groupsView.partOptions.closeEmptyGroups;if(o&&this.active&&this.count===1){const d=this.groupsView.getGroups(Oe.MOST_RECENTLY_ACTIVE)[1];d&&(s?d.focus():this.groupsView.activateGroup(d,!0))}i&&this.model.closeEditor(i,t?.context);const n=this.model.activeEditor;if(n){let r;e&&this.groupsView.activeGroup!==this&&(r=to.PRESERVE);const d={preserveFocus:e,activation:r,ignoreError:t?.fromError},l={preserveWindowOrder:!0};this.doOpenEditor(n,d,l)}else i&&this.editorPane.closeEditor(i),s&&!o&&this.focus(),this._onDidActiveEditorChange.fire({editor:void 0}),o&&this.groupsView.removeGroup(this,e)}shouldRestoreFocus(e){const t=sn();return t===yD(e)?!0:Oa(t,e)}doCloseInactiveEditor(e,t){this.model.closeEditor(e,t?.context)}async handleCloseConfirmation(e){if(!e.length)return!1;const t=e.shift();let i=this.mapEditorToPendingConfirmation.get(t);i||(i=this.doHandleCloseConfirmation(t),this.mapEditorToPendingConfirmation.set(t,i));let s;try{s=await i}finally{this.mapEditorToPendingConfirmation.delete(t)}return s||this.handleCloseConfirmation(e)}async doHandleCloseConfirmation(e,t){if(!this.shouldConfirmClose(e)||e instanceof jt&&this.model.contains(e.primary)||this.editorPartsView.groups.some(n=>{if(n===this)return!1;const r=n;return!!(r.contains(e,{supportSideBySide:xe.BOTH})||e instanceof jt&&r.contains(e.primary))}))return!1;let i=Ci.CANCEL,s=Gi.EXPLICIT,o=!1;if(!e.hasCapability($t.Untitled)&&!t?.skipAutoSave&&!e.closeHandler&&(this.filesConfigurationService.getAutoSaveMode(e).mode===Sl.ON_FOCUS_CHANGE?(o=!0,i=Ci.SAVE,s=Gi.FOCUS_CHANGE):vw&&(pi||Ec)&&this.filesConfigurationService.getAutoSaveMode(e).mode===Sl.ON_WINDOW_CHANGE&&(o=!0,i=Ci.SAVE,s=Gi.WINDOW_CHANGE)),!o){(!this.activeEditor||!this.activeEditor.matches(e))&&await this.doOpenEditor(e),await this.hostService.focus(Ue(this.element));let n=!1;if(typeof e.closeHandler?.confirm=="function")try{i=await e.closeHandler.confirm([{editor:e,groupId:this.id}])}catch(r){this.logService.error(r),n=!0}if(typeof e.closeHandler?.confirm!="function"||n){let r;e instanceof jt?r=e.primary.getName():r=e.getName(),i=await this.fileDialogService.showSaveConfirm([r])}}if(!e.closeHandler&&!this.shouldConfirmClose(e))return i===Ci.CANCEL;switch(i){case Ci.SAVE:return!await e.save(this.id,{reason:s})&&o?this.doHandleCloseConfirmation(e,{skipAutoSave:!0}):e.isDirty();case Ci.DONT_SAVE:try{return await e.revert(this.id),e.isDirty()}catch(n){return this.logService.error(n),await e.revert(this.id,{soft:!0}),e.isDirty()}case Ci.CANCEL:return!0}}shouldConfirmClose(e){if(e.closeHandler)try{return e.closeHandler.showConfirm()}catch(t){this.logService.error(t)}return e.isDirty()&&!e.isSaving()}async closeEditors(e,t){if(this.isEmpty)return!0;const i=this.doGetEditorsToClose(e);return await this.handleCloseConfirmation(i.slice(0))?!1:(this.doCloseEditors(i,t),!0)}doGetEditorsToClose(e){if(Array.isArray(e))return e;const t=e,i=typeof t.direction=="number";let s=this.model.getEditors(i?_e.SEQUENTIAL:_e.MOST_RECENTLY_ACTIVE,t);return t.savedOnly?s=s.filter(o=>!o.isDirty()||o.isSaving()):i&&t.except?s=t.direction===mw.LEFT?s.slice(0,this.model.indexOf(t.except,s)):s.slice(this.model.indexOf(t.except,s)+1):t.except&&(s=s.filter(o=>t.except&&!o.matches(t.except))),s}doCloseEditors(e,t){let i=!1;for(const s of e)this.isActive(s)?i=!0:this.doCloseInactiveEditor(s);i&&this.doCloseActiveEditor(t?.preserveFocus),e.length&&this.titleControl.closeEditors(e)}closeAllEditors(e){return this.isEmpty?(this.groupsView.partOptions.closeEmptyGroups&&this.groupsView.removeGroup(this),!0):e?.excludeConfirming?(this.doCloseAllEditors(e),!0):this.handleCloseConfirmation(this.model.getEditors(_e.MOST_RECENTLY_ACTIVE,e)).then(t=>t?!1:(this.doCloseAllEditors(e),!0))}doCloseAllEditors(e){let t=this.model.getEditors(_e.SEQUENTIAL,e);e?.excludeConfirming&&(t=t.filter(s=>!this.shouldConfirmClose(s)));const i=[];for(const s of t)this.isActive(s)||this.doCloseInactiveEditor(s),i.push(s);this.activeEditor&&i.includes(this.activeEditor)&&this.doCloseActiveEditor(),i.length&&this.titleControl.closeEditors(i)}async replaceEditors(e){let t;const i=[];for(let{editor:s,replacement:o,forceReplaceDirty:n,options:r}of e){const d=this.getIndexOfEditor(s);if(d>=0){const l=this.isActive(s);r?r.index=d:r={index:d},r.inactive=!l,r.pinned=r.pinned??!0;const h={editor:s,replacement:o,forceReplaceDirty:n,options:r};l?t=h:i.push(h)}}for(const{editor:s,replacement:o,forceReplaceDirty:n,options:r}of i)if(await this.doOpenEditor(o,r),!s.matches(o)){let d=!1;if(n?(this.doCloseEditor(s,!0,{context:_n.REPLACE}),d=!0):d=await this.doCloseEditorWithConfirmationHandling(s,{preserveFocus:!0},{context:_n.REPLACE}),!d)return}if(t){const s=this.doOpenEditor(t.replacement,t.options);t.editor.matches(t.replacement)||(t.forceReplaceDirty?this.doCloseEditor(t.editor,!0,{context:_n.REPLACE}):await this.doCloseEditorWithConfirmationHandling(t.editor,{preserveFocus:!0},{context:_n.REPLACE})),await s}}get isLocked(){return this.model.isLocked}lock(e){this.model.lock(e)}createEditorActions(e,t=b.EditorTitle){let i={primary:[],secondary:[]},s;const o=this.activeEditorPane;if(o instanceof ow){const n=o.scopedContextKeyService??this.scopedContextKeyService,r=e.add(this.menuService.createMenu(t,n,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:0}));s=r.onDidChange;const d=(l,h)=>h==="navigation"&&l.actions.length<=1;i=Tp(r.getActions({arg:this.resourceContext.get(),shouldForwardArgs:!0}),"navigation",d)}else{const n=e.add(new A);s=n.event,e.add(this.onDidActiveEditorChange(()=>n.fire()))}return{actions:i,onDidChange:s}}updateStyles(){const e=this.isEmpty;e?this.element.style.backgroundColor=this.getColor(CD)||"":this.element.style.backgroundColor="";const t=this.getColor(SD)||this.getColor(zi);!e&&t?(this.titleContainer.classList.add("title-border-bottom"),this.titleContainer.style.setProperty("--title-border-bottom-color",t)):(this.titleContainer.classList.remove("title-border-bottom"),this.titleContainer.style.removeProperty("--title-border-bottom-color"));const{showTabs:i}=this.groupsView.partOptions;this.titleContainer.style.backgroundColor=this.getColor(i==="multiple"?MC:ED)||"",this.editorContainer.style.backgroundColor=this.getColor(Iw)||""}get minimumWidth(){return this.editorPane.minimumWidth}get minimumHeight(){return this.editorPane.minimumHeight}get maximumWidth(){return this.editorPane.maximumWidth}get maximumHeight(){return this.editorPane.maximumHeight}get proportionalLayout(){return this.lastLayout?!(this.lastLayout.width===this.minimumWidth||this.lastLayout.height===this.minimumHeight):!0}layout(e,t,i,s){this.lastLayout={width:e,height:t,top:i,left:s},this.element.classList.toggle("max-height-478px",t<=478);const o=this.titleControl.layout({container:new Ne(e,t),available:new Ne(e,t-this.editorPane.minimumHeight)});this.progressBar.getContainer().style.top=`${Math.max(this.titleHeight.offset-2,0)}px`;const n=Math.max(0,t-o.height);this.editorContainer.style.height=`${n}px`,this.editorPane.layout({width:e,height:n,top:i+o.height,left:s})}relayout(){if(this.lastLayout){const{width:e,height:t,top:i,left:s}=this.lastLayout;this.layout(e,t,i,s)}}setBoundarySashes(e){this.editorPane.setBoundarySashes(e)}toJSON(){return this.model.serialize()}dispose(){this._disposed=!0,this._onWillDispose.fire(),super.dispose()}};Xr=ko=_([u(6,K),u(7,re),u(8,me),u(9,rt),u(10,ot),u(11,Ks),u(12,bt),u(13,fu),u(14,O),u(15,Ja),u(16,kr),u(17,it),u(18,zs),u(19,Nt),u(20,Ji),u(21,Ve)],Xr);const AP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Gg;Te(AP);function QE(a){return a.getValue("editor.dropIntoEditor.enabled")}function e_(a){return a.shiftKey}var Yn;let Wg=(Yn=class extends Cc{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=Vs.getInstance(),this.groupTransfer=Vs.getInstance(),this.treeItemsTransfer=Vs.getInstance(),this.cleanupOverlayScheduler=this._register(new Za(()=>this.dispose(),300)),this.enableDropIntoEditor=QE(this.configurationService)&&this.isDropIntoActiveEditorEnabled(),this.create()}create(){const e=this.getOverlayOffsetHeight(),t=this.container=M("div",{id:Gg.OVERLAY_ID});t.style.top=`${e}px`,this.groupView.element.appendChild(t),this.groupView.element.classList.add("dragged-over"),this._register(he(()=>{t.remove(),this.groupView.element.classList.remove("dragged-over")})),this.overlay=M(".editor-group-overlay-indicator"),t.appendChild(this.overlay),this.enableDropIntoEditor&&(this.dropIntoPromptElement=DD(c(3309,"Hold __{0}__ to drop into editor",Ke?"⇧":"Shift"),{}),this.dropIntoPromptElement.classList.add("editor-group-overlay-drop-into-prompt"),this.overlay.appendChild(this.dropIntoPromptElement)),this.registerListeners(t),this.updateStyles()}updateStyles(){const e=ge(this.overlay);e.style.backgroundColor=this.getColor(sw)||"";const t=this.getColor(Cw);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(AD)??"",this.dropIntoPromptElement.style.color=this.getColor(TD)??"";const i=this.getColor(kD);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 Yd(e,{onDragOver:t=>{if(this.enableDropIntoEditor&&e_(t)){this.dispose();return}const i=this.groupTransfer.hasData(Gt.prototype),s=this.editorTransfer.hasData(mt.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(mt.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=>{be.stop(t,!0),this.dispose(),this.currentDropOperation&&this.handleDrop(t,this.currentDropOperation.splitDirection)}})),this._register(z(e,ee.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}isDropIntoActiveEditorEnabled(){return!!this.groupView.activeEditor?.hasCapability($t.CanDropIntoEditor)}findSourceGroupView(){if(this.groupTransfer.hasData(Gt.prototype)){const e=this.groupTransfer.getData(Gt.prototype);if(Array.isArray(e)&&e.length>0)return this.editorGroupService.getGroup(e[0].identifier)}else if(this.editorTransfer.hasData(mt.prototype)){const e=this.editorTransfer.getData(mt.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(Gt.prototype)){const s=this.groupTransfer.getData(Gt.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:Cr.COPY_EDITORS}),this.editorGroupService.mergeGroup(o,this.groupView,r)}n&&this.editorGroupService.activateGroup(n)}this.groupTransfer.clearData(Gt.prototype)}}else if(this.editorTransfer.hasData(mt.prototype)){const s=this.editorTransfer.getData(mt.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=pu(this.groupView,o.map(p=>p.identifier.editor));d?r.copyEditors(h,l):r.moveEditors(h,l)}l.focus()}this.editorTransfer.clearData(mt.prototype)}}else if(this.treeItemsTransfer.hasData(xs.prototype)){const s=this.treeItemsTransfer.getData(xs.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 VC(r);o.push(...d.map(l=>({...l,options:{...l.options,pinned:!0}})))}}o.length&&this.editorService.openEditors(o,i(),{validateTrust:!0})}this.treeItemsTransfer.clearData(xs.prototype)}else this.instantiationService.createInstance(PC,{allowWorkspaceOpen:!Wi||xD(this.contextService.getWorkspace())}).handleDrop(e,Ue(this.groupView.element),()=>i(),o=>o?.focus())}isCopyOperation(e,t){return t?.editor.hasCapability($t.Singleton)?!1:e.ctrlKey&&!Ke||e.altKey&&Ke}isToggleSplitOperation(e){return e.altKey&&!Ke||e.shiftKey&&Ke}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,g=n/3,f=r/3;let w;switch(e>h&&e<n-h&&t>p&&t<r-p?w=void 0:o?e<g?w=Y.LEFT:e>g*2?w=Y.RIGHT:t<r/2?w=Y.UP:w=Y.DOWN:t<f?w=Y.UP:t>f*2?w=Y.DOWN:e<n/2?w=Y.LEFT:w=Y.RIGHT,w){case Y.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case Y.DOWN:this.doPositionOverlay({top:"50%",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case Y.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"}),this.toggleDropIntoPrompt(!1);break;case Y.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=ge(this.overlay);v.style.opacity="1",setTimeout(()=>v.classList.add("overlay-move-transition"),0),this.currentDropOperation={splitDirection:w}}doPositionOverlay(e){const[t,i]=Po(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=ge(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}},Gg=Yn,Yn.OVERLAY_ID="monaco-workbench-editor-drop-overlay",Yn);Wg=Gg=_([u(1,me),u(2,se),u(3,K),u(4,O),u(5,U),u(6,Sw),u(7,fi)],Wg);let Kg=class extends Cc{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=Vs.getInstance(),this.groupTransfer=Vs.getInstance(),this.registerListeners()}get overlay(){if(this._overlay&&!this._overlay.disposed)return this._overlay}registerListeners(){this._register(z(this.container,ee.DRAG_ENTER,e=>this.onDragEnter(e))),this._register(z(this.container,ee.DRAG_LEAVE,()=>this.onDragLeave()));for(const e of[this.container,Ue(this.container)])this._register(z(e,ee.DRAG_END,()=>this.onDragEnd()))}onDragEnter(e){if(QE(this.configurationService)&&e_(e))return;if(this.counter++,!this.editorTransfer.hasData(mt.prototype)&&!this.groupTransfer.hasData(Gt.prototype)&&e.dataTransfer){const i=ie.as(_D.DragAndDropContribution).getAll(),s=Array.from(i).map(o=>o.dataFormatKey);if(!ID(e,da.FILES,Fp.FILES,da.RESOURCES,Fp.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(Wg,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=>Oa(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)}};Kg=_([u(2,U),u(3,me),u(4,se),u(5,K)],Kg);const hd={targetWidth:900,leftMarginRatio:.1909,rightMarginRatio:.1909},wp={type:"distribute"};function sy(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:W.None}}function TP(a,e){return{element:a.element,get maximumSize(){return a.maximumWidth},get minimumSize(){return a.minimumWidth},onDidChange:W.map(a.onDidChange,t=>t&&t.width),layout:(t,i,s)=>a.layout(t,e(),s?.top??0,(s?.left??0)+i)}}class kP{constructor(e,t,i={...hd},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 F,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 jd(this.container,{inverseAltBehavior:!0,orientation:de.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={...hd},this.resizeSplitViews()})),this.splitView.layout(this.lastLayoutPosition.width,this.lastLayoutPosition);const t=this.style?this.style.background:void 0;this.emptyViews=[sy(t),sy(t)],this.splitView.addView(this.emptyViews[0],wp,0),this.splitView.addView(TP(this.view,()=>this.lastLayoutPosition.height),wp,1),this.splitView.addView(this.emptyViews[1],wp,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===hd.targetWidth:e.leftMarginRatio===hd.leftMarginRatio&&e.rightMarginRatio===hd.rightMarginRatio}dispose(){this.splitViewDisposables.dispose(),this.splitView&&(this.splitView.dispose(),this.splitView=void 0)}}var Qs;class xP{constructor(){this.element=M(".grid-view-container"),this._onDidChange=new ho,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=W.None,this._gridWidget=e}layout(e,t,i,s){this.gridWidget?.layout(e,t,i,s)}dispose(){this._onDidChange.dispose()}}var Ho;let eh=(Ho=class extends Wy{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 A),this.onDidFocus=this._onDidFocus.event,this._onDidLayout=this._register(new A),this.onDidLayout=this._onDidLayout.event,this._onDidChangeActiveGroup=this._register(new A),this.onDidChangeActiveGroup=this._onDidChangeActiveGroup.event,this._onDidChangeGroupIndex=this._register(new A),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLabel=this._register(new A),this.onDidChangeGroupLabel=this._onDidChangeGroupLabel.event,this._onDidChangeGroupLocked=this._register(new A),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new A),this.onDidChangeGroupMaximized=this._onDidChangeGroupMaximized.event,this._onDidActivateGroup=this._register(new A),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidAddGroup=this._register(new Bp),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new Bp),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new A),this.onDidMoveGroup=this._onDidMoveGroup.event,this.onDidSetGridWidget=this._register(new A),this._onDidChangeSizeConstraints=this._register(new ho),this.onDidChangeSizeConstraints=W.any(this.onDidSetGridWidget.event,this._onDidChangeSizeConstraints.event),this._onDidScroll=this._register(new ho),this.onDidScroll=W.any(this.onDidSetGridWidget.event,this._onDidScroll.event),this._onDidChangeEditorPartOptions=this._register(new A),this.onDidChangeEditorPartOptions=this._onDidChangeEditorPartOptions.event,this._onWillDispose=this._register(new A),this.onWillDispose=this._onWillDispose.event,this.workspaceMemento=this.getMemento(te.WORKSPACE,Ze.USER),this.profileMemento=this.getMemento(te.PROFILE,Ze.MACHINE),this.groupViews=new Map,this.mostRecentActiveGroups=[],this.container=M(".content"),this.gridWidgetDisposables=this._register(new F),this.gridWidgetView=this._register(new xP),this.enforcedPartOptions=[],this.top=0,this.left=0,this.sideGroup={openEditor:(g,f)=>{const[w]=this.scopedInstantiationService.invokeFunction(v=>dE(v,{editor:g,options:f},br));return w.openEditor(g,f)}},this._isReady=!1,this.whenReadyPromise=new tn,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new tn,this.whenRestored=this.whenRestoredPromise.p,this._willRestoreState=!1,this.priority=Ds.High,this.scopedContextKeyService=this._register(this.contextKeyService.createScoped(this.container)),this.scopedInstantiationService=this._register(this.instantiationService.createChild(new fr([re,this.scopedContextKeyService]))),this._partOptions=Kb(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(te.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e)))}onConfigurationUpdated(e){RD(e)&&this.handleChangedPartOptions()}handleChangedPartOptions(){const e=this._partOptions,t=Kb(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(),he(()=>{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===de.VERTICAL?ci.VERTICAL:ci.HORIZONTAL}get isReady(){return this._isReady}get hasRestorableState(){return!!this.workspaceMemento[Qs.EDITOR_PART_UI_STATE_STORAGE_KEY]}get willRestoreState(){return this._willRestoreState}getGroups(e=Oe.CREATION_TIME){switch(e){case Oe.CREATION_TIME:return this.groups;case Oe.MOST_RECENTLY_ACTIVE:{const t=xi(this.mostRecentActiveGroups.map(i=>this.getGroup(i)));return Go([...t,...this.groups])}case Oe.GRID_APPEARANCE:{const t=[];return this.gridWidget&&this.fillGridNodes(t,this.gridWidget.getViews()),t}}}fillGridNodes(e,t){Vn(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(Oe.GRID_APPEARANCE),n=o.indexOf(s);switch(e){case Ye.FIRST:return o[0];case Ye.LAST:return o[o.length-1];case Ye.NEXT:{let r=o[n+1];return!r&&i&&(r=this.doFindGroupByLocation(Ye.FIRST,t)),r}case Ye.PREVIOUS:{let r=o[n-1];return!r&&i&&(r=this.doFindGroupByLocation(Ye.LAST,t)),r}}}activateGroup(e,t){const i=this.assertGroupView(e);return this.doSetGroupActive(i),t||this.hostService.moveTop(Ue(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 Oi.EVEN:this.gridWidget.distributeViewSizes();break;case Oi.MAXIMIZE:if(this.groups.length<2)return;this.gridWidget.maximizeView(i),i.focus();break;case Oi.EXPAND:this.gridWidget.expandView(i);break}}toggleMaximizeGroup(e=this.activeGroup){this.hasMaximizedGroup()?this.unmaximizeGroup():this.arrangeGroups(Oi.MAXIMIZE,e)}toggleExpandGroup(e=this.activeGroup){this.isGroupExpanded(this.activeGroup)?this.arrangeGroups(Oi.EVEN):this.arrangeGroups(Oi.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===ci.HORIZONTAL?de.HORIZONTAL:de.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(Oe.GRID_APPEARANCE);if(i<o.length){const d=o[i-1];o.forEach((l,h)=>{h>=i&&this.mergeGroup(l,d)}),o=this.getGroups(Oe.GRID_APPEARANCE)}const n=this.activeGroup,r=vE({orientation:this.toGridViewOrientation(e.orientation,this.isTwoDimensionalGrid()?this.gridWidget.orientation:Ls(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===de.HORIZONTAL?ci.HORIZONTAL:ci.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?sn()===e.ownerDocument.body?!0:aC(e):!1}isTwoDimensionalGrid(){const e=this.gridWidget.getViews();return Vn(e)?e.children.some(t=>Vn(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(Oi.EXPAND,o),n&&s.focus()}else o=s.groupsView.addGroup(s,t,i);return o}getSplitSizingStyle(){switch(this._partOptions.splitSizing){case"distribute":return ua.Distribute;case"split":return ua.Split;default:return ua.Auto}}doCreateGroupView(e,t){let i;e instanceof Xr?i=Xr.createCopy(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):FC(e)?i=Xr.createFromSerialized(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):i=Xr.createNew(this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t),this.groupViews.set(i.id,i);const s=new F;return s.add(i.onDidFocus(()=>{this.doSetGroupActive(i),this._onDidFocus.fire()})),s.add(i.onDidModelChange(o=>{switch(o.kind){case at.GROUP_LOCKED:this._onDidChangeGroupLocked.fire(i);break;case at.GROUP_INDEX:this._onDidChangeGroupIndex.fire(i);break;case at.GROUP_LABEL:this._onDidChangeGroupLabel.fire(i);break}})),s.add(i.onDidActiveEditorChange(()=>{this.updateContainer()})),W.once(i.onWillDispose)(()=>{qe(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(Oi.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 Y.UP:return Ee.Up;case Y.DOWN:return Ee.Down;case Y.LEFT:return Ee.Left;case Y.RIGHT:return Ee.Right}}toGridViewOrientation(e,t){return typeof e=="number"?e===ci.HORIZONTAL?de.HORIZONTAL:de.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(Oe.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(Oe.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===Cr.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(Oe.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 LD(Sr(e)),this.scopedInstantiationService.createInstance(Kg,e,t)}get minimumWidth(){return Math.min(this.centeredLayoutWidget.minimumWidth,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(Ue(this.container))).width)}get maximumWidth(){return this.centeredLayoutWidget.maximumWidth}get minimumHeight(){return Math.min(this.centeredLayoutWidget.minimumHeight,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(Ue(this.container))).height)}get maximumHeight(){return this.centeredLayoutWidget.maximumHeight}get snap(){return this.layoutService.getPanelAlignment()==="center"}get onDidChange(){return W.any(this.centeredLayoutWidget.onDidChange,this.onDidSetGridWidget.event)}get gridSeparatorBorder(){return this.theme.getColor(VD)||this.theme.getColor(zi)||Ii.transparent}updateStyles(){this.container.style.backgroundColor=this.getColor(Iw)||"";const e={separatorBorder:this.gridSeparatorBorder,background:this.theme.getColor(PD)||Ii.transparent};this.gridWidget.style(e),this.centeredLayoutWidget.styles(e)}createContentArea(e,t){return this.element=e,this.windowId!==ve.vscodeWindowId&&this.container.classList.add("auxiliary"),e.appendChild(this.container),this._willRestoreState=!t||t.restorePreviousState,this.doCreateGridControl(),this.centeredLayoutWidget=this._register(new kP(this.container,this.gridWidgetView,this.profileMemento[Qs.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,bu.settled(this.groups.map(i=>i.whenRestored)).finally(()=>{this.whenRestoredPromise.complete()}),this.container}handleContextKeys(){gn.bindTo(this.scopedContextKeyService).set(this.windowId!==ve.vscodeWindowId);const t=_c.bindTo(this.scopedContextKeyService),i=No.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(OD(i,()=>i.classList.remove("visible"))),this._register(pl.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(H.PANEL_PART)&&h===this.layoutService.getPanelPosition()?this.layoutService.setPartHidden(!1,H.PANEL_PART):!this.layoutService.isVisible(H.AUXILIARYBAR_PART)&&h===(this.layoutService.getSideBarPosition()===di.RIGHT?di.LEFT:di.RIGHT)&&this.layoutService.setPartHidden(!1,H.AUXILIARYBAR_PART)},l=()=>{s&&(clearTimeout(s),s=void 0),o&&(clearTimeout(o),o=void 0)};this._register(pl.INSTANCE.registerTarget(i,{onDragOver:h=>{be.stop(h.eventData,!0),h.eventData.dataTransfer&&(h.eventData.dataTransfer.dropEffect="none");const p=i.getBoundingClientRect();let g,f;const w=100;h.eventData.clientX<p.left+w&&(g=di.LEFT),h.eventData.clientX>p.right-w&&(g=di.RIGHT),h.eventData.clientY>p.bottom-w&&(f=di.BOTTOM),h.eventData.clientY<p.top+w&&(f=di.TOP),s&&g!==n&&(clearTimeout(s),s=void 0),o&&f!==r&&(clearTimeout(o),o=void 0),!s&&g!==void 0&&(n=g,s=setTimeout(()=>d(g),200)),!o&&f!==void 0&&(r=f,o=setTimeout(()=>d(f),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 Bo(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 on(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=Bo.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(Oe.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(Ne.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[Qs.EDITOR_PART_UI_STATE_STORAGE_KEY]:this.workspaceMemento[Qs.EDITOR_PART_UI_STATE_STORAGE_KEY]=this.createState()),this.centeredLayoutWidget){const e=this.centeredLayoutWidget.state;this.centeredLayoutWidget.isDefault(e)?delete this.profileMemento[Qs.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]:this.profileMemento[Qs.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]=e}super.saveState()}loadState(){return this.workspaceMemento[Qs.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(Oe.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(Oe.GRID_APPEARANCE))i?.includes(o)||this._onDidAddGroup.fire(o);this.notifyGroupIndexChange()}onDidChangeMementoState(e){if(e.external&&e.scope===te.WORKSPACE){this.reloadMemento(e.scope);const t=this.loadState();t&&this.applyState(t)}}toJSON(){return{type:H.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()}},Qs=Ho,Ho.EDITOR_PART_UI_STATE_STORAGE_KEY="editorpart.state",Ho.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY="editorpart.centeredview",Ho);eh=Qs=_([u(4,K),u(5,me),u(6,se),u(7,pe),u(8,st),u(9,Nt),u(10,re)],eh);let Ug=class extends eh{constructor(e,t,i,s,o,n,r,d){super(e,H.EDITOR_PART,"",ve.vscodeWindowId,t,i,s,o,n,r,d)}};Ug=_([u(1,K),u(2,me),u(3,se),u(4,pe),u(5,st),u(6,Nt),u(7,re)],Ug);var Wr,Hg;const Uu=ND(new A);E(class extends V{constructor(){super({id:"workbench.action.toggleCompactAuxiliaryWindow",title:y(2959,"Toggle Window Compact Mode"),category:R.View,f1:!0,precondition:AC})}async run(){Uu.fire({windowId:an().vscodeWindowId,compact:"toggle"})}});E(class extends V{constructor(){super({id:"workbench.action.enableCompactAuxiliaryWindow",title:c(2960,"Turn On Compact Mode"),icon:P.screenFull,menu:{id:b.LayoutControlMenu,when:D.and(UC.toNegated(),gn),order:0}})}async run(){Uu.fire({windowId:an().vscodeWindowId,compact:!0})}});E(class extends V{constructor(){super({id:"workbench.action.disableCompactAuxiliaryWindow",title:c(2961,"Turn Off Compact Mode"),icon:P.screenNormal,menu:{id:b.LayoutControlMenu,when:D.and(UC,gn),order:0}})}async run(){Uu.fire({windowId:an().vscodeWindowId,compact:!1})}});var Xn;let zg=(Xn=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 F;let o=!!t?.compact;function n(){let Z=0;return G&&(Z+=T.height),w&&v&&(Z+=w.height),Z}function r(Z){G?Ra(T.container):mr(T.container),Z&&h.layout()}function d(Z){w&&(v?Ra(w.container):mr(w.container),Z&&h.layout())}function l(Z){if(Z===o)return;o=Z,h.updateOptions({compact:o}),w?.updateOptions({compact:o}),g.updateOptions({compact:o});const j=G;G=!o&&i.configurationService.getValue(Wr.STATUS_BAR_VISIBILITY)!==!1,j!==G&&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 g=s.add(this.instantiationService.createInstance($g,h.window.vscodeWindowId,this.editorPartsView,t?.state,e));g.updateOptions({compact:o}),s.add(this.editorPartsView.registerPart(g)),g.create(p);const f=s.add(g.scopedInstantiationService.createChild(new fr([O,this.editorService.createScoped(g,s)])));let w,v=!1;if(vw&&FD()){w=s.add(this.titleService.createAuxiliaryTitlebarPart(h.container,g,f)),w.updateOptions({compact:o}),v=Ub(this.configurationService,h.window,void 0);const Z=()=>{const j=v;v=Ub(this.configurationService,h.window,void 0),j!==v&&d(!0)};s.add(w.onDidChange(()=>h.layout())),s.add(this.layoutService.onDidChangePartVisibility(()=>Z())),s.add(KC(j=>{j===h.window.vscodeWindowId&&Z()})),d(!1)}else s.add(f.createInstance(MD,h.window));const T=s.add(this.statusbarService.createAuxiliaryStatusbarPart(h.container,f));let G=!o&&this.configurationService.getValue(Wr.STATUS_BAR_VISIBILITY)!==!1;s.add(this.configurationService.onDidChangeConfiguration(Z=>{Z.affectsConfiguration(Wr.STATUS_BAR_VISIBILITY)&&(G=!o&&this.configurationService.getValue(Wr.STATUS_BAR_VISIBILITY)!==!1,r(!0))})),r(!1);const B=s.add(W.once(g.onWillClose)(()=>h.window.close()));s.add(W.once(h.onUnload)(()=>{s.isDisposed||(B.dispose(),g.close(),s.dispose())})),s.add(W.once(this.lifecycleService.onDidShutdown)(()=>s.dispose())),s.add(h.onBeforeUnload(Z=>{for(const j of g.groups)for(const Q of j.editors){const q=Q.canMove(j.id,this.editorPartsView.mainPart.activeGroup.id);if(typeof q=="string"){j.openEditor(Q),Z.veto(q);break}}})),s.add(h.onWillLayout(Z=>{const j=w?.height??0;w?.layout(Z.width,j,0,0);const Q=Z.height-n();g.layout(Z.width,Q,j,0),T.layout(Z.width,T.height,Z.height-T.height,0)})),h.layout(),s.add(Uu.event(Z=>{if(Z.windowId===h.window.vscodeWindowId){let j;typeof Z.compact=="boolean"?j=Z.compact:j=!o,l(j)}}));const X=s.add(f.createChild(new fr([Fs,this.statusbarService.createScoped(T,s)])));return{part:g,instantiationService:X,disposables:s}}},Wr=Xn,Xn.STATUS_BAR_VISIBILITY="workbench.statusBar.visible",Xn);zg=Wr=_([u(1,K),u(2,Dw),u(3,Qa),u(4,se),u(5,Fs),u(6,BD),u(7,O),u(8,st)],zg);var Jn;let $g=(Jn=class extends eh{constructor(e,t,i,s,o,n,r,d,l,h,p){const g=Hg.COUNTER++;super(t,`workbench.parts.auxiliaryEditor.${g}`,s,e,o,n,r,d,l,h,p),this.state=i,this._onWillClose=this._register(new A),this.onWillClose=this._onWillClose.event,this.optionsDisposable=this._register(new ke),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(Oe.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(Oe.MOST_RECENTLY_ACTIVE))if(!i.isLocked){e=i;break}e||(e=this.editorPartsView.mainPart.addGroup(this.editorPartsView.mainPart.activeGroup,this.partOptions.openSideBySideDirection==="right"?Y.RIGHT:Y.DOWN));const t=this.mergeAllGroups(e,{preserveExistingIndex:!0});return e.focus(),t}},Hg=Jn,Jn.COUNTER=1,Jn);$g=Hg=_([u(4,K),u(5,me),u(6,se),u(7,pe),u(8,st),u(9,Nt),u(10,re)],$g);var Sn,zo;let oy=(zo=class extends GD{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 A),this.onDidCreateAuxiliaryEditorPart=this._onDidCreateAuxiliaryEditorPart.event,this.workspaceMemento=this.getMemento(te.WORKSPACE,Ze.USER),this._isReady=!1,this.whenReadyPromise=new tn,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new tn,this.whenRestored=this.whenRestoredPromise.p,this._onDidActiveGroupChange=this._register(new A),this.onDidChangeActiveGroup=this._onDidActiveGroupChange.event,this._onDidAddGroup=this._register(new A),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new A),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new A),this.onDidMoveGroup=this._onDidMoveGroup.event,this._onDidActivateGroup=this._register(new A),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidChangeGroupIndex=this._register(new A),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLocked=this._register(new A),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new A),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 Il),this.editorWorkingSets=(()=>{const n=this.storageService.get(Sn.EDITOR_WORKING_SETS_STORAGE_KEY,te.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(te.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e))),this.whenReady.then(()=>this.registerGroupsContextKeyListeners())}createMainEditorPart(){return this.instantiationService.createInstance(Ug,this)}getScopedInstantiationService(e){return e===this.mainPart&&(this.mapPartToInstantiationService.has(e.windowId)||this.instantiationService.invokeFunction(t=>{const i=t.get(O),s=t.get(Fs);this.mapPartToInstantiationService.set(e.windowId,this._register(this.mainPart.scopedInstantiationService.createChild(new fr([O,i.createScoped(this.mainPart,this._store)],[Fs,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(zg,this).create(this.getGroupsLabel(this._parts.size),e);return this.mapPartToInstantiationService.set(t.windowId,i),s.add(he(()=>this.mapPartToInstantiationService.delete(t.windowId))),this._onDidAddGroup.fire(t.activeGroup),this._onDidCreateAuxiliaryEditorPart.fire(t),t}registerPart(e){const t=this._register(new F);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(he(()=>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(3332,"Window {0}",e+1)}getPart(e){if(this._parts.size>1)if(Sr(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[Sn.EDITOR_PARTS_UI_STATE_STORAGE_KEY]}saveState(){const e=this.createState();e.auxiliary.length===0?delete this.workspaceMemento[Sn.EDITOR_PARTS_UI_STATE_STORAGE_KEY]:this.workspaceMemento[Sn.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===te.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(Oe.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:ed(),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(Sn.EDITOR_WORKING_SETS_STORAGE_KEY,JSON.stringify(this.editorWorkingSets),te.WORKSPACE,Ze.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=Oe.CREATION_TIME){if(this._parts.size>1){let t;switch(e){case Oe.GRID_APPEARANCE:case Oe.CREATION_TIME:t=this.parts;break;case Oe.MOST_RECENTLY_ACTIVE:t=Go([...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(Oe.GRID_APPEARANCE);if(e.location===Ye.FIRST||e.location===Ye.LAST)return e.location===Ye.FIRST?o[0]:o[o.length-1];const n=s.findGroup(e,t,!1);if(n)return n;if(e.location===Ye.NEXT||e.location===Ye.PREVIOUS){const r=this.assertGroupView(t),d=o.indexOf(r);if(e.location===Ye.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 he(()=>{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)}},Sn=zo,zo.EDITOR_PARTS_UI_STATE_STORAGE_KEY="editorparts.state",zo.EDITOR_WORKING_SETS_STORAGE_KEY="editor.workingSets",zo);oy=Sn=_([u(0,K),u(1,pe),u(2,me),u(3,Dw),u(4,re)],oy);var qg;Te($D);var Zn;let jg=(Zn=class extends Jd{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,g,f,w){super(H.PANEL_PART,{hasTitle:!0},qg.activePanelSettingsKey,WD.bindTo(h),KD.bindTo(h),"panel","panel",void 0,UD,e,t,i,s,o,n,r,d,l,h,p,f),this.commandService=g,this.configurationService=w,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=ge(this.getContainer());e.style.backgroundColor=this.getColor(ep)||"";const t=this.getColor(Dl)||this.getColor(zi)||"";e.style.borderLeftColor=t,e.style.borderRightColor=t,e.style.borderBottomColor=t;const i=this.getTitleArea();i&&(i.style.borderTopColor=this.getColor(Dl)||this.getColor(zi)||"")}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:Ar.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.layoutService.getPanelPosition()===di.BOTTOM&&!this.layoutService.isPanelMaximized()?La.ABOVE:La.BELOW},fillExtraContextMenuActions:e=>this.fillExtraContextMenuActions(e),compositeSize:0,iconSize:16,compact:!0,overflowActionSize:44,colors:e=>({activeBackgroundColor:e.getColor(ep),inactiveBackgroundColor:e.getColor(ep),activeBorderBottomColor:e.getColor(sC),activeForegroundColor:e.getColor(tC),inactiveForegroundColor:e.getColor(Qy),badgeBackground:e.getColor(zD),badgeForeground:e.getColor(HD),dragAndDropBorder:e.getColor(Yy)})}}fillExtraContextMenuActions(e){if(this.getCompositeBarPosition()===Re.TITLE){const d=this.getViewsSubmenuAction();d&&(e.push(new go),e.push(d))}const t=this.menuService.getMenuActions(b.PanelPositionMenu,this.contextKeyService,{shouldForwardArgs:!0}),i=this.menuService.getMenuActions(b.PanelAlignmentMenu,this.contextKeyService,{shouldForwardArgs:!0}),s=ml(t).secondary,o=ml(i).secondary,n=this.configurationService.getValue("workbench.panel.showLabels"),r=lo({id:"workbench.action.panel.toggleShowLabels",label:n?c(3532,"Show Icons"):c(3533,"Show Labels"),run:()=>this.configurationService.updateValue("workbench.panel.showLabels",!n)});e.push(new go,new gl("workbench.action.panel.position",c(3534,"Panel Position"),s),new gl("workbench.action.panel.align",c(3535,"Align Panel"),o),r,lo({id:Hb.ID,label:c(3536,"Hide Panel"),run:()=>this.commandService.executeCommand(Hb.ID)}))}layout(e,t,i,s){let o;switch(this.layoutService.getPanelPosition()){case di.RIGHT:o=new Ne(e-1,t);break;case di.TOP:o=new Ne(e,t-1);break;default:o=new Ne(e,t);break}super.layout(o.width,o.height,i,s)}shouldShowCompositeBar(){return!0}getCompositeBarPosition(){return Re.TITLE}toJSON(){return{type:H.PANEL_PART}}},qg=Zn,Zn.activePanelSettingsKey="workbench.panelpart.activepanelid",Zn);jg=qg=_([u(0,Qe),u(1,pe),u(2,bt),u(3,st),u(4,ot),u(5,ei),u(6,K),u(7,me),u(8,_t),u(9,re),u(10,Qt),u(11,Xe),u(12,Ks),u(13,se)],jg);const t_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(t_);E(class extends V{constructor(){super({id:"workbench.action.closeSidebar",title:y(3537,"Close Primary Side Bar"),category:R.View,f1:!0,precondition:yw})}run(a){a.get(st).setPartHidden(!0,H.SIDEBAR_PART)}});class RP extends V{constructor(){super({id:"workbench.action.focusSideBar",title:y(3538,"Focus into Primary Side Bar"),category:R.View,f1:!0,keybinding:{weight:x.WorkbenchContrib,when:null,primary:S.CtrlCmd|m.Digit0}})}async run(e){const t=e.get(st),i=e.get(fn);t.isVisible(H.SIDEBAR_PART)||t.setPartHidden(!1,H.SIDEBAR_PART),i.getActivePaneComposite(ae.Sidebar)?.focus()}}E(RP);var Yg;Te(t_);var Qn;let Xg=(Qn=class extends Jd{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,g,f){super(H.SIDEBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(fl)||this.getColor(zi)?1:0},Yg.activeViewletSettingsKey,qD.bindTo(h),jD.bindTo(h),"sideBar","viewlet",YD,qy,e,t,i,s,o,n,r,d,l,h,p,f),this.configurationService=g,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Ds.Low,this.activityBarPart=this._register(this.instantiationService.createInstance(Kc,this)),this.rememberActivityBarVisiblePosition(),this._register(g.onDidChangeConfiguration(w=>{w.affectsConfiguration(vi.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=ge(this.getContainer());e.style.backgroundColor=this.getColor(ra)||"",e.style.color=this.getColor(jy)||"";const t=this.getColor(fl)||this.getColor(zi),i=this.layoutService.getSideBarPosition()===di.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(XD)??""}layout(e,t,i,s){this.layoutService.isVisible(H.SIDEBAR_PART)&&super.layout(e,t,i,s)}getTitleAreaDropDownAnchorAlignment(){return this.layoutService.getSideBarPosition()===di.LEFT?ul.LEFT:ul.RIGHT}createCompositeBar(){return this.instantiationService.createInstance(JD,this.getCompositeBarOptions(),this.partId,this,!1)}getCompositeBarOptions(){return{partContainerClass:"sidebar",pinnedViewContainersKey:Kc.pinnedViewContainersKey,placeholderViewContainersKey:Kc.placeholderViewContainersKey,viewContainersWorkspaceStateKey:Kc.viewContainersWorkspaceStateKey,icon:!0,orientation:Ar.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===Re.BOTTOM?La.ABOVE:La.BELOW},fillExtraContextMenuActions:e=>{if(this.getCompositeBarPosition()===Re.TITLE){const t=this.getViewsSubmenuAction();t&&(e.push(new go),e.push(t))}},compositeSize:0,iconSize:16,overflowActionSize:30,colors:e=>({activeBackgroundColor:e.getColor(ra),inactiveBackgroundColor:e.getColor(ra),activeBorderBottomColor:e.getColor(oC),activeForegroundColor:e.getColor(iC),inactiveForegroundColor:e.getColor(eC),badgeBackground:e.getColor(Zy),badgeForeground:e.getColor(Jy),dragAndDropBorder:e.getColor(Xy)}),compact:!0}}shouldShowCompositeBar(){const e=this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION);return e===dt.TOP||e===dt.BOTTOM}shouldShowActivityBar(){return this.shouldShowCompositeBar()?!1:this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION)!==dt.HIDDEN}getCompositeBarPosition(){switch(this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION)){case dt.TOP:return Re.TOP;case dt.BOTTOM:return Re.BOTTOM;case dt.HIDDEN:case dt.DEFAULT:default:return Re.TITLE}}rememberActivityBarVisiblePosition(){const e=this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION);e!==dt.HIDDEN&&this.storageService.store(vi.ACTIVITY_BAR_LOCATION,e,te.PROFILE,Ze.USER)}getRememberedActivityBarVisiblePosition(){switch(this.storageService.get(vi.ACTIVITY_BAR_LOCATION,te.PROFILE)){case dt.TOP:return dt.TOP;case dt.BOTTOM:return dt.BOTTOM;default:return dt.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(vi.ACTIVITY_BAR_LOCATION)===dt.HIDDEN&&(await this.configurationService.updateValue(vi.ACTIVITY_BAR_LOCATION,this.getRememberedActivityBarVisiblePosition()),this.onDidChangeActivityBarLocation()),this.shouldShowCompositeBar()?this.focusCompositeBar():(this.layoutService.isVisible(H.ACTIVITYBAR_PART)||this.layoutService.setPartHidden(!1,H.ACTIVITYBAR_PART),this.activityBarPart.show(!0))}registerActions(){const e=this;this._register(E(class extends V{constructor(){super({id:ZD,title:y(3539,"Toggle Activity Bar Visibility")})}run(){const t=e.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION)===dt.HIDDEN?e.getRememberedActivityBarVisiblePosition():dt.HIDDEN;return e.configurationService.updateValue(vi.ACTIVITY_BAR_LOCATION,t)}}))}toJSON(){return{type:H.SIDEBAR_PART}}},Yg=Qn,Qn.activeViewletSettingsKey="workbench.sidebar.activeviewletid",Qn);Xg=Yg=_([u(0,Qe),u(1,pe),u(2,bt),u(3,st),u(4,ot),u(5,ei),u(6,K),u(7,me),u(8,_t),u(9,re),u(10,Qt),u(11,se),u(12,Ks)],Xg);let Jg=class extends N{constructor(e,t,i){super(),this.viewId=e,this.viewDescriptorService=t,this.activityService=i,this.activity=void 0,this.activityDisposable=N.None,this._register(W.filter(this.viewDescriptorService.onDidChangeContainer,s=>s.views.some(o=>o.id===e))(()=>this.update())),this._register(W.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()}};Jg=_([u(1,_t),u(2,mn)],Jg);let Zg=class extends N{constructor(e,t){super(),this.viewDescriptorService=e,this.instantiationService=t,this.viewActivities=new Map,this._onDidChangeActivity=this._register(new A),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 N.None;let s=this.viewContainerActivities.get(e);return s||(s=[],this.viewContainerActivities.set(e,s)),s.push(t),this._onDidChangeActivity.fire(i),he(()=>{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(Jg,e)},this.viewActivities.set(e,i));const s=i.id;i.activity.setActivity(t);const o=i;return he(()=>{o.id===s&&(o.activity.dispose(),this.viewActivities.delete(e))})}showAccountsActivity(e){return this.showActivity(QD,e)}showGlobalActivity(e){return this.showActivity(eA,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),he(()=>{i.splice(i.indexOf(t),1),i.length===0&&this.globalActivities.delete(e),this._onDidChangeActivity.fire(e)})}};Zg=_([u(0,_t),u(1,K)],Zg);class rc{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=Si.lowerCaseToEnum(o);return[new Fo(t.ctrl,t.shift,t.alt,t.meta,n),t.remains]}const s=Pt.fromUserSettings(t.key);return[new Wo(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 tA(t):null}}const i_=[{key:"commandPalette",id:b.CommandPalette,description:c(12723,"The Command Palette"),supportsSubmenus:!1},{key:"touchBar",id:b.TouchBarContext,description:c(12724,"The touch bar (macOS only)"),supportsSubmenus:!1},{key:"editor/title",id:b.EditorTitle,description:c(12725,"The editor title menu")},{key:"editor/title/run",id:b.EditorTitleRun,description:c(12726,"Run submenu inside the editor title menu")},{key:"editor/context",id:b.EditorContext,description:c(12727,"The editor context menu")},{key:"editor/context/copy",id:b.EditorContextCopy,description:c(12728,"'Copy as' submenu in the editor context menu")},{key:"editor/context/share",id:b.EditorContextShare,description:c(12729,"'Share' submenu in the editor context menu"),proposed:"contribShareMenu"},{key:"explorer/context",id:b.ExplorerContext,description:c(12730,"The file explorer context menu")},{key:"explorer/context/share",id:b.ExplorerContextShare,description:c(12731,"'Share' submenu in the file explorer context menu"),proposed:"contribShareMenu"},{key:"editor/title/context",id:b.EditorTitleContext,description:c(12732,"The editor tabs context menu")},{key:"editor/title/context/share",id:b.EditorTitleContextShare,description:c(12733,"'Share' submenu inside the editor title context menu"),proposed:"contribShareMenu"},{key:"debug/callstack/context",id:b.DebugCallStackContext,description:c(12734,"The debug callstack view context menu")},{key:"debug/variables/context",id:b.DebugVariablesContext,description:c(12735,"The debug variables view context menu")},{key:"debug/watch/context",id:b.DebugWatchContext,description:c(12736,"The debug watch view context menu")},{key:"debug/toolBar",id:b.DebugToolBar,description:c(12737,"The debug toolbar menu")},{key:"debug/createConfiguration",id:b.DebugCreateConfiguration,proposed:"contribDebugCreateConfiguration",description:c(12738,"The debug create configuration menu")},{key:"notebook/variables/context",id:b.NotebookVariablesContext,description:c(12739,"The notebook variables view context menu")},{key:"menuBar/home",id:b.MenubarHomeMenu,description:c(12740,"The home indicator context menu (web only)"),proposed:"contribMenuBarHome",supportsSubmenus:!1},{key:"menuBar/edit/copy",id:b.MenubarCopy,description:c(12741,"'Copy as' submenu in the top level Edit menu")},{key:"scm/title",id:b.SCMTitle,description:c(12742,"The Source Control title menu")},{key:"scm/sourceControl",id:b.SCMSourceControl,description:c(12743,"The Source Control menu")},{key:"scm/sourceControl/title",id:b.SCMSourceControlTitle,description:c(12744,"The Source Control title menu"),proposed:"contribSourceControlTitleMenu"},{key:"scm/resourceState/context",id:b.SCMResourceContext,description:c(12745,"The Source Control resource state context menu")},{key:"scm/resourceFolder/context",id:b.SCMResourceFolderContext,description:c(12746,"The Source Control resource folder context menu")},{key:"scm/resourceGroup/context",id:b.SCMResourceGroupContext,description:c(12747,"The Source Control resource group context menu")},{key:"scm/change/title",id:b.SCMChangeContext,description:c(12748,"The Source Control inline change menu")},{key:"scm/inputBox",id:b.SCMInputBox,description:c(12749,"The Source Control input box menu"),proposed:"contribSourceControlInputBoxMenu"},{key:"scm/history/title",id:b.SCMHistoryTitle,description:c(12750,"The Source Control History title menu"),proposed:"contribSourceControlHistoryTitleMenu"},{key:"scm/historyItem/context",id:b.SCMHistoryItemContext,description:c(12751,"The Source Control history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItem/hover",id:b.SCMHistoryItemHover,description:c(12752,"The Source Control history item hover menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItemRef/context",id:b.SCMHistoryItemRefContext,description:c(12753,"The Source Control history item reference context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"statusBar/remoteIndicator",id:b.StatusBarRemoteIndicatorMenu,description:c(12754,"The remote indicator menu in the status bar"),supportsSubmenus:!1},{key:"terminal/context",id:b.TerminalInstanceContext,description:c(12755,"The terminal context menu")},{key:"terminal/title/context",id:b.TerminalTabContext,description:c(12756,"The terminal tabs context menu")},{key:"view/title",id:b.ViewTitle,description:c(12757,"The contributed view title menu")},{key:"viewContainer/title",id:b.ViewContainerTitle,description:c(12758,"The contributed view container title menu"),proposed:"contribViewContainerTitle"},{key:"view/item/context",id:b.ViewItemContext,description:c(12759,"The contributed view item context menu")},{key:"comments/comment/editorActions",id:b.CommentEditorActions,description:c(12760,"The contributed comment editor actions"),proposed:"contribCommentEditorActionsMenu"},{key:"comments/commentThread/title",id:b.CommentThreadTitle,description:c(12761,"The contributed comment thread title menu")},{key:"comments/commentThread/context",id:b.CommentThreadActions,description:c(12762,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/additionalActions",id:b.CommentThreadAdditionalActions,description:c(12762,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!0,proposed:"contribCommentThreadAdditionalMenu"},{key:"comments/commentThread/title/context",id:b.CommentThreadTitleContext,description:c(12763,"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:b.CommentTitle,description:c(12764,"The contributed comment title menu")},{key:"comments/comment/context",id:b.CommentActions,description:c(12765,"The contributed comment context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/comment/context",id:b.CommentThreadCommentContext,description:c(12766,"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:b.CommentsViewThreadActions,description:c(12767,"The contributed comment thread context menu in the comments view"),proposed:"contribCommentsViewThreadMenus"},{key:"notebook/toolbar",id:b.NotebookToolbar,description:c(12768,"The contributed notebook toolbar menu")},{key:"notebook/kernelSource",id:b.NotebookKernelSource,description:c(12769,"The contributed notebook kernel sources menu"),proposed:"notebookKernelSource"},{key:"notebook/cell/title",id:b.NotebookCellTitle,description:c(12770,"The contributed notebook cell title menu")},{key:"notebook/cell/execute",id:b.NotebookCellExecute,description:c(12771,"The contributed notebook cell execution menu")},{key:"interactive/toolbar",id:b.InteractiveToolbar,description:c(12772,"The contributed interactive toolbar menu")},{key:"interactive/cell/title",id:b.InteractiveCellTitle,description:c(12773,"The contributed interactive cell title menu")},{key:"issue/reporter",id:b.IssueReporter,description:c(12774,"The contributed issue reporter menu")},{key:"testing/item/context",id:b.TestItem,description:c(12775,"The contributed test item menu")},{key:"testing/item/gutter",id:b.TestItemGutter,description:c(12776,"The menu for a gutter decoration for a test item")},{key:"testing/profiles/context",id:b.TestProfilesContext,description:c(12777,"The menu for configuring testing profiles.")},{key:"testing/item/result",id:b.TestPeekElement,description:c(12778,"The menu for an item in the Test Results view or peek.")},{key:"testing/message/context",id:b.TestMessageContext,description:c(12779,"A prominent button overlaying editor content where the message is displayed")},{key:"testing/message/content",id:b.TestMessageContent,description:c(12780,"Context menu for the message in the results tree")},{key:"extension/context",id:b.ExtensionContext,description:c(12781,"The extension context menu")},{key:"timeline/title",id:b.TimelineTitle,description:c(12782,"The Timeline view title menu")},{key:"timeline/item/context",id:b.TimelineItemContext,description:c(12783,"The Timeline view item context menu")},{key:"ports/item/context",id:b.TunnelContext,description:c(12784,"The Ports view item context menu")},{key:"ports/item/origin/inline",id:b.TunnelOriginInline,description:c(12785,"The Ports view item origin inline menu")},{key:"ports/item/port/inline",id:b.TunnelPortInline,description:c(12786,"The Ports view item port inline menu")},{key:"file/newFile",id:b.NewFile,description:c(12787,"The 'New File...' quick pick, shown on welcome page and File menu."),supportsSubmenus:!1},{key:"webview/context",id:b.WebviewContext,description:c(12788,"The webview context menu")},{key:"file/share",id:b.MenubarShare,description:c(12789,"Share submenu shown in the top level File menu."),proposed:"contribShareMenu"},{key:"editor/inlineCompletions/actions",id:b.InlineCompletionsActions,description:c(12790,"The actions shown when hovering on an inline completion"),supportsSubmenus:!1,proposed:"inlineCompletionsAdditions"},{key:"editor/content",id:b.EditorContent,description:c(12791,"The prominent button in an editor, overlays its content"),proposed:"contribEditorContentMenu"},{key:"editor/lineNumber/context",id:b.EditorLineNumberContext,description:c(12792,"The contributed editor line number context menu")},{key:"mergeEditor/result/title",id:b.MergeInputResultToolbar,description:c(12793,"The result toolbar of the merge editor"),proposed:"contribMergeEditorMenus"},{key:"multiDiffEditor/resource/title",id:b.MultiDiffEditorFileToolbar,description:c(12794,"The resource toolbar in the multi diff editor"),proposed:"contribMultiDiffEditorMenus"},{key:"diffEditor/gutter/hunk",id:b.DiffEditorHunkToolbar,description:c(12795,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"diffEditor/gutter/selection",id:b.DiffEditorSelectionToolbar,description:c(12795,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"searchPanel/aiResults/commands",id:b.SearchActionMenu,description:c(12796,"The commands that will contribute to the menu rendered as buttons next to the AI search title")},{key:"editor/context/chat",id:b.ChatTextEditorMenu,description:c(12797,"The Chat submenu in the text editor context menu."),supportsSubmenus:!1,proposed:"chatParticipantPrivate"},{key:"terminal/context/chat",id:b.ChatTerminalMenu,description:c(12798,"The Chat submenu in the terminal context menu."),supportsSubmenus:!1,proposed:"chatParticipantPrivate"},{key:"chat/chatSessions",id:b.ChatSessionsMenu,description:c(12799,"The Chat Sessions menu."),supportsSubmenus:!1,proposed:"chatSessionsProvider"}];var vo;(function(a){function e(f){return typeof f.command=="string"}a.isMenuItem=e;function t(f,w){return typeof f.command!="string"?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","command")),!1):f.alt&&typeof f.alt!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","alt")),!1):f.when&&typeof f.when!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidMenuItem=t;function i(f,w){return typeof f.submenu!="string"?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","submenu")),!1):f.when&&typeof f.when!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidSubmenuItem=i;function s(f,w){if(!Array.isArray(f))return w.error(c(12802,"submenu items must be an array")),!1;for(const v of f)if(e(v)){if(!t(v,w))return!1}else if(!i(v,w))return!1;return!0}a.isValidItems=s;function o(f,w){return typeof f!="object"?(w.error(c(12803,"submenu items must be an object")),!1):typeof f.id!="string"?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","id")),!1):typeof f.label!="string"?(w.error(c(12800,"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(12804,"Identifier of the command to execute. The command must be declared in the 'commands'-section"),type:"string"},alt:{description:c(12805,"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"),type:"string"},when:{description:c(12806,"Condition which must be true to show this item"),type:"string"},group:{description:c(12807,"Group into which this item belongs"),type:"string"}}},r={type:"object",required:["submenu"],properties:{submenu:{description:c(12808,"Identifier of the submenu to display in this item."),type:"string"},when:{description:c(12806,"Condition which must be true to show this item"),type:"string"},group:{description:c(12807,"Group into which this item belongs"),type:"string"}}},d={type:"object",required:["id","label"],properties:{id:{description:c(12809,"Identifier of the menu to display as a submenu."),type:"string"},label:{description:c(12810,"The label of the menu item which leads to this submenu."),type:"string"},icon:{description:c(12811,"(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(12812,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12813,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.menusContribution={description:c(12814,"Contributes menu items to the editor"),type:"object",properties:Gp(i_,f=>f.key,f=>({markdownDescription:f.proposed?c(12815,'Proposed API, requires `enabledApiProposal: ["{0}"]` - {1}',f.proposed,f.description):f.description,type:"array",items:f.supportsSubmenus===!1?n:{oneOf:[n,r]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[n,r]}}},a.submenusContribution={description:c(12816,"Contributes submenu items to the editor"),type:"array",items:d};function l(f,w){return f?Tn(f.command)?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","command")),!1):!p(f.title,w,"title")||f.shortTitle&&!p(f.shortTitle,w,"shortTitle")?!1:f.enablement&&typeof f.enablement!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","precondition")),!1):!(f.category&&!p(f.category,w,"category")||!h(f.icon,w)):(w.error(c(12817,"expected non-empty value.")),!1)}a.isValidCommand=l;function h(f,w){return typeof f>"u"||typeof f=="string"||typeof f.dark=="string"&&typeof f.light=="string"?!0:(w.error(c(12818,"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")),!1)}function p(f,w,v){return typeof f>"u"?(w.error(c(12819,"property `{0}` is mandatory and must be of type `string` or `object`",v)),!1):typeof f=="string"&&Tn(f)?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`",v)),!1):typeof f!="string"&&(Tn(f.original)||Tn(f.value))?(w.error(c(12820,"properties `{0}` and `{1}` are mandatory and must be of type `string`",`${v}.value`,`${v}.original`)),!1):!0}const g={type:"object",required:["command","title"],properties:{command:{description:c(12821,"Identifier of the command to execute"),type:"string"},title:{description:c(12822,"Title by which the command is represented in the UI"),type:"string"},shortTitle:{markdownDescription:c(12823,"(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(12824,"(Optional) Category string by which the command is grouped in the UI"),type:"string"},enablement:{description:c(12825,"(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(12826,"(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(12827,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12828,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.commandsContribution={description:c(12829,"Contributes commands to the command palette."),oneOf:[g,{type:"array",items:g}]}})(vo||(vo={}));const ny=new F,s_=xr.registerExtensionPoint({extensionPoint:"commands",jsonSchema:vo.commandsContribution,activationEventsGenerator:(a,e)=>{for(const t of a)t.command&&e.push(`onCommand:${t.command}`)}});s_.setHandler(a=>{function e(t,i){if(!vo.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=De.fromString(s)??{dark:io(i.description.extensionLocation,s),light:io(i.description.extensionLocation,s)}:h={dark:io(i.description.extensionLocation,s.dark),light:io(i.description.extensionLocation,s.light)});const p=I.getCommand(l);p&&(p.source?i.collector.info(c(12830,"Command `{0}` already registered by {1} ({2})",t.command,p.source.title,p.source.id)):i.collector.info(c(12831,"Command `{0}` already registered",t.command))),ny.add(I.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:D.deserialize(o),icon:h}))}ny.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 Vd=new Map,o_=xr.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:vo.submenusContribution});o_.setHandler(a=>{Vd.clear();for(const e of a){const{value:t,collector:i}=e;for(const[,s]of Object.entries(t)){if(!vo.isValidSubmenu(s,i))continue;if(!s.id){i.warn(c(12832,"`{0}` is not a valid submenu identifier",s.id));continue}if(Vd.has(s.id)){i.info(c(12833,"The `{0}` submenu was already previously registered.",s.id));continue}if(!s.label){i.warn(c(12834,"`{0}` is not a valid submenu label",s.label));continue}let o;s.icon&&(typeof s.icon=="string"?o=De.fromString(s.icon)||{dark:io(e.description.extensionLocation,s.icon)}:o={dark:io(e.description.extensionLocation,s.icon.dark),light:io(e.description.extensionLocation,s.icon.light)});const n={id:b.for(`api:${s.id}`),label:s.label,icon:o};Vd.set(s.id,n)}}});const LP=new Map(i_.map(a=>[a.key,a])),ry=new F,bp=new Map,VP=xr.registerExtensionPoint({extensionPoint:"menus",jsonSchema:vo.menusContribution,deps:[o_]});VP.setHandler(a=>{ry.clear(),bp.clear();for(const e of a){const{value:t,collector:i}=e;for(const s of Object.entries(t)){if(!vo.isValidItems(s[1],i))continue;let o=LP.get(s[0]);if(!o){const n=Vd.get(s[0]);n&&(o={key:s[0],id:n.id,description:""})}if(o){if(o.proposed&&!Wp(e.description,o.proposed)){i.error(c(12835,`{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(vo.isMenuItem(n)){const d=I.getCommand(n.command),l=n.alt&&I.getCommand(n.alt)||void 0;if(!d){i.error(c(12836,"Menu item references a command `{0}` which is not defined in the 'commands' section.",n.command));continue}n.alt&&!l&&i.warn(c(12837,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",n.alt)),n.command===n.alt&&i.info(c(12838,"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(12839,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const d=Vd.get(n.submenu);if(!d){i.error(c(12840,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",n.submenu));continue}let l=bp.get(o.id.id);if(l||(l=new Set,bp.set(o.id.id,l)),l.has(d.id.id)){i.warn(c(12841,"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===b.ViewContainerTitle&&!n.when?.includes("viewContainer == workbench.view.debug")){i.error(c(12842,"The {0} menu contribution must check {1} in its {2} clause.","`viewContainer/title`","`viewContainer == workbench.view.debug`",'"when"'));continue}r.when=D.deserialize(n.when),ry.add(I.appendMenuItem(o.id,r))}}}}});let Qg=class extends N{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=Gp(i,h=>h.id),o=e.contributes?.menus||{},n=Gp(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 g=s[p.command];g?g.menus.includes(h)||g.menus.push(h):(g={id:p.command,title:"",keybindings:[],menus:[h]},s[g.id]=g,i.push(g))}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 g=s[h.command];g?g.keybindings.push(p):(g={id:h.command,title:"",keybindings:[p],menus:[]},s[g.id]=g,i.push(g))}),!i.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const d=[c(12843,"ID"),c(12844,"Title"),c(12845,"Keyboard Shortcuts"),c(12846,"Menu Contexts")],l=i.sort((h,p)=>h.id.localeCompare(p.id)).map(h=>[new Ki().appendMarkdown(`\`${h.id}\``),typeof h.title=="string"?h.title:h.title.value,h.keybindings,new Ki().appendMarkdown(`${h.menus.sort((p,g)=>p.localeCompare(g)).map(p=>`\`${p}\``).join(" ")}`)]);return{data:{headers:d,rows:l},dispose:()=>{}}}resolveKeybinding(e){let t;switch(iA){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]}};Qg=_([u(0,ot)],Qg);ie.as(vu.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:c(12847,"Commands"),access:{canToggle:!1},renderer:new le(Qg)});class n_{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${PP(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"?rc.parseKeybinding(e.key):null,i="when"in e&&typeof e.when=="string"?D.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 PP(a,e){return a.length<e?a+new Array(e-a.length).join(" "):a}class OP{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(`
|
|
125
|
+
`,B=a.getColor(oD);if(B&&v&&C){const Q=B.flatten(v),q=B.flatten(C);e.addRule(G(Q,q,!0,!0))}const X=a.getColor(nD);if(X&&v&&C){const Q=X.flatten(v),q=X.flatten(C);e.addRule(G(Q,q,!1,!0))}const Z=a.getColor(rD);if(Z&&v&&C){const Q=Z.flatten(v),q=Z.flatten(C);e.addRule(G(Q,q,!0,!1))}const j=a.getColor(aD);if(j&&v&&C){const Q=j.flatten(v),q=j.flatten(C);e.addRule(G(Q,q,!1,!1))}}});const ZE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(ZE);class IP extends ic{constructor(){super(...arguments),this.activeLabel=Object.create(null)}get breadcrumbsControl(){return this.breadcrumbsControlFactory?.control}create(e){super.create(e);const t=this.titleContainer=e;t.draggable=!0,this.registerContainerListeners(t),this._register(qd.addTarget(t));const i=M(".label-container");return t.appendChild(i),this.editorLabel=this._register(this.instantiationService.createInstance(dD,i,{})).element,this._register(z(this.editorLabel.element,ee.CLICK,s=>this.onTitleLabelClick(s))),this.breadcrumbsControlFactory=this._register(this.instantiationService.createInstance(Gl,i,this.groupView,{showFileIcons:!1,showSymbolIcons:!0,showDecorationColors:!1,widgetStyles:{...uC,breadcrumbsBackground:Ii.transparent.toString()},showPlaceholder:!1,dragEditor:!0})),this._register(this.breadcrumbsControlFactory.onDidEnablementChange(()=>this.handleBreadcrumbsEnablementChange())),t.classList.toggle("breadcrumbs",!!this.breadcrumbsControl),this._register(he(()=>t.classList.remove("breadcrumbs"))),this.createEditorActionsToolBar(t,["title-actions"]),t}registerContainerListeners(e){let t,i=!1;this._register(new Yd(e,{onDragStart:s=>{i=this.onGroupDragStart(s,e)},onDrag:s=>{t=s},onDragEnd:s=>{this.onGroupDragEnd(s,t,e,i)}})),this._register(z(e,ee.DBLCLICK,s=>this.onTitleDoubleClick(s))),this._register(z(e,ee.AUXCLICK,s=>this.onTitleAuxClick(s))),this._register(z(e,Ni.Tap,s=>this.onTitleTap(s)));for(const s of[ee.CONTEXT_MENU,Ni.Contextmenu])this._register(z(e,s,o=>{this.tabsModel.activeEditor&&this.onTabContextMenu(this.tabsModel.activeEditor,o,e)}))}onTitleLabelClick(e){be.stop(e,!1),setTimeout(()=>this.quickInputService.quickAccess.show())}onTitleDoubleClick(e){be.stop(e),this.groupView.pinEditor()}onTitleAuxClick(e){e.button===1&&this.tabsModel.activeEditor&&(be.stop(e,!0),xC(this.tabsModel,this.tabsModel.activeEditor,RC.MOUSE,this.groupsView.partOptions)||this.groupView.closeEditor(this.tabsModel.activeEditor))}onTitleTap(e){const t=e.initialTarget;!Sr(t)||!this.editorLabel||!Oa(t,this.editorLabel.element)||setTimeout(()=>this.quickInputService.quickAccess.show(),50)}openEditor(e){return this.doHandleOpenEditor()}openEditors(e){return this.doHandleOpenEditor()}doHandleOpenEditor(){const e=this.ifActiveEditorChanged(()=>this.redraw());return e||this.ifActiveEditorPropertiesChanged(()=>this.redraw()),e}beforeCloseEditor(e){}closeEditor(e){this.ifActiveEditorChanged(()=>this.redraw())}closeEditors(e){this.ifActiveEditorChanged(()=>this.redraw())}moveEditor(e,t,i){this.ifActiveEditorChanged(()=>this.redraw())}pinEditor(e){this.ifEditorIsActive(e,()=>this.redraw())}stickEditor(e){}unstickEditor(e){}setActive(e){this.redraw()}updateEditorSelections(){}updateEditorLabel(e){this.ifEditorIsActive(e,()=>this.redraw())}updateEditorDirty(e){this.ifEditorIsActive(e,()=>{const t=ge(this.titleContainer);e.isDirty()&&!e.isSaving()?t.classList.add("dirty"):t.classList.remove("dirty")})}updateOptions(e,t){super.updateOptions(e,t),(e.labelFormat!==t.labelFormat||!mu(e.decorations,t.decorations))&&this.redraw()}updateStyles(){this.redraw()}handleBreadcrumbsEnablementChange(){ge(this.titleContainer).classList.toggle("breadcrumbs",!!this.breadcrumbsControl),this.redraw()}ifActiveEditorChanged(e){return!this.activeLabel.editor&&this.tabsModel.activeEditor||this.activeLabel.editor&&!this.tabsModel.activeEditor||!this.activeLabel.editor||!this.tabsModel.isActive(this.activeLabel.editor)?(e(),!0):!1}ifActiveEditorPropertiesChanged(e){!this.activeLabel.editor||!this.tabsModel.activeEditor||this.activeLabel.pinned!==this.tabsModel.isPinned(this.tabsModel.activeEditor)&&e()}ifEditorIsActive(e,t){this.tabsModel.isActive(e)&&t()}redraw(){const e=this.tabsModel.activeEditor??void 0,t=this.groupsView.partOptions,i=e?this.tabsModel.isPinned(e):!1,s=this.groupsView.activeGroup===this.groupView;this.activeLabel={editor:e,pinned:i},this.breadcrumbsControl&&(s?(this.breadcrumbsControl.update(),this.breadcrumbsControl.domNode.classList.toggle("preview",!i)):this.breadcrumbsControl.hide());const[o,n]=Po(this.titleContainer,this.editorLabel);if(!e)o.classList.remove("dirty"),n.clear(),this.clearEditorActionsToolbar();else{this.updateEditorDirty(e);const{labelFormat:r}=this.groupsView.partOptions;let d;this.breadcrumbsControl&&!this.breadcrumbsControl.isHidden()||r==="default"&&!s?d="":d=e.getDescription(this.getVerbosity(r))||"",n.setResource({resource:Ge.getOriginalUri(e,{supportSideBySide:xe.BOTH}),name:e.getName(),description:d},{title:this.getHoverTitle(e),italic:!i,extraClasses:["single-tab","title-label"].concat(e.getLabelExtraClasses()),fileDecorations:{colors:!!t.decorations?.colors,badges:!!t.decorations?.badges},icon:e.getIcon(),hideIcon:t.showIcons===!1}),s?o.style.color=this.getColor(cD)||"":o.style.color=this.getColor(lD)||"",this.updateEditorActionsToolbar()}}getVerbosity(e){switch(e){case"short":return ts.SHORT;case"long":return ts.LONG;default:return ts.MEDIUM}}prepareEditorActions(e){return this.groupsView.activeGroup===this.groupView?e:{primary:this.groupsView.partOptions.alwaysShowEditorActions?e.primary:e.primary.filter(i=>i.id===qs||i.id===od),secondary:e.secondary}}getHeight(){return this.tabHeight}layout(e){return this.breadcrumbsControl?.layout(void 0),new Ne(e.container.width,this.getHeight())}}let Fg=class extends N{constructor(e,t,i,s,o,n){super(),this.parent=e,this.groupsView=i,this.groupView=s,this.model=o,this.instantiationService=n;const r=this._register(new XE(this.model)),d=this._register(new JE(this.model));this.stickyEditorTabsControl=this._register(this.instantiationService.createInstance(nc,this.parent,t,this.groupsView,this.groupView,r)),this.unstickyEditorTabsControl=this._register(this.instantiationService.createInstance(nc,this.parent,t,this.groupsView,this.groupView,d)),this.handleTabBarsStateChange()}handleTabBarsStateChange(){this.activeControl=this.model.activeEditor?this.getEditorTabsController(this.model.activeEditor):void 0,this.handleTabBarsLayoutChange()}handleTabBarsLayoutChange(){if(this.groupView.count===0)return;const e=this.parent.classList.contains("two-tab-bars"),t=this.groupView.count!==this.groupView.stickyCount&&this.groupView.stickyCount>0;this.parent.classList.toggle("two-tab-bars",t),e!==t&&this.groupView.relayout()}didActiveControlChange(){return this.activeControl!==(this.model.activeEditor?this.getEditorTabsController(this.model.activeEditor):void 0)}getEditorTabsController(e){return this.model.isSticky(e)?this.stickyEditorTabsControl:this.unstickyEditorTabsControl}openEditor(e,t){const i=this.didActiveControlChange(),o=this.getEditorTabsController(e).openEditor(e,t)||i;return o&&this.handleOpenedEditors(),o}openEditors(e){const t=e.filter(d=>this.model.isSticky(d)),i=e.filter(d=>!this.model.isSticky(d)),s=this.didActiveControlChange(),o=this.stickyEditorTabsControl.openEditors(t),n=this.unstickyEditorTabsControl.openEditors(i),r=o||n||s;return r&&this.handleOpenedEditors(),r}handleOpenedEditors(){this.handleTabBarsStateChange()}beforeCloseEditor(e){this.getEditorTabsController(e).beforeCloseEditor(e)}closeEditor(e){this.stickyEditorTabsControl.closeEditor(e),this.unstickyEditorTabsControl.closeEditor(e),this.handleClosedEditors()}closeEditors(e){const t=e.filter(s=>this.model.isSticky(s)),i=e.filter(s=>!this.model.isSticky(s));this.stickyEditorTabsControl.closeEditors(t),this.unstickyEditorTabsControl.closeEditors(i),this.handleClosedEditors()}handleClosedEditors(){this.handleTabBarsStateChange()}moveEditor(e,t,i,s){s?(this.model.isSticky(e)?(this.stickyEditorTabsControl.openEditor(e),this.unstickyEditorTabsControl.closeEditor(e)):(this.stickyEditorTabsControl.closeEditor(e),this.unstickyEditorTabsControl.openEditor(e)),this.handleTabBarsStateChange()):this.model.isSticky(e)?this.stickyEditorTabsControl.moveEditor(e,t,i,s):this.unstickyEditorTabsControl.moveEditor(e,t-this.model.stickyCount,i-this.model.stickyCount,s)}pinEditor(e){this.getEditorTabsController(e).pinEditor(e)}stickEditor(e){this.unstickyEditorTabsControl.closeEditor(e),this.stickyEditorTabsControl.openEditor(e),this.handleTabBarsStateChange()}unstickEditor(e){this.stickyEditorTabsControl.closeEditor(e),this.unstickyEditorTabsControl.openEditor(e),this.handleTabBarsStateChange()}setActive(e){this.stickyEditorTabsControl.setActive(e),this.unstickyEditorTabsControl.setActive(e)}updateEditorSelections(){this.stickyEditorTabsControl.updateEditorSelections(),this.unstickyEditorTabsControl.updateEditorSelections()}updateEditorLabel(e){this.getEditorTabsController(e).updateEditorLabel(e)}updateEditorDirty(e){this.getEditorTabsController(e).updateEditorDirty(e)}updateOptions(e,t){this.stickyEditorTabsControl.updateOptions(e,t),this.unstickyEditorTabsControl.updateOptions(e,t)}layout(e){const t=this.stickyEditorTabsControl.layout(e),i={container:e.container,available:new Ne(e.available.width,e.available.height-t.height)},s=this.unstickyEditorTabsControl.layout(i);return new Ne(e.container.width,t.height+s.height)}getHeight(){return this.stickyEditorTabsControl.getHeight()+this.unstickyEditorTabsControl.getHeight()}dispose(){this.parent.classList.toggle("two-tab-bars",!1),super.dispose()}};Fg=_([u(5,K)],Fg);Te(ZE);class DP extends ic{constructor(){super(...arguments),this.activeEditor=null}prepareEditorActions(e){return{primary:[],secondary:[]}}openEditor(e){return this.handleOpenedEditors()}openEditors(e){return this.handleOpenedEditors()}handleOpenedEditors(){const e=this.activeEditorChanged();return this.activeEditor=this.tabsModel.activeEditor,e}activeEditorChanged(){return!!(!this.activeEditor&&this.tabsModel.activeEditor||this.activeEditor&&!this.tabsModel.activeEditor||!this.activeEditor||!this.tabsModel.isActive(this.activeEditor))}beforeCloseEditor(e){}closeEditor(e){this.handleClosedEditors()}closeEditors(e){this.handleClosedEditors()}handleClosedEditors(){this.activeEditor=this.tabsModel.activeEditor}moveEditor(e,t,i){}pinEditor(e){}stickEditor(e){}unstickEditor(e){}setActive(e){}updateEditorSelections(){}updateEditorLabel(e){}updateEditorDirty(e){}getHeight(){return 0}layout(e){return new Ne(e.container.width,this.getHeight())}}Te(cL);let Bg=class extends Cc{get breadcrumbsControl(){return this.breadcrumbsControlFactory?.control}constructor(e,t,i,s,o,n,r){super(r),this.parent=e,this.editorPartsView=t,this.groupsView=i,this.groupView=s,this.model=o,this.instantiationService=n,this.editorTabsControlDisposable=this._register(new F),this.breadcrumbsControlDisposables=this._register(new F),this.editorTabsControl=this.createEditorTabsControl(),this.breadcrumbsControlFactory=this.createBreadcrumbsControl()}createEditorTabsControl(){let e;switch(this.groupsView.partOptions.showTabs){case"none":e=DP;break;case"single":e=IP;break;default:e=this.groupsView.partOptions.pinnedTabsOnSeparateRow?Fg:nc;break}const t=this.instantiationService.createInstance(e,this.parent,this.editorPartsView,this.groupsView,this.groupView,this.model);return this.editorTabsControlDisposable.add(t)}createBreadcrumbsControl(){if(this.groupsView.partOptions.showTabs==="single")return;const e=M(".breadcrumbs-below-tabs");this.parent.appendChild(e);const t=this.breadcrumbsControlDisposables.add(this.instantiationService.createInstance(Gl,e,this.groupView,{showFileIcons:!0,showSymbolIcons:!0,showDecorationColors:!1,showPlaceholder:!0,dragEditor:!1}));return this.breadcrumbsControlDisposables.add(t.onDidEnablementChange(()=>this.groupView.relayout())),this.breadcrumbsControlDisposables.add(t.onDidVisibilityChange(()=>this.groupView.relayout())),t}openEditor(e,t){const i=this.editorTabsControl.openEditor(e,t);this.handleOpenedEditors(i)}openEditors(e){const t=this.editorTabsControl.openEditors(e);this.handleOpenedEditors(t)}handleOpenedEditors(e){e?this.breadcrumbsControl?.update():this.breadcrumbsControl?.revealLast()}beforeCloseEditor(e){return this.editorTabsControl.beforeCloseEditor(e)}closeEditor(e){this.editorTabsControl.closeEditor(e),this.handleClosedEditors()}closeEditors(e){this.editorTabsControl.closeEditors(e),this.handleClosedEditors()}handleClosedEditors(){this.groupView.activeEditor||this.breadcrumbsControl?.update()}moveEditor(e,t,i,s){return this.editorTabsControl.moveEditor(e,t,i,s)}pinEditor(e){return this.editorTabsControl.pinEditor(e)}stickEditor(e){return this.editorTabsControl.stickEditor(e)}unstickEditor(e){return this.editorTabsControl.unstickEditor(e)}setActive(e){return this.editorTabsControl.setActive(e)}updateEditorSelections(){this.editorTabsControl.updateEditorSelections()}updateEditorLabel(e){return this.editorTabsControl.updateEditorLabel(e)}updateEditorDirty(e){return this.editorTabsControl.updateEditorDirty(e)}updateOptions(e,t){e.showTabs!==t.showTabs||t.showTabs!=="single"&&e.pinnedTabsOnSeparateRow!==t.pinnedTabsOnSeparateRow?(this.editorTabsControlDisposable.clear(),this.breadcrumbsControlDisposables.clear(),Bt(this.parent),this.editorTabsControl=this.createEditorTabsControl(),this.breadcrumbsControlFactory=this.createBreadcrumbsControl()):this.editorTabsControl.updateOptions(e,t)}layout(e){const t=this.editorTabsControl.layout(e);let i;return this.breadcrumbsControl?.isHidden()===!1&&(i=new Ne(e.container.width,ze.HEIGHT),this.breadcrumbsControl.layout(i)),new Ne(e.container.width,t.height+(i?i.height:0))}getHeight(){const e=this.editorTabsControl.getHeight(),t=this.breadcrumbsControl?.isHidden()===!1?ze.HEIGHT:0;return{total:e+t,offset:e}}};Bg=_([u(5,K),u(6,me)],Bg);var ko;Te(XR);let Xr=ko=class extends Cc{static createNew(e,t,i,s,o,n){return o.createInstance(ko,null,e,t,i,s,n)}static createFromSerialized(e,t,i,s,o,n,r){return n.createInstance(ko,e,t,i,s,o,r)}static createCopy(e,t,i,s,o,n,r){return n.createInstance(ko,e,t,i,s,o,r)}constructor(e,t,i,s,o,n,r,d,l,h,p,g,f,w,v,C,T,G,B,X,Z,j){super(l),this.editorPartsView=t,this.groupsView=i,this.groupsLabel=s,this._index=o,this.instantiationService=r,this.contextKeyService=d,this.telemetryService=h,this.keybindingService=p,this.menuService=g,this.contextMenuService=f,this.fileDialogService=w,this.editorService=v,this.filesConfigurationService=C,this.uriIdentityService=T,this.logService=G,this.editorResolverService=B,this.hostService=X,this.dialogService=Z,this.fileService=j,this._onDidFocus=this._register(new A),this.onDidFocus=this._onDidFocus.event,this._onWillDispose=this._register(new A),this.onWillDispose=this._onWillDispose.event,this._onDidModelChange=this._register(new A),this.onDidModelChange=this._onDidModelChange.event,this._onDidActiveEditorChange=this._register(new A),this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this._onDidOpenEditorFail=this._register(new A),this.onDidOpenEditorFail=this._onDidOpenEditorFail.event,this._onWillCloseEditor=this._register(new A),this.onWillCloseEditor=this._onWillCloseEditor.event,this._onDidCloseEditor=this._register(new A),this.onDidCloseEditor=this._onDidCloseEditor.event,this._onWillMoveEditor=this._register(new A),this.onWillMoveEditor=this._onWillMoveEditor.event,this._onWillOpenEditor=this._register(new A),this.onWillOpenEditor=this._onWillOpenEditor.event,this.disposedEditorsWorker=this._register(new NC(q=>this.handleDisposedEditors(q),0)),this.mapEditorToPendingConfirmation=new Map,this.containerToolBarMenuDisposable=this._register(new ke),this.whenRestoredPromise=new tn,this.whenRestored=this.whenRestoredPromise.p,this._disposed=!1,this.element=M("div"),this._onDidChange=this._register(new ho),this.onDidChange=this._onDidChange.event,e instanceof ko?this.model=this._register(e.model.clone()):FC(e)?this.model=this._register(r.createInstance(Gb,e)):this.model=this._register(r.createInstance(Gb,void 0)),this.scopedContextKeyService=this._register(this.contextKeyService.createScoped(this.element)),this.element.classList.add(...xi(["editor-group-container",this.model.isLocked?"locked":void 0])),this.registerContainerListeners(),this.createContainerToolbar(),this.createContainerContextMenu(),this._register(this.instantiationService.createInstance(lg,this.element)),this.progressBar=this._register(new Uy(this.element,Hy)),this.progressBar.hide(),this.scopedInstantiationService=this._register(this.instantiationService.createChild(new fr([re,this.scopedContextKeyService],[iw,this._register(new hD(this.progressBar,this))]))),this.resourceContext=this._register(this.scopedInstantiationService.createInstance(yC)),this.handleGroupContextKeys(),this.titleContainer=M(".title"),this.element.appendChild(this.titleContainer),this.titleControl=this._register(this.scopedInstantiationService.createInstance(Bg,this.titleContainer,this.editorPartsView,this.groupsView,this,this.model)),this.editorContainer=M(".editor-container"),this.element.appendChild(this.editorContainer),this.editorPane=this._register(this.scopedInstantiationService.createInstance(cg,this.element,this.editorContainer,this)),this._onDidChange.input=this.editorPane.onDidChangeSizeConstraints,this.doTrackFocus(),this.updateTitleContainer(),this.updateContainer(),this.updateStyles(),(this.restoreEditors(e,n)??Promise.resolve()).finally(()=>{this.whenRestoredPromise.complete()}),this.registerListeners()}handleGroupContextKeys(){const e=this.editorPartsView.bind(Ic,this),t=this.editorPartsView.bind(bw,this),i=this.editorPartsView.bind(CC,this),s=this.editorPartsView.bind(gu,this),o=this.editorPartsView.bind(Ns,this),n=this.editorPartsView.bind(BC,this),r=this.editorPartsView.bind(Ms,this),d=Dc.bindTo(this.scopedContextKeyService),l=uD.bindTo(this.scopedContextKeyService),h=pD.bindTo(this.scopedContextKeyService),p=this.editorPartsView.bind(TC,this),g=this.editorPartsView.bind(gD,this),f=this.editorPartsView.bind(fD,this),w=this.editorPartsView.bind(mD,this),v=this.editorPartsView.bind(pw,this),C=this.editorPartsView.bind(Pp,this),T=this.editorPartsView.bind(Ai,this),G=this.editorPartsView.bind(Xa,this),B=this.editorPartsView.bind(xn,this),X=this.editorPartsView.bind(hi,this),Z=this._register(new ke),j=()=>{Z.clear(),this.scopedContextKeyService.bufferChangeEvents(()=>{const q=this.activeEditor,ce=this.activeEditorPane;if(this.resourceContext.set(Ge.getOriginalUri(q,{supportSideBySide:xe.PRIMARY})),EC(G,q,this.editorResolverService),q?(B.set(q.hasCapability($t.CanSplitInGroup)),X.set(q.typeId===jt.ID),e.set(q.isDirty()&&!q.isSaving()),Z.value=q.onDidChangeDirty(()=>{e.set(q.isDirty()&&!q.isSaving())})):(B.set(!1),X.set(!1),e.set(!1)),ce){p.set(ce.getId()),f.set(!ce.input.hasCapability($t.Untitled)),g.set(!!ce.input.isReadonly());const $e=Ge.getOriginalUri(ce.input,{supportSideBySide:xe.PRIMARY}),ft=Ge.getOriginalUri(ce.input,{supportSideBySide:xe.SECONDARY});v.set(ce.input instanceof qt&&!ce.input.original.isReadonly()&&!!$e&&(this.fileService.hasProvider($e)||$e.scheme===ue.untitled)&&!!ft&&(this.fileService.hasProvider(ft)||ft.scheme===ue.untitled)),w.set(!!$e&&this.fileService.hasProvider($e)&&!this.fileService.hasCapability($e,WC.Readonly));const wi=ce?.getId()===fC;T.set(wi),C.set(wi)}else p.reset(),f.reset(),g.reset(),v.reset(),w.reset()})},Q=q=>{switch(q.kind){case at.GROUP_LOCKED:r.set(this.isLocked);break;case at.EDITOR_ACTIVE:i.set(this.model.isFirst(this.model.activeEditor)),s.set(this.model.isLast(this.model.activeEditor)),t.set(this.model.activeEditor?this.model.isPinned(this.model.activeEditor):!1),o.set(this.model.activeEditor?this.model.isSticky(this.model.activeEditor):!1);break;case at.EDITOR_CLOSE:t.set(this.model.activeEditor?this.model.isPinned(this.model.activeEditor):!1),o.set(this.model.activeEditor?this.model.isSticky(this.model.activeEditor):!1);case at.EDITOR_OPEN:case at.EDITOR_MOVE:i.set(this.model.isFirst(this.model.activeEditor)),s.set(this.model.isLast(this.model.activeEditor));break;case at.EDITOR_PIN:q.editor&&q.editor===this.model.activeEditor&&t.set(this.model.isPinned(this.model.activeEditor));break;case at.EDITOR_STICKY:q.editor&&q.editor===this.model.activeEditor&&o.set(this.model.isSticky(this.model.activeEditor));break;case at.EDITORS_SELECTION:d.set(this.model.selectedEditors.length>1),l.set(this.model.selectedEditors.length===2),h.set(this.model.selectedEditors.every(ce=>ce.resource&&(this.fileService.hasProvider(ce.resource)||ce.resource.scheme===ue.untitled)));break}n.set(this.count)};this._register(this.onDidModelChange(q=>Q(q))),this._register(this.onDidActiveEditorChange(()=>j())),j(),Q({kind:at.EDITOR_ACTIVE}),Q({kind:at.GROUP_LOCKED})}registerContainerListeners(){this._register(z(this.element,ee.DBLCLICK,e=>{this.isEmpty&&(be.stop(e),this.editorService.openEditor({resource:void 0,options:{pinned:!0,override:Rt.id}},this.id))})),this._register(z(this.element,ee.AUXCLICK,e=>{this.isEmpty&&e.button===1&&(be.stop(e,!0),this.groupsView.removeGroup(this))}))}createContainerToolbar(){const e=M(".editor-group-container-toolbar");this.element.appendChild(e);const t=this._register(new pn(e,{ariaLabel:c(3310,"Empty editor group actions"),highlightToggledItems:!0})),i=this._register(this.menuService.createMenu(b.EmptyEditorGroup,this.scopedContextKeyService)),s=()=>{this.containerToolBarMenuDisposable.value=he(()=>t.clear());const o=Tp(i.getActions({arg:{groupId:this.id},shouldForwardArgs:!0}),"navigation");for(const n of[...o.primary,...o.secondary]){const r=this.keybindingService.lookupKeybinding(n.id);t.push(n,{icon:!0,label:!1,keybinding:r?.getLabel()})}};s(),this._register(i.onDidChange(s))}createContainerContextMenu(){this._register(z(this.element,ee.CONTEXT_MENU,e=>this.onShowContainerContextMenu(e))),this._register(z(this.element,Ni.Contextmenu,()=>this.onShowContainerContextMenu()))}onShowContainerContextMenu(e){if(!this.isEmpty)return;let t=this.element;e&&(t=new Vo(Ue(this.element),e)),this.contextMenuService.showContextMenu({menuId:b.EmptyEditorGroupContext,contextKeyService:this.contextKeyService,getAnchor:()=>t,onHide:()=>this.focus()})}doTrackFocus(){const e=this._register(fo(this.element));this._register(e.onDidFocus(()=>{this.isEmpty&&this._onDidFocus.fire()}));const t=i=>{let s;if($r(i)){if(i.button!==0||Ke&&i.ctrlKey)return;s=i.target}else s=i.initialTarget;El(s,"monaco-action-bar",this.titleContainer)||El(s,"monaco-breadcrumb-item",this.titleContainer)||setTimeout(()=>{this.focus()})};this._register(z(this.titleContainer,ee.MOUSE_DOWN,i=>t(i))),this._register(z(this.titleContainer,Ni.Tap,i=>t(i))),this._register(this.editorPane.onDidFocus(()=>{this._onDidFocus.fire()}))}updateContainer(){this.isEmpty?(this.element.classList.add("empty"),this.element.tabIndex=0,this.element.setAttribute("aria-label",c(3311,"{0} (empty)",this.ariaLabel))):(this.element.classList.remove("empty"),this.element.removeAttribute("tabIndex"),this.element.removeAttribute("aria-label")),this.updateStyles()}updateTitleContainer(){this.titleContainer.classList.toggle("tabs",this.groupsView.partOptions.showTabs==="multiple"),this.titleContainer.classList.toggle("show-file-icons",this.groupsView.partOptions.showIcons)}restoreEditors(e,t){if(this.count===0)return;let i;e instanceof ko?i=Wb(e):i=Object.create(null);const s=this.model.activeEditor;if(!s)return;i.pinned=this.model.isPinned(s),i.sticky=this.model.isSticky(s),i.preserveFocus=!0;const o={preserveWindowOrder:!0,skipTitleUpdate:!0},n=sn(),r=this.doShowEditor(s,{active:!0,isNew:!1},i,o).then(()=>{this.groupsView.activeGroup===this&&n&&_l(n)&&!t?.preserveFocus&&this.focus()});return this.titleControl.openEditors(this.editors),r}registerListeners(){this._register(this.model.onDidModelChange(e=>this.onDidGroupModelChange(e))),this._register(this.groupsView.onDidChangeEditorPartOptions(e=>this.onDidChangeEditorPartOptions(e))),this._register(this.groupsView.onDidVisibilityChange(e=>this.onDidVisibilityChange(e))),this._register(this.onDidFocus(()=>this.onDidGainFocus()))}onDidGroupModelChange(e){switch(this._onDidModelChange.fire(e),e.kind){case at.GROUP_LOCKED:this.element.classList.toggle("locked",this.isLocked);break;case at.EDITORS_SELECTION:this.onDidChangeEditorSelection();break}if(e.editor)switch(e.kind){case at.EDITOR_OPEN:bD(e)&&this.onDidOpenEditor(e.editor,e.editorIndex);break;case at.EDITOR_CLOSE:wD(e)&&this.handleOnDidCloseEditor(e.editor,e.editorIndex,e.context,e.sticky);break;case at.EDITOR_WILL_DISPOSE:this.onWillDisposeEditor(e.editor);break;case at.EDITOR_DIRTY:this.onDidChangeEditorDirty(e.editor);break;case at.EDITOR_TRANSIENT:this.onDidChangeEditorTransient(e.editor);break;case at.EDITOR_LABEL:this.onDidChangeEditorLabel(e.editor);break}}onDidOpenEditor(e,t){this.telemetryService.publicLog("editorOpened",this.toEditorTelemetryDescriptor(e)),this.updateContainer()}handleOnDidCloseEditor(e,t,i,s){this._onWillCloseEditor.fire({groupId:this.id,editor:e,context:i,index:t,sticky:s});const o=[e];e instanceof jt&&o.push(e.primary,e.secondary);for(const n of o)this.canDispose(n)&&n.dispose();this.updateContainer(),this._onDidCloseEditor.fire({groupId:this.id,editor:e,context:i,index:t,sticky:s})}canDispose(e){for(const t of this.editorPartsView.groups)if(t instanceof ko&&t.model.contains(e,{strictEquals:!0,supportSideBySide:xe.ANY}))return!1;return!0}toResourceTelemetryDescriptor(e){if(!e)return;const t=e?e.scheme===ue.file?e.fsPath:e.path:void 0;if(!t)return;let i=Fi(e);const s=i.indexOf("?");return i=s!==-1?i.substr(0,s):i,{mimeType:new GC(vD(e).join(", ")),scheme:e.scheme,ext:i,path:wu(t)}}toEditorTelemetryDescriptor(e){const t=e.getTelemetryDescriptor(),i=Ge.getOriginalUri(e,{supportSideBySide:xe.BOTH});return $.isUri(i)?(t.resource=this.toResourceTelemetryDescriptor(i),t):(i&&(i.primary&&(t.resource=this.toResourceTelemetryDescriptor(i.primary)),i.secondary&&(t.resourceSecondary=this.toResourceTelemetryDescriptor(i.secondary))),t)}onWillDisposeEditor(e){this.disposedEditorsWorker.work(e)}handleDisposedEditors(e){let t;const i=[];for(const s of e){const o=this.model.findEditor(s);if(!o)continue;const n=o[0];n.isDisposed()&&(this.model.isActive(n)?t=n:i.push(n))}for(const s of i)this.doCloseEditor(s,!0);t&&this.doCloseEditor(t,!0)}onDidChangeEditorPartOptions(e){this.updateTitleContainer(),this.titleControl.updateOptions(e.oldPartOptions,e.newPartOptions),(e.oldPartOptions.showTabs!==e.newPartOptions.showTabs||e.oldPartOptions.tabHeight!==e.newPartOptions.tabHeight||e.oldPartOptions.showTabs==="multiple"&&e.oldPartOptions.pinnedTabsOnSeparateRow!==e.newPartOptions.pinnedTabsOnSeparateRow)&&(this.relayout(),this.model.activeEditor&&this.titleControl.openEditors(this.model.getEditors(_e.SEQUENTIAL))),this.updateStyles(),e.oldPartOptions.enablePreview&&!e.newPartOptions.enablePreview&&this.model.previewEditor&&this.pinEditor(this.model.previewEditor)}onDidChangeEditorDirty(e){this.pinEditor(e),this.titleControl.updateEditorDirty(e)}onDidChangeEditorTransient(e){!this.model.isTransient(e)&&!this.groupsView.partOptions.enablePreview&&this.pinEditor(e)}onDidChangeEditorLabel(e){this.titleControl.updateEditorLabel(e)}onDidChangeEditorSelection(){this.titleControl.updateEditorSelections()}onDidVisibilityChange(e){this.editorPane.setVisible(e)}onDidGainFocus(){this.activeEditor&&this.model.setTransient(this.activeEditor,!1)}get index(){return this._index}get label(){return this.groupsLabel?c(3312,"{0}: Group {1}",this.groupsLabel,this._index+1):c(3313,"Group {0}",this._index+1)}get ariaLabel(){return this.groupsLabel?c(3314,"{0}: Editor Group {1}",this.groupsLabel,this._index+1):c(3315,"Editor Group {0}",this._index+1)}get disposed(){return this._disposed}get isEmpty(){return this.count===0}get titleHeight(){return this.titleControl.getHeight()}notifyIndexChanged(e){this._index!==e&&(this._index=e,this.model.setIndex(e))}notifyLabelChanged(e){this.groupsLabel!==e&&(this.groupsLabel=e,this.model.setLabel(e))}setActive(e){this.active=e,!e&&this.activeEditor&&this.selectedEditors.length>1&&this.setSelection(this.activeEditor,[]),this.element.classList.toggle("active",e),this.element.classList.toggle("inactive",!e),this.titleControl.setActive(e),this.updateStyles(),this.model.setActive(void 0)}get id(){return this.model.id}get windowId(){return this.groupsView.windowId}get editors(){return this.model.getEditors(_e.SEQUENTIAL)}get count(){return this.model.count}get stickyCount(){return this.model.stickyCount}get activeEditorPane(){return this.editorPane?this.editorPane.activeEditorPane??void 0:void 0}get activeEditor(){return this.model.activeEditor}get selectedEditors(){return this.model.selectedEditors}get previewEditor(){return this.model.previewEditor}isPinned(e){return this.model.isPinned(e)}isSticky(e){return this.model.isSticky(e)}isSelected(e){return this.model.isSelected(e)}isTransient(e){return this.model.isTransient(e)}isActive(e){return this.model.isActive(e)}async setSelection(e,t){this.isActive(e)?this.model.setSelection(e,t):await this.openEditor(e,{activation:to.ACTIVATE},{inactiveSelection:t})}contains(e,t){return this.model.contains(e,t)}getEditors(e,t){return this.model.getEditors(e,t)}findEditors(e,t){const i=this.uriIdentityService.asCanonicalUri(e);return this.getEditors(t?.order??_e.SEQUENTIAL).filter(s=>{if(s.resource&&Je(s.resource,i))return!0;if(t?.supportSideBySide===xe.PRIMARY||t?.supportSideBySide===xe.ANY){const o=Ge.getCanonicalUri(s,{supportSideBySide:xe.PRIMARY});if(o&&Je(o,i))return!0}if(t?.supportSideBySide===xe.SECONDARY||t?.supportSideBySide===xe.ANY){const o=Ge.getCanonicalUri(s,{supportSideBySide:xe.SECONDARY});if(o&&Je(o,i))return!0}return!1})}getEditorByIndex(e){return this.model.getEditorByIndex(e)}getIndexOfEditor(e){return this.model.indexOf(e)}isFirst(e){return this.model.isFirst(e)}isLast(e){return this.model.isLast(e)}focus(){this.activeEditorPane?this.activeEditorPane.focus():this.element.focus(),this._onDidFocus.fire()}pinEditor(e=this.activeEditor||void 0){if(e&&!this.model.isPinned(e)){const t=this.model.pin(e);t&&this.titleControl.pinEditor(t)}}stickEditor(e=this.activeEditor||void 0){this.doStickEditor(e,!0)}unstickEditor(e=this.activeEditor||void 0){this.doStickEditor(e,!1)}doStickEditor(e,t){if(e&&this.model.isSticky(e)!==t){const i=this.getIndexOfEditor(e),s=t?this.model.stick(e):this.model.unstick(e);if(!s)return;const o=this.getIndexOfEditor(s);o!==i&&this.titleControl.moveEditor(s,i,o,!0),t?this.titleControl.stickEditor(s):this.titleControl.unstickEditor(s)}}async openEditor(e,t,i){return this.doOpenEditor(e,t,{...i,supportSideBySide:xe.BOTH})}async doOpenEditor(e,t,i){if(!e||e.isDisposed())return;this._onWillOpenEditor.fire({editor:e,groupId:this.id});const s=t?.sticky||!this.groupsView.partOptions.enablePreview&&!t?.transient||e.isDirty()||(t?.pinned??typeof t?.index=="number")||typeof t?.index=="number"&&this.model.isSticky(t.index)||e.hasCapability($t.Scratchpad),o={index:t?t.index:void 0,pinned:s,sticky:t?.sticky||typeof t?.index=="number"&&this.model.isSticky(t.index),transient:!!t?.transient,inactiveSelection:i?.inactiveSelection,active:this.count===0||!t||!t.inactive,supportSideBySide:i?.supportSideBySide};!o.active&&!o.pinned&&this.model.activeEditor&&!this.model.isPinned(this.model.activeEditor)&&(o.active=!0);let n=!1,r=!1;if(t?.activation===to.ACTIVATE?n=!0:t?.activation===to.RESTORE?r=!0:t?.activation===to.PRESERVE?(n=!1,r=!1):o.active&&(n=!t||!t.preserveFocus,r=!n),typeof o.index=="number"){const p=this.model.indexOf(e);p!==-1&&p!==o.index&&this.doMoveEditorInsideGroup(e,o)}const{editor:d,isNew:l}=this.model.openEditor(e,o);l&&this.count===1&&this.editorPartsView.groups.length>1&&d.editorId&&this.groupsView.partOptions.autoLockGroups?.has(d.editorId)&&this.lock(!0);const h=this.doShowEditor(d,{active:!!o.active,isNew:l},t,i);return n?this.groupsView.activateGroup(this):r&&this.groupsView.restoreGroup(this),h}doShowEditor(e,t,i,s){let o;return t.active?o=(async()=>{const{pane:n,changed:r,cancelled:d,error:l}=await this.editorPane.openEditor(e,i,s,{newInGroup:t.isNew});if(!d)return r&&this._onDidActiveEditorChange.fire({editor:e}),l&&this._onDidOpenEditorFail.fire(e),!n&&this.activeEditor===e&&this.doCloseEditor(e,i?.preserveFocus,{fromError:!0}),n})():o=Promise.resolve(void 0),s?.skipTitleUpdate||this.titleControl.openEditor(e,s),o}async openEditors(e){const t=xi(e).filter(({editor:r})=>!r.isDisposed()),i=t.at(0);if(!i)return;const s={supportSideBySide:xe.BOTH};await this.doOpenEditor(i.editor,i.options,s);const o=t.slice(1),n=this.getIndexOfEditor(i.editor)+1;return await bu.settled(o.map(({editor:r,options:d},l)=>this.doOpenEditor(r,{...d,inactive:!0,pinned:!0,index:n+l},{...s,skipTitleUpdate:!0}))),this.titleControl.openEditors(o.map(({editor:r})=>r)),this.editorPane.activeEditorPane??void 0}moveEditors(e,t){const i={skipTitleUpdate:this!==t};let s=!1;const o=new Set;for(const{editor:n,options:r}of e)this.moveEditor(n,t,r,i)?o.add(n):s=!0;return i.skipTitleUpdate&&(t.titleControl.openEditors(Array.from(o)),this.titleControl.closeEditors(Array.from(o))),!s}moveEditor(e,t,i,s){return this===t?(this.doMoveEditorInsideGroup(e,i),!0):this.doMoveOrCopyEditorAcrossGroups(e,t,i,{...s,keepCopy:!1})}doMoveEditorInsideGroup(e,t){const i=t?t.index:void 0;if(typeof i!="number")return;const s=this.model.indexOf(e),o=this.model.getEditorByIndex(s);if(o){if(s!==i){const n=this.model.stickyCount;this.model.moveEditor(o,i),this.model.pin(o),this.titleControl.moveEditor(o,s,i,n!==this.model.stickyCount),this.titleControl.pinEditor(o)}t?.sticky&&this.stickEditor(o)}}doMoveOrCopyEditorAcrossGroups(e,t,i,s){const o=s?.keepCopy;if(!o||e.hasCapability($t.Singleton)){const r=e.canMove(this.id,t.id);if(typeof r=="string")return this.dialogService.error(r,c(3316,"Try saving or reverting the editor first and then try again.")),!1}const n=Wb(this,e,{...i,pinned:!0,sticky:i?.sticky??(!o&&this.model.isSticky(e))});return o||this._onWillMoveEditor.fire({groupId:this.id,editor:e,target:t.id}),t.doOpenEditor(o?e.copy():e,n,s),o||this.doCloseEditor(e,!0,{...s,context:_n.MOVE}),!0}copyEditors(e,t){const i={skipTitleUpdate:this!==t};for(const{editor:s,options:o}of e)this.copyEditor(s,t,o,i);if(i.skipTitleUpdate){const s=e.map(({editor:o})=>o);t.titleControl.openEditors(s)}}copyEditor(e,t,i,s){this===t?this.doMoveEditorInsideGroup(e,i):this.doMoveOrCopyEditorAcrossGroups(e,t,i,{...s,keepCopy:!0})}async closeEditor(e=this.activeEditor||void 0,t){return this.doCloseEditorWithConfirmationHandling(e,t)}async doCloseEditorWithConfirmationHandling(e=this.activeEditor||void 0,t,i){return!e||await this.handleCloseConfirmation([e])?!1:(this.doCloseEditor(e,t?.preserveFocus,i),!0)}doCloseEditor(e,t=this.groupsView.activeGroup!==this,i){i?.skipTitleUpdate||this.titleControl.beforeCloseEditor(e),this.model.isActive(e)?this.doCloseActiveEditor(t,i):this.doCloseInactiveEditor(e,i),i?.skipTitleUpdate||this.titleControl.closeEditor(e)}doCloseActiveEditor(e=this.groupsView.activeGroup!==this,t){const i=this.activeEditor,s=!e&&this.shouldRestoreFocus(this.element),o=this.groupsView.partOptions.closeEmptyGroups;if(o&&this.active&&this.count===1){const d=this.groupsView.getGroups(Oe.MOST_RECENTLY_ACTIVE)[1];d&&(s?d.focus():this.groupsView.activateGroup(d,!0))}i&&this.model.closeEditor(i,t?.context);const n=this.model.activeEditor;if(n){let r;e&&this.groupsView.activeGroup!==this&&(r=to.PRESERVE);const d={preserveFocus:e,activation:r,ignoreError:t?.fromError},l={preserveWindowOrder:!0};this.doOpenEditor(n,d,l)}else i&&this.editorPane.closeEditor(i),s&&!o&&this.focus(),this._onDidActiveEditorChange.fire({editor:void 0}),o&&this.groupsView.removeGroup(this,e)}shouldRestoreFocus(e){const t=sn();return t===yD(e)?!0:Oa(t,e)}doCloseInactiveEditor(e,t){this.model.closeEditor(e,t?.context)}async handleCloseConfirmation(e){if(!e.length)return!1;const t=e.shift();let i=this.mapEditorToPendingConfirmation.get(t);i||(i=this.doHandleCloseConfirmation(t),this.mapEditorToPendingConfirmation.set(t,i));let s;try{s=await i}finally{this.mapEditorToPendingConfirmation.delete(t)}return s||this.handleCloseConfirmation(e)}async doHandleCloseConfirmation(e,t){if(!this.shouldConfirmClose(e)||e instanceof jt&&this.model.contains(e.primary)||this.editorPartsView.groups.some(n=>{if(n===this)return!1;const r=n;return!!(r.contains(e,{supportSideBySide:xe.BOTH})||e instanceof jt&&r.contains(e.primary))}))return!1;let i=Ci.CANCEL,s=Gi.EXPLICIT,o=!1;if(!e.hasCapability($t.Untitled)&&!t?.skipAutoSave&&!e.closeHandler&&(this.filesConfigurationService.getAutoSaveMode(e).mode===Sl.ON_FOCUS_CHANGE?(o=!0,i=Ci.SAVE,s=Gi.FOCUS_CHANGE):vw&&(pi||Ec)&&this.filesConfigurationService.getAutoSaveMode(e).mode===Sl.ON_WINDOW_CHANGE&&(o=!0,i=Ci.SAVE,s=Gi.WINDOW_CHANGE)),!o){(!this.activeEditor||!this.activeEditor.matches(e))&&await this.doOpenEditor(e),await this.hostService.focus(Ue(this.element));let n=!1;if(typeof e.closeHandler?.confirm=="function")try{i=await e.closeHandler.confirm([{editor:e,groupId:this.id}])}catch(r){this.logService.error(r),n=!0}if(typeof e.closeHandler?.confirm!="function"||n){let r;e instanceof jt?r=e.primary.getName():r=e.getName(),i=await this.fileDialogService.showSaveConfirm([r])}}if(!e.closeHandler&&!this.shouldConfirmClose(e))return i===Ci.CANCEL;switch(i){case Ci.SAVE:return!await e.save(this.id,{reason:s})&&o?this.doHandleCloseConfirmation(e,{skipAutoSave:!0}):e.isDirty();case Ci.DONT_SAVE:try{return await e.revert(this.id),e.isDirty()}catch(n){return this.logService.error(n),await e.revert(this.id,{soft:!0}),e.isDirty()}case Ci.CANCEL:return!0}}shouldConfirmClose(e){if(e.closeHandler)try{return e.closeHandler.showConfirm()}catch(t){this.logService.error(t)}return e.isDirty()&&!e.isSaving()}async closeEditors(e,t){if(this.isEmpty)return!0;const i=this.doGetEditorsToClose(e);return await this.handleCloseConfirmation(i.slice(0))?!1:(this.doCloseEditors(i,t),!0)}doGetEditorsToClose(e){if(Array.isArray(e))return e;const t=e,i=typeof t.direction=="number";let s=this.model.getEditors(i?_e.SEQUENTIAL:_e.MOST_RECENTLY_ACTIVE,t);return t.savedOnly?s=s.filter(o=>!o.isDirty()||o.isSaving()):i&&t.except?s=t.direction===mw.LEFT?s.slice(0,this.model.indexOf(t.except,s)):s.slice(this.model.indexOf(t.except,s)+1):t.except&&(s=s.filter(o=>t.except&&!o.matches(t.except))),s}doCloseEditors(e,t){let i=!1;for(const s of e)this.isActive(s)?i=!0:this.doCloseInactiveEditor(s);i&&this.doCloseActiveEditor(t?.preserveFocus),e.length&&this.titleControl.closeEditors(e)}closeAllEditors(e){return this.isEmpty?(this.groupsView.partOptions.closeEmptyGroups&&this.groupsView.removeGroup(this),!0):e?.excludeConfirming?(this.doCloseAllEditors(e),!0):this.handleCloseConfirmation(this.model.getEditors(_e.MOST_RECENTLY_ACTIVE,e)).then(t=>t?!1:(this.doCloseAllEditors(e),!0))}doCloseAllEditors(e){let t=this.model.getEditors(_e.SEQUENTIAL,e);e?.excludeConfirming&&(t=t.filter(s=>!this.shouldConfirmClose(s)));const i=[];for(const s of t)this.isActive(s)||this.doCloseInactiveEditor(s),i.push(s);this.activeEditor&&i.includes(this.activeEditor)&&this.doCloseActiveEditor(),i.length&&this.titleControl.closeEditors(i)}async replaceEditors(e){let t;const i=[];for(let{editor:s,replacement:o,forceReplaceDirty:n,options:r}of e){const d=this.getIndexOfEditor(s);if(d>=0){const l=this.isActive(s);r?r.index=d:r={index:d},r.inactive=!l,r.pinned=r.pinned??!0;const h={editor:s,replacement:o,forceReplaceDirty:n,options:r};l?t=h:i.push(h)}}for(const{editor:s,replacement:o,forceReplaceDirty:n,options:r}of i)if(await this.doOpenEditor(o,r),!s.matches(o)){let d=!1;if(n?(this.doCloseEditor(s,!0,{context:_n.REPLACE}),d=!0):d=await this.doCloseEditorWithConfirmationHandling(s,{preserveFocus:!0},{context:_n.REPLACE}),!d)return}if(t){const s=this.doOpenEditor(t.replacement,t.options);t.editor.matches(t.replacement)||(t.forceReplaceDirty?this.doCloseEditor(t.editor,!0,{context:_n.REPLACE}):await this.doCloseEditorWithConfirmationHandling(t.editor,{preserveFocus:!0},{context:_n.REPLACE})),await s}}get isLocked(){return this.model.isLocked}lock(e){this.model.lock(e)}createEditorActions(e,t=b.EditorTitle){let i={primary:[],secondary:[]},s;const o=this.activeEditorPane;if(o instanceof ow){const n=o.scopedContextKeyService??this.scopedContextKeyService,r=e.add(this.menuService.createMenu(t,n,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:0}));s=r.onDidChange;const d=(l,h)=>h==="navigation"&&l.actions.length<=1;i=Tp(r.getActions({arg:this.resourceContext.get(),shouldForwardArgs:!0}),"navigation",d)}else{const n=e.add(new A);s=n.event,e.add(this.onDidActiveEditorChange(()=>n.fire()))}return{actions:i,onDidChange:s}}updateStyles(){const e=this.isEmpty;e?this.element.style.backgroundColor=this.getColor(CD)||"":this.element.style.backgroundColor="";const t=this.getColor(SD)||this.getColor(zi);!e&&t?(this.titleContainer.classList.add("title-border-bottom"),this.titleContainer.style.setProperty("--title-border-bottom-color",t)):(this.titleContainer.classList.remove("title-border-bottom"),this.titleContainer.style.removeProperty("--title-border-bottom-color"));const{showTabs:i}=this.groupsView.partOptions;this.titleContainer.style.backgroundColor=this.getColor(i==="multiple"?MC:ED)||"",this.editorContainer.style.backgroundColor=this.getColor(Iw)||""}get minimumWidth(){return this.editorPane.minimumWidth}get minimumHeight(){return this.editorPane.minimumHeight}get maximumWidth(){return this.editorPane.maximumWidth}get maximumHeight(){return this.editorPane.maximumHeight}get proportionalLayout(){return this.lastLayout?!(this.lastLayout.width===this.minimumWidth||this.lastLayout.height===this.minimumHeight):!0}layout(e,t,i,s){this.lastLayout={width:e,height:t,top:i,left:s},this.element.classList.toggle("max-height-478px",t<=478);const o=this.titleControl.layout({container:new Ne(e,t),available:new Ne(e,t-this.editorPane.minimumHeight)});this.progressBar.getContainer().style.top=`${Math.max(this.titleHeight.offset-2,0)}px`;const n=Math.max(0,t-o.height);this.editorContainer.style.height=`${n}px`,this.editorPane.layout({width:e,height:n,top:i+o.height,left:s})}relayout(){if(this.lastLayout){const{width:e,height:t,top:i,left:s}=this.lastLayout;this.layout(e,t,i,s)}}setBoundarySashes(e){this.editorPane.setBoundarySashes(e)}toJSON(){return this.model.serialize()}dispose(){this._disposed=!0,this._onWillDispose.fire(),super.dispose()}};Xr=ko=_([u(6,K),u(7,re),u(8,me),u(9,rt),u(10,ot),u(11,Ks),u(12,bt),u(13,fu),u(14,O),u(15,Ja),u(16,kr),u(17,it),u(18,zs),u(19,Nt),u(20,Ji),u(21,Ve)],Xr);const AP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Gg;Te(AP);function QE(a){return a.getValue("editor.dropIntoEditor.enabled")}function e_(a){return a.shiftKey}var Yn;let Wg=(Yn=class extends Cc{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=Vs.getInstance(),this.groupTransfer=Vs.getInstance(),this.treeItemsTransfer=Vs.getInstance(),this.cleanupOverlayScheduler=this._register(new Za(()=>this.dispose(),300)),this.enableDropIntoEditor=QE(this.configurationService)&&this.isDropIntoActiveEditorEnabled(),this.create()}create(){const e=this.getOverlayOffsetHeight(),t=this.container=M("div",{id:Gg.OVERLAY_ID});t.style.top=`${e}px`,this.groupView.element.appendChild(t),this.groupView.element.classList.add("dragged-over"),this._register(he(()=>{t.remove(),this.groupView.element.classList.remove("dragged-over")})),this.overlay=M(".editor-group-overlay-indicator"),t.appendChild(this.overlay),this.enableDropIntoEditor&&(this.dropIntoPromptElement=DD(c(3309,"Hold __{0}__ to drop into editor",Ke?"⇧":"Shift"),{}),this.dropIntoPromptElement.classList.add("editor-group-overlay-drop-into-prompt"),this.overlay.appendChild(this.dropIntoPromptElement)),this.registerListeners(t),this.updateStyles()}updateStyles(){const e=ge(this.overlay);e.style.backgroundColor=this.getColor(sw)||"";const t=this.getColor(Cw);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(AD)??"",this.dropIntoPromptElement.style.color=this.getColor(TD)??"";const i=this.getColor(kD);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 Yd(e,{onDragOver:t=>{if(this.enableDropIntoEditor&&e_(t)){this.dispose();return}const i=this.groupTransfer.hasData(Gt.prototype),s=this.editorTransfer.hasData(mt.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(mt.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=>{be.stop(t,!0),this.dispose(),this.currentDropOperation&&this.handleDrop(t,this.currentDropOperation.splitDirection)}})),this._register(z(e,ee.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}isDropIntoActiveEditorEnabled(){return!!this.groupView.activeEditor?.hasCapability($t.CanDropIntoEditor)}findSourceGroupView(){if(this.groupTransfer.hasData(Gt.prototype)){const e=this.groupTransfer.getData(Gt.prototype);if(Array.isArray(e)&&e.length>0)return this.editorGroupService.getGroup(e[0].identifier)}else if(this.editorTransfer.hasData(mt.prototype)){const e=this.editorTransfer.getData(mt.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(Gt.prototype)){const s=this.groupTransfer.getData(Gt.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:Cr.COPY_EDITORS}),this.editorGroupService.mergeGroup(o,this.groupView,r)}n&&this.editorGroupService.activateGroup(n)}this.groupTransfer.clearData(Gt.prototype)}}else if(this.editorTransfer.hasData(mt.prototype)){const s=this.editorTransfer.getData(mt.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=pu(this.groupView,o.map(p=>p.identifier.editor));d?r.copyEditors(h,l):r.moveEditors(h,l)}l.focus()}this.editorTransfer.clearData(mt.prototype)}}else if(this.treeItemsTransfer.hasData(xs.prototype)){const s=this.treeItemsTransfer.getData(xs.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 VC(r);o.push(...d.map(l=>({...l,options:{...l.options,pinned:!0}})))}}o.length&&this.editorService.openEditors(o,i(),{validateTrust:!0})}this.treeItemsTransfer.clearData(xs.prototype)}else this.instantiationService.createInstance(PC,{allowWorkspaceOpen:!Wi||xD(this.contextService.getWorkspace())}).handleDrop(e,Ue(this.groupView.element),()=>i(),o=>o?.focus())}isCopyOperation(e,t){return t?.editor.hasCapability($t.Singleton)?!1:e.ctrlKey&&!Ke||e.altKey&&Ke}isToggleSplitOperation(e){return e.altKey&&!Ke||e.shiftKey&&Ke}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,g=n/3,f=r/3;let w;switch(e>h&&e<n-h&&t>p&&t<r-p?w=void 0:o?e<g?w=Y.LEFT:e>g*2?w=Y.RIGHT:t<r/2?w=Y.UP:w=Y.DOWN:t<f?w=Y.UP:t>f*2?w=Y.DOWN:e<n/2?w=Y.LEFT:w=Y.RIGHT,w){case Y.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case Y.DOWN:this.doPositionOverlay({top:"50%",left:"0",width:"100%",height:"50%"}),this.toggleDropIntoPrompt(!1);break;case Y.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"}),this.toggleDropIntoPrompt(!1);break;case Y.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=ge(this.overlay);v.style.opacity="1",setTimeout(()=>v.classList.add("overlay-move-transition"),0),this.currentDropOperation={splitDirection:w}}doPositionOverlay(e){const[t,i]=Po(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=ge(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}},Gg=Yn,Yn.OVERLAY_ID="monaco-workbench-editor-drop-overlay",Yn);Wg=Gg=_([u(1,me),u(2,se),u(3,K),u(4,O),u(5,U),u(6,Sw),u(7,fi)],Wg);let Kg=class extends Cc{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=Vs.getInstance(),this.groupTransfer=Vs.getInstance(),this.registerListeners()}get overlay(){if(this._overlay&&!this._overlay.disposed)return this._overlay}registerListeners(){this._register(z(this.container,ee.DRAG_ENTER,e=>this.onDragEnter(e))),this._register(z(this.container,ee.DRAG_LEAVE,()=>this.onDragLeave()));for(const e of[this.container,Ue(this.container)])this._register(z(e,ee.DRAG_END,()=>this.onDragEnd()))}onDragEnter(e){if(QE(this.configurationService)&&e_(e))return;if(this.counter++,!this.editorTransfer.hasData(mt.prototype)&&!this.groupTransfer.hasData(Gt.prototype)&&e.dataTransfer){const i=ie.as(_D.DragAndDropContribution).getAll(),s=Array.from(i).map(o=>o.dataFormatKey);if(!ID(e,da.FILES,Fp.FILES,da.RESOURCES,Fp.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(Wg,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=>Oa(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)}};Kg=_([u(2,U),u(3,me),u(4,se),u(5,K)],Kg);const hd={targetWidth:900,leftMarginRatio:.1909,rightMarginRatio:.1909},wp={type:"distribute"};function sy(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:W.None}}function TP(a,e){return{element:a.element,get maximumSize(){return a.maximumWidth},get minimumSize(){return a.minimumWidth},onDidChange:W.map(a.onDidChange,t=>t&&t.width),layout:(t,i,s)=>a.layout(t,e(),s?.top??0,(s?.left??0)+i)}}class kP{constructor(e,t,i={...hd},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 F,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 jd(this.container,{inverseAltBehavior:!0,orientation:de.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={...hd},this.resizeSplitViews()})),this.splitView.layout(this.lastLayoutPosition.width,this.lastLayoutPosition);const t=this.style?this.style.background:void 0;this.emptyViews=[sy(t),sy(t)],this.splitView.addView(this.emptyViews[0],wp,0),this.splitView.addView(TP(this.view,()=>this.lastLayoutPosition.height),wp,1),this.splitView.addView(this.emptyViews[1],wp,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===hd.targetWidth:e.leftMarginRatio===hd.leftMarginRatio&&e.rightMarginRatio===hd.rightMarginRatio}dispose(){this.splitViewDisposables.dispose(),this.splitView&&(this.splitView.dispose(),this.splitView=void 0)}}var Qs;class xP{constructor(){this.element=M(".grid-view-container"),this._onDidChange=new ho,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=W.None,this._gridWidget=e}layout(e,t,i,s){this.gridWidget?.layout(e,t,i,s)}dispose(){this._onDidChange.dispose()}}var Ho;let eh=(Ho=class extends Wy{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 A),this.onDidFocus=this._onDidFocus.event,this._onDidLayout=this._register(new A),this.onDidLayout=this._onDidLayout.event,this._onDidChangeActiveGroup=this._register(new A),this.onDidChangeActiveGroup=this._onDidChangeActiveGroup.event,this._onDidChangeGroupIndex=this._register(new A),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLabel=this._register(new A),this.onDidChangeGroupLabel=this._onDidChangeGroupLabel.event,this._onDidChangeGroupLocked=this._register(new A),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new A),this.onDidChangeGroupMaximized=this._onDidChangeGroupMaximized.event,this._onDidActivateGroup=this._register(new A),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidAddGroup=this._register(new Bp),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new Bp),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new A),this.onDidMoveGroup=this._onDidMoveGroup.event,this.onDidSetGridWidget=this._register(new A),this._onDidChangeSizeConstraints=this._register(new ho),this.onDidChangeSizeConstraints=W.any(this.onDidSetGridWidget.event,this._onDidChangeSizeConstraints.event),this._onDidScroll=this._register(new ho),this.onDidScroll=W.any(this.onDidSetGridWidget.event,this._onDidScroll.event),this._onDidChangeEditorPartOptions=this._register(new A),this.onDidChangeEditorPartOptions=this._onDidChangeEditorPartOptions.event,this._onWillDispose=this._register(new A),this.onWillDispose=this._onWillDispose.event,this.workspaceMemento=this.getMemento(te.WORKSPACE,Ze.USER),this.profileMemento=this.getMemento(te.PROFILE,Ze.MACHINE),this.groupViews=new Map,this.mostRecentActiveGroups=[],this.container=M(".content"),this.gridWidgetDisposables=this._register(new F),this.gridWidgetView=this._register(new xP),this.enforcedPartOptions=[],this.top=0,this.left=0,this.sideGroup={openEditor:(g,f)=>{const[w]=this.scopedInstantiationService.invokeFunction(v=>dE(v,{editor:g,options:f},br));return w.openEditor(g,f)}},this._isReady=!1,this.whenReadyPromise=new tn,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new tn,this.whenRestored=this.whenRestoredPromise.p,this._willRestoreState=!1,this.priority=Ds.High,this.scopedContextKeyService=this._register(this.contextKeyService.createScoped(this.container)),this.scopedInstantiationService=this._register(this.instantiationService.createChild(new fr([re,this.scopedContextKeyService]))),this._partOptions=Kb(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(te.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e)))}onConfigurationUpdated(e){RD(e)&&this.handleChangedPartOptions()}handleChangedPartOptions(){const e=this._partOptions,t=Kb(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(),he(()=>{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===de.VERTICAL?ci.VERTICAL:ci.HORIZONTAL}get isReady(){return this._isReady}get hasRestorableState(){return!!this.workspaceMemento[Qs.EDITOR_PART_UI_STATE_STORAGE_KEY]}get willRestoreState(){return this._willRestoreState}getGroups(e=Oe.CREATION_TIME){switch(e){case Oe.CREATION_TIME:return this.groups;case Oe.MOST_RECENTLY_ACTIVE:{const t=xi(this.mostRecentActiveGroups.map(i=>this.getGroup(i)));return Go([...t,...this.groups])}case Oe.GRID_APPEARANCE:{const t=[];return this.gridWidget&&this.fillGridNodes(t,this.gridWidget.getViews()),t}}}fillGridNodes(e,t){Vn(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(Oe.GRID_APPEARANCE),n=o.indexOf(s);switch(e){case Ye.FIRST:return o[0];case Ye.LAST:return o[o.length-1];case Ye.NEXT:{let r=o[n+1];return!r&&i&&(r=this.doFindGroupByLocation(Ye.FIRST,t)),r}case Ye.PREVIOUS:{let r=o[n-1];return!r&&i&&(r=this.doFindGroupByLocation(Ye.LAST,t)),r}}}activateGroup(e,t){const i=this.assertGroupView(e);return this.doSetGroupActive(i),t||this.hostService.moveTop(Ue(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 Oi.EVEN:this.gridWidget.distributeViewSizes();break;case Oi.MAXIMIZE:if(this.groups.length<2)return;this.gridWidget.maximizeView(i),i.focus();break;case Oi.EXPAND:this.gridWidget.expandView(i);break}}toggleMaximizeGroup(e=this.activeGroup){this.hasMaximizedGroup()?this.unmaximizeGroup():this.arrangeGroups(Oi.MAXIMIZE,e)}toggleExpandGroup(e=this.activeGroup){this.isGroupExpanded(this.activeGroup)?this.arrangeGroups(Oi.EVEN):this.arrangeGroups(Oi.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===ci.HORIZONTAL?de.HORIZONTAL:de.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(Oe.GRID_APPEARANCE);if(i<o.length){const d=o[i-1];o.forEach((l,h)=>{h>=i&&this.mergeGroup(l,d)}),o=this.getGroups(Oe.GRID_APPEARANCE)}const n=this.activeGroup,r=vE({orientation:this.toGridViewOrientation(e.orientation,this.isTwoDimensionalGrid()?this.gridWidget.orientation:Ls(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===de.HORIZONTAL?ci.HORIZONTAL:ci.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?sn()===e.ownerDocument.body?!0:aC(e):!1}isTwoDimensionalGrid(){const e=this.gridWidget.getViews();return Vn(e)?e.children.some(t=>Vn(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(Oi.EXPAND,o),n&&s.focus()}else o=s.groupsView.addGroup(s,t,i);return o}getSplitSizingStyle(){switch(this._partOptions.splitSizing){case"distribute":return ua.Distribute;case"split":return ua.Split;default:return ua.Auto}}doCreateGroupView(e,t){let i;e instanceof Xr?i=Xr.createCopy(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):FC(e)?i=Xr.createFromSerialized(e,this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t):i=Xr.createNew(this.editorPartsView,this,this.groupsLabel,this.count,this.scopedInstantiationService,t),this.groupViews.set(i.id,i);const s=new F;return s.add(i.onDidFocus(()=>{this.doSetGroupActive(i),this._onDidFocus.fire()})),s.add(i.onDidModelChange(o=>{switch(o.kind){case at.GROUP_LOCKED:this._onDidChangeGroupLocked.fire(i);break;case at.GROUP_INDEX:this._onDidChangeGroupIndex.fire(i);break;case at.GROUP_LABEL:this._onDidChangeGroupLabel.fire(i);break}})),s.add(i.onDidActiveEditorChange(()=>{this.updateContainer()})),W.once(i.onWillDispose)(()=>{qe(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(Oi.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 Y.UP:return Ee.Up;case Y.DOWN:return Ee.Down;case Y.LEFT:return Ee.Left;case Y.RIGHT:return Ee.Right}}toGridViewOrientation(e,t){return typeof e=="number"?e===ci.HORIZONTAL?de.HORIZONTAL:de.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(Oe.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(Oe.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===Cr.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(Oe.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 LD(Sr(e)),this.scopedInstantiationService.createInstance(Kg,e,t)}get minimumWidth(){return Math.min(this.centeredLayoutWidget.minimumWidth,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(Ue(this.container))).width)}get maximumWidth(){return this.centeredLayoutWidget.maximumWidth}get minimumHeight(){return Math.min(this.centeredLayoutWidget.minimumHeight,this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(Ue(this.container))).height)}get maximumHeight(){return this.centeredLayoutWidget.maximumHeight}get snap(){return this.layoutService.getPanelAlignment()==="center"}get onDidChange(){return W.any(this.centeredLayoutWidget.onDidChange,this.onDidSetGridWidget.event)}get gridSeparatorBorder(){return this.theme.getColor(VD)||this.theme.getColor(zi)||Ii.transparent}updateStyles(){this.container.style.backgroundColor=this.getColor(Iw)||"";const e={separatorBorder:this.gridSeparatorBorder,background:this.theme.getColor(PD)||Ii.transparent};this.gridWidget.style(e),this.centeredLayoutWidget.styles(e)}createContentArea(e,t){return this.element=e,this.windowId!==ve.vscodeWindowId&&this.container.classList.add("auxiliary"),e.appendChild(this.container),this._willRestoreState=!t||t.restorePreviousState,this.doCreateGridControl(),this.centeredLayoutWidget=this._register(new kP(this.container,this.gridWidgetView,this.profileMemento[Qs.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,bu.settled(this.groups.map(i=>i.whenRestored)).finally(()=>{this.whenRestoredPromise.complete()}),this.container}handleContextKeys(){gn.bindTo(this.scopedContextKeyService).set(this.windowId!==ve.vscodeWindowId);const t=_c.bindTo(this.scopedContextKeyService),i=No.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(OD(i,()=>i.classList.remove("visible"))),this._register(pl.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(H.PANEL_PART)&&h===this.layoutService.getPanelPosition()?this.layoutService.setPartHidden(!1,H.PANEL_PART):!this.layoutService.isVisible(H.AUXILIARYBAR_PART)&&h===(this.layoutService.getSideBarPosition()===di.RIGHT?di.LEFT:di.RIGHT)&&this.layoutService.setPartHidden(!1,H.AUXILIARYBAR_PART)},l=()=>{s&&(clearTimeout(s),s=void 0),o&&(clearTimeout(o),o=void 0)};this._register(pl.INSTANCE.registerTarget(i,{onDragOver:h=>{be.stop(h.eventData,!0),h.eventData.dataTransfer&&(h.eventData.dataTransfer.dropEffect="none");const p=i.getBoundingClientRect();let g,f;const w=100;h.eventData.clientX<p.left+w&&(g=di.LEFT),h.eventData.clientX>p.right-w&&(g=di.RIGHT),h.eventData.clientY>p.bottom-w&&(f=di.BOTTOM),h.eventData.clientY<p.top+w&&(f=di.TOP),s&&g!==n&&(clearTimeout(s),s=void 0),o&&f!==r&&(clearTimeout(o),o=void 0),!s&&g!==void 0&&(n=g,s=setTimeout(()=>d(g),200)),!o&&f!==void 0&&(r=f,o=setTimeout(()=>d(f),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 Bo(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 on(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=Bo.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(Oe.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(Ne.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[Qs.EDITOR_PART_UI_STATE_STORAGE_KEY]:this.workspaceMemento[Qs.EDITOR_PART_UI_STATE_STORAGE_KEY]=this.createState()),this.centeredLayoutWidget){const e=this.centeredLayoutWidget.state;this.centeredLayoutWidget.isDefault(e)?delete this.profileMemento[Qs.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]:this.profileMemento[Qs.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]=e}super.saveState()}loadState(){return this.workspaceMemento[Qs.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(Oe.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(Oe.GRID_APPEARANCE))i?.includes(o)||this._onDidAddGroup.fire(o);this.notifyGroupIndexChange()}onDidChangeMementoState(e){if(e.external&&e.scope===te.WORKSPACE){this.reloadMemento(e.scope);const t=this.loadState();t&&this.applyState(t)}}toJSON(){return{type:H.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()}},Qs=Ho,Ho.EDITOR_PART_UI_STATE_STORAGE_KEY="editorpart.state",Ho.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY="editorpart.centeredview",Ho);eh=Qs=_([u(4,K),u(5,me),u(6,se),u(7,pe),u(8,st),u(9,Nt),u(10,re)],eh);let Ug=class extends eh{constructor(e,t,i,s,o,n,r,d){super(e,H.EDITOR_PART,"",ve.vscodeWindowId,t,i,s,o,n,r,d)}};Ug=_([u(1,K),u(2,me),u(3,se),u(4,pe),u(5,st),u(6,Nt),u(7,re)],Ug);var Wr,Hg;const Uu=FD(new A);E(class extends V{constructor(){super({id:"workbench.action.toggleCompactAuxiliaryWindow",title:y(2959,"Toggle Window Compact Mode"),category:R.View,f1:!0,precondition:AC})}async run(){Uu.fire({windowId:an().vscodeWindowId,compact:"toggle"})}});E(class extends V{constructor(){super({id:"workbench.action.enableCompactAuxiliaryWindow",title:c(2960,"Turn On Compact Mode"),icon:P.screenFull,menu:{id:b.LayoutControlMenu,when:D.and(UC.toNegated(),gn),order:0}})}async run(){Uu.fire({windowId:an().vscodeWindowId,compact:!0})}});E(class extends V{constructor(){super({id:"workbench.action.disableCompactAuxiliaryWindow",title:c(2961,"Turn Off Compact Mode"),icon:P.screenNormal,menu:{id:b.LayoutControlMenu,when:D.and(UC,gn),order:0}})}async run(){Uu.fire({windowId:an().vscodeWindowId,compact:!1})}});var Xn;let zg=(Xn=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 F;let o=!!t?.compact;function n(){let Z=0;return G&&(Z+=T.height),w&&v&&(Z+=w.height),Z}function r(Z){G?Ra(T.container):mr(T.container),Z&&h.layout()}function d(Z){w&&(v?Ra(w.container):mr(w.container),Z&&h.layout())}function l(Z){if(Z===o)return;o=Z,h.updateOptions({compact:o}),w?.updateOptions({compact:o}),g.updateOptions({compact:o});const j=G;G=!o&&i.configurationService.getValue(Wr.STATUS_BAR_VISIBILITY)!==!1,j!==G&&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 g=s.add(this.instantiationService.createInstance($g,h.window.vscodeWindowId,this.editorPartsView,t?.state,e));g.updateOptions({compact:o}),s.add(this.editorPartsView.registerPart(g)),g.create(p);const f=s.add(g.scopedInstantiationService.createChild(new fr([O,this.editorService.createScoped(g,s)])));let w,v=!1;if(vw&&ND()){w=s.add(this.titleService.createAuxiliaryTitlebarPart(h.container,g,f)),w.updateOptions({compact:o}),v=Ub(this.configurationService,h.window,void 0);const Z=()=>{const j=v;v=Ub(this.configurationService,h.window,void 0),j!==v&&d(!0)};s.add(w.onDidChange(()=>h.layout())),s.add(this.layoutService.onDidChangePartVisibility(()=>Z())),s.add(KC(j=>{j===h.window.vscodeWindowId&&Z()})),d(!1)}else s.add(f.createInstance(MD,h.window));const T=s.add(this.statusbarService.createAuxiliaryStatusbarPart(h.container,f));let G=!o&&this.configurationService.getValue(Wr.STATUS_BAR_VISIBILITY)!==!1;s.add(this.configurationService.onDidChangeConfiguration(Z=>{Z.affectsConfiguration(Wr.STATUS_BAR_VISIBILITY)&&(G=!o&&this.configurationService.getValue(Wr.STATUS_BAR_VISIBILITY)!==!1,r(!0))})),r(!1);const B=s.add(W.once(g.onWillClose)(()=>h.window.close()));s.add(W.once(h.onUnload)(()=>{s.isDisposed||(B.dispose(),g.close(),s.dispose())})),s.add(W.once(this.lifecycleService.onDidShutdown)(()=>s.dispose())),s.add(h.onBeforeUnload(Z=>{for(const j of g.groups)for(const Q of j.editors){const q=Q.canMove(j.id,this.editorPartsView.mainPart.activeGroup.id);if(typeof q=="string"){j.openEditor(Q),Z.veto(q);break}}})),s.add(h.onWillLayout(Z=>{const j=w?.height??0;w?.layout(Z.width,j,0,0);const Q=Z.height-n();g.layout(Z.width,Q,j,0),T.layout(Z.width,T.height,Z.height-T.height,0)})),h.layout(),s.add(Uu.event(Z=>{if(Z.windowId===h.window.vscodeWindowId){let j;typeof Z.compact=="boolean"?j=Z.compact:j=!o,l(j)}}));const X=s.add(f.createChild(new fr([Fs,this.statusbarService.createScoped(T,s)])));return{part:g,instantiationService:X,disposables:s}}},Wr=Xn,Xn.STATUS_BAR_VISIBILITY="workbench.statusBar.visible",Xn);zg=Wr=_([u(1,K),u(2,Dw),u(3,Qa),u(4,se),u(5,Fs),u(6,BD),u(7,O),u(8,st)],zg);var Jn;let $g=(Jn=class extends eh{constructor(e,t,i,s,o,n,r,d,l,h,p){const g=Hg.COUNTER++;super(t,`workbench.parts.auxiliaryEditor.${g}`,s,e,o,n,r,d,l,h,p),this.state=i,this._onWillClose=this._register(new A),this.onWillClose=this._onWillClose.event,this.optionsDisposable=this._register(new ke),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(Oe.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(Oe.MOST_RECENTLY_ACTIVE))if(!i.isLocked){e=i;break}e||(e=this.editorPartsView.mainPart.addGroup(this.editorPartsView.mainPart.activeGroup,this.partOptions.openSideBySideDirection==="right"?Y.RIGHT:Y.DOWN));const t=this.mergeAllGroups(e,{preserveExistingIndex:!0});return e.focus(),t}},Hg=Jn,Jn.COUNTER=1,Jn);$g=Hg=_([u(4,K),u(5,me),u(6,se),u(7,pe),u(8,st),u(9,Nt),u(10,re)],$g);var Sn,zo;let oy=(zo=class extends GD{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 A),this.onDidCreateAuxiliaryEditorPart=this._onDidCreateAuxiliaryEditorPart.event,this.workspaceMemento=this.getMemento(te.WORKSPACE,Ze.USER),this._isReady=!1,this.whenReadyPromise=new tn,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new tn,this.whenRestored=this.whenRestoredPromise.p,this._onDidActiveGroupChange=this._register(new A),this.onDidChangeActiveGroup=this._onDidActiveGroupChange.event,this._onDidAddGroup=this._register(new A),this.onDidAddGroup=this._onDidAddGroup.event,this._onDidRemoveGroup=this._register(new A),this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidMoveGroup=this._register(new A),this.onDidMoveGroup=this._onDidMoveGroup.event,this._onDidActivateGroup=this._register(new A),this.onDidActivateGroup=this._onDidActivateGroup.event,this._onDidChangeGroupIndex=this._register(new A),this.onDidChangeGroupIndex=this._onDidChangeGroupIndex.event,this._onDidChangeGroupLocked=this._register(new A),this.onDidChangeGroupLocked=this._onDidChangeGroupLocked.event,this._onDidChangeGroupMaximized=this._register(new A),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 Il),this.editorWorkingSets=(()=>{const n=this.storageService.get(Sn.EDITOR_WORKING_SETS_STORAGE_KEY,te.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(te.WORKSPACE,this._store)(e=>this.onDidChangeMementoState(e))),this.whenReady.then(()=>this.registerGroupsContextKeyListeners())}createMainEditorPart(){return this.instantiationService.createInstance(Ug,this)}getScopedInstantiationService(e){return e===this.mainPart&&(this.mapPartToInstantiationService.has(e.windowId)||this.instantiationService.invokeFunction(t=>{const i=t.get(O),s=t.get(Fs);this.mapPartToInstantiationService.set(e.windowId,this._register(this.mainPart.scopedInstantiationService.createChild(new fr([O,i.createScoped(this.mainPart,this._store)],[Fs,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(zg,this).create(this.getGroupsLabel(this._parts.size),e);return this.mapPartToInstantiationService.set(t.windowId,i),s.add(he(()=>this.mapPartToInstantiationService.delete(t.windowId))),this._onDidAddGroup.fire(t.activeGroup),this._onDidCreateAuxiliaryEditorPart.fire(t),t}registerPart(e){const t=this._register(new F);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(he(()=>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(3332,"Window {0}",e+1)}getPart(e){if(this._parts.size>1)if(Sr(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[Sn.EDITOR_PARTS_UI_STATE_STORAGE_KEY]}saveState(){const e=this.createState();e.auxiliary.length===0?delete this.workspaceMemento[Sn.EDITOR_PARTS_UI_STATE_STORAGE_KEY]:this.workspaceMemento[Sn.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===te.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(Oe.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:ed(),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(Sn.EDITOR_WORKING_SETS_STORAGE_KEY,JSON.stringify(this.editorWorkingSets),te.WORKSPACE,Ze.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=Oe.CREATION_TIME){if(this._parts.size>1){let t;switch(e){case Oe.GRID_APPEARANCE:case Oe.CREATION_TIME:t=this.parts;break;case Oe.MOST_RECENTLY_ACTIVE:t=Go([...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(Oe.GRID_APPEARANCE);if(e.location===Ye.FIRST||e.location===Ye.LAST)return e.location===Ye.FIRST?o[0]:o[o.length-1];const n=s.findGroup(e,t,!1);if(n)return n;if(e.location===Ye.NEXT||e.location===Ye.PREVIOUS){const r=this.assertGroupView(t),d=o.indexOf(r);if(e.location===Ye.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 he(()=>{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)}},Sn=zo,zo.EDITOR_PARTS_UI_STATE_STORAGE_KEY="editorparts.state",zo.EDITOR_WORKING_SETS_STORAGE_KEY="editor.workingSets",zo);oy=Sn=_([u(0,K),u(1,pe),u(2,me),u(3,Dw),u(4,re)],oy);var qg;Te($D);var Zn;let jg=(Zn=class extends Jd{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,g,f,w){super(H.PANEL_PART,{hasTitle:!0},qg.activePanelSettingsKey,WD.bindTo(h),KD.bindTo(h),"panel","panel",void 0,UD,e,t,i,s,o,n,r,d,l,h,p,f),this.commandService=g,this.configurationService=w,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=ge(this.getContainer());e.style.backgroundColor=this.getColor(ep)||"";const t=this.getColor(Dl)||this.getColor(zi)||"";e.style.borderLeftColor=t,e.style.borderRightColor=t,e.style.borderBottomColor=t;const i=this.getTitleArea();i&&(i.style.borderTopColor=this.getColor(Dl)||this.getColor(zi)||"")}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:Ar.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.layoutService.getPanelPosition()===di.BOTTOM&&!this.layoutService.isPanelMaximized()?La.ABOVE:La.BELOW},fillExtraContextMenuActions:e=>this.fillExtraContextMenuActions(e),compositeSize:0,iconSize:16,compact:!0,overflowActionSize:44,colors:e=>({activeBackgroundColor:e.getColor(ep),inactiveBackgroundColor:e.getColor(ep),activeBorderBottomColor:e.getColor(sC),activeForegroundColor:e.getColor(tC),inactiveForegroundColor:e.getColor(Qy),badgeBackground:e.getColor(zD),badgeForeground:e.getColor(HD),dragAndDropBorder:e.getColor(Yy)})}}fillExtraContextMenuActions(e){if(this.getCompositeBarPosition()===Re.TITLE){const d=this.getViewsSubmenuAction();d&&(e.push(new go),e.push(d))}const t=this.menuService.getMenuActions(b.PanelPositionMenu,this.contextKeyService,{shouldForwardArgs:!0}),i=this.menuService.getMenuActions(b.PanelAlignmentMenu,this.contextKeyService,{shouldForwardArgs:!0}),s=ml(t).secondary,o=ml(i).secondary,n=this.configurationService.getValue("workbench.panel.showLabels"),r=lo({id:"workbench.action.panel.toggleShowLabels",label:n?c(3532,"Show Icons"):c(3533,"Show Labels"),run:()=>this.configurationService.updateValue("workbench.panel.showLabels",!n)});e.push(new go,new gl("workbench.action.panel.position",c(3534,"Panel Position"),s),new gl("workbench.action.panel.align",c(3535,"Align Panel"),o),r,lo({id:Hb.ID,label:c(3536,"Hide Panel"),run:()=>this.commandService.executeCommand(Hb.ID)}))}layout(e,t,i,s){let o;switch(this.layoutService.getPanelPosition()){case di.RIGHT:o=new Ne(e-1,t);break;case di.TOP:o=new Ne(e,t-1);break;default:o=new Ne(e,t);break}super.layout(o.width,o.height,i,s)}shouldShowCompositeBar(){return!0}getCompositeBarPosition(){return Re.TITLE}toJSON(){return{type:H.PANEL_PART}}},qg=Zn,Zn.activePanelSettingsKey="workbench.panelpart.activepanelid",Zn);jg=qg=_([u(0,Qe),u(1,pe),u(2,bt),u(3,st),u(4,ot),u(5,ei),u(6,K),u(7,me),u(8,_t),u(9,re),u(10,Qt),u(11,Xe),u(12,Ks),u(13,se)],jg);const t_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));Te(t_);E(class extends V{constructor(){super({id:"workbench.action.closeSidebar",title:y(3537,"Close Primary Side Bar"),category:R.View,f1:!0,precondition:yw})}run(a){a.get(st).setPartHidden(!0,H.SIDEBAR_PART)}});class RP extends V{constructor(){super({id:"workbench.action.focusSideBar",title:y(3538,"Focus into Primary Side Bar"),category:R.View,f1:!0,keybinding:{weight:x.WorkbenchContrib,when:null,primary:S.CtrlCmd|m.Digit0}})}async run(e){const t=e.get(st),i=e.get(fn);t.isVisible(H.SIDEBAR_PART)||t.setPartHidden(!1,H.SIDEBAR_PART),i.getActivePaneComposite(ae.Sidebar)?.focus()}}E(RP);var Yg;Te(t_);var Qn;let Xg=(Qn=class extends Jd{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,g,f){super(H.SIDEBAR_PART,{hasTitle:!0,borderWidth:()=>this.getColor(fl)||this.getColor(zi)?1:0},Yg.activeViewletSettingsKey,qD.bindTo(h),jD.bindTo(h),"sideBar","viewlet",YD,qy,e,t,i,s,o,n,r,d,l,h,p,f),this.configurationService=g,this.minimumWidth=170,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.priority=Ds.Low,this.activityBarPart=this._register(this.instantiationService.createInstance(Kc,this)),this.rememberActivityBarVisiblePosition(),this._register(g.onDidChangeConfiguration(w=>{w.affectsConfiguration(vi.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=ge(this.getContainer());e.style.backgroundColor=this.getColor(ra)||"",e.style.color=this.getColor(jy)||"";const t=this.getColor(fl)||this.getColor(zi),i=this.layoutService.getSideBarPosition()===di.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(XD)??""}layout(e,t,i,s){this.layoutService.isVisible(H.SIDEBAR_PART)&&super.layout(e,t,i,s)}getTitleAreaDropDownAnchorAlignment(){return this.layoutService.getSideBarPosition()===di.LEFT?ul.LEFT:ul.RIGHT}createCompositeBar(){return this.instantiationService.createInstance(JD,this.getCompositeBarOptions(),this.partId,this,!1)}getCompositeBarOptions(){return{partContainerClass:"sidebar",pinnedViewContainersKey:Kc.pinnedViewContainersKey,placeholderViewContainersKey:Kc.placeholderViewContainersKey,viewContainersWorkspaceStateKey:Kc.viewContainersWorkspaceStateKey,icon:!0,orientation:Ar.HORIZONTAL,recomputeSizes:!0,activityHoverOptions:{position:()=>this.getCompositeBarPosition()===Re.BOTTOM?La.ABOVE:La.BELOW},fillExtraContextMenuActions:e=>{if(this.getCompositeBarPosition()===Re.TITLE){const t=this.getViewsSubmenuAction();t&&(e.push(new go),e.push(t))}},compositeSize:0,iconSize:16,overflowActionSize:30,colors:e=>({activeBackgroundColor:e.getColor(ra),inactiveBackgroundColor:e.getColor(ra),activeBorderBottomColor:e.getColor(oC),activeForegroundColor:e.getColor(iC),inactiveForegroundColor:e.getColor(eC),badgeBackground:e.getColor(Zy),badgeForeground:e.getColor(Jy),dragAndDropBorder:e.getColor(Xy)}),compact:!0}}shouldShowCompositeBar(){const e=this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION);return e===dt.TOP||e===dt.BOTTOM}shouldShowActivityBar(){return this.shouldShowCompositeBar()?!1:this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION)!==dt.HIDDEN}getCompositeBarPosition(){switch(this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION)){case dt.TOP:return Re.TOP;case dt.BOTTOM:return Re.BOTTOM;case dt.HIDDEN:case dt.DEFAULT:default:return Re.TITLE}}rememberActivityBarVisiblePosition(){const e=this.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION);e!==dt.HIDDEN&&this.storageService.store(vi.ACTIVITY_BAR_LOCATION,e,te.PROFILE,Ze.USER)}getRememberedActivityBarVisiblePosition(){switch(this.storageService.get(vi.ACTIVITY_BAR_LOCATION,te.PROFILE)){case dt.TOP:return dt.TOP;case dt.BOTTOM:return dt.BOTTOM;default:return dt.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(vi.ACTIVITY_BAR_LOCATION)===dt.HIDDEN&&(await this.configurationService.updateValue(vi.ACTIVITY_BAR_LOCATION,this.getRememberedActivityBarVisiblePosition()),this.onDidChangeActivityBarLocation()),this.shouldShowCompositeBar()?this.focusCompositeBar():(this.layoutService.isVisible(H.ACTIVITYBAR_PART)||this.layoutService.setPartHidden(!1,H.ACTIVITYBAR_PART),this.activityBarPart.show(!0))}registerActions(){const e=this;this._register(E(class extends V{constructor(){super({id:ZD,title:y(3539,"Toggle Activity Bar Visibility")})}run(){const t=e.configurationService.getValue(vi.ACTIVITY_BAR_LOCATION)===dt.HIDDEN?e.getRememberedActivityBarVisiblePosition():dt.HIDDEN;return e.configurationService.updateValue(vi.ACTIVITY_BAR_LOCATION,t)}}))}toJSON(){return{type:H.SIDEBAR_PART}}},Yg=Qn,Qn.activeViewletSettingsKey="workbench.sidebar.activeviewletid",Qn);Xg=Yg=_([u(0,Qe),u(1,pe),u(2,bt),u(3,st),u(4,ot),u(5,ei),u(6,K),u(7,me),u(8,_t),u(9,re),u(10,Qt),u(11,se),u(12,Ks)],Xg);let Jg=class extends N{constructor(e,t,i){super(),this.viewId=e,this.viewDescriptorService=t,this.activityService=i,this.activity=void 0,this.activityDisposable=N.None,this._register(W.filter(this.viewDescriptorService.onDidChangeContainer,s=>s.views.some(o=>o.id===e))(()=>this.update())),this._register(W.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()}};Jg=_([u(1,_t),u(2,mn)],Jg);let Zg=class extends N{constructor(e,t){super(),this.viewDescriptorService=e,this.instantiationService=t,this.viewActivities=new Map,this._onDidChangeActivity=this._register(new A),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 N.None;let s=this.viewContainerActivities.get(e);return s||(s=[],this.viewContainerActivities.set(e,s)),s.push(t),this._onDidChangeActivity.fire(i),he(()=>{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(Jg,e)},this.viewActivities.set(e,i));const s=i.id;i.activity.setActivity(t);const o=i;return he(()=>{o.id===s&&(o.activity.dispose(),this.viewActivities.delete(e))})}showAccountsActivity(e){return this.showActivity(QD,e)}showGlobalActivity(e){return this.showActivity(eA,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),he(()=>{i.splice(i.indexOf(t),1),i.length===0&&this.globalActivities.delete(e),this._onDidChangeActivity.fire(e)})}};Zg=_([u(0,_t),u(1,K)],Zg);class rc{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=Si.lowerCaseToEnum(o);return[new Fo(t.ctrl,t.shift,t.alt,t.meta,n),t.remains]}const s=Pt.fromUserSettings(t.key);return[new Wo(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 tA(t):null}}const i_=[{key:"commandPalette",id:b.CommandPalette,description:c(12723,"The Command Palette"),supportsSubmenus:!1},{key:"touchBar",id:b.TouchBarContext,description:c(12724,"The touch bar (macOS only)"),supportsSubmenus:!1},{key:"editor/title",id:b.EditorTitle,description:c(12725,"The editor title menu")},{key:"editor/title/run",id:b.EditorTitleRun,description:c(12726,"Run submenu inside the editor title menu")},{key:"editor/context",id:b.EditorContext,description:c(12727,"The editor context menu")},{key:"editor/context/copy",id:b.EditorContextCopy,description:c(12728,"'Copy as' submenu in the editor context menu")},{key:"editor/context/share",id:b.EditorContextShare,description:c(12729,"'Share' submenu in the editor context menu"),proposed:"contribShareMenu"},{key:"explorer/context",id:b.ExplorerContext,description:c(12730,"The file explorer context menu")},{key:"explorer/context/share",id:b.ExplorerContextShare,description:c(12731,"'Share' submenu in the file explorer context menu"),proposed:"contribShareMenu"},{key:"editor/title/context",id:b.EditorTitleContext,description:c(12732,"The editor tabs context menu")},{key:"editor/title/context/share",id:b.EditorTitleContextShare,description:c(12733,"'Share' submenu inside the editor title context menu"),proposed:"contribShareMenu"},{key:"debug/callstack/context",id:b.DebugCallStackContext,description:c(12734,"The debug callstack view context menu")},{key:"debug/variables/context",id:b.DebugVariablesContext,description:c(12735,"The debug variables view context menu")},{key:"debug/watch/context",id:b.DebugWatchContext,description:c(12736,"The debug watch view context menu")},{key:"debug/toolBar",id:b.DebugToolBar,description:c(12737,"The debug toolbar menu")},{key:"debug/createConfiguration",id:b.DebugCreateConfiguration,proposed:"contribDebugCreateConfiguration",description:c(12738,"The debug create configuration menu")},{key:"notebook/variables/context",id:b.NotebookVariablesContext,description:c(12739,"The notebook variables view context menu")},{key:"menuBar/home",id:b.MenubarHomeMenu,description:c(12740,"The home indicator context menu (web only)"),proposed:"contribMenuBarHome",supportsSubmenus:!1},{key:"menuBar/edit/copy",id:b.MenubarCopy,description:c(12741,"'Copy as' submenu in the top level Edit menu")},{key:"scm/title",id:b.SCMTitle,description:c(12742,"The Source Control title menu")},{key:"scm/sourceControl",id:b.SCMSourceControl,description:c(12743,"The Source Control menu")},{key:"scm/sourceControl/title",id:b.SCMSourceControlTitle,description:c(12744,"The Source Control title menu"),proposed:"contribSourceControlTitleMenu"},{key:"scm/resourceState/context",id:b.SCMResourceContext,description:c(12745,"The Source Control resource state context menu")},{key:"scm/resourceFolder/context",id:b.SCMResourceFolderContext,description:c(12746,"The Source Control resource folder context menu")},{key:"scm/resourceGroup/context",id:b.SCMResourceGroupContext,description:c(12747,"The Source Control resource group context menu")},{key:"scm/change/title",id:b.SCMChangeContext,description:c(12748,"The Source Control inline change menu")},{key:"scm/inputBox",id:b.SCMInputBox,description:c(12749,"The Source Control input box menu"),proposed:"contribSourceControlInputBoxMenu"},{key:"scm/history/title",id:b.SCMHistoryTitle,description:c(12750,"The Source Control History title menu"),proposed:"contribSourceControlHistoryTitleMenu"},{key:"scm/historyItem/context",id:b.SCMHistoryItemContext,description:c(12751,"The Source Control history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItem/hover",id:b.SCMHistoryItemHover,description:c(12752,"The Source Control history item hover menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/historyItemRef/context",id:b.SCMHistoryItemRefContext,description:c(12753,"The Source Control history item reference context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"statusBar/remoteIndicator",id:b.StatusBarRemoteIndicatorMenu,description:c(12754,"The remote indicator menu in the status bar"),supportsSubmenus:!1},{key:"terminal/context",id:b.TerminalInstanceContext,description:c(12755,"The terminal context menu")},{key:"terminal/title/context",id:b.TerminalTabContext,description:c(12756,"The terminal tabs context menu")},{key:"view/title",id:b.ViewTitle,description:c(12757,"The contributed view title menu")},{key:"viewContainer/title",id:b.ViewContainerTitle,description:c(12758,"The contributed view container title menu"),proposed:"contribViewContainerTitle"},{key:"view/item/context",id:b.ViewItemContext,description:c(12759,"The contributed view item context menu")},{key:"comments/comment/editorActions",id:b.CommentEditorActions,description:c(12760,"The contributed comment editor actions"),proposed:"contribCommentEditorActionsMenu"},{key:"comments/commentThread/title",id:b.CommentThreadTitle,description:c(12761,"The contributed comment thread title menu")},{key:"comments/commentThread/context",id:b.CommentThreadActions,description:c(12762,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/additionalActions",id:b.CommentThreadAdditionalActions,description:c(12762,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!0,proposed:"contribCommentThreadAdditionalMenu"},{key:"comments/commentThread/title/context",id:b.CommentThreadTitleContext,description:c(12763,"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:b.CommentTitle,description:c(12764,"The contributed comment title menu")},{key:"comments/comment/context",id:b.CommentActions,description:c(12765,"The contributed comment context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/comment/context",id:b.CommentThreadCommentContext,description:c(12766,"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:b.CommentsViewThreadActions,description:c(12767,"The contributed comment thread context menu in the comments view"),proposed:"contribCommentsViewThreadMenus"},{key:"notebook/toolbar",id:b.NotebookToolbar,description:c(12768,"The contributed notebook toolbar menu")},{key:"notebook/kernelSource",id:b.NotebookKernelSource,description:c(12769,"The contributed notebook kernel sources menu"),proposed:"notebookKernelSource"},{key:"notebook/cell/title",id:b.NotebookCellTitle,description:c(12770,"The contributed notebook cell title menu")},{key:"notebook/cell/execute",id:b.NotebookCellExecute,description:c(12771,"The contributed notebook cell execution menu")},{key:"interactive/toolbar",id:b.InteractiveToolbar,description:c(12772,"The contributed interactive toolbar menu")},{key:"interactive/cell/title",id:b.InteractiveCellTitle,description:c(12773,"The contributed interactive cell title menu")},{key:"issue/reporter",id:b.IssueReporter,description:c(12774,"The contributed issue reporter menu")},{key:"testing/item/context",id:b.TestItem,description:c(12775,"The contributed test item menu")},{key:"testing/item/gutter",id:b.TestItemGutter,description:c(12776,"The menu for a gutter decoration for a test item")},{key:"testing/profiles/context",id:b.TestProfilesContext,description:c(12777,"The menu for configuring testing profiles.")},{key:"testing/item/result",id:b.TestPeekElement,description:c(12778,"The menu for an item in the Test Results view or peek.")},{key:"testing/message/context",id:b.TestMessageContext,description:c(12779,"A prominent button overlaying editor content where the message is displayed")},{key:"testing/message/content",id:b.TestMessageContent,description:c(12780,"Context menu for the message in the results tree")},{key:"extension/context",id:b.ExtensionContext,description:c(12781,"The extension context menu")},{key:"timeline/title",id:b.TimelineTitle,description:c(12782,"The Timeline view title menu")},{key:"timeline/item/context",id:b.TimelineItemContext,description:c(12783,"The Timeline view item context menu")},{key:"ports/item/context",id:b.TunnelContext,description:c(12784,"The Ports view item context menu")},{key:"ports/item/origin/inline",id:b.TunnelOriginInline,description:c(12785,"The Ports view item origin inline menu")},{key:"ports/item/port/inline",id:b.TunnelPortInline,description:c(12786,"The Ports view item port inline menu")},{key:"file/newFile",id:b.NewFile,description:c(12787,"The 'New File...' quick pick, shown on welcome page and File menu."),supportsSubmenus:!1},{key:"webview/context",id:b.WebviewContext,description:c(12788,"The webview context menu")},{key:"file/share",id:b.MenubarShare,description:c(12789,"Share submenu shown in the top level File menu."),proposed:"contribShareMenu"},{key:"editor/inlineCompletions/actions",id:b.InlineCompletionsActions,description:c(12790,"The actions shown when hovering on an inline completion"),supportsSubmenus:!1,proposed:"inlineCompletionsAdditions"},{key:"editor/content",id:b.EditorContent,description:c(12791,"The prominent button in an editor, overlays its content"),proposed:"contribEditorContentMenu"},{key:"editor/lineNumber/context",id:b.EditorLineNumberContext,description:c(12792,"The contributed editor line number context menu")},{key:"mergeEditor/result/title",id:b.MergeInputResultToolbar,description:c(12793,"The result toolbar of the merge editor"),proposed:"contribMergeEditorMenus"},{key:"multiDiffEditor/resource/title",id:b.MultiDiffEditorFileToolbar,description:c(12794,"The resource toolbar in the multi diff editor"),proposed:"contribMultiDiffEditorMenus"},{key:"diffEditor/gutter/hunk",id:b.DiffEditorHunkToolbar,description:c(12795,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"diffEditor/gutter/selection",id:b.DiffEditorSelectionToolbar,description:c(12795,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"searchPanel/aiResults/commands",id:b.SearchActionMenu,description:c(12796,"The commands that will contribute to the menu rendered as buttons next to the AI search title")},{key:"editor/context/chat",id:b.ChatTextEditorMenu,description:c(12797,"The Chat submenu in the text editor context menu."),supportsSubmenus:!1,proposed:"chatParticipantPrivate"},{key:"terminal/context/chat",id:b.ChatTerminalMenu,description:c(12798,"The Chat submenu in the terminal context menu."),supportsSubmenus:!1,proposed:"chatParticipantPrivate"},{key:"chat/chatSessions",id:b.ChatSessionsMenu,description:c(12799,"The Chat Sessions menu."),supportsSubmenus:!1,proposed:"chatSessionsProvider"}];var vo;(function(a){function e(f){return typeof f.command=="string"}a.isMenuItem=e;function t(f,w){return typeof f.command!="string"?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","command")),!1):f.alt&&typeof f.alt!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","alt")),!1):f.when&&typeof f.when!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidMenuItem=t;function i(f,w){return typeof f.submenu!="string"?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","submenu")),!1):f.when&&typeof f.when!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}a.isValidSubmenuItem=i;function s(f,w){if(!Array.isArray(f))return w.error(c(12802,"submenu items must be an array")),!1;for(const v of f)if(e(v)){if(!t(v,w))return!1}else if(!i(v,w))return!1;return!0}a.isValidItems=s;function o(f,w){return typeof f!="object"?(w.error(c(12803,"submenu items must be an object")),!1):typeof f.id!="string"?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","id")),!1):typeof f.label!="string"?(w.error(c(12800,"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(12804,"Identifier of the command to execute. The command must be declared in the 'commands'-section"),type:"string"},alt:{description:c(12805,"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"),type:"string"},when:{description:c(12806,"Condition which must be true to show this item"),type:"string"},group:{description:c(12807,"Group into which this item belongs"),type:"string"}}},r={type:"object",required:["submenu"],properties:{submenu:{description:c(12808,"Identifier of the submenu to display in this item."),type:"string"},when:{description:c(12806,"Condition which must be true to show this item"),type:"string"},group:{description:c(12807,"Group into which this item belongs"),type:"string"}}},d={type:"object",required:["id","label"],properties:{id:{description:c(12809,"Identifier of the menu to display as a submenu."),type:"string"},label:{description:c(12810,"The label of the menu item which leads to this submenu."),type:"string"},icon:{description:c(12811,"(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(12812,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12813,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.menusContribution={description:c(12814,"Contributes menu items to the editor"),type:"object",properties:Gp(i_,f=>f.key,f=>({markdownDescription:f.proposed?c(12815,'Proposed API, requires `enabledApiProposal: ["{0}"]` - {1}',f.proposed,f.description):f.description,type:"array",items:f.supportsSubmenus===!1?n:{oneOf:[n,r]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[n,r]}}},a.submenusContribution={description:c(12816,"Contributes submenu items to the editor"),type:"array",items:d};function l(f,w){return f?Tn(f.command)?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`","command")),!1):!p(f.title,w,"title")||f.shortTitle&&!p(f.shortTitle,w,"shortTitle")?!1:f.enablement&&typeof f.enablement!="string"?(w.error(c(12801,"property `{0}` can be omitted or must be of type `string`","precondition")),!1):!(f.category&&!p(f.category,w,"category")||!h(f.icon,w)):(w.error(c(12817,"expected non-empty value.")),!1)}a.isValidCommand=l;function h(f,w){return typeof f>"u"||typeof f=="string"||typeof f.dark=="string"&&typeof f.light=="string"?!0:(w.error(c(12818,"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")),!1)}function p(f,w,v){return typeof f>"u"?(w.error(c(12819,"property `{0}` is mandatory and must be of type `string` or `object`",v)),!1):typeof f=="string"&&Tn(f)?(w.error(c(12800,"property `{0}` is mandatory and must be of type `string`",v)),!1):typeof f!="string"&&(Tn(f.original)||Tn(f.value))?(w.error(c(12820,"properties `{0}` and `{1}` are mandatory and must be of type `string`",`${v}.value`,`${v}.original`)),!1):!0}const g={type:"object",required:["command","title"],properties:{command:{description:c(12821,"Identifier of the command to execute"),type:"string"},title:{description:c(12822,"Title by which the command is represented in the UI"),type:"string"},shortTitle:{markdownDescription:c(12823,"(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(12824,"(Optional) Category string by which the command is grouped in the UI"),type:"string"},enablement:{description:c(12825,"(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(12826,"(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(12827,"Icon path when a light theme is used"),type:"string"},dark:{description:c(12828,"Icon path when a dark theme is used"),type:"string"}}}]}}};a.commandsContribution={description:c(12829,"Contributes commands to the command palette."),oneOf:[g,{type:"array",items:g}]}})(vo||(vo={}));const ny=new F,s_=xr.registerExtensionPoint({extensionPoint:"commands",jsonSchema:vo.commandsContribution,activationEventsGenerator:(a,e)=>{for(const t of a)t.command&&e.push(`onCommand:${t.command}`)}});s_.setHandler(a=>{function e(t,i){if(!vo.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=De.fromString(s)??{dark:io(i.description.extensionLocation,s),light:io(i.description.extensionLocation,s)}:h={dark:io(i.description.extensionLocation,s.dark),light:io(i.description.extensionLocation,s.light)});const p=I.getCommand(l);p&&(p.source?i.collector.info(c(12830,"Command `{0}` already registered by {1} ({2})",t.command,p.source.title,p.source.id)):i.collector.info(c(12831,"Command `{0}` already registered",t.command))),ny.add(I.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:D.deserialize(o),icon:h}))}ny.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 Vd=new Map,o_=xr.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:vo.submenusContribution});o_.setHandler(a=>{Vd.clear();for(const e of a){const{value:t,collector:i}=e;for(const[,s]of Object.entries(t)){if(!vo.isValidSubmenu(s,i))continue;if(!s.id){i.warn(c(12832,"`{0}` is not a valid submenu identifier",s.id));continue}if(Vd.has(s.id)){i.info(c(12833,"The `{0}` submenu was already previously registered.",s.id));continue}if(!s.label){i.warn(c(12834,"`{0}` is not a valid submenu label",s.label));continue}let o;s.icon&&(typeof s.icon=="string"?o=De.fromString(s.icon)||{dark:io(e.description.extensionLocation,s.icon)}:o={dark:io(e.description.extensionLocation,s.icon.dark),light:io(e.description.extensionLocation,s.icon.light)});const n={id:b.for(`api:${s.id}`),label:s.label,icon:o};Vd.set(s.id,n)}}});const LP=new Map(i_.map(a=>[a.key,a])),ry=new F,bp=new Map,VP=xr.registerExtensionPoint({extensionPoint:"menus",jsonSchema:vo.menusContribution,deps:[o_]});VP.setHandler(a=>{ry.clear(),bp.clear();for(const e of a){const{value:t,collector:i}=e;for(const s of Object.entries(t)){if(!vo.isValidItems(s[1],i))continue;let o=LP.get(s[0]);if(!o){const n=Vd.get(s[0]);n&&(o={key:s[0],id:n.id,description:""})}if(o){if(o.proposed&&!Wp(e.description,o.proposed)){i.error(c(12835,`{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(vo.isMenuItem(n)){const d=I.getCommand(n.command),l=n.alt&&I.getCommand(n.alt)||void 0;if(!d){i.error(c(12836,"Menu item references a command `{0}` which is not defined in the 'commands' section.",n.command));continue}n.alt&&!l&&i.warn(c(12837,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",n.alt)),n.command===n.alt&&i.info(c(12838,"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(12839,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const d=Vd.get(n.submenu);if(!d){i.error(c(12840,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",n.submenu));continue}let l=bp.get(o.id.id);if(l||(l=new Set,bp.set(o.id.id,l)),l.has(d.id.id)){i.warn(c(12841,"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===b.ViewContainerTitle&&!n.when?.includes("viewContainer == workbench.view.debug")){i.error(c(12842,"The {0} menu contribution must check {1} in its {2} clause.","`viewContainer/title`","`viewContainer == workbench.view.debug`",'"when"'));continue}r.when=D.deserialize(n.when),ry.add(I.appendMenuItem(o.id,r))}}}}});let Qg=class extends N{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=Gp(i,h=>h.id),o=e.contributes?.menus||{},n=Gp(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 g=s[p.command];g?g.menus.includes(h)||g.menus.push(h):(g={id:p.command,title:"",keybindings:[],menus:[h]},s[g.id]=g,i.push(g))}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 g=s[h.command];g?g.keybindings.push(p):(g={id:h.command,title:"",keybindings:[p],menus:[]},s[g.id]=g,i.push(g))}),!i.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const d=[c(12843,"ID"),c(12844,"Title"),c(12845,"Keyboard Shortcuts"),c(12846,"Menu Contexts")],l=i.sort((h,p)=>h.id.localeCompare(p.id)).map(h=>[new Ki().appendMarkdown(`\`${h.id}\``),typeof h.title=="string"?h.title:h.title.value,h.keybindings,new Ki().appendMarkdown(`${h.menus.sort((p,g)=>p.localeCompare(g)).map(p=>`\`${p}\``).join(" ")}`)]);return{data:{headers:d,rows:l},dispose:()=>{}}}resolveKeybinding(e){let t;switch(iA){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]}};Qg=_([u(0,ot)],Qg);ie.as(vu.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:c(12847,"Commands"),access:{canToggle:!1},renderer:new le(Qg)});class n_{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${PP(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"?rc.parseKeybinding(e.key):null,i="when"in e&&typeof e.when=="string"?D.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 PP(a,e){return a.length<e?a+new Array(e-a.length).join(" "):a}class OP{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(`
|
|
126
126
|
`)}}var md;function MP(a,e){return a?typeof a.command!="string"?(e.push(c(13239,"property `{0}` is mandatory and must be of type `string`","command")),!1):a.key&&typeof a.key!="string"?(e.push(c(13240,"property `{0}` can be omitted or must be of type `string`","key")),!1):a.when&&typeof a.when!="string"?(e.push(c(13240,"property `{0}` can be omitted or must be of type `string`","when")),!1):a.mac&&typeof a.mac!="string"?(e.push(c(13240,"property `{0}` can be omitted or must be of type `string`","mac")),!1):a.linux&&typeof a.linux!="string"?(e.push(c(13240,"property `{0}` can be omitted or must be of type `string`","linux")),!1):a.win&&typeof a.win!="string"?(e.push(c(13240,"property `{0}` can be omitted or must be of type `string`","win")),!1):!0:(e.push(c(13238,"expected non-empty value.")),!1)}const ay={type:"object",default:{command:"",key:""},properties:{command:{description:c(13241,"Identifier of the command to run when keybinding is triggered."),type:"string"},args:{description:c(13242,"Arguments to pass to the command to execute.")},key:{description:c(13243,"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(13244,"Mac specific key or key sequence."),type:"string"},linux:{description:c(13245,"Linux specific key or key sequence."),type:"string"},win:{description:c(13246,"Windows specific key or key sequence."),type:"string"},when:{description:c(13247,"Condition when the key is active."),type:"string"}}},dy=xr.registerExtensionPoint({extensionPoint:"keybindings",deps:[s_],jsonSchema:{description:c(13248,"Contributes keybindings."),oneOf:[ay,{type:"array",items:ay}]}}),NP=[L.NumpadDivide,L.NumpadMultiply,L.NumpadSubtract,L.NumpadAdd,L.Numpad1,L.Numpad2,L.Numpad3,L.Numpad4,L.Numpad5,L.Numpad6,L.Numpad7,L.Numpad8,L.Numpad9,L.Numpad0,L.NumpadDecimal],vs=new Map;vs.set(L.Numpad1,m.Digit1);vs.set(L.Numpad2,m.Digit2);vs.set(L.Numpad3,m.Digit3);vs.set(L.Numpad4,m.Digit4);vs.set(L.Numpad5,m.Digit5);vs.set(L.Numpad6,m.Digit6);vs.set(L.Numpad7,m.Digit7);vs.set(L.Numpad8,m.Digit8);vs.set(L.Numpad9,m.Digit9);vs.set(L.Numpad0,m.Digit0);let ef=md=class extends sA{constructor(e,t,i,s,o,n,r,d,l,h,p){super(e,t,i,s,h),this.hostService=n,this.keyboardLayoutService=p,this._contributions=[],this.isComposingGlobalContextKey=e.createKey("isComposing",!1),this.kbsJsonSchema=new tf,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 FP(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()})),dy.setHandler(g=>{const f=[];for(const w of g)this._handleKeybindingsExtensionPointUser(w.description.identifier,w.description.isBuiltin,w.value,w.collector,f);J.setExtensionKeybindings(f),this.updateResolver()}),this.updateKeybindingsJsonSchema(),this._register(r.onDidRegisterExtensions(()=>this.updateKeybindingsJsonSchema())),this._register(W.runAndSubscribe(HC,({window:g,disposables:f})=>f.add(this._registerKeyListeners(g)),{window:ve,disposables:this._store})),this._register(KC(g=>{if(g!==ve.vscodeWindowId)return;const f=navigator.keyboard;tp.keyboard!==ip.None&&(zb(ve)?f?.lock(["Escape"]):f?.unlock(),this._cachedResolver=null,this._onDidUpdateKeybindings.fire())}))}dispose(){this._contributions.forEach(e=>e.listener?.dispose()),this._contributions.length=0,super.dispose()}_registerKeyListeners(e){const t=new F;return t.add(z(e,ee.KEY_DOWN,i=>{if(this._keybindingHoldMode)return;this.isComposingGlobalContextKey.set(i.isComposing);const s=new dn(i);this._log(`/ Received keydown event - ${oA(i)}`),this._log(`| Converted keydown event - ${nA(s)}`),this._dispatch(s,s.target)&&s.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t.add(z(e,ee.KEY_UP,i=>{this._resetKeybindingHoldMode(),this.isComposingGlobalContextKey.set(i.isComposing);const s=new dn(i);this._singleModifierDispatch(s,s.target)&&s.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t}registerSchemaContribution(e){const t=e.onDidChange?.(()=>this.updateKeybindingsJsonSchema()),i={listener:t,contribution:e};return this._contributions.push(i),this.updateKeybindingsJsonSchema(),he(()=>{t?.dispose(),$C(this._contributions,i),this.updateKeybindingsJsonSchema()})}updateKeybindingsJsonSchema(){this.kbsJsonSchema.updateSchema(this._contributions.flatMap(e=>e.contribution.getSchemaAdditions()))}_printKeybinding(e){return rA.toLabel(li,e.chords,t=>t instanceof Wo?Pt.toString(t.keyCode):Si.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 J.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(`
|
|
127
127
|
`)}_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:
|
|
128
128
|
${e}
|