@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,4 +1,4 @@
|
|
|
1
|
-
import{D as te,c0 as Cn,bY as q,cI as Zn,cJ as we,cK as w,cL as bn,cM as qt,cN as $n,E,A as En,cO as ie,cP as qn,cQ as jn,cR as me,cS as V,bN as Jn,bO as B,bQ as mt,$ as b,cT as Wi,bV as We,cU as ge,cV as yi,cW as pt,cX as vi,cY as P,W as O,cZ as _e,j as Pe,bI as Tn,d as L,q as g,ak as re,b_ as Be,bZ as R,c_ as Ms,c$ as Os,f as y,g as u,m as _i,bi as W,bE as dt,bF as J,Z as ke,d0 as Te,d1 as Qn,a8 as I,d2 as xs,d3 as yn,d4 as ci,d5 as Ft,d6 as er,d7 as tr,d8 as Wt,d9 as hi,a5 as ct,da as F,db as De,dc as Q,dd as Gi,U as wi,de as ir,df as sr,dg as Bi,dh as vn,di as ks,dj as Hs,dk as nr,dl as ye,dm as rr,dn as ut,dp as Fs,dq as _n,dr as or,ds as K,dt as Nt,du as ht,dv as Gt,h as ee,dw as wn,dx as lt,dy as de,dz as Rn,dA as ar,dB as cr,dC as hr,ck as h,bv as C,c1 as ue,bB as ce,dD as Ie,cd as ft,dE as lr,dF as $,dG as Ve,dH as dr,ap as Vt,dI as zi,aa as Ri,dJ as ur,dK as fr,dL as gr,dM as mr,t as Ne,dN as pr,ao as li,dO as _t,dP as Ar,by as he,dQ as Sr,V as Ir,dR as Cr,aK as p,aL as D,dS as Dn,dT as br,dU as Li,dV as _,a3 as zt,dW as Zs,dX as Er,bz as jt,ci as Di,bx as Tr,O as Pn,dY as yr,bX as wt,cf as vr,cg as _r,dZ as Ws,d_ as gt,bA as wr,d$ as Rr,e0 as Gs,e1 as X,e2 as Ui,e3 as Me,e4 as oe,e5 as Dr,e6 as Et,e7 as Ut,G as le,e8 as Bt,e9 as Yi,ea as Fe,eb as Nn,ec as $s,cl as v,ed as Pr,ee as Nr,ef as Vr,eg as Br,cw as Lr,cp as T,cv as Mr,cr as Pt,cs as Mi,ct as Qt,cu as Oe,cn as k,co as Or,cq as qs,eh as ei,ei as xr,ej as Pi,ek as Ki,el as H,em as js,en as z,eo as kr,ep as Hr,eq as Fr,er as Wr,cy as Gr,cz as zr,es as Js,et as Ur,eu as Qs,ev as pe,ew as Xi,cm as St,ex as ti,ey as Zi,ez as Yr,eA as Kr,eB as Xr,eC as Zr,eD as en,bp as Vn,eE as tn,eF as $r,eG as qr,eH as jr,z as ii,eI as Bn,eJ as Jr,bK as Qr,eK as eo,eL as to,eM as si,eN as io,eO as Oi,eP as so,eQ as no,eR as ro,eS as oo,eT as ao,eU as co,eV as ho,eW as lo,eX as uo,eY as fo,eZ as go,e_ as Ln,e$ as mo,f0 as zs,f1 as sn,f2 as po,f3 as Mn,a7 as $i,f4 as qi,f5 as ji,f6 as Ji,bL as fe,f7 as Us,bM as Ce,f8 as Qi,f9 as es,fa as Yt,fb as Jt,fc as On,bP as Ys,fd as ni,fe as Ao,ff as So,fg as ze,fh as Io,fi as Co,fj as bo,fk as Eo,a9 as ne,fl as nn,fm as To,fn as yo,fo as vo,fp as _o,fq as wo,fr as Ro,fs as rn,ft as Do,fu as Po,fv as No,fw as Vo,fx as Bo,fy as Lo,fz as Mo,fA as Oo,N as xo,fB as ko,fC as Ho,fD as Fo,fE as xn,fF as Wo,fG as on,fH as Go,fI as an,fJ as Ks,al as Ke,fK as kn,fL as Rt,fM as ri,fN as Hn,fO as Fn,fP as zo,fQ as xi,fR as cn,fS as Uo,fT as Yo,fU as Ko,fV as hn,fW as Xo,fX as Zo,fY as $o,fZ as qo,f_ as jo,f$ as Jo,g0 as Qo,g1 as ea,g2 as ta,bU as ia,g3 as ln,g4 as sa,g5 as na,g6 as ra,g7 as oa,g8 as aa,g9 as ca,ga as ha,gb as la,gc as da,u as ua,gd as fa,ge as ga,p as ma,gf as Wn,X as pa,Y as Aa,gg as Sa,gh as Ia,gi as Ca,gj as ba,gk as Ea,gl as Ta,gm as ya,gn as va,go as Ni,b3 as _a,gp as wa,gq as Ra,aI as Da,gr as Pa,cc as Na,gs as Gn,gt as Va,gu as Ba,gv as La,gw as Ma,ce as Oa}from"./index-D9lSNsHR.js";import{cD as Ih,cE as Ch,cB as bh,cH as Eh,cF as Th,cC as yh,cG as vh,cA as _h}from"./index-D9lSNsHR.js";import{S as xa,P as ka,A as Ha,c as Fa,d as Dt,D as Z,e as Wa,f as Ga,h as za,g as Ua,a as Ya,E as Ka,B as Xa}from"./views-Hn-QKMUh.js";import{E as Za}from"./fileCommands._save-_f7KuzoK.js";import"./workbenchThemeService.service-CDwCNsAv.js";const $a=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var j;(function(l){l[l.ADD=0]="ADD",l[l.CHANGE=1]="CHANGE",l[l.EXPAND_COLLAPSE=2]="EXPAND_COLLAPSE",l[l.REMOVE=3]="REMOVE"})(j||(j={}));var vt;(function(l){l[l.ADD=0]="ADD",l[l.REMOVE=1]="REMOVE"})(vt||(vt={}));class qa extends te{constructor(e,t){super(),this.item=e,this.onClose=t,this._onDidClose=this._register(new E),this.onDidClose=this._onDidClose.event,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.registerListeners()}registerListeners(){this._register(this.item.onDidChangeVisibility(e=>this._onDidChangeVisibility.fire(e))),me.once(this.item.onDidClose)(()=>{this._onDidClose.fire(),this.dispose()})}get progress(){return this.item.progress}updateSeverity(e){this.item.updateSeverity(e)}updateMessage(e){this.item.updateMessage(e)}updateActions(e){this.item.updateActions(e)}close(){this.onClose(this.item),this.dispose()}}const bi=class bi extends te{constructor(){super(...arguments),this._onDidChangeNotification=this._register(new E),this.onDidChangeNotification=this._onDidChangeNotification.event,this._onDidChangeStatusMessage=this._register(new E),this.onDidChangeStatusMessage=this._onDidChangeStatusMessage.event,this._onDidChangeFilter=this._register(new E),this.onDidChangeFilter=this._onDidChangeFilter.event,this._notifications=[],this.filter={global:w.OFF,sources:new Map}}get notifications(){return this._notifications}get statusMessage(){return this._statusMessage}setFilter(e){let t=!1;typeof e.global=="number"&&(t=this.filter.global!==e.global,this.filter.global=e.global);let i=!1;e.sources&&(i=!jn(this.filter.sources,e.sources),this.filter.sources=e.sources),(t||i)&&this._onDidChangeFilter.fire({global:t?e.global:void 0,sources:i?e.sources:void 0})}addNotification(e){const t=this.createViewItem(e);return t?(this.findNotification(t)?.close(),this._notifications.splice(0,0,t),this._onDidChangeNotification.fire({item:t,index:0,kind:j.ADD}),new qa(t,s=>this.onClose(s))):bi.NO_OP_NOTIFICATION}onClose(e){const t=this.findNotification(e);t&&t!==e?t.close():e.close()}findNotification(e){return this._notifications.find(t=>t.equals(e))}createViewItem(e){const t=Kt.create(e,this.filter);if(!t)return;const i=(r,o)=>{const a=this._notifications.indexOf(t);a>=0&&this._onDidChangeNotification.fire({item:t,index:a,kind:r,detail:o})},s=t.onDidChangeExpansion(()=>i(j.EXPAND_COLLAPSE)),n=t.onDidChangeContent(r=>i(j.CHANGE,r.kind));return me.once(t.onDidClose)(()=>{s.dispose(),n.dispose();const r=this._notifications.indexOf(t);r>=0&&(this._notifications.splice(r,1),this._onDidChangeNotification.fire({item:t,index:r,kind:j.REMOVE}))}),t}showStatusMessage(e,t){const i=Ja.create(e,t);return i?(this._statusMessage=i,this._onDidChangeStatusMessage.fire({kind:vt.ADD,item:i}),{close:()=>{this._statusMessage===i&&(this._statusMessage=void 0,this._onDidChangeStatusMessage.fire({kind:vt.REMOVE,item:i}))}}):{close:()=>{}}}};bi.NO_OP_NOTIFICATION=new qn;let dn=bi;function ki(l){return l instanceof Kt}var ae;(function(l){l[l.SEVERITY=0]="SEVERITY",l[l.MESSAGE=1]="MESSAGE",l[l.ACTIONS=2]="ACTIONS",l[l.PROGRESS=3]="PROGRESS"})(ae||(ae={}));class ja extends te{constructor(){super(),this._onDidChange=this._register(new E),this.onDidChange=this._onDidChange.event,this._state=Object.create(null)}get state(){return this._state}infinite(){this._state.infinite||(this._state.infinite=!0,this._state.total=void 0,this._state.worked=void 0,this._state.done=void 0,this._onDidChange.fire())}done(){this._state.done||(this._state.done=!0,this._state.infinite=void 0,this._state.total=void 0,this._state.worked=void 0,this._onDidChange.fire())}total(e){this._state.total!==e&&(this._state.total=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire())}worked(e){typeof this._state.worked=="number"?this._state.worked+=e:this._state.worked=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire()}}const Le=class Le extends te{static create(e,t){if(!e||!e.message||Cn(e.message))return;let i;typeof e.severity=="number"?i=e.severity:i=q.Info;const s=Le.parseNotificationMessage(e.message);if(!s)return;let n;e.actions?n=e.actions:Zn(e.message)&&(n={primary:e.message.actions});let r=e.priority??we.DEFAULT;return(r===we.DEFAULT||r===we.OPTIONAL)&&i!==q.Error&&(t.global===w.ERROR?r=we.SILENT:bn(e.source)&&t.sources.get(e.source.id)===w.ERROR&&(r=we.SILENT)),new Le(e.id,i,e.sticky,r,s,e.source,e.progress,n)}static parseNotificationMessage(e){let t;if(e instanceof Error?t=qt(e,!1):typeof e=="string"&&(t=e),!t)return;const i=t;t.length>Le.MAX_MESSAGE_LENGTH&&(t=`${t.substr(0,Le.MAX_MESSAGE_LENGTH)}...`),t=t.replace(/(\r\n|\n|\r)/gm," ").trim();const s=$n(t);return{raw:i,linkedText:s,original:e}}constructor(e,t,i,s,n,r,o,a){super(),this.id=e,this._severity=t,this._sticky=i,this._priority=s,this._message=n,this._source=r,this._visible=!1,this._onDidChangeExpansion=this._register(new E),this.onDidChangeExpansion=this._onDidChangeExpansion.event,this._onDidClose=this._register(new E),this.onDidClose=this._onDidClose.event,this._onDidChangeContent=this._register(new E),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,o&&this.setProgress(o),this.setActions(a)}setProgress(e){e.infinite?this.progress.infinite():e.total&&(this.progress.total(e.total),e.worked&&this.progress.worked(e.worked))}setActions(e={primary:[],secondary:[]}){this._actions={primary:Array.isArray(e.primary)?e.primary:[],secondary:Array.isArray(e.secondary)?e.secondary:[]},this._expanded=e.primary&&e.primary.length>0}get canCollapse(){return!this.hasActions}get expanded(){return!!this._expanded}get severity(){return this._severity}get sticky(){if(this._sticky)return!0;const e=this.hasActions;return!!(e&&this._severity===q.Error||!e&&this._expanded||this._progress&&!this._progress.state.done)}get priority(){return this._priority}get hasActions(){return!this._actions||!this._actions.primary?!1:this._actions.primary.length>0}get hasProgress(){return!!this._progress}get progress(){return this._progress||(this._progress=this._register(new ja),this._register(this._progress.onDidChange(()=>this._onDidChangeContent.fire({kind:ae.PROGRESS})))),this._progress}get message(){return this._message}get source(){return typeof this._source=="string"?this._source:this._source?this._source.label:void 0}get sourceId(){return this._source&&typeof this._source!="string"&&"id"in this._source?this._source.id:void 0}get actions(){return this._actions}get visible(){return this._visible}updateSeverity(e){e!==this._severity&&(this._severity=e,this._onDidChangeContent.fire({kind:ae.SEVERITY}))}updateMessage(e){const t=Le.parseNotificationMessage(e);!t||t.raw===this._message.raw||(this._message=t,this._onDidChangeContent.fire({kind:ae.MESSAGE}))}updateActions(e){this.setActions(e),this._onDidChangeContent.fire({kind:ae.ACTIONS})}updateVisibility(e){this._visible!==e&&(this._visible=e,this._onDidChangeVisibility.fire(e))}expand(){this._expanded||!this.canCollapse||(this._expanded=!0,this._onDidChangeExpansion.fire())}collapse(e){!this._expanded||!this.canCollapse||(this._expanded=!1,e||this._onDidChangeExpansion.fire())}toggle(){this._expanded?this.collapse():this.expand()}close(){this._onDidClose.fire(),this.dispose()}equals(e){if(this.hasProgress||e.hasProgress)return!1;if(typeof this.id=="string"||typeof e.id=="string")return this.id===e.id;if(typeof this._source=="object"){if(this._source.label!==e.source||this._source.id!==e.sourceId)return!1}else if(this._source!==e.source)return!1;if(this._message.raw!==e.message.raw)return!1;const t=this._actions&&this._actions.primary||[],i=e.actions&&e.actions.primary||[];return En(t,i,(s,n)=>s.id+s.label===n.id+n.label)}};Le.MAX_MESSAGE_LENGTH=1e3;let Kt=Le;class di extends ie{constructor(e,t){super(e,t.label,void 0,!0,async()=>{t.run(),this._onDidRun.fire()}),this._onDidRun=this._register(new E),this.onDidRun=this._onDidRun.event,this._keepOpen=!!t.keepOpen,this._menu=!t.isSecondary&&t.menu?t.menu.map((i,s)=>new di(`${e}.${s}`,i)):void 0}get menu(){return this._menu}get keepOpen(){return this._keepOpen}}class Ja{static create(e,t){if(!e||Cn(e))return;let i;if(e instanceof Error?i=qt(e,!1):typeof e=="string"&&(i=e),!!i)return{message:i,options:t}}}const ts="notifications.showList",Xt="notifications.hideList",Qa="notifications.toggleList",Hi="notifications.hideToasts",un="notifications.focusToasts",ec="notifications.focusNextToast",tc="notifications.focusPreviousToast",ic="notifications.focusFirstToast",sc="notifications.focusLastToast",is="notification.collapse",ss="notification.expand",fn="notification.acceptPrimaryAction",nc="notification.toggle",ns="notification.clear",ui="notifications.clearAll",fi="notifications.toggleDoNotDisturbMode",gi="notifications.toggleDoNotDisturbModeBySource";function Ue(l,e){if(ki(e))return e;const t=l.lastFocusedList;if(t instanceof Os){let i=t.getFocusedElements()[0];if(ki(i)||t.isDOMFocused()&&(i=t.element(0)),ki(i))return i}}function rc(l,e,t){V.registerCommandAndKeybindingRule({id:ts,weight:B.WorkbenchContrib,primary:Jn(mt.CtrlCmd|b.KeyK,mt.CtrlCmd|mt.Shift|b.KeyN),handler:()=>{e.hide(),l.show()}}),V.registerCommandAndKeybindingRule({id:Xt,weight:B.WorkbenchContrib+50,when:Wi,primary:b.Escape,handler:()=>l.hide()}),We.registerCommand(Qa,()=>{l.isVisible?l.hide():(e.hide(),l.show())}),V.registerCommandAndKeybindingRule({id:ns,weight:B.WorkbenchContrib,when:ge,primary:b.Delete,mac:{primary:mt.CtrlCmd|b.Backspace},handler:(s,n)=>{const r=s.get(yi),o=Ue(s.get(pt),n);o&&!o.hasProgress&&(o.close(),r.playSignal(vi.clear))}}),V.registerCommandAndKeybindingRule({id:ss,weight:B.WorkbenchContrib,when:ge,primary:b.RightArrow,handler:(s,n)=>{Ue(s.get(pt),n)?.expand()}}),V.registerCommandAndKeybindingRule({id:fn,weight:B.WorkbenchContrib,when:P.or(ge,_e),primary:mt.CtrlCmd|mt.Shift|b.KeyA,handler:s=>{const n=s.get(O).createInstance(Zt),r=Ue(s.get(pt))||t.notifications.at(0);if(!r)return;const o=r.actions?.primary?r.actions.primary.at(0):void 0;o&&(n.run(o,r),r.close(),n.dispose())}}),V.registerCommandAndKeybindingRule({id:is,weight:B.WorkbenchContrib,when:ge,primary:b.LeftArrow,handler:(s,n)=>{Ue(s.get(pt),n)?.collapse()}}),V.registerCommandAndKeybindingRule({id:nc,weight:B.WorkbenchContrib,when:ge,primary:b.Space,secondary:[b.Enter],handler:s=>{Ue(s.get(pt))?.toggle()}}),We.registerCommand(Hi,s=>{e.hide()}),V.registerKeybindingRule({id:Hi,weight:B.WorkbenchContrib-50,when:_e,primary:b.Escape}),V.registerKeybindingRule({id:Hi,weight:B.WorkbenchContrib+100,when:P.and(_e,ge),primary:b.Escape}),We.registerCommand(un,()=>e.focus()),V.registerCommandAndKeybindingRule({id:ec,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.DownArrow,handler:()=>{e.focusNext()}}),V.registerCommandAndKeybindingRule({id:tc,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.UpArrow,handler:()=>{e.focusPrevious()}}),V.registerCommandAndKeybindingRule({id:ic,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.PageUp,secondary:[b.Home],handler:()=>{e.focusFirst()}}),V.registerCommandAndKeybindingRule({id:sc,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.PageDown,secondary:[b.End],handler:()=>{e.focusLast()}}),We.registerCommand(ui,()=>l.clearAll()),We.registerCommand(fi,s=>{const n=s.get(Pe);n.setFilter(n.getFilter()===w.ERROR?w.OFF:w.ERROR)}),We.registerCommand(gi,s=>{const n=s.get(Pe),r=s.get(Tn),o=n.getFilters().sort((f,m)=>f.label.localeCompare(m.label)),a=new L,c=a.add(r.createQuickPick());c.items=o.map(f=>({id:f.id,label:f.label,tooltip:`${f.label} (${f.id})`,filter:f.filter})),c.canSelectMany=!0,c.placeholder=g(3453,"Select sources to enable all notifications from"),c.selectedItems=c.items.filter(f=>f.filter===w.OFF),c.show(),a.add(c.onDidAccept(async()=>{for(const f of c.items)n.setFilter({id:f.id,label:f.label,filter:c.selectedItems.includes(f)?w.OFF:w.ERROR});c.hide()})),a.add(c.onDidHide(()=>a.dispose()))});const i=re(3454,"Notifications");Be.appendMenuItem(R.CommandPalette,{command:{id:ts,title:re(3455,"Show Notifications"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:Xt,title:re(3456,"Hide Notifications"),category:i},when:Wi}),Be.appendMenuItem(R.CommandPalette,{command:{id:ui,title:re(3457,"Clear All Notifications"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:fn,title:re(3458,"Accept Notification Primary Action"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:fi,title:re(3459,"Toggle Do Not Disturb Mode"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:gi,title:re(3460,"Toggle Do Not Disturb Mode By Source..."),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:un,title:re(3461,"Focus Notification Toast"),category:i},when:_e})}let Zt=class extends Ms{constructor(e,t){super(),this.telemetryService=e,this.notificationService=t}async runAction(e,t){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.id,from:"message"});try{await super.runAction(e,t)}catch(i){this.notificationService.error(i)}}};Zt=y([u(0,_i),u(1,Pe)],Zt);const oc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));ke(zn);const ac=dt("notifications-clear",J.close,g(3426,"Icon for the clear action in notifications.")),cc=dt("notifications-clear-all",J.clearAll,g(3427,"Icon for the clear all action in notifications.")),hc=dt("notifications-hide",J.chevronDown,g(3428,"Icon for the hide action in notifications.")),lc=dt("notifications-expand",J.chevronUp,g(3429,"Icon for the expand action in notifications.")),dc=dt("notifications-collapse",J.chevronDown,g(3430,"Icon for the collapse action in notifications.")),uc=dt("notifications-configure",J.gear,g(3431,"Icon for the configure action in notifications.")),Un=dt("notifications-do-not-disturb",J.bellSlash,g(3432,"Icon for the mute all action in notifications."));var Xe;let Lt=(Xe=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(ac)),this.commandService=i}async run(e){this.commandService.executeCommand(ns,e)}},Xe.ID=ns,Xe.LABEL=g(3433,"Clear Notification"),Xe);Lt=y([u(2,Te)],Lt);var Ze;let Mt=(Ze=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(cc)),this.commandService=i}async run(){this.commandService.executeCommand(ui)}},Ze.ID=ui,Ze.LABEL=g(3434,"Clear All Notifications"),Ze);Mt=y([u(2,Te)],Mt);var $e;let mi=($e=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(Un)),this.commandService=i}async run(){this.commandService.executeCommand(fi)}},$e.ID=fi,$e.LABEL=g(3435,"Toggle Do Not Disturb Mode"),$e);mi=y([u(2,Te)],mi);var qe;let pi=(qe=class extends ie{constructor(e,t,i){super(e,t),this.commandService=i}async run(){this.commandService.executeCommand(gi)}},qe.ID=gi,qe.LABEL=g(3436,"Toggle Do Not Disturb Mode By Source..."),qe);pi=y([u(2,Te)],pi);const Ei=class Ei extends ie{constructor(e,t){super(e,t,W.asClassName(Un))}};Ei.ID="workbench.action.configureDoNotDisturbMode",Ei.LABEL=g(3437,"Configure Do Not Disturb...");let It=Ei;var je;let Ot=(je=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(hc)),this.commandService=i}async run(){this.commandService.executeCommand(Xt)}},je.ID=Xt,je.LABEL=g(3438,"Hide Notifications"),je);Ot=y([u(2,Te)],Ot);var Je;let xt=(Je=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(lc)),this.commandService=i}async run(e){this.commandService.executeCommand(ss,e)}},Je.ID=ss,Je.LABEL=g(3439,"Expand Notification"),Je);xt=y([u(2,Te)],xt);var Qe;let kt=(Qe=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(dc)),this.commandService=i}async run(e){this.commandService.executeCommand(is,e)}},Qe.ID=is,Qe.LABEL=g(3440,"Collapse Notification"),Qe);kt=y([u(2,Te)],kt);const Ti=class Ti extends ie{constructor(e,t,i){super(e,t,W.asClassName(uc)),this.notification=i}};Ti.ID="workbench.action.configureNotification",Ti.LABEL=g(3441,"More Actions...");let Tt=Ti;var et;let Ht=(et=class extends ie{constructor(e,t,i){super(e,t),this.clipboardService=i}run(e){return this.clipboardService.writeText(e.message.raw)}},et.ID="workbench.action.copyNotificationMessage",et.LABEL=g(3442,"Copy Text"),et);Ht=y([u(2,Qn)],Ht);var rs,be;const Ee=class Ee{constructor(e){this.offsetHelper=this.createOffsetHelper(e)}createOffsetHelper(e){return e.appendChild(I(".notification-offset-helper"))}getHeight(e){if(!e.expanded)return Ee.ROW_HEIGHT;let t=Ee.ROW_HEIGHT;const i=this.computePreferredHeight(e);if(Ee.LINE_HEIGHT<i){const n=i-Ee.LINE_HEIGHT;t+=n}return(e.source||hi(e.actions&&e.actions.primary))&&(t+=Ee.ROW_HEIGHT),t===Ee.ROW_HEIGHT&&e.collapse(!0),t}computePreferredHeight(e){let t=0;e.hasProgress||t++,e.canCollapse&&t++,hi(e.actions&&e.actions.secondary)&&t++,this.offsetHelper.style.width=`${450-(40+t*30-Math.max(t-1,0)*4)}px`;const i=Yn.render(e.message);this.offsetHelper.appendChild(i);const s=Math.max(this.offsetHelper.offsetHeight,this.offsetHelper.scrollHeight);return ct(this.offsetHelper),s}getTemplateId(e){if(e instanceof Kt)return Ai.TEMPLATE_ID;throw new Error("unknown element type: "+e)}};Ee.ROW_HEIGHT=42,Ee.LINE_HEIGHT=22;let os=Ee;class Yn{static render(e,t){const i=I("span");for(const s of e.linkedText.nodes)if(typeof s=="string")i.appendChild(document.createTextNode(s));else{let n=s.title;!n&&s.href.startsWith("command:")?n=g(3483,"Click to execute command '{0}'",s.href.substr(8)):n||(n=s.href);const r=I("a",{href:s.href,title:n,tabIndex:0},s.label);if(t){const o=A=>{nr(A)&&De.stop(A,!0),t.callback(s.href)},a=t.toDispose.add(new Bi(r,Q.CLICK)).event,c=t.toDispose.add(new Bi(r,Q.KEY_DOWN)).event,f=me.chain(c,A=>A.filter(S=>{const x=new vn(S);return x.equals(b.Space)||x.equals(b.Enter)}));t.toDispose.add(ks.addTarget(r));const m=t.toDispose.add(new Bi(r,Hs.Tap)).event;me.any(a,m,f)(o,null,t.toDispose)}i.appendChild(r)}return i}}var tt;let Ai=(tt=class{constructor(e,t,i,s){this.actionRunner=e,this.contextMenuService=t,this.instantiationService=i,this.notificationService=s}get templateId(){return rs.TEMPLATE_ID}renderTemplate(e){const t=Object.create(null);t.toDispose=new L,t.container=I(".notification-list-item"),t.mainRow=I(".notification-list-item-main-row"),t.icon=I(".notification-list-item-icon.codicon"),t.message=I(".notification-list-item-message");const i=this,s=I(".notification-list-item-toolbar-container");return t.toolbar=new xs(s,{ariaLabel:g(3484,"Notification Actions"),actionViewItemProvider:(n,r)=>{if(n instanceof Tt)return t.toDispose.add(new yn(n,{getActions(){const o=[],a={id:n.notification.sourceId,label:n.notification.source};if(bn(a)){const c=i.notificationService.getFilter(a)===w.ERROR;o.push(ci({id:a.id,label:c?g(3485,"Turn On All Notifications from '{0}'",a.label):g(3486,"Turn Off Info and Warning Notifications from '{0}'",a.label),run:()=>i.notificationService.setFilter({...a,filter:c?w.OFF:w.ERROR})})),n.notification.actions?.secondary?.length&&o.push(new Ft)}return Array.isArray(n.notification.actions?.secondary)&&o.push(...n.notification.actions.secondary),o}},this.contextMenuService,{...r,actionRunner:this.actionRunner,classNames:n.class}))},actionRunner:this.actionRunner}),t.toDispose.add(t.toolbar),t.detailsRow=I(".notification-list-item-details-row"),t.source=I(".notification-list-item-source"),t.buttonsContainer=I(".notification-list-item-buttons-container"),e.appendChild(t.container),t.container.appendChild(t.detailsRow),t.detailsRow.appendChild(t.source),t.detailsRow.appendChild(t.buttonsContainer),t.container.appendChild(t.mainRow),t.mainRow.appendChild(t.icon),t.mainRow.appendChild(t.message),t.mainRow.appendChild(s),t.progress=new er(e,tr),t.toDispose.add(t.progress),t.renderer=this.instantiationService.createInstance(as,t,this.actionRunner),t.toDispose.add(t.renderer),t}renderElement(e,t,i){i.renderer.setInput(e)}disposeTemplate(e){Wt(e.toDispose)}},rs=tt,tt.TEMPLATE_ID="notification",tt);Ai=rs=y([u(1,ye),u(2,O),u(3,Pe)],Ai);var it;let as=(it=class extends te{constructor(e,t,i,s,n,r,o){super(),this.template=e,this.actionRunner=t,this.openerService=i,this.instantiationService=s,this.keybindingService=n,this.contextMenuService=r,this.hoverService=o,this.inputDisposables=this._register(new L),be.closeNotificationAction||(be.closeNotificationAction=s.createInstance(Lt,Lt.ID,Lt.LABEL),be.expandNotificationAction=s.createInstance(xt,xt.ID,xt.LABEL),be.collapseNotificationAction=s.createInstance(kt,kt.ID,kt.LABEL))}setInput(e){this.inputDisposables.clear(),this.render(e)}render(e){this.template.container.classList.toggle("expanded",e.expanded),this.inputDisposables.add(F(this.template.container,Q.MOUSE_UP,n=>{n.button===1&&De.stop(n,!0)})),this.inputDisposables.add(F(this.template.container,Q.AUXCLICK,n=>{!e.hasProgress&&n.button===1&&(De.stop(n,!0),e.close())})),this.renderSeverity(e);const t=this.inputDisposables.add(this.hoverService.setupManagedHover(Gi("mouse"),this.template.message,"")),i=this.renderMessage(e,t);this.renderSecondaryActions(e,i);const s=this.inputDisposables.add(this.hoverService.setupManagedHover(Gi("mouse"),this.template.source,""));this.renderSource(e,s),this.renderButtons(e),this.renderProgress(e),this.inputDisposables.add(e.onDidChangeContent(n=>{switch(n.kind){case ae.SEVERITY:this.renderSeverity(e);break;case ae.PROGRESS:this.renderProgress(e);break;case ae.MESSAGE:this.renderMessage(e,t);break}}))}renderSeverity(e){be.SEVERITIES.forEach(t=>{e.severity!==t&&this.template.icon.classList.remove(...W.asClassNameArray(this.toSeverityIcon(t)))}),this.template.icon.classList.add(...W.asClassNameArray(this.toSeverityIcon(e.severity)))}renderMessage(e,t){ct(this.template.message),this.template.message.appendChild(Yn.render(e.message,{callback:s=>this.openerService.open(wi.parse(s),{allowCommands:!0}),toDispose:this.inputDisposables}));const i=e.canCollapse&&!e.expanded&&this.template.message.scrollWidth>this.template.message.clientWidth;return t.update(i?this.template.message.textContent+"":""),i}renderSecondaryActions(e,t){const i=[];if(hi(e.actions?.secondary)){const n=this.instantiationService.createInstance(Tt,Tt.ID,Tt.LABEL,e);i.push(n),this.inputDisposables.add(n)}let s=!1;e.canCollapse&&(e.expanded||e.source||t)&&(s=!0),s&&i.push(e.expanded?be.collapseNotificationAction:be.expandNotificationAction),e.hasProgress||i.push(be.closeNotificationAction),this.template.toolbar.clear(),this.template.toolbar.context=e,i.forEach(n=>this.template.toolbar.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)}))}renderSource(e,t){e.expanded&&e.source?(this.template.source.textContent=g(3487,"Source: {0}",e.source),t.update(e.source)):(this.template.source.textContent="",t.update(""))}renderButtons(e){ct(this.template.buttonsContainer);const t=e.actions?e.actions.primary:void 0;if(e.expanded&&hi(t)){const i=this,s=this.inputDisposables.add(new class extends Ms{async runAction(r){i.actionRunner.run(r,e),(!(r instanceof di)||!r.keepOpen)&&e.close()}}),n=this.inputDisposables.add(new ir(this.template.buttonsContainer));for(let r=0;r<t.length;r++){const o=t[r],a={title:!0,secondary:r>0,...sr},c=o instanceof di?o.menu:void 0,f=this.inputDisposables.add(c?n.addButtonWithDropdown({...a,contextMenuProvider:this.contextMenuService,actions:c,actionRunner:s}):n.addButton(a));f.label=o.label,this.inputDisposables.add(f.onDidClick(m=>{m&&De.stop(m,!0),s.run(o)}))}}}renderProgress(e){if(!e.hasProgress){this.template.progress.stop().hide();return}const t=e.progress.state;t.infinite?this.template.progress.infinite().show():typeof t.total=="number"||typeof t.worked=="number"?(typeof t.total=="number"&&!this.template.progress.hasTotal()&&this.template.progress.total(t.total),typeof t.worked=="number"&&this.template.progress.setWorked(t.worked).show()):this.template.progress.done().hide()}toSeverityIcon(e){switch(e){case q.Warning:return J.warning;case q.Error:return J.error}return J.info}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}},be=it,it.SEVERITIES=[q.Info,q.Warning,q.Error],it);as=be=y([u(2,rr),u(3,O),u(4,ut),u(5,ye),u(6,Fs)],as);ke(oc);let Si=class extends te{constructor(e,t,i,s){super(),this.container=e,this.options=t,this.instantiationService=i,this.contextMenuService=s,this.viewModel=[]}show(){this.isVisible||(this.list||this.createNotificationsList(),this.isVisible=!0)}createNotificationsList(){this.listContainer=I(".notifications-list-container");const e=this._register(this.instantiationService.createInstance(Zt)),t=this.instantiationService.createInstance(Ai,e),i=this.listDelegate=new os(this.listContainer),s=this.options,n=this.list=this._register(this.instantiationService.createInstance(Os,"NotificationsList",this.listContainer,i,[t],{...s,setRowLineHeight:!1,horizontalScrolling:!1,overrideStyles:{listBackground:_n},accessibilityProvider:this.instantiationService.createInstance(cs,s)})),r=this._register(this.instantiationService.createInstance(Ht,Ht.ID,Ht.LABEL));this._register(n.onContextMenu(a=>{a.element&&this.contextMenuService.showContextMenu({getAnchor:()=>a.anchor,getActions:()=>[r],getActionsContext:()=>a.element,actionRunner:e})})),this._register(n.onMouseDblClick(a=>a.element.toggle()));const o=this._register(or(n.getHTMLElement()));this._register(o.onDidBlur(()=>{K(this.listContainer).document.hasFocus()&&n.setFocus([])})),ge.bindTo(n.contextKeyService),this._register(n.onDidChangeSelection(a=>{a.indexes.length>0&&n.setSelection([])})),this.container.appendChild(this.listContainer)}updateNotificationsList(e,t,i=[]){const[s,n]=Nt(this.list,this.listContainer),r=ht(n),o=s.getFocus()[0],a=this.viewModel[o];let c=null;if(typeof o=="number"&&(c=s.getRelativeTop(o)),this.viewModel.splice(e,t,...i),s.splice(e,t,i),s.layout(),this.viewModel.length===0)this.hide();else if(typeof o=="number"){let f=0;if(a){let m=this.viewModel.indexOf(a);m===-1&&(m=o-1),m<this.viewModel.length&&m>=0&&(f=m)}typeof c=="number"&&s.reveal(f,c),s.setFocus([f])}this.isVisible&&r&&s.domFocus()}updateNotificationHeight(e){const t=this.viewModel.indexOf(e);if(t===-1)return;const[i,s]=Nt(this.list,this.listDelegate);i.updateElementHeight(t,s.getHeight(e)),i.layout()}hide(){!this.isVisible||!this.list||(this.isVisible=!1,this.list.splice(0,this.viewModel.length),this.viewModel=[])}focusFirst(){this.list&&(this.list.focusFirst(),this.list.domFocus())}hasFocus(){return this.listContainer?ht(this.listContainer):!1}layout(e,t){this.listContainer&&this.list&&(this.listContainer.style.width=`${e}px`,typeof t=="number"&&(this.list.getHTMLElement().style.maxHeight=`${t}px`),this.list.layout())}dispose(){this.hide(),super.dispose()}};Si=y([u(2,O),u(3,ye)],Si);let cs=class{constructor(e,t,i){this._options=e,this._keybindingService=t,this._configurationService=i}getAriaLabel(e){let t;const i=this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel();return this._configurationService.getValue("accessibility.verbosity.notification")&&(t=i?g(3462,"Inspect the response in the accessible view with {0}",i):g(3463,"Inspect the response in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding")),e.source?Gt(t?g(3466,"{0}, source: {1}, notification, {2}",e.message.raw,e.source,t):g(3467,"{0}, source: {1}, notification",e.message.raw,e.source),e.severity):Gt(t?g(3464,"{0}, notification, {1}",e.message.raw,t):g(3465,"{0}, notification",e.message.raw),e.severity)}getWidgetAriaLabel(){return this._options.widgetAriaLabel??g(3468,"Notifications List")}getRole(){return"dialog"}};cs=y([u(1,ut),u(2,ee)],cs);var At;ke($a);ke(zn);var xe;let hs=(xe=class extends wn{constructor(e,t,i,s,n,r,o,a,c,f,m){super(i),this.container=e,this.model=t,this.instantiationService=s,this.layoutService=n,this.editorGroupService=o,this.keybindingService=a,this.notificationService=c,this.accessibilitySignalService=f,this.contextMenuService=m,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.notificationsCenterVisibleContextKey=Wi.bindTo(r),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(lt.lift(e)))),this._register(this.notificationService.onDidChangeFilter(()=>this.onDidChangeFilter()))}onDidChangeFilter(){this.notificationService.getFilter()===w.ERROR&&this.hide()}get isVisible(){return!!this._isVisible}show(){if(this._isVisible){const i=de(this.notificationsList);i.show(),i.focusFirst();return}this.notificationsCenterContainer||this.create(),this.updateTitle();const[e,t]=Nt(this.notificationsList,this.notificationsCenterContainer);this._isVisible=!0,t.classList.add("visible"),e.show(),this.layout(this.workbenchDimensions),e.updateNotificationsList(0,0,this.model.notifications),e.focusFirst(),this.updateStyles(),this.model.notifications.forEach(i=>i.updateVisibility(!0)),this.notificationsCenterVisibleContextKey.set(!0),this._onDidChangeVisibility.fire()}updateTitle(){const[e,t]=Nt(this.notificationsCenterTitle,this.clearAllAction);this.model.notifications.length===0?(e.textContent=g(3446,"No new notifications"),t.enabled=!1):(e.textContent=g(3447,"Notifications"),t.enabled=this.model.notifications.some(i=>!i.hasProgress))}create(){this.notificationsCenterContainer=I(".notifications-center"),this.notificationsCenterHeader=I(".notifications-center-header"),this.notificationsCenterContainer.appendChild(this.notificationsCenterHeader),this.notificationsCenterTitle=I("span.notifications-center-header-title"),this.notificationsCenterHeader.appendChild(this.notificationsCenterTitle);const e=I(".notifications-center-header-toolbar");this.notificationsCenterHeader.appendChild(e);const t=this._register(this.instantiationService.createInstance(Zt)),i=this,s=this._register(new xs(e,{ariaLabel:g(3448,"Notification Center Actions"),actionRunner:t,actionViewItemProvider:(r,o)=>{if(r.id===It.ID)return this._register(this.instantiationService.createInstance(yn,r,{getActions(){const a=[ci({id:mi.ID,label:i.notificationService.getFilter()===w.OFF?g(3449,"Enable Do Not Disturb Mode"):g(3450,"Disable Do Not Disturb Mode"),run:()=>i.notificationService.setFilter(i.notificationService.getFilter()===w.OFF?w.ERROR:w.OFF)})],c=i.notificationService.getFilters().sort((f,m)=>f.label.localeCompare(m.label));for(const f of c.slice(0,At.MAX_NOTIFICATION_SOURCES))a.length===1&&a.push(new Ft),a.push(ci({id:`${mi.ID}.${f.id}`,label:f.label,checked:f.filter!==w.ERROR,run:()=>i.notificationService.setFilter({...f,filter:f.filter===w.ERROR?w.OFF:w.ERROR})}));return c.length>At.MAX_NOTIFICATION_SOURCES&&(a.push(new Ft),a.push(i._register(i.instantiationService.createInstance(pi,pi.ID,g(3451,"More…"))))),a}},this.contextMenuService,{...o,actionRunner:t,classNames:r.class,keybindingProvider:a=>this.keybindingService.lookupKeybinding(a.id)}))}}));this.clearAllAction=this._register(this.instantiationService.createInstance(Mt,Mt.ID,Mt.LABEL)),s.push(this.clearAllAction,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(this.clearAllAction)}),this.configureDoNotDisturbAction=this._register(this.instantiationService.createInstance(It,It.ID,It.LABEL)),s.push(this.configureDoNotDisturbAction,{icon:!0,label:!1});const n=this._register(this.instantiationService.createInstance(Ot,Ot.ID,Ot.LABEL));s.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)}),this.notificationsList=this.instantiationService.createInstance(Si,this.notificationsCenterContainer,{widgetAriaLabel:g(3452,"Notifications Center")}),this.container.appendChild(this.notificationsCenterContainer)}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}onDidChangeNotification(e){if(!this._isVisible)return;let t=!1;const[i,s]=Nt(this.notificationsList,this.notificationsCenterContainer);switch(e.kind){case j.ADD:i.updateNotificationsList(e.index,0,[e.item]),e.item.updateVisibility(!0);break;case j.CHANGE:switch(e.detail){case ae.ACTIONS:i.updateNotificationsList(e.index,1,[e.item]);break;case ae.MESSAGE:e.item.expanded&&i.updateNotificationHeight(e.item);break}break;case j.EXPAND_COLLAPSE:i.updateNotificationsList(e.index,1,[e.item]);break;case j.REMOVE:t=ht(s),i.updateNotificationsList(e.index,1),e.item.updateVisibility(!1);break}this.updateTitle(),this.model.notifications.length===0&&(this.hide(),t&&this.editorGroupService.activeGroup.focus())}hide(){if(!this._isVisible||!this.notificationsCenterContainer||!this.notificationsList)return;const e=ht(this.notificationsCenterContainer);this._isVisible=!1,this.notificationsCenterContainer.classList.remove("visible"),this.notificationsList.hide(),this.model.notifications.forEach(t=>t.updateVisibility(!1)),this.notificationsCenterVisibleContextKey.set(!1),this._onDidChangeVisibility.fire(),e&&this.editorGroupService.activeGroup.focus()}updateStyles(){if(this.notificationsCenterContainer&&this.notificationsCenterHeader){const e=this.getColor(Rn);this.notificationsCenterContainer.style.boxShadow=e?`0 0 8px 2px ${e}`:"";const t=this.getColor(ar);this.notificationsCenterContainer.style.border=t?`1px solid ${t}`:"";const i=this.getColor(cr);this.notificationsCenterHeader.style.color=i??"";const s=this.getColor(hr);this.notificationsCenterHeader.style.background=s??""}}layout(e){if(this.workbenchDimensions=e,this._isVisible&&this.notificationsCenterContainer){const t=At.MAX_DIMENSIONS.width,i=At.MAX_DIMENSIONS.height;let s=t,n=i;this.workbenchDimensions&&(s=this.workbenchDimensions.width,s-=16,n=this.workbenchDimensions.height-35,this.layoutService.isVisible(h.STATUSBAR_PART,C)&&(n-=22),this.layoutService.isVisible(h.TITLEBAR_PART,C)&&(n-=22),n-=24),de(this.notificationsList).layout(Math.min(t,s),Math.min(i,n))}}clearAll(){this.hide();for(const e of[...this.model.notifications])e.hasProgress||e.close(),this.accessibilitySignalService.playSignal(vi.clear)}},At=xe,xe.MAX_DIMENSIONS=new lt(450,400),xe.MAX_NOTIFICATION_SOURCES=10,xe);hs=At=y([u(2,ue),u(3,O),u(4,ce),u(5,Ie),u(6,ft),u(7,ut),u(8,Pe),u(9,yi),u(10,ye)],hs);class fc extends te{constructor(e){super(),this.model=e;for(const t of e.notifications)this.triggerAriaAlert(t);this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}onDidChangeNotification(e){e.kind===j.ADD&&(this.triggerAriaAlert(e.item),e.item.severity===q.Error&&(e.item.message.original instanceof Error?console.error(e.item.message.original):console.error(qt(e.item.message.linkedText.toString(),!0))))}triggerAriaAlert(e){if(e.priority===we.SILENT)return;const t=e.onDidChangeContent(i=>{i.kind===ae.MESSAGE&&this.doTriggerAriaAlert(e)});me.once(e.onDidClose)(()=>t.dispose()),this.doTriggerAriaAlert(e)}doTriggerAriaAlert(e){let t;e.severity===q.Error?t=g(3443,"Error: {0}",e.message.linkedText.toString()):e.severity===q.Warning?t=g(3444,"Warning: {0}",e.message.linkedText.toString()):t=g(3445,"Info: {0}",e.message.linkedText.toString()),lr(t)}}let ls=class extends te{constructor(e,t,i){super(),this.model=e,this.statusbarService=t,this.notificationService=i,this.newNotificationsCount=0,this.isNotificationsCenterVisible=!1,this.isNotificationsToastsVisible=!1,this.updateNotificationsCenterStatusItem(),e.statusMessage&&this.doSetStatusMessage(e.statusMessage),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.model.onDidChangeStatusMessage(e=>this.onDidChangeStatusMessage(e))),this._register(this.notificationService.onDidChangeFilter(()=>this.updateNotificationsCenterStatusItem()))}onDidChangeNotification(e){this.isNotificationsCenterVisible||(e.kind===j.ADD?this.newNotificationsCount++:e.kind===j.REMOVE&&this.newNotificationsCount>0&&this.newNotificationsCount--),this.updateNotificationsCenterStatusItem()}updateNotificationsCenterStatusItem(){let e=0;if(!this.isNotificationsCenterVisible&&!this.isNotificationsToastsVisible)for(const i of this.model.notifications)i.hasProgress&&e++;let t={name:g(3469,"Notifications"),text:`${e>0||this.newNotificationsCount>0?"$(bell-dot)":"$(bell)"}`,ariaLabel:g(3469,"Notifications"),command:this.isNotificationsCenterVisible?Xt:ts,tooltip:this.getTooltip(e),showBeak:this.isNotificationsCenterVisible};this.notificationService.getFilter()===w.ERROR&&(t={...t,text:`${e>0||this.newNotificationsCount>0?"$(bell-slash-dot)":"$(bell-slash)"}`,ariaLabel:g(3470,"Do Not Disturb"),tooltip:g(3471,"Do Not Disturb Mode is Enabled")}),this.notificationsCenterStatusItem?this.notificationsCenterStatusItem.update(t):this.notificationsCenterStatusItem=this.statusbarService.addEntry(t,"status.notifications",$.RIGHT,Number.NEGATIVE_INFINITY)}getTooltip(e){return this.isNotificationsCenterVisible?g(3472,"Hide Notifications"):this.model.notifications.length===0?g(3473,"No Notifications"):e===0?this.newNotificationsCount===0?g(3474,"No New Notifications"):this.newNotificationsCount===1?g(3475,"1 New Notification"):g(3476,"{0} New Notifications",this.newNotificationsCount):this.newNotificationsCount===0?g(3477,"No New Notifications ({0} in progress)",e):this.newNotificationsCount===1?g(3478,"1 New Notification ({0} in progress)",e):g(3479,"{0} New Notifications ({1} in progress)",this.newNotificationsCount,e)}update(e,t){let i=!1;this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.newNotificationsCount=0,i=!0),this.isNotificationsToastsVisible!==t&&(this.isNotificationsToastsVisible=t,i=!0),i&&this.updateNotificationsCenterStatusItem()}onDidChangeStatusMessage(e){const t=e.item;switch(e.kind){case vt.ADD:this.doSetStatusMessage(t);break;case vt.REMOVE:this.currentStatusMessage&&this.currentStatusMessage[0]===t&&(Wt(this.currentStatusMessage[1]),this.currentStatusMessage=void 0);break}}doSetStatusMessage(e){const t=e.message,i=e.options&&typeof e.options.showAfter=="number"?e.options.showAfter:0,s=e.options&&typeof e.options.hideAfter=="number"?e.options.hideAfter:-1;this.currentStatusMessage&&Wt(this.currentStatusMessage[1]);let n,r=setTimeout(()=>{n=this.statusbarService.addEntry({name:g(3480,"Status Message"),text:t,ariaLabel:t},"status.message",$.LEFT,Number.NEGATIVE_INFINITY),r=void 0},i),o;const a={dispose:()=>{r&&clearTimeout(r),o&&clearTimeout(o),n?.dispose()}};s>0&&(o=setTimeout(()=>a.dispose(),s)),this.currentStatusMessage=[e,a]}};ls=y([u(1,Ve),u(2,Pe)],ls);const gc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ge;ke(gc);var Ae;(function(l){l[l.HIDDEN_OR_VISIBLE=0]="HIDDEN_OR_VISIBLE",l[l.HIDDEN=1]="HIDDEN",l[l.VISIBLE=2]="VISIBLE"})(Ae||(Ae={}));var Se;let ds=(Se=class extends wn{get isVisible(){return!!this._isVisible}constructor(e,t,i,s,n,r,o,a,c){super(n),this.container=e,this.model=t,this.instantiationService=i,this.layoutService=s,this.editorGroupService=r,this.lifecycleService=a,this.hostService=c,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._isVisible=!1,this.mapNotificationToToast=new Map,this.mapNotificationToDisposable=new Map,this.addedToastsIntervalCounter=new dr(Ge.SPAM_PROTECTION.interval),this.notificationsToastsVisibleContextKey=_e.bindTo(o),this.registerListeners()}registerListeners(){this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(lt.lift(e)))),this.lifecycleService.when(Vt.Restored).then(()=>{this.model.notifications.forEach(e=>this.addToast(e)),this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}),this._register(this.model.onDidChangeFilter(({global:e,sources:t})=>{if(e===w.ERROR)this.hide();else if(t)for(const[i]of this.mapNotificationToToast)typeof i.sourceId=="string"&&t.get(i.sourceId)===w.ERROR&&i.severity!==q.Error&&i.priority!==we.URGENT&&this.removeToast(i)}))}onDidChangeNotification(e){switch(e.kind){case j.ADD:return this.addToast(e.item);case j.REMOVE:return this.removeToast(e.item)}}addToast(e){if(this.isNotificationsCenterVisible||e.priority===we.SILENT)return;if(e.priority===we.OPTIONAL){const i=zi();if(Ri(i)&&ur(i)&&fr(i,this.layoutService.mainContainer))return}if(this.addedToastsIntervalCounter.increment()>Ge.SPAM_PROTECTION.limit)return;const t=new L;this.mapNotificationToDisposable.set(e,t),t.add(gr(K(this.container),()=>this.doAddToast(e,t)))}doAddToast(e,t){let i=this.notificationsToastsContainer;i||(i=this.notificationsToastsContainer=I(".notifications-toasts"),this.container.appendChild(i)),i.classList.add("visible");const s=I(".notification-toast-container"),n=i.firstChild;n?i.insertBefore(s,n):i.appendChild(s);const r=I(".notification-toast");s.appendChild(r);const o=this.instantiationService.createInstance(Si,r,{verticalScrollMode:mr.Hidden,widgetAriaLabel:e.source?Gt(g(3482,"{0}, source: {1}, notification",e.message.raw,e.source),e.severity):Gt(g(3481,"{0}, notification",e.message.raw),e.severity)});t.add(o);const a={item:e,list:o,container:s,toast:r};this.mapNotificationToToast.set(e,a),t.add(Ne(()=>this.updateToastVisibility(a,!1))),o.show();const c=this.computeMaxDimensions();this.layoutLists(c.width),o.updateNotificationsList(0,0,[e]),this.layoutContainer(c.height),t.add(e.onDidChangeExpansion(()=>{o.updateNotificationsList(0,1,[e])})),t.add(e.onDidChangeContent(f=>{switch(f.kind){case ae.ACTIONS:o.updateNotificationsList(0,1,[e]);break;case ae.MESSAGE:e.expanded&&o.updateNotificationHeight(e);break}})),me.once(e.onDidClose)(()=>{this.removeToast(e)}),this.purgeNotification(e,s,o,t),this.updateStyles(),this.notificationsToastsVisibleContextKey.set(!0),r.classList.add("notification-fade-in"),t.add(F(r,"transitionend",()=>{r.classList.remove("notification-fade-in"),r.classList.add("notification-fade-in-done")})),e.updateVisibility(!0),this._isVisible||(this._isVisible=!0,this._onDidChangeVisibility.fire())}purgeNotification(e,t,i,s){let n=!1;s.add(F(t,Q.MOUSE_OVER,()=>n=!0)),s.add(F(t,Q.MOUSE_OUT,()=>n=!1));let r,o;const a=()=>{r=setTimeout(()=>{this.hostService.hasFocus?e.sticky||i.hasFocus()||n?a():this.removeToast(e):o||(o=this.hostService.onDidChangeFocus(c=>{c&&a()}),s.add(o))},Ge.PURGE_TIMEOUT[e.severity])};a(),s.add(Ne(()=>clearTimeout(r)))}removeToast(e){let t=!1;const i=this.mapNotificationToToast.get(e);i&&(ht(i.container)&&(t=!(this.focusNext()||this.focusPrevious())),this.mapNotificationToToast.delete(e));const s=this.mapNotificationToDisposable.get(e);s&&(Wt(s),this.mapNotificationToDisposable.delete(e)),this.mapNotificationToToast.size>0?this.layout(this.workbenchDimensions):(this.doHide(),t&&this.editorGroupService.activeGroup.focus())}removeToasts(){this.mapNotificationToToast.clear(),this.mapNotificationToDisposable.forEach(e=>Wt(e)),this.mapNotificationToDisposable.clear(),this.doHide()}doHide(){this.notificationsToastsContainer?.classList.remove("visible"),this.notificationsToastsVisibleContextKey.set(!1),this._isVisible&&(this._isVisible=!1,this._onDidChangeVisibility.fire())}hide(){const e=this.notificationsToastsContainer?ht(this.notificationsToastsContainer):!1;this.removeToasts(),e&&this.editorGroupService.activeGroup.focus()}focus(){const e=this.getToasts(Ae.VISIBLE);return e.length>0?(e[0].list.focusFirst(),!0):!1}focusNext(){const e=this.getToasts(Ae.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t+1];if(s)return s.list.focusFirst(),!0;break}return!1}focusPrevious(){const e=this.getToasts(Ae.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t-1];if(s)return s.list.focusFirst(),!0;break}return!1}focusFirst(){const e=this.getToasts(Ae.VISIBLE)[0];return e?(e.list.focusFirst(),!0):!1}focusLast(){const e=this.getToasts(Ae.VISIBLE);return e.length>0?(e[e.length-1].list.focusFirst(),!0):!1}update(e){this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.isNotificationsCenterVisible&&this.removeToasts())}updateStyles(){this.mapNotificationToToast.forEach(({toast:e})=>{const t=this.getColor(_n);e.style.background=t||"";const i=this.getColor(Rn);e.style.boxShadow=i?`0 0 8px 2px ${i}`:"";const s=this.getColor(pr);e.style.border=s?`1px solid ${s}`:""})}getToasts(e){const t=[];return this.mapNotificationToToast.forEach(i=>{switch(e){case Ae.HIDDEN_OR_VISIBLE:t.push(i);break;case Ae.HIDDEN:this.isToastInDOM(i)||t.push(i);break;case Ae.VISIBLE:this.isToastInDOM(i)&&t.push(i);break}}),t.reverse()}layout(e){this.workbenchDimensions=e;const t=this.computeMaxDimensions();t.height&&this.layoutContainer(t.height),this.layoutLists(t.width)}computeMaxDimensions(){const e=Ge.MAX_WIDTH;let t=e,i;return this.workbenchDimensions&&(t=this.workbenchDimensions.width,t-=16,i=this.workbenchDimensions.height,this.layoutService.isVisible(h.STATUSBAR_PART,C)&&(i-=22),this.layoutService.isVisible(h.TITLEBAR_PART,C)&&(i-=22),i-=24),new lt(Math.min(e,t),i??0)}layoutLists(e){this.mapNotificationToToast.forEach(({list:t})=>t.layout(e))}layoutContainer(e){let t=e,i=Math.round(e*.618),s=0;for(const n of this.getToasts(Ae.HIDDEN_OR_VISIBLE)){n.container.style.opacity="0",this.updateToastVisibility(n,!0),t-=n.container.offsetHeight,i-=n.container.offsetHeight;let r=!1;s===Ge.MAX_NOTIFICATIONS?r=!1:(s===0&&t>=0||s>0&&i>=0)&&(r=!0),this.updateToastVisibility(n,r),n.container.style.opacity="",r&&s++}}updateToastVisibility(e,t){if(this.isToastInDOM(e)===t)return;const i=de(this.notificationsToastsContainer);t?i.appendChild(e.container):e.container.remove(),e.item.updateVisibility(t)}isToastInDOM(e){return!!e.container.parentElement}},Ge=Se,Se.MAX_WIDTH=450,Se.MAX_NOTIFICATIONS=3,Se.PURGE_TIMEOUT={[q.Info]:1e4,[q.Warning]:12e3,[q.Error]:15e3},Se.SPAM_PROTECTION={interval:800,limit:Se.MAX_NOTIFICATIONS},Se);ds=Ge=y([u(2,O),u(3,ce),u(4,ue),u(5,ft),u(6,Ie),u(7,li),u(8,_t)],ds);const gn=new Ar("coreExperimentation.startupExpGroup","");var Y;(function(l){l.Control="control",l.MaximizedChat="maximizedChat",l.SplitEmptyEditorChat="splitEmptyEditorChat",l.SplitWelcomeChat="splitWelcomeChat"})(Y||(Y={}));const us="startup",mc={stable:{experimentName:us,targetPercentage:20,groups:[{name:Y.Control,min:0,max:.25,iteration:1},{name:Y.MaximizedChat,min:.25,max:.5,iteration:1},{name:Y.SplitEmptyEditorChat,min:.5,max:.75,iteration:1},{name:Y.SplitWelcomeChat,min:.75,max:1,iteration:1}]},insider:{experimentName:us,targetPercentage:50,groups:[{name:Y.Control,min:0,max:.25,iteration:1},{name:Y.MaximizedChat,min:.25,max:.5,iteration:1},{name:Y.SplitEmptyEditorChat,min:.5,max:.75,iteration:1},{name:Y.SplitWelcomeChat,min:.75,max:1,iteration:1}]}};let mn=class extends te{constructor(e,t,i,s,n){super(),this.storageService=e,this.telemetryService=t,this.productService=i,this.contextKeyService=s,this.environmentService=n,this.experiments=new Map,!(n.disableExperiments||n.enableSmokeTestDriver||n.extensionTestsLocationURI)&&this.initializeExperiments()}initializeExperiments(){const e=this.storageService.get(Cr,p.APPLICATION)||new Date().toUTCString();if((+new Date-+new Date(e))/1e3/60/60/24>1)return;const i=this.getExperimentConfiguration();if(!i)return;const s=`coreExperimentation.${i.experimentName}`,n=this.storageService.get(s,p.APPLICATION);if(n)try{const o=JSON.parse(n);this.experiments.set(i.experimentName,o),gn.bindTo(this.contextKeyService).set(o.experimentGroup);return}catch{this.storageService.remove(s,p.APPLICATION);return}const r=this.createStartupExperiment(i.experimentName,i);r&&(this.experiments.set(i.experimentName,r),this.sendExperimentTelemetry(i.experimentName,r),gn.bindTo(this.contextKeyService).set(r.experimentGroup),this.storageService.store(s,JSON.stringify(r),p.APPLICATION,D.MACHINE))}getExperimentConfiguration(){const e=this.productService.quality;if(e)return mc[e]}createStartupExperiment(e,t){const i=this.environmentService.startupExperimentGroup;if(i){const r=t.groups.find(o=>o.name===i);return r?{cohort:1,subCohort:1,experimentGroup:r.name,iteration:r.iteration,isInExperiment:!0}:void 0}const s=Math.random();if(s>=t.targetPercentage/100)return;const n=s/(t.targetPercentage/100);for(const r of t.groups)if(n>=r.min&&n<r.max)return{cohort:s,subCohort:n,experimentGroup:r.name,iteration:r.iteration,isInExperiment:!0}}sendExperimentTelemetry(e,t){this.telemetryService.publicLog2("coreExperimentation.experimentCohort",{experimentName:e,cohort:t.cohort,subCohort:t.subCohort,experimentGroup:t.experimentGroup,iteration:t.iteration,isInExperiment:t.isInExperiment})}getExperiment(){return this.experiments.get(us)}};mn=y([u(0,he),u(1,_i),u(2,Sr),u(3,Ie),u(4,Ir)],mn);var N;(function(l){l.SIDEBAR_HIDDEN="nosidebar",l.MAIN_EDITOR_AREA_HIDDEN="nomaineditorarea",l.PANEL_HIDDEN="nopanel",l.AUXILIARYBAR_HIDDEN="noauxiliarybar",l.STATUSBAR_HIDDEN="nostatusbar",l.FULLSCREEN="fullscreen",l.MAXIMIZED="maximized",l.WINDOW_BORDER="border"})(N||(N={}));const pc=["chat.commandCenter.enabled","workbench.navigationControl.enabled","workbench.experimental.share.enabled"],Ac=[_.ACTIVITY_BAR_LOCATION,_.COMMAND_CENTER,...pc,_.EDITOR_ACTIONS_LOCATION,_.LAYOUT_ACTIONS,Gs.MenuBarVisibility,X.TITLE_BAR_STYLE,X.CUSTOM_TITLE_BAR_VISIBILITY],pn=new lt(en.width,en.height);class Sc extends te{get activeContainer(){return this.getContainerFromDocument(Dn())}get containers(){const e=[];for(const{window:t}of br())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}whenContainerStylesLoaded(e){return this.containerStylesLoaded.get(e.vscodeWindowId)}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){return this.getContainerDimension(this.activeContainer)}getContainerDimension(e){return e===this.mainContainer?this.mainContainerDimension:Li(e)}get mainContainerOffset(){return this.computeContainerOffset(C)}get activeContainerOffset(){return this.computeContainerOffset(K(this.activeContainer))}computeContainerOffset(e){let t=0,i=0;this.isVisible(h.BANNER_PART)&&(t=this.getPart(h.BANNER_PART).maximumHeight,i=t);const s=this.isVisible(h.TITLEBAR_PART,e);return s&&(t+=this.getPart(h.TITLEBAR_PART).maximumHeight,i=t),s&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1&&(i=6),{top:t,quickPickTop:i}}constructor(e,t){super(),this.parent=e,this.layoutOptions=t,this._onDidChangeZenMode=this._register(new E),this.onDidChangeZenMode=this._onDidChangeZenMode.event,this._onDidChangeMainEditorCenteredLayout=this._register(new E),this.onDidChangeMainEditorCenteredLayout=this._onDidChangeMainEditorCenteredLayout.event,this._onDidChangePanelAlignment=this._register(new E),this.onDidChangePanelAlignment=this._onDidChangePanelAlignment.event,this._onDidChangeWindowMaximized=this._register(new E),this.onDidChangeWindowMaximized=this._onDidChangeWindowMaximized.event,this._onDidChangePanelPosition=this._register(new E),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangePartVisibility=this._register(new E),this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this._onDidChangeNotificationsVisibility=this._register(new E),this.onDidChangeNotificationsVisibility=this._onDidChangeNotificationsVisibility.event,this._onDidChangeAuxiliaryBarMaximized=this._register(new E),this.onDidChangeAuxiliaryBarMaximized=this._onDidChangeAuxiliaryBarMaximized.event,this._onDidLayoutMainContainer=this._register(new E),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new E),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidLayoutContainer=this._register(new E),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new E),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidChangeActiveContainer=this._register(new E),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainer=zt("div"),this.containerStylesLoaded=new Map,this.parts=new Map,this.initialized=!1,this.disposed=!1,this._openedDefaultEditors=!1,this.whenReadyPromise=new Zs,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Zs,this.whenRestored=this.whenRestoredPromise.p,this.restored=!1,this.inMaximizedAuxiliaryBarTransition=!1,Er(e)}initLayout(e){this.environmentService=e.get(jt),this.configurationService=e.get(ee),this.hostService=e.get(_t),this.contextService=e.get(Di),this.storageService=e.get(he),this.themeService=e.get(ue),this.extensionService=e.get(Tr),this.logService=e.get(Pn),this.telemetryService=e.get(_i),this.auxiliaryWindowService=e.get(yr),this.editorService=e.get(wt),this.editorGroupService=e.get(ft),this.mainPartEditorService=this.editorService.createScoped(this.editorGroupService.mainPart,this._store),this.paneCompositeService=e.get(vr),this.viewDescriptorService=e.get(_r),this.titleService=e.get(Ws),this.notificationService=e.get(Pe),this.statusBarService=e.get(Ve),e.get(gt),this.registerLayoutListeners(),this.initLayoutState(e.get(li),e.get(wr),e.get(Rr))}registerLayoutListeners(){const e=()=>{this.isVisible(h.EDITOR_PART,C)||(this.isAuxiliaryBarMaximized()?this.toggleMaximizedAuxiliaryBar():this.toggleMaximizedPanel())};this.editorGroupService.whenRestored.then(()=>{this._register(this.mainPartEditorService.onDidVisibleEditorsChange(e)),this._register(this.editorGroupService.mainPart.onDidActivateGroup(e)),this._register(this.mainPartEditorService.onDidActiveEditorChange(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED))))}),this._register(this.configurationService.onDidChangeConfiguration(i=>{if([...Ac,se.SIDEBAR_POSITION,se.STATUSBAR_VISIBLE].some(s=>i.affectsConfiguration(s))){const s=i.affectsConfiguration("workbench.experimental.share.enabled")&&this.configurationService.getValue("workbench.experimental.share.enabled"),n=i.affectsConfiguration("workbench.navigationControl.enabled")&&this.configurationService.getValue("workbench.navigationControl.enabled");if((s||n)&&this.configurationService.getValue(_.COMMAND_CENTER)===!1){this.configurationService.updateValue(_.COMMAND_CENTER,!0);return}const r=i.affectsConfiguration(_.EDITOR_ACTIONS_LOCATION)&&this.configurationService.getValue(_.EDITOR_ACTIONS_LOCATION)===Ui.TITLEBAR,o=i.affectsConfiguration(_.COMMAND_CENTER)&&this.configurationService.getValue(_.COMMAND_CENTER),a=i.affectsConfiguration(_.LAYOUT_ACTIONS)&&this.configurationService.getValue(_.LAYOUT_ACTIONS);if((i.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&[Me.TOP,Me.BOTTOM].includes(this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION))||r||o||a)&&this.configurationService.getValue(X.CUSTOM_TITLE_BAR_VISIBILITY)===oe.NEVER){this.configurationService.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO);return}this.doUpdateLayoutConfiguration()}})),this._register(Dr(i=>this.onFullscreenChanged(i))),this._register(this.editorGroupService.mainPart.onDidAddGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidRemoveGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)))),this._register(F(this.mainContainer,Q.SCROLL,()=>this.mainContainer.scrollTop=0)),(Et||Ut||le)&&!Bt(this.configurationService)&&this._register(this.titleService.onMenubarVisibilityChange(i=>this.onMenubarToggled(i))),this._register(this.themeService.onDidColorThemeChange(()=>this.updateWindowBorder())),this._register(this.hostService.onDidChangeFocus(i=>this.onWindowFocusChanged(i))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),le&&typeof navigator.windowControlsOverlay=="object"&&this._register(F(navigator.windowControlsOverlay,"geometrychange",()=>this.onDidChangeWCO())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:i,disposables:s})=>{const n=i.window.vscodeWindowId;this.containerStylesLoaded.set(n,i.whenStylesHaveLoaded),i.whenStylesHaveLoaded.then(()=>this.containerStylesLoaded.delete(n)),s.add(Ne(()=>this.containerStylesLoaded.delete(n)));const r=s.add(new L);this._onDidAddContainer.fire({container:i.container,disposables:r}),s.add(i.onDidLayout(o=>this.handleContainerDidLayout(i.container,o)))}))}onMenubarToggled(e){if(e!==this.state.runtime.menuBar.toggled){this.state.runtime.menuBar.toggled=e;const t=Yi(this.configurationService);le&&t==="toggle"?this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled)):this.state.runtime.mainWindowFullscreen&&(t==="toggle"||t==="classic")&&this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled)),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),Nn(e)&&this._onDidLayoutActiveContainer.fire(t),this._onDidLayoutContainer.fire({container:e,dimension:t})}onFullscreenChanged(e){e===C.vscodeWindowId&&(this.state.runtime.mainWindowFullscreen=$s(C),this.state.runtime.mainWindowFullscreen?this.mainContainer.classList.add(N.FULLSCREEN):(this.mainContainer.classList.remove(N.FULLSCREEN),this.stateModel.getRuntimeValue(d.ZEN_MODE_EXIT_INFO).transitionedToFullScreen&&this.isZenModeActive()&&this.toggleZenMode()),this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen,this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled)),this.updateWindowBorder(!0))}onActiveWindowChanged(){const e=this.getActiveContainerId();this.state.runtime.activeContainerId!==e&&(this.state.runtime.activeContainerId=e,this.updateWindowBorder(),this._onDidChangeActiveContainer.fire())}onWindowFocusChanged(e){this.state.runtime.hasFocus!==e&&(this.state.runtime.hasFocus=e,this.updateWindowBorder())}getActiveContainerId(){const e=this.activeContainer;return K(e).vscodeWindowId}doUpdateLayoutConfiguration(e){this.updateCustomTitleBarVisibility(),this.updateMenubarVisibility(!!e),this.editorGroupService.whenRestored.then(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED),e))}setSideBarPosition(e){const t=this.getPart(h.ACTIVITYBAR_PART),i=this.getPart(h.SIDEBAR_PART),s=this.getPart(h.AUXILIARYBAR_PART),n=e===v.LEFT?"left":"right",r=e===v.RIGHT?"left":"right",o=this.getPanelAlignment(),a=this.getPanelPosition();this.stateModel.setRuntimeValue(d.SIDEBAR_POSITON,e);const c=de(t.getContainer()),f=de(i.getContainer()),m=de(s.getContainer());c.classList.remove(r),f.classList.remove(r),c.classList.add(n),f.classList.add(n),m.classList.remove(n),m.classList.add(r),t.updateStyles(),i.updateStyles(),s.updateStyles(),this.adjustPartPositions(e,o,a)}updateWindowBorder(e=!1){if(le||Et||(Et||Ut)&&Pr(this.configurationService)||Bt(this.configurationService))return;const t=this.themeService.getColorTheme(),i=t.getColor(Nr),s=t.getColor(Vr),n=this.hasMainWindowBorder();for(const r of this.containers){const o=r===this.mainContainer,a=this.activeContainer===r;let c=!1;if(!this.state.runtime.mainWindowFullscreen&&(i||s)){c=!0;const f=a&&this.state.runtime.hasFocus?i:s??i;r.style.setProperty("--window-border-color",f?.toString()??"transparent")}o&&(this.state.runtime.mainWindowBorder=c),r.classList.toggle(N.WINDOW_BORDER,c)}!e&&n!==this.hasMainWindowBorder()&&this.layout()}initLayoutState(e,t,i){this._mainContainerDimension=Li(this.parent,pn),this.stateModel=new fs(this.storageService,this.configurationService,this.contextService,i,this.environmentService,this.viewDescriptorService),this.stateModel.load({mainContainerDimension:this._mainContainerDimension,resetLayout:!!this.layoutOptions?.resetLayout}),this._register(this.stateModel.onDidChangeState(o=>{o.key===d.ACTIVITYBAR_HIDDEN&&this.setActivityBarHidden(o.value),o.key===d.STATUSBAR_HIDDEN&&this.setStatusBarHidden(o.value),o.key===d.SIDEBAR_POSITON&&this.setSideBarPosition(o.value),o.key===d.PANEL_POSITION&&this.setPanelPosition(o.value),o.key===d.PANEL_ALIGNMENT&&this.setPanelAlignment(o.value),this.doUpdateLayoutConfiguration()}));const s=this.getInitialEditorsState();s&&this.logService.trace("Initial editor state",s);const n={layout:{editors:s?.layout},editor:{restoreEditors:this.shouldRestoreEditors(this.contextService,s),editorsToOpen:this.resolveEditorsToOpen(t,s)},views:{defaults:this.getDefaultLayoutViews(this.environmentService,this.storageService),containerToRestore:{}}},r={activeContainerId:this.getActiveContainerId(),mainWindowFullscreen:$s(C),hasFocus:this.hostService.hasFocus,maximized:new Set,mainWindowBorder:!1,menuBar:{toggled:!1},zenMode:{transitionDisposables:new Br}};if(this.state={initialization:n,runtime:r},this.isVisible(h.SIDEBAR_PART)){let o;!this.environmentService.isBuilt||e.startupKind===Lr.ReloadedWindow||this.environmentService.isExtensionDevelopment&&!this.environmentService.extensionTestsLocationURI?o=this.storageService.get(xa.activeViewletSettingsKey,p.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(T.Sidebar)?.id):o=this.viewDescriptorService.getDefaultViewContainer(T.Sidebar)?.id,o?this.state.initialization.views.containerToRestore.sideBar=o:this.stateModel.setRuntimeValue(d.SIDEBAR_HIDDEN,!0)}if(this.isVisible(h.PANEL_PART)){const o=this.storageService.get(ka.activePanelSettingsKey,p.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(T.Panel)?.id);o?this.state.initialization.views.containerToRestore.panel=o:this.stateModel.setRuntimeValue(d.PANEL_HIDDEN,!0)}if(this.isVisible(h.AUXILIARYBAR_PART)){const o=this.storageService.get(Ha.activeViewSettingsKey,p.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(T.AuxiliaryBar)?.id);o?this.state.initialization.views.containerToRestore.auxiliaryBar=o:this.stateModel.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,!0)}this.updateWindowBorder(!0)}getDefaultLayoutViews(e,t){const i=e.options?.defaultLayout;if(!i||!i.force&&!t.isNew(p.WORKSPACE))return;const{views:s}=i;if(s?.length)return s.map(n=>n.id)}shouldRestoreEditors(e,t){return Mr(e.getWorkspace())?!1:!!(this.configurationService.getValue("window.restoreWindows")==="preserve")||t===void 0}willRestoreEditors(){return this.state.initialization.editor.restoreEditors}async resolveEditorsToOpen(e,t){if(t){const i=Pt(await Mi(t.filesToMerge,e,this.logService));if(i.length===4&&Qt(i[0])&&Qt(i[1])&&Qt(i[2])&&Qt(i[3]))return[{editor:{input1:{resource:i[0].resource},input2:{resource:i[1].resource},base:{resource:i[2].resource},result:{resource:i[3].resource},options:{pinned:!0}}}];const s=Pt(await Mi(t.filesToDiff,e,this.logService));if(s.length===2)return[{editor:{original:{resource:s[0].resource},modified:{resource:s[1].resource},options:{pinned:!0}}}];const n=[],r=await Mi(t.filesToOpenOrCreate,e,this.logService);for(let o=0;o<r.length;o++){const a=r[o];a&&n.push({editor:a,viewColumn:t.filesToOpenOrCreate?.[o].viewColumn})}return n}else if(this.contextService.getWorkbenchState()===Oe.EMPTY&&this.configurationService.getValue("workbench.startupEditor")==="newUntitledFile")return this.editorGroupService.hasRestorableState?[]:[{editor:{resource:void 0}}];return[]}get openedDefaultEditors(){return this._openedDefaultEditors}getInitialEditorsState(){const e=this.environmentService.options?.defaultLayout;if((e?.editors?.length||e?.layout?.editors)&&(e.force||this.storageService.isNew(p.WORKSPACE)))return this._openedDefaultEditors=!0,{layout:e.layout?.editors,filesToOpenOrCreate:e?.editors?.map(n=>({viewColumn:n.viewColumn,fileUri:wi.revive(n.uri),openOnlyIfExists:n.openOnlyIfExists,options:n.options}))};const{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}=this.environmentService;if(t||i||s)return{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}}isRestored(){return this.restored}restoreParts(){const e=[],t=[];e.push((async()=>{k("code/willRestoreEditors"),await this.editorGroupService.whenReady,k("code/restoreEditors/editorGroupsReady"),this.state.initialization.layout?.editors&&this.editorGroupService.mainPart.applyLayout(this.state.initialization.layout.editors);const r=await this.state.initialization.editor.editorsToOpen;k("code/restoreEditors/editorsToOpenResolved");let o;if(r.length){const a=this.editorGroupService.mainPart.getGroups(Or.GRID_APPEARANCE),c=new Map;for(const f of r){const m=a[(f.viewColumn??1)-1];let A=c.get(m.id);A||(A=new Set,c.set(m.id,A)),A.add(f.editor)}o=Promise.all(Array.from(c).map(async([f,m])=>{try{await this.editorService.openEditors(Array.from(m),f,{validateTrust:!0})}catch(A){this.logService.error(A)}}))}t.push(Promise.all([o?.finally(()=>k("code/restoreEditors/editorsOpened")),this.editorGroupService.whenRestored.finally(()=>k("code/restoreEditors/editorGroupsRestored"))]).finally(()=>{k("code/didRestoreEditors")}))})());const i=(async()=>{if(this.state.initialization.views.defaults?.length){k("code/willOpenDefaultViews");const r=[],o=f=>{const m=this.viewDescriptorService.getViewLocationById(f.id);if(m!==null){const A=this.viewDescriptorService.getViewContainerByViewId(f.id);if(A){f.order>=(r?.[m]?.order??0)&&(r[m]={id:A.id,order:f.order});const S=this.viewDescriptorService.getViewContainerModel(A);return S.setCollapsed(f.id,!1),S.setVisible(f.id,!0),!0}}return!1},a=[...this.state.initialization.views.defaults].reverse().map((f,m)=>({id:f,order:m}));let c=a.length;for(;c;)c--,o(a[c])&&a.splice(c,1);if(a.length){await this.extensionService.whenInstalledExtensionsRegistered();let f=a.length;for(;f;)f--,o(a[f])&&a.splice(f,1)}r[T.Sidebar]&&(this.state.initialization.views.containerToRestore.sideBar=r[T.Sidebar].id),r[T.Panel]&&(this.state.initialization.views.containerToRestore.panel=r[T.Panel].id),r[T.AuxiliaryBar]&&(this.state.initialization.views.containerToRestore.auxiliaryBar=r[T.AuxiliaryBar].id),k("code/didOpenDefaultViews")}})();e.push(i),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.sideBar&&(k("code/willRestoreViewlet"),await this.openViewContainer(T.Sidebar,this.state.initialization.views.containerToRestore.sideBar),k("code/didRestoreViewlet"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.panel&&(k("code/willRestorePanel"),await this.openViewContainer(T.Panel,this.state.initialization.views.containerToRestore.panel),k("code/didRestorePanel"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.auxiliaryBar&&(k("code/willRestoreAuxiliaryBar"),await this.openViewContainer(T.AuxiliaryBar,this.state.initialization.views.containerToRestore.auxiliaryBar),k("code/didRestoreAuxiliaryBar"))})());const s=this.isZenModeActive(),n=An(this.configurationService).restore;s&&(this.setZenModeActive(!n),this.toggleZenMode(!1,!0)),this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)&&this.centerMainEditorLayout(!0,!0),qs.settled(e).finally(()=>{zi()===C.document.body&&(this.isPanelMaximized()||this.isAuxiliaryBarMaximized())&&this.focus(),this.whenReadyPromise.complete(),qs.settled(t).finally(()=>{this.restored=!0,this.whenRestoredPromise.complete()})})}async openViewContainer(e,t,i){let s=await this.paneCompositeService.openPaneComposite(t,e,i);s||(s=await this.paneCompositeService.openPaneComposite(this.viewDescriptorService.getDefaultViewContainer(e)?.id,e,i),!s&&await this.paneCompositeService.openPaneComposite(this.paneCompositeService.getVisiblePaneCompositeIds(e).at(0),e,i))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ne(()=>this.parts.delete(t))}getPart(e){const t=this.parts.get(e);if(!t)throw new Error(`Unknown part ${e}`);return t}registerNotifications(e){this._register(e.onDidChangeNotificationsVisibility(t=>this._onDidChangeNotificationsVisibility.fire(t)))}hasFocus(e){const t=this.getContainer(ei(),e);if(!t)return!1;const i=zi();return i?xr(i,t):!1}_getFocusedPart(){for(const e of this.parts.keys())if(this.hasFocus(e))return e}focusPart(e,t=C){const i=this.getContainer(t,e)??this.mainContainer;switch(e){case h.EDITOR_PART:this.editorGroupService.getPart(i).activeGroup.focus();break;case h.PANEL_PART:{this.paneCompositeService.getActivePaneComposite(T.Panel)?.focus();break}case h.SIDEBAR_PART:{this.paneCompositeService.getActivePaneComposite(T.Sidebar)?.focus();break}case h.AUXILIARYBAR_PART:{this.paneCompositeService.getActivePaneComposite(T.AuxiliaryBar)?.focus();break}case h.ACTIVITYBAR_PART:this.getPart(h.SIDEBAR_PART).focusActivityBar();break;case h.STATUSBAR_PART:this.statusBarService.getPart(i).focus();break;default:i?.focus()}}getContainer(e,t){if(typeof t>"u")return this.getContainerFromDocument(e.document);if(e===C)return this.getPart(t).getContainer();let i;if(t===h.EDITOR_PART?i=this.editorGroupService.getPart(this.getContainerFromDocument(e.document)):t===h.STATUSBAR_PART?i=this.statusBarService.getPart(this.getContainerFromDocument(e.document)):t===h.TITLEBAR_PART&&(i=this.titleService.getPart(this.getContainerFromDocument(e.document))),i instanceof Pi)return i.getContainer()}isVisible(e,t=C){if(t!==C&&e===h.EDITOR_PART)return!0;switch(e){case h.TITLEBAR_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.titleBarPartView):Fe(this.configurationService,C,this.state.runtime.menuBar.toggled);case h.SIDEBAR_PART:return!this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN);case h.PANEL_PART:return!this.stateModel.getRuntimeValue(d.PANEL_HIDDEN);case h.AUXILIARYBAR_PART:return!this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN);case h.STATUSBAR_PART:return!this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN);case h.ACTIVITYBAR_PART:return!this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN);case h.EDITOR_PART:return!this.stateModel.getRuntimeValue(d.EDITOR_HIDDEN);case h.BANNER_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.bannerPartView):!1;default:return!1}}shouldShowBannerFirst(){return le&&!Ki()}focus(){this.isPanelMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(h.PANEL_PART):this.isAuxiliaryBarMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(h.AUXILIARYBAR_PART):this.focusPart(h.EDITOR_PART,K(this.activeContainer))}focusPanelOrEditor(){const e=this.paneCompositeService.getActivePaneComposite(T.Panel);(this.hasFocus(h.PANEL_PART)||!this.isVisible(h.EDITOR_PART))&&e?e.focus():this.focus()}getMaximumEditorDimensions(e){const t=K(e),i=this.getContainerDimension(e);if(e===this.mainContainer){const s=H(this.getPanelPosition()),n=(this.isVisible(h.ACTIVITYBAR_PART)?this.activityBarPartView.minimumWidth:0)+(this.isVisible(h.SIDEBAR_PART)?this.sideBarPartView.minimumWidth:0)+(this.isVisible(h.PANEL_PART)&&!s?this.panelPartView.minimumWidth:0)+(this.isVisible(h.AUXILIARYBAR_PART)?this.auxiliaryBarPartView.minimumWidth:0),r=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0)+(this.isVisible(h.PANEL_PART)&&s?this.panelPartView.minimumHeight:0),o=i.width-n,a=i.height-r;return{width:o,height:a}}else{const s=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0);return{width:i.width,height:i.height-s}}}isZenModeActive(){return this.stateModel.getRuntimeValue(d.ZEN_MODE_ACTIVE)}setZenModeActive(e){this.stateModel.setRuntimeValue(d.ZEN_MODE_ACTIVE,e)}toggleZenMode(e,t=!1){const i=this._getFocusedPart();this.setZenModeActive(!this.isZenModeActive()),this.state.runtime.zenMode.transitionDisposables.clearAndDisposeAll();const s=a=>{for(const c of this.mainPartEditorService.visibleTextEditorControls){if(!a&&Kr(c)&&c.hasModel()){const f=c.getModel();a=this.configurationService.getValue("editor.lineNumbers",{resource:f.uri,overrideIdentifier:f.getLanguageId()})}a||(a=this.configurationService.getValue("editor.lineNumbers")),c.updateOptions({lineNumbers:a})}};let n=!1;const r=An(this.configurationService),o=this.stateModel.getRuntimeValue(d.ZEN_MODE_EXIT_INFO);this.isZenModeActive()?(n=!this.state.runtime.mainWindowFullscreen&&r.fullScreen&&!js,t||(o.transitionedToFullScreen=n,o.transitionedToCenteredEditorLayout=!this.isMainEditorLayoutCentered()&&r.centerLayout,o.handleNotificationsDoNotDisturbMode=this.notificationService.getFilter()===w.OFF,o.wasVisible.sideBar=this.isVisible(h.SIDEBAR_PART),o.wasVisible.panel=this.isVisible(h.PANEL_PART),o.wasVisible.auxiliaryBar=this.isVisible(h.AUXILIARYBAR_PART),this.stateModel.setRuntimeValue(d.ZEN_MODE_EXIT_INFO,o)),this.setPanelHidden(!0,!0),this.setAuxiliaryBarHidden(!0,!0),this.setSideBarHidden(!0),r.hideActivityBar&&this.setActivityBarHidden(!0),r.hideStatusBar&&this.setStatusBarHidden(!0),r.hideLineNumbers&&(s("off"),this.state.runtime.zenMode.transitionDisposables.set(z.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s("off")))),r.showTabs!==this.editorGroupService.partOptions.showTabs&&this.state.runtime.zenMode.transitionDisposables.set(z.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:r.showTabs})),r.silentNotifications&&o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.ERROR),r.centerLayout&&this.centerMainEditorLayout(!0,!0),this.state.runtime.zenMode.transitionDisposables.set("configurationChange",this.configurationService.onDidChangeConfiguration(a=>{if(a.affectsConfiguration(z.HIDE_ACTIVITYBAR)||a.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)){const c=this.configurationService.getValue(z.HIDE_ACTIVITYBAR),f=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);this.setActivityBarHidden(c?!0:f===Me.TOP||f===Me.BOTTOM)}if(a.affectsConfiguration(z.HIDE_STATUSBAR)){const c=this.configurationService.getValue(z.HIDE_STATUSBAR);this.setStatusBarHidden(c)}if(a.affectsConfiguration(z.CENTER_LAYOUT)){const c=this.configurationService.getValue(z.CENTER_LAYOUT);this.centerMainEditorLayout(c,!0)}if(a.affectsConfiguration(z.SHOW_TABS)){const c=this.configurationService.getValue(z.SHOW_TABS)??"multiple";this.state.runtime.zenMode.transitionDisposables.set(z.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:c}))}if(a.affectsConfiguration(z.SILENT_NOTIFICATIONS)){const c=!!this.configurationService.getValue(z.SILENT_NOTIFICATIONS);o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(c?w.ERROR:w.OFF)}if(a.affectsConfiguration(z.HIDE_LINENUMBERS)){const c=this.configurationService.getValue(z.HIDE_LINENUMBERS)?"off":void 0;s(c),this.state.runtime.zenMode.transitionDisposables.set(z.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s(c)))}}))):(o.wasVisible.panel&&this.setPanelHidden(!1,!0),o.wasVisible.auxiliaryBar&&this.setAuxiliaryBarHidden(!1,!0),o.wasVisible.sideBar&&this.setSideBarHidden(!1),this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN,!0)||this.setActivityBarHidden(!1),this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN,!0)||this.setStatusBarHidden(!1),o.transitionedToCenteredEditorLayout&&this.centerMainEditorLayout(!1,!0),o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.OFF),s(),n=o.transitionedToFullScreen&&this.state.runtime.mainWindowFullscreen),e||this.layout(),n&&this.hostService.toggleFullScreen(C),i&&this.isVisible(i,K(this.activeContainer))?kr(i)?this.focusPart(i,K(this.activeContainer)):this.focusPart(i):this.focus(),this._onDidChangeZenMode.fire(this.isZenModeActive())}setStatusBarHidden(e){this.stateModel.setRuntimeValue(d.STATUSBAR_HIDDEN,e),e?this.mainContainer.classList.add(N.STATUSBAR_HIDDEN):this.mainContainer.classList.remove(N.STATUSBAR_HIDDEN),this.workbenchGrid.setViewVisible(this.statusBarPartView,!e)}createWorkbenchLayout(){const e=this.getPart(h.TITLEBAR_PART),t=this.getPart(h.BANNER_PART),i=this.getPart(h.EDITOR_PART),s=this.getPart(h.ACTIVITYBAR_PART),n=this.getPart(h.PANEL_PART),r=this.getPart(h.AUXILIARYBAR_PART),o=this.getPart(h.SIDEBAR_PART),a=this.getPart(h.STATUSBAR_PART);this.titleBarPartView=e,this.bannerPartView=t,this.sideBarPartView=o,this.activityBarPartView=s,this.editorPartView=i,this.panelPartView=n,this.auxiliaryBarPartView=r,this.statusBarPartView=a;const c={[h.ACTIVITYBAR_PART]:this.activityBarPartView,[h.BANNER_PART]:this.bannerPartView,[h.TITLEBAR_PART]:this.titleBarPartView,[h.EDITOR_PART]:this.editorPartView,[h.PANEL_PART]:this.panelPartView,[h.SIDEBAR_PART]:this.sideBarPartView,[h.STATUSBAR_PART]:this.statusBarPartView,[h.AUXILIARYBAR_PART]:this.auxiliaryBarPartView},f=({type:A})=>c[A],m=Fa.deserialize(this.createGridDescriptor(),{fromJSON:f},{proportionalLayout:!1});this.mainContainer.prepend(m.element),this.mainContainer.setAttribute("role","application"),this.workbenchGrid=m,this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen;for(const A of[e,i,s,n,o,a,r,t])this._register(A.onDidVisibilityChange(S=>{this.inMaximizedAuxiliaryBarTransition||(A===o?this.setSideBarHidden(!S):A===n?this.setPanelHidden(!S,!0):A===r?this.setAuxiliaryBarHidden(!S,!0):A===i&&this.setEditorHidden(!S)),this._onDidChangePartVisibility.fire(),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}));this._register(this.storageService.onWillSaveState(A=>{const S=this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView):this.workbenchGrid.getViewSize(this.sideBarPartView).width;this.stateModel.setInitializationValue(d.SIDEBAR_SIZE,S);const x=this.stateModel.getRuntimeValue(d.PANEL_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView):H(this.stateModel.getRuntimeValue(d.PANEL_POSITION))?this.workbenchGrid.getViewSize(this.panelPartView).height:this.workbenchGrid.getViewSize(this.panelPartView).width;this.stateModel.setInitializationValue(d.PANEL_SIZE,x);const G=this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView):this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setInitializationValue(d.AUXILIARYBAR_SIZE,G),this.stateModel.save(!0,!0)}))}layout(){this.disposed||(this._mainContainerDimension=Li(this.state.runtime.mainWindowFullscreen?C.document.body:this.parent,pn),this.logService.trace(`Layout#layout, height: ${this._mainContainerDimension.height}, width: ${this._mainContainerDimension.width}`),Hr(this.mainContainer,0,0,0,0,"relative"),Fr(this.mainContainer,this._mainContainerDimension.width,this._mainContainerDimension.height),this.workbenchGrid.layout(this._mainContainerDimension.width,this._mainContainerDimension.height),this.initialized=!0,this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension))}isMainEditorLayoutCentered(){return this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)}centerMainEditorLayout(e,t){this.stateModel.setRuntimeValue(d.MAIN_EDITOR_CENTERED,e);const s=Pt(this.editorGroupService.mainPart.groups.map(a=>a.activeEditor)).some(a=>a instanceof Wr?this.configurationService.getValue("diffEditor.renderSideBySide"):!!a?.hasCapability(Gr.MultipleEditors)),n=this.editorGroupService.getLayout();let r=!1;n.orientation===zr.HORIZONTAL?r=n.groups.length>1:r=n.groups.some(a=>a.groups&&a.groups.length>1),this.configurationService.getValue("workbench.editor.centeredLayoutAutoResize")&&(r&&!this.editorGroupService.mainPart.hasMaximizedGroup()||s)&&(e=!1),this.editorGroupService.mainPart.isLayoutCentered()!==e&&(this.editorGroupService.mainPart.centerLayout(e),t||this.layout()),this._onDidChangeMainEditorCenteredLayout.fire(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED))}getSize(e){return this.workbenchGrid.getViewSize(this.getPart(e))}setSize(e,t){this.workbenchGrid.resizeView(this.getPart(e),t)}resizePart(e,t,i){const s=Math.sign(t)*Js(ei(),Math.abs(t)),n=Math.sign(i)*Js(ei(),Math.abs(i));let r;switch(e){case h.SIDEBAR_PART:r=this.workbenchGrid.getViewSize(this.sideBarPartView),this.workbenchGrid.resizeView(this.sideBarPartView,{width:r.width+s,height:r.height});break;case h.PANEL_PART:r=this.workbenchGrid.getViewSize(this.panelPartView),this.workbenchGrid.resizeView(this.panelPartView,{width:r.width+(H(this.getPanelPosition())?0:s),height:r.height+(H(this.getPanelPosition())?n:0)});break;case h.AUXILIARYBAR_PART:r=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:r.width+s,height:r.height});break;case h.EDITOR_PART:if(r=this.workbenchGrid.getViewSize(this.editorPartView),this.editorGroupService.mainPart.count===1)this.workbenchGrid.resizeView(this.editorPartView,{width:r.width+s,height:r.height+n});else{const o=this.editorGroupService.mainPart.activeGroup,{width:a,height:c}=this.editorGroupService.mainPart.getSize(o);this.editorGroupService.mainPart.setSize(o,{width:a+s,height:c+n});const{width:f,height:m}=this.editorGroupService.mainPart.getSize(o);(n&&c===m||s&&a===f)&&this.workbenchGrid.resizeView(this.editorPartView,{width:r.width+(s&&a===f?s:0),height:r.height+(n&&c===m?n:0)})}break;default:return}}setActivityBarHidden(e){this.stateModel.setRuntimeValue(d.ACTIVITYBAR_HIDDEN,e),this.workbenchGrid.setViewVisible(this.activityBarPartView,!e)}setBannerHidden(e){this.workbenchGrid.setViewVisible(this.bannerPartView,!e)}setEditorHidden(e){!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(h.EDITOR_PART)||(this.stateModel.setRuntimeValue(d.EDITOR_HIDDEN,e),e?this.mainContainer.classList.add(N.MAIN_EDITOR_AREA_HIDDEN):this.mainContainer.classList.remove(N.MAIN_EDITOR_AREA_HIDDEN),this.workbenchGrid.setViewVisible(this.editorPartView,!e),e&&!this.isVisible(h.PANEL_PART)&&!this.isAuxiliaryBarMaximized()&&this.setPanelHidden(!1,!0))}getLayoutClasses(){return Pt([this.isVisible(h.SIDEBAR_PART)?void 0:N.SIDEBAR_HIDDEN,this.isVisible(h.EDITOR_PART,C)?void 0:N.MAIN_EDITOR_AREA_HIDDEN,this.isVisible(h.PANEL_PART)?void 0:N.PANEL_HIDDEN,this.isVisible(h.AUXILIARYBAR_PART)?void 0:N.AUXILIARYBAR_HIDDEN,this.isVisible(h.STATUSBAR_PART)?void 0:N.STATUSBAR_HIDDEN,this.state.runtime.mainWindowFullscreen?N.FULLSCREEN:void 0])}setSideBarHidden(e){if(!(!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(h.SIDEBAR_PART))){if(this.stateModel.setRuntimeValue(d.SIDEBAR_HIDDEN,e),e?this.mainContainer.classList.add(N.SIDEBAR_HIDDEN):this.mainContainer.classList.remove(N.SIDEBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(T.Sidebar))this.paneCompositeService.hideActivePaneComposite(T.Sidebar),this.isAuxiliaryBarMaximized()||this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(T.Sidebar)){const t=this.paneCompositeService.getLastActivePaneCompositeId(T.Sidebar);t&&this.openViewContainer(T.Sidebar,t,!0)}this.workbenchGrid.setViewVisible(this.sideBarPartView,!e)}}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(!t)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i?i.activeViewDescriptors.length>=1:!1}adjustPartPositions(e,t,i){const s=!H(i),n=s||!(t==="center"||e===v.LEFT&&t==="right"||e===v.RIGHT&&t==="left"),r=s||!(t==="center"||e===v.RIGHT&&t==="right"||e===v.LEFT&&t==="left"),o=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).width:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumWidth),a=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).height:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumHeight),c=this.isVisible(h.SIDEBAR_PART)?this.workbenchGrid.getViewSize(this.sideBarPartView).width:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView)??this.sideBarPartView.minimumWidth),f=this.isVisible(h.AUXILIARYBAR_PART)?this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView)??this.auxiliaryBarPartView.minimumWidth),m=[h.PANEL_PART,h.SIDEBAR_PART,h.AUXILIARYBAR_PART].find(A=>this.hasFocus(A));e===v.LEFT?(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,0]),this.workbenchGrid.moveView(this.sideBarPartView,c,n?this.editorPartView:this.activityBarPartView,n?Z.Left:Z.Right),r?this.workbenchGrid.moveView(this.auxiliaryBarPartView,f,this.editorPartView,Z.Right):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,-1])):(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,-1]),this.workbenchGrid.moveView(this.sideBarPartView,c,n?this.editorPartView:this.activityBarPartView,n?Z.Right:Z.Left),r?this.workbenchGrid.moveView(this.auxiliaryBarPartView,f,this.editorPartView,Z.Left):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,0])),m&&this.focusPart(m),s&&(this.workbenchGrid.moveView(this.panelPartView,o,this.editorPartView,i===v.LEFT?Z.Left:Z.Right),this.workbenchGrid.resizeView(this.panelPartView,{height:a,width:o})),this.isVisible(h.SIDEBAR_PART)&&this.workbenchGrid.resizeView(this.sideBarPartView,{height:this.workbenchGrid.getViewSize(this.sideBarPartView).height,width:c}),this.isVisible(h.AUXILIARYBAR_PART)&&this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{height:this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).height,width:f})}setPanelAlignment(e){H(this.getPanelPosition())||this.setPanelPosition(v.BOTTOM),e!=="center"&&this.isPanelMaximized()&&this.toggleMaximizedPanel(),this.stateModel.setRuntimeValue(d.PANEL_ALIGNMENT,e),this.adjustPartPositions(this.getSideBarPosition(),e,this.getPanelPosition()),this._onDidChangePanelAlignment.fire(e)}setPanelHidden(e,t){if(!this.workbenchGrid||!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(h.PANEL_PART))return;const i=!this.isVisible(h.PANEL_PART);this.stateModel.setRuntimeValue(d.PANEL_HIDDEN,e);const s=this.isPanelMaximized(),n=this.panelOpensMaximized();e?this.mainContainer.classList.add(N.PANEL_HIDDEN):this.mainContainer.classList.remove(N.PANEL_HIDDEN);let r=!1;if(e&&this.paneCompositeService.getActivePaneComposite(T.Panel))this.paneCompositeService.hideActivePaneComposite(T.Panel),!js&&!this.isAuxiliaryBarMaximized()&&(r=!0);else if(!e&&!this.paneCompositeService.getActivePaneComposite(T.Panel)){let o=this.paneCompositeService.getLastActivePaneCompositeId(T.Panel);(!o||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(T.Panel).find(a=>this.hasViews(a.id))?.id),o&&this.openViewContainer(T.Panel,o,!t)}e&&s&&this.toggleMaximizedPanel(),i!==e&&(this.workbenchGrid.setViewVisible(this.panelPartView,!e),e?this.stateModel.setRuntimeValue(d.PANEL_WAS_LAST_MAXIMIZED,s):!t&&s!==n&&this.toggleMaximizedPanel(),r&&this.editorGroupService.mainPart.activeGroup.focus())}isAuxiliaryBarMaximized(){return this.stateModel.getRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED)}toggleMaximizedAuxiliaryBar(){this.setAuxiliaryBarMaximized(!this.isAuxiliaryBarMaximized())}setAuxiliaryBarMaximized(e){if(this.inMaximizedAuxiliaryBarTransition||e===this.isAuxiliaryBarMaximized())return!1;if(e){const t={sideBarVisible:this.isVisible(h.SIDEBAR_PART),editorVisible:this.isVisible(h.EDITOR_PART),panelVisible:this.isVisible(h.PANEL_PART),auxiliaryBarVisible:this.isVisible(h.AUXILIARYBAR_PART)};this.stateModel.setRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!0),this.inMaximizedAuxiliaryBarTransition=!0;try{t.auxiliaryBarVisible||this.setAuxiliaryBarHidden(!1);const i=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE,i),t.sideBarVisible&&this.setSideBarHidden(!0),t.panelVisible&&this.setPanelHidden(!0),t.editorVisible&&this.setEditorHidden(!0),this.stateModel.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY,t)}finally{this.inMaximizedAuxiliaryBarTransition=!1}}else{const t=de(this.stateModel.getRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY));this.stateModel.setRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!1),this.inMaximizedAuxiliaryBarTransition=!0;try{this.setEditorHidden(!t?.editorVisible),this.setPanelHidden(!t?.panelVisible),this.setSideBarHidden(!t?.sideBarVisible);const i=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView);this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:this.stateModel.getRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE),height:i.height})}finally{this.inMaximizedAuxiliaryBarTransition=!1}}return this.focusPart(h.AUXILIARYBAR_PART),this._onDidChangeAuxiliaryBarMaximized.fire(),!0}isPanelMaximized(){return(this.getPanelAlignment()==="center"||!H(this.getPanelPosition()))&&!this.isVisible(h.EDITOR_PART,C)&&!this.isAuxiliaryBarMaximized()}toggleMaximizedPanel(){const e=this.workbenchGrid.getViewSize(this.panelPartView),t=this.getPanelPosition(),i=!this.isPanelMaximized();i?(this.isVisible(h.PANEL_PART)&&(H(t)?this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT,e.height):this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH,e.width)),this.setEditorHidden(!0)):(this.setEditorHidden(!1),this.workbenchGrid.resizeView(this.panelPartView,{width:H(t)?e.width:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH),height:H(t)?this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT):e.height})),this.stateModel.setRuntimeValue(d.PANEL_WAS_LAST_MAXIMIZED,i)}panelOpensMaximized(){if(this.getPanelAlignment()!=="center"&&H(this.getPanelPosition()))return!1;const e=Ur(this.configurationService.getValue(Re.PANEL_OPENS_MAXIMIZED)),t=this.stateModel.getRuntimeValue(d.PANEL_WAS_LAST_MAXIMIZED);return e===Qs.ALWAYS||e===Qs.REMEMBER_LAST&&t}setAuxiliaryBarHidden(e,t){if(!(e&&this.setAuxiliaryBarMaximized(!1)&&!this.isVisible(h.AUXILIARYBAR_PART))){if(this.stateModel.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,e),e?this.mainContainer.classList.add(N.AUXILIARYBAR_HIDDEN):this.mainContainer.classList.remove(N.AUXILIARYBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(T.AuxiliaryBar))this.paneCompositeService.hideActivePaneComposite(T.AuxiliaryBar),this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(T.AuxiliaryBar)){let i=this.paneCompositeService.getLastActivePaneCompositeId(T.AuxiliaryBar);(!i||!this.hasViews(i))&&(i=this.viewDescriptorService.getViewContainersByLocation(T.AuxiliaryBar).find(s=>this.hasViews(s.id))?.id),i&&this.openViewContainer(T.AuxiliaryBar,i,!t)}this.workbenchGrid.setViewVisible(this.auxiliaryBarPartView,!e)}}setPartHidden(e,t){switch(t){case h.ACTIVITYBAR_PART:return this.setActivityBarHidden(e);case h.SIDEBAR_PART:return this.setSideBarHidden(e);case h.EDITOR_PART:return this.setEditorHidden(e);case h.BANNER_PART:return this.setBannerHidden(e);case h.AUXILIARYBAR_PART:return this.setAuxiliaryBarHidden(e);case h.PANEL_PART:return this.setPanelHidden(e)}}hasMainWindowBorder(){return this.state.runtime.mainWindowBorder}getMainWindowBorderRadius(){return this.state.runtime.mainWindowBorder&&pe?"10px":void 0}getSideBarPosition(){return this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)}getPanelAlignment(){return this.stateModel.getRuntimeValue(d.PANEL_ALIGNMENT)}updateMenubarVisibility(e){const t=Fe(this.configurationService,C,this.state.runtime.menuBar.toggled);!e&&this.workbenchGrid&&t!==this.isVisible(h.TITLEBAR_PART,C)&&this.workbenchGrid.setViewVisible(this.titleBarPartView,t)}updateCustomTitleBarVisibility(){const e=Fe(this.configurationService,C,this.state.runtime.menuBar.toggled),t=this.isVisible(h.TITLEBAR_PART);e!==t&&this.workbenchGrid.setViewVisible(this.titleBarPartView,e)}toggleMenuBar(){let e=Yi(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=Xi(this.configurationService)?"toggle":"compact":t="classic",this.configurationService.updateValue(Gs.MenuBarVisibility,t)}getPanelPosition(){return this.stateModel.getRuntimeValue(d.PANEL_POSITION)}setPanelPosition(e){this.isVisible(h.PANEL_PART)||this.setPanelHidden(!1);const t=this.getPart(h.PANEL_PART),i=St(this.getPanelPosition()),s=St(e),n=de(t.getContainer());n.classList.remove(i),n.classList.add(s),t.updateStyles();const r=this.workbenchGrid.getViewSize(this.panelPartView),o=this.workbenchGrid.getViewSize(this.sideBarPartView),a=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView);let c=!this.isVisible(h.EDITOR_PART,C);s!==i&&!c&&(H(e)?this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH,r.width):H(ti(i))&&this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT,r.height)),H(e)&&this.getPanelAlignment()!=="center"&&c&&(this.toggleMaximizedPanel(),c=!1),this.stateModel.setRuntimeValue(d.PANEL_POSITION,e);const f=this.isVisible(h.SIDEBAR_PART),m=this.isVisible(h.AUXILIARYBAR_PART),A=this.hasFocus(h.PANEL_PART);e===v.BOTTOM?this.workbenchGrid.moveView(this.panelPartView,c?r.height:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,Z.Down):e===v.TOP?this.workbenchGrid.moveView(this.panelPartView,c?r.height:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,Z.Up):e===v.RIGHT?this.workbenchGrid.moveView(this.panelPartView,c?r.width:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,Z.Right):this.workbenchGrid.moveView(this.panelPartView,c?r.width:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,Z.Left),A&&this.focusPart(h.PANEL_PART),this.workbenchGrid.resizeView(this.sideBarPartView,o),f||this.setSideBarHidden(!0),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,a),m||this.setAuxiliaryBarHidden(!0),H(e)&&this.adjustPartPositions(this.getSideBarPosition(),this.getPanelAlignment(),e),this._onDidChangePanelPosition.fire(s)}isWindowMaximized(e){return this.state.runtime.maximized.has(Zi(e))}updateWindowMaximizedState(e,t){this.mainContainer.classList.toggle(N.MAXIMIZED,t);const i=Zi(e);t!==this.state.runtime.maximized.has(i)&&(t?this.state.runtime.maximized.add(i):this.state.runtime.maximized.delete(i),this.updateWindowBorder(),this._onDidChangeWindowMaximized.fire({windowId:i,maximized:t}))}getVisibleNeighborPart(e,t){if(!this.workbenchGrid||!this.isVisible(e,C))return;const i=this.workbenchGrid.getNeighborViews(this.getPart(e),t,!1);if(i)for(const s of i){const n=[h.ACTIVITYBAR_PART,h.EDITOR_PART,h.PANEL_PART,h.AUXILIARYBAR_PART,h.SIDEBAR_PART,h.STATUSBAR_PART,h.TITLEBAR_PART].find(r=>this.getPart(r)===s&&this.isVisible(r,C));if(n!==void 0)return n}}onDidChangeWCO(){const e=this.workbenchGrid.getNeighborViews(this.titleBarPartView,Z.Up,!1).length>0,t=this.shouldShowBannerFirst();e!==t&&this.workbenchGrid.moveView(this.bannerPartView,Dt.Distribute,this.titleBarPartView,t?Z.Up:Z.Down),this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled))}arrangeEditorNodes(e,t,i){if(!e.sideBar&&!e.auxiliaryBar)return e.editor.size=t,e.editor;const s=[e.editor];return e.editor.size=i,e.sideBar&&(this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)===v.LEFT?s.splice(0,0,e.sideBar):s.push(e.sideBar),e.editor.size-=this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)?0:e.sideBar.size),e.auxiliaryBar&&(this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)===v.RIGHT?s.splice(0,0,e.auxiliaryBar):s.push(e.auxiliaryBar),e.editor.size-=this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size),{type:"branch",data:s,size:t,visible:s.some(n=>n.visible)}}arrangeMiddleSectionNodes(e,t,i){const s=this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN)?0:e.activityBar.size,n=this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)?0:e.sideBar.size,r=this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size,o=this.stateModel.getInitializationValue(d.PANEL_SIZE)?0:e.panel.size,a=this.stateModel.getRuntimeValue(d.PANEL_POSITION),c=this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON),f=[];if(!H(a))f.push(e.editor),e.editor.size=t-s-n-o-r,a===v.RIGHT?f.push(e.panel):f.splice(0,0,e.panel),c===v.LEFT?(f.push(e.auxiliaryBar),f.splice(0,0,e.sideBar),f.splice(0,0,e.activityBar)):(f.splice(0,0,e.auxiliaryBar),f.push(e.sideBar),f.push(e.activityBar));else{const m=this.stateModel.getRuntimeValue(d.PANEL_ALIGNMENT),A=!(m==="center"||c===v.LEFT&&m==="right"||c===v.RIGHT&&m==="left"),S=!(m==="center"||c===v.RIGHT&&m==="right"||c===v.LEFT&&m==="left"),x=t-s-(A?0:n)-(S?0:r),G=this.arrangeEditorNodes({editor:e.editor,sideBar:A?e.sideBar:void 0,auxiliaryBar:S?e.auxiliaryBar:void 0},i-o,x),ve=a===v.BOTTOM?[G,e.panel]:[e.panel,G];f.push({type:"branch",data:ve,size:x,visible:ve.some(He=>He.visible)}),A||(c===v.LEFT?f.splice(0,0,e.sideBar):f.push(e.sideBar)),S||(c===v.RIGHT?f.splice(0,0,e.auxiliaryBar):f.push(e.auxiliaryBar)),c===v.LEFT?f.splice(0,0,e.activityBar):f.push(e.activityBar)}return f}createGridDescriptor(){const{width:e,height:t}=this._mainContainerDimension,i=this.stateModel.getInitializationValue(d.SIDEBAR_SIZE),s=this.stateModel.getInitializationValue(d.AUXILIARYBAR_SIZE),n=this.stateModel.getInitializationValue(d.PANEL_SIZE),r=this.titleBarPartView.minimumHeight,o=this.bannerPartView.minimumHeight,a=this.statusBarPartView.minimumHeight,c=this.activityBarPartView.minimumWidth,f=t-r-a,m=[{type:"leaf",data:{type:h.TITLEBAR_PART},size:r,visible:this.isVisible(h.TITLEBAR_PART,C)},{type:"leaf",data:{type:h.BANNER_PART},size:o,visible:!1}],A={type:"leaf",data:{type:h.ACTIVITYBAR_PART},size:c,visible:!this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN)},S={type:"leaf",data:{type:h.SIDEBAR_PART},size:i,visible:!this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)},x={type:"leaf",data:{type:h.AUXILIARYBAR_PART},size:s,visible:this.isVisible(h.AUXILIARYBAR_PART)},G={type:"leaf",data:{type:h.EDITOR_PART},size:0,visible:!this.stateModel.getRuntimeValue(d.EDITOR_HIDDEN)},ve={type:"leaf",data:{type:h.PANEL_PART},size:n,visible:!this.stateModel.getRuntimeValue(d.PANEL_HIDDEN)},He=this.arrangeMiddleSectionNodes({activityBar:A,auxiliaryBar:x,editor:G,panel:ve,sideBar:S},e,f),Vi={root:{type:"branch",size:e,data:[...this.shouldShowBannerFirst()?m.reverse():m,{type:"branch",data:He,size:f},{type:"leaf",data:{type:h.STATUSBAR_PART},size:a,visible:!this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN)}]},orientation:Yr.VERTICAL,width:e,height:t},Xn={activityBarVisible:!this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN),sideBarVisible:!this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN),auxiliaryBarVisible:!this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN),panelVisible:!this.stateModel.getRuntimeValue(d.PANEL_HIDDEN),statusbarVisible:!this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN),sideBarPosition:St(this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)),panelPosition:St(this.stateModel.getRuntimeValue(d.PANEL_POSITION))};return this.telemetryService.publicLog2("startupLayout",Xn),Vi}dispose(){super.dispose(),this.disposed=!0}}function An(l){return l.getValue(Re.ZEN_MODE_CONFIG)}class Kn{constructor(e,t,i,s){this.name=e,this.scope=t,this.target=i,this.defaultValue=s}}class M extends Kn{constructor(e,t,i,s,n){super(e,t,i,s),this.zenModeIgnore=n,this.runtime=!0}}class Fi extends Kn{constructor(){super(...arguments),this.runtime=!1}}const d={MAIN_EDITOR_CENTERED:new M("editor.centered",p.WORKSPACE,D.MACHINE,!1),ZEN_MODE_ACTIVE:new M("zenMode.active",p.WORKSPACE,D.MACHINE,!1),ZEN_MODE_EXIT_INFO:new M("zenMode.exitInfo",p.WORKSPACE,D.MACHINE,{transitionedToCenteredEditorLayout:!1,transitionedToFullScreen:!1,handleNotificationsDoNotDisturbMode:!1,wasVisible:{auxiliaryBar:!1,panel:!1,sideBar:!1}}),SIDEBAR_SIZE:new Fi("sideBar.size",p.PROFILE,D.MACHINE,300),AUXILIARYBAR_SIZE:new Fi("auxiliaryBar.size",p.PROFILE,D.MACHINE,300),PANEL_SIZE:new Fi("panel.size",p.PROFILE,D.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_HEIGHT:new M("panel.lastNonMaximizedHeight",p.PROFILE,D.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_WIDTH:new M("panel.lastNonMaximizedWidth",p.PROFILE,D.MACHINE,300),PANEL_WAS_LAST_MAXIMIZED:new M("panel.wasLastMaximized",p.WORKSPACE,D.MACHINE,!1),AUXILIARYBAR_WAS_LAST_MAXIMIZED:new M("auxiliaryBar.wasLastMaximized",p.WORKSPACE,D.MACHINE,!1),AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE:new M("auxiliaryBar.lastNonMaximizedSize",p.PROFILE,D.MACHINE,300),AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY:new M("auxiliaryBar.lastNonMaximizedVisibility",p.WORKSPACE,D.MACHINE,{sideBarVisible:!1,editorVisible:!1,panelVisible:!1,auxiliaryBarVisible:!1}),SIDEBAR_POSITON:new M("sideBar.position",p.WORKSPACE,D.MACHINE,v.LEFT),PANEL_POSITION:new M("panel.position",p.WORKSPACE,D.MACHINE,v.BOTTOM),PANEL_ALIGNMENT:new M("panel.alignment",p.PROFILE,D.USER,"center"),ACTIVITYBAR_HIDDEN:new M("activityBar.hidden",p.WORKSPACE,D.MACHINE,!1,!0),SIDEBAR_HIDDEN:new M("sideBar.hidden",p.WORKSPACE,D.MACHINE,!1),EDITOR_HIDDEN:new M("editor.hidden",p.WORKSPACE,D.MACHINE,!1),PANEL_HIDDEN:new M("panel.hidden",p.WORKSPACE,D.MACHINE,!0),AUXILIARYBAR_HIDDEN:new M("auxiliaryBar.hidden",p.WORKSPACE,D.MACHINE,!0),STATUSBAR_HIDDEN:new M("statusBar.hidden",p.WORKSPACE,D.MACHINE,!1,!0)};var Re;(function(l){l.AUXILIARYBAR_DEFAULT_VISIBILITY="workbench.secondarySideBar.defaultVisibility",l.ACTIVITY_BAR_VISIBLE="workbench.activityBar.visible",l.PANEL_POSITION="workbench.panel.defaultLocation",l.PANEL_OPENS_MAXIMIZED="workbench.panel.opensMaximized",l.ZEN_MODE_CONFIG="zenMode",l.EDITOR_CENTERED_LAYOUT_AUTO_RESIZE="workbench.editor.centeredLayoutAutoResize"})(Re||(Re={}));var se;(function(l){l.STATUSBAR_VISIBLE="workbench.statusBar.visible",l.SIDEBAR_POSITION="workbench.sideBar.location"})(se||(se={}));const Ct=class Ct extends te{constructor(e,t,i,s,n,r){super(),this.storageService=e,this.configurationService=t,this.contextService=i,this.coreExperimentationService=s,this.environmentService=n,this.viewDescriptorService=r,this._onDidChangeState=this._register(new E),this.onDidChangeState=this._onDidChangeState.event,this.stateCache=new Map,this.isNew={[p.WORKSPACE]:this.storageService.isNew(p.WORKSPACE),[p.PROFILE]:this.storageService.isNew(p.PROFILE),[p.APPLICATION]:this.storageService.isNew(p.APPLICATION)},this._register(this.configurationService.onDidChangeConfiguration(o=>this.updateStateFromLegacySettings(o)))}updateStateFromLegacySettings(e){e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&this.setRuntimeValueAndFire(d.ACTIVITYBAR_HIDDEN,this.isActivityBarHidden()),e.affectsConfiguration(se.STATUSBAR_VISIBLE)&&this.setRuntimeValueAndFire(d.STATUSBAR_HIDDEN,!this.configurationService.getValue(se.STATUSBAR_VISIBLE)),e.affectsConfiguration(se.SIDEBAR_POSITION)&&this.setRuntimeValueAndFire(d.SIDEBAR_POSITON,ti(this.configurationService.getValue(se.SIDEBAR_POSITION)??"left"))}updateLegacySettingsFromState(e,t){const i=this.getRuntimeValue(d.ZEN_MODE_ACTIVE);e.zenModeIgnore&&i||(e===d.ACTIVITYBAR_HIDDEN?this.configurationService.updateValue(_.ACTIVITY_BAR_LOCATION,t?Me.HIDDEN:void 0):e===d.STATUSBAR_HIDDEN?this.configurationService.updateValue(se.STATUSBAR_VISIBLE,!t):e===d.SIDEBAR_POSITON&&this.configurationService.updateValue(se.SIDEBAR_POSITION,St(t)))}load(e){let t;if(!e.resetLayout)for(t in d){const n=d[t],r=this.loadKeyFromStorage(n);r!==void 0&&this.stateCache.set(n.name,r)}this.stateCache.set(d.ACTIVITYBAR_HIDDEN.name,this.isActivityBarHidden()),this.stateCache.set(d.STATUSBAR_HIDDEN.name,!this.configurationService.getValue(se.STATUSBAR_VISIBLE)),this.stateCache.set(d.SIDEBAR_POSITON.name,ti(this.configurationService.getValue(se.SIDEBAR_POSITION)??"left"));const i=this.contextService.getWorkbenchState(),s=e.mainContainerDimension;d.SIDEBAR_SIZE.defaultValue=Math.min(300,s.width/4),d.SIDEBAR_HIDDEN.defaultValue=i===Oe.EMPTY,d.AUXILIARYBAR_SIZE.defaultValue=Math.min(300,s.width/4),d.AUXILIARYBAR_HIDDEN.defaultValue=(()=>{const n=this.configurationService.inspect(Re.AUXILIARYBAR_DEFAULT_VISIBILITY);if(n.defaultValue!=="hidden"&&!Xr(n)){if(le&&!this.environmentService.remoteAuthority)return!0;const r=this.storageService.getObject("chat.setupContext",p.PROFILE);if(r&&(r.installed&&r.disabled||!r.installed&&r.hidden))return!0;const o=this.viewDescriptorService.getViewLocationById("workbench.panel.chat.view.copilot");if(o===T.Sidebar||o===T.Panel)return!0}switch(this.configurationService.getValue(Re.AUXILIARYBAR_DEFAULT_VISIBILITY)){case"maximized":case"visible":return!1;case"visibleInWorkspace":case"maximizedInWorkspace":return i===Oe.EMPTY;default:return!0}})(),d.PANEL_SIZE.defaultValue=this.stateCache.get(d.PANEL_POSITION.name)??H(d.PANEL_POSITION.defaultValue)?s.height/3:s.width/4,d.PANEL_POSITION.defaultValue=ti(this.configurationService.getValue(Re.PANEL_POSITION)??"bottom");for(t in d){const n=d[t];this.stateCache.get(n.name)===void 0&&this.stateCache.set(n.name,n.defaultValue)}this.applyOverrides(e),this._register(this.storageService.onDidChangeValue(p.PROFILE,void 0,this._store)(n=>{let r;for(r in d){const o=d[r];if(o instanceof M&&o.scope===p.PROFILE&&o.target===D.USER&&`${Ct.STORAGE_PREFIX}${o.name}`===n.key){const a=this.loadKeyFromStorage(o)??o.defaultValue;this.stateCache.get(o.name)!==a&&(this.stateCache.set(o.name,a),this._onDidChangeState.fire({key:o,value:a}))}}}))}applyOverrides(e){const t=new Zr(()=>{try{return this.coreExperimentationService.getExperiment()}catch{return}});if(this.storageService.isNew(p.APPLICATION)&&this.contextService.getWorkbenchState()===Oe.EMPTY&&(t.value?.experimentGroup===Y.MaximizedChat||t.value?.experimentGroup===Y.SplitEmptyEditorChat||t.value?.experimentGroup===Y.SplitWelcomeChat)){if(t.value.experimentGroup===Y.MaximizedChat)this.applyAuxiliaryBarMaximizedOverride();else if(t.value.experimentGroup===Y.SplitEmptyEditorChat||t.value.experimentGroup===Y.SplitWelcomeChat){const i=e.mainContainerDimension;this.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,!1),this.setInitializationValue(d.AUXILIARYBAR_SIZE,Math.ceil(i.width/(1.618*1.618)))}}else if(this.isNew[p.WORKSPACE]){const i=this.configurationService.getValue(Re.AUXILIARYBAR_DEFAULT_VISIBILITY);(i==="maximized"||i==="maximizedInWorkspace"&&this.contextService.getWorkbenchState()!==Oe.EMPTY)&&this.applyAuxiliaryBarMaximizedOverride()}this.getRuntimeValue(d.PANEL_HIDDEN)&&this.getRuntimeValue(d.EDITOR_HIDDEN)&&!this.getRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED)&&this.setRuntimeValue(d.EDITOR_HIDDEN,!1)}applyAuxiliaryBarMaximizedOverride(){this.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY,{sideBarVisible:!this.getRuntimeValue(d.SIDEBAR_HIDDEN),panelVisible:!this.getRuntimeValue(d.PANEL_HIDDEN),editorVisible:!this.getRuntimeValue(d.EDITOR_HIDDEN),auxiliaryBarVisible:!this.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)}),this.setRuntimeValue(d.SIDEBAR_HIDDEN,!0),this.setRuntimeValue(d.PANEL_HIDDEN,!0),this.setRuntimeValue(d.EDITOR_HIDDEN,!0),this.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,!1),this.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE,this.getInitializationValue(d.AUXILIARYBAR_SIZE)),this.setRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!0)}save(e,t){let i;const s=this.getRuntimeValue(d.ZEN_MODE_ACTIVE);for(i in d){const n=d[i];if(e&&n.scope===p.WORKSPACE||t&&n.scope===p.PROFILE){if(s&&n instanceof M&&n.zenModeIgnore)continue;this.saveKeyToStorage(n)}}}getInitializationValue(e){return this.stateCache.get(e.name)}setInitializationValue(e,t){this.stateCache.set(e.name,t)}getRuntimeValue(e,t){if(t)switch(e){case d.ACTIVITYBAR_HIDDEN:this.stateCache.set(e.name,this.isActivityBarHidden());break;case d.STATUSBAR_HIDDEN:this.stateCache.set(e.name,!this.configurationService.getValue(se.STATUSBAR_VISIBLE));break;case d.SIDEBAR_POSITON:this.stateCache.set(e.name,this.configurationService.getValue(se.SIDEBAR_POSITION)??"left");break}return this.stateCache.get(e.name)}setRuntimeValue(e,t){this.stateCache.set(e.name,t);const i=this.getRuntimeValue(d.ZEN_MODE_ACTIVE);e.scope===p.PROFILE&&(!i||!e.zenModeIgnore)&&(this.saveKeyToStorage(e),this.updateLegacySettingsFromState(e,t))}isActivityBarHidden(){const e=this.configurationService.getValue(Re.ACTIVITY_BAR_VISIBLE);return e!==void 0?!e:this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION)!==Me.DEFAULT}setRuntimeValueAndFire(e,t){this.stateCache.get(e.name)!==t&&(this.setRuntimeValue(e,t),this._onDidChangeState.fire({key:e,value:t}))}saveKeyToStorage(e){const t=this.stateCache.get(e.name);this.storageService.store(`${Ct.STORAGE_PREFIX}${e.name}`,typeof t=="object"?JSON.stringify(t):t,e.scope,e.target)}loadKeyFromStorage(e){const t=this.storageService.get(`${Ct.STORAGE_PREFIX}${e.name}`,e.scope);if(t!==void 0)switch(this.isNew[e.scope]=!1,typeof e.defaultValue){case"boolean":return t==="true";case"number":return parseInt(t);case"object":return JSON.parse(t)}return t}};Ct.STORAGE_PREFIX="workbench.";let fs=Ct;const Ic=5e3;let gs=class extends te{constructor(e,t,i){super(),this._accessibilitySignalService=i,this._scheduler=new Vn(()=>{this._signalLoop=this._accessibilitySignalService.playSignalLoop(vi.progress,t??Ic)},e),this._scheduler.schedule()}dispose(){super.dispose(),this._signalLoop?.dispose(),this._scheduler.dispose()}};gs=y([u(2,yi)],gs);class Cc{constructor(){this.priority=90,this.name="notifications",this.when=ge,this.type=tn.View}getProvider(e){const t=e.get($r),i=e.get(pt),s=e.get(Te),n=e.get(yi);function r(){const o=Ue(i);if(!o)return;s.executeCommand("notifications.showList");let a;const c=i.lastFocusedList;if(c instanceof Os&&(a=c.indexOf(o)),a===void 0)return;function f(){if(s.executeCommand("notifications.showList"),c&&a!==void 0){c.domFocus();try{c.setFocus([a])}catch{}}}function m(){const S=Ue(i),x=S?.message.original.toString();if(!(!S||!x))return Gt(S.source?g(3424,"{0} Source: {1}",x,S.source):x,S.severity)}const A=m();if(A)return o.onDidClose(()=>t.next()),new qr(jr.Notification,{type:tn.View},()=>A,()=>f(),"accessibility.verbosity.notification",void 0,bc(o,n),()=>{if(c)return f(),c.focusNext(),m()},()=>{if(c)return f(),c.focusPrevious(),m()})}return r()}}function bc(l,e){let t;if(l.actions&&(t=[],l.actions.primary&&t.push(...l.actions.primary),l.actions.secondary&&t.push(...l.actions.secondary)),t)for(const s of t){s.class=W.asClassName(J.bell);const n=s.run;s.run=()=>{n(),l.close()}}const i=t?.find(s=>s.label.includes("Manage Extension"));return i&&(i.class=W.asClassName(J.gear)),t&&t.push({id:"clearNotification",label:g(3425,"Clear Notification"),tooltip:g(3425,"Clear Notification"),run:()=>{l.close(),e.playSignal(vi.clear)},enabled:!0,class:W.asClassName(J.clearAll)}),t}class Ec extends Sc{constructor(e,t,i,s){super(e,{resetLayout:!!t?.resetLayout}),this.options=t,this.serviceCollection=i,this._onWillShutdown=this._register(new E),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new E),this.onDidShutdown=this._onDidShutdown.event,this.previousUnexpectedError={message:void 0,time:0},k("code/willStartWorkbench"),this.registerErrorHandler(s),this.parent.appendChild(this.mainContainer)}registerErrorHandler(e){C.addEventListener("unhandledrejection",t=>{ii(t.reason),t.preventDefault()}),Bn(t=>this.handleUnexpectedError(t,e))}handleUnexpectedError(e,t){const i=qt(e,!0);if(!i)return;const s=Date.now();i===this.previousUnexpectedError.message&&s-this.previousUnexpectedError.time<=1e3||(this.previousUnexpectedError.time=s,this.previousUnexpectedError.message=i,t.error(i))}startup(){try{this._register(Jr(175));const e=this.initServices(this.serviceCollection);return e.invokeFunction(t=>{const i=t.get(li),s=t.get(he),n=t.get(ee),r=t.get(_t),o=t.get(Qr),a=t.get(Pe);this.initLayout(t),this.registerListeners(i,s,n,r,o),this.renderWorkbench(e,a,s,n),this.createWorkbenchLayout(),this.layout(),this.restore(i)}),e}catch(e){throw ii(e),e}}initServices(e){e.set(ce,this);const t=eo();for(const[s,n]of t)e.set(s,n);const i=new to(e,!0);return i.invokeFunction(s=>{const n=s.get(li),r=s.get(ee);typeof r.acquireInstantiationService=="function"&&r.acquireInstantiationService(i),n.phase=Vt.Ready}),i}registerListeners(e,t,i,s,n){this._register(i.onDidChangeConfiguration(r=>this.updateFontAliasing(r,i))),si?this._register(t.onWillSaveState(r=>{r.reason===io.SHUTDOWN&&this.storeFontInfo(t)})):this._register(e.onWillShutdown(()=>this.storeFontInfo(t))),this._register(e.onWillShutdown(r=>this._onWillShutdown.fire(r))),this._register(e.onDidShutdown(()=>{this._onDidShutdown.fire(),this.dispose()})),this._register(s.onDidChangeFocus(r=>{r||t.flush()})),this._register(n.onWillShowDialog(()=>this.mainContainer.classList.add("modal-dialog-visible"))),this._register(n.onDidShowDialog(()=>this.mainContainer.classList.remove("modal-dialog-visible")))}updateFontAliasing(e,t){if(!pe||e&&!e.affectsConfiguration("workbench.fontAliasing"))return;const i=t.getValue("workbench.fontAliasing");if(this.fontAliasing===i)return;this.fontAliasing=i;const s=["antialiased","none","auto"];this.mainContainer.classList.remove(...s.map(n=>`monaco-font-aliasing-${n}`)),s.some(n=>n===i)&&this.mainContainer.classList.add(`monaco-font-aliasing-${i}`)}restoreFontInfo(e,t){const i=e.get("editorFontInfo",p.APPLICATION);if(i)try{const s=JSON.parse(i);Array.isArray(s)&&Oi.restoreFontInfo(C,s)}catch{}Oi.readFontInfo(C,so.createFromRawSettings(t.getValue("editor"),no.getInstance(C).value))}storeFontInfo(e){const t=Oi.serializeFontInfo(C);t&&e.store("editorFontInfo",JSON.stringify(t),p.APPLICATION,D.MACHINE)}renderWorkbench(e,t,i,s){ro(this.mainContainer),oo((o,a)=>e.createInstance(gs,o,a));const r=Pt(["monaco-workbench",Et?"windows":Ut?"linux":"mac",le?"web":void 0,ao?"chromium":co?"firefox":ho?"safari":void 0,...this.getLayoutClasses(),...this.options?.extraClasses?this.options.extraClasses:[]]);this.mainContainer.classList.add(...r),this.updateFontAliasing(void 0,s),this.restoreFontInfo(i,s);for(const{id:o,role:a,classes:c,options:f}of[{id:h.TITLEBAR_PART,role:"none",classes:["titlebar"]},{id:h.BANNER_PART,role:"banner",classes:["banner"]},{id:h.ACTIVITYBAR_PART,role:"none",classes:["activitybar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.SIDEBAR_PART,role:"none",classes:["sidebar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.EDITOR_PART,role:"main",classes:["editor"],options:{restorePreviousState:this.willRestoreEditors()}},{id:h.PANEL_PART,role:"none",classes:["panel","basepanel",St(this.getPanelPosition())]},{id:h.AUXILIARYBAR_PART,role:"none",classes:["auxiliarybar","basepanel",this.getSideBarPosition()===v.LEFT?"right":"left"]},{id:h.STATUSBAR_PART,role:"status",classes:["statusbar"]}]){const m=this.createPart(o,a,c);k(`code/willCreatePart/${o}`),this.getPart(o).create(m,f),k(`code/didCreatePart/${o}`)}this.createNotificationsHandlers(e,t)}createPart(e,t,i){const s=zt(t==="status"?"footer":"div");return s.classList.add("part",...i),s.id=e,s.setAttribute("role",t),t==="status"&&s.setAttribute("aria-live","off"),s}createNotificationsHandlers(e,t){const i=this._register(e.createInstance(hs,this.mainContainer,t.model)),s=this._register(e.createInstance(ds,this.mainContainer,t.model));this._register(e.createInstance(fc,t.model));const n=e.createInstance(ls,t.model);this._register(i.onDidChangeVisibility(()=>{n.update(i.isVisible,s.isVisible),s.update(i.isVisible)})),this._register(s.onDidChangeVisibility(()=>{n.update(i.isVisible,s.isVisible)})),rc(i,s,t.model),lo.register(new Cc),this.registerNotifications({onDidChangeNotificationsVisibility:me.map(me.any(s.onDidChangeVisibility,i.onDidChangeVisibility),()=>s.isVisible||i.isVisible)})}restore(e){try{this.restoreParts()}catch(t){ii(t)}this.whenReady.finally(()=>Promise.race([this.whenRestored,uo(2e3)]).finally(()=>{function t(){k("code/didStartWorkbench"),performance.measure("perf: workbench create & restore","code/didLoadWorkbenchMain","code/didStartWorkbench")}this.isRestored()?t():this.whenRestored.finally(()=>t()),e.phase=Vt.Restored,this._register(new Vn(()=>{this._register(fo(C,()=>e.phase=Vt.Eventually,2500))},2500)).schedule()}))}}const Tc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ms;let ps=class{constructor(e,t,i,s){this._disposables=new L,this._onDidChangeVisibility=this._disposables.add(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.element=zt("div"),this.element.classList.add("command-center");const n=i.createInstance(go,this.element,R.CommandCenter,{contextMenu:R.TitleBarContext,hiddenItemStrategy:Ln.NoHide,toolbarOptions:{primaryGroup:()=>!0},telemetrySource:"commandCenter",actionViewItemProvider:(r,o)=>r instanceof mo&&r.item.submenu===R.CommandCenterCenter?i.createInstance(As,r,e,{...o,hoverDelegate:t}):zs(i,r,{...o,hoverDelegate:t})});this._disposables.add(me.filter(s.onShow,()=>Nn(this.element),this._disposables)(this._setVisibility.bind(this,!1))),this._disposables.add(s.onHide(this._setVisibility.bind(this,!0))),this._disposables.add(n)}_setVisibility(e){this.element.classList.toggle("hide",!e),this._onDidChangeVisibility.fire()}dispose(){this._disposables.dispose()}};ps=y([u(2,O),u(3,Tn)],ps);var st;let As=(st=class extends sn{constructor(e,t,i,s,n,r,o){super(void 0,e.actions.find(a=>a.id==="workbench.action.quickOpenWithModes")??e.actions[0],i),this._submenu=e,this._windowTitle=t,this._hoverService=s,this._keybindingService=n,this._instaService=r,this._editorGroupService=o,this._hoverDelegate=i.hoverDelegate??Gi("mouse")}render(e){super.render(e),e.classList.add("command-center-center"),e.classList.toggle("multiple",this._submenu.actions.length>1);const t=this._store.add(this._hoverService.setupManagedHover(this._hoverDelegate,e,this.getTooltip()));this._store.add(this._windowTitle.onDidChange(()=>{t.update(this.getTooltip())}));const i=[];for(const s of this._submenu.actions)s instanceof po?i.push(s.actions):i.push([s]);for(let s=0;s<i.length;s++){const n=i[s],r=this._instaService.createInstance(Mn,e,{hiddenItemStrategy:Ln.NoHide,telemetrySource:"commandCenterCenter",actionViewItemProvider:(o,a)=>{if(a={...a,hoverDelegate:this._hoverDelegate},o.id!==ms._quickOpenCommandId)return zs(this._instaService,o,a);const c=this;return this._instaService.createInstance(class extends sn{constructor(){super(void 0,o,a)}render(m){super.render(m),m.classList.toggle("command-center-quick-pick"),m.role="button";const A=this.action,S=zt("span");S.ariaHidden="true",S.className=A.class??"",S.classList.add("search-icon");const x=this._getLabel(),G=zt("span");G.classList.add("search-label"),G.innerText=x,$i(m,S,G);const ve=this._store.add(c._hoverService.setupManagedHover(c._hoverDelegate,m,this.getTooltip()));this._store.add(c._windowTitle.onDidChange(()=>{ve.update(this.getTooltip()),G.innerText=this._getLabel()})),this._store.add(c._editorGroupService.onDidChangeEditorPartOptions(({newPartOptions:He,oldPartOptions:Vi})=>{He.showTabs!==Vi.showTabs&&(ve.update(this.getTooltip()),G.innerText=this._getLabel())}))}getTooltip(){return c.getTooltip()}_getLabel(){const{prefix:m,suffix:A}=c._windowTitle.getTitleDecorations();let S=c._windowTitle.workspaceName;return c._windowTitle.isCustomTitleFormat()?S=c._windowTitle.getWindowTitle():c._editorGroupService.partOptions.showTabs==="none"&&(S=c._windowTitle.fileName??S),S||(S=g(3544,"Search")),m&&(S=g(3545,"{0} {1}",m,S)),A&&(S=g(3546,"{0} {1}",S,A)),S.replaceAll(/\r\n|\r|\n/g,"⏎")}})}});if(r.setActions(n),this._store.add(r),s<i.length-1){const o=qi(J.circleSmallFilled);o.style.padding="0 12px",o.style.height="100%",o.style.opacity="0.5",e.appendChild(o)}}}getTooltip(){const e=this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();return e?g(3547,"Search {0} ({1}) — {2}",this._windowTitle.workspaceName,e,this._windowTitle.value):g(3548,"Search {0} — {1}",this._windowTitle.workspaceName,this._windowTitle.value)}},ms=st,st._quickOpenCommandId="workbench.action.quickOpenWithModes",st);As=ms=y([u(3,Fs),u(4,ut),u(5,O),u(6,ft)],As);Be.appendMenuItem(R.CommandCenter,{submenu:R.CommandCenterCenter,title:g(3549,"Command Center"),icon:J.shield,order:101});class Xs extends Ce{constructor(e,t,i,s,n){super({id:`toggle.${e}`,title:t,metadata:i?{description:i}:void 0,toggled:P.equals(`config.${e}`,!0),menu:[{id:R.TitleBarContext,when:n,order:s,group:"2_config"},{id:R.TitleBarTitleContext,when:n,order:s,group:"2_config"}]}),this.section=e}run(e,...t){const i=e.get(ee),s=i.getValue(this.section);i.updateValue(this.section,!s)}}fe(class extends Xs{constructor(){super(_.COMMAND_CENTER,g(3568,"Command Center"),g(3569,"Toggle visibility of the Command Center in title bar"),1,Us.toNegated())}});fe(class extends Xs{constructor(){super("workbench.navigationControl.enabled",g(3570,"Navigation Controls"),g(3571,"Toggle visibility of the Navigation Controls in title bar"),2,P.and(Us.toNegated(),P.has("config.window.commandCenter")))}});fe(class extends Xs{constructor(){super(_.LAYOUT_ACTIONS,g(3572,"Layout Controls"),g(3573,"Toggle visibility of the Layout Controls in title bar"),4)}});fe(class extends Ce{constructor(){super({id:`toggle.${X.CUSTOM_TITLE_BAR_VISIBILITY}`,title:g(3574,"Hide Custom Title Bar"),menu:[{id:R.TitleBarContext,order:0,when:P.equals(Qi.key,es.NATIVE),group:"3_toggle"},{id:R.TitleBarTitleContext,order:0,when:P.equals(Qi.key,es.NATIVE),group:"3_toggle"}]})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER)}});fe(class extends Ce{constructor(){super({id:`toggle.${X.CUSTOM_TITLE_BAR_VISIBILITY}.windowed`,title:g(3575,"Hide Custom Title Bar In Full Screen"),menu:[{id:R.TitleBarContext,order:1,when:Yt,group:"3_toggle"},{id:R.TitleBarTitleContext,order:1,when:Yt,group:"3_toggle"}]})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.WINDOWED)}});class yc extends Ce{constructor(){super({id:"toggle.toggleCustomTitleBar",title:g(3576,"Custom Title Bar"),toggled:Jt,menu:[{id:R.MenubarAppearanceMenu,order:6,when:P.or(P.and(P.equals(Qi.key,es.NATIVE),P.and(P.equals("config.workbench.layoutControl.enabled",!1),P.equals("config.window.commandCenter",!1),P.notEquals("config.workbench.editor.editorActionsLocation","titleBar"),P.notEquals("config.workbench.activityBar.location","top"),P.notEquals("config.workbench.activityBar.location","bottom"))?.negate()),Yt),group:"2_workbench_layout"}]})}run(e,...t){const i=e.get(ee),s=e.get(Ie);switch(i.getValue(X.CUSTOM_TITLE_BAR_VISIBILITY)){case oe.NEVER:i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO);break;case oe.WINDOWED:{Yt.evaluate(s.getContext(null))?i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO):i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER);break}case oe.AUTO:default:i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER);break}}}fe(yc);fe(class extends Ce{constructor(){super({id:"showCustomTitleBar",title:re(3577,"Show Custom Title Bar"),precondition:Jt.negate(),f1:!0})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO)}});fe(class extends Ce{constructor(){super({id:"hideCustomTitleBar",title:re(3578,"Hide Custom Title Bar"),precondition:Jt,f1:!0})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER)}});fe(class extends Ce{constructor(){super({id:"hideCustomTitleBarInFullScreen",title:re(3579,"Hide Custom Title Bar In Full Screen"),precondition:P.and(Jt,Yt),f1:!0})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.WINDOWED)}});var U;fe((U=class extends Ce{constructor(){const e=P.and(P.equals("config.workbench.editor.showTabs","none").negate(),P.equals(`config.${U.settingsID}`,"default"))?.negate();super({id:`toggle.${U.settingsID}`,title:g(3580,"Editor Actions"),toggled:P.equals(`config.${U.settingsID}`,"hidden").negate(),menu:[{id:R.TitleBarContext,order:3,when:e,group:"2_config"},{id:R.TitleBarTitleContext,order:3,when:e,group:"2_config"}]})}run(e,...t){const i=e.get(ee),s=e.get(he),n=i.getValue(U.settingsID);if(n==="hidden"){if(i.getValue(_.EDITOR_TABS_MODE)!=="none")i.updateValue(U.settingsID,"titleBar");else{const o=s.get(U.settingsID,p.PROFILE);i.updateValue(U.settingsID,o??"default")}s.remove(U.settingsID,p.PROFILE)}else i.updateValue(U.settingsID,"hidden"),s.store(U.settingsID,n,p.PROFILE,D.USER)}},U.settingsID="workbench.editor.editorActionsLocation",U));const vc={id:ji,label:g(3581,"Accounts"),tooltip:g(3581,"Accounts"),class:void 0,enabled:!0,run:function(){}},_c={id:Ji,label:g(3582,"Manage"),tooltip:g(3582,"Manage"),class:void 0,enabled:!0,run:function(){}};var Ss;ke(Tc);let Is=class extends On{constructor(e,t,i){super("workbench.titleService",i,t),this.instantiationService=e,this.properties=void 0,this.variables=new Map,this.mainPart=this._register(this.createMainTitlebarPart()),this.onMenubarVisibilityChange=this.mainPart.onMenubarVisibilityChange,this._register(this.registerPart(this.mainPart)),this.registerActions(),this.registerAPICommands()}createMainTitlebarPart(){return this.instantiationService.createInstance(Cs)}registerActions(){const e=this;this._register(fe(class extends Ce{constructor(){super({id:"workbench.action.focusTitleBar",title:re(3583,"Focus Title Bar"),category:Ys.View,f1:!0,precondition:Jt})}run(){e.getPartByDocument(Dn())?.focus()}}))}registerAPICommands(){this._register(We.registerCommand({id:"registerWindowTitleVariable",handler:(e,t,i)=>{this.registerVariables([{name:t,contextKey:i}])},metadata:{description:"Registers a new title variable",args:[{name:"name",schema:{type:"string"},description:"The name of the variable to register"},{name:"contextKey",schema:{type:"string"},description:"The context key to use for the value of the variable"}]}}))}createAuxiliaryTitlebarPart(e,t,i){const s=I(".part.titlebar",{role:"none"});s.style.position="relative",e.insertBefore(s,e.firstChild);const n=new L,r=this.doCreateAuxiliaryTitlebarPart(s,t,i);return n.add(this.registerPart(r)),n.add(me.runAndSubscribe(r.onDidChange,()=>s.style.height=`${r.height}px`)),r.create(s),this.properties&&r.updateProperties(this.properties),this.variables.size&&r.registerVariables(Array.from(this.variables.values())),me.once(r.onWillDispose)(()=>n.dispose()),r}doCreateAuxiliaryTitlebarPart(e,t,i){return i.createInstance(bs,e,t,this.mainPart)}updateProperties(e){this.properties=e;for(const t of this.parts)t.updateProperties(e)}registerVariables(e){const t=[];for(const i of e)this.variables.has(i.name)||(this.variables.set(i.name,i),t.push(i));for(const i of this.parts)i.registerVariables(t)}};Is=y([u(0,O),u(1,he),u(2,ue)],Is);let Ii=class extends Pi{get minimumHeight(){const e=le&&Ki();let t=this.isCommandCenterVisible||e?Ao:30;return e&&(t=Math.max(t,So(K(this.element))?.height??0)),t/(this.preventZoom?ni(K(this.element)):1)}get maximumHeight(){return this.minimumHeight}constructor(e,t,i,s,n,r,o,a,c,f,m,A,S,x,G){super(e,{hasTitle:!1},a,c,f),this.editorGroupsContainer=i,this.contextMenuService=s,this.configurationService=n,this.environmentService=r,this.instantiationService=o,this.storageService=c,this.contextKeyService=m,this.hostService=A,this.editorService=S,this.menuService=x,this.keybindingService=G,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this._onMenubarVisibilityChange=this._register(new E),this.onMenubarVisibilityChange=this._onMenubarVisibilityChange.event,this._onWillDispose=this._register(new E),this.onWillDispose=this._onWillDispose.event,this.customMenubar=this._register(new ze),this.actionToolBarDisposable=this._register(new L),this.editorActionsChangeDisposable=this._register(new L),this.globalToolbarMenuDisposables=this._register(new L),this.editorToolbarMenuDisposables=this._register(new L),this.layoutToolbarMenuDisposables=this._register(new L),this.activityToolbarDisposables=this._register(new L),this.titleDisposables=this._register(new L),this.isInactive=!1,this.isCompact=!1,this.isAuxiliary=t.vscodeWindowId!==C.vscodeWindowId,this.isCompactContextKey=Us.bindTo(this.contextKeyService),this.titleBarStyle=Io(this.configurationService),this.windowTitle=this._register(o.createInstance(Co,t)),this.hoverDelegate=this._register(bo()),this.registerListeners(Zi(t))}registerListeners(e){this._register(this.hostService.onDidChangeFocus(t=>t?this.onFocus():this.onBlur())),this._register(this.hostService.onDidChangeActiveWindow(t=>t===e?this.onFocus():this.onBlur())),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationChanged(t))),this._register(this.editorGroupsContainer.onDidChangeEditorPartOptions(t=>this.onEditorPartConfigurationChange(t)))}onBlur(){this.isInactive=!0,this.updateStyles()}onFocus(){this.isInactive=!1,this.updateStyles()}onEditorPartConfigurationChange({oldPartOptions:e,newPartOptions:t}){(e.editorActionsLocation!==t.editorActionsLocation||e.showTabs!==t.showTabs)&&this.actionToolBar&&(this.createActionToolBar(),this.createActionToolBarMenus({editorActions:!0}),this._onDidChange.fire(void 0))}onConfigurationChanged(e){if(!this.isAuxiliary&&!Xi(this.configurationService,this.titleBarStyle)&&(!pe||le)&&e.affectsConfiguration(Gs.MenuBarVisibility)&&(this.currentMenubarVisibility==="compact"?this.uninstallMenubar():this.installMenubar()),this.actionToolBar){const t=e.affectsConfiguration(_.LAYOUT_ACTIONS),i=e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION);(t||i)&&(this.createActionToolBarMenus({layoutActions:t,activityActions:i}),this._onDidChange.fire(void 0))}e.affectsConfiguration(_.COMMAND_CENTER)&&this.recreateTitle()}recreateTitle(){this.createTitle(),this._onDidChange.fire(void 0)}updateOptions(e){const t=this.isCompact;this.isCompact=e.compact,this.isCompactContextKey.set(this.isCompact),t!==this.isCompact&&(this.recreateTitle(),this.createActionToolBarMenus(!0))}installMenubar(){this.menubar||(this.customMenubar.value=this.instantiationService.createInstance(Eo),this.menubar=ne(this.leftContent,I("div.menubar")),this.menubar.setAttribute("role","menubar"),this._register(this.customMenubar.value.onVisibilityChange(e=>this.onMenubarVisibilityChanged(e))),this.customMenubar.value.create(this.menubar))}uninstallMenubar(){this.customMenubar.value=void 0,this.menubar?.remove(),this.menubar=void 0,this.onMenubarVisibilityChanged(!1)}onMenubarVisibilityChanged(e){(le||Et||Ut)&&(this.lastLayoutDimensions&&this.layout(this.lastLayoutDimensions.width,this.lastLayoutDimensions.height),this._onMenubarVisibilityChange.fire(e))}updateProperties(e){this.windowTitle.updateProperties(e)}registerVariables(e){this.windowTitle.registerVariables(e)}createContentArea(e){if(this.element=e,this.rootContainer=ne(e,I(".titlebar-container")),this.leftContent=ne(this.rootContainer,I(".titlebar-left")),this.centerContent=ne(this.rootContainer,I(".titlebar-center")),this.rightContent=ne(this.rootContainer,I(".titlebar-right")),(Et||Ut)&&!Bt(this.configurationService,this.titleBarStyle)&&(this.appIcon=nn(this.leftContent,I("a.window-appicon"))),this.dragRegion=nn(this.rootContainer,I("div.titlebar-drag-region")),!this.isAuxiliary&&!Xi(this.configurationService,this.titleBarStyle)&&(!pe||le)&&this.currentMenubarVisibility!=="compact"&&this.installMenubar(),this.title=ne(this.centerContent,I("div.window-title")),this.createTitle(),this.actionToolBarElement=ne(this.rightContent,I("div.action-toolbar-container")),this.createActionToolBar(),this.createActionToolBarMenus(),!Bt(this.configurationService,this.titleBarStyle)){let t=pe?"left":"right";pe&&si&&To.Locale(yo).value?.textInfo?.direction==="rtl"&&(t="right"),pe&&si&&t==="left"||vo(this.configurationService)===_o.HIDDEN||(this.windowControlsContainer=ne(t==="left"?this.leftContent:this.rightContent,I("div.window-controls-container")),le&&ne(t==="left"?this.rightContent:this.leftContent,I("div.window-controls-container")),Ki()&&this.windowControlsContainer.classList.add("wco-enabled"))}return this._register(F(this.rootContainer,Q.CONTEXT_MENU,t=>{De.stop(t);let i;pe&&Ri(t.target)&&wo(t.target,this.title)?i=R.TitleBarTitleContext:i=R.TitleBarContext,this.onContextMenu(t,i)})),pe&&this._register(F(this.title,Q.MOUSE_DOWN,t=>{t.metaKey&&(De.stop(t,!0),this.onContextMenu(t,R.TitleBarTitleContext))},!0)),this.updateStyles(),this.element}createTitle(){this.titleDisposables.clear();const e=Bt(this.configurationService,this.titleBarStyle);if(!this.isCommandCenterVisible)e?$i(this.title):(this.title.innerText=this.windowTitle.value,this.titleDisposables.add(this.windowTitle.onDidChange(()=>{this.title.innerText=this.windowTitle.value,this.lastLayoutDimensions&&this.updateLayout(this.lastLayoutDimensions)})));else{const t=this.instantiationService.createInstance(ps,this.windowTitle,this.hoverDelegate);$i(this.title,t.element),this.titleDisposables.add(t)}}actionViewItemProvider(e,t){if(!this.isAuxiliary){if(e.id===Ji)return this.instantiationService.createInstance(Ro,{position:()=>rn.BELOW},t);if(e.id===ji)return this.instantiationService.createInstance(Do,{position:()=>rn.BELOW},t)}const i=this.editorGroupsContainer.activeGroup?.activeEditorPane;if(i&&i instanceof Po){const s=i.getActionViewItem(e,t);if(s)return s}return zs(this.instantiationService,e,{...t,menuAsChild:!1})}getKeybinding(e){const t=this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService??this.contextKeyService;return this.keybindingService.lookupKeybinding(e.id,t)}createActionToolBar(){this.actionToolBarDisposable.clear(),this.actionToolBar=this.actionToolBarDisposable.add(this.instantiationService.createInstance(Mn,this.actionToolBarElement,{contextMenu:R.TitleBarContext,orientation:Vo.HORIZONTAL,ariaLabel:g(3584,"Title actions"),getKeyBinding:e=>this.getKeybinding(e),overflowBehavior:{maxItems:9,exempted:[ji,Ji,...Wa]},anchorAlignmentProvider:()=>No.RIGHT,telemetrySource:"titlePart",highlightToggledItems:this.editorActionsEnabled||this.isAuxiliary,actionViewItemProvider:(e,t)=>this.actionViewItemProvider(e,t),hoverDelegate:this.hoverDelegate})),this.editorActionsEnabled&&this.actionToolBarDisposable.add(this.editorGroupsContainer.onDidChangeActiveGroup(()=>this.createActionToolBarMenus({editorActions:!0})))}createActionToolBarMenus(e=!0){e===!0&&(e={editorActions:!0,layoutActions:!0,globalActions:!0,activityActions:!0});const t=()=>{const i={primary:[],secondary:[]};if(this.editorActionsEnabled){this.editorActionsChangeDisposable.clear();const s=this.editorGroupsContainer.activeGroup;if(s){const n=s.createEditorActions(this.editorActionsChangeDisposable,this.isAuxiliary&&this.isCompact?R.CompactWindowEditorTitle:R.EditorTitle);i.primary.push(...n.actions.primary),i.secondary.push(...n.actions.secondary),this.editorActionsChangeDisposable.add(n.onDidChange(()=>t()))}}this.globalToolbarMenu&&on(this.globalToolbarMenu.getActions(),i),this.layoutToolbarMenu&&on(this.layoutToolbarMenu.getActions(),i,()=>!this.editorActionsEnabled||this.isCompact),this.activityActionsEnabled&&(Go(this.storageService)&&i.primary.push(vc),i.primary.push(_c)),this.actionToolBar.setActions(an(i.primary),an(i.secondary))};if(e.editorActions)if(this.editorToolbarMenuDisposables.clear(),this.editorActionsEnabled&&this.editorService.activeEditor!==void 0){const i={groupId:this.editorGroupsContainer.activeGroup.id};this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new Ga(i)),this.actionToolBar.context=i}else this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new Ms),this.actionToolBar.context=void 0;e.layoutActions&&(this.layoutToolbarMenuDisposables.clear(),this.layoutControlEnabled?(this.layoutToolbarMenu=this.menuService.createMenu(R.LayoutControlMenu,this.contextKeyService),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu.onDidChange(()=>t()))):this.layoutToolbarMenu=void 0),e.globalActions&&(this.globalToolbarMenuDisposables.clear(),this.globalActionsEnabled?(this.globalToolbarMenu=this.menuService.createMenu(R.TitleBar,this.contextKeyService),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu.onDidChange(()=>t()))):this.globalToolbarMenu=void 0),e.activityActions&&(this.activityToolbarDisposables.clear(),this.activityActionsEnabled&&this.activityToolbarDisposables.add(this.storageService.onDidChangeValue(p.PROFILE,Bo.ACCOUNTS_VISIBILITY_PREFERENCE_KEY,this._store)(()=>t()))),t()}updateStyles(){if(super.updateStyles(),this.element){this.isInactive?this.element.classList.add("inactive"):this.element.classList.remove("inactive");const e=this.getColor(this.isInactive?Lo:Mo,(s,n)=>s.isOpaque()?s:s.makeOpaque(Oo(n)))||"";this.element.style.backgroundColor=e,this.appIconBadge&&(this.appIconBadge.style.backgroundColor=e),e&&xo.fromHex(e).isLighter()?this.element.classList.add("light"):this.element.classList.remove("light");const t=this.getColor(this.isInactive?ko:Ho);this.element.style.color=t||"";const i=this.getColor(Fo);this.element.style.borderBottom=i?`1px solid ${i}`:""}}onContextMenu(e,t){const i=new xn(K(this.element),e);this.contextMenuService.showContextMenu({getAnchor:()=>i,menuId:t,contextKeyService:this.contextKeyService,domForShadowRoot:pe&&si?i.target:void 0})}get currentMenubarVisibility(){return this.isAuxiliary?"hidden":Yi(this.configurationService)}get layoutControlEnabled(){return this.configurationService.getValue(_.LAYOUT_ACTIONS)!==!1}get isCommandCenterVisible(){return!this.isCompact&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1}get editorActionsEnabled(){return this.editorGroupsContainer.partOptions.editorActionsLocation===Ui.TITLEBAR||this.editorGroupsContainer.partOptions.editorActionsLocation===Ui.DEFAULT&&this.editorGroupsContainer.partOptions.showTabs===Wo.NONE}get activityActionsEnabled(){const e=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);return!this.isCompact&&!this.isAuxiliary&&(e===Me.TOP||e===Me.BOTTOM)}get globalActionsEnabled(){return!this.isCompact}get hasZoomableElements(){const e=!(this.currentMenubarVisibility==="hidden"||this.currentMenubarVisibility==="compact"||!le&&pe),t=this.isCommandCenterVisible,i=this.globalActionsEnabled||this.layoutControlEnabled||this.editorActionsEnabled||this.activityActionsEnabled;return e||t||i}get preventZoom(){return ni(K(this.element))<1||!this.hasZoomableElements}layout(e,t){this.updateLayout(new lt(e,t)),super.layoutContents(e,t)}updateLayout(e){this.lastLayoutDimensions=e;const t=ni(K(this.element));if(this.element.style.setProperty("--zoom-factor",t.toString()),this.rootContainer.classList.toggle("counter-zoom",this.preventZoom),this.customMenubar.value){const s=new lt(0,e.height);this.customMenubar.value.layout(s)}const i=this.isCommandCenterVisible||this.title.innerText!=="";this.rootContainer.classList.toggle("has-center",i)}focus(){this.customMenubar.value?this.customMenubar.value.toggleFocus():this.element.querySelector('[tabindex]:not([tabindex="-1"])')?.focus()}toJSON(){return{type:h.TITLEBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}};Ii=y([u(3,ye),u(4,ee),u(5,jt),u(6,O),u(7,ue),u(8,he),u(9,ce),u(10,Ie),u(11,_t),u(12,wt),u(13,Ks),u(14,ut)],Ii);let Cs=class extends Ii{constructor(e,t,i,s,n,r,o,a,c,f,m,A,S){super(h.TITLEBAR_PART,C,f.mainPart,e,t,i,s,n,r,o,a,c,m,A,S)}};Cs=y([u(0,ye),u(1,ee),u(2,jt),u(3,O),u(4,ue),u(5,he),u(6,ce),u(7,Ie),u(8,_t),u(9,ft),u(10,wt),u(11,Ks),u(12,ut)],Cs);var nt;let bs=(nt=class extends Ii{get height(){return this.minimumHeight}constructor(e,t,i,s,n,r,o,a,c,f,m,A,S,x,G,ve){const He=Ss.COUNTER++;super(`workbench.parts.auxiliaryTitle.${He}`,K(e),t,s,n,r,o,a,c,f,m,A,x,G,ve),this.container=e,this.mainTitlebar=i}get preventZoom(){return ni(K(this.element))<1||!this.mainTitlebar.hasZoomableElements}},Ss=nt,nt.COUNTER=1,nt);bs=Ss=y([u(3,ye),u(4,ee),u(5,jt),u(6,O),u(7,ue),u(8,he),u(9,ce),u(10,Ie),u(11,_t),u(12,ft),u(13,wt),u(14,Ks),u(15,ut)],bs);function wc(){return{[Ws.toString()]:new Ke(Is,[],!1)}}kn(async l=>{l.get(Ws)});const Rc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Dc extends ie{constructor(e,t,i){super(e,t,void 0,!0),this.model=i,this.checked=!i.isHidden(e)}async run(){this.model.isHidden(this.id)?this.model.show(this.id):this.model.hide(this.id)}}class Pc extends ie{constructor(e,t,i){super(e,g(3540,"Hide '{0}'",t),void 0,!0),this.model=i}async run(){this.model.hide(this.id)}}let Es=class extends ie{constructor(e,t){super("statusbar.manage.extension",g(3541,"Manage Extension")),this.extensionId=e,this.commandService=t}run(){return this.commandService.executeCommand("_extensions.manage",this.extensionId)}};Es=y([u(1,Te)],Es);V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusPrevious",weight:B.WorkbenchContrib,primary:b.LeftArrow,secondary:[b.UpArrow],when:Rt,handler:l=>{l.get(Ve).focusPreviousEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusNext",weight:B.WorkbenchContrib,primary:b.RightArrow,secondary:[b.DownArrow],when:Rt,handler:l=>{l.get(Ve).focusNextEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusFirst",weight:B.WorkbenchContrib,primary:b.Home,when:Rt,handler:l=>{const e=l.get(Ve);e.focus(!1),e.focusNextEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusLast",weight:B.WorkbenchContrib,primary:b.End,when:Rt,handler:l=>{const e=l.get(Ve);e.focus(!1),e.focusPreviousEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.clearFocus",weight:B.WorkbenchContrib,primary:b.Escape,when:Rt,handler:l=>{const e=l.get(Ve),t=l.get(wt);e.isEntryFocused()?e.focus(!1):t.activeEditorPane&&t.activeEditorPane.focus()}});class Nc extends Ce{constructor(){super({id:"workbench.action.focusStatusBar",title:re(3542,"Focus Status Bar"),category:Ys.View,f1:!0})}async run(e){e.get(ce).focusPart(h.STATUSBAR_PART,ei())}}fe(Nc);const Ye=class Ye extends te{get entries(){return this._entries.slice(0)}get lastFocusedEntry(){return this._lastFocusedEntry&&!this.isHidden(this._lastFocusedEntry.id)?this._lastFocusedEntry:void 0}constructor(e){super(),this.storageService=e,this._onDidChangeEntryVisibility=this._register(new E),this.onDidChangeEntryVisibility=this._onDidChangeEntryVisibility.event,this._entries=[],this.hidden=new Set,this.restoreState(),this.registerListeners()}restoreState(){const e=this.storageService.get(Ye.HIDDEN_ENTRIES_KEY,p.PROFILE);if(e)try{this.hidden=new Set(JSON.parse(e))}catch{}}registerListeners(){this._register(this.storageService.onDidChangeValue(p.PROFILE,Ye.HIDDEN_ENTRIES_KEY,this._store)(()=>this.onDidStorageValueChange()))}onDidStorageValueChange(){const e=new Set(this.hidden);this.hidden.clear(),this.restoreState();const t=new Set;for(const i of e)this.hidden.has(i)||t.add(i);for(const i of this.hidden)e.has(i)||t.add(i);if(t.size>0)for(const i of this._entries)t.has(i.id)&&(this.updateVisibility(i.id,!0),t.delete(i.id))}add(e){this._entries.push(e),this.updateVisibility(e,!1),this.sort(),this.markFirstLastVisibleEntry()}remove(e){const t=this._entries.indexOf(e);t>=0&&(this._entries.splice(t,1),this._entries.some(i=>ri(i.priority.primary)&&i.priority.primary.location.id===e.id)&&this.sort(),this.markFirstLastVisibleEntry())}isHidden(e){return this.hidden.has(e)}hide(e){this.hidden.has(e)||(this.hidden.add(e),this.updateVisibility(e,!0),this.saveState())}show(e){this.hidden.has(e)&&(this.hidden.delete(e),this.updateVisibility(e,!0),this.saveState())}findEntry(e){return this._entries.find(t=>t.container===e)}getEntries(e){return this._entries.filter(t=>t.alignment===e)}focusNextEntry(){this.focusEntry(1,0)}focusPreviousEntry(){this.focusEntry(-1,this.entries.length-1)}isEntryFocused(){return!!this.getFocusedEntry()}getFocusedEntry(){return this._entries.find(e=>ht(e.container))}focusEntry(e,t){const i=r=>{let o=r,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;for(;a&&this.isHidden(a.id);)o+=e,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;return a},s=this.getFocusedEntry();if(s){const r=i(this._entries.indexOf(s)+e);if(r){this._lastFocusedEntry=r,r.labelContainer.focus();return}}const n=i(t);n&&(this._lastFocusedEntry=n,n.labelContainer.focus())}updateVisibility(e,t){if(typeof e=="string"){const i=e;for(const s of this._entries)s.id===i&&this.updateVisibility(s,t)}else{const i=e,s=this.isHidden(i.id);s?Hn(i.container):Fn(i.container),t&&this._onDidChangeEntryVisibility.fire({id:i.id,visible:!s}),this.markFirstLastVisibleEntry()}}saveState(){this.hidden.size>0?this.storageService.store(Ye.HIDDEN_ENTRIES_KEY,JSON.stringify(Array.from(this.hidden.values())),p.PROFILE,D.USER):this.storageService.remove(Ye.HIDDEN_ENTRIES_KEY,p.PROFILE)}sort(){const e=new Set(this._entries.map(r=>r.id)),t=new Map,i=new Map;for(let r=0;r<this._entries.length;r++){const o=this._entries[r];if(typeof o.priority.primary=="number"||!e.has(o.priority.primary.location.id))t.set(o,r);else{const a=o.priority.primary.location.id;let c=i.get(a);if(!c){for(const f of i.values())if(f.has(a)){c=f;break}c||(c=new Map,i.set(a,c))}c.set(o.id,o)}}const s=Array.from(t.keys());s.sort((r,o)=>{if(r.alignment===o.alignment){const a=typeof r.priority.primary=="number"?r.priority.primary:r.priority.primary.location.priority,c=typeof o.priority.primary=="number"?o.priority.primary:o.priority.primary.location.priority;return a!==c?c-a:r.priority.secondary!==o.priority.secondary?o.priority.secondary-r.priority.secondary:t.get(r)-t.get(o)}return r.alignment===$.LEFT?-1:o.alignment===$.LEFT?1:0});let n;if(i.size>0){n=[];for(const r of s){const o=i.get(r.id),a=o?Array.from(o.values()):void 0;a&&n.push(...a.filter(c=>ri(c.priority.primary)&&c.priority.primary.alignment===$.LEFT).sort((c,f)=>f.priority.secondary-c.priority.secondary)),n.push(r),a&&n.push(...a.filter(c=>ri(c.priority.primary)&&c.priority.primary.alignment===$.RIGHT).sort((c,f)=>f.priority.secondary-c.priority.secondary)),i.delete(r.id)}for(const[,r]of i)n.push(...Array.from(r.values()).sort((o,a)=>a.priority.secondary-o.priority.secondary))}else n=s;this._entries=n}markFirstLastVisibleEntry(){this.doMarkFirstLastVisibleStatusbarItem(this.getEntries($.LEFT)),this.doMarkFirstLastVisibleStatusbarItem(this.getEntries($.RIGHT))}doMarkFirstLastVisibleStatusbarItem(e){let t,i;for(const s of e)s.container.classList.remove("first-visible-item","last-visible-item"),!this.isHidden(s.id)&&(t||(t=s),i=s);t?.container.classList.add("first-visible-item"),i?.container.classList.add("last-visible-item")}};Ye.HIDDEN_ENTRIES_KEY="workbench.statusbar.hidden";let Ts=Ye,ys=class extends te{get name(){return de(this.entry).name}get hasCommand(){return typeof this.entry?.command<"u"}constructor(e,t,i,s,n,r,o,a){super(),this.container=e,this.hoverDelegate=i,this.commandService=s,this.hoverService=n,this.notificationService=r,this.telemetryService=o,this.themeService=a,this.entry=void 0,this.foregroundListener=this._register(new ze),this.backgroundListener=this._register(new ze),this.commandMouseListener=this._register(new ze),this.commandTouchListener=this._register(new ze),this.commandKeyboardListener=this._register(new ze),this.hover=void 0,this.labelContainer=I("a.statusbar-item-label",{role:"button",tabIndex:-1}),this._register(ks.addTarget(this.labelContainer)),this.label=this._register(new Vc(this.labelContainer)),this.container.appendChild(this.labelContainer),this.beakContainer=I(".status-bar-item-beak-container"),this.container.appendChild(this.beakContainer),t.content&&this.container.appendChild(t.content),this.update(t)}update(e){if(this.label.showProgress=e.showProgress??!1,(!this.entry||e.text!==this.entry.text)&&(this.label.text=e.text,e.text?Fn(this.labelContainer):Hn(this.labelContainer)),(!this.entry||e.ariaLabel!==this.entry.ariaLabel)&&(this.container.setAttribute("aria-label",e.ariaLabel),this.labelContainer.setAttribute("aria-label",e.ariaLabel)),(!this.entry||e.role!==this.entry.role)&&this.labelContainer.setAttribute("role",e.role||"button"),!this.entry||!this.isEqualTooltip(this.entry,e)){let i,s;zo(e.tooltip)?(s=e.tooltip.content,i={actions:e.tooltip.commands.map(r=>({commandId:r.id,label:r.title,run:()=>this.executeCommand(r)}))}):s=e.tooltip;const n=xi(s)?{markdown:s,markdownNotSupportedFallback:void 0}:s;this.hover?this.hover.update(n,i):this.hover=this._register(this.hoverService.setupManagedHover(this.hoverDelegate,this.container,n,i))}if(!this.entry||e.command!==this.entry.command){this.commandMouseListener.clear(),this.commandTouchListener.clear(),this.commandKeyboardListener.clear();const i=e.command;i&&(i!==cn||this.hover)?(this.commandMouseListener.value=F(this.labelContainer,Q.CLICK,()=>this.executeCommand(i)),this.commandTouchListener.value=F(this.labelContainer,Hs.Tap,()=>this.executeCommand(i)),this.commandKeyboardListener.value=F(this.labelContainer,Q.KEY_DOWN,s=>{const n=new vn(s);n.equals(b.Space)||n.equals(b.Enter)?(De.stop(s),this.executeCommand(i)):(n.equals(b.Escape)||n.equals(b.LeftArrow)||n.equals(b.RightArrow))&&(De.stop(s),this.hover?.hide())}),this.labelContainer.classList.remove("disabled")):this.labelContainer.classList.add("disabled")}(!this.entry||e.showBeak!==this.entry.showBeak)&&(e.showBeak?this.container.classList.add("has-beak"):this.container.classList.remove("has-beak"));const t=!!e.backgroundColor||e.kind&&e.kind!=="standard";if(!this.entry||e.kind!==this.entry.kind){for(const i of Uo)this.container.classList.remove(`${i}-kind`);e.kind&&e.kind!=="standard"&&this.container.classList.add(`${e.kind}-kind`),this.container.classList.toggle("has-background-color",t)}(!this.entry||e.color!==this.entry.color)&&this.applyColor(this.labelContainer,e.color),(!this.entry||e.backgroundColor!==this.entry.backgroundColor)&&(this.container.classList.toggle("has-background-color",t),this.applyColor(this.container,e.backgroundColor,!0)),this.entry=e}isEqualTooltip({tooltip:e},{tooltip:t}){return e===void 0?t===void 0:xi(e)?xi(t)&&Yo(e,t):e===t}async executeCommand(e){if(e===cn)this.hover?.show(!0);else{const t=typeof e=="string"?e:e.id,i=typeof e=="string"?[]:e.arguments??[];this.telemetryService.publicLog2("workbenchActionExecuted",{id:t,from:"status bar"});try{await this.commandService.executeCommand(t,...i)}catch(s){this.notificationService.error(qt(s))}}}applyColor(e,t,i){let s;if(i?this.backgroundListener.clear():this.foregroundListener.clear(),t)if(Ko(t)){s=this.themeService.getColorTheme().getColor(t.id)?.toString();const n=this.themeService.onDidColorThemeChange(r=>{const o=r.getColor(t.id)?.toString();i?e.style.backgroundColor=o??"":e.style.color=o??""});i?this.backgroundListener.value=n:this.foregroundListener.value=n}else s=t;i?e.style.backgroundColor=s??"":e.style.color=s??""}};ys=y([u(3,Te),u(4,Fs),u(5,Pe),u(6,_i),u(7,ue)],ys);class Vc extends za{constructor(e){super(e),this.container=e,this.progressCodicon=qi(hn),this.currentText="",this.currentShowProgress=!1}set showProgress(e){this.currentShowProgress!==e&&(this.currentShowProgress=e,this.progressCodicon=qi(e==="syncing"?hn:Xo),this.text=this.currentText)}set text(e){if(this.currentShowProgress){this.container.firstChild!==this.progressCodicon&&this.container.appendChild(this.progressCodicon);for(const i of Array.from(this.container.childNodes))i!==this.progressCodicon&&i.remove();let t=e??"";t&&(t=` ${t}`),ne(this.container,...Zo(t))}else super.text=e}}var oi,vs;ke(Rc);var rt;let $t=(rt=class extends Pi{constructor(e,t,i,s,n,r,o,a){super(e,{hasTitle:!1},i,n,r),this.instantiationService=t,this.contextService=s,this.contextMenuService=o,this.contextKeyService=a,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=oi.HEIGHT,this.maximumHeight=oi.HEIGHT,this.pendingEntries=[],this._onWillDispose=this._register(new E),this.onWillDispose=this._onWillDispose.event,this.onDidOverrideEntry=this._register(new E),this.entryOverrides=new Map,this.compactEntriesDisposable=this._register(new ze),this.styleOverrides=new Set,this.viewModel=this._register(new Ts(n)),this.onDidChangeEntryVisibility=this.viewModel.onDidChangeEntryVisibility,this.hoverDelegate=this._register(this.instantiationService.createInstance($o,"element",{instantHover:!0,dynamicDelay(c){if(typeof c=="function"||Ri(c)||qo(c)&&typeof c.markdown=="function"||jo(c))return 500}},(c,f)=>({persistence:{hideOnKeyDown:!0,sticky:f},appearance:{maxHeightRatio:.9}}))),this.registerListeners()}registerListeners(){this._register(this.onDidChangeEntryVisibility(()=>this.updateCompactEntries())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateStyles()))}overrideEntry(e,t){return this.entryOverrides.set(e,t),this.onDidOverrideEntry.fire(e),Ne(()=>{this.entryOverrides.get(e)===t&&(this.entryOverrides.delete(e),this.onDidOverrideEntry.fire(e))})}withEntryOverride(e,t){const i=this.entryOverrides.get(t);return i&&(e={...e,...i}),e}addEntry(e,t,i,s=0){let n;return Jo(s)?n=s:n={primary:s,secondary:Qo(t)},this.element?this.doAddEntry(e,t,i,n):this.doAddPendingEntry(e,t,i,n)}doAddPendingEntry(e,t,i,s){const n={entry:e,id:t,alignment:i,priority:s};return this.pendingEntries.push(n),{update:o=>{n.accessor?n.accessor.update(o):n.entry=o},dispose:()=>{n.accessor?n.accessor.dispose():this.pendingEntries=this.pendingEntries.filter(o=>o!==n)}}}doAddEntry(e,t,i,s){const n=new L,r=this.doCreateStatusItem(t,i),o=n.add(this.instantiationService.createInstance(ys,r,this.withEntryOverride(e,t),this.hoverDelegate)),a=new class{constructor(){this.id=t,this.extensionId=e.extensionId,this.alignment=i,this.priority=s,this.container=r,this.labelContainer=o.labelContainer}get name(){return o.name}get hasCommand(){return o.hasCommand}},{needsFullRefresh:c}=this.doAddOrRemoveModelEntry(a,!0);c?this.appendStatusbarEntries():this.appendStatusbarEntry(a);let f=e;const m={update:A=>{f=A,o.update(this.withEntryOverride(A,t))},dispose:()=>{const{needsFullRefresh:A}=this.doAddOrRemoveModelEntry(a,!1);A?this.appendStatusbarEntries():(r.remove(),this.updateCompactEntries()),n.dispose()}};return n.add(this.onDidOverrideEntry.event(A=>{A===t&&m.update(f)})),m}doCreateStatusItem(e,t,...i){const s=I(".statusbar-item",{id:e});return i&&s.classList.add(...i),t===$.RIGHT?s.classList.add("right"):s.classList.add("left"),s}doAddOrRemoveModelEntry(e,t){const i=this.viewModel.entries;t?this.viewModel.add(e):this.viewModel.remove(e);const s=this.viewModel.entries;return t?i.splice(s.indexOf(e),0,e):i.splice(i.indexOf(e),1),{needsFullRefresh:!En(i,s)}}isEntryVisible(e){return!this.viewModel.isHidden(e)}updateEntryVisibility(e,t){t?this.viewModel.show(e):this.viewModel.hide(e)}focusNextEntry(){this.viewModel.focusNextEntry()}focusPreviousEntry(){this.viewModel.focusPreviousEntry()}isEntryFocused(){return this.viewModel.isEntryFocused()}focus(e=!0){this.getContainer()?.focus();const t=this.viewModel.lastFocusedEntry;e&&t&&setTimeout(()=>t.labelContainer.focus(),0)}createContentArea(e){this.element=e;const t=this._register(this.contextKeyService.createScoped(this.element));return Rt.bindTo(t).set(!0),this.leftItemsContainer=I(".left-items.items-container"),this.element.appendChild(this.leftItemsContainer),this.element.tabIndex=0,this.rightItemsContainer=I(".right-items.items-container"),this.element.appendChild(this.rightItemsContainer),this._register(F(e,Q.CONTEXT_MENU,i=>this.showContextMenu(i))),this._register(ks.addTarget(e)),this._register(F(e,Hs.Contextmenu,i=>this.showContextMenu(i))),this.createInitialStatusbarEntries(),this.element}createInitialStatusbarEntries(){for(this.appendStatusbarEntries();this.pendingEntries.length;){const e=this.pendingEntries.shift();e&&(e.accessor=this.addEntry(e.entry,e.id,e.alignment,e.priority.primary))}}appendStatusbarEntries(){const e=de(this.leftItemsContainer),t=de(this.rightItemsContainer);ct(e),ct(t);for(const i of[...this.viewModel.getEntries($.LEFT),...this.viewModel.getEntries($.RIGHT).reverse()])(i.alignment===$.LEFT?e:t).appendChild(i.container);this.updateCompactEntries()}appendStatusbarEntry(e){const t=this.viewModel.getEntries(e.alignment);e.alignment===$.RIGHT&&t.reverse();const i=de(e.alignment===$.LEFT?this.leftItemsContainer:this.rightItemsContainer),s=t.indexOf(e);s+1===t.length?i.appendChild(e.container):i.insertBefore(e.container,t[s+1].container),this.updateCompactEntries()}updateCompactEntries(){const e=this.viewModel.entries,t=new Map;for(const r of e)this.viewModel.isHidden(r.id)||t.set(r.id,r),r.container.classList.remove("compact-left","compact-right");const i=new Map;for(const r of t.values())if(ri(r.priority.primary)&&r.priority.primary.compact){const o=r.priority.primary.location.id,a=t.get(o);if(!a)continue;let c=i.get(o);if(!c){for(const f of i.values())if(f.has(o)){c=f;break}c||(c=new Map,i.set(o,c))}c.set(r.id,r),c.set(a.id,a),r.priority.primary.alignment===$.LEFT?(a.container.classList.add("compact-left"),r.container.classList.add("compact-right")):(a.container.classList.add("compact-right"),r.container.classList.add("compact-left"))}const s=this.getColor(ea),n=this.getColor(ta);if(this.compactEntriesDisposable.value=new L,s&&n&&!ia(this.theme.type))for(const[,r]of i)for(const o of r.values())o.hasCommand&&(this.compactEntriesDisposable.value.add(F(o.labelContainer,Q.MOUSE_OVER,()=>{r.forEach(a=>a.labelContainer.style.backgroundColor=s),o.labelContainer.style.backgroundColor=n})),this.compactEntriesDisposable.value.add(F(o.labelContainer,Q.MOUSE_OUT,()=>{r.forEach(a=>a.labelContainer.style.backgroundColor="")})))}showContextMenu(e){De.stop(e,!0);const t=new xn(K(this.element),e);let i;this.contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>(i=this.getContextMenuActions(t),i),onHide:()=>{i&&ga(i)}})}getContextMenuActions(e){const t=[];t.push(ci({id:ln.ID,label:g(3543,"Hide Status Bar"),run:()=>this.instantiationService.invokeFunction(n=>new ln().run(n))})),t.push(new Ft);const i=new Set;for(const n of this.viewModel.entries)i.has(n.id)||(t.push(new Dc(n.id,n.name,this.viewModel)),i.add(n.id));let s;for(let n=e.target;n;n=n.parentElement){const r=this.viewModel.findEntry(n);if(r){s=r;break}}return s&&(t.push(new Ft),s.extensionId&&t.push(this.instantiationService.createInstance(Es,s.extensionId)),t.push(new Pc(s.id,s.name,this.viewModel))),t}updateStyles(){super.updateStyles();const e=de(this.getContainer()),t=[...this.styleOverrides].sort((a,c)=>a.priority-c.priority)[0],i=this.getColor(t?.background??(this.contextService.getWorkbenchState()!==Oe.EMPTY?sa:na))||"";e.style.backgroundColor=i;const s=this.getColor(t?.foreground??(this.contextService.getWorkbenchState()!==Oe.EMPTY?ra:oa))||"";e.style.color=s;const n=this.getColor(aa),r=this.getColor(t?.border??(this.contextService.getWorkbenchState()!==Oe.EMPTY?ca:ha))||this.getColor(la);r?(e.classList.add("status-border-top"),e.style.setProperty("--status-border-top-color",r)):(e.classList.remove("status-border-top"),e.style.removeProperty("--status-border-top-color"));const o=this.getColor(da);this.styleElement||(this.styleElement=ua(e)),this.styleElement.textContent=`
|
|
1
|
+
import{D as te,c0 as Cn,bY as q,cI as Zn,cJ as we,cK as w,cL as bn,cM as qt,cN as $n,E,A as En,cO as ie,cP as qn,cQ as jn,cR as me,cS as V,bN as B,bP as Jn,bQ as mt,$ as b,cT as Wi,bV as We,cU as ge,cV as yi,cW as pt,cX as vi,W as O,cY as P,cZ as _e,j as Pe,bI as Tn,d as L,s as g,ak as re,b_ as Be,bZ as R,c_ as Ms,c$ as Os,f as y,g as u,m as _i,bi as W,bE as dt,bF as J,Z as ke,d0 as Te,d1 as Qn,ai as I,d2 as xs,d3 as yn,d4 as ci,d5 as Ft,d6 as er,d7 as tr,d8 as Wt,d9 as hi,a5 as ct,da as F,db as De,dc as Q,dd as Gi,U as wi,de as ir,df as sr,dg as Bi,dh as vn,di as ks,dj as Hs,dk as nr,dl as ye,dm as rr,dn as ut,dp as Fs,dq as _n,dr as or,ds as K,dt as Nt,du as ht,dv as Gt,h as ee,dw as wn,dx as lt,dy as de,dz as Rn,dA as ar,dB as cr,dC as hr,ck as h,bv as C,c1 as ue,bB as ce,dD as Ie,cc as ft,dE as lr,dF as $,dG as Ve,dH as dr,ap as Vt,dI as zi,a9 as Ri,dJ as ur,dK as fr,dL as gr,dM as mr,t as Ne,dN as pr,ao as li,dO as _t,dP as Ar,by as he,dQ as Sr,V as Ir,dR as Cr,aJ as p,aK as D,dS as Dn,dT as br,dU as Li,dV as _,a3 as zt,dW as Zs,dX as Er,bz as jt,ci as Di,bx as Tr,O as Pn,dY as yr,bX as wt,cf as vr,cg as _r,dZ as Ws,d_ as gt,bA as wr,d$ as Rr,e0 as Gs,e1 as X,e2 as Ui,e3 as Me,e4 as oe,e5 as Dr,e6 as Et,e7 as Ut,G as le,e8 as Bt,e9 as Yi,ea as Fe,eb as Nn,ec as $s,cl as v,ed as Pr,ee as Nr,ef as Vr,eg as Br,cw as Lr,cp as T,cv as Mr,cr as Pt,cs as Mi,ct as Qt,cu as Oe,cn as k,co as Or,cq as qs,eh as ei,ei as xr,ej as Pi,ek as Ki,el as H,em as js,en as z,eo as kr,ep as Hr,eq as Fr,er as Wr,cD as Gr,cE as zr,es as Js,et as Ur,eu as Qs,ev as pe,ew as Xi,cm as St,ex as ti,ey as Zi,ez as Yr,eA as Kr,eB as Xr,eC as Zr,eD as en,bp as Vn,eE as tn,eF as $r,eG as qr,eH as jr,z as ii,eI as Bn,eJ as Jr,bK as Qr,eK as eo,eL as si,eM as to,eN as Oi,eO as io,eP as so,eQ as no,eR as ro,eS as oo,eT as ao,eU as co,eV as ho,eW as lo,eX as uo,eY as fo,eZ as go,e_ as Ln,e$ as mo,f0 as zs,f1 as sn,f2 as po,f3 as Mn,a7 as $i,f4 as qi,f5 as ji,f6 as Ji,bL as fe,f7 as Us,bM as Ce,f8 as Qi,f9 as es,fa as Yt,fb as Jt,fc as On,bO as Ys,fd as ni,fe as Ao,ff as So,fg as ze,fh as Io,fi as Co,fj as bo,fk as Eo,a8 as ne,fl as nn,fm as To,fn as yo,fo as vo,fp as _o,fq as wo,fr as Ro,fs as rn,ft as Do,fu as Po,fv as No,fw as Vo,fx as Bo,fy as Lo,fz as Mo,fA as Oo,N as xo,fB as ko,fC as Ho,fD as Fo,fE as xn,fF as Wo,fG as on,fH as Go,fI as an,fJ as Ks,al as Ke,fK as kn,fL as Rt,fM as ri,fN as Hn,fO as Fn,fP as zo,fQ as xi,fR as cn,fS as Uo,fT as Yo,fU as Ko,fV as hn,fW as Xo,fX as Zo,fY as $o,fZ as qo,f_ as jo,f$ as Jo,g0 as Qo,g1 as ea,g2 as ta,bU as ia,g3 as ln,g4 as sa,g5 as na,g6 as ra,g7 as oa,g8 as aa,g9 as ca,ga as ha,gb as la,gc as da,u as ua,gd as fa,ge as ga,p as ma,gf as Wn,X as pa,Y as Aa,gg as Sa,gh as Ia,gi as Ca,gj as ba,gk as Ea,gl as Ta,gm as ya,gn as va,go as Ni,b3 as _a,gp as wa,gq as Ra,aP as Da,gr as Pa,cd as Na,gs as Gn,gt as Va,gu as Ba,gv as La,gw as Ma,ce as Oa}from"./index-GPQU4rv1.js";import{cx as Ih,cy as Ch,cA as bh,cB as Eh,cC as Th,cF as yh,cG as vh,cH as _h}from"./index-GPQU4rv1.js";import{S as xa,P as ka,A as Ha,c as Fa,d as Dt,D as Z,e as Wa,f as Ga,h as za,E as Ua,g as Ya,a as Ka,B as Xa}from"./views-Dck1c7fK.js";import{E as Za}from"./fileCommands._save-BslznhnO.js";import"./workbenchThemeService.service-DlXrxy4t.js";const $a=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var j;(function(l){l[l.ADD=0]="ADD",l[l.CHANGE=1]="CHANGE",l[l.EXPAND_COLLAPSE=2]="EXPAND_COLLAPSE",l[l.REMOVE=3]="REMOVE"})(j||(j={}));var vt;(function(l){l[l.ADD=0]="ADD",l[l.REMOVE=1]="REMOVE"})(vt||(vt={}));class qa extends te{constructor(e,t){super(),this.item=e,this.onClose=t,this._onDidClose=this._register(new E),this.onDidClose=this._onDidClose.event,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.registerListeners()}registerListeners(){this._register(this.item.onDidChangeVisibility(e=>this._onDidChangeVisibility.fire(e))),me.once(this.item.onDidClose)(()=>{this._onDidClose.fire(),this.dispose()})}get progress(){return this.item.progress}updateSeverity(e){this.item.updateSeverity(e)}updateMessage(e){this.item.updateMessage(e)}updateActions(e){this.item.updateActions(e)}close(){this.onClose(this.item),this.dispose()}}const bi=class bi extends te{constructor(){super(...arguments),this._onDidChangeNotification=this._register(new E),this.onDidChangeNotification=this._onDidChangeNotification.event,this._onDidChangeStatusMessage=this._register(new E),this.onDidChangeStatusMessage=this._onDidChangeStatusMessage.event,this._onDidChangeFilter=this._register(new E),this.onDidChangeFilter=this._onDidChangeFilter.event,this._notifications=[],this.filter={global:w.OFF,sources:new Map}}get notifications(){return this._notifications}get statusMessage(){return this._statusMessage}setFilter(e){let t=!1;typeof e.global=="number"&&(t=this.filter.global!==e.global,this.filter.global=e.global);let i=!1;e.sources&&(i=!jn(this.filter.sources,e.sources),this.filter.sources=e.sources),(t||i)&&this._onDidChangeFilter.fire({global:t?e.global:void 0,sources:i?e.sources:void 0})}addNotification(e){const t=this.createViewItem(e);return t?(this.findNotification(t)?.close(),this._notifications.splice(0,0,t),this._onDidChangeNotification.fire({item:t,index:0,kind:j.ADD}),new qa(t,s=>this.onClose(s))):bi.NO_OP_NOTIFICATION}onClose(e){const t=this.findNotification(e);t&&t!==e?t.close():e.close()}findNotification(e){return this._notifications.find(t=>t.equals(e))}createViewItem(e){const t=Kt.create(e,this.filter);if(!t)return;const i=(r,o)=>{const a=this._notifications.indexOf(t);a>=0&&this._onDidChangeNotification.fire({item:t,index:a,kind:r,detail:o})},s=t.onDidChangeExpansion(()=>i(j.EXPAND_COLLAPSE)),n=t.onDidChangeContent(r=>i(j.CHANGE,r.kind));return me.once(t.onDidClose)(()=>{s.dispose(),n.dispose();const r=this._notifications.indexOf(t);r>=0&&(this._notifications.splice(r,1),this._onDidChangeNotification.fire({item:t,index:r,kind:j.REMOVE}))}),t}showStatusMessage(e,t){const i=Ja.create(e,t);return i?(this._statusMessage=i,this._onDidChangeStatusMessage.fire({kind:vt.ADD,item:i}),{close:()=>{this._statusMessage===i&&(this._statusMessage=void 0,this._onDidChangeStatusMessage.fire({kind:vt.REMOVE,item:i}))}}):{close:()=>{}}}};bi.NO_OP_NOTIFICATION=new qn;let dn=bi;function ki(l){return l instanceof Kt}var ae;(function(l){l[l.SEVERITY=0]="SEVERITY",l[l.MESSAGE=1]="MESSAGE",l[l.ACTIONS=2]="ACTIONS",l[l.PROGRESS=3]="PROGRESS"})(ae||(ae={}));class ja extends te{constructor(){super(),this._onDidChange=this._register(new E),this.onDidChange=this._onDidChange.event,this._state=Object.create(null)}get state(){return this._state}infinite(){this._state.infinite||(this._state.infinite=!0,this._state.total=void 0,this._state.worked=void 0,this._state.done=void 0,this._onDidChange.fire())}done(){this._state.done||(this._state.done=!0,this._state.infinite=void 0,this._state.total=void 0,this._state.worked=void 0,this._onDidChange.fire())}total(e){this._state.total!==e&&(this._state.total=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire())}worked(e){typeof this._state.worked=="number"?this._state.worked+=e:this._state.worked=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire()}}const Le=class Le extends te{static create(e,t){if(!e||!e.message||Cn(e.message))return;let i;typeof e.severity=="number"?i=e.severity:i=q.Info;const s=Le.parseNotificationMessage(e.message);if(!s)return;let n;e.actions?n=e.actions:Zn(e.message)&&(n={primary:e.message.actions});let r=e.priority??we.DEFAULT;return(r===we.DEFAULT||r===we.OPTIONAL)&&i!==q.Error&&(t.global===w.ERROR?r=we.SILENT:bn(e.source)&&t.sources.get(e.source.id)===w.ERROR&&(r=we.SILENT)),new Le(e.id,i,e.sticky,r,s,e.source,e.progress,n)}static parseNotificationMessage(e){let t;if(e instanceof Error?t=qt(e,!1):typeof e=="string"&&(t=e),!t)return;const i=t;t.length>Le.MAX_MESSAGE_LENGTH&&(t=`${t.substr(0,Le.MAX_MESSAGE_LENGTH)}...`),t=t.replace(/(\r\n|\n|\r)/gm," ").trim();const s=$n(t);return{raw:i,linkedText:s,original:e}}constructor(e,t,i,s,n,r,o,a){super(),this.id=e,this._severity=t,this._sticky=i,this._priority=s,this._message=n,this._source=r,this._visible=!1,this._onDidChangeExpansion=this._register(new E),this.onDidChangeExpansion=this._onDidChangeExpansion.event,this._onDidClose=this._register(new E),this.onDidClose=this._onDidClose.event,this._onDidChangeContent=this._register(new E),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,o&&this.setProgress(o),this.setActions(a)}setProgress(e){e.infinite?this.progress.infinite():e.total&&(this.progress.total(e.total),e.worked&&this.progress.worked(e.worked))}setActions(e={primary:[],secondary:[]}){this._actions={primary:Array.isArray(e.primary)?e.primary:[],secondary:Array.isArray(e.secondary)?e.secondary:[]},this._expanded=e.primary&&e.primary.length>0}get canCollapse(){return!this.hasActions}get expanded(){return!!this._expanded}get severity(){return this._severity}get sticky(){if(this._sticky)return!0;const e=this.hasActions;return!!(e&&this._severity===q.Error||!e&&this._expanded||this._progress&&!this._progress.state.done)}get priority(){return this._priority}get hasActions(){return!this._actions||!this._actions.primary?!1:this._actions.primary.length>0}get hasProgress(){return!!this._progress}get progress(){return this._progress||(this._progress=this._register(new ja),this._register(this._progress.onDidChange(()=>this._onDidChangeContent.fire({kind:ae.PROGRESS})))),this._progress}get message(){return this._message}get source(){return typeof this._source=="string"?this._source:this._source?this._source.label:void 0}get sourceId(){return this._source&&typeof this._source!="string"&&"id"in this._source?this._source.id:void 0}get actions(){return this._actions}get visible(){return this._visible}updateSeverity(e){e!==this._severity&&(this._severity=e,this._onDidChangeContent.fire({kind:ae.SEVERITY}))}updateMessage(e){const t=Le.parseNotificationMessage(e);!t||t.raw===this._message.raw||(this._message=t,this._onDidChangeContent.fire({kind:ae.MESSAGE}))}updateActions(e){this.setActions(e),this._onDidChangeContent.fire({kind:ae.ACTIONS})}updateVisibility(e){this._visible!==e&&(this._visible=e,this._onDidChangeVisibility.fire(e))}expand(){this._expanded||!this.canCollapse||(this._expanded=!0,this._onDidChangeExpansion.fire())}collapse(e){!this._expanded||!this.canCollapse||(this._expanded=!1,e||this._onDidChangeExpansion.fire())}toggle(){this._expanded?this.collapse():this.expand()}close(){this._onDidClose.fire(),this.dispose()}equals(e){if(this.hasProgress||e.hasProgress)return!1;if(typeof this.id=="string"||typeof e.id=="string")return this.id===e.id;if(typeof this._source=="object"){if(this._source.label!==e.source||this._source.id!==e.sourceId)return!1}else if(this._source!==e.source)return!1;if(this._message.raw!==e.message.raw)return!1;const t=this._actions&&this._actions.primary||[],i=e.actions&&e.actions.primary||[];return En(t,i,(s,n)=>s.id+s.label===n.id+n.label)}};Le.MAX_MESSAGE_LENGTH=1e3;let Kt=Le;class di extends ie{constructor(e,t){super(e,t.label,void 0,!0,async()=>{t.run(),this._onDidRun.fire()}),this._onDidRun=this._register(new E),this.onDidRun=this._onDidRun.event,this._keepOpen=!!t.keepOpen,this._menu=!t.isSecondary&&t.menu?t.menu.map((i,s)=>new di(`${e}.${s}`,i)):void 0}get menu(){return this._menu}get keepOpen(){return this._keepOpen}}class Ja{static create(e,t){if(!e||Cn(e))return;let i;if(e instanceof Error?i=qt(e,!1):typeof e=="string"&&(i=e),!!i)return{message:i,options:t}}}const ts="notifications.showList",Xt="notifications.hideList",Qa="notifications.toggleList",Hi="notifications.hideToasts",un="notifications.focusToasts",ec="notifications.focusNextToast",tc="notifications.focusPreviousToast",ic="notifications.focusFirstToast",sc="notifications.focusLastToast",is="notification.collapse",ss="notification.expand",fn="notification.acceptPrimaryAction",nc="notification.toggle",ns="notification.clear",ui="notifications.clearAll",fi="notifications.toggleDoNotDisturbMode",gi="notifications.toggleDoNotDisturbModeBySource";function Ue(l,e){if(ki(e))return e;const t=l.lastFocusedList;if(t instanceof Os){let i=t.getFocusedElements()[0];if(ki(i)||t.isDOMFocused()&&(i=t.element(0)),ki(i))return i}}function rc(l,e,t){V.registerCommandAndKeybindingRule({id:ts,weight:B.WorkbenchContrib,primary:Jn(mt.CtrlCmd|b.KeyK,mt.CtrlCmd|mt.Shift|b.KeyN),handler:()=>{e.hide(),l.show()}}),V.registerCommandAndKeybindingRule({id:Xt,weight:B.WorkbenchContrib+50,when:Wi,primary:b.Escape,handler:()=>l.hide()}),We.registerCommand(Qa,()=>{l.isVisible?l.hide():(e.hide(),l.show())}),V.registerCommandAndKeybindingRule({id:ns,weight:B.WorkbenchContrib,when:ge,primary:b.Delete,mac:{primary:mt.CtrlCmd|b.Backspace},handler:(s,n)=>{const r=s.get(yi),o=Ue(s.get(pt),n);o&&!o.hasProgress&&(o.close(),r.playSignal(vi.clear))}}),V.registerCommandAndKeybindingRule({id:ss,weight:B.WorkbenchContrib,when:ge,primary:b.RightArrow,handler:(s,n)=>{Ue(s.get(pt),n)?.expand()}}),V.registerCommandAndKeybindingRule({id:fn,weight:B.WorkbenchContrib,when:P.or(ge,_e),primary:mt.CtrlCmd|mt.Shift|b.KeyA,handler:s=>{const n=s.get(O).createInstance(Zt),r=Ue(s.get(pt))||t.notifications.at(0);if(!r)return;const o=r.actions?.primary?r.actions.primary.at(0):void 0;o&&(n.run(o,r),r.close(),n.dispose())}}),V.registerCommandAndKeybindingRule({id:is,weight:B.WorkbenchContrib,when:ge,primary:b.LeftArrow,handler:(s,n)=>{Ue(s.get(pt),n)?.collapse()}}),V.registerCommandAndKeybindingRule({id:nc,weight:B.WorkbenchContrib,when:ge,primary:b.Space,secondary:[b.Enter],handler:s=>{Ue(s.get(pt))?.toggle()}}),We.registerCommand(Hi,s=>{e.hide()}),V.registerKeybindingRule({id:Hi,weight:B.WorkbenchContrib-50,when:_e,primary:b.Escape}),V.registerKeybindingRule({id:Hi,weight:B.WorkbenchContrib+100,when:P.and(_e,ge),primary:b.Escape}),We.registerCommand(un,()=>e.focus()),V.registerCommandAndKeybindingRule({id:ec,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.DownArrow,handler:()=>{e.focusNext()}}),V.registerCommandAndKeybindingRule({id:tc,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.UpArrow,handler:()=>{e.focusPrevious()}}),V.registerCommandAndKeybindingRule({id:ic,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.PageUp,secondary:[b.Home],handler:()=>{e.focusFirst()}}),V.registerCommandAndKeybindingRule({id:sc,weight:B.WorkbenchContrib,when:P.and(ge,_e),primary:b.PageDown,secondary:[b.End],handler:()=>{e.focusLast()}}),We.registerCommand(ui,()=>l.clearAll()),We.registerCommand(fi,s=>{const n=s.get(Pe);n.setFilter(n.getFilter()===w.ERROR?w.OFF:w.ERROR)}),We.registerCommand(gi,s=>{const n=s.get(Pe),r=s.get(Tn),o=n.getFilters().sort((f,m)=>f.label.localeCompare(m.label)),a=new L,c=a.add(r.createQuickPick());c.items=o.map(f=>({id:f.id,label:f.label,tooltip:`${f.label} (${f.id})`,filter:f.filter})),c.canSelectMany=!0,c.placeholder=g(3453,"Select sources to enable all notifications from"),c.selectedItems=c.items.filter(f=>f.filter===w.OFF),c.show(),a.add(c.onDidAccept(async()=>{for(const f of c.items)n.setFilter({id:f.id,label:f.label,filter:c.selectedItems.includes(f)?w.OFF:w.ERROR});c.hide()})),a.add(c.onDidHide(()=>a.dispose()))});const i=re(3454,"Notifications");Be.appendMenuItem(R.CommandPalette,{command:{id:ts,title:re(3455,"Show Notifications"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:Xt,title:re(3456,"Hide Notifications"),category:i},when:Wi}),Be.appendMenuItem(R.CommandPalette,{command:{id:ui,title:re(3457,"Clear All Notifications"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:fn,title:re(3458,"Accept Notification Primary Action"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:fi,title:re(3459,"Toggle Do Not Disturb Mode"),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:gi,title:re(3460,"Toggle Do Not Disturb Mode By Source..."),category:i}}),Be.appendMenuItem(R.CommandPalette,{command:{id:un,title:re(3461,"Focus Notification Toast"),category:i},when:_e})}let Zt=class extends Ms{constructor(e,t){super(),this.telemetryService=e,this.notificationService=t}async runAction(e,t){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.id,from:"message"});try{await super.runAction(e,t)}catch(i){this.notificationService.error(i)}}};Zt=y([u(0,_i),u(1,Pe)],Zt);const oc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));ke(zn);const ac=dt("notifications-clear",J.close,g(3426,"Icon for the clear action in notifications.")),cc=dt("notifications-clear-all",J.clearAll,g(3427,"Icon for the clear all action in notifications.")),hc=dt("notifications-hide",J.chevronDown,g(3428,"Icon for the hide action in notifications.")),lc=dt("notifications-expand",J.chevronUp,g(3429,"Icon for the expand action in notifications.")),dc=dt("notifications-collapse",J.chevronDown,g(3430,"Icon for the collapse action in notifications.")),uc=dt("notifications-configure",J.gear,g(3431,"Icon for the configure action in notifications.")),Un=dt("notifications-do-not-disturb",J.bellSlash,g(3432,"Icon for the mute all action in notifications."));var Xe;let Lt=(Xe=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(ac)),this.commandService=i}async run(e){this.commandService.executeCommand(ns,e)}},Xe.ID=ns,Xe.LABEL=g(3433,"Clear Notification"),Xe);Lt=y([u(2,Te)],Lt);var Ze;let Mt=(Ze=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(cc)),this.commandService=i}async run(){this.commandService.executeCommand(ui)}},Ze.ID=ui,Ze.LABEL=g(3434,"Clear All Notifications"),Ze);Mt=y([u(2,Te)],Mt);var $e;let mi=($e=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(Un)),this.commandService=i}async run(){this.commandService.executeCommand(fi)}},$e.ID=fi,$e.LABEL=g(3435,"Toggle Do Not Disturb Mode"),$e);mi=y([u(2,Te)],mi);var qe;let pi=(qe=class extends ie{constructor(e,t,i){super(e,t),this.commandService=i}async run(){this.commandService.executeCommand(gi)}},qe.ID=gi,qe.LABEL=g(3436,"Toggle Do Not Disturb Mode By Source..."),qe);pi=y([u(2,Te)],pi);const Ei=class Ei extends ie{constructor(e,t){super(e,t,W.asClassName(Un))}};Ei.ID="workbench.action.configureDoNotDisturbMode",Ei.LABEL=g(3437,"Configure Do Not Disturb...");let It=Ei;var je;let Ot=(je=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(hc)),this.commandService=i}async run(){this.commandService.executeCommand(Xt)}},je.ID=Xt,je.LABEL=g(3438,"Hide Notifications"),je);Ot=y([u(2,Te)],Ot);var Je;let xt=(Je=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(lc)),this.commandService=i}async run(e){this.commandService.executeCommand(ss,e)}},Je.ID=ss,Je.LABEL=g(3439,"Expand Notification"),Je);xt=y([u(2,Te)],xt);var Qe;let kt=(Qe=class extends ie{constructor(e,t,i){super(e,t,W.asClassName(dc)),this.commandService=i}async run(e){this.commandService.executeCommand(is,e)}},Qe.ID=is,Qe.LABEL=g(3440,"Collapse Notification"),Qe);kt=y([u(2,Te)],kt);const Ti=class Ti extends ie{constructor(e,t,i){super(e,t,W.asClassName(uc)),this.notification=i}};Ti.ID="workbench.action.configureNotification",Ti.LABEL=g(3441,"More Actions...");let Tt=Ti;var et;let Ht=(et=class extends ie{constructor(e,t,i){super(e,t),this.clipboardService=i}run(e){return this.clipboardService.writeText(e.message.raw)}},et.ID="workbench.action.copyNotificationMessage",et.LABEL=g(3442,"Copy Text"),et);Ht=y([u(2,Qn)],Ht);var rs,be;const Ee=class Ee{constructor(e){this.offsetHelper=this.createOffsetHelper(e)}createOffsetHelper(e){return e.appendChild(I(".notification-offset-helper"))}getHeight(e){if(!e.expanded)return Ee.ROW_HEIGHT;let t=Ee.ROW_HEIGHT;const i=this.computePreferredHeight(e);if(Ee.LINE_HEIGHT<i){const n=i-Ee.LINE_HEIGHT;t+=n}return(e.source||hi(e.actions&&e.actions.primary))&&(t+=Ee.ROW_HEIGHT),t===Ee.ROW_HEIGHT&&e.collapse(!0),t}computePreferredHeight(e){let t=0;e.hasProgress||t++,e.canCollapse&&t++,hi(e.actions&&e.actions.secondary)&&t++,this.offsetHelper.style.width=`${450-(40+t*30-Math.max(t-1,0)*4)}px`;const i=Yn.render(e.message);this.offsetHelper.appendChild(i);const s=Math.max(this.offsetHelper.offsetHeight,this.offsetHelper.scrollHeight);return ct(this.offsetHelper),s}getTemplateId(e){if(e instanceof Kt)return Ai.TEMPLATE_ID;throw new Error("unknown element type: "+e)}};Ee.ROW_HEIGHT=42,Ee.LINE_HEIGHT=22;let os=Ee;class Yn{static render(e,t){const i=I("span");for(const s of e.linkedText.nodes)if(typeof s=="string")i.appendChild(document.createTextNode(s));else{let n=s.title;!n&&s.href.startsWith("command:")?n=g(3483,"Click to execute command '{0}'",s.href.substr(8)):n||(n=s.href);const r=I("a",{href:s.href,title:n,tabIndex:0},s.label);if(t){const o=A=>{nr(A)&&De.stop(A,!0),t.callback(s.href)},a=t.toDispose.add(new Bi(r,Q.CLICK)).event,c=t.toDispose.add(new Bi(r,Q.KEY_DOWN)).event,f=me.chain(c,A=>A.filter(S=>{const x=new vn(S);return x.equals(b.Space)||x.equals(b.Enter)}));t.toDispose.add(ks.addTarget(r));const m=t.toDispose.add(new Bi(r,Hs.Tap)).event;me.any(a,m,f)(o,null,t.toDispose)}i.appendChild(r)}return i}}var tt;let Ai=(tt=class{constructor(e,t,i,s){this.actionRunner=e,this.contextMenuService=t,this.instantiationService=i,this.notificationService=s}get templateId(){return rs.TEMPLATE_ID}renderTemplate(e){const t=Object.create(null);t.toDispose=new L,t.container=I(".notification-list-item"),t.mainRow=I(".notification-list-item-main-row"),t.icon=I(".notification-list-item-icon.codicon"),t.message=I(".notification-list-item-message");const i=this,s=I(".notification-list-item-toolbar-container");return t.toolbar=new xs(s,{ariaLabel:g(3484,"Notification Actions"),actionViewItemProvider:(n,r)=>{if(n instanceof Tt)return t.toDispose.add(new yn(n,{getActions(){const o=[],a={id:n.notification.sourceId,label:n.notification.source};if(bn(a)){const c=i.notificationService.getFilter(a)===w.ERROR;o.push(ci({id:a.id,label:c?g(3485,"Turn On All Notifications from '{0}'",a.label):g(3486,"Turn Off Info and Warning Notifications from '{0}'",a.label),run:()=>i.notificationService.setFilter({...a,filter:c?w.OFF:w.ERROR})})),n.notification.actions?.secondary?.length&&o.push(new Ft)}return Array.isArray(n.notification.actions?.secondary)&&o.push(...n.notification.actions.secondary),o}},this.contextMenuService,{...r,actionRunner:this.actionRunner,classNames:n.class}))},actionRunner:this.actionRunner}),t.toDispose.add(t.toolbar),t.detailsRow=I(".notification-list-item-details-row"),t.source=I(".notification-list-item-source"),t.buttonsContainer=I(".notification-list-item-buttons-container"),e.appendChild(t.container),t.container.appendChild(t.detailsRow),t.detailsRow.appendChild(t.source),t.detailsRow.appendChild(t.buttonsContainer),t.container.appendChild(t.mainRow),t.mainRow.appendChild(t.icon),t.mainRow.appendChild(t.message),t.mainRow.appendChild(s),t.progress=new er(e,tr),t.toDispose.add(t.progress),t.renderer=this.instantiationService.createInstance(as,t,this.actionRunner),t.toDispose.add(t.renderer),t}renderElement(e,t,i){i.renderer.setInput(e)}disposeTemplate(e){Wt(e.toDispose)}},rs=tt,tt.TEMPLATE_ID="notification",tt);Ai=rs=y([u(1,ye),u(2,O),u(3,Pe)],Ai);var it;let as=(it=class extends te{constructor(e,t,i,s,n,r,o){super(),this.template=e,this.actionRunner=t,this.openerService=i,this.instantiationService=s,this.keybindingService=n,this.contextMenuService=r,this.hoverService=o,this.inputDisposables=this._register(new L),be.closeNotificationAction||(be.closeNotificationAction=s.createInstance(Lt,Lt.ID,Lt.LABEL),be.expandNotificationAction=s.createInstance(xt,xt.ID,xt.LABEL),be.collapseNotificationAction=s.createInstance(kt,kt.ID,kt.LABEL))}setInput(e){this.inputDisposables.clear(),this.render(e)}render(e){this.template.container.classList.toggle("expanded",e.expanded),this.inputDisposables.add(F(this.template.container,Q.MOUSE_UP,n=>{n.button===1&&De.stop(n,!0)})),this.inputDisposables.add(F(this.template.container,Q.AUXCLICK,n=>{!e.hasProgress&&n.button===1&&(De.stop(n,!0),e.close())})),this.renderSeverity(e);const t=this.inputDisposables.add(this.hoverService.setupManagedHover(Gi("mouse"),this.template.message,"")),i=this.renderMessage(e,t);this.renderSecondaryActions(e,i);const s=this.inputDisposables.add(this.hoverService.setupManagedHover(Gi("mouse"),this.template.source,""));this.renderSource(e,s),this.renderButtons(e),this.renderProgress(e),this.inputDisposables.add(e.onDidChangeContent(n=>{switch(n.kind){case ae.SEVERITY:this.renderSeverity(e);break;case ae.PROGRESS:this.renderProgress(e);break;case ae.MESSAGE:this.renderMessage(e,t);break}}))}renderSeverity(e){be.SEVERITIES.forEach(t=>{e.severity!==t&&this.template.icon.classList.remove(...W.asClassNameArray(this.toSeverityIcon(t)))}),this.template.icon.classList.add(...W.asClassNameArray(this.toSeverityIcon(e.severity)))}renderMessage(e,t){ct(this.template.message),this.template.message.appendChild(Yn.render(e.message,{callback:s=>this.openerService.open(wi.parse(s),{allowCommands:!0}),toDispose:this.inputDisposables}));const i=e.canCollapse&&!e.expanded&&this.template.message.scrollWidth>this.template.message.clientWidth;return t.update(i?this.template.message.textContent+"":""),i}renderSecondaryActions(e,t){const i=[];if(hi(e.actions?.secondary)){const n=this.instantiationService.createInstance(Tt,Tt.ID,Tt.LABEL,e);i.push(n),this.inputDisposables.add(n)}let s=!1;e.canCollapse&&(e.expanded||e.source||t)&&(s=!0),s&&i.push(e.expanded?be.collapseNotificationAction:be.expandNotificationAction),e.hasProgress||i.push(be.closeNotificationAction),this.template.toolbar.clear(),this.template.toolbar.context=e,i.forEach(n=>this.template.toolbar.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)}))}renderSource(e,t){e.expanded&&e.source?(this.template.source.textContent=g(3487,"Source: {0}",e.source),t.update(e.source)):(this.template.source.textContent="",t.update(""))}renderButtons(e){ct(this.template.buttonsContainer);const t=e.actions?e.actions.primary:void 0;if(e.expanded&&hi(t)){const i=this,s=this.inputDisposables.add(new class extends Ms{async runAction(r){i.actionRunner.run(r,e),(!(r instanceof di)||!r.keepOpen)&&e.close()}}),n=this.inputDisposables.add(new ir(this.template.buttonsContainer));for(let r=0;r<t.length;r++){const o=t[r],a={title:!0,secondary:r>0,...sr},c=o instanceof di?o.menu:void 0,f=this.inputDisposables.add(c?n.addButtonWithDropdown({...a,contextMenuProvider:this.contextMenuService,actions:c,actionRunner:s}):n.addButton(a));f.label=o.label,this.inputDisposables.add(f.onDidClick(m=>{m&&De.stop(m,!0),s.run(o)}))}}}renderProgress(e){if(!e.hasProgress){this.template.progress.stop().hide();return}const t=e.progress.state;t.infinite?this.template.progress.infinite().show():typeof t.total=="number"||typeof t.worked=="number"?(typeof t.total=="number"&&!this.template.progress.hasTotal()&&this.template.progress.total(t.total),typeof t.worked=="number"&&this.template.progress.setWorked(t.worked).show()):this.template.progress.done().hide()}toSeverityIcon(e){switch(e){case q.Warning:return J.warning;case q.Error:return J.error}return J.info}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}},be=it,it.SEVERITIES=[q.Info,q.Warning,q.Error],it);as=be=y([u(2,rr),u(3,O),u(4,ut),u(5,ye),u(6,Fs)],as);ke(oc);let Si=class extends te{constructor(e,t,i,s){super(),this.container=e,this.options=t,this.instantiationService=i,this.contextMenuService=s,this.viewModel=[]}show(){this.isVisible||(this.list||this.createNotificationsList(),this.isVisible=!0)}createNotificationsList(){this.listContainer=I(".notifications-list-container");const e=this._register(this.instantiationService.createInstance(Zt)),t=this.instantiationService.createInstance(Ai,e),i=this.listDelegate=new os(this.listContainer),s=this.options,n=this.list=this._register(this.instantiationService.createInstance(Os,"NotificationsList",this.listContainer,i,[t],{...s,setRowLineHeight:!1,horizontalScrolling:!1,overrideStyles:{listBackground:_n},accessibilityProvider:this.instantiationService.createInstance(cs,s)})),r=this._register(this.instantiationService.createInstance(Ht,Ht.ID,Ht.LABEL));this._register(n.onContextMenu(a=>{a.element&&this.contextMenuService.showContextMenu({getAnchor:()=>a.anchor,getActions:()=>[r],getActionsContext:()=>a.element,actionRunner:e})})),this._register(n.onMouseDblClick(a=>a.element.toggle()));const o=this._register(or(n.getHTMLElement()));this._register(o.onDidBlur(()=>{K(this.listContainer).document.hasFocus()&&n.setFocus([])})),ge.bindTo(n.contextKeyService),this._register(n.onDidChangeSelection(a=>{a.indexes.length>0&&n.setSelection([])})),this.container.appendChild(this.listContainer)}updateNotificationsList(e,t,i=[]){const[s,n]=Nt(this.list,this.listContainer),r=ht(n),o=s.getFocus()[0],a=this.viewModel[o];let c=null;if(typeof o=="number"&&(c=s.getRelativeTop(o)),this.viewModel.splice(e,t,...i),s.splice(e,t,i),s.layout(),this.viewModel.length===0)this.hide();else if(typeof o=="number"){let f=0;if(a){let m=this.viewModel.indexOf(a);m===-1&&(m=o-1),m<this.viewModel.length&&m>=0&&(f=m)}typeof c=="number"&&s.reveal(f,c),s.setFocus([f])}this.isVisible&&r&&s.domFocus()}updateNotificationHeight(e){const t=this.viewModel.indexOf(e);if(t===-1)return;const[i,s]=Nt(this.list,this.listDelegate);i.updateElementHeight(t,s.getHeight(e)),i.layout()}hide(){!this.isVisible||!this.list||(this.isVisible=!1,this.list.splice(0,this.viewModel.length),this.viewModel=[])}focusFirst(){this.list&&(this.list.focusFirst(),this.list.domFocus())}hasFocus(){return this.listContainer?ht(this.listContainer):!1}layout(e,t){this.listContainer&&this.list&&(this.listContainer.style.width=`${e}px`,typeof t=="number"&&(this.list.getHTMLElement().style.maxHeight=`${t}px`),this.list.layout())}dispose(){this.hide(),super.dispose()}};Si=y([u(2,O),u(3,ye)],Si);let cs=class{constructor(e,t,i){this._options=e,this._keybindingService=t,this._configurationService=i}getAriaLabel(e){let t;const i=this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel();return this._configurationService.getValue("accessibility.verbosity.notification")&&(t=i?g(3462,"Inspect the response in the accessible view with {0}",i):g(3463,"Inspect the response in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding")),e.source?Gt(t?g(3466,"{0}, source: {1}, notification, {2}",e.message.raw,e.source,t):g(3467,"{0}, source: {1}, notification",e.message.raw,e.source),e.severity):Gt(t?g(3464,"{0}, notification, {1}",e.message.raw,t):g(3465,"{0}, notification",e.message.raw),e.severity)}getWidgetAriaLabel(){return this._options.widgetAriaLabel??g(3468,"Notifications List")}getRole(){return"dialog"}};cs=y([u(1,ut),u(2,ee)],cs);var At;ke($a);ke(zn);var xe;let hs=(xe=class extends wn{constructor(e,t,i,s,n,r,o,a,c,f,m){super(i),this.container=e,this.model=t,this.instantiationService=s,this.layoutService=n,this.editorGroupService=o,this.keybindingService=a,this.notificationService=c,this.accessibilitySignalService=f,this.contextMenuService=m,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.notificationsCenterVisibleContextKey=Wi.bindTo(r),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(lt.lift(e)))),this._register(this.notificationService.onDidChangeFilter(()=>this.onDidChangeFilter()))}onDidChangeFilter(){this.notificationService.getFilter()===w.ERROR&&this.hide()}get isVisible(){return!!this._isVisible}show(){if(this._isVisible){const i=de(this.notificationsList);i.show(),i.focusFirst();return}this.notificationsCenterContainer||this.create(),this.updateTitle();const[e,t]=Nt(this.notificationsList,this.notificationsCenterContainer);this._isVisible=!0,t.classList.add("visible"),e.show(),this.layout(this.workbenchDimensions),e.updateNotificationsList(0,0,this.model.notifications),e.focusFirst(),this.updateStyles(),this.model.notifications.forEach(i=>i.updateVisibility(!0)),this.notificationsCenterVisibleContextKey.set(!0),this._onDidChangeVisibility.fire()}updateTitle(){const[e,t]=Nt(this.notificationsCenterTitle,this.clearAllAction);this.model.notifications.length===0?(e.textContent=g(3446,"No new notifications"),t.enabled=!1):(e.textContent=g(3447,"Notifications"),t.enabled=this.model.notifications.some(i=>!i.hasProgress))}create(){this.notificationsCenterContainer=I(".notifications-center"),this.notificationsCenterHeader=I(".notifications-center-header"),this.notificationsCenterContainer.appendChild(this.notificationsCenterHeader),this.notificationsCenterTitle=I("span.notifications-center-header-title"),this.notificationsCenterHeader.appendChild(this.notificationsCenterTitle);const e=I(".notifications-center-header-toolbar");this.notificationsCenterHeader.appendChild(e);const t=this._register(this.instantiationService.createInstance(Zt)),i=this,s=this._register(new xs(e,{ariaLabel:g(3448,"Notification Center Actions"),actionRunner:t,actionViewItemProvider:(r,o)=>{if(r.id===It.ID)return this._register(this.instantiationService.createInstance(yn,r,{getActions(){const a=[ci({id:mi.ID,label:i.notificationService.getFilter()===w.OFF?g(3449,"Enable Do Not Disturb Mode"):g(3450,"Disable Do Not Disturb Mode"),run:()=>i.notificationService.setFilter(i.notificationService.getFilter()===w.OFF?w.ERROR:w.OFF)})],c=i.notificationService.getFilters().sort((f,m)=>f.label.localeCompare(m.label));for(const f of c.slice(0,At.MAX_NOTIFICATION_SOURCES))a.length===1&&a.push(new Ft),a.push(ci({id:`${mi.ID}.${f.id}`,label:f.label,checked:f.filter!==w.ERROR,run:()=>i.notificationService.setFilter({...f,filter:f.filter===w.ERROR?w.OFF:w.ERROR})}));return c.length>At.MAX_NOTIFICATION_SOURCES&&(a.push(new Ft),a.push(i._register(i.instantiationService.createInstance(pi,pi.ID,g(3451,"More…"))))),a}},this.contextMenuService,{...o,actionRunner:t,classNames:r.class,keybindingProvider:a=>this.keybindingService.lookupKeybinding(a.id)}))}}));this.clearAllAction=this._register(this.instantiationService.createInstance(Mt,Mt.ID,Mt.LABEL)),s.push(this.clearAllAction,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(this.clearAllAction)}),this.configureDoNotDisturbAction=this._register(this.instantiationService.createInstance(It,It.ID,It.LABEL)),s.push(this.configureDoNotDisturbAction,{icon:!0,label:!1});const n=this._register(this.instantiationService.createInstance(Ot,Ot.ID,Ot.LABEL));s.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)}),this.notificationsList=this.instantiationService.createInstance(Si,this.notificationsCenterContainer,{widgetAriaLabel:g(3452,"Notifications Center")}),this.container.appendChild(this.notificationsCenterContainer)}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}onDidChangeNotification(e){if(!this._isVisible)return;let t=!1;const[i,s]=Nt(this.notificationsList,this.notificationsCenterContainer);switch(e.kind){case j.ADD:i.updateNotificationsList(e.index,0,[e.item]),e.item.updateVisibility(!0);break;case j.CHANGE:switch(e.detail){case ae.ACTIONS:i.updateNotificationsList(e.index,1,[e.item]);break;case ae.MESSAGE:e.item.expanded&&i.updateNotificationHeight(e.item);break}break;case j.EXPAND_COLLAPSE:i.updateNotificationsList(e.index,1,[e.item]);break;case j.REMOVE:t=ht(s),i.updateNotificationsList(e.index,1),e.item.updateVisibility(!1);break}this.updateTitle(),this.model.notifications.length===0&&(this.hide(),t&&this.editorGroupService.activeGroup.focus())}hide(){if(!this._isVisible||!this.notificationsCenterContainer||!this.notificationsList)return;const e=ht(this.notificationsCenterContainer);this._isVisible=!1,this.notificationsCenterContainer.classList.remove("visible"),this.notificationsList.hide(),this.model.notifications.forEach(t=>t.updateVisibility(!1)),this.notificationsCenterVisibleContextKey.set(!1),this._onDidChangeVisibility.fire(),e&&this.editorGroupService.activeGroup.focus()}updateStyles(){if(this.notificationsCenterContainer&&this.notificationsCenterHeader){const e=this.getColor(Rn);this.notificationsCenterContainer.style.boxShadow=e?`0 0 8px 2px ${e}`:"";const t=this.getColor(ar);this.notificationsCenterContainer.style.border=t?`1px solid ${t}`:"";const i=this.getColor(cr);this.notificationsCenterHeader.style.color=i??"";const s=this.getColor(hr);this.notificationsCenterHeader.style.background=s??""}}layout(e){if(this.workbenchDimensions=e,this._isVisible&&this.notificationsCenterContainer){const t=At.MAX_DIMENSIONS.width,i=At.MAX_DIMENSIONS.height;let s=t,n=i;this.workbenchDimensions&&(s=this.workbenchDimensions.width,s-=16,n=this.workbenchDimensions.height-35,this.layoutService.isVisible(h.STATUSBAR_PART,C)&&(n-=22),this.layoutService.isVisible(h.TITLEBAR_PART,C)&&(n-=22),n-=24),de(this.notificationsList).layout(Math.min(t,s),Math.min(i,n))}}clearAll(){this.hide();for(const e of[...this.model.notifications])e.hasProgress||e.close(),this.accessibilitySignalService.playSignal(vi.clear)}},At=xe,xe.MAX_DIMENSIONS=new lt(450,400),xe.MAX_NOTIFICATION_SOURCES=10,xe);hs=At=y([u(2,ue),u(3,O),u(4,ce),u(5,Ie),u(6,ft),u(7,ut),u(8,Pe),u(9,yi),u(10,ye)],hs);class fc extends te{constructor(e){super(),this.model=e;for(const t of e.notifications)this.triggerAriaAlert(t);this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}onDidChangeNotification(e){e.kind===j.ADD&&(this.triggerAriaAlert(e.item),e.item.severity===q.Error&&(e.item.message.original instanceof Error?console.error(e.item.message.original):console.error(qt(e.item.message.linkedText.toString(),!0))))}triggerAriaAlert(e){if(e.priority===we.SILENT)return;const t=e.onDidChangeContent(i=>{i.kind===ae.MESSAGE&&this.doTriggerAriaAlert(e)});me.once(e.onDidClose)(()=>t.dispose()),this.doTriggerAriaAlert(e)}doTriggerAriaAlert(e){let t;e.severity===q.Error?t=g(3443,"Error: {0}",e.message.linkedText.toString()):e.severity===q.Warning?t=g(3444,"Warning: {0}",e.message.linkedText.toString()):t=g(3445,"Info: {0}",e.message.linkedText.toString()),lr(t)}}let ls=class extends te{constructor(e,t,i){super(),this.model=e,this.statusbarService=t,this.notificationService=i,this.newNotificationsCount=0,this.isNotificationsCenterVisible=!1,this.isNotificationsToastsVisible=!1,this.updateNotificationsCenterStatusItem(),e.statusMessage&&this.doSetStatusMessage(e.statusMessage),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.model.onDidChangeStatusMessage(e=>this.onDidChangeStatusMessage(e))),this._register(this.notificationService.onDidChangeFilter(()=>this.updateNotificationsCenterStatusItem()))}onDidChangeNotification(e){this.isNotificationsCenterVisible||(e.kind===j.ADD?this.newNotificationsCount++:e.kind===j.REMOVE&&this.newNotificationsCount>0&&this.newNotificationsCount--),this.updateNotificationsCenterStatusItem()}updateNotificationsCenterStatusItem(){let e=0;if(!this.isNotificationsCenterVisible&&!this.isNotificationsToastsVisible)for(const i of this.model.notifications)i.hasProgress&&e++;let t={name:g(3469,"Notifications"),text:`${e>0||this.newNotificationsCount>0?"$(bell-dot)":"$(bell)"}`,ariaLabel:g(3469,"Notifications"),command:this.isNotificationsCenterVisible?Xt:ts,tooltip:this.getTooltip(e),showBeak:this.isNotificationsCenterVisible};this.notificationService.getFilter()===w.ERROR&&(t={...t,text:`${e>0||this.newNotificationsCount>0?"$(bell-slash-dot)":"$(bell-slash)"}`,ariaLabel:g(3470,"Do Not Disturb"),tooltip:g(3471,"Do Not Disturb Mode is Enabled")}),this.notificationsCenterStatusItem?this.notificationsCenterStatusItem.update(t):this.notificationsCenterStatusItem=this.statusbarService.addEntry(t,"status.notifications",$.RIGHT,Number.NEGATIVE_INFINITY)}getTooltip(e){return this.isNotificationsCenterVisible?g(3472,"Hide Notifications"):this.model.notifications.length===0?g(3473,"No Notifications"):e===0?this.newNotificationsCount===0?g(3474,"No New Notifications"):this.newNotificationsCount===1?g(3475,"1 New Notification"):g(3476,"{0} New Notifications",this.newNotificationsCount):this.newNotificationsCount===0?g(3477,"No New Notifications ({0} in progress)",e):this.newNotificationsCount===1?g(3478,"1 New Notification ({0} in progress)",e):g(3479,"{0} New Notifications ({1} in progress)",this.newNotificationsCount,e)}update(e,t){let i=!1;this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.newNotificationsCount=0,i=!0),this.isNotificationsToastsVisible!==t&&(this.isNotificationsToastsVisible=t,i=!0),i&&this.updateNotificationsCenterStatusItem()}onDidChangeStatusMessage(e){const t=e.item;switch(e.kind){case vt.ADD:this.doSetStatusMessage(t);break;case vt.REMOVE:this.currentStatusMessage&&this.currentStatusMessage[0]===t&&(Wt(this.currentStatusMessage[1]),this.currentStatusMessage=void 0);break}}doSetStatusMessage(e){const t=e.message,i=e.options&&typeof e.options.showAfter=="number"?e.options.showAfter:0,s=e.options&&typeof e.options.hideAfter=="number"?e.options.hideAfter:-1;this.currentStatusMessage&&Wt(this.currentStatusMessage[1]);let n,r=setTimeout(()=>{n=this.statusbarService.addEntry({name:g(3480,"Status Message"),text:t,ariaLabel:t},"status.message",$.LEFT,Number.NEGATIVE_INFINITY),r=void 0},i),o;const a={dispose:()=>{r&&clearTimeout(r),o&&clearTimeout(o),n?.dispose()}};s>0&&(o=setTimeout(()=>a.dispose(),s)),this.currentStatusMessage=[e,a]}};ls=y([u(1,Ve),u(2,Pe)],ls);const gc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ge;ke(gc);var Ae;(function(l){l[l.HIDDEN_OR_VISIBLE=0]="HIDDEN_OR_VISIBLE",l[l.HIDDEN=1]="HIDDEN",l[l.VISIBLE=2]="VISIBLE"})(Ae||(Ae={}));var Se;let ds=(Se=class extends wn{get isVisible(){return!!this._isVisible}constructor(e,t,i,s,n,r,o,a,c){super(n),this.container=e,this.model=t,this.instantiationService=i,this.layoutService=s,this.editorGroupService=r,this.lifecycleService=a,this.hostService=c,this._onDidChangeVisibility=this._register(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._isVisible=!1,this.mapNotificationToToast=new Map,this.mapNotificationToDisposable=new Map,this.addedToastsIntervalCounter=new dr(Ge.SPAM_PROTECTION.interval),this.notificationsToastsVisibleContextKey=_e.bindTo(o),this.registerListeners()}registerListeners(){this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(lt.lift(e)))),this.lifecycleService.when(Vt.Restored).then(()=>{this.model.notifications.forEach(e=>this.addToast(e)),this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}),this._register(this.model.onDidChangeFilter(({global:e,sources:t})=>{if(e===w.ERROR)this.hide();else if(t)for(const[i]of this.mapNotificationToToast)typeof i.sourceId=="string"&&t.get(i.sourceId)===w.ERROR&&i.severity!==q.Error&&i.priority!==we.URGENT&&this.removeToast(i)}))}onDidChangeNotification(e){switch(e.kind){case j.ADD:return this.addToast(e.item);case j.REMOVE:return this.removeToast(e.item)}}addToast(e){if(this.isNotificationsCenterVisible||e.priority===we.SILENT)return;if(e.priority===we.OPTIONAL){const i=zi();if(Ri(i)&&ur(i)&&fr(i,this.layoutService.mainContainer))return}if(this.addedToastsIntervalCounter.increment()>Ge.SPAM_PROTECTION.limit)return;const t=new L;this.mapNotificationToDisposable.set(e,t),t.add(gr(K(this.container),()=>this.doAddToast(e,t)))}doAddToast(e,t){let i=this.notificationsToastsContainer;i||(i=this.notificationsToastsContainer=I(".notifications-toasts"),this.container.appendChild(i)),i.classList.add("visible");const s=I(".notification-toast-container"),n=i.firstChild;n?i.insertBefore(s,n):i.appendChild(s);const r=I(".notification-toast");s.appendChild(r);const o=this.instantiationService.createInstance(Si,r,{verticalScrollMode:mr.Hidden,widgetAriaLabel:e.source?Gt(g(3482,"{0}, source: {1}, notification",e.message.raw,e.source),e.severity):Gt(g(3481,"{0}, notification",e.message.raw),e.severity)});t.add(o);const a={item:e,list:o,container:s,toast:r};this.mapNotificationToToast.set(e,a),t.add(Ne(()=>this.updateToastVisibility(a,!1))),o.show();const c=this.computeMaxDimensions();this.layoutLists(c.width),o.updateNotificationsList(0,0,[e]),this.layoutContainer(c.height),t.add(e.onDidChangeExpansion(()=>{o.updateNotificationsList(0,1,[e])})),t.add(e.onDidChangeContent(f=>{switch(f.kind){case ae.ACTIONS:o.updateNotificationsList(0,1,[e]);break;case ae.MESSAGE:e.expanded&&o.updateNotificationHeight(e);break}})),me.once(e.onDidClose)(()=>{this.removeToast(e)}),this.purgeNotification(e,s,o,t),this.updateStyles(),this.notificationsToastsVisibleContextKey.set(!0),r.classList.add("notification-fade-in"),t.add(F(r,"transitionend",()=>{r.classList.remove("notification-fade-in"),r.classList.add("notification-fade-in-done")})),e.updateVisibility(!0),this._isVisible||(this._isVisible=!0,this._onDidChangeVisibility.fire())}purgeNotification(e,t,i,s){let n=!1;s.add(F(t,Q.MOUSE_OVER,()=>n=!0)),s.add(F(t,Q.MOUSE_OUT,()=>n=!1));let r,o;const a=()=>{r=setTimeout(()=>{this.hostService.hasFocus?e.sticky||i.hasFocus()||n?a():this.removeToast(e):o||(o=this.hostService.onDidChangeFocus(c=>{c&&a()}),s.add(o))},Ge.PURGE_TIMEOUT[e.severity])};a(),s.add(Ne(()=>clearTimeout(r)))}removeToast(e){let t=!1;const i=this.mapNotificationToToast.get(e);i&&(ht(i.container)&&(t=!(this.focusNext()||this.focusPrevious())),this.mapNotificationToToast.delete(e));const s=this.mapNotificationToDisposable.get(e);s&&(Wt(s),this.mapNotificationToDisposable.delete(e)),this.mapNotificationToToast.size>0?this.layout(this.workbenchDimensions):(this.doHide(),t&&this.editorGroupService.activeGroup.focus())}removeToasts(){this.mapNotificationToToast.clear(),this.mapNotificationToDisposable.forEach(e=>Wt(e)),this.mapNotificationToDisposable.clear(),this.doHide()}doHide(){this.notificationsToastsContainer?.classList.remove("visible"),this.notificationsToastsVisibleContextKey.set(!1),this._isVisible&&(this._isVisible=!1,this._onDidChangeVisibility.fire())}hide(){const e=this.notificationsToastsContainer?ht(this.notificationsToastsContainer):!1;this.removeToasts(),e&&this.editorGroupService.activeGroup.focus()}focus(){const e=this.getToasts(Ae.VISIBLE);return e.length>0?(e[0].list.focusFirst(),!0):!1}focusNext(){const e=this.getToasts(Ae.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t+1];if(s)return s.list.focusFirst(),!0;break}return!1}focusPrevious(){const e=this.getToasts(Ae.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t-1];if(s)return s.list.focusFirst(),!0;break}return!1}focusFirst(){const e=this.getToasts(Ae.VISIBLE)[0];return e?(e.list.focusFirst(),!0):!1}focusLast(){const e=this.getToasts(Ae.VISIBLE);return e.length>0?(e[e.length-1].list.focusFirst(),!0):!1}update(e){this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.isNotificationsCenterVisible&&this.removeToasts())}updateStyles(){this.mapNotificationToToast.forEach(({toast:e})=>{const t=this.getColor(_n);e.style.background=t||"";const i=this.getColor(Rn);e.style.boxShadow=i?`0 0 8px 2px ${i}`:"";const s=this.getColor(pr);e.style.border=s?`1px solid ${s}`:""})}getToasts(e){const t=[];return this.mapNotificationToToast.forEach(i=>{switch(e){case Ae.HIDDEN_OR_VISIBLE:t.push(i);break;case Ae.HIDDEN:this.isToastInDOM(i)||t.push(i);break;case Ae.VISIBLE:this.isToastInDOM(i)&&t.push(i);break}}),t.reverse()}layout(e){this.workbenchDimensions=e;const t=this.computeMaxDimensions();t.height&&this.layoutContainer(t.height),this.layoutLists(t.width)}computeMaxDimensions(){const e=Ge.MAX_WIDTH;let t=e,i;return this.workbenchDimensions&&(t=this.workbenchDimensions.width,t-=16,i=this.workbenchDimensions.height,this.layoutService.isVisible(h.STATUSBAR_PART,C)&&(i-=22),this.layoutService.isVisible(h.TITLEBAR_PART,C)&&(i-=22),i-=24),new lt(Math.min(e,t),i??0)}layoutLists(e){this.mapNotificationToToast.forEach(({list:t})=>t.layout(e))}layoutContainer(e){let t=e,i=Math.round(e*.618),s=0;for(const n of this.getToasts(Ae.HIDDEN_OR_VISIBLE)){n.container.style.opacity="0",this.updateToastVisibility(n,!0),t-=n.container.offsetHeight,i-=n.container.offsetHeight;let r=!1;s===Ge.MAX_NOTIFICATIONS?r=!1:(s===0&&t>=0||s>0&&i>=0)&&(r=!0),this.updateToastVisibility(n,r),n.container.style.opacity="",r&&s++}}updateToastVisibility(e,t){if(this.isToastInDOM(e)===t)return;const i=de(this.notificationsToastsContainer);t?i.appendChild(e.container):e.container.remove(),e.item.updateVisibility(t)}isToastInDOM(e){return!!e.container.parentElement}},Ge=Se,Se.MAX_WIDTH=450,Se.MAX_NOTIFICATIONS=3,Se.PURGE_TIMEOUT={[q.Info]:1e4,[q.Warning]:12e3,[q.Error]:15e3},Se.SPAM_PROTECTION={interval:800,limit:Se.MAX_NOTIFICATIONS},Se);ds=Ge=y([u(2,O),u(3,ce),u(4,ue),u(5,ft),u(6,Ie),u(7,li),u(8,_t)],ds);const gn=new Ar("coreExperimentation.startupExpGroup","");var Y;(function(l){l.Control="control",l.MaximizedChat="maximizedChat",l.SplitEmptyEditorChat="splitEmptyEditorChat",l.SplitWelcomeChat="splitWelcomeChat"})(Y||(Y={}));const us="startup",mc={stable:{experimentName:us,targetPercentage:20,groups:[{name:Y.Control,min:0,max:.25,iteration:1},{name:Y.MaximizedChat,min:.25,max:.5,iteration:1},{name:Y.SplitEmptyEditorChat,min:.5,max:.75,iteration:1},{name:Y.SplitWelcomeChat,min:.75,max:1,iteration:1}]},insider:{experimentName:us,targetPercentage:50,groups:[{name:Y.Control,min:0,max:.25,iteration:1},{name:Y.MaximizedChat,min:.25,max:.5,iteration:1},{name:Y.SplitEmptyEditorChat,min:.5,max:.75,iteration:1},{name:Y.SplitWelcomeChat,min:.75,max:1,iteration:1}]}};let mn=class extends te{constructor(e,t,i,s,n){super(),this.storageService=e,this.telemetryService=t,this.productService=i,this.contextKeyService=s,this.environmentService=n,this.experiments=new Map,!(n.disableExperiments||n.enableSmokeTestDriver||n.extensionTestsLocationURI)&&this.initializeExperiments()}initializeExperiments(){const e=this.storageService.get(Cr,p.APPLICATION)||new Date().toUTCString();if((+new Date-+new Date(e))/1e3/60/60/24>1)return;const i=this.getExperimentConfiguration();if(!i)return;const s=`coreExperimentation.${i.experimentName}`,n=this.storageService.get(s,p.APPLICATION);if(n)try{const o=JSON.parse(n);this.experiments.set(i.experimentName,o),gn.bindTo(this.contextKeyService).set(o.experimentGroup);return}catch{this.storageService.remove(s,p.APPLICATION);return}const r=this.createStartupExperiment(i.experimentName,i);r&&(this.experiments.set(i.experimentName,r),this.sendExperimentTelemetry(i.experimentName,r),gn.bindTo(this.contextKeyService).set(r.experimentGroup),this.storageService.store(s,JSON.stringify(r),p.APPLICATION,D.MACHINE))}getExperimentConfiguration(){const e=this.productService.quality;if(e)return mc[e]}createStartupExperiment(e,t){const i=this.environmentService.startupExperimentGroup;if(i){const r=t.groups.find(o=>o.name===i);return r?{cohort:1,subCohort:1,experimentGroup:r.name,iteration:r.iteration,isInExperiment:!0}:void 0}const s=Math.random();if(s>=t.targetPercentage/100)return;const n=s/(t.targetPercentage/100);for(const r of t.groups)if(n>=r.min&&n<r.max)return{cohort:s,subCohort:n,experimentGroup:r.name,iteration:r.iteration,isInExperiment:!0}}sendExperimentTelemetry(e,t){this.telemetryService.publicLog2("coreExperimentation.experimentCohort",{experimentName:e,cohort:t.cohort,subCohort:t.subCohort,experimentGroup:t.experimentGroup,iteration:t.iteration,isInExperiment:t.isInExperiment})}getExperiment(){return this.experiments.get(us)}};mn=y([u(0,he),u(1,_i),u(2,Sr),u(3,Ie),u(4,Ir)],mn);var N;(function(l){l.SIDEBAR_HIDDEN="nosidebar",l.MAIN_EDITOR_AREA_HIDDEN="nomaineditorarea",l.PANEL_HIDDEN="nopanel",l.AUXILIARYBAR_HIDDEN="noauxiliarybar",l.STATUSBAR_HIDDEN="nostatusbar",l.FULLSCREEN="fullscreen",l.MAXIMIZED="maximized",l.WINDOW_BORDER="border"})(N||(N={}));const pc=["chat.commandCenter.enabled","workbench.navigationControl.enabled","workbench.experimental.share.enabled"],Ac=[_.ACTIVITY_BAR_LOCATION,_.COMMAND_CENTER,...pc,_.EDITOR_ACTIONS_LOCATION,_.LAYOUT_ACTIONS,Gs.MenuBarVisibility,X.TITLE_BAR_STYLE,X.CUSTOM_TITLE_BAR_VISIBILITY],pn=new lt(en.width,en.height);class Sc extends te{get activeContainer(){return this.getContainerFromDocument(Dn())}get containers(){const e=[];for(const{window:t}of br())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}whenContainerStylesLoaded(e){return this.containerStylesLoaded.get(e.vscodeWindowId)}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){return this.getContainerDimension(this.activeContainer)}getContainerDimension(e){return e===this.mainContainer?this.mainContainerDimension:Li(e)}get mainContainerOffset(){return this.computeContainerOffset(C)}get activeContainerOffset(){return this.computeContainerOffset(K(this.activeContainer))}computeContainerOffset(e){let t=0,i=0;this.isVisible(h.BANNER_PART)&&(t=this.getPart(h.BANNER_PART).maximumHeight,i=t);const s=this.isVisible(h.TITLEBAR_PART,e);return s&&(t+=this.getPart(h.TITLEBAR_PART).maximumHeight,i=t),s&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1&&(i=6),{top:t,quickPickTop:i}}constructor(e,t){super(),this.parent=e,this.layoutOptions=t,this._onDidChangeZenMode=this._register(new E),this.onDidChangeZenMode=this._onDidChangeZenMode.event,this._onDidChangeMainEditorCenteredLayout=this._register(new E),this.onDidChangeMainEditorCenteredLayout=this._onDidChangeMainEditorCenteredLayout.event,this._onDidChangePanelAlignment=this._register(new E),this.onDidChangePanelAlignment=this._onDidChangePanelAlignment.event,this._onDidChangeWindowMaximized=this._register(new E),this.onDidChangeWindowMaximized=this._onDidChangeWindowMaximized.event,this._onDidChangePanelPosition=this._register(new E),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangePartVisibility=this._register(new E),this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this._onDidChangeNotificationsVisibility=this._register(new E),this.onDidChangeNotificationsVisibility=this._onDidChangeNotificationsVisibility.event,this._onDidChangeAuxiliaryBarMaximized=this._register(new E),this.onDidChangeAuxiliaryBarMaximized=this._onDidChangeAuxiliaryBarMaximized.event,this._onDidLayoutMainContainer=this._register(new E),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new E),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidLayoutContainer=this._register(new E),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new E),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidChangeActiveContainer=this._register(new E),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainer=zt("div"),this.containerStylesLoaded=new Map,this.parts=new Map,this.initialized=!1,this.disposed=!1,this._openedDefaultEditors=!1,this.whenReadyPromise=new Zs,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Zs,this.whenRestored=this.whenRestoredPromise.p,this.restored=!1,this.inMaximizedAuxiliaryBarTransition=!1,Er(e)}initLayout(e){this.environmentService=e.get(jt),this.configurationService=e.get(ee),this.hostService=e.get(_t),this.contextService=e.get(Di),this.storageService=e.get(he),this.themeService=e.get(ue),this.extensionService=e.get(Tr),this.logService=e.get(Pn),this.telemetryService=e.get(_i),this.auxiliaryWindowService=e.get(yr),this.editorService=e.get(wt),this.editorGroupService=e.get(ft),this.mainPartEditorService=this.editorService.createScoped(this.editorGroupService.mainPart,this._store),this.paneCompositeService=e.get(vr),this.viewDescriptorService=e.get(_r),this.titleService=e.get(Ws),this.notificationService=e.get(Pe),this.statusBarService=e.get(Ve),e.get(gt),this.registerLayoutListeners(),this.initLayoutState(e.get(li),e.get(wr),e.get(Rr))}registerLayoutListeners(){const e=()=>{this.isVisible(h.EDITOR_PART,C)||(this.isAuxiliaryBarMaximized()?this.toggleMaximizedAuxiliaryBar():this.toggleMaximizedPanel())};this.editorGroupService.whenRestored.then(()=>{this._register(this.mainPartEditorService.onDidVisibleEditorsChange(e)),this._register(this.editorGroupService.mainPart.onDidActivateGroup(e)),this._register(this.mainPartEditorService.onDidActiveEditorChange(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED))))}),this._register(this.configurationService.onDidChangeConfiguration(i=>{if([...Ac,se.SIDEBAR_POSITION,se.STATUSBAR_VISIBLE].some(s=>i.affectsConfiguration(s))){const s=i.affectsConfiguration("workbench.experimental.share.enabled")&&this.configurationService.getValue("workbench.experimental.share.enabled"),n=i.affectsConfiguration("workbench.navigationControl.enabled")&&this.configurationService.getValue("workbench.navigationControl.enabled");if((s||n)&&this.configurationService.getValue(_.COMMAND_CENTER)===!1){this.configurationService.updateValue(_.COMMAND_CENTER,!0);return}const r=i.affectsConfiguration(_.EDITOR_ACTIONS_LOCATION)&&this.configurationService.getValue(_.EDITOR_ACTIONS_LOCATION)===Ui.TITLEBAR,o=i.affectsConfiguration(_.COMMAND_CENTER)&&this.configurationService.getValue(_.COMMAND_CENTER),a=i.affectsConfiguration(_.LAYOUT_ACTIONS)&&this.configurationService.getValue(_.LAYOUT_ACTIONS);if((i.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&[Me.TOP,Me.BOTTOM].includes(this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION))||r||o||a)&&this.configurationService.getValue(X.CUSTOM_TITLE_BAR_VISIBILITY)===oe.NEVER){this.configurationService.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO);return}this.doUpdateLayoutConfiguration()}})),this._register(Dr(i=>this.onFullscreenChanged(i))),this._register(this.editorGroupService.mainPart.onDidAddGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidRemoveGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)))),this._register(F(this.mainContainer,Q.SCROLL,()=>this.mainContainer.scrollTop=0)),(Et||Ut||le)&&!Bt(this.configurationService)&&this._register(this.titleService.onMenubarVisibilityChange(i=>this.onMenubarToggled(i))),this._register(this.themeService.onDidColorThemeChange(()=>this.updateWindowBorder())),this._register(this.hostService.onDidChangeFocus(i=>this.onWindowFocusChanged(i))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),le&&typeof navigator.windowControlsOverlay=="object"&&this._register(F(navigator.windowControlsOverlay,"geometrychange",()=>this.onDidChangeWCO())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:i,disposables:s})=>{const n=i.window.vscodeWindowId;this.containerStylesLoaded.set(n,i.whenStylesHaveLoaded),i.whenStylesHaveLoaded.then(()=>this.containerStylesLoaded.delete(n)),s.add(Ne(()=>this.containerStylesLoaded.delete(n)));const r=s.add(new L);this._onDidAddContainer.fire({container:i.container,disposables:r}),s.add(i.onDidLayout(o=>this.handleContainerDidLayout(i.container,o)))}))}onMenubarToggled(e){if(e!==this.state.runtime.menuBar.toggled){this.state.runtime.menuBar.toggled=e;const t=Yi(this.configurationService);le&&t==="toggle"?this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled)):this.state.runtime.mainWindowFullscreen&&(t==="toggle"||t==="classic")&&this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled)),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),Nn(e)&&this._onDidLayoutActiveContainer.fire(t),this._onDidLayoutContainer.fire({container:e,dimension:t})}onFullscreenChanged(e){e===C.vscodeWindowId&&(this.state.runtime.mainWindowFullscreen=$s(C),this.state.runtime.mainWindowFullscreen?this.mainContainer.classList.add(N.FULLSCREEN):(this.mainContainer.classList.remove(N.FULLSCREEN),this.stateModel.getRuntimeValue(d.ZEN_MODE_EXIT_INFO).transitionedToFullScreen&&this.isZenModeActive()&&this.toggleZenMode()),this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen,this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled)),this.updateWindowBorder(!0))}onActiveWindowChanged(){const e=this.getActiveContainerId();this.state.runtime.activeContainerId!==e&&(this.state.runtime.activeContainerId=e,this.updateWindowBorder(),this._onDidChangeActiveContainer.fire())}onWindowFocusChanged(e){this.state.runtime.hasFocus!==e&&(this.state.runtime.hasFocus=e,this.updateWindowBorder())}getActiveContainerId(){const e=this.activeContainer;return K(e).vscodeWindowId}doUpdateLayoutConfiguration(e){this.updateCustomTitleBarVisibility(),this.updateMenubarVisibility(!!e),this.editorGroupService.whenRestored.then(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED),e))}setSideBarPosition(e){const t=this.getPart(h.ACTIVITYBAR_PART),i=this.getPart(h.SIDEBAR_PART),s=this.getPart(h.AUXILIARYBAR_PART),n=e===v.LEFT?"left":"right",r=e===v.RIGHT?"left":"right",o=this.getPanelAlignment(),a=this.getPanelPosition();this.stateModel.setRuntimeValue(d.SIDEBAR_POSITON,e);const c=de(t.getContainer()),f=de(i.getContainer()),m=de(s.getContainer());c.classList.remove(r),f.classList.remove(r),c.classList.add(n),f.classList.add(n),m.classList.remove(n),m.classList.add(r),t.updateStyles(),i.updateStyles(),s.updateStyles(),this.adjustPartPositions(e,o,a)}updateWindowBorder(e=!1){if(le||Et||(Et||Ut)&&Pr(this.configurationService)||Bt(this.configurationService))return;const t=this.themeService.getColorTheme(),i=t.getColor(Nr),s=t.getColor(Vr),n=this.hasMainWindowBorder();for(const r of this.containers){const o=r===this.mainContainer,a=this.activeContainer===r;let c=!1;if(!this.state.runtime.mainWindowFullscreen&&(i||s)){c=!0;const f=a&&this.state.runtime.hasFocus?i:s??i;r.style.setProperty("--window-border-color",f?.toString()??"transparent")}o&&(this.state.runtime.mainWindowBorder=c),r.classList.toggle(N.WINDOW_BORDER,c)}!e&&n!==this.hasMainWindowBorder()&&this.layout()}initLayoutState(e,t,i){this._mainContainerDimension=Li(this.parent,pn),this.stateModel=new fs(this.storageService,this.configurationService,this.contextService,i,this.environmentService,this.viewDescriptorService),this.stateModel.load({mainContainerDimension:this._mainContainerDimension,resetLayout:!!this.layoutOptions?.resetLayout}),this._register(this.stateModel.onDidChangeState(o=>{o.key===d.ACTIVITYBAR_HIDDEN&&this.setActivityBarHidden(o.value),o.key===d.STATUSBAR_HIDDEN&&this.setStatusBarHidden(o.value),o.key===d.SIDEBAR_POSITON&&this.setSideBarPosition(o.value),o.key===d.PANEL_POSITION&&this.setPanelPosition(o.value),o.key===d.PANEL_ALIGNMENT&&this.setPanelAlignment(o.value),this.doUpdateLayoutConfiguration()}));const s=this.getInitialEditorsState();s&&this.logService.trace("Initial editor state",s);const n={layout:{editors:s?.layout},editor:{restoreEditors:this.shouldRestoreEditors(this.contextService,s),editorsToOpen:this.resolveEditorsToOpen(t,s)},views:{defaults:this.getDefaultLayoutViews(this.environmentService,this.storageService),containerToRestore:{}}},r={activeContainerId:this.getActiveContainerId(),mainWindowFullscreen:$s(C),hasFocus:this.hostService.hasFocus,maximized:new Set,mainWindowBorder:!1,menuBar:{toggled:!1},zenMode:{transitionDisposables:new Br}};if(this.state={initialization:n,runtime:r},this.isVisible(h.SIDEBAR_PART)){let o;!this.environmentService.isBuilt||e.startupKind===Lr.ReloadedWindow||this.environmentService.isExtensionDevelopment&&!this.environmentService.extensionTestsLocationURI?o=this.storageService.get(xa.activeViewletSettingsKey,p.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(T.Sidebar)?.id):o=this.viewDescriptorService.getDefaultViewContainer(T.Sidebar)?.id,o?this.state.initialization.views.containerToRestore.sideBar=o:this.stateModel.setRuntimeValue(d.SIDEBAR_HIDDEN,!0)}if(this.isVisible(h.PANEL_PART)){const o=this.storageService.get(ka.activePanelSettingsKey,p.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(T.Panel)?.id);o?this.state.initialization.views.containerToRestore.panel=o:this.stateModel.setRuntimeValue(d.PANEL_HIDDEN,!0)}if(this.isVisible(h.AUXILIARYBAR_PART)){const o=this.storageService.get(Ha.activeViewSettingsKey,p.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(T.AuxiliaryBar)?.id);o?this.state.initialization.views.containerToRestore.auxiliaryBar=o:this.stateModel.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,!0)}this.updateWindowBorder(!0)}getDefaultLayoutViews(e,t){const i=e.options?.defaultLayout;if(!i||!i.force&&!t.isNew(p.WORKSPACE))return;const{views:s}=i;if(s?.length)return s.map(n=>n.id)}shouldRestoreEditors(e,t){return Mr(e.getWorkspace())?!1:!!(this.configurationService.getValue("window.restoreWindows")==="preserve")||t===void 0}willRestoreEditors(){return this.state.initialization.editor.restoreEditors}async resolveEditorsToOpen(e,t){if(t){const i=Pt(await Mi(t.filesToMerge,e,this.logService));if(i.length===4&&Qt(i[0])&&Qt(i[1])&&Qt(i[2])&&Qt(i[3]))return[{editor:{input1:{resource:i[0].resource},input2:{resource:i[1].resource},base:{resource:i[2].resource},result:{resource:i[3].resource},options:{pinned:!0}}}];const s=Pt(await Mi(t.filesToDiff,e,this.logService));if(s.length===2)return[{editor:{original:{resource:s[0].resource},modified:{resource:s[1].resource},options:{pinned:!0}}}];const n=[],r=await Mi(t.filesToOpenOrCreate,e,this.logService);for(let o=0;o<r.length;o++){const a=r[o];a&&n.push({editor:a,viewColumn:t.filesToOpenOrCreate?.[o].viewColumn})}return n}else if(this.contextService.getWorkbenchState()===Oe.EMPTY&&this.configurationService.getValue("workbench.startupEditor")==="newUntitledFile")return this.editorGroupService.hasRestorableState?[]:[{editor:{resource:void 0}}];return[]}get openedDefaultEditors(){return this._openedDefaultEditors}getInitialEditorsState(){const e=this.environmentService.options?.defaultLayout;if((e?.editors?.length||e?.layout?.editors)&&(e.force||this.storageService.isNew(p.WORKSPACE)))return this._openedDefaultEditors=!0,{layout:e.layout?.editors,filesToOpenOrCreate:e?.editors?.map(n=>({viewColumn:n.viewColumn,fileUri:wi.revive(n.uri),openOnlyIfExists:n.openOnlyIfExists,options:n.options}))};const{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}=this.environmentService;if(t||i||s)return{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}}isRestored(){return this.restored}restoreParts(){const e=[],t=[];e.push((async()=>{k("code/willRestoreEditors"),await this.editorGroupService.whenReady,k("code/restoreEditors/editorGroupsReady"),this.state.initialization.layout?.editors&&this.editorGroupService.mainPart.applyLayout(this.state.initialization.layout.editors);const r=await this.state.initialization.editor.editorsToOpen;k("code/restoreEditors/editorsToOpenResolved");let o;if(r.length){const a=this.editorGroupService.mainPart.getGroups(Or.GRID_APPEARANCE),c=new Map;for(const f of r){const m=a[(f.viewColumn??1)-1];let A=c.get(m.id);A||(A=new Set,c.set(m.id,A)),A.add(f.editor)}o=Promise.all(Array.from(c).map(async([f,m])=>{try{await this.editorService.openEditors(Array.from(m),f,{validateTrust:!0})}catch(A){this.logService.error(A)}}))}t.push(Promise.all([o?.finally(()=>k("code/restoreEditors/editorsOpened")),this.editorGroupService.whenRestored.finally(()=>k("code/restoreEditors/editorGroupsRestored"))]).finally(()=>{k("code/didRestoreEditors")}))})());const i=(async()=>{if(this.state.initialization.views.defaults?.length){k("code/willOpenDefaultViews");const r=[],o=f=>{const m=this.viewDescriptorService.getViewLocationById(f.id);if(m!==null){const A=this.viewDescriptorService.getViewContainerByViewId(f.id);if(A){f.order>=(r?.[m]?.order??0)&&(r[m]={id:A.id,order:f.order});const S=this.viewDescriptorService.getViewContainerModel(A);return S.setCollapsed(f.id,!1),S.setVisible(f.id,!0),!0}}return!1},a=[...this.state.initialization.views.defaults].reverse().map((f,m)=>({id:f,order:m}));let c=a.length;for(;c;)c--,o(a[c])&&a.splice(c,1);if(a.length){await this.extensionService.whenInstalledExtensionsRegistered();let f=a.length;for(;f;)f--,o(a[f])&&a.splice(f,1)}r[T.Sidebar]&&(this.state.initialization.views.containerToRestore.sideBar=r[T.Sidebar].id),r[T.Panel]&&(this.state.initialization.views.containerToRestore.panel=r[T.Panel].id),r[T.AuxiliaryBar]&&(this.state.initialization.views.containerToRestore.auxiliaryBar=r[T.AuxiliaryBar].id),k("code/didOpenDefaultViews")}})();e.push(i),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.sideBar&&(k("code/willRestoreViewlet"),await this.openViewContainer(T.Sidebar,this.state.initialization.views.containerToRestore.sideBar),k("code/didRestoreViewlet"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.panel&&(k("code/willRestorePanel"),await this.openViewContainer(T.Panel,this.state.initialization.views.containerToRestore.panel),k("code/didRestorePanel"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.auxiliaryBar&&(k("code/willRestoreAuxiliaryBar"),await this.openViewContainer(T.AuxiliaryBar,this.state.initialization.views.containerToRestore.auxiliaryBar),k("code/didRestoreAuxiliaryBar"))})());const s=this.isZenModeActive(),n=An(this.configurationService).restore;s&&(this.setZenModeActive(!n),this.toggleZenMode(!1,!0)),this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)&&this.centerMainEditorLayout(!0,!0),qs.settled(e).finally(()=>{zi()===C.document.body&&(this.isPanelMaximized()||this.isAuxiliaryBarMaximized())&&this.focus(),this.whenReadyPromise.complete(),qs.settled(t).finally(()=>{this.restored=!0,this.whenRestoredPromise.complete()})})}async openViewContainer(e,t,i){let s=await this.paneCompositeService.openPaneComposite(t,e,i);s||(s=await this.paneCompositeService.openPaneComposite(this.viewDescriptorService.getDefaultViewContainer(e)?.id,e,i),!s&&await this.paneCompositeService.openPaneComposite(this.paneCompositeService.getVisiblePaneCompositeIds(e).at(0),e,i))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ne(()=>this.parts.delete(t))}getPart(e){const t=this.parts.get(e);if(!t)throw new Error(`Unknown part ${e}`);return t}registerNotifications(e){this._register(e.onDidChangeNotificationsVisibility(t=>this._onDidChangeNotificationsVisibility.fire(t)))}hasFocus(e){const t=this.getContainer(ei(),e);if(!t)return!1;const i=zi();return i?xr(i,t):!1}_getFocusedPart(){for(const e of this.parts.keys())if(this.hasFocus(e))return e}focusPart(e,t=C){const i=this.getContainer(t,e)??this.mainContainer;switch(e){case h.EDITOR_PART:this.editorGroupService.getPart(i).activeGroup.focus();break;case h.PANEL_PART:{this.paneCompositeService.getActivePaneComposite(T.Panel)?.focus();break}case h.SIDEBAR_PART:{this.paneCompositeService.getActivePaneComposite(T.Sidebar)?.focus();break}case h.AUXILIARYBAR_PART:{this.paneCompositeService.getActivePaneComposite(T.AuxiliaryBar)?.focus();break}case h.ACTIVITYBAR_PART:this.getPart(h.SIDEBAR_PART).focusActivityBar();break;case h.STATUSBAR_PART:this.statusBarService.getPart(i).focus();break;default:i?.focus()}}getContainer(e,t){if(typeof t>"u")return this.getContainerFromDocument(e.document);if(e===C)return this.getPart(t).getContainer();let i;if(t===h.EDITOR_PART?i=this.editorGroupService.getPart(this.getContainerFromDocument(e.document)):t===h.STATUSBAR_PART?i=this.statusBarService.getPart(this.getContainerFromDocument(e.document)):t===h.TITLEBAR_PART&&(i=this.titleService.getPart(this.getContainerFromDocument(e.document))),i instanceof Pi)return i.getContainer()}isVisible(e,t=C){if(t!==C&&e===h.EDITOR_PART)return!0;switch(e){case h.TITLEBAR_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.titleBarPartView):Fe(this.configurationService,C,this.state.runtime.menuBar.toggled);case h.SIDEBAR_PART:return!this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN);case h.PANEL_PART:return!this.stateModel.getRuntimeValue(d.PANEL_HIDDEN);case h.AUXILIARYBAR_PART:return!this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN);case h.STATUSBAR_PART:return!this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN);case h.ACTIVITYBAR_PART:return!this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN);case h.EDITOR_PART:return!this.stateModel.getRuntimeValue(d.EDITOR_HIDDEN);case h.BANNER_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.bannerPartView):!1;default:return!1}}shouldShowBannerFirst(){return le&&!Ki()}focus(){this.isPanelMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(h.PANEL_PART):this.isAuxiliaryBarMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(h.AUXILIARYBAR_PART):this.focusPart(h.EDITOR_PART,K(this.activeContainer))}focusPanelOrEditor(){const e=this.paneCompositeService.getActivePaneComposite(T.Panel);(this.hasFocus(h.PANEL_PART)||!this.isVisible(h.EDITOR_PART))&&e?e.focus():this.focus()}getMaximumEditorDimensions(e){const t=K(e),i=this.getContainerDimension(e);if(e===this.mainContainer){const s=H(this.getPanelPosition()),n=(this.isVisible(h.ACTIVITYBAR_PART)?this.activityBarPartView.minimumWidth:0)+(this.isVisible(h.SIDEBAR_PART)?this.sideBarPartView.minimumWidth:0)+(this.isVisible(h.PANEL_PART)&&!s?this.panelPartView.minimumWidth:0)+(this.isVisible(h.AUXILIARYBAR_PART)?this.auxiliaryBarPartView.minimumWidth:0),r=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0)+(this.isVisible(h.PANEL_PART)&&s?this.panelPartView.minimumHeight:0),o=i.width-n,a=i.height-r;return{width:o,height:a}}else{const s=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0);return{width:i.width,height:i.height-s}}}isZenModeActive(){return this.stateModel.getRuntimeValue(d.ZEN_MODE_ACTIVE)}setZenModeActive(e){this.stateModel.setRuntimeValue(d.ZEN_MODE_ACTIVE,e)}toggleZenMode(e,t=!1){const i=this._getFocusedPart();this.setZenModeActive(!this.isZenModeActive()),this.state.runtime.zenMode.transitionDisposables.clearAndDisposeAll();const s=a=>{for(const c of this.mainPartEditorService.visibleTextEditorControls){if(!a&&Kr(c)&&c.hasModel()){const f=c.getModel();a=this.configurationService.getValue("editor.lineNumbers",{resource:f.uri,overrideIdentifier:f.getLanguageId()})}a||(a=this.configurationService.getValue("editor.lineNumbers")),c.updateOptions({lineNumbers:a})}};let n=!1;const r=An(this.configurationService),o=this.stateModel.getRuntimeValue(d.ZEN_MODE_EXIT_INFO);this.isZenModeActive()?(n=!this.state.runtime.mainWindowFullscreen&&r.fullScreen&&!js,t||(o.transitionedToFullScreen=n,o.transitionedToCenteredEditorLayout=!this.isMainEditorLayoutCentered()&&r.centerLayout,o.handleNotificationsDoNotDisturbMode=this.notificationService.getFilter()===w.OFF,o.wasVisible.sideBar=this.isVisible(h.SIDEBAR_PART),o.wasVisible.panel=this.isVisible(h.PANEL_PART),o.wasVisible.auxiliaryBar=this.isVisible(h.AUXILIARYBAR_PART),this.stateModel.setRuntimeValue(d.ZEN_MODE_EXIT_INFO,o)),this.setPanelHidden(!0,!0),this.setAuxiliaryBarHidden(!0,!0),this.setSideBarHidden(!0),r.hideActivityBar&&this.setActivityBarHidden(!0),r.hideStatusBar&&this.setStatusBarHidden(!0),r.hideLineNumbers&&(s("off"),this.state.runtime.zenMode.transitionDisposables.set(z.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s("off")))),r.showTabs!==this.editorGroupService.partOptions.showTabs&&this.state.runtime.zenMode.transitionDisposables.set(z.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:r.showTabs})),r.silentNotifications&&o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.ERROR),r.centerLayout&&this.centerMainEditorLayout(!0,!0),this.state.runtime.zenMode.transitionDisposables.set("configurationChange",this.configurationService.onDidChangeConfiguration(a=>{if(a.affectsConfiguration(z.HIDE_ACTIVITYBAR)||a.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)){const c=this.configurationService.getValue(z.HIDE_ACTIVITYBAR),f=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);this.setActivityBarHidden(c?!0:f===Me.TOP||f===Me.BOTTOM)}if(a.affectsConfiguration(z.HIDE_STATUSBAR)){const c=this.configurationService.getValue(z.HIDE_STATUSBAR);this.setStatusBarHidden(c)}if(a.affectsConfiguration(z.CENTER_LAYOUT)){const c=this.configurationService.getValue(z.CENTER_LAYOUT);this.centerMainEditorLayout(c,!0)}if(a.affectsConfiguration(z.SHOW_TABS)){const c=this.configurationService.getValue(z.SHOW_TABS)??"multiple";this.state.runtime.zenMode.transitionDisposables.set(z.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:c}))}if(a.affectsConfiguration(z.SILENT_NOTIFICATIONS)){const c=!!this.configurationService.getValue(z.SILENT_NOTIFICATIONS);o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(c?w.ERROR:w.OFF)}if(a.affectsConfiguration(z.HIDE_LINENUMBERS)){const c=this.configurationService.getValue(z.HIDE_LINENUMBERS)?"off":void 0;s(c),this.state.runtime.zenMode.transitionDisposables.set(z.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s(c)))}}))):(o.wasVisible.panel&&this.setPanelHidden(!1,!0),o.wasVisible.auxiliaryBar&&this.setAuxiliaryBarHidden(!1,!0),o.wasVisible.sideBar&&this.setSideBarHidden(!1),this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN,!0)||this.setActivityBarHidden(!1),this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN,!0)||this.setStatusBarHidden(!1),o.transitionedToCenteredEditorLayout&&this.centerMainEditorLayout(!1,!0),o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.OFF),s(),n=o.transitionedToFullScreen&&this.state.runtime.mainWindowFullscreen),e||this.layout(),n&&this.hostService.toggleFullScreen(C),i&&this.isVisible(i,K(this.activeContainer))?kr(i)?this.focusPart(i,K(this.activeContainer)):this.focusPart(i):this.focus(),this._onDidChangeZenMode.fire(this.isZenModeActive())}setStatusBarHidden(e){this.stateModel.setRuntimeValue(d.STATUSBAR_HIDDEN,e),e?this.mainContainer.classList.add(N.STATUSBAR_HIDDEN):this.mainContainer.classList.remove(N.STATUSBAR_HIDDEN),this.workbenchGrid.setViewVisible(this.statusBarPartView,!e)}createWorkbenchLayout(){const e=this.getPart(h.TITLEBAR_PART),t=this.getPart(h.BANNER_PART),i=this.getPart(h.EDITOR_PART),s=this.getPart(h.ACTIVITYBAR_PART),n=this.getPart(h.PANEL_PART),r=this.getPart(h.AUXILIARYBAR_PART),o=this.getPart(h.SIDEBAR_PART),a=this.getPart(h.STATUSBAR_PART);this.titleBarPartView=e,this.bannerPartView=t,this.sideBarPartView=o,this.activityBarPartView=s,this.editorPartView=i,this.panelPartView=n,this.auxiliaryBarPartView=r,this.statusBarPartView=a;const c={[h.ACTIVITYBAR_PART]:this.activityBarPartView,[h.BANNER_PART]:this.bannerPartView,[h.TITLEBAR_PART]:this.titleBarPartView,[h.EDITOR_PART]:this.editorPartView,[h.PANEL_PART]:this.panelPartView,[h.SIDEBAR_PART]:this.sideBarPartView,[h.STATUSBAR_PART]:this.statusBarPartView,[h.AUXILIARYBAR_PART]:this.auxiliaryBarPartView},f=({type:A})=>c[A],m=Fa.deserialize(this.createGridDescriptor(),{fromJSON:f},{proportionalLayout:!1});this.mainContainer.prepend(m.element),this.mainContainer.setAttribute("role","application"),this.workbenchGrid=m,this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen;for(const A of[e,i,s,n,o,a,r,t])this._register(A.onDidVisibilityChange(S=>{this.inMaximizedAuxiliaryBarTransition||(A===o?this.setSideBarHidden(!S):A===n?this.setPanelHidden(!S,!0):A===r?this.setAuxiliaryBarHidden(!S,!0):A===i&&this.setEditorHidden(!S)),this._onDidChangePartVisibility.fire(),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}));this._register(this.storageService.onWillSaveState(A=>{const S=this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView):this.workbenchGrid.getViewSize(this.sideBarPartView).width;this.stateModel.setInitializationValue(d.SIDEBAR_SIZE,S);const x=this.stateModel.getRuntimeValue(d.PANEL_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView):H(this.stateModel.getRuntimeValue(d.PANEL_POSITION))?this.workbenchGrid.getViewSize(this.panelPartView).height:this.workbenchGrid.getViewSize(this.panelPartView).width;this.stateModel.setInitializationValue(d.PANEL_SIZE,x);const G=this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView):this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setInitializationValue(d.AUXILIARYBAR_SIZE,G),this.stateModel.save(!0,!0)}))}layout(){this.disposed||(this._mainContainerDimension=Li(this.state.runtime.mainWindowFullscreen?C.document.body:this.parent,pn),this.logService.trace(`Layout#layout, height: ${this._mainContainerDimension.height}, width: ${this._mainContainerDimension.width}`),Hr(this.mainContainer,0,0,0,0,"relative"),Fr(this.mainContainer,this._mainContainerDimension.width,this._mainContainerDimension.height),this.workbenchGrid.layout(this._mainContainerDimension.width,this._mainContainerDimension.height),this.initialized=!0,this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension))}isMainEditorLayoutCentered(){return this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED)}centerMainEditorLayout(e,t){this.stateModel.setRuntimeValue(d.MAIN_EDITOR_CENTERED,e);const s=Pt(this.editorGroupService.mainPart.groups.map(a=>a.activeEditor)).some(a=>a instanceof Wr?this.configurationService.getValue("diffEditor.renderSideBySide"):!!a?.hasCapability(Gr.MultipleEditors)),n=this.editorGroupService.getLayout();let r=!1;n.orientation===zr.HORIZONTAL?r=n.groups.length>1:r=n.groups.some(a=>a.groups&&a.groups.length>1),this.configurationService.getValue("workbench.editor.centeredLayoutAutoResize")&&(r&&!this.editorGroupService.mainPart.hasMaximizedGroup()||s)&&(e=!1),this.editorGroupService.mainPart.isLayoutCentered()!==e&&(this.editorGroupService.mainPart.centerLayout(e),t||this.layout()),this._onDidChangeMainEditorCenteredLayout.fire(this.stateModel.getRuntimeValue(d.MAIN_EDITOR_CENTERED))}getSize(e){return this.workbenchGrid.getViewSize(this.getPart(e))}setSize(e,t){this.workbenchGrid.resizeView(this.getPart(e),t)}resizePart(e,t,i){const s=Math.sign(t)*Js(ei(),Math.abs(t)),n=Math.sign(i)*Js(ei(),Math.abs(i));let r;switch(e){case h.SIDEBAR_PART:r=this.workbenchGrid.getViewSize(this.sideBarPartView),this.workbenchGrid.resizeView(this.sideBarPartView,{width:r.width+s,height:r.height});break;case h.PANEL_PART:r=this.workbenchGrid.getViewSize(this.panelPartView),this.workbenchGrid.resizeView(this.panelPartView,{width:r.width+(H(this.getPanelPosition())?0:s),height:r.height+(H(this.getPanelPosition())?n:0)});break;case h.AUXILIARYBAR_PART:r=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:r.width+s,height:r.height});break;case h.EDITOR_PART:if(r=this.workbenchGrid.getViewSize(this.editorPartView),this.editorGroupService.mainPart.count===1)this.workbenchGrid.resizeView(this.editorPartView,{width:r.width+s,height:r.height+n});else{const o=this.editorGroupService.mainPart.activeGroup,{width:a,height:c}=this.editorGroupService.mainPart.getSize(o);this.editorGroupService.mainPart.setSize(o,{width:a+s,height:c+n});const{width:f,height:m}=this.editorGroupService.mainPart.getSize(o);(n&&c===m||s&&a===f)&&this.workbenchGrid.resizeView(this.editorPartView,{width:r.width+(s&&a===f?s:0),height:r.height+(n&&c===m?n:0)})}break;default:return}}setActivityBarHidden(e){this.stateModel.setRuntimeValue(d.ACTIVITYBAR_HIDDEN,e),this.workbenchGrid.setViewVisible(this.activityBarPartView,!e)}setBannerHidden(e){this.workbenchGrid.setViewVisible(this.bannerPartView,!e)}setEditorHidden(e){!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(h.EDITOR_PART)||(this.stateModel.setRuntimeValue(d.EDITOR_HIDDEN,e),e?this.mainContainer.classList.add(N.MAIN_EDITOR_AREA_HIDDEN):this.mainContainer.classList.remove(N.MAIN_EDITOR_AREA_HIDDEN),this.workbenchGrid.setViewVisible(this.editorPartView,!e),e&&!this.isVisible(h.PANEL_PART)&&!this.isAuxiliaryBarMaximized()&&this.setPanelHidden(!1,!0))}getLayoutClasses(){return Pt([this.isVisible(h.SIDEBAR_PART)?void 0:N.SIDEBAR_HIDDEN,this.isVisible(h.EDITOR_PART,C)?void 0:N.MAIN_EDITOR_AREA_HIDDEN,this.isVisible(h.PANEL_PART)?void 0:N.PANEL_HIDDEN,this.isVisible(h.AUXILIARYBAR_PART)?void 0:N.AUXILIARYBAR_HIDDEN,this.isVisible(h.STATUSBAR_PART)?void 0:N.STATUSBAR_HIDDEN,this.state.runtime.mainWindowFullscreen?N.FULLSCREEN:void 0])}setSideBarHidden(e){if(!(!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(h.SIDEBAR_PART))){if(this.stateModel.setRuntimeValue(d.SIDEBAR_HIDDEN,e),e?this.mainContainer.classList.add(N.SIDEBAR_HIDDEN):this.mainContainer.classList.remove(N.SIDEBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(T.Sidebar))this.paneCompositeService.hideActivePaneComposite(T.Sidebar),this.isAuxiliaryBarMaximized()||this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(T.Sidebar)){const t=this.paneCompositeService.getLastActivePaneCompositeId(T.Sidebar);t&&this.openViewContainer(T.Sidebar,t,!0)}this.workbenchGrid.setViewVisible(this.sideBarPartView,!e)}}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(!t)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i?i.activeViewDescriptors.length>=1:!1}adjustPartPositions(e,t,i){const s=!H(i),n=s||!(t==="center"||e===v.LEFT&&t==="right"||e===v.RIGHT&&t==="left"),r=s||!(t==="center"||e===v.RIGHT&&t==="right"||e===v.LEFT&&t==="left"),o=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).width:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumWidth),a=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).height:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumHeight),c=this.isVisible(h.SIDEBAR_PART)?this.workbenchGrid.getViewSize(this.sideBarPartView).width:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView)??this.sideBarPartView.minimumWidth),f=this.isVisible(h.AUXILIARYBAR_PART)?this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width:Dt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView)??this.auxiliaryBarPartView.minimumWidth),m=[h.PANEL_PART,h.SIDEBAR_PART,h.AUXILIARYBAR_PART].find(A=>this.hasFocus(A));e===v.LEFT?(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,0]),this.workbenchGrid.moveView(this.sideBarPartView,c,n?this.editorPartView:this.activityBarPartView,n?Z.Left:Z.Right),r?this.workbenchGrid.moveView(this.auxiliaryBarPartView,f,this.editorPartView,Z.Right):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,-1])):(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,-1]),this.workbenchGrid.moveView(this.sideBarPartView,c,n?this.editorPartView:this.activityBarPartView,n?Z.Right:Z.Left),r?this.workbenchGrid.moveView(this.auxiliaryBarPartView,f,this.editorPartView,Z.Left):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,0])),m&&this.focusPart(m),s&&(this.workbenchGrid.moveView(this.panelPartView,o,this.editorPartView,i===v.LEFT?Z.Left:Z.Right),this.workbenchGrid.resizeView(this.panelPartView,{height:a,width:o})),this.isVisible(h.SIDEBAR_PART)&&this.workbenchGrid.resizeView(this.sideBarPartView,{height:this.workbenchGrid.getViewSize(this.sideBarPartView).height,width:c}),this.isVisible(h.AUXILIARYBAR_PART)&&this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{height:this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).height,width:f})}setPanelAlignment(e){H(this.getPanelPosition())||this.setPanelPosition(v.BOTTOM),e!=="center"&&this.isPanelMaximized()&&this.toggleMaximizedPanel(),this.stateModel.setRuntimeValue(d.PANEL_ALIGNMENT,e),this.adjustPartPositions(this.getSideBarPosition(),e,this.getPanelPosition()),this._onDidChangePanelAlignment.fire(e)}setPanelHidden(e,t){if(!this.workbenchGrid||!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(h.PANEL_PART))return;const i=!this.isVisible(h.PANEL_PART);this.stateModel.setRuntimeValue(d.PANEL_HIDDEN,e);const s=this.isPanelMaximized(),n=this.panelOpensMaximized();e?this.mainContainer.classList.add(N.PANEL_HIDDEN):this.mainContainer.classList.remove(N.PANEL_HIDDEN);let r=!1;if(e&&this.paneCompositeService.getActivePaneComposite(T.Panel))this.paneCompositeService.hideActivePaneComposite(T.Panel),!js&&!this.isAuxiliaryBarMaximized()&&(r=!0);else if(!e&&!this.paneCompositeService.getActivePaneComposite(T.Panel)){let o=this.paneCompositeService.getLastActivePaneCompositeId(T.Panel);(!o||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(T.Panel).find(a=>this.hasViews(a.id))?.id),o&&this.openViewContainer(T.Panel,o,!t)}e&&s&&this.toggleMaximizedPanel(),i!==e&&(this.workbenchGrid.setViewVisible(this.panelPartView,!e),e?this.stateModel.setRuntimeValue(d.PANEL_WAS_LAST_MAXIMIZED,s):!t&&s!==n&&this.toggleMaximizedPanel(),r&&this.editorGroupService.mainPart.activeGroup.focus())}isAuxiliaryBarMaximized(){return this.stateModel.getRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED)}toggleMaximizedAuxiliaryBar(){this.setAuxiliaryBarMaximized(!this.isAuxiliaryBarMaximized())}setAuxiliaryBarMaximized(e){if(this.inMaximizedAuxiliaryBarTransition||e===this.isAuxiliaryBarMaximized())return!1;if(e){const t={sideBarVisible:this.isVisible(h.SIDEBAR_PART),editorVisible:this.isVisible(h.EDITOR_PART),panelVisible:this.isVisible(h.PANEL_PART),auxiliaryBarVisible:this.isVisible(h.AUXILIARYBAR_PART)};this.stateModel.setRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!0),this.inMaximizedAuxiliaryBarTransition=!0;try{t.auxiliaryBarVisible||this.setAuxiliaryBarHidden(!1);const i=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE,i),t.sideBarVisible&&this.setSideBarHidden(!0),t.panelVisible&&this.setPanelHidden(!0),t.editorVisible&&this.setEditorHidden(!0),this.stateModel.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY,t)}finally{this.inMaximizedAuxiliaryBarTransition=!1}}else{const t=de(this.stateModel.getRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY));this.stateModel.setRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!1),this.inMaximizedAuxiliaryBarTransition=!0;try{this.setEditorHidden(!t?.editorVisible),this.setPanelHidden(!t?.panelVisible),this.setSideBarHidden(!t?.sideBarVisible);const i=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView);this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:this.stateModel.getRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE),height:i.height})}finally{this.inMaximizedAuxiliaryBarTransition=!1}}return this.focusPart(h.AUXILIARYBAR_PART),this._onDidChangeAuxiliaryBarMaximized.fire(),!0}isPanelMaximized(){return(this.getPanelAlignment()==="center"||!H(this.getPanelPosition()))&&!this.isVisible(h.EDITOR_PART,C)&&!this.isAuxiliaryBarMaximized()}toggleMaximizedPanel(){const e=this.workbenchGrid.getViewSize(this.panelPartView),t=this.getPanelPosition(),i=!this.isPanelMaximized();i?(this.isVisible(h.PANEL_PART)&&(H(t)?this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT,e.height):this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH,e.width)),this.setEditorHidden(!0)):(this.setEditorHidden(!1),this.workbenchGrid.resizeView(this.panelPartView,{width:H(t)?e.width:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH),height:H(t)?this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT):e.height})),this.stateModel.setRuntimeValue(d.PANEL_WAS_LAST_MAXIMIZED,i)}panelOpensMaximized(){if(this.getPanelAlignment()!=="center"&&H(this.getPanelPosition()))return!1;const e=Ur(this.configurationService.getValue(Re.PANEL_OPENS_MAXIMIZED)),t=this.stateModel.getRuntimeValue(d.PANEL_WAS_LAST_MAXIMIZED);return e===Qs.ALWAYS||e===Qs.REMEMBER_LAST&&t}setAuxiliaryBarHidden(e,t){if(!(e&&this.setAuxiliaryBarMaximized(!1)&&!this.isVisible(h.AUXILIARYBAR_PART))){if(this.stateModel.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,e),e?this.mainContainer.classList.add(N.AUXILIARYBAR_HIDDEN):this.mainContainer.classList.remove(N.AUXILIARYBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(T.AuxiliaryBar))this.paneCompositeService.hideActivePaneComposite(T.AuxiliaryBar),this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(T.AuxiliaryBar)){let i=this.paneCompositeService.getLastActivePaneCompositeId(T.AuxiliaryBar);(!i||!this.hasViews(i))&&(i=this.viewDescriptorService.getViewContainersByLocation(T.AuxiliaryBar).find(s=>this.hasViews(s.id))?.id),i&&this.openViewContainer(T.AuxiliaryBar,i,!t)}this.workbenchGrid.setViewVisible(this.auxiliaryBarPartView,!e)}}setPartHidden(e,t){switch(t){case h.ACTIVITYBAR_PART:return this.setActivityBarHidden(e);case h.SIDEBAR_PART:return this.setSideBarHidden(e);case h.EDITOR_PART:return this.setEditorHidden(e);case h.BANNER_PART:return this.setBannerHidden(e);case h.AUXILIARYBAR_PART:return this.setAuxiliaryBarHidden(e);case h.PANEL_PART:return this.setPanelHidden(e)}}hasMainWindowBorder(){return this.state.runtime.mainWindowBorder}getMainWindowBorderRadius(){return this.state.runtime.mainWindowBorder&&pe?"10px":void 0}getSideBarPosition(){return this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)}getPanelAlignment(){return this.stateModel.getRuntimeValue(d.PANEL_ALIGNMENT)}updateMenubarVisibility(e){const t=Fe(this.configurationService,C,this.state.runtime.menuBar.toggled);!e&&this.workbenchGrid&&t!==this.isVisible(h.TITLEBAR_PART,C)&&this.workbenchGrid.setViewVisible(this.titleBarPartView,t)}updateCustomTitleBarVisibility(){const e=Fe(this.configurationService,C,this.state.runtime.menuBar.toggled),t=this.isVisible(h.TITLEBAR_PART);e!==t&&this.workbenchGrid.setViewVisible(this.titleBarPartView,e)}toggleMenuBar(){let e=Yi(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=Xi(this.configurationService)?"toggle":"compact":t="classic",this.configurationService.updateValue(Gs.MenuBarVisibility,t)}getPanelPosition(){return this.stateModel.getRuntimeValue(d.PANEL_POSITION)}setPanelPosition(e){this.isVisible(h.PANEL_PART)||this.setPanelHidden(!1);const t=this.getPart(h.PANEL_PART),i=St(this.getPanelPosition()),s=St(e),n=de(t.getContainer());n.classList.remove(i),n.classList.add(s),t.updateStyles();const r=this.workbenchGrid.getViewSize(this.panelPartView),o=this.workbenchGrid.getViewSize(this.sideBarPartView),a=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView);let c=!this.isVisible(h.EDITOR_PART,C);s!==i&&!c&&(H(e)?this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH,r.width):H(ti(i))&&this.stateModel.setRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT,r.height)),H(e)&&this.getPanelAlignment()!=="center"&&c&&(this.toggleMaximizedPanel(),c=!1),this.stateModel.setRuntimeValue(d.PANEL_POSITION,e);const f=this.isVisible(h.SIDEBAR_PART),m=this.isVisible(h.AUXILIARYBAR_PART),A=this.hasFocus(h.PANEL_PART);e===v.BOTTOM?this.workbenchGrid.moveView(this.panelPartView,c?r.height:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,Z.Down):e===v.TOP?this.workbenchGrid.moveView(this.panelPartView,c?r.height:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,Z.Up):e===v.RIGHT?this.workbenchGrid.moveView(this.panelPartView,c?r.width:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,Z.Right):this.workbenchGrid.moveView(this.panelPartView,c?r.width:this.stateModel.getRuntimeValue(d.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,Z.Left),A&&this.focusPart(h.PANEL_PART),this.workbenchGrid.resizeView(this.sideBarPartView,o),f||this.setSideBarHidden(!0),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,a),m||this.setAuxiliaryBarHidden(!0),H(e)&&this.adjustPartPositions(this.getSideBarPosition(),this.getPanelAlignment(),e),this._onDidChangePanelPosition.fire(s)}isWindowMaximized(e){return this.state.runtime.maximized.has(Zi(e))}updateWindowMaximizedState(e,t){this.mainContainer.classList.toggle(N.MAXIMIZED,t);const i=Zi(e);t!==this.state.runtime.maximized.has(i)&&(t?this.state.runtime.maximized.add(i):this.state.runtime.maximized.delete(i),this.updateWindowBorder(),this._onDidChangeWindowMaximized.fire({windowId:i,maximized:t}))}getVisibleNeighborPart(e,t){if(!this.workbenchGrid||!this.isVisible(e,C))return;const i=this.workbenchGrid.getNeighborViews(this.getPart(e),t,!1);if(i)for(const s of i){const n=[h.ACTIVITYBAR_PART,h.EDITOR_PART,h.PANEL_PART,h.AUXILIARYBAR_PART,h.SIDEBAR_PART,h.STATUSBAR_PART,h.TITLEBAR_PART].find(r=>this.getPart(r)===s&&this.isVisible(r,C));if(n!==void 0)return n}}onDidChangeWCO(){const e=this.workbenchGrid.getNeighborViews(this.titleBarPartView,Z.Up,!1).length>0,t=this.shouldShowBannerFirst();e!==t&&this.workbenchGrid.moveView(this.bannerPartView,Dt.Distribute,this.titleBarPartView,t?Z.Up:Z.Down),this.workbenchGrid.setViewVisible(this.titleBarPartView,Fe(this.configurationService,C,this.state.runtime.menuBar.toggled))}arrangeEditorNodes(e,t,i){if(!e.sideBar&&!e.auxiliaryBar)return e.editor.size=t,e.editor;const s=[e.editor];return e.editor.size=i,e.sideBar&&(this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)===v.LEFT?s.splice(0,0,e.sideBar):s.push(e.sideBar),e.editor.size-=this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)?0:e.sideBar.size),e.auxiliaryBar&&(this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)===v.RIGHT?s.splice(0,0,e.auxiliaryBar):s.push(e.auxiliaryBar),e.editor.size-=this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size),{type:"branch",data:s,size:t,visible:s.some(n=>n.visible)}}arrangeMiddleSectionNodes(e,t,i){const s=this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN)?0:e.activityBar.size,n=this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)?0:e.sideBar.size,r=this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size,o=this.stateModel.getInitializationValue(d.PANEL_SIZE)?0:e.panel.size,a=this.stateModel.getRuntimeValue(d.PANEL_POSITION),c=this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON),f=[];if(!H(a))f.push(e.editor),e.editor.size=t-s-n-o-r,a===v.RIGHT?f.push(e.panel):f.splice(0,0,e.panel),c===v.LEFT?(f.push(e.auxiliaryBar),f.splice(0,0,e.sideBar),f.splice(0,0,e.activityBar)):(f.splice(0,0,e.auxiliaryBar),f.push(e.sideBar),f.push(e.activityBar));else{const m=this.stateModel.getRuntimeValue(d.PANEL_ALIGNMENT),A=!(m==="center"||c===v.LEFT&&m==="right"||c===v.RIGHT&&m==="left"),S=!(m==="center"||c===v.RIGHT&&m==="right"||c===v.LEFT&&m==="left"),x=t-s-(A?0:n)-(S?0:r),G=this.arrangeEditorNodes({editor:e.editor,sideBar:A?e.sideBar:void 0,auxiliaryBar:S?e.auxiliaryBar:void 0},i-o,x),ve=a===v.BOTTOM?[G,e.panel]:[e.panel,G];f.push({type:"branch",data:ve,size:x,visible:ve.some(He=>He.visible)}),A||(c===v.LEFT?f.splice(0,0,e.sideBar):f.push(e.sideBar)),S||(c===v.RIGHT?f.splice(0,0,e.auxiliaryBar):f.push(e.auxiliaryBar)),c===v.LEFT?f.splice(0,0,e.activityBar):f.push(e.activityBar)}return f}createGridDescriptor(){const{width:e,height:t}=this._mainContainerDimension,i=this.stateModel.getInitializationValue(d.SIDEBAR_SIZE),s=this.stateModel.getInitializationValue(d.AUXILIARYBAR_SIZE),n=this.stateModel.getInitializationValue(d.PANEL_SIZE),r=this.titleBarPartView.minimumHeight,o=this.bannerPartView.minimumHeight,a=this.statusBarPartView.minimumHeight,c=this.activityBarPartView.minimumWidth,f=t-r-a,m=[{type:"leaf",data:{type:h.TITLEBAR_PART},size:r,visible:this.isVisible(h.TITLEBAR_PART,C)},{type:"leaf",data:{type:h.BANNER_PART},size:o,visible:!1}],A={type:"leaf",data:{type:h.ACTIVITYBAR_PART},size:c,visible:!this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN)},S={type:"leaf",data:{type:h.SIDEBAR_PART},size:i,visible:!this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN)},x={type:"leaf",data:{type:h.AUXILIARYBAR_PART},size:s,visible:this.isVisible(h.AUXILIARYBAR_PART)},G={type:"leaf",data:{type:h.EDITOR_PART},size:0,visible:!this.stateModel.getRuntimeValue(d.EDITOR_HIDDEN)},ve={type:"leaf",data:{type:h.PANEL_PART},size:n,visible:!this.stateModel.getRuntimeValue(d.PANEL_HIDDEN)},He=this.arrangeMiddleSectionNodes({activityBar:A,auxiliaryBar:x,editor:G,panel:ve,sideBar:S},e,f),Vi={root:{type:"branch",size:e,data:[...this.shouldShowBannerFirst()?m.reverse():m,{type:"branch",data:He,size:f},{type:"leaf",data:{type:h.STATUSBAR_PART},size:a,visible:!this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN)}]},orientation:Yr.VERTICAL,width:e,height:t},Xn={activityBarVisible:!this.stateModel.getRuntimeValue(d.ACTIVITYBAR_HIDDEN),sideBarVisible:!this.stateModel.getRuntimeValue(d.SIDEBAR_HIDDEN),auxiliaryBarVisible:!this.stateModel.getRuntimeValue(d.AUXILIARYBAR_HIDDEN),panelVisible:!this.stateModel.getRuntimeValue(d.PANEL_HIDDEN),statusbarVisible:!this.stateModel.getRuntimeValue(d.STATUSBAR_HIDDEN),sideBarPosition:St(this.stateModel.getRuntimeValue(d.SIDEBAR_POSITON)),panelPosition:St(this.stateModel.getRuntimeValue(d.PANEL_POSITION))};return this.telemetryService.publicLog2("startupLayout",Xn),Vi}dispose(){super.dispose(),this.disposed=!0}}function An(l){return l.getValue(Re.ZEN_MODE_CONFIG)}class Kn{constructor(e,t,i,s){this.name=e,this.scope=t,this.target=i,this.defaultValue=s}}class M extends Kn{constructor(e,t,i,s,n){super(e,t,i,s),this.zenModeIgnore=n,this.runtime=!0}}class Fi extends Kn{constructor(){super(...arguments),this.runtime=!1}}const d={MAIN_EDITOR_CENTERED:new M("editor.centered",p.WORKSPACE,D.MACHINE,!1),ZEN_MODE_ACTIVE:new M("zenMode.active",p.WORKSPACE,D.MACHINE,!1),ZEN_MODE_EXIT_INFO:new M("zenMode.exitInfo",p.WORKSPACE,D.MACHINE,{transitionedToCenteredEditorLayout:!1,transitionedToFullScreen:!1,handleNotificationsDoNotDisturbMode:!1,wasVisible:{auxiliaryBar:!1,panel:!1,sideBar:!1}}),SIDEBAR_SIZE:new Fi("sideBar.size",p.PROFILE,D.MACHINE,300),AUXILIARYBAR_SIZE:new Fi("auxiliaryBar.size",p.PROFILE,D.MACHINE,300),PANEL_SIZE:new Fi("panel.size",p.PROFILE,D.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_HEIGHT:new M("panel.lastNonMaximizedHeight",p.PROFILE,D.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_WIDTH:new M("panel.lastNonMaximizedWidth",p.PROFILE,D.MACHINE,300),PANEL_WAS_LAST_MAXIMIZED:new M("panel.wasLastMaximized",p.WORKSPACE,D.MACHINE,!1),AUXILIARYBAR_WAS_LAST_MAXIMIZED:new M("auxiliaryBar.wasLastMaximized",p.WORKSPACE,D.MACHINE,!1),AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE:new M("auxiliaryBar.lastNonMaximizedSize",p.PROFILE,D.MACHINE,300),AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY:new M("auxiliaryBar.lastNonMaximizedVisibility",p.WORKSPACE,D.MACHINE,{sideBarVisible:!1,editorVisible:!1,panelVisible:!1,auxiliaryBarVisible:!1}),SIDEBAR_POSITON:new M("sideBar.position",p.WORKSPACE,D.MACHINE,v.LEFT),PANEL_POSITION:new M("panel.position",p.WORKSPACE,D.MACHINE,v.BOTTOM),PANEL_ALIGNMENT:new M("panel.alignment",p.PROFILE,D.USER,"center"),ACTIVITYBAR_HIDDEN:new M("activityBar.hidden",p.WORKSPACE,D.MACHINE,!1,!0),SIDEBAR_HIDDEN:new M("sideBar.hidden",p.WORKSPACE,D.MACHINE,!1),EDITOR_HIDDEN:new M("editor.hidden",p.WORKSPACE,D.MACHINE,!1),PANEL_HIDDEN:new M("panel.hidden",p.WORKSPACE,D.MACHINE,!0),AUXILIARYBAR_HIDDEN:new M("auxiliaryBar.hidden",p.WORKSPACE,D.MACHINE,!0),STATUSBAR_HIDDEN:new M("statusBar.hidden",p.WORKSPACE,D.MACHINE,!1,!0)};var Re;(function(l){l.AUXILIARYBAR_DEFAULT_VISIBILITY="workbench.secondarySideBar.defaultVisibility",l.ACTIVITY_BAR_VISIBLE="workbench.activityBar.visible",l.PANEL_POSITION="workbench.panel.defaultLocation",l.PANEL_OPENS_MAXIMIZED="workbench.panel.opensMaximized",l.ZEN_MODE_CONFIG="zenMode",l.EDITOR_CENTERED_LAYOUT_AUTO_RESIZE="workbench.editor.centeredLayoutAutoResize"})(Re||(Re={}));var se;(function(l){l.STATUSBAR_VISIBLE="workbench.statusBar.visible",l.SIDEBAR_POSITION="workbench.sideBar.location"})(se||(se={}));const Ct=class Ct extends te{constructor(e,t,i,s,n,r){super(),this.storageService=e,this.configurationService=t,this.contextService=i,this.coreExperimentationService=s,this.environmentService=n,this.viewDescriptorService=r,this._onDidChangeState=this._register(new E),this.onDidChangeState=this._onDidChangeState.event,this.stateCache=new Map,this.isNew={[p.WORKSPACE]:this.storageService.isNew(p.WORKSPACE),[p.PROFILE]:this.storageService.isNew(p.PROFILE),[p.APPLICATION]:this.storageService.isNew(p.APPLICATION)},this._register(this.configurationService.onDidChangeConfiguration(o=>this.updateStateFromLegacySettings(o)))}updateStateFromLegacySettings(e){e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&this.setRuntimeValueAndFire(d.ACTIVITYBAR_HIDDEN,this.isActivityBarHidden()),e.affectsConfiguration(se.STATUSBAR_VISIBLE)&&this.setRuntimeValueAndFire(d.STATUSBAR_HIDDEN,!this.configurationService.getValue(se.STATUSBAR_VISIBLE)),e.affectsConfiguration(se.SIDEBAR_POSITION)&&this.setRuntimeValueAndFire(d.SIDEBAR_POSITON,ti(this.configurationService.getValue(se.SIDEBAR_POSITION)??"left"))}updateLegacySettingsFromState(e,t){const i=this.getRuntimeValue(d.ZEN_MODE_ACTIVE);e.zenModeIgnore&&i||(e===d.ACTIVITYBAR_HIDDEN?this.configurationService.updateValue(_.ACTIVITY_BAR_LOCATION,t?Me.HIDDEN:void 0):e===d.STATUSBAR_HIDDEN?this.configurationService.updateValue(se.STATUSBAR_VISIBLE,!t):e===d.SIDEBAR_POSITON&&this.configurationService.updateValue(se.SIDEBAR_POSITION,St(t)))}load(e){let t;if(!e.resetLayout)for(t in d){const n=d[t],r=this.loadKeyFromStorage(n);r!==void 0&&this.stateCache.set(n.name,r)}this.stateCache.set(d.ACTIVITYBAR_HIDDEN.name,this.isActivityBarHidden()),this.stateCache.set(d.STATUSBAR_HIDDEN.name,!this.configurationService.getValue(se.STATUSBAR_VISIBLE)),this.stateCache.set(d.SIDEBAR_POSITON.name,ti(this.configurationService.getValue(se.SIDEBAR_POSITION)??"left"));const i=this.contextService.getWorkbenchState(),s=e.mainContainerDimension;d.SIDEBAR_SIZE.defaultValue=Math.min(300,s.width/4),d.SIDEBAR_HIDDEN.defaultValue=i===Oe.EMPTY,d.AUXILIARYBAR_SIZE.defaultValue=Math.min(300,s.width/4),d.AUXILIARYBAR_HIDDEN.defaultValue=(()=>{const n=this.configurationService.inspect(Re.AUXILIARYBAR_DEFAULT_VISIBILITY);if(n.defaultValue!=="hidden"&&!Xr(n)){if(le&&!this.environmentService.remoteAuthority)return!0;const r=this.storageService.getObject("chat.setupContext",p.PROFILE);if(r&&(r.installed&&r.disabled||!r.installed&&r.hidden))return!0;const o=this.viewDescriptorService.getViewLocationById("workbench.panel.chat.view.copilot");if(o===T.Sidebar||o===T.Panel)return!0}switch(this.configurationService.getValue(Re.AUXILIARYBAR_DEFAULT_VISIBILITY)){case"maximized":case"visible":return!1;case"visibleInWorkspace":case"maximizedInWorkspace":return i===Oe.EMPTY;default:return!0}})(),d.PANEL_SIZE.defaultValue=this.stateCache.get(d.PANEL_POSITION.name)??H(d.PANEL_POSITION.defaultValue)?s.height/3:s.width/4,d.PANEL_POSITION.defaultValue=ti(this.configurationService.getValue(Re.PANEL_POSITION)??"bottom");for(t in d){const n=d[t];this.stateCache.get(n.name)===void 0&&this.stateCache.set(n.name,n.defaultValue)}this.applyOverrides(e),this._register(this.storageService.onDidChangeValue(p.PROFILE,void 0,this._store)(n=>{let r;for(r in d){const o=d[r];if(o instanceof M&&o.scope===p.PROFILE&&o.target===D.USER&&`${Ct.STORAGE_PREFIX}${o.name}`===n.key){const a=this.loadKeyFromStorage(o)??o.defaultValue;this.stateCache.get(o.name)!==a&&(this.stateCache.set(o.name,a),this._onDidChangeState.fire({key:o,value:a}))}}}))}applyOverrides(e){const t=new Zr(()=>{try{return this.coreExperimentationService.getExperiment()}catch{return}});if(this.storageService.isNew(p.APPLICATION)&&this.contextService.getWorkbenchState()===Oe.EMPTY&&(t.value?.experimentGroup===Y.MaximizedChat||t.value?.experimentGroup===Y.SplitEmptyEditorChat||t.value?.experimentGroup===Y.SplitWelcomeChat)){if(t.value.experimentGroup===Y.MaximizedChat)this.applyAuxiliaryBarMaximizedOverride();else if(t.value.experimentGroup===Y.SplitEmptyEditorChat||t.value.experimentGroup===Y.SplitWelcomeChat){const i=e.mainContainerDimension;this.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,!1),this.setInitializationValue(d.AUXILIARYBAR_SIZE,Math.ceil(i.width/(1.618*1.618)))}}else if(this.isNew[p.WORKSPACE]){const i=this.configurationService.getValue(Re.AUXILIARYBAR_DEFAULT_VISIBILITY);(i==="maximized"||i==="maximizedInWorkspace"&&this.contextService.getWorkbenchState()!==Oe.EMPTY)&&this.applyAuxiliaryBarMaximizedOverride()}this.getRuntimeValue(d.PANEL_HIDDEN)&&this.getRuntimeValue(d.EDITOR_HIDDEN)&&!this.getRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED)&&this.setRuntimeValue(d.EDITOR_HIDDEN,!1)}applyAuxiliaryBarMaximizedOverride(){this.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY,{sideBarVisible:!this.getRuntimeValue(d.SIDEBAR_HIDDEN),panelVisible:!this.getRuntimeValue(d.PANEL_HIDDEN),editorVisible:!this.getRuntimeValue(d.EDITOR_HIDDEN),auxiliaryBarVisible:!this.getRuntimeValue(d.AUXILIARYBAR_HIDDEN)}),this.setRuntimeValue(d.SIDEBAR_HIDDEN,!0),this.setRuntimeValue(d.PANEL_HIDDEN,!0),this.setRuntimeValue(d.EDITOR_HIDDEN,!0),this.setRuntimeValue(d.AUXILIARYBAR_HIDDEN,!1),this.setRuntimeValue(d.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE,this.getInitializationValue(d.AUXILIARYBAR_SIZE)),this.setRuntimeValue(d.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!0)}save(e,t){let i;const s=this.getRuntimeValue(d.ZEN_MODE_ACTIVE);for(i in d){const n=d[i];if(e&&n.scope===p.WORKSPACE||t&&n.scope===p.PROFILE){if(s&&n instanceof M&&n.zenModeIgnore)continue;this.saveKeyToStorage(n)}}}getInitializationValue(e){return this.stateCache.get(e.name)}setInitializationValue(e,t){this.stateCache.set(e.name,t)}getRuntimeValue(e,t){if(t)switch(e){case d.ACTIVITYBAR_HIDDEN:this.stateCache.set(e.name,this.isActivityBarHidden());break;case d.STATUSBAR_HIDDEN:this.stateCache.set(e.name,!this.configurationService.getValue(se.STATUSBAR_VISIBLE));break;case d.SIDEBAR_POSITON:this.stateCache.set(e.name,this.configurationService.getValue(se.SIDEBAR_POSITION)??"left");break}return this.stateCache.get(e.name)}setRuntimeValue(e,t){this.stateCache.set(e.name,t);const i=this.getRuntimeValue(d.ZEN_MODE_ACTIVE);e.scope===p.PROFILE&&(!i||!e.zenModeIgnore)&&(this.saveKeyToStorage(e),this.updateLegacySettingsFromState(e,t))}isActivityBarHidden(){const e=this.configurationService.getValue(Re.ACTIVITY_BAR_VISIBLE);return e!==void 0?!e:this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION)!==Me.DEFAULT}setRuntimeValueAndFire(e,t){this.stateCache.get(e.name)!==t&&(this.setRuntimeValue(e,t),this._onDidChangeState.fire({key:e,value:t}))}saveKeyToStorage(e){const t=this.stateCache.get(e.name);this.storageService.store(`${Ct.STORAGE_PREFIX}${e.name}`,typeof t=="object"?JSON.stringify(t):t,e.scope,e.target)}loadKeyFromStorage(e){const t=this.storageService.get(`${Ct.STORAGE_PREFIX}${e.name}`,e.scope);if(t!==void 0)switch(this.isNew[e.scope]=!1,typeof e.defaultValue){case"boolean":return t==="true";case"number":return parseInt(t);case"object":return JSON.parse(t)}return t}};Ct.STORAGE_PREFIX="workbench.";let fs=Ct;const Ic=5e3;let gs=class extends te{constructor(e,t,i){super(),this._accessibilitySignalService=i,this._scheduler=new Vn(()=>{this._signalLoop=this._accessibilitySignalService.playSignalLoop(vi.progress,t??Ic)},e),this._scheduler.schedule()}dispose(){super.dispose(),this._signalLoop?.dispose(),this._scheduler.dispose()}};gs=y([u(2,yi)],gs);class Cc{constructor(){this.priority=90,this.name="notifications",this.when=ge,this.type=tn.View}getProvider(e){const t=e.get($r),i=e.get(pt),s=e.get(Te),n=e.get(yi);function r(){const o=Ue(i);if(!o)return;s.executeCommand("notifications.showList");let a;const c=i.lastFocusedList;if(c instanceof Os&&(a=c.indexOf(o)),a===void 0)return;function f(){if(s.executeCommand("notifications.showList"),c&&a!==void 0){c.domFocus();try{c.setFocus([a])}catch{}}}function m(){const S=Ue(i),x=S?.message.original.toString();if(!(!S||!x))return Gt(S.source?g(3424,"{0} Source: {1}",x,S.source):x,S.severity)}const A=m();if(A)return o.onDidClose(()=>t.next()),new qr(jr.Notification,{type:tn.View},()=>A,()=>f(),"accessibility.verbosity.notification",void 0,bc(o,n),()=>{if(c)return f(),c.focusNext(),m()},()=>{if(c)return f(),c.focusPrevious(),m()})}return r()}}function bc(l,e){let t;if(l.actions&&(t=[],l.actions.primary&&t.push(...l.actions.primary),l.actions.secondary&&t.push(...l.actions.secondary)),t)for(const s of t){s.class=W.asClassName(J.bell);const n=s.run;s.run=()=>{n(),l.close()}}const i=t?.find(s=>s.label.includes("Manage Extension"));return i&&(i.class=W.asClassName(J.gear)),t&&t.push({id:"clearNotification",label:g(3425,"Clear Notification"),tooltip:g(3425,"Clear Notification"),run:()=>{l.close(),e.playSignal(vi.clear)},enabled:!0,class:W.asClassName(J.clearAll)}),t}class Ec extends Sc{constructor(e,t,i,s){super(e,{resetLayout:!!t?.resetLayout}),this.options=t,this.serviceCollection=i,this._onWillShutdown=this._register(new E),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new E),this.onDidShutdown=this._onDidShutdown.event,this.previousUnexpectedError={message:void 0,time:0},k("code/willStartWorkbench"),this.registerErrorHandler(s),this.parent.appendChild(this.mainContainer)}registerErrorHandler(e){C.addEventListener("unhandledrejection",t=>{ii(t.reason),t.preventDefault()}),Bn(t=>this.handleUnexpectedError(t,e))}handleUnexpectedError(e,t){const i=qt(e,!0);if(!i)return;const s=Date.now();i===this.previousUnexpectedError.message&&s-this.previousUnexpectedError.time<=1e3||(this.previousUnexpectedError.time=s,this.previousUnexpectedError.message=i,t.error(i))}startup(){try{this._register(Jr(175));const e=this.initServices(this.serviceCollection);return e.invokeFunction(t=>{const i=t.get(li),s=t.get(he),n=t.get(ee),r=t.get(_t),o=t.get(Qr),a=t.get(Pe);this.initLayout(t),this.registerListeners(i,s,n,r,o),this.renderWorkbench(e,a,s,n),this.createWorkbenchLayout(),this.layout(),this.restore(i)}),e}catch(e){throw ii(e),e}}initServices(e){e.set(ce,this);const t=fo();for(const[s,n]of t)e.set(s,n);const i=new eo(e,!0);return i.invokeFunction(s=>{const n=s.get(li),r=s.get(ee);typeof r.acquireInstantiationService=="function"&&r.acquireInstantiationService(i),n.phase=Vt.Ready}),i}registerListeners(e,t,i,s,n){this._register(i.onDidChangeConfiguration(r=>this.updateFontAliasing(r,i))),si?this._register(t.onWillSaveState(r=>{r.reason===to.SHUTDOWN&&this.storeFontInfo(t)})):this._register(e.onWillShutdown(()=>this.storeFontInfo(t))),this._register(e.onWillShutdown(r=>this._onWillShutdown.fire(r))),this._register(e.onDidShutdown(()=>{this._onDidShutdown.fire(),this.dispose()})),this._register(s.onDidChangeFocus(r=>{r||t.flush()})),this._register(n.onWillShowDialog(()=>this.mainContainer.classList.add("modal-dialog-visible"))),this._register(n.onDidShowDialog(()=>this.mainContainer.classList.remove("modal-dialog-visible")))}updateFontAliasing(e,t){if(!pe||e&&!e.affectsConfiguration("workbench.fontAliasing"))return;const i=t.getValue("workbench.fontAliasing");if(this.fontAliasing===i)return;this.fontAliasing=i;const s=["antialiased","none","auto"];this.mainContainer.classList.remove(...s.map(n=>`monaco-font-aliasing-${n}`)),s.some(n=>n===i)&&this.mainContainer.classList.add(`monaco-font-aliasing-${i}`)}restoreFontInfo(e,t){const i=e.get("editorFontInfo",p.APPLICATION);if(i)try{const s=JSON.parse(i);Array.isArray(s)&&Oi.restoreFontInfo(C,s)}catch{}Oi.readFontInfo(C,io.createFromRawSettings(t.getValue("editor"),so.getInstance(C).value))}storeFontInfo(e){const t=Oi.serializeFontInfo(C);t&&e.store("editorFontInfo",JSON.stringify(t),p.APPLICATION,D.MACHINE)}renderWorkbench(e,t,i,s){no(this.mainContainer),ro((o,a)=>e.createInstance(gs,o,a));const r=Pt(["monaco-workbench",Et?"windows":Ut?"linux":"mac",le?"web":void 0,oo?"chromium":ao?"firefox":co?"safari":void 0,...this.getLayoutClasses(),...this.options?.extraClasses?this.options.extraClasses:[]]);this.mainContainer.classList.add(...r),this.updateFontAliasing(void 0,s),this.restoreFontInfo(i,s);for(const{id:o,role:a,classes:c,options:f}of[{id:h.TITLEBAR_PART,role:"none",classes:["titlebar"]},{id:h.BANNER_PART,role:"banner",classes:["banner"]},{id:h.ACTIVITYBAR_PART,role:"none",classes:["activitybar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.SIDEBAR_PART,role:"none",classes:["sidebar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.EDITOR_PART,role:"main",classes:["editor"],options:{restorePreviousState:this.willRestoreEditors()}},{id:h.PANEL_PART,role:"none",classes:["panel","basepanel",St(this.getPanelPosition())]},{id:h.AUXILIARYBAR_PART,role:"none",classes:["auxiliarybar","basepanel",this.getSideBarPosition()===v.LEFT?"right":"left"]},{id:h.STATUSBAR_PART,role:"status",classes:["statusbar"]}]){const m=this.createPart(o,a,c);k(`code/willCreatePart/${o}`),this.getPart(o).create(m,f),k(`code/didCreatePart/${o}`)}this.createNotificationsHandlers(e,t)}createPart(e,t,i){const s=zt(t==="status"?"footer":"div");return s.classList.add("part",...i),s.id=e,s.setAttribute("role",t),t==="status"&&s.setAttribute("aria-live","off"),s}createNotificationsHandlers(e,t){const i=this._register(e.createInstance(hs,this.mainContainer,t.model)),s=this._register(e.createInstance(ds,this.mainContainer,t.model));this._register(e.createInstance(fc,t.model));const n=e.createInstance(ls,t.model);this._register(i.onDidChangeVisibility(()=>{n.update(i.isVisible,s.isVisible),s.update(i.isVisible)})),this._register(s.onDidChangeVisibility(()=>{n.update(i.isVisible,s.isVisible)})),rc(i,s,t.model),ho.register(new Cc),this.registerNotifications({onDidChangeNotificationsVisibility:me.map(me.any(s.onDidChangeVisibility,i.onDidChangeVisibility),()=>s.isVisible||i.isVisible)})}restore(e){try{this.restoreParts()}catch(t){ii(t)}this.whenReady.finally(()=>Promise.race([this.whenRestored,lo(2e3)]).finally(()=>{function t(){k("code/didStartWorkbench"),performance.measure("perf: workbench create & restore","code/didLoadWorkbenchMain","code/didStartWorkbench")}this.isRestored()?t():this.whenRestored.finally(()=>t()),e.phase=Vt.Restored,this._register(new Vn(()=>{this._register(uo(C,()=>e.phase=Vt.Eventually,2500))},2500)).schedule()}))}}const Tc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ms;let ps=class{constructor(e,t,i,s){this._disposables=new L,this._onDidChangeVisibility=this._disposables.add(new E),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.element=zt("div"),this.element.classList.add("command-center");const n=i.createInstance(go,this.element,R.CommandCenter,{contextMenu:R.TitleBarContext,hiddenItemStrategy:Ln.NoHide,toolbarOptions:{primaryGroup:()=>!0},telemetrySource:"commandCenter",actionViewItemProvider:(r,o)=>r instanceof mo&&r.item.submenu===R.CommandCenterCenter?i.createInstance(As,r,e,{...o,hoverDelegate:t}):zs(i,r,{...o,hoverDelegate:t})});this._disposables.add(me.filter(s.onShow,()=>Nn(this.element),this._disposables)(this._setVisibility.bind(this,!1))),this._disposables.add(s.onHide(this._setVisibility.bind(this,!0))),this._disposables.add(n)}_setVisibility(e){this.element.classList.toggle("hide",!e),this._onDidChangeVisibility.fire()}dispose(){this._disposables.dispose()}};ps=y([u(2,O),u(3,Tn)],ps);var st;let As=(st=class extends sn{constructor(e,t,i,s,n,r,o){super(void 0,e.actions.find(a=>a.id==="workbench.action.quickOpenWithModes")??e.actions[0],i),this._submenu=e,this._windowTitle=t,this._hoverService=s,this._keybindingService=n,this._instaService=r,this._editorGroupService=o,this._hoverDelegate=i.hoverDelegate??Gi("mouse")}render(e){super.render(e),e.classList.add("command-center-center"),e.classList.toggle("multiple",this._submenu.actions.length>1);const t=this._store.add(this._hoverService.setupManagedHover(this._hoverDelegate,e,this.getTooltip()));this._store.add(this._windowTitle.onDidChange(()=>{t.update(this.getTooltip())}));const i=[];for(const s of this._submenu.actions)s instanceof po?i.push(s.actions):i.push([s]);for(let s=0;s<i.length;s++){const n=i[s],r=this._instaService.createInstance(Mn,e,{hiddenItemStrategy:Ln.NoHide,telemetrySource:"commandCenterCenter",actionViewItemProvider:(o,a)=>{if(a={...a,hoverDelegate:this._hoverDelegate},o.id!==ms._quickOpenCommandId)return zs(this._instaService,o,a);const c=this;return this._instaService.createInstance(class extends sn{constructor(){super(void 0,o,a)}render(m){super.render(m),m.classList.toggle("command-center-quick-pick"),m.role="button";const A=this.action,S=zt("span");S.ariaHidden="true",S.className=A.class??"",S.classList.add("search-icon");const x=this._getLabel(),G=zt("span");G.classList.add("search-label"),G.innerText=x,$i(m,S,G);const ve=this._store.add(c._hoverService.setupManagedHover(c._hoverDelegate,m,this.getTooltip()));this._store.add(c._windowTitle.onDidChange(()=>{ve.update(this.getTooltip()),G.innerText=this._getLabel()})),this._store.add(c._editorGroupService.onDidChangeEditorPartOptions(({newPartOptions:He,oldPartOptions:Vi})=>{He.showTabs!==Vi.showTabs&&(ve.update(this.getTooltip()),G.innerText=this._getLabel())}))}getTooltip(){return c.getTooltip()}_getLabel(){const{prefix:m,suffix:A}=c._windowTitle.getTitleDecorations();let S=c._windowTitle.workspaceName;return c._windowTitle.isCustomTitleFormat()?S=c._windowTitle.getWindowTitle():c._editorGroupService.partOptions.showTabs==="none"&&(S=c._windowTitle.fileName??S),S||(S=g(3544,"Search")),m&&(S=g(3545,"{0} {1}",m,S)),A&&(S=g(3546,"{0} {1}",S,A)),S.replaceAll(/\r\n|\r|\n/g,"⏎")}})}});if(r.setActions(n),this._store.add(r),s<i.length-1){const o=qi(J.circleSmallFilled);o.style.padding="0 12px",o.style.height="100%",o.style.opacity="0.5",e.appendChild(o)}}}getTooltip(){const e=this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();return e?g(3547,"Search {0} ({1}) — {2}",this._windowTitle.workspaceName,e,this._windowTitle.value):g(3548,"Search {0} — {1}",this._windowTitle.workspaceName,this._windowTitle.value)}},ms=st,st._quickOpenCommandId="workbench.action.quickOpenWithModes",st);As=ms=y([u(3,Fs),u(4,ut),u(5,O),u(6,ft)],As);Be.appendMenuItem(R.CommandCenter,{submenu:R.CommandCenterCenter,title:g(3549,"Command Center"),icon:J.shield,order:101});class Xs extends Ce{constructor(e,t,i,s,n){super({id:`toggle.${e}`,title:t,metadata:i?{description:i}:void 0,toggled:P.equals(`config.${e}`,!0),menu:[{id:R.TitleBarContext,when:n,order:s,group:"2_config"},{id:R.TitleBarTitleContext,when:n,order:s,group:"2_config"}]}),this.section=e}run(e,...t){const i=e.get(ee),s=i.getValue(this.section);i.updateValue(this.section,!s)}}fe(class extends Xs{constructor(){super(_.COMMAND_CENTER,g(3568,"Command Center"),g(3569,"Toggle visibility of the Command Center in title bar"),1,Us.toNegated())}});fe(class extends Xs{constructor(){super("workbench.navigationControl.enabled",g(3570,"Navigation Controls"),g(3571,"Toggle visibility of the Navigation Controls in title bar"),2,P.and(Us.toNegated(),P.has("config.window.commandCenter")))}});fe(class extends Xs{constructor(){super(_.LAYOUT_ACTIONS,g(3572,"Layout Controls"),g(3573,"Toggle visibility of the Layout Controls in title bar"),4)}});fe(class extends Ce{constructor(){super({id:`toggle.${X.CUSTOM_TITLE_BAR_VISIBILITY}`,title:g(3574,"Hide Custom Title Bar"),menu:[{id:R.TitleBarContext,order:0,when:P.equals(Qi.key,es.NATIVE),group:"3_toggle"},{id:R.TitleBarTitleContext,order:0,when:P.equals(Qi.key,es.NATIVE),group:"3_toggle"}]})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER)}});fe(class extends Ce{constructor(){super({id:`toggle.${X.CUSTOM_TITLE_BAR_VISIBILITY}.windowed`,title:g(3575,"Hide Custom Title Bar In Full Screen"),menu:[{id:R.TitleBarContext,order:1,when:Yt,group:"3_toggle"},{id:R.TitleBarTitleContext,order:1,when:Yt,group:"3_toggle"}]})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.WINDOWED)}});class yc extends Ce{constructor(){super({id:"toggle.toggleCustomTitleBar",title:g(3576,"Custom Title Bar"),toggled:Jt,menu:[{id:R.MenubarAppearanceMenu,order:6,when:P.or(P.and(P.equals(Qi.key,es.NATIVE),P.and(P.equals("config.workbench.layoutControl.enabled",!1),P.equals("config.window.commandCenter",!1),P.notEquals("config.workbench.editor.editorActionsLocation","titleBar"),P.notEquals("config.workbench.activityBar.location","top"),P.notEquals("config.workbench.activityBar.location","bottom"))?.negate()),Yt),group:"2_workbench_layout"}]})}run(e,...t){const i=e.get(ee),s=e.get(Ie);switch(i.getValue(X.CUSTOM_TITLE_BAR_VISIBILITY)){case oe.NEVER:i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO);break;case oe.WINDOWED:{Yt.evaluate(s.getContext(null))?i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO):i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER);break}case oe.AUTO:default:i.updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER);break}}}fe(yc);fe(class extends Ce{constructor(){super({id:"showCustomTitleBar",title:re(3577,"Show Custom Title Bar"),precondition:Jt.negate(),f1:!0})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.AUTO)}});fe(class extends Ce{constructor(){super({id:"hideCustomTitleBar",title:re(3578,"Hide Custom Title Bar"),precondition:Jt,f1:!0})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.NEVER)}});fe(class extends Ce{constructor(){super({id:"hideCustomTitleBarInFullScreen",title:re(3579,"Hide Custom Title Bar In Full Screen"),precondition:P.and(Jt,Yt),f1:!0})}run(e,...t){e.get(ee).updateValue(X.CUSTOM_TITLE_BAR_VISIBILITY,oe.WINDOWED)}});var U;fe((U=class extends Ce{constructor(){const e=P.and(P.equals("config.workbench.editor.showTabs","none").negate(),P.equals(`config.${U.settingsID}`,"default"))?.negate();super({id:`toggle.${U.settingsID}`,title:g(3580,"Editor Actions"),toggled:P.equals(`config.${U.settingsID}`,"hidden").negate(),menu:[{id:R.TitleBarContext,order:3,when:e,group:"2_config"},{id:R.TitleBarTitleContext,order:3,when:e,group:"2_config"}]})}run(e,...t){const i=e.get(ee),s=e.get(he),n=i.getValue(U.settingsID);if(n==="hidden"){if(i.getValue(_.EDITOR_TABS_MODE)!=="none")i.updateValue(U.settingsID,"titleBar");else{const o=s.get(U.settingsID,p.PROFILE);i.updateValue(U.settingsID,o??"default")}s.remove(U.settingsID,p.PROFILE)}else i.updateValue(U.settingsID,"hidden"),s.store(U.settingsID,n,p.PROFILE,D.USER)}},U.settingsID="workbench.editor.editorActionsLocation",U));const vc={id:ji,label:g(3581,"Accounts"),tooltip:g(3581,"Accounts"),class:void 0,enabled:!0,run:function(){}},_c={id:Ji,label:g(3582,"Manage"),tooltip:g(3582,"Manage"),class:void 0,enabled:!0,run:function(){}};var Ss;ke(Tc);let Is=class extends On{constructor(e,t,i){super("workbench.titleService",i,t),this.instantiationService=e,this.properties=void 0,this.variables=new Map,this.mainPart=this._register(this.createMainTitlebarPart()),this.onMenubarVisibilityChange=this.mainPart.onMenubarVisibilityChange,this._register(this.registerPart(this.mainPart)),this.registerActions(),this.registerAPICommands()}createMainTitlebarPart(){return this.instantiationService.createInstance(Cs)}registerActions(){const e=this;this._register(fe(class extends Ce{constructor(){super({id:"workbench.action.focusTitleBar",title:re(3583,"Focus Title Bar"),category:Ys.View,f1:!0,precondition:Jt})}run(){e.getPartByDocument(Dn())?.focus()}}))}registerAPICommands(){this._register(We.registerCommand({id:"registerWindowTitleVariable",handler:(e,t,i)=>{this.registerVariables([{name:t,contextKey:i}])},metadata:{description:"Registers a new title variable",args:[{name:"name",schema:{type:"string"},description:"The name of the variable to register"},{name:"contextKey",schema:{type:"string"},description:"The context key to use for the value of the variable"}]}}))}createAuxiliaryTitlebarPart(e,t,i){const s=I(".part.titlebar",{role:"none"});s.style.position="relative",e.insertBefore(s,e.firstChild);const n=new L,r=this.doCreateAuxiliaryTitlebarPart(s,t,i);return n.add(this.registerPart(r)),n.add(me.runAndSubscribe(r.onDidChange,()=>s.style.height=`${r.height}px`)),r.create(s),this.properties&&r.updateProperties(this.properties),this.variables.size&&r.registerVariables(Array.from(this.variables.values())),me.once(r.onWillDispose)(()=>n.dispose()),r}doCreateAuxiliaryTitlebarPart(e,t,i){return i.createInstance(bs,e,t,this.mainPart)}updateProperties(e){this.properties=e;for(const t of this.parts)t.updateProperties(e)}registerVariables(e){const t=[];for(const i of e)this.variables.has(i.name)||(this.variables.set(i.name,i),t.push(i));for(const i of this.parts)i.registerVariables(t)}};Is=y([u(0,O),u(1,he),u(2,ue)],Is);let Ii=class extends Pi{get minimumHeight(){const e=le&&Ki();let t=this.isCommandCenterVisible||e?Ao:30;return e&&(t=Math.max(t,So(K(this.element))?.height??0)),t/(this.preventZoom?ni(K(this.element)):1)}get maximumHeight(){return this.minimumHeight}constructor(e,t,i,s,n,r,o,a,c,f,m,A,S,x,G){super(e,{hasTitle:!1},a,c,f),this.editorGroupsContainer=i,this.contextMenuService=s,this.configurationService=n,this.environmentService=r,this.instantiationService=o,this.storageService=c,this.contextKeyService=m,this.hostService=A,this.editorService=S,this.menuService=x,this.keybindingService=G,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this._onMenubarVisibilityChange=this._register(new E),this.onMenubarVisibilityChange=this._onMenubarVisibilityChange.event,this._onWillDispose=this._register(new E),this.onWillDispose=this._onWillDispose.event,this.customMenubar=this._register(new ze),this.actionToolBarDisposable=this._register(new L),this.editorActionsChangeDisposable=this._register(new L),this.globalToolbarMenuDisposables=this._register(new L),this.editorToolbarMenuDisposables=this._register(new L),this.layoutToolbarMenuDisposables=this._register(new L),this.activityToolbarDisposables=this._register(new L),this.titleDisposables=this._register(new L),this.isInactive=!1,this.isCompact=!1,this.isAuxiliary=t.vscodeWindowId!==C.vscodeWindowId,this.isCompactContextKey=Us.bindTo(this.contextKeyService),this.titleBarStyle=Io(this.configurationService),this.windowTitle=this._register(o.createInstance(Co,t)),this.hoverDelegate=this._register(bo()),this.registerListeners(Zi(t))}registerListeners(e){this._register(this.hostService.onDidChangeFocus(t=>t?this.onFocus():this.onBlur())),this._register(this.hostService.onDidChangeActiveWindow(t=>t===e?this.onFocus():this.onBlur())),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationChanged(t))),this._register(this.editorGroupsContainer.onDidChangeEditorPartOptions(t=>this.onEditorPartConfigurationChange(t)))}onBlur(){this.isInactive=!0,this.updateStyles()}onFocus(){this.isInactive=!1,this.updateStyles()}onEditorPartConfigurationChange({oldPartOptions:e,newPartOptions:t}){(e.editorActionsLocation!==t.editorActionsLocation||e.showTabs!==t.showTabs)&&this.actionToolBar&&(this.createActionToolBar(),this.createActionToolBarMenus({editorActions:!0}),this._onDidChange.fire(void 0))}onConfigurationChanged(e){if(!this.isAuxiliary&&!Xi(this.configurationService,this.titleBarStyle)&&(!pe||le)&&e.affectsConfiguration(Gs.MenuBarVisibility)&&(this.currentMenubarVisibility==="compact"?this.uninstallMenubar():this.installMenubar()),this.actionToolBar){const t=e.affectsConfiguration(_.LAYOUT_ACTIONS),i=e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION);(t||i)&&(this.createActionToolBarMenus({layoutActions:t,activityActions:i}),this._onDidChange.fire(void 0))}e.affectsConfiguration(_.COMMAND_CENTER)&&this.recreateTitle()}recreateTitle(){this.createTitle(),this._onDidChange.fire(void 0)}updateOptions(e){const t=this.isCompact;this.isCompact=e.compact,this.isCompactContextKey.set(this.isCompact),t!==this.isCompact&&(this.recreateTitle(),this.createActionToolBarMenus(!0))}installMenubar(){this.menubar||(this.customMenubar.value=this.instantiationService.createInstance(Eo),this.menubar=ne(this.leftContent,I("div.menubar")),this.menubar.setAttribute("role","menubar"),this._register(this.customMenubar.value.onVisibilityChange(e=>this.onMenubarVisibilityChanged(e))),this.customMenubar.value.create(this.menubar))}uninstallMenubar(){this.customMenubar.value=void 0,this.menubar?.remove(),this.menubar=void 0,this.onMenubarVisibilityChanged(!1)}onMenubarVisibilityChanged(e){(le||Et||Ut)&&(this.lastLayoutDimensions&&this.layout(this.lastLayoutDimensions.width,this.lastLayoutDimensions.height),this._onMenubarVisibilityChange.fire(e))}updateProperties(e){this.windowTitle.updateProperties(e)}registerVariables(e){this.windowTitle.registerVariables(e)}createContentArea(e){if(this.element=e,this.rootContainer=ne(e,I(".titlebar-container")),this.leftContent=ne(this.rootContainer,I(".titlebar-left")),this.centerContent=ne(this.rootContainer,I(".titlebar-center")),this.rightContent=ne(this.rootContainer,I(".titlebar-right")),(Et||Ut)&&!Bt(this.configurationService,this.titleBarStyle)&&(this.appIcon=nn(this.leftContent,I("a.window-appicon"))),this.dragRegion=nn(this.rootContainer,I("div.titlebar-drag-region")),!this.isAuxiliary&&!Xi(this.configurationService,this.titleBarStyle)&&(!pe||le)&&this.currentMenubarVisibility!=="compact"&&this.installMenubar(),this.title=ne(this.centerContent,I("div.window-title")),this.createTitle(),this.actionToolBarElement=ne(this.rightContent,I("div.action-toolbar-container")),this.createActionToolBar(),this.createActionToolBarMenus(),!Bt(this.configurationService,this.titleBarStyle)){let t=pe?"left":"right";pe&&si&&To.Locale(yo).value?.textInfo?.direction==="rtl"&&(t="right"),pe&&si&&t==="left"||vo(this.configurationService)===_o.HIDDEN||(this.windowControlsContainer=ne(t==="left"?this.leftContent:this.rightContent,I("div.window-controls-container")),le&&ne(t==="left"?this.rightContent:this.leftContent,I("div.window-controls-container")),Ki()&&this.windowControlsContainer.classList.add("wco-enabled"))}return this._register(F(this.rootContainer,Q.CONTEXT_MENU,t=>{De.stop(t);let i;pe&&Ri(t.target)&&wo(t.target,this.title)?i=R.TitleBarTitleContext:i=R.TitleBarContext,this.onContextMenu(t,i)})),pe&&this._register(F(this.title,Q.MOUSE_DOWN,t=>{t.metaKey&&(De.stop(t,!0),this.onContextMenu(t,R.TitleBarTitleContext))},!0)),this.updateStyles(),this.element}createTitle(){this.titleDisposables.clear();const e=Bt(this.configurationService,this.titleBarStyle);if(!this.isCommandCenterVisible)e?$i(this.title):(this.title.innerText=this.windowTitle.value,this.titleDisposables.add(this.windowTitle.onDidChange(()=>{this.title.innerText=this.windowTitle.value,this.lastLayoutDimensions&&this.updateLayout(this.lastLayoutDimensions)})));else{const t=this.instantiationService.createInstance(ps,this.windowTitle,this.hoverDelegate);$i(this.title,t.element),this.titleDisposables.add(t)}}actionViewItemProvider(e,t){if(!this.isAuxiliary){if(e.id===Ji)return this.instantiationService.createInstance(Ro,{position:()=>rn.BELOW},t);if(e.id===ji)return this.instantiationService.createInstance(Do,{position:()=>rn.BELOW},t)}const i=this.editorGroupsContainer.activeGroup?.activeEditorPane;if(i&&i instanceof Po){const s=i.getActionViewItem(e,t);if(s)return s}return zs(this.instantiationService,e,{...t,menuAsChild:!1})}getKeybinding(e){const t=this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService??this.contextKeyService;return this.keybindingService.lookupKeybinding(e.id,t)}createActionToolBar(){this.actionToolBarDisposable.clear(),this.actionToolBar=this.actionToolBarDisposable.add(this.instantiationService.createInstance(Mn,this.actionToolBarElement,{contextMenu:R.TitleBarContext,orientation:Vo.HORIZONTAL,ariaLabel:g(3584,"Title actions"),getKeyBinding:e=>this.getKeybinding(e),overflowBehavior:{maxItems:9,exempted:[ji,Ji,...Wa]},anchorAlignmentProvider:()=>No.RIGHT,telemetrySource:"titlePart",highlightToggledItems:this.editorActionsEnabled||this.isAuxiliary,actionViewItemProvider:(e,t)=>this.actionViewItemProvider(e,t),hoverDelegate:this.hoverDelegate})),this.editorActionsEnabled&&this.actionToolBarDisposable.add(this.editorGroupsContainer.onDidChangeActiveGroup(()=>this.createActionToolBarMenus({editorActions:!0})))}createActionToolBarMenus(e=!0){e===!0&&(e={editorActions:!0,layoutActions:!0,globalActions:!0,activityActions:!0});const t=()=>{const i={primary:[],secondary:[]};if(this.editorActionsEnabled){this.editorActionsChangeDisposable.clear();const s=this.editorGroupsContainer.activeGroup;if(s){const n=s.createEditorActions(this.editorActionsChangeDisposable,this.isAuxiliary&&this.isCompact?R.CompactWindowEditorTitle:R.EditorTitle);i.primary.push(...n.actions.primary),i.secondary.push(...n.actions.secondary),this.editorActionsChangeDisposable.add(n.onDidChange(()=>t()))}}this.globalToolbarMenu&&on(this.globalToolbarMenu.getActions(),i),this.layoutToolbarMenu&&on(this.layoutToolbarMenu.getActions(),i,()=>!this.editorActionsEnabled||this.isCompact),this.activityActionsEnabled&&(Go(this.storageService)&&i.primary.push(vc),i.primary.push(_c)),this.actionToolBar.setActions(an(i.primary),an(i.secondary))};if(e.editorActions)if(this.editorToolbarMenuDisposables.clear(),this.editorActionsEnabled&&this.editorService.activeEditor!==void 0){const i={groupId:this.editorGroupsContainer.activeGroup.id};this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new Ga(i)),this.actionToolBar.context=i}else this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new Ms),this.actionToolBar.context=void 0;e.layoutActions&&(this.layoutToolbarMenuDisposables.clear(),this.layoutControlEnabled?(this.layoutToolbarMenu=this.menuService.createMenu(R.LayoutControlMenu,this.contextKeyService),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu.onDidChange(()=>t()))):this.layoutToolbarMenu=void 0),e.globalActions&&(this.globalToolbarMenuDisposables.clear(),this.globalActionsEnabled?(this.globalToolbarMenu=this.menuService.createMenu(R.TitleBar,this.contextKeyService),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu.onDidChange(()=>t()))):this.globalToolbarMenu=void 0),e.activityActions&&(this.activityToolbarDisposables.clear(),this.activityActionsEnabled&&this.activityToolbarDisposables.add(this.storageService.onDidChangeValue(p.PROFILE,Bo.ACCOUNTS_VISIBILITY_PREFERENCE_KEY,this._store)(()=>t()))),t()}updateStyles(){if(super.updateStyles(),this.element){this.isInactive?this.element.classList.add("inactive"):this.element.classList.remove("inactive");const e=this.getColor(this.isInactive?Lo:Mo,(s,n)=>s.isOpaque()?s:s.makeOpaque(Oo(n)))||"";this.element.style.backgroundColor=e,this.appIconBadge&&(this.appIconBadge.style.backgroundColor=e),e&&xo.fromHex(e).isLighter()?this.element.classList.add("light"):this.element.classList.remove("light");const t=this.getColor(this.isInactive?ko:Ho);this.element.style.color=t||"";const i=this.getColor(Fo);this.element.style.borderBottom=i?`1px solid ${i}`:""}}onContextMenu(e,t){const i=new xn(K(this.element),e);this.contextMenuService.showContextMenu({getAnchor:()=>i,menuId:t,contextKeyService:this.contextKeyService,domForShadowRoot:pe&&si?i.target:void 0})}get currentMenubarVisibility(){return this.isAuxiliary?"hidden":Yi(this.configurationService)}get layoutControlEnabled(){return this.configurationService.getValue(_.LAYOUT_ACTIONS)!==!1}get isCommandCenterVisible(){return!this.isCompact&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1}get editorActionsEnabled(){return this.editorGroupsContainer.partOptions.editorActionsLocation===Ui.TITLEBAR||this.editorGroupsContainer.partOptions.editorActionsLocation===Ui.DEFAULT&&this.editorGroupsContainer.partOptions.showTabs===Wo.NONE}get activityActionsEnabled(){const e=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);return!this.isCompact&&!this.isAuxiliary&&(e===Me.TOP||e===Me.BOTTOM)}get globalActionsEnabled(){return!this.isCompact}get hasZoomableElements(){const e=!(this.currentMenubarVisibility==="hidden"||this.currentMenubarVisibility==="compact"||!le&&pe),t=this.isCommandCenterVisible,i=this.globalActionsEnabled||this.layoutControlEnabled||this.editorActionsEnabled||this.activityActionsEnabled;return e||t||i}get preventZoom(){return ni(K(this.element))<1||!this.hasZoomableElements}layout(e,t){this.updateLayout(new lt(e,t)),super.layoutContents(e,t)}updateLayout(e){this.lastLayoutDimensions=e;const t=ni(K(this.element));if(this.element.style.setProperty("--zoom-factor",t.toString()),this.rootContainer.classList.toggle("counter-zoom",this.preventZoom),this.customMenubar.value){const s=new lt(0,e.height);this.customMenubar.value.layout(s)}const i=this.isCommandCenterVisible||this.title.innerText!=="";this.rootContainer.classList.toggle("has-center",i)}focus(){this.customMenubar.value?this.customMenubar.value.toggleFocus():this.element.querySelector('[tabindex]:not([tabindex="-1"])')?.focus()}toJSON(){return{type:h.TITLEBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}};Ii=y([u(3,ye),u(4,ee),u(5,jt),u(6,O),u(7,ue),u(8,he),u(9,ce),u(10,Ie),u(11,_t),u(12,wt),u(13,Ks),u(14,ut)],Ii);let Cs=class extends Ii{constructor(e,t,i,s,n,r,o,a,c,f,m,A,S){super(h.TITLEBAR_PART,C,f.mainPart,e,t,i,s,n,r,o,a,c,m,A,S)}};Cs=y([u(0,ye),u(1,ee),u(2,jt),u(3,O),u(4,ue),u(5,he),u(6,ce),u(7,Ie),u(8,_t),u(9,ft),u(10,wt),u(11,Ks),u(12,ut)],Cs);var nt;let bs=(nt=class extends Ii{get height(){return this.minimumHeight}constructor(e,t,i,s,n,r,o,a,c,f,m,A,S,x,G,ve){const He=Ss.COUNTER++;super(`workbench.parts.auxiliaryTitle.${He}`,K(e),t,s,n,r,o,a,c,f,m,A,x,G,ve),this.container=e,this.mainTitlebar=i}get preventZoom(){return ni(K(this.element))<1||!this.mainTitlebar.hasZoomableElements}},Ss=nt,nt.COUNTER=1,nt);bs=Ss=y([u(3,ye),u(4,ee),u(5,jt),u(6,O),u(7,ue),u(8,he),u(9,ce),u(10,Ie),u(11,_t),u(12,ft),u(13,wt),u(14,Ks),u(15,ut)],bs);function wc(){return{[Ws.toString()]:new Ke(Is,[],!1)}}kn(async l=>{l.get(Ws)});const Rc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Dc extends ie{constructor(e,t,i){super(e,t,void 0,!0),this.model=i,this.checked=!i.isHidden(e)}async run(){this.model.isHidden(this.id)?this.model.show(this.id):this.model.hide(this.id)}}class Pc extends ie{constructor(e,t,i){super(e,g(3540,"Hide '{0}'",t),void 0,!0),this.model=i}async run(){this.model.hide(this.id)}}let Es=class extends ie{constructor(e,t){super("statusbar.manage.extension",g(3541,"Manage Extension")),this.extensionId=e,this.commandService=t}run(){return this.commandService.executeCommand("_extensions.manage",this.extensionId)}};Es=y([u(1,Te)],Es);V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusPrevious",weight:B.WorkbenchContrib,primary:b.LeftArrow,secondary:[b.UpArrow],when:Rt,handler:l=>{l.get(Ve).focusPreviousEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusNext",weight:B.WorkbenchContrib,primary:b.RightArrow,secondary:[b.DownArrow],when:Rt,handler:l=>{l.get(Ve).focusNextEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusFirst",weight:B.WorkbenchContrib,primary:b.Home,when:Rt,handler:l=>{const e=l.get(Ve);e.focus(!1),e.focusNextEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusLast",weight:B.WorkbenchContrib,primary:b.End,when:Rt,handler:l=>{const e=l.get(Ve);e.focus(!1),e.focusPreviousEntry()}});V.registerCommandAndKeybindingRule({id:"workbench.statusBar.clearFocus",weight:B.WorkbenchContrib,primary:b.Escape,when:Rt,handler:l=>{const e=l.get(Ve),t=l.get(wt);e.isEntryFocused()?e.focus(!1):t.activeEditorPane&&t.activeEditorPane.focus()}});class Nc extends Ce{constructor(){super({id:"workbench.action.focusStatusBar",title:re(3542,"Focus Status Bar"),category:Ys.View,f1:!0})}async run(e){e.get(ce).focusPart(h.STATUSBAR_PART,ei())}}fe(Nc);const Ye=class Ye extends te{get entries(){return this._entries.slice(0)}get lastFocusedEntry(){return this._lastFocusedEntry&&!this.isHidden(this._lastFocusedEntry.id)?this._lastFocusedEntry:void 0}constructor(e){super(),this.storageService=e,this._onDidChangeEntryVisibility=this._register(new E),this.onDidChangeEntryVisibility=this._onDidChangeEntryVisibility.event,this._entries=[],this.hidden=new Set,this.restoreState(),this.registerListeners()}restoreState(){const e=this.storageService.get(Ye.HIDDEN_ENTRIES_KEY,p.PROFILE);if(e)try{this.hidden=new Set(JSON.parse(e))}catch{}}registerListeners(){this._register(this.storageService.onDidChangeValue(p.PROFILE,Ye.HIDDEN_ENTRIES_KEY,this._store)(()=>this.onDidStorageValueChange()))}onDidStorageValueChange(){const e=new Set(this.hidden);this.hidden.clear(),this.restoreState();const t=new Set;for(const i of e)this.hidden.has(i)||t.add(i);for(const i of this.hidden)e.has(i)||t.add(i);if(t.size>0)for(const i of this._entries)t.has(i.id)&&(this.updateVisibility(i.id,!0),t.delete(i.id))}add(e){this._entries.push(e),this.updateVisibility(e,!1),this.sort(),this.markFirstLastVisibleEntry()}remove(e){const t=this._entries.indexOf(e);t>=0&&(this._entries.splice(t,1),this._entries.some(i=>ri(i.priority.primary)&&i.priority.primary.location.id===e.id)&&this.sort(),this.markFirstLastVisibleEntry())}isHidden(e){return this.hidden.has(e)}hide(e){this.hidden.has(e)||(this.hidden.add(e),this.updateVisibility(e,!0),this.saveState())}show(e){this.hidden.has(e)&&(this.hidden.delete(e),this.updateVisibility(e,!0),this.saveState())}findEntry(e){return this._entries.find(t=>t.container===e)}getEntries(e){return this._entries.filter(t=>t.alignment===e)}focusNextEntry(){this.focusEntry(1,0)}focusPreviousEntry(){this.focusEntry(-1,this.entries.length-1)}isEntryFocused(){return!!this.getFocusedEntry()}getFocusedEntry(){return this._entries.find(e=>ht(e.container))}focusEntry(e,t){const i=r=>{let o=r,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;for(;a&&this.isHidden(a.id);)o+=e,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;return a},s=this.getFocusedEntry();if(s){const r=i(this._entries.indexOf(s)+e);if(r){this._lastFocusedEntry=r,r.labelContainer.focus();return}}const n=i(t);n&&(this._lastFocusedEntry=n,n.labelContainer.focus())}updateVisibility(e,t){if(typeof e=="string"){const i=e;for(const s of this._entries)s.id===i&&this.updateVisibility(s,t)}else{const i=e,s=this.isHidden(i.id);s?Hn(i.container):Fn(i.container),t&&this._onDidChangeEntryVisibility.fire({id:i.id,visible:!s}),this.markFirstLastVisibleEntry()}}saveState(){this.hidden.size>0?this.storageService.store(Ye.HIDDEN_ENTRIES_KEY,JSON.stringify(Array.from(this.hidden.values())),p.PROFILE,D.USER):this.storageService.remove(Ye.HIDDEN_ENTRIES_KEY,p.PROFILE)}sort(){const e=new Set(this._entries.map(r=>r.id)),t=new Map,i=new Map;for(let r=0;r<this._entries.length;r++){const o=this._entries[r];if(typeof o.priority.primary=="number"||!e.has(o.priority.primary.location.id))t.set(o,r);else{const a=o.priority.primary.location.id;let c=i.get(a);if(!c){for(const f of i.values())if(f.has(a)){c=f;break}c||(c=new Map,i.set(a,c))}c.set(o.id,o)}}const s=Array.from(t.keys());s.sort((r,o)=>{if(r.alignment===o.alignment){const a=typeof r.priority.primary=="number"?r.priority.primary:r.priority.primary.location.priority,c=typeof o.priority.primary=="number"?o.priority.primary:o.priority.primary.location.priority;return a!==c?c-a:r.priority.secondary!==o.priority.secondary?o.priority.secondary-r.priority.secondary:t.get(r)-t.get(o)}return r.alignment===$.LEFT?-1:o.alignment===$.LEFT?1:0});let n;if(i.size>0){n=[];for(const r of s){const o=i.get(r.id),a=o?Array.from(o.values()):void 0;a&&n.push(...a.filter(c=>ri(c.priority.primary)&&c.priority.primary.alignment===$.LEFT).sort((c,f)=>f.priority.secondary-c.priority.secondary)),n.push(r),a&&n.push(...a.filter(c=>ri(c.priority.primary)&&c.priority.primary.alignment===$.RIGHT).sort((c,f)=>f.priority.secondary-c.priority.secondary)),i.delete(r.id)}for(const[,r]of i)n.push(...Array.from(r.values()).sort((o,a)=>a.priority.secondary-o.priority.secondary))}else n=s;this._entries=n}markFirstLastVisibleEntry(){this.doMarkFirstLastVisibleStatusbarItem(this.getEntries($.LEFT)),this.doMarkFirstLastVisibleStatusbarItem(this.getEntries($.RIGHT))}doMarkFirstLastVisibleStatusbarItem(e){let t,i;for(const s of e)s.container.classList.remove("first-visible-item","last-visible-item"),!this.isHidden(s.id)&&(t||(t=s),i=s);t?.container.classList.add("first-visible-item"),i?.container.classList.add("last-visible-item")}};Ye.HIDDEN_ENTRIES_KEY="workbench.statusbar.hidden";let Ts=Ye,ys=class extends te{get name(){return de(this.entry).name}get hasCommand(){return typeof this.entry?.command<"u"}constructor(e,t,i,s,n,r,o,a){super(),this.container=e,this.hoverDelegate=i,this.commandService=s,this.hoverService=n,this.notificationService=r,this.telemetryService=o,this.themeService=a,this.entry=void 0,this.foregroundListener=this._register(new ze),this.backgroundListener=this._register(new ze),this.commandMouseListener=this._register(new ze),this.commandTouchListener=this._register(new ze),this.commandKeyboardListener=this._register(new ze),this.hover=void 0,this.labelContainer=I("a.statusbar-item-label",{role:"button",tabIndex:-1}),this._register(ks.addTarget(this.labelContainer)),this.label=this._register(new Vc(this.labelContainer)),this.container.appendChild(this.labelContainer),this.beakContainer=I(".status-bar-item-beak-container"),this.container.appendChild(this.beakContainer),t.content&&this.container.appendChild(t.content),this.update(t)}update(e){if(this.label.showProgress=e.showProgress??!1,(!this.entry||e.text!==this.entry.text)&&(this.label.text=e.text,e.text?Fn(this.labelContainer):Hn(this.labelContainer)),(!this.entry||e.ariaLabel!==this.entry.ariaLabel)&&(this.container.setAttribute("aria-label",e.ariaLabel),this.labelContainer.setAttribute("aria-label",e.ariaLabel)),(!this.entry||e.role!==this.entry.role)&&this.labelContainer.setAttribute("role",e.role||"button"),!this.entry||!this.isEqualTooltip(this.entry,e)){let i,s;zo(e.tooltip)?(s=e.tooltip.content,i={actions:e.tooltip.commands.map(r=>({commandId:r.id,label:r.title,run:()=>this.executeCommand(r)}))}):s=e.tooltip;const n=xi(s)?{markdown:s,markdownNotSupportedFallback:void 0}:s;this.hover?this.hover.update(n,i):this.hover=this._register(this.hoverService.setupManagedHover(this.hoverDelegate,this.container,n,i))}if(!this.entry||e.command!==this.entry.command){this.commandMouseListener.clear(),this.commandTouchListener.clear(),this.commandKeyboardListener.clear();const i=e.command;i&&(i!==cn||this.hover)?(this.commandMouseListener.value=F(this.labelContainer,Q.CLICK,()=>this.executeCommand(i)),this.commandTouchListener.value=F(this.labelContainer,Hs.Tap,()=>this.executeCommand(i)),this.commandKeyboardListener.value=F(this.labelContainer,Q.KEY_DOWN,s=>{const n=new vn(s);n.equals(b.Space)||n.equals(b.Enter)?(De.stop(s),this.executeCommand(i)):(n.equals(b.Escape)||n.equals(b.LeftArrow)||n.equals(b.RightArrow))&&(De.stop(s),this.hover?.hide())}),this.labelContainer.classList.remove("disabled")):this.labelContainer.classList.add("disabled")}(!this.entry||e.showBeak!==this.entry.showBeak)&&(e.showBeak?this.container.classList.add("has-beak"):this.container.classList.remove("has-beak"));const t=!!e.backgroundColor||e.kind&&e.kind!=="standard";if(!this.entry||e.kind!==this.entry.kind){for(const i of Uo)this.container.classList.remove(`${i}-kind`);e.kind&&e.kind!=="standard"&&this.container.classList.add(`${e.kind}-kind`),this.container.classList.toggle("has-background-color",t)}(!this.entry||e.color!==this.entry.color)&&this.applyColor(this.labelContainer,e.color),(!this.entry||e.backgroundColor!==this.entry.backgroundColor)&&(this.container.classList.toggle("has-background-color",t),this.applyColor(this.container,e.backgroundColor,!0)),this.entry=e}isEqualTooltip({tooltip:e},{tooltip:t}){return e===void 0?t===void 0:xi(e)?xi(t)&&Yo(e,t):e===t}async executeCommand(e){if(e===cn)this.hover?.show(!0);else{const t=typeof e=="string"?e:e.id,i=typeof e=="string"?[]:e.arguments??[];this.telemetryService.publicLog2("workbenchActionExecuted",{id:t,from:"status bar"});try{await this.commandService.executeCommand(t,...i)}catch(s){this.notificationService.error(qt(s))}}}applyColor(e,t,i){let s;if(i?this.backgroundListener.clear():this.foregroundListener.clear(),t)if(Ko(t)){s=this.themeService.getColorTheme().getColor(t.id)?.toString();const n=this.themeService.onDidColorThemeChange(r=>{const o=r.getColor(t.id)?.toString();i?e.style.backgroundColor=o??"":e.style.color=o??""});i?this.backgroundListener.value=n:this.foregroundListener.value=n}else s=t;i?e.style.backgroundColor=s??"":e.style.color=s??""}};ys=y([u(3,Te),u(4,Fs),u(5,Pe),u(6,_i),u(7,ue)],ys);class Vc extends za{constructor(e){super(e),this.container=e,this.progressCodicon=qi(hn),this.currentText="",this.currentShowProgress=!1}set showProgress(e){this.currentShowProgress!==e&&(this.currentShowProgress=e,this.progressCodicon=qi(e==="syncing"?hn:Xo),this.text=this.currentText)}set text(e){if(this.currentShowProgress){this.container.firstChild!==this.progressCodicon&&this.container.appendChild(this.progressCodicon);for(const i of Array.from(this.container.childNodes))i!==this.progressCodicon&&i.remove();let t=e??"";t&&(t=` ${t}`),ne(this.container,...Zo(t))}else super.text=e}}var oi,vs;ke(Rc);var rt;let $t=(rt=class extends Pi{constructor(e,t,i,s,n,r,o,a){super(e,{hasTitle:!1},i,n,r),this.instantiationService=t,this.contextService=s,this.contextMenuService=o,this.contextKeyService=a,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=oi.HEIGHT,this.maximumHeight=oi.HEIGHT,this.pendingEntries=[],this._onWillDispose=this._register(new E),this.onWillDispose=this._onWillDispose.event,this.onDidOverrideEntry=this._register(new E),this.entryOverrides=new Map,this.compactEntriesDisposable=this._register(new ze),this.styleOverrides=new Set,this.viewModel=this._register(new Ts(n)),this.onDidChangeEntryVisibility=this.viewModel.onDidChangeEntryVisibility,this.hoverDelegate=this._register(this.instantiationService.createInstance($o,"element",{instantHover:!0,dynamicDelay(c){if(typeof c=="function"||Ri(c)||qo(c)&&typeof c.markdown=="function"||jo(c))return 500}},(c,f)=>({persistence:{hideOnKeyDown:!0,sticky:f},appearance:{maxHeightRatio:.9}}))),this.registerListeners()}registerListeners(){this._register(this.onDidChangeEntryVisibility(()=>this.updateCompactEntries())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateStyles()))}overrideEntry(e,t){return this.entryOverrides.set(e,t),this.onDidOverrideEntry.fire(e),Ne(()=>{this.entryOverrides.get(e)===t&&(this.entryOverrides.delete(e),this.onDidOverrideEntry.fire(e))})}withEntryOverride(e,t){const i=this.entryOverrides.get(t);return i&&(e={...e,...i}),e}addEntry(e,t,i,s=0){let n;return Jo(s)?n=s:n={primary:s,secondary:Qo(t)},this.element?this.doAddEntry(e,t,i,n):this.doAddPendingEntry(e,t,i,n)}doAddPendingEntry(e,t,i,s){const n={entry:e,id:t,alignment:i,priority:s};return this.pendingEntries.push(n),{update:o=>{n.accessor?n.accessor.update(o):n.entry=o},dispose:()=>{n.accessor?n.accessor.dispose():this.pendingEntries=this.pendingEntries.filter(o=>o!==n)}}}doAddEntry(e,t,i,s){const n=new L,r=this.doCreateStatusItem(t,i),o=n.add(this.instantiationService.createInstance(ys,r,this.withEntryOverride(e,t),this.hoverDelegate)),a=new class{constructor(){this.id=t,this.extensionId=e.extensionId,this.alignment=i,this.priority=s,this.container=r,this.labelContainer=o.labelContainer}get name(){return o.name}get hasCommand(){return o.hasCommand}},{needsFullRefresh:c}=this.doAddOrRemoveModelEntry(a,!0);c?this.appendStatusbarEntries():this.appendStatusbarEntry(a);let f=e;const m={update:A=>{f=A,o.update(this.withEntryOverride(A,t))},dispose:()=>{const{needsFullRefresh:A}=this.doAddOrRemoveModelEntry(a,!1);A?this.appendStatusbarEntries():(r.remove(),this.updateCompactEntries()),n.dispose()}};return n.add(this.onDidOverrideEntry.event(A=>{A===t&&m.update(f)})),m}doCreateStatusItem(e,t,...i){const s=I(".statusbar-item",{id:e});return i&&s.classList.add(...i),t===$.RIGHT?s.classList.add("right"):s.classList.add("left"),s}doAddOrRemoveModelEntry(e,t){const i=this.viewModel.entries;t?this.viewModel.add(e):this.viewModel.remove(e);const s=this.viewModel.entries;return t?i.splice(s.indexOf(e),0,e):i.splice(i.indexOf(e),1),{needsFullRefresh:!En(i,s)}}isEntryVisible(e){return!this.viewModel.isHidden(e)}updateEntryVisibility(e,t){t?this.viewModel.show(e):this.viewModel.hide(e)}focusNextEntry(){this.viewModel.focusNextEntry()}focusPreviousEntry(){this.viewModel.focusPreviousEntry()}isEntryFocused(){return this.viewModel.isEntryFocused()}focus(e=!0){this.getContainer()?.focus();const t=this.viewModel.lastFocusedEntry;e&&t&&setTimeout(()=>t.labelContainer.focus(),0)}createContentArea(e){this.element=e;const t=this._register(this.contextKeyService.createScoped(this.element));return Rt.bindTo(t).set(!0),this.leftItemsContainer=I(".left-items.items-container"),this.element.appendChild(this.leftItemsContainer),this.element.tabIndex=0,this.rightItemsContainer=I(".right-items.items-container"),this.element.appendChild(this.rightItemsContainer),this._register(F(e,Q.CONTEXT_MENU,i=>this.showContextMenu(i))),this._register(ks.addTarget(e)),this._register(F(e,Hs.Contextmenu,i=>this.showContextMenu(i))),this.createInitialStatusbarEntries(),this.element}createInitialStatusbarEntries(){for(this.appendStatusbarEntries();this.pendingEntries.length;){const e=this.pendingEntries.shift();e&&(e.accessor=this.addEntry(e.entry,e.id,e.alignment,e.priority.primary))}}appendStatusbarEntries(){const e=de(this.leftItemsContainer),t=de(this.rightItemsContainer);ct(e),ct(t);for(const i of[...this.viewModel.getEntries($.LEFT),...this.viewModel.getEntries($.RIGHT).reverse()])(i.alignment===$.LEFT?e:t).appendChild(i.container);this.updateCompactEntries()}appendStatusbarEntry(e){const t=this.viewModel.getEntries(e.alignment);e.alignment===$.RIGHT&&t.reverse();const i=de(e.alignment===$.LEFT?this.leftItemsContainer:this.rightItemsContainer),s=t.indexOf(e);s+1===t.length?i.appendChild(e.container):i.insertBefore(e.container,t[s+1].container),this.updateCompactEntries()}updateCompactEntries(){const e=this.viewModel.entries,t=new Map;for(const r of e)this.viewModel.isHidden(r.id)||t.set(r.id,r),r.container.classList.remove("compact-left","compact-right");const i=new Map;for(const r of t.values())if(ri(r.priority.primary)&&r.priority.primary.compact){const o=r.priority.primary.location.id,a=t.get(o);if(!a)continue;let c=i.get(o);if(!c){for(const f of i.values())if(f.has(o)){c=f;break}c||(c=new Map,i.set(o,c))}c.set(r.id,r),c.set(a.id,a),r.priority.primary.alignment===$.LEFT?(a.container.classList.add("compact-left"),r.container.classList.add("compact-right")):(a.container.classList.add("compact-right"),r.container.classList.add("compact-left"))}const s=this.getColor(ea),n=this.getColor(ta);if(this.compactEntriesDisposable.value=new L,s&&n&&!ia(this.theme.type))for(const[,r]of i)for(const o of r.values())o.hasCommand&&(this.compactEntriesDisposable.value.add(F(o.labelContainer,Q.MOUSE_OVER,()=>{r.forEach(a=>a.labelContainer.style.backgroundColor=s),o.labelContainer.style.backgroundColor=n})),this.compactEntriesDisposable.value.add(F(o.labelContainer,Q.MOUSE_OUT,()=>{r.forEach(a=>a.labelContainer.style.backgroundColor="")})))}showContextMenu(e){De.stop(e,!0);const t=new xn(K(this.element),e);let i;this.contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>(i=this.getContextMenuActions(t),i),onHide:()=>{i&&ga(i)}})}getContextMenuActions(e){const t=[];t.push(ci({id:ln.ID,label:g(3543,"Hide Status Bar"),run:()=>this.instantiationService.invokeFunction(n=>new ln().run(n))})),t.push(new Ft);const i=new Set;for(const n of this.viewModel.entries)i.has(n.id)||(t.push(new Dc(n.id,n.name,this.viewModel)),i.add(n.id));let s;for(let n=e.target;n;n=n.parentElement){const r=this.viewModel.findEntry(n);if(r){s=r;break}}return s&&(t.push(new Ft),s.extensionId&&t.push(this.instantiationService.createInstance(Es,s.extensionId)),t.push(new Pc(s.id,s.name,this.viewModel))),t}updateStyles(){super.updateStyles();const e=de(this.getContainer()),t=[...this.styleOverrides].sort((a,c)=>a.priority-c.priority)[0],i=this.getColor(t?.background??(this.contextService.getWorkbenchState()!==Oe.EMPTY?sa:na))||"";e.style.backgroundColor=i;const s=this.getColor(t?.foreground??(this.contextService.getWorkbenchState()!==Oe.EMPTY?ra:oa))||"";e.style.color=s;const n=this.getColor(aa),r=this.getColor(t?.border??(this.contextService.getWorkbenchState()!==Oe.EMPTY?ca:ha))||this.getColor(la);r?(e.classList.add("status-border-top"),e.style.setProperty("--status-border-top-color",r)):(e.classList.remove("status-border-top"),e.style.removeProperty("--status-border-top-color"));const o=this.getColor(da);this.styleElement||(this.styleElement=ua(e)),this.styleElement.textContent=`
|
|
2
2
|
|
|
3
3
|
/* Status bar focus outline */
|
|
4
4
|
.monaco-workbench .part.statusbar:focus {
|
|
@@ -15,4 +15,4 @@ import{D as te,c0 as Cn,bY as q,cI as Zn,cJ as we,cK as w,cL as bn,cM as qt,cN a
|
|
|
15
15
|
.monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak > .status-bar-item-beak-container:before {
|
|
16
16
|
border-bottom-color: ${r??i};
|
|
17
17
|
}
|
|
18
|
-
`}layout(e,t,i,s){super.layout(e,t,i,s),super.layoutContents(e,t)}overrideStyle(e){return this.styleOverrides.add(e),this.updateStyles(),Ne(()=>{this.styleOverrides.delete(e),this.updateStyles()})}toJSON(){return{type:h.STATUSBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}},oi=rt,rt.HEIGHT=22,rt);$t=oi=y([u(1,O),u(2,ue),u(3,Di),u(4,he),u(5,ce),u(6,ye),u(7,Ie)],$t);let _s=class extends $t{constructor(e,t,i,s,n,r,o){super(h.STATUSBAR_PART,e,t,i,s,n,r,o)}};_s=y([u(0,O),u(1,ue),u(2,Di),u(3,he),u(4,ce),u(5,ye),u(6,Ie)],_s);var ot;let ws=(ot=class extends $t{constructor(e,t,i,s,n,r,o,a){const c=vs.COUNTER++;super(`workbench.parts.auxiliaryStatus.${c}`,t,i,s,n,r,o,a),this.container=e,this.height=$t.HEIGHT}},vs=ot,ot.COUNTER=1,ot);ws=vs=y([u(1,O),u(2,ue),u(3,Di),u(4,he),u(5,ce),u(6,ye),u(7,Ie)],ws);let Rs=class extends On{constructor(e,t,i){super("workbench.statusBarService",i,t),this.instantiationService=e,this._onDidCreateAuxiliaryStatusbarPart=this._register(new E),this.onDidCreateAuxiliaryStatusbarPart=this._onDidCreateAuxiliaryStatusbarPart.event,this.mainPart=this._register(this.instantiationService.createInstance(_s)),this._register(this.registerPart(this.mainPart)),this.onDidChangeEntryVisibility=this.mainPart.onDidChangeEntryVisibility}createAuxiliaryStatusbarPart(e,t){const i=I("footer.part.statusbar",{role:"status","aria-live":"off",tabIndex:"0"});i.style.position="relative",e.appendChild(i);const s=t.createInstance(ws,i),n=this.registerPart(s);return s.create(i),me.once(s.onWillDispose)(()=>n.dispose()),this._onDidCreateAuxiliaryStatusbarPart.fire(s),s}createScoped(e,t){return t.add(this.instantiationService.createInstance(Ds,e))}addEntry(e,t,i,s=0){return e.showInAllWindows?this.doAddEntryToAllWindows(e,t,i,s):this.mainPart.addEntry(e,t,i,s)}doAddEntryToAllWindows(e,t,i,s=0){const n=new L,r=new Set;let o=e;function a(c){const f=new L;f.add(c.onWillDispose(()=>f.dispose()));const m=f.add(c.addEntry(o,t,i,s));r.add(m),f.add(Ne(()=>r.delete(m))),n.add(f),f.add(Ne(()=>n.delete(f)))}for(const c of this.parts)a(c);return n.add(this.onDidCreateAuxiliaryStatusbarPart(c=>a(c))),{update:c=>{o=c;for(const f of r)f.update(c)},dispose:()=>n.dispose()}}isEntryVisible(e){return this.mainPart.isEntryVisible(e)}updateEntryVisibility(e,t){for(const i of this.parts)i.updateEntryVisibility(e,t)}overrideEntry(e,t){const i=new L;for(const s of this.parts)i.add(s.overrideEntry(e,t));return i}focus(e){this.activePart.focus(e)}focusNextEntry(){this.activePart.focusNextEntry()}focusPreviousEntry(){this.activePart.focusPreviousEntry()}isEntryFocused(){return this.activePart.isEntryFocused()}overrideStyle(e){const t=new L;for(const i of this.parts)t.add(i.overrideStyle(e));return t}};Rs=y([u(0,O),u(1,he),u(2,ue)],Rs);let Ds=class extends te{constructor(e,t){super(),this.statusbarEntryContainer=e,this.statusbarService=t,this.onDidChangeEntryVisibility=this.statusbarEntryContainer.onDidChangeEntryVisibility}createAuxiliaryStatusbarPart(e,t){return this.statusbarService.createAuxiliaryStatusbarPart(e,t)}createScoped(e,t){return this.statusbarService.createScoped(e,t)}getPart(){return this.statusbarEntryContainer}addEntry(e,t,i,s=0){return this.statusbarEntryContainer.addEntry(e,t,i,s)}isEntryVisible(e){return this.statusbarEntryContainer.isEntryVisible(e)}updateEntryVisibility(e,t){this.statusbarEntryContainer.updateEntryVisibility(e,t)}overrideEntry(e,t){return this.statusbarEntryContainer.overrideEntry(e,t)}focus(e){this.statusbarEntryContainer.focus(e)}focusNextEntry(){this.statusbarEntryContainer.focusNextEntry()}focusPreviousEntry(){this.statusbarEntryContainer.focusPreviousEntry()}isEntryFocused(){return this.statusbarEntryContainer.isEntryFocused()}overrideStyle(e){return this.statusbarEntryContainer.overrideStyle(e)}};Ds=y([u(1,Ve)],Ds);function Bc(l){const e=l;return typeof e.id=="string"&&e.id.length>0&&typeof e.name=="string"&&typeof e.text=="string"&&(e.alignment==="left"||e.alignment==="right")&&(e.command===void 0||typeof e.command=="string")&&(e.tooltip===void 0||typeof e.tooltip=="string")&&(e.priority===void 0||typeof e.priority=="number")&&(e.accessibilityInformation===void 0||Ta(e.accessibilityInformation))}const Sn={type:"object",required:["id","text","alignment","name"],properties:{id:{type:"string",markdownDescription:g(2509,"The identifier of the status bar entry. Must be unique within the extension. The same value must be used when calling the `vscode.window.createStatusBarItem(id, ...)`-API")},name:{type:"string",description:g(2510,"The name of the entry, like 'Python Language Indicator', 'Git Status' etc. Try to keep the length of the name short, yet descriptive enough that users can understand what the status bar item is about.")},text:{type:"string",description:g(2511,"The text to show for the entry. You can embed icons in the text by leveraging the `$(<name>)`-syntax, like 'Hello $(globe)!'")},tooltip:{type:"string",description:g(2512,"The tooltip text for the entry.")},command:{type:"string",description:g(2513,"The command to execute when the status bar entry is clicked.")},alignment:{type:"string",enum:["left","right"],description:g(2514,"The alignment of the status bar entry.")},priority:{type:"number",description:g(2515,"The priority of the status bar entry. Higher value means the item should be shown more to the left.")},accessibilityInformation:{type:"object",description:g(2516,"Defines the role and aria label to be used when the status bar entry is focused."),properties:{role:{type:"string",description:g(2517,"The role of the status bar entry which defines how a screen reader interacts with it. More about aria roles can be found here https://w3c.github.io/aria/#widget_roles")},label:{type:"string",description:g(2518,"The aria label of the status bar entry. Defaults to the entry's text.")}}}}},Lc={description:g(2519,"Contributes items to the status bar."),oneOf:[Sn,{type:"array",items:Sn}]},In=ma.registerExtensionPoint({extensionPoint:"statusBarItems",jsonSchema:Lc});let Ps=class{constructor(e){const t=new L;In.setHandler(i=>{t.clear();for(const s of i){if(!Sa(s.description,"contribStatusBarItems")){s.collector.error(`The ${In.name} is proposed API`);continue}const{value:n,collector:r}=s;for(const o of Ia.wrap(n)){if(!Bc(o)){r.error(g(2520,"Invalid status bar item contribution."));continue}const a=Ca(s.description.identifier,o.id);e.setOrUpdateEntry(a,a,ba.toKey(s.description.identifier),o.name??s.description.displayName??s.description.name,o.text,o.tooltip,o.command?{id:o.command,title:o.name}:void 0,void 0,void 0,o.alignment==="left",o.priority,o.accessibilityInformation)===Ea.DidDefine&&t.add(Ne(()=>e.unsetEntry(a)))}}})}};Ps=y([u(0,Wn)],Ps);var yt;let Ci=(yt=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(Ps)}},yt.ID="workbench.contrib.statusBarItemsExtensionPoint",yt);Ci=y([u(0,O)],Ci);pa(Ci.ID,Ci,Aa.BlockStartup);function Mc(){return{[Ve.toString()]:new Ke(Rs,[],!1),[Wn.toString()]:new Ke(ya,[],!1)}}const Oc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));ke(Oc);let Ns=class extends Pi{get minimumHeight(){return this.visible?this.height:0}get maximumHeight(){return this.visible?this.height:0}get onDidChange(){return this._onDidChangeSize.event}constructor(e,t,i,s,n){super(h.BANNER_PART,{hasTitle:!1},e,i,t),this.contextKeyService=s,this.instantiationService=n,this.height=26,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this._onDidChangeSize=this._register(new E),this.visible=!1,this.focusedActionIndex=-1,this.markdownRenderer=this.instantiationService.createInstance(va,{})}createContentArea(e){this.element=e,this.element.tabIndex=0,this._register(F(this.element,Q.FOCUS,()=>{this.focusedActionIndex!==-1&&this.focusActionLink()}));const t=this._register(this.contextKeyService.createScoped(this.element));return Ni.bindTo(t).set(!0),this.element}close(e){this.setVisibility(!1),ct(this.element),typeof e.onClose=="function"&&e.onClose(),this.item=void 0}focusActionLink(){const e=this.item?.actions?.length??0;if(this.focusedActionIndex<e){const t=this.messageActionsContainer?.children[this.focusedActionIndex];Ri(t)&&(this.actionBar?.setFocusable(!1),t.focus())}else this.actionBar?.focus(0)}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=I("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}setVisibility(e){e!==this.visible&&(this.visible=e,this.focusedActionIndex=-1,this.layoutService.setPartHidden(!e,h.BANNER_PART),this._onDidChangeSize.fire(void 0))}focus(){this.focusedActionIndex=-1,this.element.focus()}focusNextAction(){const e=this.item?.actions?.length??0;this.focusedActionIndex=this.focusedActionIndex<e?this.focusedActionIndex+1:0,this.focusActionLink()}focusPreviousAction(){const e=this.item?.actions?.length??0;this.focusedActionIndex=this.focusedActionIndex>0?this.focusedActionIndex-1:e,this.focusActionLink()}hide(e){this.item?.id===e&&this.setVisibility(!1)}show(e){if(e.id===this.item?.id){this.setVisibility(!0);return}ct(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ne(this.element,I("div.icon-container"));i.setAttribute("aria-hidden","true"),W.isThemeIcon(e.icon)?i.appendChild(I(`div${W.asCSSSelector(e.icon)}`)):(i.classList.add("custom-icon"),wi.isUri(e.icon)&&(i.style.backgroundImage=_a(e.icon)));const s=ne(this.element,I("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ne(this.element,I("div.message-actions-container")),e.actions)for(const a of e.actions)this._register(this.instantiationService.createInstance(wa,this.messageActionsContainer,{...a,tabIndex:-1},{}));const n=ne(this.element,I("div.action-container"));this.actionBar=this._register(new xs(n));const r=e.closeLabel??g(2941,"Close Banner"),o=this._register(new ie("banner.close",r,W.asClassName(Ra),!0,()=>this.close(e)));this.actionBar.push(o,{icon:!0,label:!1}),this.actionBar.setFocusable(!1),this.setVisibility(!0),this.item=e}toJSON(){return{type:h.BANNER_PART}}};Ns=y([u(0,ue),u(1,ce),u(2,he),u(3,Ie),u(4,O)],Ns);V.registerCommandAndKeybindingRule({id:"workbench.banner.focusBanner",weight:B.WorkbenchContrib,primary:b.Escape,when:Ni,handler:l=>{l.get(gt).focus()}});V.registerCommandAndKeybindingRule({id:"workbench.banner.focusNextAction",weight:B.WorkbenchContrib,primary:b.RightArrow,secondary:[b.DownArrow],when:Ni,handler:l=>{l.get(gt).focusNextAction()}});V.registerCommandAndKeybindingRule({id:"workbench.banner.focusPreviousAction",weight:B.WorkbenchContrib,primary:b.LeftArrow,secondary:[b.UpArrow],when:Ni,handler:l=>{l.get(gt).focusPreviousAction()}});const bt=class bt extends Ce{constructor(){super({id:bt.ID,title:bt.LABEL,category:Ys.View,f1:!0})}async run(e){e.get(ce).focusPart(h.BANNER_PART)}};bt.ID="workbench.action.focusBanner",bt.LABEL=re(2942,"Focus Banner");let Vs=bt;fe(Vs);var ai,at;let Bs=(at=class{constructor(e,t,i){const s=i.options?.welcomeBanner;if(!s||t.getBoolean(ai.WELCOME_BANNER_DISMISSED_KEY,p.PROFILE,!1))return;let n;typeof s.icon=="string"?n=W.fromId(s.icon):s.icon&&(n=wi.revive(s.icon)),e.show({id:"welcome.banner",message:s.message,icon:n,actions:s.actions,onClose:()=>{t.store(ai.WELCOME_BANNER_DISMISSED_KEY,!0,p.PROFILE,D.MACHINE)}})}},ai=at,at.WELCOME_BANNER_DISMISSED_KEY="workbench.banner.welcome.dismissed",at);Bs=ai=y([u(0,gt),u(1,he),u(2,jt)],Bs);Da.as(Pa.Workbench).registerWorkbenchContribution(Bs,Vt.Restored);function xc(){return{[gt.toString()]:new Ke(Ns,[],!1)}}kn(async l=>{l.get(gt)});let Ls=class extends Ec{constructor(e,t,i){super(Gn(),e,new Va,t),this.instantiationService=i,this.mainContainer.classList.add("monaco-workbench-part")}registerErrorHandler(e){Bn(t=>this.handleUnexpectedError(t,e))}createNotificationsHandlers(){}initServices(){return this.instantiationService}restore(){try{this.restoreParts()}catch(e){ii(e)}}};Ls=y([u(1,Pn),u(2,O)],Ls);Ba(async l=>{l.get(ce).startup();const e=La(C,Gn());Ma(e!=null&&!e.guess,C)});Oa(async l=>{l.get(O).createInstance(Xa)});function ph(l,e){return{...Ya(e),...Na({isKeybindingConfigurationVisible:()=>!0,shouldUseGlobalPicker:()=>!0}),...Ua({shouldUseGlobalKeybindings:()=>!0}),[ce.toString()]:new Ke(Ls,[l],!1),[ft.toString()]:new Ke(Ka,[],!1),[wt.toString()]:new Ke(Za,[void 0],!1),...wc(),...Mc(),...xc()}}export{Ih as AbstractResourceEditorInput,Ch as AbstractTextResourceEditorInput,bh as ConfirmResult,Eh as DomScrollableElement,Th as EditorInput,Gr as EditorInputCapabilities,h as Parts,yh as RegisteredEditorPriority,vh as SplitView,T as ViewContainerLocation,_h as ViewPaneContainer,ph as default};
|
|
18
|
+
`}layout(e,t,i,s){super.layout(e,t,i,s),super.layoutContents(e,t)}overrideStyle(e){return this.styleOverrides.add(e),this.updateStyles(),Ne(()=>{this.styleOverrides.delete(e),this.updateStyles()})}toJSON(){return{type:h.STATUSBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}},oi=rt,rt.HEIGHT=22,rt);$t=oi=y([u(1,O),u(2,ue),u(3,Di),u(4,he),u(5,ce),u(6,ye),u(7,Ie)],$t);let _s=class extends $t{constructor(e,t,i,s,n,r,o){super(h.STATUSBAR_PART,e,t,i,s,n,r,o)}};_s=y([u(0,O),u(1,ue),u(2,Di),u(3,he),u(4,ce),u(5,ye),u(6,Ie)],_s);var ot;let ws=(ot=class extends $t{constructor(e,t,i,s,n,r,o,a){const c=vs.COUNTER++;super(`workbench.parts.auxiliaryStatus.${c}`,t,i,s,n,r,o,a),this.container=e,this.height=$t.HEIGHT}},vs=ot,ot.COUNTER=1,ot);ws=vs=y([u(1,O),u(2,ue),u(3,Di),u(4,he),u(5,ce),u(6,ye),u(7,Ie)],ws);let Rs=class extends On{constructor(e,t,i){super("workbench.statusBarService",i,t),this.instantiationService=e,this._onDidCreateAuxiliaryStatusbarPart=this._register(new E),this.onDidCreateAuxiliaryStatusbarPart=this._onDidCreateAuxiliaryStatusbarPart.event,this.mainPart=this._register(this.instantiationService.createInstance(_s)),this._register(this.registerPart(this.mainPart)),this.onDidChangeEntryVisibility=this.mainPart.onDidChangeEntryVisibility}createAuxiliaryStatusbarPart(e,t){const i=I("footer.part.statusbar",{role:"status","aria-live":"off",tabIndex:"0"});i.style.position="relative",e.appendChild(i);const s=t.createInstance(ws,i),n=this.registerPart(s);return s.create(i),me.once(s.onWillDispose)(()=>n.dispose()),this._onDidCreateAuxiliaryStatusbarPart.fire(s),s}createScoped(e,t){return t.add(this.instantiationService.createInstance(Ds,e))}addEntry(e,t,i,s=0){return e.showInAllWindows?this.doAddEntryToAllWindows(e,t,i,s):this.mainPart.addEntry(e,t,i,s)}doAddEntryToAllWindows(e,t,i,s=0){const n=new L,r=new Set;let o=e;function a(c){const f=new L;f.add(c.onWillDispose(()=>f.dispose()));const m=f.add(c.addEntry(o,t,i,s));r.add(m),f.add(Ne(()=>r.delete(m))),n.add(f),f.add(Ne(()=>n.delete(f)))}for(const c of this.parts)a(c);return n.add(this.onDidCreateAuxiliaryStatusbarPart(c=>a(c))),{update:c=>{o=c;for(const f of r)f.update(c)},dispose:()=>n.dispose()}}isEntryVisible(e){return this.mainPart.isEntryVisible(e)}updateEntryVisibility(e,t){for(const i of this.parts)i.updateEntryVisibility(e,t)}overrideEntry(e,t){const i=new L;for(const s of this.parts)i.add(s.overrideEntry(e,t));return i}focus(e){this.activePart.focus(e)}focusNextEntry(){this.activePart.focusNextEntry()}focusPreviousEntry(){this.activePart.focusPreviousEntry()}isEntryFocused(){return this.activePart.isEntryFocused()}overrideStyle(e){const t=new L;for(const i of this.parts)t.add(i.overrideStyle(e));return t}};Rs=y([u(0,O),u(1,he),u(2,ue)],Rs);let Ds=class extends te{constructor(e,t){super(),this.statusbarEntryContainer=e,this.statusbarService=t,this.onDidChangeEntryVisibility=this.statusbarEntryContainer.onDidChangeEntryVisibility}createAuxiliaryStatusbarPart(e,t){return this.statusbarService.createAuxiliaryStatusbarPart(e,t)}createScoped(e,t){return this.statusbarService.createScoped(e,t)}getPart(){return this.statusbarEntryContainer}addEntry(e,t,i,s=0){return this.statusbarEntryContainer.addEntry(e,t,i,s)}isEntryVisible(e){return this.statusbarEntryContainer.isEntryVisible(e)}updateEntryVisibility(e,t){this.statusbarEntryContainer.updateEntryVisibility(e,t)}overrideEntry(e,t){return this.statusbarEntryContainer.overrideEntry(e,t)}focus(e){this.statusbarEntryContainer.focus(e)}focusNextEntry(){this.statusbarEntryContainer.focusNextEntry()}focusPreviousEntry(){this.statusbarEntryContainer.focusPreviousEntry()}isEntryFocused(){return this.statusbarEntryContainer.isEntryFocused()}overrideStyle(e){return this.statusbarEntryContainer.overrideStyle(e)}};Ds=y([u(1,Ve)],Ds);function Bc(l){const e=l;return typeof e.id=="string"&&e.id.length>0&&typeof e.name=="string"&&typeof e.text=="string"&&(e.alignment==="left"||e.alignment==="right")&&(e.command===void 0||typeof e.command=="string")&&(e.tooltip===void 0||typeof e.tooltip=="string")&&(e.priority===void 0||typeof e.priority=="number")&&(e.accessibilityInformation===void 0||Ta(e.accessibilityInformation))}const Sn={type:"object",required:["id","text","alignment","name"],properties:{id:{type:"string",markdownDescription:g(2509,"The identifier of the status bar entry. Must be unique within the extension. The same value must be used when calling the `vscode.window.createStatusBarItem(id, ...)`-API")},name:{type:"string",description:g(2510,"The name of the entry, like 'Python Language Indicator', 'Git Status' etc. Try to keep the length of the name short, yet descriptive enough that users can understand what the status bar item is about.")},text:{type:"string",description:g(2511,"The text to show for the entry. You can embed icons in the text by leveraging the `$(<name>)`-syntax, like 'Hello $(globe)!'")},tooltip:{type:"string",description:g(2512,"The tooltip text for the entry.")},command:{type:"string",description:g(2513,"The command to execute when the status bar entry is clicked.")},alignment:{type:"string",enum:["left","right"],description:g(2514,"The alignment of the status bar entry.")},priority:{type:"number",description:g(2515,"The priority of the status bar entry. Higher value means the item should be shown more to the left.")},accessibilityInformation:{type:"object",description:g(2516,"Defines the role and aria label to be used when the status bar entry is focused."),properties:{role:{type:"string",description:g(2517,"The role of the status bar entry which defines how a screen reader interacts with it. More about aria roles can be found here https://w3c.github.io/aria/#widget_roles")},label:{type:"string",description:g(2518,"The aria label of the status bar entry. Defaults to the entry's text.")}}}}},Lc={description:g(2519,"Contributes items to the status bar."),oneOf:[Sn,{type:"array",items:Sn}]},In=ma.registerExtensionPoint({extensionPoint:"statusBarItems",jsonSchema:Lc});let Ps=class{constructor(e){const t=new L;In.setHandler(i=>{t.clear();for(const s of i){if(!Sa(s.description,"contribStatusBarItems")){s.collector.error(`The ${In.name} is proposed API`);continue}const{value:n,collector:r}=s;for(const o of Ia.wrap(n)){if(!Bc(o)){r.error(g(2520,"Invalid status bar item contribution."));continue}const a=Ca(s.description.identifier,o.id);e.setOrUpdateEntry(a,a,ba.toKey(s.description.identifier),o.name??s.description.displayName??s.description.name,o.text,o.tooltip,o.command?{id:o.command,title:o.name}:void 0,void 0,void 0,o.alignment==="left",o.priority,o.accessibilityInformation)===Ea.DidDefine&&t.add(Ne(()=>e.unsetEntry(a)))}}})}};Ps=y([u(0,Wn)],Ps);var yt;let Ci=(yt=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(Ps)}},yt.ID="workbench.contrib.statusBarItemsExtensionPoint",yt);Ci=y([u(0,O)],Ci);pa(Ci.ID,Ci,Aa.BlockStartup);function Mc(){return{[Ve.toString()]:new Ke(Rs,[],!1),[Wn.toString()]:new Ke(ya,[],!1)}}const Oc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));ke(Oc);let Ns=class extends Pi{get minimumHeight(){return this.visible?this.height:0}get maximumHeight(){return this.visible?this.height:0}get onDidChange(){return this._onDidChangeSize.event}constructor(e,t,i,s,n){super(h.BANNER_PART,{hasTitle:!1},e,i,t),this.contextKeyService=s,this.instantiationService=n,this.height=26,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this._onDidChangeSize=this._register(new E),this.visible=!1,this.focusedActionIndex=-1,this.markdownRenderer=this.instantiationService.createInstance(va,{})}createContentArea(e){this.element=e,this.element.tabIndex=0,this._register(F(this.element,Q.FOCUS,()=>{this.focusedActionIndex!==-1&&this.focusActionLink()}));const t=this._register(this.contextKeyService.createScoped(this.element));return Ni.bindTo(t).set(!0),this.element}close(e){this.setVisibility(!1),ct(this.element),typeof e.onClose=="function"&&e.onClose(),this.item=void 0}focusActionLink(){const e=this.item?.actions?.length??0;if(this.focusedActionIndex<e){const t=this.messageActionsContainer?.children[this.focusedActionIndex];Ri(t)&&(this.actionBar?.setFocusable(!1),t.focus())}else this.actionBar?.focus(0)}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=I("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}setVisibility(e){e!==this.visible&&(this.visible=e,this.focusedActionIndex=-1,this.layoutService.setPartHidden(!e,h.BANNER_PART),this._onDidChangeSize.fire(void 0))}focus(){this.focusedActionIndex=-1,this.element.focus()}focusNextAction(){const e=this.item?.actions?.length??0;this.focusedActionIndex=this.focusedActionIndex<e?this.focusedActionIndex+1:0,this.focusActionLink()}focusPreviousAction(){const e=this.item?.actions?.length??0;this.focusedActionIndex=this.focusedActionIndex>0?this.focusedActionIndex-1:e,this.focusActionLink()}hide(e){this.item?.id===e&&this.setVisibility(!1)}show(e){if(e.id===this.item?.id){this.setVisibility(!0);return}ct(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ne(this.element,I("div.icon-container"));i.setAttribute("aria-hidden","true"),W.isThemeIcon(e.icon)?i.appendChild(I(`div${W.asCSSSelector(e.icon)}`)):(i.classList.add("custom-icon"),wi.isUri(e.icon)&&(i.style.backgroundImage=_a(e.icon)));const s=ne(this.element,I("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ne(this.element,I("div.message-actions-container")),e.actions)for(const a of e.actions)this._register(this.instantiationService.createInstance(wa,this.messageActionsContainer,{...a,tabIndex:-1},{}));const n=ne(this.element,I("div.action-container"));this.actionBar=this._register(new xs(n));const r=e.closeLabel??g(2941,"Close Banner"),o=this._register(new ie("banner.close",r,W.asClassName(Ra),!0,()=>this.close(e)));this.actionBar.push(o,{icon:!0,label:!1}),this.actionBar.setFocusable(!1),this.setVisibility(!0),this.item=e}toJSON(){return{type:h.BANNER_PART}}};Ns=y([u(0,ue),u(1,ce),u(2,he),u(3,Ie),u(4,O)],Ns);V.registerCommandAndKeybindingRule({id:"workbench.banner.focusBanner",weight:B.WorkbenchContrib,primary:b.Escape,when:Ni,handler:l=>{l.get(gt).focus()}});V.registerCommandAndKeybindingRule({id:"workbench.banner.focusNextAction",weight:B.WorkbenchContrib,primary:b.RightArrow,secondary:[b.DownArrow],when:Ni,handler:l=>{l.get(gt).focusNextAction()}});V.registerCommandAndKeybindingRule({id:"workbench.banner.focusPreviousAction",weight:B.WorkbenchContrib,primary:b.LeftArrow,secondary:[b.UpArrow],when:Ni,handler:l=>{l.get(gt).focusPreviousAction()}});const bt=class bt extends Ce{constructor(){super({id:bt.ID,title:bt.LABEL,category:Ys.View,f1:!0})}async run(e){e.get(ce).focusPart(h.BANNER_PART)}};bt.ID="workbench.action.focusBanner",bt.LABEL=re(2942,"Focus Banner");let Vs=bt;fe(Vs);var ai,at;let Bs=(at=class{constructor(e,t,i){const s=i.options?.welcomeBanner;if(!s||t.getBoolean(ai.WELCOME_BANNER_DISMISSED_KEY,p.PROFILE,!1))return;let n;typeof s.icon=="string"?n=W.fromId(s.icon):s.icon&&(n=wi.revive(s.icon)),e.show({id:"welcome.banner",message:s.message,icon:n,actions:s.actions,onClose:()=>{t.store(ai.WELCOME_BANNER_DISMISSED_KEY,!0,p.PROFILE,D.MACHINE)}})}},ai=at,at.WELCOME_BANNER_DISMISSED_KEY="workbench.banner.welcome.dismissed",at);Bs=ai=y([u(0,gt),u(1,he),u(2,jt)],Bs);Da.as(Pa.Workbench).registerWorkbenchContribution(Bs,Vt.Restored);function xc(){return{[gt.toString()]:new Ke(Ns,[],!1)}}kn(async l=>{l.get(gt)});let Ls=class extends Ec{constructor(e,t,i){super(Gn(),e,new Va,t),this.instantiationService=i,this.mainContainer.classList.add("monaco-workbench-part")}registerErrorHandler(e){Bn(t=>this.handleUnexpectedError(t,e))}createNotificationsHandlers(){}initServices(){return this.instantiationService}restore(){try{this.restoreParts()}catch(e){ii(e)}}};Ls=y([u(1,Pn),u(2,O)],Ls);Ba(async l=>{l.get(ce).startup();const e=La(C,Gn());Ma(e!=null&&!e.guess,C)});Oa(async l=>{l.get(O).createInstance(Xa)});function ph(l,e){return{...Ka(e),...Na({isKeybindingConfigurationVisible:()=>!0,shouldUseGlobalPicker:()=>!0}),...Ya({shouldUseGlobalKeybindings:()=>!0}),[ce.toString()]:new Ke(Ls,[l],!1),[ft.toString()]:new Ke(Ua,[],!1),[wt.toString()]:new Ke(Za,[void 0],!1),...wc(),...Mc(),...xc()}}export{Ih as AbstractResourceEditorInput,Ch as AbstractTextResourceEditorInput,bh as ConfirmResult,Eh as DomScrollableElement,Th as EditorInput,Gr as EditorInputCapabilities,h as Parts,yh as RegisteredEditorPriority,vh as SplitView,T as ViewContainerLocation,_h as ViewPaneContainer,ph as default};
|