@opensumi/cli-engine 3.9.1-next-1752974346.0 → 3.9.1-next-1753350817.0

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.
@@ -33292,7 +33292,7 @@ ${y}`)}return this.keybindingsChanged.fire({affectsCommands:[f.command]}),{dispo
33292
33292
  `);for(let R=0;R<I.length-1;R++)I[R]=I[R]+`
33293
33293
  `;I[I.length-1]||I.pop();const w=I.map(R=>this.linkify(R,!1,S));if(w.length===1)return w[0];const T=document.createElement("span");return w.forEach(R=>T.appendChild(R)),T}const D=document.createElement("span");for(const I of this.detectLinks(b))try{switch(I.kind){case"text":D.appendChild(document.createTextNode(I.value));break;case"web":D.appendChild(this.createWebLink(I.value));break;case"path":{const w=I.captures[0],T=I.captures[1]?Number(I.captures[1]):0,R=I.captures[2]?Number(I.captures[2]):0;D.appendChild(this.createPathLink(I.value,w,T,R,S));break}}}catch{D.appendChild(document.createTextNode(I.value))}return D}createWebLink(b){const A=this.createLink(b),S=l.URI.parse(b);return this.decorateLink(A,async()=>{if(S.scheme===o.Schemes.file){const D=S.toString(),I=o.OS.type()===l.OperatingSystem.Windows?l.path.win32:l.path.posix,w=l.path.normalize(I.sep===l.path.posix.sep&&l.isWindows?D.replace(/\\/g,l.path.posix.sep):D);await this.workbenchEditorService.open(l.URI.parse(w));return}this.openerService.open(b)}),A}createPathLink(b,A,S,D,I){if(A[0]==="/"&&A[1]==="/")return document.createTextNode(b);if(A[0]==="."){if(!I)return document.createTextNode(b);const R=I.toResource(A),M=this.createLink(b);return this.decorateLink(M,()=>{this.workbenchEditorService.open(l.URI.parse(R.toString()))}),M}const w=this.createLink(b);w.tabIndex=0;const T=l.URI.file(l.path.normalize(A));return this.fileServiceClient.getFileStat(T.toString()).then(R=>{!R||R&&R.isDirectory||this.decorateLink(w,()=>{this.workbenchEditorService.open(l.URI.parse(T.toString()),{range:{startColumn:D,startLineNumber:S,endLineNumber:S,endColumn:D}})})}),w}createLink(b){const A=document.createElement("a");return A.textContent=b,A}decorateLink(b,A){b.classList.add(m.default.link),b.title=(0,o.formatLocalize)("debug.console.followLink",l.isMacintosh?"Cmd":"Ctrl"),b.onmousemove=S=>{b.classList.toggle(m.default.pointer,l.isMacintosh?S.metaKey:S.ctrlKey)},b.onmouseleave=()=>b.classList.remove(m.default.pointer),b.onclick=S=>{const D=window.getSelection();!D||D.type==="Range"||(l.isMacintosh?S.metaKey:S.ctrlKey)&&(S.preventDefault(),S.stopImmediatePropagation(),A(!1))}}detectLinks(b){if(!b)return[];if(b.length>f)return[{kind:"text",value:b,captures:[]}];const A=[s,E],S=["web","path"],D=[],I=(w,T)=>{if(T>=A.length){D.push({value:w,kind:"text",captures:[]});return}const R=A[T];let M=0,O;for(R.lastIndex=0;(O=R.exec(w))!==null;){const k=w.substring(M,O.index);k&&I(k,T+1);const F=O[0];D.push({value:F,kind:S[T],captures:O.slice(1)}),M=O.index+F.length}const x=w.substring(M);x&&I(x,T+1)};return I(b,0),D}};t.LinkDetector=d,n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],d.prototype,"openerService",void 0),t.LinkDetector=d=n.__decorate([(0,r.Injectable)({multiple:!0})],d)},61752:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugMemoryFileSystemProvider=void 0;const n=e(85608),r=n.__importDefault(e(17228)),o=e(76003),l=e(43718),_=e(64582),v=e(38029),{Path:m}=l.path;let p=class{constructor(){this.memoryFdCounter=0,this.changeEmitter=new l.Emitter,this.fdMemory=new Map,this.capabilities=1028,this.onDidChangeCapabilities=l.Event.None,this.onDidChangeFile=this.changeEmitter.event,this.emptyBuffer=this.toBuffer("")}stat(a){return Promise.resolve({type:l.FileType.File,uri:a.toString(),mtime:0,ctime:0,size:0,lastModification:0,isDirectory:!1})}async readFile(a){const h=this.parseUri(a);if(!h)return this.emptyBuffer;if(!h.offset)return this.emptyBuffer;const{session:u,memoryReference:c,offset:E}=h,f=new Uint8Array(E.toOffset-E.fromOffset),d=this.memoryFdCounter++;let y=u.getMemory(c);return E&&(y=new s(y,E)),this.fdMemory.set(d,{session:u,region:y}),await this.read(d,E.fromOffset,f,0,f.length),f}async read(a,h,u,c,E){const f=this.fdMemory.get(a);if(!f)return;const d=await f.region.read(h,E);let y=0;for(const b of d)switch(b.type){case 1:return y;case 2:return y>0?y:this.logger.error(b.error);case 0:{const A=Math.max(0,h-b.offset),S=b.data.slice(A,Math.min(b.data.byteLength,A+(E-y)));u.set(S.buffer,c+y),y+=S.byteLength;break}default:this.logger.log(b)}return y}toBuffer(a){return l.BinaryBuffer.fromString(a).buffer}parseUri(a){if(a.scheme!==_.DEBUG_MEMORY_SCHEME)return;const h=this.debugSessionManager.sessions.find(f=>f.id.toLowerCase()===a.authority.toLowerCase());if(!h)return;let u;const c=/range=([0-9]+):([0-9]+)/.exec(a.query);c&&(u={fromOffset:Number(c[1]),toOffset:Number(c[2])});const[,E]=a.path.split(m.separator);return{session:h,offset:u,readOnly:!h.capabilities.supportsWriteMemoryRequest,sessionId:a.authority,memoryReference:decodeURIComponent(E)}}readDirectory(){throw new Error("Not allowed")}createDirectory(){throw new Error("Not allowed")}rename(){throw new Error("Not allowed")}delete(){throw new Error("Not allowed")}watch(){throw new Error("Not allowed")}writeFile(){throw new Error("Method not implemented.")}};t.DebugMemoryFileSystemProvider=p,n.__decorate([(0,o.Autowired)(_.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],p.prototype,"debugSessionManager",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),t.DebugMemoryFileSystemProvider=p=n.__decorate([(0,o.Injectable)()],p);class s extends l.Disposable{constructor(a,h){super(),this.parent=a,this.range=h,this.invalidateEmitter=new l.Emitter,this.onDidInvalidate=this.invalidateEmitter.event,this.width=this.range.toOffset-this.range.fromOffset,this.writable=a.writable,this.registerDispose(a),this.registerDispose(a.onDidInvalidate(u=>{const c=(0,r.default)(u.fromOffset-h.fromOffset,0,this.width),E=(0,r.default)(u.toOffset-h.fromOffset,0,this.width);E>c&&this.invalidateEmitter.fire({fromOffset:c,toOffset:E})}))}read(a,h){if(a<0)throw new RangeError(`Invalid fromOffset: ${a}`);return this.parent.read(this.range.fromOffset+a,this.range.fromOffset+Math.min(h,this.width))}write(a,h){return this.parent.write(this.range.fromOffset+a,h)}}},31141:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugPreferences=t.IDebugConfiguration=t.debugPreferencesSchema=void 0,t.createDebugPreferences=o,t.injectDebugPreferences=l;const n=e(41869);t.debugPreferencesSchema={type:"object",properties:{"debug.trace":{type:"boolean",default:!1,description:(0,n.localize)("preference.debug.trace")},"debug.debugViewLocation":{enum:["default","left","right","bottom"],default:"default",description:(0,n.localize)("preference.debug.debugViewLocation")},"debug.openDebug":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart","openOnDebugBreak"],default:"openOnDebugBreak",description:(0,n.localize)("preference.debug.openDebug")},"debug.internalConsoleOptions":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,n.localize)("preference.debug.internalConsoleOptions")},"debug.allowBreakpointsEverywhere":{type:"boolean",description:(0,n.localize)("preference.debug.allowBreakpointsEverywhere"),default:!1}}};class r{}t.IDebugConfiguration=r,t.DebugPreferences=Symbol("DebugPreferences");function o(_){return(0,n.createPreferenceProxy)(_,t.debugPreferencesSchema)}function l(_){_.addProviders({token:t.DebugPreferences,useFactory:v=>{const m=v.get(n.PreferenceService);return o(m)}}),_.addProviders({token:n.PreferenceContribution,useValue:{schema:t.debugPreferencesSchema}})}},40453:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProgressService=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(68969),v=e(43718),m=e(26296);let p=n=class{constructor(){this.toDispose=[]}async onDebugServiceStateChange(g){this.progressResolve&&(this.progressResolve(),this.progressResolve=void 0),g===m.DebugState.Initializing&&this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},a=>new Promise(h=>this.progressResolve=h))}run(g){let a;const h=u=>{a=new v.DisposableCollection,u&&(a?.push(u.onDidChangeState(c=>this.onDebugServiceStateChange(c))),a?.push(u.onDidProgressStart(async c=>{const E=new Promise(f=>{const d=l.Event.any(l.Event.filter(u.onDidProgressEnd,y=>y.body.progressId===c.body.progressId),u.onDidExitAdapter)(()=>{d.dispose(),f()})});this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},()=>E),this.progressService.withProgress({location:v.ProgressLocation.Notification,title:c.body.title,cancellable:c.body.cancellable,silent:!0,delay:500},f=>{let d=0;const y=A=>{let S;typeof A.percentage=="number"&&(S=A.percentage-d,d+=S),f.report({message:A.message,increment:S,total:typeof S=="number"?100:void 0})};c.body.message&&y(c.body);const b=u.onDidProgressUpdate(A=>{A.body.progressId===c.body.progressId&&y(A.body)});return E.then(()=>b.dispose())},()=>u.cancel(c.body.progressId))})))};this.toDispose.push(g.onDidChangeActiveDebugSession(({current:u})=>{a&&a.dispose(),h(u)})),h(g.currentSession)}};t.DebugProgressService=p,p.DEBUG_PANEL_PROGRESS_ID="debug",r.__decorate([(0,o.Autowired)(_.IProgressService),r.__metadata("design:type",Object)],p.prototype,"progressService",void 0),t.DebugProgressService=p=n=r.__decorate([(0,o.Injectable)()],p)},69946:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSchema=t.DebugSchemaManager=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(64582),_=e(70159),v=e(37499),{deepClone:m}=o.objects;let p=class{async update(){const g=this.config.getDebuggers(),a={...m(t.launchSchema)},h=a.properties.configurations.items,u=g.map(c=>({attributes:Object.keys(c.configurationAttributes||{}).map(E=>c.configurationAttributes[E]),configurationSnippets:c.configurationSnippets}));for(const{attributes:c,configurationSnippets:E}of u)c&&h.oneOf&&h.oneOf.push(...c),E&&h.defaultSnippets&&h.defaultSnippets.push(...E);this.schemaRegistry.registerSchema(l.launchExtensionSchemaUri,a,["launch.json"])}};t.DebugSchemaManager=p,n.__decorate([(0,r.Autowired)(_.IDebugServer),n.__metadata("design:type",Object)],p.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],p.prototype,"schemaRegistry",void 0),n.__decorate([(0,r.Autowired)(v.DebugConfigurationManager),n.__metadata("design:type",v.DebugConfigurationManager)],p.prototype,"config",void 0),t.DebugSchemaManager=p=n.__decorate([(0,r.Injectable)()],p),t.launchSchema={$id:l.launchSchemaUri,type:"object",title:"Launch",required:[],default:{version:"0.2.0",configurations:[]},properties:{version:{type:"string",description:"Version of this file format.",default:"0.2.0"},configurations:{type:"array",description:"List of configurations. Add new configurations or edit existing ones by using IntelliSense.",items:{defaultSnippets:[],type:"object",oneOf:[]}}}}},90408:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugService=void 0;const n=e(85608),r=e(76003),o=e(41869);let l=class{constructor(){this.onDidDebugContributionPointChangeEmitter=new o.Emitter,this.debugContributionPointsMap=new Map}registerDebugContributionPoints(v,m){this.debugContributionPointsMap.has(v)||(this.debugContributionPointsMap.set(v,m),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m}))}unregisterDebugContributionPoints(v){const m=this.debugContributionPointsMap.get(v);m&&(this.debugContributionPointsMap.delete(v),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m,removed:!0}))}get debugContributionPoints(){return this.debugContributionPointsMap}get onDidDebugContributionPointChange(){return this.onDidDebugContributionPointChangeEmitter.event}};t.DebugService=l,t.DebugService=l=n.__decorate([(0,r.Injectable)()],l)},3520:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionConnection=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(64582),_=e(38029),v=new Set(["breakpoint","capabilities","continued","exited","initialized","loadedSource","module","output","process","stopped","terminated","thread","progressStart","progressUpdate","progressEnd","invalidated"]);let m=class{constructor(s,g,a){this.sessionId=s,this.connectionFactory=g,this.traceOutputChannel=a,this.pendingRequests=new Map,this.requestHandlers=new Map,this.onDidCustomEventEmitter=new o.Emitter,this.onDidCustomEvent=this.onDidCustomEventEmitter.event,this.toDispose=new o.DisposableCollection(this.onDidCustomEventEmitter,o.Disposable.create(()=>this.pendingRequests.clear()),o.Disposable.create(()=>this.emitters.clear())),this.allThreadsContinued=!0,this.emitters=new Map,this.connection=this.createConnection()}get disposed(){return this.toDispose.disposed}dispose(){this.toDispose.dispose()}async createConnection(){if(this.disposed)throw new Error("Connection has been already disposed.");{const s=await this.connectionFactory(this.sessionId);return s.onceClose((g,a)=>{this.fire("exited",{code:g,reason:a})}),s.onMessage(g=>this.handleMessage(g)),this.toDispose.push(o.Disposable.create(()=>{s.dispose()})),s}}async sendRequest(s,g,a,h){var u;s==="initialize"&&(this.sessionAdapterID=g.adapterID);const c=this.manager.reportTime(l.DEBUG_REPORT_NAME.DEBUG_ADAPTER_PROTOCOL_TIME,{sessionId:this.sessionId,threadId:g&&g.threadId||((u=this.manager.currentThread)===null||u===void 0?void 0:u.raw.id)}),E=await this.doSendRequest(s,g,h),f={adapterID:this.sessionAdapterID,request:a.request};if(s==="threads"&&(f.amount=E.body.threads.length),c(s,f),(s==="next"||s==="stepIn"||s==="stepOut"||s==="stepBack"||s==="reverseContinue"||s==="restartFrame")&&this.fireContinuedEvent(g.threadId),s==="continue"){const d=E;return(d&&d.body&&d.body.allThreadsContinued)!==void 0&&(this.allThreadsContinued=E.body.allThreadsContinued),this.fireContinuedEvent(g.threadId,this.allThreadsContinued),E}return E}async sendCustomRequest(s,g){var a;return(a=await this.doSendRequest(s,g))===null||a===void 0?void 0:a.body}async doSendRequest(s,g=null,a){const h=new o.Deferred,u={seq:(0,l.getSequenceId)(),type:"request",command:s};let c;return g&&(u.arguments=g),this.pendingRequests.set(u.seq,E=>{c&&c.dispose(),E.success?h.resolve(E):h.reject(E)}),a&&(c=a.onCancellationRequested(async()=>{c.dispose();const E=this.manager.getSession(this.sessionId);E&&E.capabilities.supportsCancelRequest&&E.sendRequest("cancel",{requestId:u.seq})})),await this.send(u),h.promise}async send(s){const g=await this.connection,a=JSON.stringify(s);this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [UI -> adapter]: ${a}`),g.send(a)}handleMessage(s){this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [adapter -> UI ]: ${s}`);const g=JSON.parse(s);g.type==="request"?this.handleRequest(g):g.type==="response"?this.handleResponse(g):g.type==="event"&&this.handleEvent(g)}handleResponse(s){const g=this.pendingRequests.get(s.request_seq);g&&(this.pendingRequests.delete(s.request_seq),g(s))}onRequest(s,g){this.requestHandlers.set(s,g)}async handleRequest(s){const g={type:"response",seq:(0,l.getSequenceId)(),command:s.command,request_seq:s.seq,success:!0},a=this.requestHandlers.get(s.command);if(a)try{g.body=await a(s)}catch(h){g.success=!1,g.message=h.message}else(0,o.getDebugLogger)().error("Unhandled request",s);await this.send(g)}handleEvent(s){"event"in s?(s.event==="continued"&&(this.allThreadsContinued=s.body.allThreadsContinued!==!1),v.has(s.event)?this.doFire(s.event,s):this.onDidCustomEventEmitter.fire(s)):this.fire("exited",s)}on(s,g){return this.disposed?o.Disposable.create(()=>{}):this.getEmitter(s).event(g)}fire(s,g){this.doFire(s,g)}doFire(s,g){this.disposed||this.getEmitter(s).fire(g)}getEmitter(s){const g=this.emitters.get(s)||this.newEmitter();return this.emitters.set(s,g),g}newEmitter(){const s=new o.Emitter;return this.toDispose.push(s),s}fireContinuedEvent(s,g=!1){this.fire("continued",{type:"event",event:"continued",body:{threadId:s,allThreadsContinued:g},seq:(0,l.getSequenceId)()})}};t.DebugSessionConnection=m,n.__decorate([(0,r.Autowired)(l.IDebugSessionManager),n.__metadata("design:type",_.DebugSessionManager)],m.prototype,"manager",void 0),t.DebugSessionConnection=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__param(1,(0,r.Optional)()),n.__param(2,(0,r.Optional)()),n.__metadata("design:paramtypes",[String,Function,Object])],m)},97186:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionFactory=t.DebugSessionContributionRegistryImpl=t.DebugSessionContributionRegistry=t.DebugSessionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869);t.DebugSessionContribution=Symbol("DebugSessionContribution"),t.DebugSessionContributionRegistry=Symbol("DebugSessionContributionRegistry");let l=class{constructor(){this.contribs=new Map,this.init()}init(){for(const v of this.contributions.getContributions())this.contribs.set(v.debugType,v)}get(v){return this.contribs.get(v)}};t.DebugSessionContributionRegistryImpl=l,n.__decorate([(0,r.Autowired)(t.DebugSessionContribution),n.__metadata("design:type",Object)],l.prototype,"contributions",void 0),t.DebugSessionContributionRegistryImpl=l=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],l),t.DebugSessionFactory=Symbol("DebugSessionFactory")},38029:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionManager=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),_=e(54414),v=e(72665),m=e(93950),p=e(80907),s=e(64582),g=e(79845),a=e(80712),h=e(17280),u=e(97186),c=e(5905);let E=class{fireDidChange(d){this.inDebugModeKey.set(this.inDebugMode),this.onDidChangeEmitter.fire(d)}constructor(){this._uid=(0,o.uuid)(),this._sessions=new Map,this._extraMap=new Map,this._actionIndex=0,this.onWillStartDebugSessionEmitter=new o.Emitter,this.onWillStartDebugSession=this.onWillStartDebugSessionEmitter.event,this.onWillResolveDebugConfigurationEmitter=new o.Emitter,this.onWillResolveDebugConfiguration=this.onWillResolveDebugConfigurationEmitter.event,this.onDidCreateDebugSessionEmitter=new o.Emitter,this.onDidCreateDebugSession=this.onDidCreateDebugSessionEmitter.event,this.onDidStartDebugSessionEmitter=new o.Emitter,this.onDidStartDebugSession=this.onDidStartDebugSessionEmitter.event,this.onDidStopDebugSessionEmitter=new o.Emitter,this.onDidStopDebugSession=this.onDidStopDebugSessionEmitter.event,this.onDidChangeActiveDebugSessionEmitter=new o.Emitter,this.onDidChangeActiveDebugSession=this.onDidChangeActiveDebugSessionEmitter.event,this.onDidDestroyDebugSessionEmitter=new o.Emitter,this.onDidDestroyDebugSession=this.onDidDestroyDebugSessionEmitter.event,this.onDidReceiveDebugSessionCustomEventEmitter=new o.Emitter,this.onDidReceiveDebugSessionCustomEvent=this.onDidReceiveDebugSessionCustomEventEmitter.event,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this.configurationIds=new Map,this.toDisposeOnCurrentSession=new o.DisposableCollection,this.init()}init(){this.debugTypeKey=this.contextKeyService.createKey(s.CONTEXT_DEBUG_TYPE_KEY,void 0),this.inDebugModeKey=this.contextKeyService.createKey(s.CONTEXT_IN_DEBUG_MODE_KEY,this.inDebugMode),this.debugStopped=this.contextKeyService.createKey(s.CONTEXT_DEBUG_STOPPED_KEY,!1),this.modelManager.onModelChanged(d=>{const{newModelUrl:y}=d;if(y){const b=o.URI.parse(y.toString()),A=this.modelManager.model;if(this.currentSession&&this.currentThread&&A){const S=this.currentThread.frames.find(D=>{var I;return((I=D.source)===null||I===void 0?void 0:I.uri.toString())===b.toString()});S&&S!==this.currentFrame&&(this.currentThread.currentFrame=S,setTimeout(()=>{this.workbenchEditorService.currentEditor&&this.workbenchEditorService.currentEditor.monacoEditor.revealLineInCenter(S.raw.line)},0))}}})}_getExtra(d,y){if(d==null)return;const b=this._extraMap.get(d);if(b)return{traceId:b.traceId,remote:b.remote,adapterID:b.adapterID,request:b.request,...y&&b.threads.get(`${y}`)}}getExtra(d,y){return this._getExtra(d,y)}_setExtra(d,y,b){const A=this._extraMap.get(d);A&&(b?A.threads.set(y,b):A.threads.delete(y))}setExtra(d,y,b){return this._setExtra(d,y,b)}report(d,y,b){return b={traceId:this._uid,...this._getExtra(b?.sessionId,b?.threadId),...b},this.reporterService.point(d,y,b)}reportTime(d,y){const b=this.reporterService.time(d);return(A,S)=>(S={...y,...S},S={traceId:this._uid,...this._getExtra(S?.sessionId,S?.threadId),...S},b.timeEnd(A,S))}reportAction(d,y,b){var A,S,D;let I=this._getExtra(d,y);I&&(y&&!I.threadId&&(I={...I}),this._actionIndex+=1,I.action=`${b}-${this._actionIndex}`,I.filePath=(S=(A=this.currentFrame)===null||A===void 0?void 0:A.raw.source)===null||S===void 0?void 0:S.path,I.fileLineNumber=(D=this.currentFrame)===null||D===void 0?void 0:D.raw.line,this._setExtra(d,`${y??""}`,I))}async start(d){const{configuration:y}=d,b={adapterID:y.type,request:y.request==="launch"?"launch":"attach",traceId:this._uid,remote:0,threads:new Map};if((0,c.isRemoteAttach)(y)&&(b.remote=1),this.report(s.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"number",{count:this.breakpoints.getBreakpoints().length,...b}),!d.configuration.__restart&&this.isExistedDebugSession(d)){this.messageService.error((0,o.formatLocalize)("debug.launch.existed",d.configuration.name));return}try{const A=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_SESSION_START_TIME,b);await this.fireWillStartDebugSession();const S=await this.resolveConfiguration(d);if(S){if(S.configuration.preLaunchTask){this.debugProgressService.onDebugServiceStateChange(s.DebugState.Initializing);const I=o.Uri.parse(S.workspaceFolderUri),w=await this.taskService.getTask(I,S.configuration.preLaunchTask);if(w){const T=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_PRE_LAUNCH_TASK_TIME,b),R=await this.taskService.run(w);R.exitCode!==0&&this.messageService.error(`The preLaunchTask ${S.configuration.preLaunchTask} exitCode is ${R.exitCode}`),T(I.toString(),{exitCode:R.exitCode})}this.debugProgressService.onDebugServiceStateChange(s.DebugState.Running)}}else{d.configuration.type?this.messageService.error((0,o.formatLocalize)("debug.notSupported.type",d.configuration.type)):this.messageService.error((0,o.localize)("debug.notSupported.any"));return}const D=await this.debug.createDebugSession(S);if(A(S.configuration.type,{adapterID:S.configuration.type,request:S.configuration.request,sessionId:D}),!D){this.messageService.error((0,o.formatLocalize)("debug.launch.typeNotSupported",S.configuration.type));return}return this.doStart(D,S,b)}catch(A){throw this.messageService.error((0,o.localize)("debug.launch.catchError")),A}}async fireWillStartDebugSession(){await o.WaitUntilEvent.fire(this.onWillStartDebugSessionEmitter,{})}async resolveConfiguration(d){if(s.IDebugSessionDTO.is(d))return d;const{workspaceFolderUri:y,index:b,noDebug:A,parentSession:S,repl:D,compact:I,lifecycleManagedByParent:w}=d,T=await this.resolveDebugConfiguration(d.configuration,y);T&&!("cwd"in T)&&(T.cwd="${workspaceFolder}");let R=await this.variableResolver.resolve(T,{});if(!R){R===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}if(R=await this.resolveDebugConfigurationWithSubstitutedVariables(R,y),!R){R===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}const M=R.name+y,O=this.configurationIds.has(M)?this.configurationIds.get(M)+1:0;return this.configurationIds.set(M,O),{id:O,configuration:R,workspaceFolderUri:y,index:b,noDebug:A,parentSession:S,repl:D,compact:I,lifecycleManagedByParent:w}}async resolveDebugConfiguration(d,y){return await this.fireWillResolveDebugConfiguration(d.type),this.debug.resolveDebugConfiguration(d,y)}async resolveDebugConfigurationWithSubstitutedVariables(d,y){return this.debug.resolveDebugConfigurationWithSubstitutedVariables(d,y)}async fireWillResolveDebugConfiguration(d){await o.WaitUntilEvent.fire(this.onWillResolveDebugConfigurationEmitter,{debugType:d})}async doStart(d,y,b){const A=this.sessionContributionRegistry.get(y.configuration.type);if(!A)return;const D=A.debugSessionFactory().get(d,y);this._sessions.set(d,D),this._extraMap.set(d,b),y.lifecycleManagedByParent||this.updateCurrentSession(D),this.debugTypeKey.set(D.configuration.type),this.onDidCreateDebugSessionEmitter.fire(D);let I=s.DebugState.Inactive;return D.onDidChange(()=>{var w,T;I!==D.state&&(I=D.state,I===s.DebugState.Stopped?(this.onDidStopDebugSessionEmitter.fire(D),this.debugStopped.set(!0)):this.debugStopped.set(!1)),this.debugContextKey.contextSetVariableSupported.set((w=D.capabilities.supportsSetVariable)!==null&&w!==void 0?w:!1),this.debugContextKey.contextRestartFrameSupported.set((T=D.capabilities.supportsRestartFrame)!==null&&T!==void 0?T:!1),this.debugContextKey.contextDebugState.set(s.DebugState[D.state]),this.debugContextKey.contextInDebugMode.set(I!==s.DebugState.Inactive)}),D.on("terminated",w=>{const T=w.body&&w.body.restart;T?this.doRestart(D,T):this.destroy(D.id)}),D.on("exited",()=>this.destroy(D.id)),D.start().then(()=>this.onDidStartDebugSessionEmitter.fire(D)),D.onDidCustomEvent(({event:w,body:T})=>this.onDidReceiveDebugSessionCustomEventEmitter.fire({event:w,body:T,session:D})),D}isExistedDebugSession(d){const{name:y}=d.configuration;for(const[,b]of this._sessions)if(b.configuration.name===y&&!b.terminated)return!0;return!1}async restart(d=this.currentSession){return d&&this.doRestart(d)}async doRestart(d,y){const{options:b,configuration:A}=d;return await d.restart({arguments:A})?d:(await d.terminate(!0),A.__restart=y,this.start(b))}updateCurrentSession(d){this.currentSession=d||this.sessions[this.sessions.length-1]}get inDebugMode(){return this.state>s.DebugState.Inactive}get currentThread(){const d=this.currentSession;return d&&d.currentThread}get state(){const d=this.currentSession;return d?d.state:s.DebugState.Inactive}get currentFrame(){const{currentThread:d}=this;return d&&d.currentFrame}get topFrame(){const{currentThread:d}=this;return d&&d.topFrame}getSession(d){if(d)return this._sessions.get(d)}get sessions(){return Array.from(this._sessions.values()).filter(d=>d.state>s.DebugState.Inactive)}get currentSession(){return this._currentSession}set currentSession(d){if(this._currentSession===d)return;this.toDisposeOnCurrentSession.dispose();const y=this._currentSession;this._currentSession=d,this.onDidChangeActiveDebugSessionEmitter.fire({previous:y,current:d}),d&&(this.toDisposeOnCurrentSession.push(d.onDidChange(()=>{this.currentFrame===this.topFrame&&this.open(),this.fireDidChange(d)})),this.toDisposeOnCurrentSession.push(d.onCurrentThreadChange(()=>{this.fireDidChange(d)}))),this.open(),this.fireDidChange(d)}open(){const{currentFrame:d}=this;d&&d.open()}async stopSession(d,y=!1){return d?y?d.disconnect():d.terminate():Promise.all(this.sessions.map(b=>y?b.disconnect():b.terminate()))}destroy(d){if(d){const y=this._sessions.get(d);y&&this.doDestroy(y)}else this._sessions.forEach(y=>this.doDestroy(y))}doDestroy(d){this.debug.terminateDebugSession(d.id),this.remove(d.id),d.dispose(),this.onDidDestroyDebugSessionEmitter.fire(d)}remove(d){this._sessions.delete(d);const{currentSession:y}=this;y&&y.id===d&&this.updateCurrentSession(void 0),setTimeout(()=>{this._extraMap.delete(d)})}};t.DebugSessionManager=E,n.__decorate([(0,r.Autowired)(l.LabelService),n.__metadata("design:type",l.LabelService)],E.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(u.DebugSessionContributionRegistry),n.__metadata("design:type",Object)],E.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(s.IDebugServer),n.__metadata("design:type",Object)],E.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],E.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],E.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(p.IVariableResolverService),n.__metadata("design:type",Object)],E.prototype,"variableResolver",void 0),n.__decorate([(0,r.Autowired)(a.BreakpointManager),n.__metadata("design:type",a.BreakpointManager)],E.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(s.IDebugModelManager),n.__metadata("design:type",Object)],E.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(m.ITaskService),n.__metadata("design:type",Object)],E.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(g.IDebugProgress),n.__metadata("design:type",Object)],E.prototype,"debugProgressService",void 0),n.__decorate([(0,r.Autowired)(h.DebugContextKey),n.__metadata("design:type",h.DebugContextKey)],E.prototype,"debugContextKey",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),t.DebugSessionManager=E=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],E)},29539:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSession=void 0;const r=e(85608).__importDefault(e(12784)),o=e(41869),l=e(43718),_=e(64582),v=e(32385),m=e(99797),p=e(88776),s=e(7885);class g{fireDidChange(){this.onDidChangeEmitter.fire(void 0),this.onStateChange()}get capabilities(){return this._capabilities}get supportsThreadIdCorrespond(){return!!this.capabilities.supportsThreadIdCorrespond}constructor(h,u,c,E,f,d,y,b,A,S,D){this.id=h,this.options=u,this.connection=c,this.terminalService=E,this.workbenchEditorService=f,this.breakpointManager=d,this.modelManager=y,this.labelProvider=b,this.messages=A,this.fileSystem=S,this.sessionManager=D,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this._onDidChangeCallStack=new o.Emitter,this.onDidChangeCallStack=this._onDidChangeCallStack.event,this._onVariableChange=new o.Emitter,this.onVariableChange=this._onVariableChange.event,this._onCurrentThreadChange=new o.Emitter,this.onCurrentThreadChange=this._onCurrentThreadChange.event,this._onDidStop=new o.Emitter,this.onDidStop=this._onDidStop.event,this._onDidContinued=new o.Emitter,this.onDidContinued=this._onDidContinued.event,this._onDidThread=new o.Emitter,this.onDidThread=this._onDidThread.event,this._onRequest=new o.Emitter,this.onRequest=this._onRequest.event,this._onDidExitAdapter=new o.Emitter,this.onDidExitAdapter=this._onDidExitAdapter.event,this._onDidProgressStart=new o.Emitter,this.onDidProgressStart=this._onDidProgressStart.event,this._onDidProgressUpdate=new o.Emitter,this.onDidProgressUpdate=this._onDidProgressUpdate.event,this._onDidProgressEnd=new o.Emitter,this.onDidProgressEnd=this._onDidProgressEnd.event,this._onDidInvalidated=new o.Emitter,this.onDidInvalidated=this._onDidInvalidated.event,this._onDidChangeState=new o.Emitter,this.onDidChangeState=this._onDidChangeState.event,this._onDidInvalidMemory=new o.Emitter,this.onDidInvalidateMemory=this._onDidInvalidMemory.event,this.toDispose=new o.DisposableCollection,this._capabilities={},this.updateDeffered=null,this.exitDeferred=new o.Deferred,this.cancellationMap=new Map,this.toDisposeOnCurrentThread=new o.DisposableCollection,this.initialized=!1,this.id2Breakpoint=new Map,this.settingBreakpoints=null,this._multipleThreadPaused=new Map,this.sources=new Map,this._threads=new Map,this.scheduleUpdateThreads=(0,r.default)(()=>this.updateThreads(void 0),100),this.pendingThreads=Promise.resolve(),this.terminated=!1,this.connection.onRequest("runInTerminal",async I=>await this.runInTerminal(I)),this.toDispose.pushAll([this.onDidChangeEmitter,this.connection,this.on("initialized",()=>{this.configure()}),this.on("breakpoint",({body:I})=>this.onUpdateBreakpoint(I)),this.on("continued",async I=>{const{body:{allThreadsContinued:w,threadId:T}}=I;if(this.handleCancellation(T),this.supportsThreadIdCorrespond){T?this._multipleThreadPaused.delete(T):w!==!1&&this._multipleThreadPaused.clear(),await this.updateCurrentThread(),this._onDidContinued.fire(I);return}if(w!==!1){this.clearThreads(),this._onDidContinued.fire(I);return}(0,l.isDefined)(T)&&this.clearThread(T),this.onStateChange(),this._onDidContinued.fire(I)}),this.on("stopped",async I=>{const{body:w}=I;this.stoppedDetails=w;const{threadId:T}=w,R=this.sessionManager.reportTime(_.DEBUG_REPORT_NAME.DEBUG_STOPPED,{sessionId:this.id,threadId:T});if(this.supportsThreadIdCorrespond===!0){if(await this.collectPausedThread(w),w.threadId&&this._multipleThreadPaused.has(w.threadId)){const O=this._multipleThreadPaused.get(w.threadId);await this.updateCurrentThread(O),await this.updateCurrentThreadFramesOnFocus()}}else this.updateDeffered=new o.Deferred,await this.updateThreads(w),await this.updateCurrentThreadFramesOnFocus(),this.updateDeffered.resolve();R("stopped");const M=this.sessionManager.getExtra(this.id,T);T&&M&&M.action&&(M.action=void 0,this.sessionManager.setExtra(this.id,`${T??""}`,M)),this.onStateChange(),this.sessionManager.currentSession=this,this._onDidStop.fire(I)}),this.on("thread",I=>{const{body:{reason:w,threadId:T}}=I;if(this.supportsThreadIdCorrespond){this.state===_.DebugState.Stopped&&this._onDidThread.fire(I);return}w==="started"?this.scheduleUpdateThreads():w==="exited"&&this.clearThread(T),this._onDidThread.fire(I)}),this.on("terminated",()=>{this.terminated=!0}),this.on("exited",I=>{this.exitDeferred.resolve(I)}),this.on("progressStart",I=>{this._onDidProgressStart.fire(I)}),this.on("progressUpdate",I=>{this._onDidProgressUpdate.fire(I)}),this.on("progressEnd",I=>{this._onDidProgressEnd.fire(I)}),this.on("memory",I=>{this._onDidInvalidMemory.fire(I)}),this.on("invalidated",async I=>{this._onDidInvalidated.fire(I),I.body.areas&&I.body.areas.length===1&&(I.body.areas[0]==="variables"||I.body.areas[0]==="watch")||(this.cancelAllRequests(),this.clearThreads(),await this.updateThreads(this.stoppedDetails)),this.fireDidChange()}),this.on("capabilities",I=>this.updateCapabilities(I.body.capabilities)),this.breakpointManager.onDidChangeBreakpoints(I=>this.runtimeUpdateBreakpoint(I)),this.breakpointManager.onDidChangeExceptionsBreakpoints(I=>{this.breakpointManager.breakpointsEnabled&&this.setExceptionBreakpoints(I)}),l.Disposable.create(()=>{this.breakpointManager.clearAllStatus(this.id)})])}getMemory(h){return new v.MemoryRegion(h,this)}get configuration(){return this.options.configuration}get parentSession(){return this.options.parentSession}get lifecycleManagedByParent(){return this.options.lifecycleManagedByParent}get compact(){return!!this.options.compact}async start(){await this.workbenchEditorService.saveAll(),await this.initialize(),await this.launchOrAttach()}async runInTerminal({arguments:{title:h,cwd:u,args:c,env:E}}){return this.doRunInTerminal({name:h,cwd:u,env:E,args:c})}async doRunInTerminal(h){var u;const c=this.terminalService.terminals.find(y=>y.name===h.name&&y.isActive);let E;const f=await this.terminalService.getDefaultShellPath(),d=(0,_.prepareCommand)(f,h.args,!1,(u=h.cwd)===null||u===void 0?void 0:u.toString(),h.env);if(c)d&&this.terminalService.sendText(c.id,d),E=await this.terminalService.getProcessId(c.id);else{const y=await this.terminalService.createTerminal(h);y.show(),d&&(this.terminalService.sendText(y.id,d),E=await this.terminalService.getProcessId(y.id))}return{processId:E}}async initialize(){const h=await this.connection.sendRequest("initialize",{clientID:"OpenSumi",clientName:"OpenSumi IDE",adapterID:this.configuration.type,locale:(0,l.getLanguageId)(),linesStartAt1:!0,columnsStartAt1:!0,pathFormat:"path",supportsVariableType:!1,supportsVariablePaging:!1,supportsRunInTerminalRequest:!0,supportsProgressReporting:!0,supportsInvalidatedEvent:!0,supportsMemoryEvent:!0,supportsMemoryReferences:!0},this.configuration);this.updateCapabilities(h.body||{}),this.onStateChange()}async launchOrAttach(){var h;if(this.parentSession&&this.parentSession.state===_.DebugState.Inactive)throw(0,o.canceled)();try{this.configuration.request==="attach"?await this.sendRequest("attach",this.configuration):await this.sendRequest("launch",this.configuration)}catch(u){throw this.fireExited(u),this.messages.error(u.message||((h=u.body)===null||h===void 0?void 0:h.error.format)||(0,o.localize)("debug.console.errorMessage")),u&&u.message}}async configure(){await this.initBreakpoints(),this.breakpointManager.setExceptionBreakpoints(this.capabilities.exceptionBreakpointFilters||[]),this.initialized=!0,this.capabilities.supportsConfigurationDoneRequest&&this.sendRequest("configurationDone",{}),this.supportsThreadIdCorrespond||await this.updateThreads(void 0)}async setExceptionBreakpoints(h){return this.sendRequest("setExceptionBreakpoints",h)}onStateChange(){const h=this.state;this.previousState!==h&&(this.previousState=h,this._onDidChangeState.fire(h))}async onUpdateBreakpoint(h){let u;this.settingBreakpoints&&await this.settingBreakpoints.promise;try{const c=h.breakpoint;switch(h.reason){case"new":if(c.source&&typeof c.line=="number"&&c.id&&!this.id2Breakpoint.has(c.id)){const E=p.DebugSource.toUri(c.source),f=m.DebugBreakpoint.create(E,{line:c.line,column:c.column});f.status.set(this.id,c),this.addBreakpoint(f)}break;case"removed":c.id&&(u=this.id2Breakpoint.get(c.id),u&&this.delBreakpoint(u));break;case"changed":c.id&&(u=this.id2Breakpoint.get(c.id),u&&(u.status.set(this.id,c),this.breakpointManager.updateBreakpoint(u,!0)));break;default:break}}finally{}}async setBreakpoints(h){const u=[];for(const c of h){const E=await this.toSource(c),f=this.breakpointManager.getBreakpoints(c).filter(d=>this.breakpointManager.breakpointsEnabled&&d.enabled);u.push(this.sendRequest("setBreakpoints",{source:E.raw,sourceModified:!1,lines:f.map(d=>d.raw.line),breakpoints:f.map(d=>d.raw)}).then(d=>(d.body.breakpoints.forEach((y,b)=>{var A,S;y.id&&this.id2Breakpoint.set(y.id,f[b]);const D=f[b];D.raw.line=(A=y.line)!==null&&A!==void 0?A:D.raw.line,D.raw.column=(S=y.column)!==null&&S!==void 0?S:D.raw.column,D.status.set(this.id,y)}),this.breakpointManager.updateBreakpoints(f,!0),this.breakpointManager.resolveBpDeffered(),Promise.resolve())).catch(d=>{if(!(d instanceof Error)){const b=d.message?`${d.message}`:"Breakpoint not valid for current debug session";f.forEach(A=>{A.status.set(this.id,{verified:!1,message:b}),this.breakpointManager.updateBreakpoint(A,!0)})}}))}return await Promise.all(u)}delBreakpoint(h){return this.breakpointManager.delBreakpoint(h)}async addBreakpoint(h,u){return u&&this.breakpointManager.setBpDeffered(),this.breakpointManager.addBreakpoint(h),this.breakpointManager.promiseBpDeffered()}async runtimeUpdateBreakpoint(h){const{affected:u,statusUpdated:c}=h;if(!c)return await this.setBreakpoints(u)}async initBreakpoints(){this.settingBreakpoints=new o.Deferred,this.id2Breakpoint.clear(),this.configuration.noDebug||await this.setBreakpoints(this.breakpointManager.affected.map(h=>o.URI.parse(h))),this.settingBreakpoints.resolve(),this.settingBreakpoints=null}get currentThread(){return this._currentThread}set currentThread(h){this.toDisposeOnCurrentThread.dispose(),this._currentThread=h,h&&this.toDisposeOnCurrentThread.push(h.onDidChanged(()=>this.fireDidChange()))}get multipleThreadPaused(){return this._multipleThreadPaused}hasInMultipleThreadPaused(h){return this._multipleThreadPaused.has(h)}clearThreads(){var h;const u=this.sessionManager.reportTime(_.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:(h=this.currentThread)===null||h===void 0?void 0:h.id,threadAmount:this.threadCount});this._threads.forEach(c=>{c.clear()}),this._onDidChangeCallStack.fire(),this.collocationThread(),u("clearThreads")}clearThread(h){const u=this.sessionManager.reportTime(_.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:h,threadAmount:this.threadCount}),c=this._threads.get(h);c&&(c.clear(),this._onDidChangeCallStack.fire()),this.collocationThread(),u("clearThread")}get state(){if(this.connection.disposed)return _.DebugState.Inactive;if(!this.initialized)return _.DebugState.Initializing;const h=this.currentThread;return h?h.stopped?_.DebugState.Stopped:_.DebugState.Running:this.supportsThreadIdCorrespond?_.DebugState.Running:this.stoppedThreads.next().value?_.DebugState.Stopped:_.DebugState.Running}get currentFrame(){return this.currentThread&&this.currentThread.currentFrame}async getScopes(h){const{currentFrame:u}=this;return u?u.getScopes(h):[]}get label(){return _.IDebugSessionDTO.is(this.options)&&this.options.id?this.configuration.name+" ("+(this.options.id+1)+")":this.configuration.name}get visible(){return this.state>_.DebugState.Inactive}getSource(h){const u=p.DebugSource.toUri(h).toString(),c=this.sources.get(u)||new p.DebugSource(this,this.labelProvider,this.modelManager,this.workbenchEditorService,this.fileSystem);return c.update({raw:h}),this.sources.set(u,c),c}getSourceForUri(h){return this.sources.get(h.toString())}async toSource(h){const u=this.getSourceForUri(h);return u||this.getSource(await this.toDebugSource(h))}async toDebugSource(h){if(h.scheme===p.DebugSource.SCHEME)return{name:h.path.toString(),sourceReference:Number(h.query)};const u=h.displayName;let c=h.toString();return h.scheme===l.Schemes.file&&(c=await this.fileSystem.getFsPath(c)),{name:u,path:c,adapterData:void 0,sourceReference:void 0}}get threads(){return Array.from(this._threads.values())}get threadCount(){return this._threads.size}*getThreads(h){for(const u of this.threads)h(u)&&(yield u)}get runningThreads(){return this.getThreads(h=>!h.stopped)}get stoppedThreads(){return this.getThreads(h=>h.stopped)}async rawFetchThreads(h){const u=typeof h>"u"?null:{threadId:h},c=await this.sendRequest("threads",u);return c&&c.body&&c.body.threads&&Array.isArray(c.body.threads)?Promise.resolve(c.body.threads):Promise.resolve([])}async fetchThreads(){const h=await this.rawFetchThreads(),u=this._threads,c=[];for(const E of h){const f=E.id,d=u.get(f)||new s.DebugThread(this);c.push(d),d.update({raw:E})}return Promise.resolve(c)}updateThreads(h){return this.pendingThreads=this.pendingThreads.then(async()=>{try{const u=await this.rawFetchThreads();this.doUpdateThreads(u,h)}catch{}})}doUpdateThreads(h,u){const c=this.sessionManager.reportTime(_.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:u?.threadId,threadAmount:h.length}),E=[];h.forEach(f=>{if(E.push(f.id),this._threads.has(f.id)){if(f.name){const d=this._threads.get(f.id);d&&(d.raw.name=f.name)}}else{const d=new s.DebugThread(this),y={raw:f};d.update(y),this._threads.set(f.id,d)}}),this._threads.forEach(f=>{var d;const{raw:{id:y}}=f;E.indexOf(y)===-1&&this._threads.delete(y),u&&(u.allThreadsStopped||u.threadId===y)&&((d=this._threads.get(y))===null||d===void 0||d.update({stoppedDetails:u}))}),this.collocationThread(u),c("doUpdateThreads")}collocationThread(h){var u;const{currentThread:c}=this;let E=c&&c.raw.id;h&&!h.preserveFocusHint&&h.threadId&&(E=h.threadId),this.currentThread=typeof E=="number"&&this._threads.get(E)||this._threads.values().next().value,((u=this.currentThread)===null||u===void 0?void 0:u.raw.id)!==E&&this.fireDidChange()}async updateCurrentThread(h){h?(this.currentThread=h,this._onCurrentThreadChange.fire(this.currentThread)):(this.currentThread=void 0,this._onCurrentThreadChange.fire(void 0))}async collectPausedThread(h){const u=await this.rawFetchThreads(h?.threadId);if(u.length===0)return new Map;const c=h.threadId&&this._multipleThreadPaused.has(h.threadId)?this._multipleThreadPaused.get(h.threadId):new s.DebugThread(this),E={raw:u[0]};return h&&(h.allThreadsStopped||h.threadId===u[0].id)&&(E.stoppedDetails=h),c&&(c.update(E),await this.rawFetchFrames(c),this._multipleThreadPaused.set(c.raw.id,c)),this._multipleThreadPaused}async updateCurrentThreadFramesOnFocus(){await this.rawFetchFrames(this.currentThread),this._onDidChangeCallStack.fire();const h=this.workbenchEditorService.currentEditor,u=c=>{this.stoppedDetails&&!this.stoppedDetails.preserveFocusHint&&(this.currentThread.currentFrame=c)};if(this.currentThread&&!this.currentFrame){const c=this.currentThread.frames.filter(E=>E&&E.source&&E.source.raw.presentationHint!=="deemphasize");if(c.length===0)return;if(h){const E=h.monacoEditor.getModel();if(E){const f=o.URI.parse(E.uri.toString()),d=c.filter(y=>y.source.uri.toString()===f.toString());d.length>0?u(d[0]):u(c[0])}}else u(c[0])}}async rawFetchFrames(h){!h||h.frameCount||(this.capabilities.supportsDelayedStackTraceLoading?(await h.rawFetchFrames(1),await h.rawFetchFrames(19)):await h.rawFetchFrames())}async terminate(h){if(this.initialized=!0,this.cancelAllRequests(),this.lifecycleManagedByParent&&this.parentSession){await this.parentSession.terminate(h);return}!this.terminated&&this.capabilities.supportsTerminateRequest&&this.configuration.request==="launch"?(this.terminated=!0,this.sendRequest("terminate",{restart:h}),await this.exited(1e3)||await this.disconnect(h)):await this.disconnect(h)}async disconnect(h){try{this.lifecycleManagedByParent&&this.parentSession?this.parentSession.disconnect(h):this.sendRequest("disconnect",{restart:h})}catch(c){this.fireExited(c);return}finally{this._onDidExitAdapter.fire(),this.onStateChange()}const u=500;await this.exited(u)||this.fireExited(new Error(`timeout after ${u} ms`))}updateCapabilities(h){Object.assign(this._capabilities,h)}fireExited(h){this.connection.fire("exited",{reason:h})}exited(h){return Promise.race([this.exitDeferred.promise.then(()=>!0,()=>!1),new Promise(u=>{setTimeout(u,h,!1)})])}async restart(h){return this.cancelAllRequests(),this.capabilities.supportsRestartRequest?(this.terminated=!1,this.lifecycleManagedByParent&&this.parentSession?await this.parentSession.restart({arguments:this.parentSession.configuration}):await this.sendRequest("restart",h),!0):!1}dispose(){this.toDispose.dispose()}async evaluate(h,u){var c;this.updateDeffered&&await((c=this.updateDeffered)===null||c===void 0?void 0:c.promise);const E=this.currentFrame&&this.currentFrame.raw.id;return(await this.sendRequest("evaluate",{expression:h,frameId:E,context:u})).body}async variables(h,u="named"){return(await this.sendRequest("variables",{variablesReference:h,filter:u})).body}async goto(h){if(this.capabilities.supportsGotoTargetsRequest)return await this.sendRequest("goto",h)}async exceptionInfo(h){return this.capabilities.supportsExceptionInfoRequest?this.sendRequest("exceptionInfo",h):Promise.reject(new Error("exceptionInfo not supported"))}async cancel(h){return this.sendRequest("cancel",{progressId:h})}async setVariableValue(h){if(this.capabilities.supportsSetVariable){const u=await this.sendRequest("setVariable",h);return this._onVariableChange.fire(),u}}async breakpointLocations(h,u){var c;const E=await this.toSource(h),d=(((c=(await this.sendRequest("breakpointLocations",{source:E.raw,line:u})).body)===null||c===void 0?void 0:c.breakpoints)||[]).map(y=>({lineNumber:y.line,column:y.column||1}));return Object.values(d.reduce((y,b)=>({...y,[`${b.lineNumber}:${b.column}`]:b}),{}))}async sendRequest(h,u,c){var E,f,d;if(!this._capabilities.supportsTerminateRequest&&h==="terminate"||!this._capabilities.supportsCompletionsRequest&&h==="completions"||!this._capabilities.supportsTerminateThreadsRequest&&h==="terminateThreads")throw new Error(`debug: ${h} not supported`);let y;["continue","next","stepIn","stepOut","threads"].some(b=>h===b)&&this.handleCancellation((E=this.currentThread)===null||E===void 0?void 0:E.raw.id),["stackTrace","scopes","variables","completions","threads"].some(b=>h===b)&&(y=!((f=this.currentThread)===null||f===void 0)&&f.raw.id?this.getNewCancellationToken((d=this.currentThread)===null||d===void 0?void 0:d.raw.id,c):void 0);try{return await this.connection.sendRequest(h,u,this.configuration,y)}finally{this._onRequest.fire(h)}}async takeCommand(h){return new Promise(u=>{const c=this.onRequest(E=>{E===h&&(c.dispose(),u())})})}sendCustomRequest(h,u){return this.connection.sendCustomRequest(h,u)}on(h,u){return this.connection.on(h,u)}get onDidCustomEvent(){return this.connection.onDidCustomEvent}hasSeparateRepl(){return!this.parentSession||this.options.repl!=="mergeWithParent"}reportTime(h,u){return this.sessionManager.reportTime(h,u)}getNewCancellationToken(h,u){const c=new l.CancellationTokenSource(u),E=this.cancellationMap.get(h)||[];return E.push(c),this.cancellationMap.set(h,E),c.token}cancelAllRequests(){this.cancellationMap.forEach(h=>h.forEach(u=>u.cancel())),this.cancellationMap.clear()}handleCancellation(h){if(h){const u=this.cancellationMap.get(h);this.cancellationMap.delete(h),u&&u.forEach(c=>c.cancel())}else this.cancelAllRequests()}getDebugProtocolBreakpoint(h){const u=this.breakpointManager.getBreakpoints().find(c=>c.id===h);if(u){const c=u.status.get(this.id);return{id:c?.id,verified:!!c?.verified,message:c?.message,source:c?.source,line:c?.line,column:c?.column,endLine:c?.endLine,endColumn:c?.endColumn,instructionReference:c?.instructionReference,offset:c?.offset}}}currentEditor(){var h;return(h=this.getModel())===null||h===void 0?void 0:h.getEditor()}getModel(){return this.modelManager.model}async readMemory(h,u,c){return this.capabilities.supportsReadMemoryRequest?await this.sendRequest("readMemory",{count:c,memoryReference:h,offset:u}):Promise.resolve(void 0)}async writeMemory(h,u,c,E){return this.capabilities.supportsWriteMemoryRequest?await this.sendRequest("writeMemory",{memoryReference:h,offset:u,allowPartial:E,data:c}):Promise.resolve(void 0)}}t.DebugSession=g},5905:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSnippet=t.CharWidthReader=t.DEFAULT_WORD_REGEXP=t.USUAL_WORD_SEPARATORS=void 0,t.isExtensionHostDebugging=l,t.matchAll=_,t.isRemoteAttach=v;const n=e(41869),r=e(57711),{equalsIgnoreCase:o}=n.strings;function l(g){return g.type&&o(g.type==="vslsShare"?g.adapterProxy.configuration.type:g.type,"extensionhost")}function _(g,a){let h;const u=[];for(;(h=a.exec(g))!==null;)u.push(h);return u}function v(g){if(g.request==="attach"){const a={node:"address",java:"hostName",go:"host",cppdbg:"miDebuggerServerAddress",python:"host"},{type:h}=g,u=g[a[h]];return u?!["localhost","0.0.0.0","127.0.0.1","::1"].includes(u):!0}return!1}t.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function m(g=""){let a="(-?\\d*\\.\\d\\w*)|([^";for(const h of t.USUAL_WORD_SEPARATORS)g.indexOf(h)>=0||(a+="\\"+h);return a+="\\s]+)",new RegExp(a,"g")}t.DEFAULT_WORD_REGEXP=m();class p{static getInstance(){return p._INSTANCE||(p._INSTANCE=new p),p._INSTANCE}constructor(){this._cache=new Map,this._canvas=document.createElement("canvas")}getCharWidth(a,h){const u=a+h;if(this._cache.has(u))return this._cache.get(u);const c=this._canvas.getContext("2d");c.font=h;const f=c.measureText(a).width;return this._cache.set(u,f),f}}t.CharWidthReader=p,p._INSTANCE=null;const s=g=>{const a=new RegExp(/^\^\"(.*)\"/gm),h=new r.SnippetParser;return new RegExp(/\${\d+:(.*)/).test(g)||a.test(g)?h.parse(g).toString().replace(a,"$1"):g};t.parseSnippet=s},17475:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointWidget=t.TopStackType=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(43718),v=r.__importStar(e(20868)),m=e(64582),p=e(97319),s=e(4983),g=e(27562);var a;(function(u){u[u.exception=0]="exception",u[u.debugger=1]="debugger"})(a||(t.TopStackType=a={}));let h=n=class extends _.Disposable{constructor(){super(),this.breakpointWidgetInputFocus=s.CONTEXT_BREAKPOINT_INPUT_FOCUSED.bind(this.contextKeyService)}get position(){return this._position}get values(){var c;return(c=this.zone)===null||c===void 0?void 0:c.values}get breakpointType(){var c;return(c=this.zone)===null||c===void 0?void 0:c.breakpointType}show(c,E,f="condition"){this.dispose(),this._position=c,this.addDispose(this.zone=this.injector.get(g.DebugBreakpointZoneWidget,[this.editor,{...E},f])),this.addDispose(this.zone.onDidChangeBreakpoint(({context:d,value:y})=>{E&&(E[d]=y)})),this.addDispose(this.zone.onFocus(()=>{this.breakpointWidgetInputFocus.set(!0)})),this.addDispose(this.zone.onBlur(()=>{this.breakpointWidgetInputFocus.set(!1)})),this.addDispose(this.zone.onDispose(()=>{this._position=void 0,this.breakpointWidgetInputFocus.set(!1)})),this.zone.show(v.positionToRange(c),n.LINE_HEIGHT_NUMBER)}hide(){var c;(c=this.zone)===null||c===void 0||c.hide()}};t.DebugBreakpointWidget=h,h.LINE_HEIGHT_NUMBER=2,r.__decorate([(0,o.Autowired)(m.DebugEditor),r.__metadata("design:type",Object)],h.prototype,"editor",void 0),r.__decorate([(0,o.Autowired)(p.DebugBreakpointsService),r.__metadata("design:type",p.DebugBreakpointsService)],h.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,o.Autowired)(l.IContextKeyService),r.__metadata("design:type",Object)],h.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),t.DebugBreakpointWidget=h=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],h)},27562:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointZoneWidget=void 0;const r=e(85608),o=r.__importDefault(e(14041)),l=r.__importDefault(e(25873)),_=e(76003),v=e(97267),m=e(41869),p=e(43718),s=e(20303),g=e(52416),a=e(31324),h=e(64582),u=e(97319),c=r.__importDefault(e(55797));let E=n=class extends s.ZoneWidget{_fillContainer(d){}get values(){return{...this.contexts,[this.context]:this.input&&this.input.monacoEditor.getValue()||void 0}}get breakpointType(){return this.context}constructor(d,y={},b="condition"){super(d),this.editor=d,this.contexts=y,this.context=b,this._onDidChangeBreakpoint=new p.Emitter,this.onDidChangeBreakpoint=this._onDidChangeBreakpoint.event,this._onFocus=new p.Emitter,this.onFocus=this._onFocus.event,this._onBlur=new p.Emitter,this.onBlur=this._onBlur.event,this.inputFocusHandler=()=>{this._onFocus.fire()},this.inputBlurHandler=()=>{this._onBlur.fire()},this.selectContextHandler=A=>{this.input&&(this.contexts[this.context]=this.input.monacoEditor.getValue()||void 0),this.context=A,this.setInputMode(),this.render()},this._wrapper=document.createElement("div"),this._selection=document.createElement("div"),this._input=document.createElement("div"),this._container.appendChild(this._wrapper),this._wrapper.appendChild(this._selection),this._wrapper.appendChild(this._input),l.default.createRoot(this._input).render(o.default.createElement(o.default.Fragment,null))}hide(){this.input&&(this.input.dispose(),this.input=void 0),super.dispose()}show(d,y){super.show(d,y),this.debugBreakpointsService.createBreakpointInput(this._input).then(b=>{this.input=b;const{monacoEditor:A}=this.input;this.setInputMode(),this.addDispose(A.onDidBlurEditorWidget(()=>{this.inputBlurHandler()})),this.addDispose(A.onDidFocusEditorWidget(()=>{this.inputFocusHandler()})),this.addDispose(A.onDidChangeModelContent(S=>{if(!this.input)return;A.getValue().length===0?this.ensureRenderPlaceholder():this.clearPlaceholder();const I=A.getModel().getLineCount();this._relayout(I+1)})),this.syncPreContent()})}createDecorations(){this.input&&this.input.monacoEditor.getValue().length===0&&this.input.monacoEditor.deltaDecorations([],[{range:{startLineNumber:1,endLineNumber:0,startColumn:0,endColumn:1},options:{description:"debug-breakpoint-zone-widget",afterContentClassName:c.default.input_placeholder}}])}renderOption(d,y){return o.default.createElement(v.Option,{value:d},y)}setInputMode(){var d,y;const b=(d=this.editor.getModel())===null||d===void 0?void 0:d.getLanguageId(),A=(y=this.input)===null||y===void 0?void 0:y.monacoEditor.getModel();A&&b&&A.setLanguage(this.context==="logMessage"?"plaintext":b)}renderPlaceholder(){if(!this.input)return;this.clearPlaceholder();const d=`'${this.placeholder}' !important`;this.cssRenderDisposable=this.cssManager.addClass(n.INPUT_PLACEHOLDER_AFTER,{content:d})}ensureRenderPlaceholder(){this.input&&(this.createDecorations(),this.renderPlaceholder())}syncPreContent(){if(this.input){this.input.focus();const d=this.contexts[this.context]||"";this.input.monacoEditor.setValue(d)}}clearPlaceholder(){this.cssRenderDisposable&&(this.cssRenderDisposable.dispose(),this.cssRenderDisposable=void 0)}applyClass(){if(this._wrapper.className=c.default.debug_breakpoint_wrapper,this._selection.className=c.default.debug_breakpoint_selected,this._input.className=c.default.debug_breakpoint_input,!this.editor.getModel())return;const y=this.editor.getOption(a.EditorOption.lineHeight),b=this.editor.getOption(a.EditorOption.fontSize),A=y-b;this._input.style.marginTop=A+"px"}applyStyle(){this.syncPreContent(),l.default.createRoot(this._selection).render(o.default.createElement(v.Select,{value:this.context,selectedRenderer:()=>o.default.createElement("span",{className:"kt-select-option"},this.getContextToLocalize(this.context)),onChange:this.selectContextHandler},this.renderOption("condition",this.getContextToLocalize("condition")),this.renderOption("hitCondition",this.getContextToLocalize("hitCondition")),this.renderOption("logMessage",this.getContextToLocalize("logMessage"))))}getContextToLocalize(d){switch(d){case"logMessage":return(0,p.localize)("debug.expression.logMessage");case"hitCondition":return(0,p.localize)("debug.expression.hitCondition");default:return(0,p.localize)("debug.expression.condition")}}get placeholder(){switch(this.context){case"logMessage":return(0,p.localize)("debug.expression.log.placeholder");case"hitCondition":return(0,p.localize)("debug.expression.hit.placeholder");default:return(0,p.localize)("debug.expression.condition.placeholder")}}};t.DebugBreakpointZoneWidget=E,E.INPUT_PLACEHOLDER_AFTER=c.default.input_placeholder+"::after",r.__decorate([(0,_.Autowired)(u.DebugBreakpointsService),r.__metadata("design:type",u.DebugBreakpointsService)],E.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,_.Autowired)(m.PreferenceService),r.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),r.__decorate([(0,_.Autowired)(g.ICSSStyleService),r.__metadata("design:type",Object)],E.prototype,"cssManager",void 0),t.DebugBreakpointZoneWidget=E=n=r.__decorate([(0,_.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object,Object,String])],E)},52943:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugEditorContribution=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(54414),v=e(51553),m=r.__importStar(e(20868)),p=e(79865),s=e(44781),g=e(38390),a=e(17280),h=e(84303),u=e(38029),c=e(16170),E=e(64582),f=e(5905),d="inlinevaluedecoration",y=100,b=150,A=500,{flatten:S}=l.arrays;class D{constructor(O,x){this.column=O,this.text=x}}function I(M,O,x=1073741824){return O.length>b&&(O=O.substr(0,b)+"..."),{range:{startLineNumber:M,endLineNumber:M,startColumn:x,endColumn:x},renderOptions:{after:{contentText:O,backgroundColor:"rgba(255, 200, 0, 0.2)",margin:"10px"},dark:{after:{color:"rgba(255, 255, 255, 0.5)"}},light:{after:{color:"rgba(0, 0, 0, 0.5)"}}}}}function w(M,O,x,k){const F=new Map;for(const U of M)if(F.set(U.name,U.value),F.size>=y)break;const L=new Map;F.forEach((U,W)=>{const j=k.get(W);if(j)for(const Q of j)O.containsPosition(new l.Position(Q,0))&&(L.has(Q)||L.set(Q,[]),L.get(Q).indexOf(W)===-1&&L.get(Q).push(W))});const N=[];return L.forEach((U,W)=>{const j=U.sort((Q,G)=>{const Z=x.getLineContent(W);return Z.indexOf(Q)-Z.indexOf(G)}).map(Q=>`${Q} = ${F.get(Q)}`).join(", ");N.push(I(W,j))}),N}function T(M){const O=new Map;if(!M)return O;for(let x=1,k=M.getLineCount();x<=k;++x){const F=M.getLineContent(x);if(F.length>A)continue;M.tokenization.forceTokenization(x);const L=M.tokenization.getLineTokens(x);for(let N=0,U=L.getCount();N<U;N++)if(L.getStandardTokenType(N)===g.StandardTokenType.Other){f.DEFAULT_WORD_REGEXP.lastIndex=0;const j=L.getStartOffset(N),Q=L.getEndOffset(N),G=F.substring(j,Q),Z=f.DEFAULT_WORD_REGEXP.exec(G);if(Z){const $=Z[0];O.has($)||O.set($,[]),O.get($).push(x)}}}return O}let R=n=class{constructor(O){this.editor=O,this.disposer=new l.Disposable,this.editorDisposer=new l.Disposable}contribute(O){return this.disposer.addDispose(this.debugSessionManager.onDidChangeActiveDebugSession(()=>{const x=this.debugSessionManager.currentSession;x&&(this.editorDisposer.addDispose(x.onDidChange(async()=>{var k,F;this.setHoverEnabled(O,x.state===E.DebugState.Running);const L=(k=x.currentThread)===null||k===void 0?void 0:k.currentFrame;L&&O.currentUri&&!((F=L.source)===null||F===void 0)&&F.uri.isEqual(O.currentUri)&&await this.toggleExceptionWidget()})),this.editorDisposer.addDispose(x.onDidExitAdapter(()=>{this.setHoverEnabled(O,!0)})),this.editorDisposer.addDispose(this.editorService.onActiveResourceChange(k=>{var F;k?.uri.toString()===((F=x.getModel())===null||F===void 0?void 0:F.uri.toString())?this.setHoverEnabled(O):this.setHoverEnabled(O,!0)})),this.disposer.addDispose([l.Event.any(x.onDidChangeCallStack,x.onDidStop)(async()=>{await this.directRunUpdateInlineValueDecorations(O)}),x.onDidExitAdapter(()=>{this.removeInlineValuesScheduler(O).schedule(),this.editorDisposer.dispose()})]),this.disposer.addDispose(x.onDidChangeState(k=>{k!==E.DebugState.Stopped&&this.toggleExceptionWidget()})),this.disposer.addDispose(x),this.registerEditorListener(O))})),this.disposer.addDispose(this.debugSessionManager.onDidDestroyDebugSession(()=>{this.closeExceptionWidget()})),this.disposer.addDispose(this.editorDisposer),this.toggleExceptionWidget(),this.disposer}registerEditorListener(O){this.editorDisposer.addDispose(O.monacoEditor.onKeyDown(async x=>{var k,F,L,N,U;if(((L=(F=(k=this.debugSessionManager.currentSession)===null||k===void 0?void 0:k.currentFrame)===null||F===void 0?void 0:F.source)===null||L===void 0?void 0:L.uri.toString())===((N=O.currentUri)===null||N===void 0?void 0:N.toString())&&x.keyCode===m.KeyCode.Alt){this.setHoverEnabled(O,!0),(U=this.debugModelManager.model)===null||U===void 0||U.getDebugHoverWidget().hide();const W=O.monacoEditor.onKeyUp(async j=>{var Q;j.keyCode===m.KeyCode.Alt&&(this.setHoverEnabled(O,!1),(Q=this.debugModelManager.model)===null||Q===void 0||Q.getDebugHoverWidget().show(),W.dispose())})}})),this.editorDisposer.addDispose(O.monacoEditor.onDidChangeModelContent(async()=>{n.MEMOIZER.clear(),await this.directRunUpdateInlineValueDecorations(O)})),this.editorDisposer.addDispose(O.monacoEditor.onDidChangeModel(async()=>{this.toggleExceptionWidget(),await this.directRunUpdateInlineValueDecorations(O)}))}registerDecorationType(){this.overrideServicesRegistry.getRegisteredService(l.ServiceNames.CODE_EDITOR_SERVICE).registerDecorationType("inline-value-decoration",d,{})}setHoverEnabled(O,x=!this.debugContextKey.contextInDebugMode.get()){O.monacoEditor.updateOptions({hover:{enabled:x}})}async directRunUpdateInlineValueDecorations(O){var x;const k=(x=this.debugSessionManager.currentSession)===null||x===void 0?void 0:x.currentFrame;k&&(n.MEMOIZER.clear(),await this.updateInlineValueDecorations(k,O))}removeInlineValuesScheduler(O){return new l.RunOnceScheduler(()=>O.monacoEditor.removeDecorationsByType(d),100)}async updateInlineValueDecorations(O,x){var k;if(!x)return;const F="{0} = {1}",L=", ",N=x.monacoEditor.getModel();if(!this.preferenceService.get("debug.inline.values")||!N||!O||N.uri.toString()!==((k=O.source)===null||k===void 0?void 0:k.uri.toString())){this.removeInlineValuesScheduler(x).isScheduled()||this.removeInlineValuesScheduler(x).schedule();return}this.removeInlineValuesScheduler(x).cancel();let U;if(p.languageFeaturesService.inlineValuesProvider.has(N)){const W=async(H,K)=>{const Y=await O.getMostSpecificScopes(O.range()),X=K?H:H.toLowerCase();for(const re of Y){await re.ensureLoaded();const he=(re.children||[]).find(me=>K?me.name===X:me.name.toLowerCase()===X);if(he)return he.value}},j={frameId:O.raw.id,stoppedLocation:(()=>{const H=O.range();return new s.Range(H.startLineNumber,H.startColumn+1,H.endLineNumber,H.endColumn+1)})()},Q=new l.CancellationTokenSource().token,G=x.monacoEditor.getVisibleRanges(),Z=p.languageFeaturesService.inlineValuesProvider.ordered(N).reverse();U=[];const $=new Map,V=S(Z.map(H=>G.map(K=>Promise.resolve(H.provideInlineValues(N,K,j,Q)).then(async Y=>{if(Y)for(const X of Y){let re;switch(X.type){case"text":re=X.text;break;case"variable":{let oe=X.variableName;oe||(oe=N.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1));const he=await W(oe,X.caseSensitiveLookup);he&&(re=l.strings.format(F,oe,he));break}case"expression":{let oe=X.expression;if(oe||(oe=N.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1)),oe){const he=new c.DebugWatchRoot(O.thread.session),me=new c.DebugWatchNode(O.thread.session,oe,he);await me.evaluate(oe),me.available&&(re=l.strings.format(F,oe,me.description))}break}}if(re){const oe=X.range.startLineNumber;let he=$.get(oe);he||(he=[],$.set(oe,he)),he.some(me=>me.text===re)||he.push(new D(X.range.startColumn,re))}}},Y=>{(0,l.onUnexpectedExternalError)(Y)}))));await Promise.all(V),$.forEach((H,K)=>{if(H.length>0){H=H.sort((X,re)=>X.column-re.column);const Y=H.map(X=>X.text).join(L);U.push(I(K,Y))}})}else{const W=await O.getMostSpecificScopes(O.range());U=(await Promise.all(W.map(async Q=>{await Q.ensureLoaded();const G=Q.children||[],Z=O.range(),$=Q.range();let V=new s.Range(0,0,Z.startLineNumber,Z.startColumn);return $&&(V=V.setStartPosition($.startLineNumber,$.startColumn)),w(G,V,N,T(x?.monacoEditor.getModel()))}))).reduce((Q,G)=>Q.concat(G),[])}x.monacoEditor.setDecorationsByType("inline-value-decoration",d,U)}async toggleExceptionWidget(){var O,x;const k=this.debugSessionManager.currentSession;if(!k){this.closeExceptionWidget();return}const{currentThread:F}=k;if(!F){this.closeExceptionWidget();return}const L=F.frames.find(U=>!!(U&&U.source&&U.source.available&&U.source.presentationHint!=="deemphasize"));if(!L){this.closeExceptionWidget();return}const N=(O=this.editor.currentUri)===null||O===void 0?void 0:O.isEqual((x=L.source)===null||x===void 0?void 0:x.uri);if(this.debugExceptionWidget&&!N)this.closeExceptionWidget();else if(N){const U=await F?.fetchExceptionInfo();U&&this.showExceptionWidget(U,k,L.range().startLineNumber,L.range().startColumn)}}showExceptionWidget(O,x,k,F){this.debugExceptionWidget&&this.debugExceptionWidget.dispose();const L=x?.currentEditor();this.debugExceptionWidget=this.injector.get(h.DebugExceptionWidget,[L,O]),this.debugExceptionWidget.show(m.positionToRange({lineNumber:k,column:F}),10),this.debugExceptionWidget.focus(),L?.revealRangeInCenter({startLineNumber:k,startColumn:F,endLineNumber:k,endColumn:F}),this.debugContextKey.contextExceptionWidgetVisible.set(!0)}closeExceptionWidget(){this.debugExceptionWidget&&(this.debugContextKey.contextExceptionWidgetVisible.set(!1),this.debugExceptionWidget.dispose(),this.debugExceptionWidget=void 0)}};t.DebugEditorContribution=R,R.MEMOIZER=(0,l.createMemoizer)(),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],R.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(l.IContextKeyService),r.__metadata("design:type",Object)],R.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(E.IDebugModelManager),r.__metadata("design:type",Object)],R.prototype,"debugModelManager",void 0),r.__decorate([(0,o.Autowired)(E.IDebugSessionManager),r.__metadata("design:type",u.DebugSessionManager)],R.prototype,"debugSessionManager",void 0),r.__decorate([(0,o.Autowired)(l.PreferenceService),r.__metadata("design:type",Object)],R.prototype,"preferenceService",void 0),r.__decorate([(0,o.Autowired)(l.MonacoOverrideServiceRegistry),r.__metadata("design:type",l.MonacoOverrideServiceRegistry)],R.prototype,"overrideServicesRegistry",void 0),r.__decorate([(0,o.Autowired)(_.WorkbenchEditorService),r.__metadata("design:type",v.WorkbenchEditorServiceImpl)],R.prototype,"editorService",void 0),r.__decorate([(0,o.Autowired)(a.DebugContextKey),r.__metadata("design:type",a.DebugContextKey)],R.prototype,"debugContextKey",void 0),t.DebugEditorContribution=R=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[Object])],R)},74257:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugExpressionProvider=void 0;const n=e(85608),r=e(76003),o=e(43718),l=n.__importStar(e(20868)),_=e(16885),{coalesce:v}=o.arrays;let m=class{async get(s,g){var a,h;let u,c;if(this.evaluatableExpressionService.hasEvaluatableExpressProvider(s)){const E=new o.CancellationTokenSource,f=this.evaluatableExpressionService.getSupportedEvaluatableExpressionProvider(s),d=new l.Position(g.startLineNumber,g.startColumn),y=f.map(A=>Promise.resolve(A.provideEvaluatableExpression(s,d,E.token)).then(S=>S,()=>{})),b=await Promise.all(y).then(v);b.length>0&&(u=(a=b[0])===null||a===void 0?void 0:a.expression,c=(h=b[0])===null||h===void 0?void 0:h.range,!u&&c&&(u=s.getLineContent(d.lineNumber).substring(c.startColumn-1,c.endColumn-1)))}else{const E=s.getLineContent(g.startLineNumber),{start:f,end:d}=this.getExactExpressionStartAndEnd(E,g.startColumn,g.endColumn);u=E.substring(f-1,d)}return u}getExactExpressionStartAndEnd(s,g,a){let h,u=0;const c=/([^()[\]{}<>\s+\-/%~#^;=|,`!]|->)+/g;let E=null;for(;E=c.exec(s);){const f=E.index+1,d=f+E[0].length;if(f<=g&&d>=a){h=E[0],u=f;break}}if(h){const f=/\w+/g;let d=null;for(;(d=f.exec(h))&&!(d.index+1+u+d[0].length>=a););d&&(h=h.substring(0,f.lastIndex))}return h?{start:u,end:u+h.length-1}:{start:0,end:0}}};t.DebugExpressionProvider=m,n.__decorate([(0,r.Autowired)(_.IEvaluatableExpressionService),n.__metadata("design:type",Object)],m.prototype,"evaluatableExpressionService",void 0),t.DebugExpressionProvider=m=n.__decorate([(0,r.Injectable)()],m)},3367:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverModel=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(41869),v=e(98650);let m=n=class extends l.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new _.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(l.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugHoverModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugHoverModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},23217:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverSource=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(64582),_=e(38029),v=e(98650);let m=class{constructor(){this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event}dispose(){this._expression=void 0}get expression(){return this._expression}clearEvaluate(){this.onDidChangeEmitter.fire(void 0)}async evaluate(s){const g=await this.doEvaluate(s);return this._expression=g,this.onDidChangeEmitter.fire(g),g}async doEvaluate(s){const{currentSession:g}=this.sessions;if(g){if(g.capabilities.supportsEvaluateForHovers){const a=new v.DebugHoverVariableRoot(s,g);return await a.evaluate("hover"),a.available&&a||void 0}return this.findVariable(s.split(".").map(a=>a.trim()).filter(a=>!!a))}}async findVariable(s){const{currentFrame:g}=this.sessions;if(!g)return;let a;const h=await g.getScopes();for(const u of h){const c=await this.doFindVariable(u,s);if(!a)a=c;else if(c&&c.value!==a.value)return}return a}async doFindVariable(s,g){await s.ensureLoaded();const a=s.children,h=[];if(a){for(const u of a)(u instanceof v.DebugVariableContainer||u instanceof v.DebugVariable)&&u.name===g[0]&&h.push(u);if(h.length===1)return g.length===1?h[0]:this.doFindVariable(h[0],g.slice(1))}}};t.DebugHoverSource=m,n.__decorate([(0,r.Autowired)(l.IDebugSessionManager),n.__metadata("design:type",_.DebugSessionManager)],m.prototype,"sessions",void 0),t.DebugHoverSource=m=n.__decorate([(0,r.Injectable)()],m)},85322:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverTreeModelService=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(41869),v=e(98650),m=r.__importDefault(e(57259)),p=e(3367),s=e(23217),{Path:g}=_.path;let a=n=class{constructor(){this._changeEventDispatchQueue=[],this.selectedDecoration=new l.Decoration(m.default.mod_selected),this.focusedDecoration=new l.Decoration(m.default.mod_focused),this.loadingDecoration=new l.Decoration(m.default.mod_loading),this._selectedNodes=[],this.onDidRefreshedEmitter=new _.Emitter,this.onDidUpdateTreeModelOrVariableEmitter=new _.Emitter,this.disposableCollection=new _.DisposableCollection,this.activeNodeDecoration=(u,c=!0)=>{if(this.preContextMenuFocusedNode&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode),this.preContextMenuFocusedNode=null),u){if(this.selectedNodes.length>0)for(const E of this.selectedDecoration.appliedTargets.keys())this.selectedDecoration.removeTarget(E);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes=[u],c&&this.treeModel.dispatchChange()}},this.activeNodeFocusedDecoration=(u,c=!1)=>{this.focusedNode!==u&&(c?(this.preContextMenuFocusedNode?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode)):this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.preContextMenuFocusedNode=u):this.focusedNode&&(this.preContextMenuFocusedNode=null,this.focusedDecoration.removeTarget(this.focusedNode)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes.push(u))),this.treeModel.dispatchChange()},this.enactiveNodeDecoration=()=>{this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this.treeModel.dispatchChange()),this._focusedNode=void 0},this.handleTreeBlur=()=>{this.enactiveNodeDecoration()},this.handleTwistierClick=u=>{v.ExpressionContainer.is(u)?(this.activeNodeDecoration(u,!1),this.toggleDirectory(u)):this.activeNodeDecoration(u)},this.toggleDirectory=async u=>{u.expanded?this.treeHandle.collapseNode(u):this.treeHandle.expandNode(u)},this.flushEventQueue=()=>{let u;if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.length===0)return;this._changeEventDispatchQueue.sort((E,f)=>{const d=g.pathDepth(E),y=g.pathDepth(f);return d-y});const c=[this._changeEventDispatchQueue[0]];for(const E of this._changeEventDispatchQueue)c.some(f=>E.indexOf(f)===0)||c.push(E);return u=(0,_.pSeries)(c.map(E=>async()=>{var f;const d=(f=this.treeModel.root)===null||f===void 0?void 0:f.watchEvents.get(E);return d&&typeof d.callback=="function"&&await d.callback({type:l.WatchEvent.Changed,path:E}),null})),this._changeEventDispatchQueue=[],u},this.debugHoverSource.onDidChange(async u=>{if(!u){this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:void 0,variable:void 0});return}u instanceof v.DebugVariable?(this.dispose(),this.onDidUpdateTreeModelOrVariableEmitter.fire({variable:u})):(await this.initTreeModel(u),this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:this.treeModel}))})}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}get onDidUpdateTreeModelOrVariable(){return this.onDidUpdateTreeModelOrVariableEmitter.event}get flushEventQueuePromise(){return this.flushEventQueueDeferred&&this.flushEventQueueDeferred.promise}get treeHandle(){return this._debugHoverTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}dispose(){this.disposableCollection.disposed||this.disposableCollection.dispose()}listenTreeViewChange(){var u,c;this.dispose(),this.disposableCollection.push((u=this.treeModel)===null||u===void 0?void 0:u.root.watcher.on(l.TreeNodeEvent.WillResolveChildren,E=>{this.loadingDecoration.addTarget(E)})),this.disposableCollection.push((c=this.treeModel)===null||c===void 0?void 0:c.root.watcher.on(l.TreeNodeEvent.DidResolveChildren,E=>{this.loadingDecoration.removeTarget(E)}))}async initTreeModel(u){if(u)return this._treeModel=this.injector.get(p.DebugHoverModel,[u]),this.initDecorations(u),this.listenTreeViewChange(),this._treeModel}initDecorations(u){this._decorations=new l.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.loadingDecoration)}removeNodeDecoration(){this.decorations&&(this.decorations.removeDecoration(this.selectedDecoration),this.decorations.removeDecoration(this.focusedDecoration))}handleTreeHandler(u){this._debugHoverTreeHandle=u}async refresh(u=this.treeModel.root){!v.ExpressionContainer.is(u)&&u.parent&&(u=u.parent),this.queueChangeEvent(u.path,()=>{this.onDidRefreshedEmitter.fire()})}queueChangeEvent(u,c){this.flushEventQueueDeferred||(this.flushEventQueueDeferred=new _.Deferred,clearTimeout(this._eventFlushTimeout),this._eventFlushTimeout=setTimeout(async()=>{var E;await this.flushEventQueue(),(E=this.flushEventQueueDeferred)===null||E===void 0||E.resolve(),this.flushEventQueueDeferred=null,c()},n.DEFAULT_FLUSH_FILE_EVENT_DELAY)),this._changeEventDispatchQueue.indexOf(u)===-1&&this._changeEventDispatchQueue.push(u)}};t.DebugHoverTreeModelService=a,a.DEFAULT_FLUSH_FILE_EVENT_DELAY=100,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],a.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(s.DebugHoverSource),r.__metadata("design:type",s.DebugHoverSource)],a.prototype,"debugHoverSource",void 0),t.DebugHoverTreeModelService=a=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],a)},65960:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverWidget=void 0;const r=e(85608),o=r.__importDefault(e(12784)),l=r.__importDefault(e(14041)),_=r.__importDefault(e(25873)),v=e(76003),m=e(41869),p=r.__importStar(e(20868)),s=e(62663),g=e(64582),a=e(38029),h=e(74257),u=e(23217),c=e(63940);let E=n=class{constructor(){this.toDispose=new m.DisposableCollection,this.allowEditorOverflow=!0,this.doSchedule=(0,o.default)(d=>d(),300),this.init()}init(){this.toDispose.pushAll([m.Disposable.create(()=>this.editor.removeContentWidget(this)),m.Disposable.create(()=>this.hide()),this.sessions.onDidChange(()=>{this.isEditorFrame()||this.hide()})]),this.renderView()}handleWindowWheel(d){d.stopPropagation()}getId(){return n.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.classList.add(n.ID)),this.domNode}getPosition(){var d;const y=this.options&&this.options.selection.getStartPosition(),b=y&&((d=this.editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition(y));return y&&b?{position:new p.Position(y.lineNumber,b.startColumn),preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.BELOW,s.monacoBrowser.editor.ContentWidgetPositionPreference.ABOVE]}:null}dispose(){this.toDispose.dispose()}show(d){this.schedule(()=>this.doShow(d),d&&d.immediate)}hide(d){this.schedule(()=>this.doHide(),d&&d.immediate)}schedule(d,y=!0){y?(this.doSchedule.cancel(),d()):this.doSchedule(d)}isEditorFrame(){const{currentFrame:d}=this.sessions;return!!d&&!!d.source&&!!this.editor.getModel()&&this.editor.getModel().uri.toString()===d.source.uri.toString()}doHide(){window.removeEventListener("mousewheel",this.handleWindowWheel,!0),this.getDomNode().contains(document.activeElement)&&this.editor.focus(),this.hoverSource.dispose(),this.hoverSource.clearEvaluate(),this.options=void 0,this.editor.removeContentWidget(this)}layoutContentWidget(){this.editor.layoutContentWidget(this)}renderView(){_.default.createRoot(this.getDomNode()).render(l.default.createElement(m.ConfigProvider,{value:this.configContext},l.default.createElement(c.DebugHoverView,null))),this.layoutContentWidget()}async doShow(d=this.options){if(!this.isEditorFrame()||!d||this.options&&this.options.selection.equalsRange(d.selection))return;this.options=d;const y=await this.expressionProvider.get(this.editor.getModel(),d.selection);y&&(this.hoverSource.clearEvaluate(),await this.hoverSource.evaluate(y)&&(this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_VARIABLES,"hover",y),this.editor.addContentWidget(this),window.addEventListener("mousewheel",this.handleWindowWheel,!0)))}};t.DebugHoverWidget=E,E.ID="debug-hover-widget",r.__decorate([(0,v.Autowired)(g.DebugEditor),r.__metadata("design:type",Object)],E.prototype,"editor",void 0),r.__decorate([(0,v.Autowired)(g.IDebugSessionManager),r.__metadata("design:type",a.DebugSessionManager)],E.prototype,"sessions",void 0),r.__decorate([(0,v.Autowired)(h.DebugExpressionProvider),r.__metadata("design:type",h.DebugExpressionProvider)],E.prototype,"expressionProvider",void 0),r.__decorate([(0,v.Autowired)(u.DebugHoverSource),r.__metadata("design:type",u.DebugHoverSource)],E.prototype,"hoverSource",void 0),r.__decorate([(0,v.Autowired)(m.AppConfig),r.__metadata("design:type",Object)],E.prototype,"configContext",void 0),r.__decorate([(0,v.Autowired)(m.IReporterService),r.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),t.DebugHoverWidget=E=n=r.__decorate([(0,v.Injectable)(),r.__metadata("design:paramtypes",[])],E)},63940:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(97267),_=e(41869),v=e(1149),m=e(28875),p=e(85322),s=n.__importDefault(e(94084)),g=()=>{const a=(0,_.useInjectable)(p.DebugHoverTreeModelService),h=(0,_.useInjectable)(v.LayoutViewSizeConfig),u=250,c=420,E=4,[f,d]=o.default.useState({}),[y,b]=o.default.useState(u),A=o.default.useRef(null);o.default.useEffect(()=>(a.onDidUpdateTreeModelOrVariable(async M=>{const{treeModel:O,variable:x}=M;O&&await O.ensureReady,d({treeModel:O,variable:x})}),S(),()=>{a.removeNodeDecoration()}),[]),o.default.useEffect(()=>{let M;return b(u),f.treeModel&&(M=f.treeModel.root.watcher.on(l.TreeNodeEvent.DidChangeExpansionState,()=>{var O,x;const k=Math.max(u,(((O=f.treeModel)===null||O===void 0?void 0:O.root.branchSize)||0)*22),F=(x=A.current)===null||x===void 0?void 0:x.getBoundingClientRect();if(F){const L=F.top,N=window.innerHeight-L-h.statusBarHeight-E;b(Math.min(N,k,c))}else b(Math.min(c,k))})),()=>{M?.dispose()}},[f.treeModel]);const S=async()=>{a.treeModel&&(await a.treeModel.ensureReady,d({treeModel:a.treeModel}))},D=M=>{a.handleTreeHandler({...M,getModel:()=>f?.treeModel,hasDirectFocus:()=>A.current===document.activeElement})},I=(M,O)=>{M.stopPropagation();const{handleTwistierClick:x}=a;O&&x(O)},w=!!f.treeModel&&!!f.treeModel.root.variablesReference,T=o.default.useCallback(M=>{const O=a.decorations.getDecorations(M.item);return o.default.createElement(m.DebugVariableRenderedNode,{item:M.item,itemType:M.itemType,decorations:O,onClick:I,onTwistierClick:I,defaultLeftPadding:0,leftPadding:4})},[f.treeModel]),R=()=>w?o.default.createElement("div",{className:s.default.debug_hover_content,tabIndex:-1,ref:A},o.default.createElement(l.RecycleTree,{height:y,itemHeight:m.DEBUG_VARIABLE_TREE_NODE_HEIGHT,onReady:D,model:f.treeModel,placeholder:()=>o.default.createElement("span",null),overflow:"auto"},T)):null;return o.default.createElement("div",{className:s.default.debug_hover},f.treeModel?o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,w&&s.default.has_complex_value),title:f.treeModel.root.name},f.treeModel.root.name):f.variable&&o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,w&&s.default.has_complex_value),title:f.variable.name},f.variable.value),R())};t.DebugHoverView=g},71569:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModelManager=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(54414),_=e(64582),v=e(99797),m=e(37499);let p=class extends o.Disposable{constructor(){super(),this.toDispose=new o.DisposableCollection,this._onMouseDown=new o.Emitter,this._onMouseMove=new o.Emitter,this._onMouseLeave=new o.Emitter,this._onMouseUp=new o.Emitter,this.onMouseDown=this._onMouseDown,this.onMouseMove=this._onMouseMove,this.onMouseLeave=this._onMouseLeave,this.onMouseUp=this._onMouseUp,this._onModelChanged=new o.Emitter,this.onModelChanged=this._onModelChanged.event,this.models=new Map}dispose(){for(const g of this.models.values())this.toDispose.pushAll(g);this.toDispose.dispose(),this.models.clear()}init(){this.editorCollection.onCodeEditorCreate(g=>this.push(g)),this.breakpointManager.onDidChangeBreakpoints(g=>{const{currentEditor:a}=this.editorService,h=a&&a.currentUri;h&&this.render(h),this.closeBreakpointIfAffected(g)})}get model(){const{currentEditor:g}=this.editorService,a=g&&g.currentUri;if(a){const h=this.models.get(a.toString());return h&&h[0]}}closeBreakpointIfAffected({affected:g,removed:a}){g.forEach(h=>{const u=this.models.get(h.toString());if(u)for(const c of u){const E=c.getBreakpointWidget(),f=E.position;if(!f)return;for(const d of a)d.raw.line===f.lineNumber&&E.dispose()}})}render(g){const a=this.models.get(g.toString());if(a)for(const h of a)h.render()}push(g){const a=g.monacoEditor;g.onRefOpen(u=>{const c=u.instance.uri.toString(),E=this.models.get(c)||[];let f=!1;if(E.length>0){for(const d of E)if(d.getEditor()._id===a._id){d.render(),f=!0;break}}if(!f){const d=u.instance.getMonacoModel(),y=this.debugModelFactory(a);E.push(y),this.models.set(c,E),d.onWillDispose(()=>{y.dispose(),this.models.delete(c)})}});const h=(u,c)=>{const E=a.getModel();if(!E)throw new Error("Not find model");this.handleMouseEvent(new o.URI(E.uri.toString()),u,c,a)};this.toDispose.push(a.onMouseMove(u=>h(_.DebugModelSupportedEventType.move,u))),this.toDispose.push(a.onMouseDown(u=>h(_.DebugModelSupportedEventType.down,u))),this.toDispose.push(a.onMouseLeave(u=>h(_.DebugModelSupportedEventType.leave,u))),this.toDispose.push(a.onContextMenu(u=>h(_.DebugModelSupportedEventType.contextMenu,u))),this.toDispose.push(a.onDidChangeModel(u=>this._onModelChanged.fire(u)))}resolve(g){const a=this.models.get(g.toString());if(a)return a}handleMouseEvent(g,a,h,u){const c=this.models.get(g.toString());if(!(!c||!this.debugConfigurationManager.canSetBreakpointsIn(c[0].getEditor().getModel()))){for(const f of c)if(f.getEditor().getId()===u.getId()){switch(a){case _.DebugModelSupportedEventType.contextMenu:f.onContextMenu(h);break;case _.DebugModelSupportedEventType.down:f.onMouseDown(h);break;case _.DebugModelSupportedEventType.leave:f.onMouseLeave(h);break;case _.DebugModelSupportedEventType.move:f.onMouseMove(h);break;default:break}break}}}};t.DebugModelManager=p,n.__decorate([(0,r.Autowired)(l.WorkbenchEditorService),n.__metadata("design:type",l.WorkbenchEditorService)],p.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(l.EditorCollectionService),n.__metadata("design:type",l.EditorCollectionService)],p.prototype,"editorCollection",void 0),n.__decorate([(0,r.Autowired)(_.DebugModelFactory),n.__metadata("design:type",Function)],p.prototype,"debugModelFactory",void 0),n.__decorate([(0,r.Autowired)(v.BreakpointManager),n.__metadata("design:type",v.BreakpointManager)],p.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(m.DebugConfigurationManager),n.__metadata("design:type",m.DebugConfigurationManager)],p.prototype,"debugConfigurationManager",void 0),t.DebugModelManager=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},91260:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModel=void 0;const r=e(85608),o=r.__importDefault(e(12784)),l=e(76003),_=e(41869),v=e(93899),m=e(43718),p=r.__importStar(e(20868)),s=e(62663),g=e(52416),a=e(64582),h=e(24395),u=e(26296),c=e(99797),E=e(38949),f=e(38029),d=e(97319),y=e(17475),b=e(65960),A=r.__importStar(e(26571));let S=n=class{static createContainer(w,T){return w.createChild([{token:h.DebugEditor,useValue:T},{token:b.DebugHoverWidget,useClass:b.DebugHoverWidget},{token:y.DebugBreakpointWidget,useClass:y.DebugBreakpointWidget},{token:a.IDebugModel,useClass:n}])}static createModel(w,T){return n.createContainer(w,T).get(a.IDebugModel)}get uri(){return this._uri}constructor(){this.toDispose=new m.DisposableCollection,this.frameDecorations=[],this.updatingDecorations=!1,this.breakpointDecorations=[],this.breakpointRanges=new Map,this.currentBreakpointDecorations=[],this.candidateDecorations=[],this.renderFrames=(0,o.default)((w=[])=>{var T;if(this.toDispose.disposed||((T=this.editor.getModel())===null||T===void 0?void 0:T.uri.toString())!==this._uri.toString())return;const R=this.createFrameDecorations().concat(w);this.frameDecorations=this.deltaDecorations(this.frameDecorations,R)},100),this.toggleBreakpoint=(w=this.position)=>{this.doToggleBreakpoint(w)},this.openBreakpointView=(w,T,R)=>{this.breakpointWidget.show(w,T,R)},this.closeBreakpointView=()=>{this.breakpointWidget.hide()},this.acceptBreakpoint=()=>{const{position:w,values:T}=this.breakpointWidget;if(this.reporterService.point(a.DEBUG_REPORT_NAME===null||a.DEBUG_REPORT_NAME===void 0?void 0:a.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,this.breakpointWidget.breakpointType),w&&T){const R=this.getBreakpoint(w);R?(R.raw.condition=T.condition,R.raw.hitCondition=T.hitCondition,R.raw.logMessage=T.logMessage,this.breakpointManager.updateBreakpoint(R)):this.breakpointManager.addBreakpoint(c.DebugBreakpoint.create(this._uri,{line:w.lineNumber,...T})),this.breakpointWidget.hide()}},this.hintDecorations=[],this.init()}async init(){const w=this.editor.getModel();let T;this._uri=new m.URI(w.uri.toString()),this.decorator=new E.DebugDecorator,this.toDispose.pushAll([this.breakpointWidget,this.editor.onKeyDown(R=>{R.code==="Escape"&&!R.altKey&&!R.shiftKey&&!R.metaKey?this.debugHoverWidget.hide({immediate:!0}):this.debugHoverWidget.hide({immediate:!1})}),this.editor.onDidChangeModelContent(()=>this.renderFrames()),this.debugSessionManager.onDidChange(()=>this.renderFrames()),this.debugBreakpointsService.onDidFocusedBreakpoints(({range:R})=>{this.preferenceService.getValid("debug.breakpoint.editorHint",!0)&&(this.renderFrames([{options:A.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION,range:R}]),T&&clearTimeout(T),T=window.setTimeout(()=>{this.renderFrames(),clearTimeout(T)},300))}),this.editor.getModel().onDidChangeContent(()=>this.updateBreakpoints()),this.editor.onDidChangeModel(()=>{this.closeBreakpointView()})]),this.renderFrames(),this.render()}dispose(){this.toDispose.dispose()}get position(){return this._position||this.editor.getPosition()}get breakpoint(){return this.getBreakpoint()}getBreakpoint(w){return this.breakpointManager.getBreakpoint(this._uri,w?w.lineNumber:void 0)}createFrameDecorations(){var w;const T=[],{currentFrame:R,topFrame:M}=this.debugSessionManager;if(!R||!R.source||R.source.uri.toString()!==((w=this.editor.getModel())===null||w===void 0?void 0:w.uri.toString()))return T;const O=new p.Range(R.raw.line,R.raw.column,R.raw.line,1<<30),x=new p.Range(R.raw.line,R.raw.column,R.raw.line,R.raw.column+1);if(M===R)if(T.push({options:A.TOP_STACK_FRAME_MARGIN,range:x}),R.thread.stoppedDetails&&R.thread.stoppedDetails.reason==="exception")T.push({options:A.TOP_STACK_FRAME_EXCEPTION_DECORATION,range:O});else{T.push({options:A.TOP_STACK_FRAME_DECORATION,range:O});const{topFrameRange:k}=this;k&&k.startLineNumber===R.raw.line&&k.startColumn!==R.raw.column&&T.push({options:A.TOP_STACK_FRAME_INLINE_DECORATION,range:O}),this.topFrameRange=O}else T.push({options:A.FOCUSED_STACK_FRAME_MARGIN,range:x}),T.push({options:A.FOCUSED_STACK_FRAME_DECORATION,range:O});return T}deltaDecorations(w,T){this.updatingDecorations=!0;try{return this.editor.deltaDecorations(w,T)}finally{this.updatingDecorations=!1}}focusStackFrame(){this.renderFrames()}async render(){await this.renderBreakpoints(),this.renderFrames()}async renderBreakpoints(){await this.breakpointManager.whenReady,this.renderNormalBreakpoints(),this.renderCurrentBreakpoints()}renderNormalBreakpoints(){const w=this.createBreakpointDecorations();this.breakpointDecorations=this.deltaDecorations(this.breakpointDecorations,w),this.updateBreakpointRanges()}updateBreakpoints(){if(this.areBreakpointsAffected()){const w=this.createBreakpoints();this.breakpointManager.setBreakpoints(this._uri,w)}}areBreakpointsAffected(){if(this.updatingDecorations||!this.editor.getModel())return!1;for(const w of this.breakpointDecorations){const T=this.editor.getModel().getDecorationRange(w),R=this.breakpointRanges.get(w);if(!T||!T.equalsRange(R))return!0}return!1}createBreakpoints(){const{_uri:w}=this,T=new Set,R=[];for(const M of this.breakpointDecorations){const O=this.editor.getModel().getDecorationRange(M);if(O&&!T.has(O.startLineNumber)){const x=O.startLineNumber,k=this.breakpointRanges.get(M),F=k&&this.breakpointManager.getBreakpoint(w,k.startLineNumber)||{},L=c.DebugBreakpoint.create(w,{...F.raw||{},line:x},F.enabled);R.push(L),T.add(x)}}return R}createBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).map(T=>this.createBreakpointDecoration(T))}createBreakpointDecoration(w){const T=w.raw.line,R=w.raw.column||0;return{range:new p.Range(T,R,T,R+1),options:{description:"breakpoint-decoration",stickiness:A.STICKINESS}}}async renderCurrentBreakpoints(){const w=this.breakpointManager.getBreakpoints(this._uri),T=this.createCurrentBreakpointDecorations(),R=this.deltaDecorations(this.currentBreakpointDecorations.map(({decorationId:x})=>x),T);this.currentBreakpointDecorations.forEach(x=>{x.inlineWidget&&x.inlineWidget.dispose()}),this.currentBreakpointDecorations=R.map((x,k)=>{const F=T[k],L=w[k],N=(L.enabled?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,U=F.options.beforeContentClassName?new D(this.editor,x,N,L,this.breakpointManager):void 0;return{breakpoint:L,decorationId:x,inlineWidget:U}});const M=await this.getCandidateBreakpoints(w),O=this.deltaDecorations(this.candidateDecorations.map(({decorationId:x})=>x),M);this.candidateDecorations.forEach(x=>{x.inlineWidget.dispose()}),this.candidateDecorations=O.map((x,k)=>{const{breakpoint:F}=M[k],L=(F?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,N=new D(this.editor,x,L,F,this.breakpointManager);return{decorationId:x,inlineWidget:N}})}async getCandidateBreakpoints(w){const T=this.editor.getModel(),R=this.debugSessionManager.currentSession;if(!T||!R?.capabilities.supportsBreakpointLocationsRequest)return[];const M=Array.from(new Set(w.map(x=>x.raw.line))),O=[];return await Promise.all(M.map(async x=>{const k=await R.breakpointLocations(this._uri,x);if(k.length<=1)return;const F=T.getLineCount();if(x>F)return;const L=T.getLineFirstNonWhitespaceColumn(x),N=T.getLineLastNonWhitespaceColumn(x);k.forEach(U=>{const W=new p.Range(U.lineNumber,U.column,U.lineNumber,U.column+1);if(U.column<=L||U.column>N)return;const j=this.currentBreakpointDecorations.find(({breakpoint:Q})=>Q.raw.line===W.startLineNumber&&Q.raw.column===W.startColumn);j?.inlineWidget||O.push({range:W,options:{description:"debug-breakpoint-placeholder",stickiness:p.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,beforeContentClassName:j?void 0:"debug-breakpoint-placeholder"},breakpoint:j?.breakpoint})})})),O}createCurrentBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).filter(T=>(0,c.isDebugBreakpoint)(T)).map(T=>this.createCurrentBreakpointDecoration(T))}createCurrentBreakpointDecoration(w){const T=this.debugSessionManager.currentSession,R=w.status.get(T&&T.id||""),M=R&&R.line?R.line:w.raw.line,O=w.raw.column||0,x=this.editor.getModel(),k=x.getLineCount(),F=M>k?!1:O>x.getLineFirstNonWhitespaceColumn(M),L=new p.Range(M,O,M,O+1),{className:N,message:U}=this.decorator.getDecoration(w,!!T,this.breakpointManager.breakpointsEnabled),W=this.preferenceService.getValid("debug.breakpoint.showBreakpointsInOverviewRuler",!1);let j=null;return W&&(j={color:this.themeService.getColor({id:g.debugIconBreakpointForeground}),position:p.editor.OverviewRulerLane.Left}),{range:L,options:{description:"debug-breakpoint-placeholder",glyphMarginClassName:N,glyphMarginHoverMessage:U.map(Q=>({value:Q})),stickiness:A.STICKINESS,beforeContentClassName:F?"debug-breakpoint-placeholder":void 0,overviewRuler:j}}}updateBreakpointRanges(){this.breakpointRanges.clear();for(const w of this.breakpointDecorations){const T=this.editor.getModel().getDecorationRange(w);this.breakpointRanges.set(w,T)}}showHover(w){const T=w.target.type,R=m.isOSX?"metaKey":"ctrlKey";w.event.altKey||T===s.monacoBrowser.editor.MouseTargetType.CONTENT_WIDGET&&w.target.detail===this.debugHoverWidget.getId()&&!w.event[R]||(T===s.monacoBrowser.editor.MouseTargetType.CONTENT_TEXT?this.debugHoverWidget.show({selection:w.target.range,immediate:!1}):this.debugHoverWidget.hide({immediate:!1}))}hideHover({event:w}){const T=this.debugHoverWidget.getDomNode().getBoundingClientRect();(w.posx<T.left||w.posx>T.right||w.posy<T.top||w.posy>T.bottom)&&this.debugHoverWidget.hide({immediate:!1})}doToggleBreakpoint(w=this.position){const T=this.breakpointManager.getBreakpoints(this._uri,{lineNumber:w.lineNumber});if(T.length)for(const R of T)this.breakpointManager.delBreakpoint(R);else this.breakpointManager.addBreakpoint(c.DebugBreakpoint.create(this._uri,{line:w.lineNumber}))}get contributedContextMenu(){return this.menuService.createMenu(v.MenuId.DebugBreakpointsContext,this.contextKeyService)}onContextMenu(w){var T;if(this.marginFreeFromNonDebugDecorations((T=w.target.position)===null||T===void 0?void 0:T.lineNumber)&&w.target&&w.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const R=this.breakpointManager.getBreakpoint(this._uri,w.target.position.lineNumber);this.breakpointManager.selectedBreakpoint={breakpoint:R,model:this};const M=this.contributedContextMenu,O=(0,v.generateMergedCtxMenu)({menus:M});this.ctxMenuRenderer.show({anchor:w.event.browserEvent,menuNodes:O,args:[w.target.position]})}}marginFreeFromNonDebugDecorations(w){const T=this.editor.getLineDecorations(w);if(Array.isArray(T))for(const{options:R}of T){const M=R.glyphMarginClassName;if(M&&(M.includes("testing-run-glyph")||M.includes("interface-navigation-glyph")))return!1}return!0}onMouseDown(w){var T;this.marginFreeFromNonDebugDecorations((T=w.target.position)===null||T===void 0?void 0:T.lineNumber)&&(w.target&&w.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&(w.event.rightButton||(this.editor.focus(),this.toggleBreakpoint(w.target.position))),this.hintBreakpoint(w))}onMouseMove(w){var T;if(!this.marginFreeFromNonDebugDecorations((T=w.target.position)===null||T===void 0?void 0:T.lineNumber)){this.onMouseLeave(w);return}this.showHover(w),this.hintBreakpoint(w)}onMouseLeave(w){this.hideHover(w),this.deltaHintDecorations([])}hintBreakpoint(w){const T=this.createHintDecorations(w);this.deltaHintDecorations(T)}deltaHintDecorations(w){this.hintDecorations=this.deltaDecorations(this.hintDecorations,w)}createHintDecorations(w){if(w.target&&w.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN||w.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_NUMBERS){const T=w.target.position.lineNumber;return this.breakpointManager.getBreakpoint(this._uri,T)?[]:[{range:new p.Range(T,1,T,1),options:A.BREAKPOINT_HINT_DECORATION}]}return[]}getBreakpoints(w,T){return this.breakpointManager.getBreakpoints(w,T)}getEditor(){return this.editor}getBreakpointWidget(){return this.breakpointWidget}getDebugHoverWidget(){return this.debugHoverWidget}};t.DebugModel=S,r.__decorate([(0,l.Autowired)(h.DebugEditor),r.__metadata("design:type",Object)],S.prototype,"editor",void 0),r.__decorate([(0,l.Autowired)(y.DebugBreakpointWidget),r.__metadata("design:type",y.DebugBreakpointWidget)],S.prototype,"breakpointWidget",void 0),r.__decorate([(0,l.Autowired)(b.DebugHoverWidget),r.__metadata("design:type",b.DebugHoverWidget)],S.prototype,"debugHoverWidget",void 0),r.__decorate([(0,l.Autowired)(u.IDebugSessionManager),r.__metadata("design:type",f.DebugSessionManager)],S.prototype,"debugSessionManager",void 0),r.__decorate([(0,l.Autowired)(d.DebugBreakpointsService),r.__metadata("design:type",d.DebugBreakpointsService)],S.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,l.Autowired)(c.BreakpointManager),r.__metadata("design:type",c.BreakpointManager)],S.prototype,"breakpointManager",void 0),r.__decorate([(0,l.Autowired)(v.AbstractMenuService),r.__metadata("design:type",v.AbstractMenuService)],S.prototype,"menuService",void 0),r.__decorate([(0,l.Autowired)(_.IContextKeyService),r.__metadata("design:type",Object)],S.prototype,"contextKeyService",void 0),r.__decorate([(0,l.Autowired)(v.ICtxMenuRenderer),r.__metadata("design:type",v.ICtxMenuRenderer)],S.prototype,"ctxMenuRenderer",void 0),r.__decorate([(0,l.Autowired)(_.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),r.__decorate([(0,l.Autowired)(_.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),r.__decorate([(0,l.Autowired)(g.IThemeService),r.__metadata("design:type",Object)],S.prototype,"themeService",void 0),r.__decorate([m.memoize,r.__metadata("design:type",Object),r.__metadata("design:paramtypes",[])],S.prototype,"contributedContextMenu",null),t.DebugModel=S=n=r.__decorate([(0,l.Injectable)(),r.__metadata("design:paramtypes",[])],S);class D extends m.Disposable{constructor(w,T,R,M,O){super(),this.editor=w,this.decorationId=T,this.breakpoint=M,this.breakpointManager=O,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.range=this.editor.getModel().getDecorationRange(T),this.addDispose(this.editor.onDidChangeModelDecorations(()=>{const k=this.editor.getModel().getDecorationRange(this.decorationId);this.range&&!this.range.equalsRange(k)&&(this.range=k,this.editor.layoutContentWidget(this))})),this.addDispose(m.Disposable.create(()=>{this.editor.removeContentWidget(this)})),this.create(R),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(w){const T=document.createElement("div");T.className="inline-breakpoint-widget",w&&(0,_.addClassName)(T,w),this.domNode=T;const{EditorOption:R}=p.editor,M=()=>{const O=this.editor.getOption(R.lineHeight);T.style.height=`${O}px`,T.style.width=`${Math.ceil(.8*O)}px`,T.style.marginLeft="4px"};M(),this.addDispose(new _.DomListener(T,"click",async()=>{this.breakpoint?this.breakpointManager.delBreakpoint(this.breakpoint):this.breakpointManager.addBreakpoint(c.DebugBreakpoint.create(this.editor.getModel().uri,{line:this.range.startLineNumber,column:this.range.startColumn}))})),this.addDispose(this.editor.onDidChangeConfiguration(O=>{(O.hasChanged(R.fontSize)||O.hasChanged(R.lineHeight))&&M()}))}getId(){return(0,m.uuid)()}getDomNode(){return this.domNode}getPosition(){return this.range?(this.domNode.classList.toggle("line-start",this.range.startColumn===1),{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn-1},preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.EXACT]}):null}}r.__decorate([m.memoize,r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",void 0)],D.prototype,"getId",null)},78606:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugRunToCursorService=void 0;const n=e(85608),r=e(76003),o=e(54414),l=e(26296),_=e(66089),v=e(38029),m=e(97319);let p=class{constructor(){}async run(g,a=!1){const h=this.sessionManager.currentSession;if(!h||h.state!==l.DebugState.Stopped)return;const u=this.workbenchEditorService.currentEditor;if(u){if(!u.monacoEditor)return}else return;const{monacoEditor:c}=u,E=c.getPosition();if(!(c.hasModel()&&E))return;const f=h.getModel();if(!f)return;const d=!!f.getBreakpoints(g,{column:E.column,lineNumber:E.lineNumber}).length;let y,b=h.currentThread,A=[];if(!d){a&&(A=f.getBreakpoints().filter(I=>I.enabled).filter(I=>I.raw.column!==E.column&&I.raw.line!==E.lineNumber),A.forEach(I=>{this.debugBreakpointsService.toggleBreakpointEnable(I)}));const D=await this.addBreakpoints(g,E);if(!D){this.recoverStatus(A);return}D.thread&&(b=D.thread),D.breakpoint&&(y=D.breakpoint)}if(!b){this.recoverStatus(A);return}const S=b.session.onDidChangeState(()=>{const D=h.state;(D===l.DebugState.Stopped||D===l.DebugState.Inactive)&&(y&&h.delBreakpoint(y),S.dispose())});await b.continue(),this.recoverStatus(A)}async addBreakpoints(g,a){const h=this.sessionManager.currentSession;if(!h)return;let u=1;const c=h.currentFrame;c&&c.range().startLineNumber===a.lineNumber&&(u=a.column||1);const E=_.DebugBreakpoint.create(g,{line:a.lineNumber,column:u});if(await h.addBreakpoint(E,!0),!E)return{breakpoint:void 0,thread:h.currentThread};let f=h.currentThread,d=0;const y=h.threads.filter(b=>b.stopped);if(d<3&&h.currentThread&&y.includes(h.currentThread)&&(f=h.currentThread,d=3),d<2){const b=y.find(A=>A.topFrame);b&&(f=b,d=2)}return d<1&&(f=y[0],d=2),{thread:f,breakpoint:E}}recoverStatus(g){g.forEach(a=>{this.debugBreakpointsService.toggleBreakpointEnable(a)})}};t.DebugRunToCursorService=p,n.__decorate([(0,r.Autowired)(l.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],p.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],p.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(m.DebugBreakpointsService),n.__metadata("design:type",m.DebugBreakpointsService)],p.prototype,"debugBreakpointsService",void 0),t.DebugRunToCursorService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},26571:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINT_DECORATION_DISABLED=t.BREAKPOINT_DECORATION=t.BREAKPOINT_HINT_DECORATION=t.TOP_STACK_FRAME_INLINE_DECORATION=t.FOCUSED_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_EXCEPTION_DECORATION=t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_DECORATION=t.FOCUSED_STACK_FRAME_MARGIN=t.TOP_STACK_FRAME_MARGIN=t.BREAK_PONINT_HOVER_MARGIN=t.STICKINESS=void 0;const r=e(85608).__importStar(e(20868));t.STICKINESS=r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,t.BREAK_PONINT_HOVER_MARGIN={description:"debug-hover",glyphMarginClassName:"sumi-debug-hover",linesDecorationsClassName:"sumi-debug-hover",isWholeLine:!0},t.TOP_STACK_FRAME_MARGIN={description:"debug-top-stack-frame",glyphMarginClassName:"sumi-debug-top-stack-frame",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_MARGIN={description:"debug-focused-stack-frame",glyphMarginClassName:"sumi-debug-focused-stack-frame",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_DECORATION={description:"debug-top-stack-frame-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-line",stickiness:t.STICKINESS},t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION={description:"focus-breakpoints-stack-frame-line",isWholeLine:!0,className:"sumi-focus-breakpoints-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_EXCEPTION_DECORATION={description:"debug-top-stack-frame-exception-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-exception-line",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_DECORATION={description:"debug-focused-stack-frame-line",isWholeLine:!0,className:"sumi-debug-focused-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_INLINE_DECORATION={description:"debug-top-stack-frame-column",beforeContentClassName:"sumi-debug-top-stack-frame-column"},t.BREAKPOINT_HINT_DECORATION={description:"debug-breakpoint-hint",glyphMarginClassName:"sumi-debug-breakpoint-hint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION={description:"debug-breakpoint",glyphMarginClassName:"sumi-debug-breakpoint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION_DISABLED={description:"debug-breakpoint-disabled",glyphMarginClassName:"sumi-debug-breakpoint-disabled",stickiness:t.STICKINESS}},16885:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluatableExpressionServiceImpl=t.IEvaluatableExpressionService=void 0;const n=e(85608),r=e(76003),o=e(40497),l=new o.LanguageFeatureRegistry;t.IEvaluatableExpressionService=Symbol("IEvaluatableExpressionService");let _=class{getSupportedEvaluatableExpressionProvider(m){return l.ordered(m)}registerEvaluatableExpressionProvider(m,p){return l.register(m,p)}hasEvaluatableExpressProvider(m){return l.has(m)}};t.EvaluatableExpressionServiceImpl=_,t.EvaluatableExpressionServiceImpl=_=n.__decorate([(0,r.Injectable)()],_)},75935:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(17475),t),n.__exportStar(e(65960),t),n.__exportStar(e(91260),t),n.__exportStar(e(71569),t),n.__exportStar(e(26571),t),n.__exportStar(e(74257),t)},33969:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(91825),_=e(64582),v=e(99797),m=e(3005),p=e(37499),s=e(59053),g=e(31141),a=e(40453),h=e(90408),u=e(97186),c=e(38029),E=e(75935),f=e(23217),d=e(16885),y=e(23434),b=e(52369),A=e(44888),S=e(84784),D=e(15153),I=e(11456),w=e(37243),T=e(86752),R=e(14600);e(51377);let M=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:f.DebugHoverSource,useClass:f.DebugHoverSource},{token:E.DebugExpressionProvider,useClass:E.DebugExpressionProvider},{token:_.IDebugModelManager,useClass:E.DebugModelManager},{token:_.IDebugSessionManager,useClass:c.DebugSessionManager},{token:v.BreakpointManager,useClass:v.BreakpointManager},{token:p.DebugConfigurationManager,useClass:p.DebugConfigurationManager},{token:d.IEvaluatableExpressionService,useClass:d.EvaluatableExpressionServiceImpl},{token:l.FolderFilePreferenceProvider,useClass:y.LaunchFolderPreferenceProvider,dropdownForTag:!0,tag:"launch"},{token:_.DebugModelFactory,useFactory:x=>k=>E.DebugModel.createModel(x,k)},{token:u.DebugSessionContributionRegistry,useClass:u.DebugSessionContributionRegistryImpl},{token:_.IDebugService,useClass:h.DebugService},{token:_.ILaunchService,useClass:A.LaunchService},{token:_.IDebugProgress,useClass:a.DebugProgressService},{token:_.IDebugConsoleModelService,useClass:D.DebugConsoleModelService},b.LaunchPreferencesContribution,s.DebugContribution,I.DebugConsoleContribution,T.VariablesPanelContribution,w.DebugCallStackContribution,R.WatchPanelContribution,{token:m.DebugCallStackItemTypeKey,useFactory:x=>x.get(o.IContextKeyService).createKey("callStackItemType")}],this.contributionProvider=u.DebugSessionContribution,this.preferences=g.injectDebugPreferences,this.isOverlay=!0,this.component=S.DebugToolbarOverlayWidget}};t.DebugModule=M,t.DebugModule=M=n.__decorate([(0,r.Injectable)()],M)},39553:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(35721),t),n.__exportStar(e(20391),t)},35721:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkerManager=t.MarkerCollection=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(14951);class _{constructor(p,s){this.uri=p,this.kind=s,this.owner2Markers=new Map}get empty(){return!this.owner2Markers.size}getOwners(){return Array.from(this.owner2Markers.keys())}getMarkers(p){return this.owner2Markers.get(p)||[]}setMarkers(p,s){const g=this.owner2Markers.get(p);return s.length>0?this.owner2Markers.set(p,s.map(a=>this.createMarker(p,a))):this.owner2Markers.delete(p),g||[]}createMarker(p,s){return Object.freeze({uri:this.uri.toString(),kind:this.kind,owner:p,data:s})}findMarkers(p){if(p.owner)return this.owner2Markers.has(p.owner)?this.filterMarkers(p,this.owner2Markers.get(p.owner)):[];{const s=[];for(const g of this.owner2Markers.values())s.push(...this.filterMarkers(p,g));return s}}filterMarkers(p,s){return s?p.dataFilter?s.filter(g=>p.dataFilter(g.data)):s:[]}}t.MarkerCollection=_;let v=class{constructor(){this.uri2MarkerCollection=new Map,this.onDidChangeMarkersEmitter=new o.Emitter,this.init()}init(){this.fileService.onFilesChanged(p=>{const s=p.filter(({type:g})=>g===l.FileChangeType.DELETED);s.length&&this.cleanMarkers(s)})}cleanMarkers(p){for(const s of this.uri2MarkerCollection.keys()){const g=new o.URI(s);l.FileChangeEvent.isDeleted(p,g)&&this.cleanAllMarkers(g)}}get onDidChangeMarkers(){return this.onDidChangeMarkersEmitter.event}fireOnDidChangeMarkers(p){this.onDidChangeMarkersEmitter.fire(p)}setMarkers(p,s,g){const a=p.toString(),h=this.uri2MarkerCollection.get(a)||new _(p,this.getKind()),u=h.setMarkers(s,g);return h.empty?this.uri2MarkerCollection.delete(p.toString()):this.uri2MarkerCollection.set(a,h),this.fireOnDidChangeMarkers(p),u}findMarkers(p={}){if(p.uri){const g=this.uri2MarkerCollection.get(p.uri.toString());return g?g.findMarkers(p):[]}const s=[];for(const g of this.getUris())s.push(...this.uri2MarkerCollection.get(g).findMarkers(p));return s}getUris(){return this.uri2MarkerCollection.keys()}cleanAllMarkers(p){if(p)this.doCleanAllMarkers(p);else for(const s of this.getUris())this.doCleanAllMarkers(new o.URI(s))}doCleanAllMarkers(p){const s=p.toString();this.uri2MarkerCollection.get(s)!==void 0&&(this.uri2MarkerCollection.delete(s),this.fireOnDidChangeMarkers(p))}};t.MarkerManager=v,n.__decorate([(0,r.Autowired)(l.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileService",void 0),t.MarkerManager=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},20391:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88776:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSource=t.DebugSourceData=void 0;const n=e(41869);class r{}t.DebugSourceData=r;class o extends r{constructor(_,v,m,p,s){super(),this.session=_,this.labelProvider=v,this.modelManager=m,this.workbenchEditorService=p,this.fileSystem=s}get uri(){return o.toUri(this.raw)}get available(){return!!this.raw}get presentationHint(){return this.raw.presentationHint}update(_){Object.assign(this,_)}async open(_,v){if(this.uri.scheme===o.SCHEME){const m=await this.load();await this.fileSystem.setContent({uri:this.uri.toString(),lastModification:0},m)}if(v&&v.raw){const{line:m,column:p}=v.raw,s={startLineNumber:m,startColumn:typeof p=="number"?p:0,endLineNumber:m,endColumn:1/0};await this.workbenchEditorService.open(this.uri,{..._,range:s}),v.thread.currentFrame=v;const g=this.modelManager.resolve(this.uri);if(g)for(const a of g)a.focusStackFrame()}else await this.workbenchEditorService.open(this.uri,_)}async load(){const _=this.raw,v=_.sourceReference;return(await this.session.sendRequest("source",{sourceReference:v,source:_})).body.content}get inMemory(){return this.uri.scheme===o.SCHEME}get reference(){return this.raw.sourceReference}get name(){return this.inMemory?this.raw.name||this.uri.path.base||this.uri.path.toString():this.labelProvider.getName(this.uri)}get longName(){return this.inMemory?this.name:this.labelProvider.getLongName(this.uri)}static toUri(_){if(_.sourceReference&&_.sourceReference>0)return new n.URI().withScheme(o.SCHEME).withPath(_.name).withQuery(String(_.sourceReference));if(!_.path)throw new Error("Unrecognized source type: "+JSON.stringify(_));return _.path.match(o.SCHEME_PATTERN)?new n.URI(_.path):new n.URI(n.Uri.file(_.path))}}t.DebugSource=o,o.SCHEME="debug",o.SCHEME_PATTERN=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/},44485:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowMoreDebugStackFrame=t.DebugStackFrame=t.DebugStackFrameData=void 0;const n=e(41869),r=e(44781),o=e(98650);class l{}t.DebugStackFrameData=l;class _ extends l{static is(p){return!!p&&"raw"in p}constructor(p,s){super(),this.thread=p,this.session=s}get id(){return this.session.id+":"+this.thread.id+":"+this.raw.id}get source(){return this._source}update(p){Object.assign(this,p),this._source=this.raw.source&&this.session.getSource(this.raw.source)}async restart(){return this.session.capabilities.supportsRestartFrame?await this.session.sendRequest("restartFrame",{frameId:this.raw.id}):Promise.reject(new Error("restartFrame not supported"))}get canRestart(){return!!this.session.capabilities.supportsRestartFrame&&this.raw.presentationHint!=="label"&&this.raw.presentationHint!=="subtle"&&!!this.raw.canRestart}async open(p){if(!this.source)return;const{line:s,column:g,endLine:a,endColumn:h}=this.raw;let u={startLineNumber:s,startColumn:g,endLineNumber:s,endColumn:1/0};typeof a=="number"&&(u={...u,endLineNumber:a,endColumn:typeof h=="number"?h:1/0}),this.source.open({...p,range:u})}toArgs(p){return Object.assign({},p,{frameId:this.raw.id})}getScopes(p){return this.doGetScopes(p)}async doGetScopes(p){try{return(await this.session.sendRequest("scopes",this.toArgs())).body.scopes.map(g=>new o.DebugScope(g,this.session,p))}catch{return[]}}range(){const p=this.raw;return new r.Range(p.line,p.column,p.endLine||p.line,p.endColumn||p.column)}async getMostSpecificScopes(p){const g=(await this.doGetScopes()).filter(u=>!u.getRawScope().expensive);if(!g.some(u=>!!u.range()))return g;const h=g.filter(u=>u.range()&&r.Range.containsRange(u.range(),p)).sort((u,c)=>u.range().endLineNumber-u.range().startLineNumber-(c.range().endLineNumber-c.range().startLineNumber));return h.length?h:g}}t.DebugStackFrame=_;class v{constructor(p,s,g,a,h){this.nextFrame=p,this.frames=s,this.session=g,this.origin=a,this._open=h,this.open=()=>{this._open(this)}}get name(){return(0,n.formatLocalize)("debug.stack.showMoreAndOrigin",this.frames.length,this.origin)}get id(){var p;return`${this.session.id}:showMore:${(p=this.nextFrame)===null||p===void 0?void 0:p.id}`}}t.ShowMoreDebugStackFrame=v},7885:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugThread=t.DebugThreadData=void 0;const n=e(41869),r=e(64582),o=e(44485);class l{}t.DebugThreadData=l;class _ extends l{constructor(m){super(),this.session=m,this._onDidChanged=new n.Emitter,this.onDidChanged=this._onDidChanged.event,this._frames=new Map,this.pendingFetch=Promise.resolve([])}get id(){return this.session.id+":"+this.raw.id}get threadId(){return this.raw.id}get currentFrame(){return this._currentFrame}set currentFrame(m){this._currentFrame=m,this._onDidChanged.fire()}get stopped(){return!!this.stoppedDetails}update(m){Object.assign(this,m),"stoppedDetails"in m&&this.clearFrames()}clear(){this.update({raw:this.raw,stoppedDetails:void 0})}continue(){return this.session.sendRequest("continue",this.toArgs())}stepOver(){return this.session.sendRequest("next",this.toArgs())}stepIn(){return this.session.sendRequest("stepIn",this.toArgs())}stepOut(){return this.session.sendRequest("stepOut",this.toArgs())}pause(){return this.session.sendRequest("pause",this.toArgs())}terminate(){return this.session.sendRequest("terminateThreads",{threadIds:[this.raw.id]})}get frames(){return Array.from(this._frames.values())}get topFrame(){return this.frames[0]}get frameCount(){return this._frames.size}async rawFetchFrames(m=20){return this.pendingFetch=this.pendingFetch.then(async()=>{try{const p=this.frameCount,s=await this.doFetchFrames(p,m);return this.doUpdateFrames(s)}catch{return[]}})}async fetchExceptionInfo(){var m;try{if(((m=this.stoppedDetails)===null||m===void 0?void 0:m.reason)==="exception"&&this.session.capabilities.supportsExceptionInfoRequest){const p=await this.session.exceptionInfo(this.toArgs());if(p)return{id:p.body.exceptionId,description:p.body.description,breakMode:p.body.breakMode,details:p.body.details}}}catch{return}}async fetchFrames(m=20){const p=await this.rawFetchFrames(m);return this.updateCurrentFrame(),p}async doFetchFrames(m,p){try{const s=await this.session.sendRequest("stackTrace",this.toArgs({startFrame:m,levels:p}));return this.stoppedDetails&&(this.stoppedDetails.totalFrames=s.body.totalFrames),s.body.stackFrames}catch(s){return this.stoppedDetails&&(this.stoppedDetails.framesErrorMessage=s.message),[]}}doUpdateFrames(m){const p=this.session.reportTime(r.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.session.id,threadId:this.raw.id,threadAmount:this.session.threadCount}),s=new Map(this._frames);for(const a of m){const h=a.id;if(!this._frames.has(h)){const u=new o.DebugStackFrame(this,this.session);this._frames.set(h,u),u.update({raw:a}),s.set(h,u)}}const g=[...s.values()];return p("doUpdateFrames"),g}clearFrames(){this._frames.clear(),this.updateCurrentFrame()}updateCurrentFrame(){const{currentFrame:m}=this,p=m&&m.raw.id;this.currentFrame=typeof p=="number"&&this._frames.get(p)||this._frames.values().next().value}toArgs(m){return Object.assign({},m,{threadId:this.raw.id})}}t.DebugThread=_},14190:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugWatch=t.IDebugWatchData=void 0;const r=e(85608).__importDefault(e(97331)),o=e(41869),l=e(64582),_=e(98650);t.IDebugWatchData=Symbol("IDebugWatchData");class v{constructor(p,s){this.manager=p,this.reporterService=s,this.toDispose=new o.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.fireVariableChange=(0,r.default)(()=>this.onDidVariableChangeEmitter.fire(),50),this.fireExpressionChange=(0,r.default)(g=>this.onDidExExpressionChangeEmitter.fire(g),50),this._expressions=[],this.onDidChangeEmitter=new o.Emitter,this.onDidVariableChangeEmitter=new o.Emitter,this.onDidExExpressionChangeEmitter=new o.Emitter,this.whenReady=this.init()}get onDidChange(){return this.onDidChangeEmitter.event}get onDidVariableChange(){return this.onDidVariableChangeEmitter.event}get onDidExpressionChange(){return this.onDidExExpressionChangeEmitter.event}async getRoot(){const p=[],s=new _.DebugWatchRoot(this.manager.currentSession);for(const g of this._expressions){const a=new _.DebugWatchNode(this.manager.currentSession,g,s);await a.evaluate(),p.push(a)}return s.updatePresetChildren(p),this._root=s,this._root}async init(){this.toDispose.push(this.manager.onDidStopDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidDestroyDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidChangeActiveDebugSession(()=>{const p=this.manager.currentSession;p&&(p.onVariableChange(()=>{this.fireVariableChange()}),p.onDidChangeCallStack(()=>{this.fireVariableChange()}))}))}async clear(){this.updateWatchExpressions([]),this.fireExpressionChange([]),this.fireDidChange()}async updateWatchExpressions(p){this._expressions=p}addWatchExpression(p){this.reporterService.point(l.DEBUG_REPORT_NAME===null||l.DEBUG_REPORT_NAME===void 0?void 0:l.DEBUG_REPORT_NAME.DEBUG_WATCH,l.DEBUG_COMMANDS.ADD_WATCHER.id,{value:p}),this._expressions.indexOf(p)===-1&&(this._expressions.push(p),this.fireExpressionChange(this._expressions))}renameWatchExpression(p,s){const g=this._expressions.indexOf(p);g>=0&&this._expressions.splice(g,1,s),this.fireExpressionChange(this._expressions)}removeWatchExpression(p){const s=this._expressions.indexOf(p);s>=0&&this._expressions.splice(s,1),this.fireExpressionChange(this._expressions)}}t.DebugWatch=v},50755:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(88776),t),n.__exportStar(e(44485),t),n.__exportStar(e(7885),t),n.__exportStar(e(14190),t)},53741:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxWidget=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),l=e(97267),_=n.__importDefault(e(93089)),v=m=>{var p,s;const{disabled:g,formContext:a,id:h,label:u,hideLabel:c,onBlur:E,onChange:f,onFocus:d,readonly:y,value:b,registry:A,options:S,schema:D,uiSchema:I}=m,{readonlyAsDisabled:w=!0}=a,T=(0,r.getTemplate)("DescriptionFieldTemplate",A,S),R=({target:F})=>f(F.checked),x={onBlur:y?void 0:({target:F})=>E(h,F.checked),onFocus:y?void 0:({target:F})=>d(h,F.checked)},k=(s=(p=S.description)!==null&&p!==void 0?p:D.description)!==null&&s!==void 0?s:D.markdownDescription;return o.default.createElement("div",{className:_.default.checkbox_widget_control},!c&&o.default.createElement("label",{title:u,className:_.default.field_label},u),o.default.createElement(l.CheckBox,{checked:typeof b>"u"?!1:b,disabled:g||w&&y,id:h,name:h,onChange:y?void 0:R,...x,"aria-describedby":(0,r.ariaDescribedByIds)(h),label:k,className:_.default.checkbox}))};t.CheckboxWidget=v},93306:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnyOfField=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),l=e(97267),_=n.__importDefault(e(93089)),v=m=>{var p,s;const{disabled:g,formContext:a,idSchema:h,onBlur:u,id:c,onChange:E,onFocus:f,options:d,placeholder:y,readonly:b,registry:A,name:S,required:D,schema:I,uiOptions:w}=m,{readonlyAsDisabled:T=!0}=a,R=({target:L})=>E(L.value===""?d.emptyValue:L.value),M=({target:L})=>u(c,L.value),O=({target:L})=>f(c,L.value),x=(s=(p=d.description)!==null&&p!==void 0?p:I.description)!==null&&s!==void 0?s:I.markdownDescription,k=(0,r.getTemplate)("TitleFieldTemplate",A,w),F=(0,r.getTemplate)("DescriptionFieldTemplate",A,w);return o.default.createElement("div",{className:_.default.any_of_widget_control},S&&o.default.createElement("div",{className:_.default.object_title},o.default.createElement(k,{id:(0,r.titleId)(h),title:S,required:D,schema:I,registry:A})),x&&o.default.createElement("div",{className:_.default.object_description},o.default.createElement(F,{id:(0,r.descriptionId)(h),description:x,schema:I,registry:A})),o.default.createElement(l.Input,{disabled:g||T&&b,onBlur:b?void 0:M,onChange:b?void 0:R,onFocus:b?void 0:O,placeholder:y,autoComplete:"off"}))};t.AnyOfField=v},32475:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),l=e(43718),_=(0,r.getDefaultRegistry)().fields.ArrayField,v=m=>{const{onChange:p}=m,s=(0,o.useCallback)(g=>{Array.isArray(g)&&p(g.map(a=>(0,l.isUndefined)(a)?"":a))},[p]);return o.default.createElement(_,{...m,onChange:s})};t.ArrayField=v},59299:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),l=e(41869),_=e(43718),v=e(64582),m=(0,r.getDefaultRegistry)().fields.ObjectField,p=s=>{const g=(0,l.useInjectable)(v.ILaunchService),{idSchema:a,onChange:h}=s;return(0,o.useEffect)(()=>{const{$id:u}=a,c=new _.Disposable;return u==="root"&&c.addDispose(g.onChangeFormData(E=>h(E))),()=>c.dispose()},[a]),o.default.createElement(m,{...s})};t.ObjectField=p},66216:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TitleField=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(93089)),l=_=>{const{title:v}=_;return v?r.default.createElement("label",{title:v,className:o.default.field_label},v):null};t.TitleField=l},81638:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),l=e(97267),_=n.__importDefault(e(93089)),v=m=>{const{schema:p,value:s,id:g,registry:a,uiOptions:h,name:u,required:c,onChange:E}=m,f=p.description,d=(0,r.getTemplate)("TitleFieldTemplate",a,h),y=(0,r.getTemplate)("DescriptionFieldTemplate",a,h),b=(0,o.useMemo)(()=>p&&p.enum?p.enum:[],[p,p.enum]);return o.default.createElement("div",{className:_.default.select_widget_control},u&&o.default.createElement("div",{className:_.default.object_title},o.default.createElement(d,{id:(0,r.titleId)(g),title:u,required:c,schema:p,registry:a})),f&&o.default.createElement("div",{className:_.default.object_description},o.default.createElement(y,{id:(0,r.descriptionId)(g),description:f,schema:p,registry:a})),o.default.createElement(l.Select,{key:g,value:s,dropdownRenderType:"absolute",onChange:E},b.map(A=>o.default.createElement(l.Option,{value:A,label:A,key:A},A))))};t.SelectWidget=v},20023:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),l=e(97267),_=e(64582),v=e(5905),m=n.__importDefault(e(93089)),p=s=>{const{disabled:g,formContext:a,id:h,onBlur:u,onChange:c,onFocus:E,options:f,placeholder:d,readonly:y,schema:b,value:A,registry:S,label:D,hideLabel:I,required:w,uiSchema:T,uiOptions:R}=s,{readonlyAsDisabled:M=!0}=a,O=(0,r.getTemplate)("TitleFieldTemplate",S,R),x=(0,r.getTemplate)("DescriptionFieldTemplate",S,R),k=(0,o.useMemo)(()=>typeof A!="string"?A:(0,v.parseSnippet)(A),[A]),F=({target:W})=>{c(W.value===""?f.emptyValue:W.value),u(h,W.value)},L=({target:W})=>E(h,W.value),N=(0,o.useMemo)(()=>b.type!==_.JSON_SCHEMA_TYPE.STRING&&b.type!==_.JSON_SCHEMA_TYPE.NUMBER?_.JSON_SCHEMA_TYPE.STRING:b.type,[b,b.type]),U=(0,o.useMemo)(()=>b.description||"",[b,b.description]);return o.default.createElement("div",null,!I&&D&&o.default.createElement("div",{className:m.default.object_title},o.default.createElement(O,{id:(0,r.titleId)(h),title:D,required:w,schema:b,uiSchema:T,registry:S})),U&&o.default.createElement("div",{className:m.default.object_description},o.default.createElement(x,{id:(0,r.descriptionId)(h),description:U,schema:b,uiSchema:T,registry:S})),o.default.createElement(l.Input,{disabled:g||M&&y,id:h,name:h,onBlur:y?void 0:F,onFocus:y?void 0:L,placeholder:d,type:N,value:k,className:m.default.text_widget_control,autoComplete:"off"}))};t.TextWidget=p},23434:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchFolderPreferenceProvider=void 0;const n=e(85608),r=e(76003),o=e(91825);let l=class extends o.FolderFilePreferenceProvider{parse(v){const m=super.parse(v);if(m!==void 0)return{launch:{...m}}}getPath(v){if(v==="launch")return[];if(v.startsWith("launch."))return[v.substr(7)]}};t.LaunchFolderPreferenceProvider=l,t.LaunchFolderPreferenceProvider=l=n.__decorate([(0,r.Injectable)()],l)},52369:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchPreferencesContribution=t.LaunchResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(64102),_=e(39496),v=e(57517),m=e(4983),p=e(10938),s=e(67858);let g=class{constructor(){this.scheme=m.LAUNCH_VIEW_SCHEME}provideResource(u){return{supportsRevive:!0,name:(0,o.localize)("menu-bar.title.debug"),icon:(0,o.getIcon)("debug"),uri:u}}provideResourceSubname(){return null}async shouldCloseResource(){return!0}};t.LaunchResourceProvider=g,t.LaunchResourceProvider=g=n.__decorate([(0,r.Injectable)()],g);let a=class{constructor(){this.schema=p.launchPreferencesSchema,this.name="launch"}registerResource(u){u.registerResourceProvider(this.prefResourceProvider)}registerEditorComponent(u){u.registerEditorComponent({component:s.LaunchViewContainer,uid:m.LAUNCH_VIEW_COMPONENT_ID,scheme:m.LAUNCH_VIEW_SCHEME}),u.registerEditorComponentResolver(m.LAUNCH_VIEW_SCHEME,(c,E,f)=>{f([{type:v.EditorOpenType.component,componentId:m.LAUNCH_VIEW_COMPONENT_ID}])})}registerMenus(u){u.registerMenuItem(_.MenuId.EditorTitle,{command:o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id,iconClass:(0,o.getIcon)("open"),group:"navigation",when:`resourceScheme == ${m.LAUNCH_VIEW_SCHEME}`})}};t.LaunchPreferencesContribution=a,n.__decorate([(0,r.Autowired)(g),n.__metadata("design:type",g)],a.prototype,"prefResourceProvider",void 0),t.LaunchPreferencesContribution=a=n.__decorate([(0,o.Domain)(o.PreferenceContribution,o.PreferenceConfiguration,v.BrowserEditorContribution,l.MenuContribution)],a)},10938:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchPreferencesSchema=void 0;const n=e(64582);t.launchPreferencesSchema={type:"object",scope:"resource",properties:{launch:{$ref:n.launchSchemaUri,description:"Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces",defaultValue:{configurations:[],compounds:[]}}}}},44888:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchService=void 0;const n=e(85608),r=n.__importStar(e(23304)),o=n.__importDefault(e(41263)),l=e(76003),_=e(41869),v=e(43718),m=e(14951),p=e(64582),s="configurations";let g=class{constructor(){this._onRawSchemaProperties=new v.Emitter,this.onRawSchemaProperties=this._onRawSchemaProperties.event,this._onChangeSchema=new v.Emitter,this.onChangeSchema=this._onChangeSchema.event,this._onChangeFormData=new v.Emitter,this.onChangeFormData=this._onChangeFormData.event}get rawSchemaProperties(){return this._rawSchemaProperties}get schema(){return this._schema}get formData(){return this._formData}async openLaunchConfiguration(){await this.commandService.executeCommand(_.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id)}setRawSchemaProperties(h){this._rawSchemaProperties=h,this._onRawSchemaProperties.fire(h)}nextNewSchema(h){this._schema=h,this._onChangeSchema.fire(h)}nextNewFormData(h,u=!0){this._formData=h,u&&this._onChangeFormData.fire(h)}addNewItem(h){if(h==="")return;const{properties:u}=this.rawSchemaProperties,c={...this.formData},E=u[h],{default:f,type:d}=E;(0,o.default)(c,h,f||this.getDefaultValue(d)),(0,o.default)(this.schema.properties,h,E),this.nextNewSchema(this.schema),this.nextNewFormData(c)}delItem(h){if(h==="")return;const{properties:u}=this.schema,c={...this.formData};delete c[h],delete u[h],this.nextNewSchema(this.schema),this.nextNewFormData(c)}getDefaultValue(h){switch(h){case p.JSON_SCHEMA_TYPE.ARRAY:return[];case p.JSON_SCHEMA_TYPE.BOOLEAN:return!1;case p.JSON_SCHEMA_TYPE.NULL:return null;case p.JSON_SCHEMA_TYPE.NUMBER:return 0;case p.JSON_SCHEMA_TYPE.OBJECT:return{};case p.JSON_SCHEMA_TYPE.STRING:default:return""}}async readResourceContent(h){try{const{content:u}=await this.fileSystem.readFile(h.toString());return u.toString()}catch{return""}}async modifyConfigurationsInResource(h,u,c){const E=await this.fileSystem.getFileStat(h.toString());if(E&&E.type===v.FileType.File){const{formData:f}=u,d=await this.readResourceContent(h),b=r.parse(d)[s];if(!b)return;Array.isArray(b)&&b.length-1>=c&&b.splice(c,1,f);const A=r.modify(d,[s],b,{isArrayInsertion:!1,formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
33294
33294
  `}}),S=r.applyEdits(d,A);await this.fileSystem.setContent(E,S)}}};t.LaunchService=g,n.__decorate([(0,l.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileSystem",void 0),n.__decorate([(0,l.Autowired)(v.CommandService),n.__metadata("design:type",Object)],g.prototype,"commandService",void 0),t.LaunchService=g=n.__decorate([(0,l.Injectable)()],g)},67858:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchViewContainer=void 0;const n=e(85608),r=e(67030),o=n.__importDefault(e(17932)),l=n.__importDefault(e(53373)),_=n.__importDefault(e(46123)),v=n.__importDefault(e(97331)),m=n.__importStar(e(14041)),p=n.__importDefault(e(19686)),s=e(97267),g=e(41869),a=e(81878),h=e(25918),u=e(1237),c=e(85084),E=e(53670),f=e(60709),d=e(70159),y=e(37499),b=e(5905),A=e(53741),S=e(93306),D=e(32475),I=e(59299),w=e(66216),T=e(81638),R=e(20023),M=n.__importDefault(e(52402)),O=e(24650),x=e(77874),k=e(27953),F=e(44115),L=e(51773),N=e(67481),U=e(5062),W=e(74447),j=e(56551),Q=({resource:V})=>{const{uri:H}=V,K=(0,g.useInjectable)(g.IJSONSchemaRegistry),Y=(0,g.useInjectable)(y.DebugConfigurationManager),X=(0,g.useInjectable)(d.ILaunchService),re=(0,g.useInjectable)(g.CommandService),[oe,he]=(0,m.useState)(0),[me,q]=(0,m.useState)(),[be,ge]=(0,m.useState)([]);(0,m.useEffect)(()=>{const Te=new g.Disposable;return Te.addDispose(K.onDidChangeSchema(We=>{We===f.launchExtensionSchemaUri&&fe(K.getSchemaContributions())})),Te.addDispose(Y.onDidChange(async()=>{Oe()})),fe(K.getSchemaContributions()),Oe(),()=>Te.dispose()},[]);const te=(0,m.useMemo)(()=>H.withScheme(g.Schemes.file),[H]),fe=(0,m.useCallback)(Te=>{const We=Te.schemas[f.launchExtensionSchemaUri];We&&q(We)},[me]),Oe=(0,m.useCallback)(()=>{const Te=Y.all;Array.isArray(Te)&&ge(Te.map(We=>new O.ConfigurationItemsModel(We.configuration.name,We.configuration)))},[]),Pe=(0,m.useMemo)(()=>me?(0,_.default)(me,["properties","configurations","items","defaultSnippets"])||[]:[],[me]),Me=(0,m.useCallback)((Te,We)=>{const{configuration:pe}=Te;pe&&he(We)},[]),Be=(0,m.useMemo)(()=>{if(be&&!(0,g.isUndefined)(oe)){const Te=be[oe];if(!Te)return;const{configuration:We,description:pe,label:ie}=Te;return We?{body:We,description:pe,label:ie}:void 0}},[be,oe]),De=(0,m.useCallback)(async Te=>{const{configuration:We}=Te;await Y.insertConfiguration(te,We),re.executeCommand(g.EDITOR_COMMANDS.SAVE_URI.id,te)},[Pe]),_e=(0,v.default)(async(Te,We)=>await X.modifyConfigurationsInResource(te,Te,We),100),ke=(0,m.useCallback)(async Te=>{const{formData:We}=Te;!We||(0,g.isUndefined)(oe)||_e(Te,oe)},[oe,Be]);return m.default.createElement(s.ComponentContextProvider,{value:{getIcon:g.getIcon,localize:g.localize}},m.default.createElement("div",{className:M.default.launch_container},m.default.createElement(a.SplitPanel,{id:"launch-container",resizeHandleClassName:M.default.devider,className:M.default.launch_panel,direction:"left-to-right"},m.default.createElement(G,{"data-sp-defaultSize":240,"data-sp-minSize":150,inputConfigurationItems:be,snippetItems:Pe,onSelectedConfiguration:Me,onAddConfigurationItems:De,currentConfigurationIndex:oe}),m.default.createElement($,{"data-sp-flex":1,snippetItem:Be,schemaContributions:me,onChange:ke}))))};t.LaunchViewContainer=Q;const G=({snippetItems:V,onSelectedConfiguration:H,onAddConfigurationItems:K,inputConfigurationItems:Y,currentConfigurationIndex:X})=>{const re=(0,g.useInjectable)(d.ILaunchService),[oe,he]=m.default.useState(!1),[me,q]=(0,m.useState)(Y);(0,m.useEffect)(()=>{if(me.length===0&&(0,g.isUndefined)(X))return;const Pe=me[X];Pe&&Pe.configuration&&re.nextNewFormData(Pe.configuration,!1)},[X,me]),(0,m.useEffect)(()=>{q([...Y])},[Y]);const be=(0,m.useCallback)((Pe,Me)=>{H(Pe,Me)},[]),ge=({data:Pe,index:Me})=>m.default.createElement("div",{key:Me,className:(0,l.default)(M.default.configuration_item,X===Me?M.default.selected:""),onClick:()=>be(Pe,Me)},m.default.createElement("div",{className:M.default.configuration_wrapper},m.default.createElement("span",{className:M.default.configuration_description},Pe.label))),te=(0,m.useCallback)(Pe=>{he(!1);const{label:Me}=Pe,Be=V.find(Te=>Te.label===Me);if(!Be)return;const{body:De}=Be;if(!(0,g.isObject)(De))return;const _e=Object.keys(De).reduce((Te,We)=>{const pe=De[We];return typeof pe=="string"?Te[We]=(0,b.parseSnippet)(pe):Array.isArray(pe)&&(Te[We]=pe.map(ie=>typeof ie=="string"?(0,b.parseSnippet)(ie):ie)),Te},De),ke=new O.ConfigurationItemsModel(Be.label,_e);ke.setDescription(Be.description||""),K(ke)},[me,V]),fe=Pe=>{he(Pe)},Oe=(0,m.useMemo)(()=>m.default.createElement(h.MenuActionList,{data:V.map(Pe=>new u.LabelMenuItemNode(Pe.label)),afterClick:Pe=>te(Pe)}),[V,me]);return m.default.createElement("div",{className:M.default.launch_indexes_container},m.default.createElement(p.default,{className:M.default.configuration_items_box},({width:Pe,height:Me})=>me.length===0?m.default.createElement("div",{style:{width:Pe},className:M.default.not_configuration_content},(0,g.localize)("debug.action.no.configuration")):m.default.createElement(s.RecycleList,{width:Pe,height:Me,data:me,template:ge})),m.default.createElement("div",{className:M.default.foot_box},m.default.createElement(s.Button,{className:M.default.button,placement:"topCenter",menu:Oe,moreVisible:oe,onVisibleChange:fe},(0,g.localize)("debug.action.add.configuration"))))},Z=(0,r.withTheme)({widgets:{TextWidget:R.TextWidget,SelectWidget:T.SelectWidget,CheckboxWidget:A.CheckboxWidget},fields:{ObjectField:I.ObjectField}}),$=({snippetItem:V,schemaContributions:H,onChange:K})=>{if(!V)return m.default.createElement("div",{className:M.default.no_onfiguration},(0,g.localize)("debug.action.no.configuration"));const Y=(0,g.useInjectable)(d.ILaunchService),X=(0,m.useMemo)(()=>{const he=(0,c.acquireAjv)(),q=((0,_.default)(H,["properties","configurations","items","oneOf"])||[]).find(be=>{const{body:ge}=V;return he.validate(be,ge)});if(q)return Y.setRawSchemaProperties(q),q},[V,H]),re=(0,m.useMemo)(()=>{if(!(X&&X.properties))return;const{label:he,body:me,description:q}=V,{properties:be,required:ge}=X,te=Object.keys(me).reduce((Oe,Pe)=>{const Me=be[Pe];return Me?.type===f.JSON_SCHEMA_TYPE.ARRAY&&(0,g.isUndefined)(Me?.items)&&(Me.items={type:f.JSON_SCHEMA_TYPE.STRING}),Array.isArray(Me?.type)&&(Me.type=Me.type[0]||f.JSON_SCHEMA_TYPE.STRING),Array.isArray(Me?.anyOf)&&(Me.anyOf=Me.anyOf.filter(Be=>Object.keys(Be).length>0)),Me?.type===f.JSON_SCHEMA_TYPE.OBJECT&&!(0,g.isUndefined)(Me?.additionalProperties)&&(Me.additionalProperties={type:f.JSON_SCHEMA_TYPE.STRING}),Me?.type===f.JSON_SCHEMA_TYPE.OBJECT&&!(0,g.isUndefined)(Me?.properties)&&Object.keys(Me.properties).length>6&&(Me.properties={},Me[E.MASSIVE_PROPERTY_FLAG]=!0),!Me?.description&&Me?.markdownDescription&&(Me.description=Me.markdownDescription),Oe[Pe]=Me,Oe},{}),fe={title:he,type:f.JSON_SCHEMA_TYPE.OBJECT,required:ge,description:q,properties:te};return Y.nextNewSchema(fe),fe},[V,X]),oe=(0,m.useCallback)(he=>{if(!(X&&X.properties)||!(re&&re.properties))return;const{label:me}=he;Y.addNewItem(me)},[V,X,re]);return m.default.createElement("div",{className:M.default.launch_schema_body_container},re&&X&&m.default.createElement(Z,{formData:V.body,schema:re,validator:o.default,fields:{AnyOfField:S.AnyOfField,OneOfField:S.AnyOfField,ArrayField:D.ArrayField},onChange:K,templates:{ArrayFieldTemplate:F.ArrayFieldTemplate,ArrayFieldItemTemplate:k.ArrayFieldItemTemplate,DescriptionFieldTemplate:U.DescriptionFieldTemplate,FieldTemplate:W.FieldTemplate,ObjectFieldTemplate:j.ObjectFieldTemplate,WrapIfAdditionalTemplate:x.WrapIfAdditionalTemplate,BaseInputTemplate:L.BaseInputTemplate,TitleFieldTemplate:w.TitleField,ButtonTemplates:{MoveUpButton:N.MoveUpButton,MoveDownButton:N.MoveDownButton,RemoveButton:N.RemoveButton,SubmitButton:he=>m.default.createElement(N.AddItemButton,{...he,onAddClick:oe}),AddButton:N.AddButton,CopyButton:N.CopyButton}}}))}},24650:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationItemsModel=void 0;const n=e(43718);class r{get uniqueID(){return this._uniqueID}get description(){return this._description}constructor(l,_){this.label=l,this.configuration=_,this._uniqueID=(0,n.uuid)(6)}setDescription(l){this._description=l}}t.ConfigurationItemsModel=r},77874:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WrapIfAdditionalTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(43718),m=e(64582),p=e(44888),s=n.__importDefault(e(40043)),g=a=>{const{children:h,classNames:u,style:c,disabled:E,id:f,label:d,onKeyChange:y,onDropPropertyClick:b,readonly:A,registry:S,schema:D}=a,I=(0,_.useInjectable)(p.LaunchService),{readonlyAsDisabled:w=!0}=S.formContext,{templates:T}=S,{RemoveButton:R}=T.ButtonTemplates,M=r.ADDITIONAL_PROPERTY_FLAG in D,O=m.MASSIVE_PROPERTY_FLAG in D,x=(0,r.getTemplate)("TitleFieldTemplate",S),k=(0,r.getTemplate)("DescriptionFieldTemplate",S),F=(0,o.useMemo)(()=>D.description||D.markdownDescription,[D]),L=(0,o.useCallback)(async()=>{await I.openLaunchConfiguration()},[]);if(O)return o.default.createElement("div",{className:u,style:c},d&&o.default.createElement("div",{className:s.default.object_title},o.default.createElement(x,{id:(0,r.titleId)(f),title:d,schema:D,registry:S})),F&&o.default.createElement("div",{className:s.default.object_description},o.default.createElement(k,{id:(0,r.descriptionId)(f),description:F,schema:D,registry:S})),o.default.createElement("div",{className:s.default.control_wrap},o.default.createElement("a",{onClick:L},(0,v.localize)("debug.launch.view.edit.inLaunchJson"))));if(!M)return o.default.createElement("div",{className:u,style:c},h);const N=(0,o.useCallback)(({target:U})=>y(U.value),[y]);return o.default.createElement("div",{className:u,style:c},o.default.createElement("div",{className:s.default.additional_field_template},o.default.createElement("div",{className:s.default.form_additional_container},o.default.createElement("div",{className:s.default.form_additional},o.default.createElement(l.Input,{className:s.default.form_control,defaultValue:d,value:d,placeholder:(0,v.formatLocalize)("debug.launch.view.template.input.placeholder","Key"),disabled:E||w&&A,id:`${f}-key`,name:`${f}-key`,onBlur:A?void 0:N,type:"text"})),o.default.createElement("div",{className:s.default.form_additional_children},h),o.default.createElement(R,{disabled:E||A,onClick:b(d),registry:S}))))};t.WrapIfAdditionalTemplate=g},27953:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayFieldItemTemplate=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=n.__importDefault(e(40043)),_={width:"100%"},v={width:"calc(100% / 4)"},m=p=>{const{className:s,children:g,disabled:a,hasCopy:h,hasMoveDown:u,hasMoveUp:c,hasRemove:E,hasToolbar:f,index:d,onCopyIndexClick:y,onDropIndexClick:b,onReorderClick:A,readonly:S,registry:D}=p,{CopyButton:I,MoveDownButton:w,MoveUpButton:T,RemoveButton:R}=D.templates.ButtonTemplates,M=(0,o.useMemo)(()=>y(d),[d,y]),O=(0,o.useMemo)(()=>b(d),[d,b]),x=(0,o.useMemo)(()=>A(d,d-1),[d,A]),k=(0,o.useMemo)(()=>A(d,d+1),[d,A]);return o.default.createElement("div",{key:`array-item-${d}`,className:(0,r.default)(s,l.default.array_field_item_template)},o.default.createElement("div",{className:l.default.control_field},o.default.cloneElement(g,{name:""})),f&&o.default.createElement("div",{className:l.default.toolbar},o.default.createElement("div",{style:_},(c||u)&&o.default.createElement(T,{disabled:a||S||!c,onClick:x,style:v,registry:D}),(c||u)&&o.default.createElement(w,{disabled:a||S||!u,onClick:k,style:v,registry:D}),h&&o.default.createElement(I,{disabled:a||S,onClick:M,style:v,registry:D}),E&&o.default.createElement(R,{disabled:a||S,onClick:O,style:v,registry:D}))))};t.ArrayFieldItemTemplate=m},44115:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayFieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),l=n.__importDefault(e(14041)),_=n.__importDefault(e(40043)),v=m=>{const{canAdd:p,className:s,disabled:g,formContext:a,idSchema:h,items:u,onAddClick:c,readonly:E,registry:f,required:d,schema:y,title:b,uiSchema:A}=m,S=(0,r.getUiOptions)(A),D=(0,r.getTemplate)("ArrayFieldDescriptionTemplate",f,S),I=(0,r.getTemplate)("ArrayFieldItemTemplate",f,S),w=(0,r.getTemplate)("ArrayFieldTitleTemplate",f,S),{ButtonTemplates:{AddButton:T}}=f.templates;return l.default.createElement("fieldset",{className:(0,o.default)(s),id:h.$id},l.default.createElement("div",{className:_.default.array_field_template},(S.title||b)&&l.default.createElement("div",{className:_.default.array_item_label},l.default.createElement(w,{idSchema:h,required:d,title:S.title||b,schema:y,uiSchema:A,registry:f})),(S.description||y.description)&&l.default.createElement("div",{className:_.default.array_item_description},l.default.createElement(D,{description:S.description||y.description,idSchema:h,schema:y,uiSchema:A,registry:f})),u&&u.map(({key:R,...M})=>l.default.createElement(I,{key:R,...M})),p&&l.default.createElement("div",{className:_.default.array_item_add},l.default.createElement(T,{disabled:g||E,onClick:c,registry:f}))))};t.ArrayFieldTemplate=v},51773:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseInputTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),l=e(97267),_={width:"100%"},v=m=>{const{disabled:p,formContext:s,id:g,onBlur:a,onChange:h,onChangeOverride:u,onFocus:c,options:E,placeholder:f,readonly:d,schema:y,value:b,type:A}=m,S=(0,r.getInputProps)(y,A,E,!1),{readonlyAsDisabled:D=!0}=s,I=O=>h(O),w=u||(({target:O})=>h(O.value===""?E.emptyValue:O.value)),T=({target:O})=>a(g,O.value),R=({target:O})=>c(g,O.value),M=o.default.createElement(l.Input,{disabled:p||D&&d,id:g,name:g,onBlur:d?void 0:T,onChange:d?void 0:w,onFocus:d?void 0:R,placeholder:f,style:_,list:y.examples?(0,r.examplesId)(g):void 0,...S,value:b,"aria-describedby":(0,r.ariaDescribedByIds)(g,!!y.examples)});return o.default.createElement(o.default.Fragment,null,M,Array.isArray(y.examples)&&o.default.createElement("datalist",{id:(0,r.examplesId)(g)},y.examples.concat(y.default&&!y.examples.includes(y.default)?[y.default]:[]).map(O=>o.default.createElement("option",{key:O,value:O}))))};t.BaseInputTemplate=v},67481:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddItemButton=t.CopyButton=t.AddButton=t.RemoveButton=t.MoveDownButton=t.MoveUpButton=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(81139),_=e(41869),v=e(25918),m=e(1237),p=e(43718),s=e(64582),g=n.__importDefault(e(40043)),a=d=>r.default.createElement(o.Button,{...d,type:"primary",icon:l.defaultIconfont.arrowup},r.default.createElement("span",{className:(0,o.getIcon)(l.defaultIconfont.arrowup)}));t.MoveUpButton=a;const h=d=>r.default.createElement(o.Button,{...d,type:"primary",icon:l.defaultIconfont.arrowdown},r.default.createElement("span",{className:(0,o.getIcon)(l.defaultIconfont.arrowdown)}));t.MoveDownButton=h;const u=d=>r.default.createElement(o.Button,{...d,type:"danger",icon:l.defaultIconfont.delete},r.default.createElement("span",{className:(0,o.getIcon)(l.defaultIconfont.delete)}));t.RemoveButton=u;const c=d=>r.default.createElement(o.Button,{...d,type:"primary",icon:l.defaultIconfont.plus},r.default.createElement("span",{className:(0,o.getIcon)(l.defaultIconfont.plus)})," ",(0,p.localize)("debug.launch.view.template.button.addItem"));t.AddButton=c;const E=d=>r.default.createElement(o.Button,{...d,type:"primary",icon:l.defaultIconfont["file-copy"]},r.default.createElement("span",{className:(0,o.getIcon)(l.defaultIconfont["file-copy"])}));t.CopyButton=E;const f=d=>{const{registry:{rootSchema:y},onAddClick:b}=d,A=(0,_.useInjectable)(s.ILaunchService),[S,D]=r.default.useState(!1),[I,w]=r.default.useState([]),{rawSchemaProperties:T}=A,R=(0,r.useCallback)(x=>D(x),[]),M=(0,r.useCallback)(x=>{D(!1),b(x)},[]),O=(0,r.useCallback)(()=>{const{properties:x}=T,{properties:k}=y;if(!x||!k)return;const F=Object.keys(x).filter(L=>!Object.hasOwn(k,L)).map(L=>new m.LabelMenuItemNode(L));w(F)},[y,T]);return(0,r.useEffect)(()=>{const x=new p.Disposable;return x.addDispose(A.onChangeSchema(()=>{requestAnimationFrame(()=>{O()})})),O(),()=>x.dispose()},[T,y]),r.default.createElement(o.Button,{type:"secondary",icon:l.defaultIconfont.plus,className:g.default.add_new_field,menu:r.default.createElement(v.MenuActionList,{afterClick:M,data:I,style:{maxHeight:600}}),moreVisible:S,onVisibleChange:R},r.default.createElement("span",{className:(0,o.getIcon)(l.defaultIconfont.plus)})," ",(0,p.localize)("debug.launch.view.template.button.submit"))};t.AddItemButton=f},5062:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DescriptionFieldTemplate=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(40043)),l=_=>{const{id:v,schema:m}=_,p=(0,r.useMemo)(()=>{var s;return(s=m.description)!==null&&s!==void 0?s:m.markdownDescription},[m,m.description,m.markdownDescription]);return p?r.default.createElement("span",{id:v,className:o.default.description_field_template},p):null};t.DescriptionFieldTemplate=l},74447:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),l=n.__importDefault(e(14041)),_=v=>{const{classNames:m,style:p,children:s,id:g,schema:a,label:h,hidden:u,formContext:c,uiSchema:E,registry:f,disabled:d,onDropPropertyClick:y,onKeyChange:b,required:A,readonly:S}=v,{wrapperStyle:D}=c,I=(0,r.getUiOptions)(E),w=(0,r.getTemplate)("WrapIfAdditionalTemplate",f,I);return u?null:l.default.createElement(w,{classNames:m,style:p,disabled:d,id:g,label:h,onDropPropertyClick:y,onKeyChange:b,readonly:S,required:A,schema:a,uiSchema:E,registry:f},g==="root"?s:l.default.createElement("div",{className:(0,o.default)(m),style:D},s))};t.FieldTemplate=_},56551:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectFieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),l=n.__importStar(e(14041)),_=e(97267),v=e(41869),m=e(70159),p=n.__importDefault(e(40043)),s=a=>{const{schema:h,uiSchema:u,formData:c}=a,{properties:E}=h;return E?Object.keys(E).length===0?!0:Object.values(E).some(f=>f[r.ADDITIONAL_PROPERTY_FLAG])?(0,r.canExpand)(h,u,c):!1:!1},g=a=>{const{schema:h,uiSchema:u,required:c,registry:E,idSchema:f,title:d,disabled:y,readonly:b,properties:A,onAddClick:S}=a,D=(0,v.useInjectable)(m.ILaunchService),I=(0,r.getUiOptions)(u),w=(0,r.getTemplate)("TitleFieldTemplate",E,I),T=(0,r.getTemplate)("DescriptionFieldTemplate",E,I),{ButtonTemplates:{AddButton:R}}=E.templates,M=(0,l.useMemo)(()=>{var L;return(L=a.description)!==null&&L!==void 0?L:h.markdownDescription},[a.description,h]),O=(0,l.useMemo)(()=>f.$id==="root"?(0,o.default)(p.default.object_field_container,p.default.root_object_field_container):p.default.object_field_container,[f]),x=(0,l.useMemo)(()=>f.$id==="root"?(0,o.default)(p.default.property_wrapper,p.default.root_property_wrapper):p.default.property_wrapper,[f]),k=(0,l.useCallback)(L=>{const{name:N}=L;D.delItem(N)},[]),F=(0,l.useCallback)(L=>{const{rawSchemaProperties:N}=D;if(!N)return null;const U=N.required||[];return l.default.createElement("div",{key:L.name,className:x,onKeyDown:W=>{W.key===v.Key.ENTER.code&&(W.preventDefault(),W.stopPropagation())}},L.content,U.includes(L.name)||f.$id!=="root"?null:l.default.createElement("div",{className:p.default.wrapper_delete,onClick:()=>k(L)},l.default.createElement("span",{className:(0,o.default)((0,_.getIcon)("close-circle"),p.default.close_icon)})))},[A,D.rawSchemaProperties,f]);return l.default.createElement("div",{className:p.default.object_field_template},l.default.createElement("fieldset",null,l.default.createElement("div",{className:O},d&&l.default.createElement("div",{className:p.default.object_title},l.default.createElement(w,{id:(0,r.titleId)(f),title:d,required:c,schema:h,uiSchema:u,registry:E})),M&&l.default.createElement("div",{className:p.default.object_description},l.default.createElement(T,{id:(0,r.descriptionId)(f),description:M,schema:h,uiSchema:u,registry:E})),A.filter(L=>!L.hidden).map(L=>F(L))),s(a)&&l.default.createElement(R,{onClick:S(h),disabled:y||b,registry:E})))};t.ObjectFieldTemplate=g},81450:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiConsoleNode=t.TreeWithLinkWrapper=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=n.__importDefault(e(43144)),_=e(97267),v=e(41869),m=n.__importDefault(e(80315)),p=a=>{if(typeof a>"u")return(0,r.default)(m.default.variable_repl_text,m.default.log);switch(a){case v.MessageType.Error:return(0,r.default)(m.default.variable_repl_text,m.default.error);case v.MessageType.Warning:return(0,r.default)(m.default.variable_repl_text,m.default.warn);case v.MessageType.Info:return(0,r.default)(m.default.variable_repl_text,m.default.info);default:return(0,r.default)(m.default.variable_repl_text,m.default.log)}};class s extends o.default.Component{componentDidMount(){if(this.props.html){const h=l.default.findDOMNode(this);h?.appendChild(this.props.html)}}render(){return o.default.createElement("code",{className:this.props.className})}}t.TreeWithLinkWrapper=s;class g extends _.TreeNode{get parent(){return this._compositeTreeNode}static is(h){return!!h&&!!h.template}constructor(h,u,c,E,f,d,y){var b;super({},u),this.description=h,this._compositeTreeNode=u,this.linkDetector=c,this.ansiNode=E,this.severity=f,this.source=d,this.line=y,this.linkDetectorHTML=(b=this.ansiNode)!==null&&b!==void 0?b:this.linkDetector.linkify(this.description)}get name(){return`log_${this.id}`}get el(){return this.linkDetectorHTML}get template(){return()=>o.default.createElement(s,{className:p(this.severity),html:this.linkDetectorHTML})}}t.AnsiConsoleNode=g},98650:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverVariableRoot=t.DebugVariableRoot=t.DebugWatchRoot=t.DebugConsoleRoot=t.DebugConsoleNode=t.DebugConsoleVariableContainer=t.DebugWatchNode=t.DebugScope=t.DebugVariableContainer=t.DebugVariable=t.DebugVirtualVariable=t.ExpressionContainer=t.ExpressionNode=t.DebugConsoleTreeService=t.ExpressionTreeService=void 0;const n=e(97267),r=e(41869),o=e(55121),l=e(44781),_="undefined";class v{constructor(D,I,w){this.session=D,this.source=I,this.line=w}async resolveChildren(D){var I;return b.is(D)&&!D.variablesReference&&!D.presetChildren?await((I=this.session)===null||I===void 0?void 0:I.getScopes(D))||[]:await this.doResolve(D)}async doResolve(D){const I=[];if(!D)return I;if(Array.isArray(D.presetChildren))return D.presetChildren;if(!this.session||this.session.terminated)return I;const{variablesReference:w,startOfVariables:T,indexedVariables:R,namedVariables:M}=D;if(M)return await this.fetch(I,w,"named",D),I;if(R){let O=s.BASE_CHUNK_SIZE;for(;R>O*s.BASE_CHUNK_SIZE;)O*=s.BASE_CHUNK_SIZE;if(R>O){const x=Math.ceil(R/O);for(let k=0;k<x;k++){const F=D.startOfVariables+k*O,L=Math.min(O,R-k*O);I.push(new g({session:this.session,variablesReference:D.variablesReference,namedVariables:0,indexedVariables:L,startOfVariables:F,name:`[${F}..${F+L-1}]`},D))}return I}}return await this.fetch(I,w,"indexed",D,T,R),I}async fetch(D,I,w,T,R,M){try{const O=await this.session.sendRequest("variables",{variablesReference:I,filter:w,start:R,count:M}),{variables:x}=O.body;for(const k of x)k.variablesReference?D.push(new h(this.session,k,T,this.source,this.line)):D.push(new a(this.session,k,T))}catch(O){D.push({severity:r.MessageType.Error,visible:!!O.message,message:O.message})}}sortComparator(D,I){return 0}}t.ExpressionTreeService=v;class m extends v{sortComparator(D,I){return 0}}t.DebugConsoleTreeService=m;class p extends n.TreeNode{constructor(D,I){var w;super(new v(D.session,D.source,D.line),I,void 0,{name:String((w=D.session)===null||w===void 0?void 0:w.id)}),this.variablesReference=D.variablesReference||0,this.namedVariables=D.namedVariables,this.indexedVariables=D.indexedVariables,this.memoryReference=D.memoryReference,this.source=D.source,this.line=D.line}get badge(){return this.source?`${this.source.name}:${this.line}`:""}get displayName(){return this.name}}t.ExpressionNode=p;class s extends n.CompositeTreeNode{constructor(D,I,w,T){var R;super(w||new v(D.session,D.source,D.line),I,void 0,{name:T||((R=D.session)===null||R===void 0?void 0:R.id)}),this.session=D.session,this.variablesReference=D.variablesReference||0,this.namedVariables=D.namedVariables,this.indexedVariables=D.indexedVariables,this.startOfVariables=D.startOfVariables||0,this.memoryReference=D.memoryReference,this.source=D.source,this.line=D.line}get badge(){return this.source?`${this.source.name}:${this.line}`:""}get displayName(){return this.name}get path(){return this.parent?new o.Path(this.parent.path).join(String(this.id)).toString():String(this.id)}}t.ExpressionContainer=s,s.BASE_CHUNK_SIZE=100;class g extends s{constructor(D,I){super(D,I,void 0,D.name),this._name=D.name}}t.DebugVirtualVariable=g;class a extends p{constructor(D,I,w){super({session:D,variablesReference:I.variablesReference,namedVariables:I.namedVariables,indexedVariables:I.indexedVariables,memoryReference:I.memoryReference},w),this.session=D,this.variable=I}get variableMenuContext(){return this.variable.__vscodeVariableMenuContext||""}toDebugProtocolObject(){return{name:this.name,variablesReference:this.variable.variablesReference||0,value:this.value,evaluateName:this.evaluateName,memoryReference:this.memoryReference}}get name(){if(this.variable){if(this.variable.name)return this.variable.name;if(this.variable.evaluateName){const D=/\["(.+)"]/.exec(this.variable.evaluateName);if(D)return D[1];{const I=this.variable.evaluateName.split(".");return I[I.length-1]}}}return String(this.id)}get evaluateName(){var D;return((D=this.variable)===null||D===void 0?void 0:D.evaluateName)||""}get description(){return this.value||_}get value(){return this._value||this.variable.value}get variableType(){return this._type||this.variable.type}get supportSetVariable(){return!!this.session&&!!this.session.capabilities.supportsSetVariable}async setValue(D){if(!this.session||this.session.terminated)return;const{name:I,parent:w}=this,T=w.variablesReference;try{const R=await this.session.sendRequest("setVariable",{variablesReference:T,name:I,value:D});this._value=R.body.value,this._type=R.body.type,this.variablesReference=R.body.variablesReference||0,this.namedVariables=R.body.namedVariables,this.indexedVariables=R.body.indexedVariables}catch(R){throw R}}getRawScope(){let D=this.parent;for(;D!==void 0&&!(D instanceof u);)D=D?.parent;return D.getRawScope()}}t.DebugVariable=a;class h extends s{constructor(D,I,w,T,R){super({session:D,variablesReference:I.variablesReference,namedVariables:I.namedVariables,indexedVariables:I.indexedVariables,memoryReference:I.memoryReference,source:T,line:R},w,void 0,I?.name||(I.evaluateName?/\["(.+)"]/.exec(I.evaluateName)?/\["(.+)"]/.exec(I.evaluateName)[1]:I.evaluateName.split(".")[I.evaluateName.split(".").length-1]:"")),this.session=D,this.variable=I}get variableMenuContext(){return this.variable.__vscodeVariableMenuContext||""}toDebugProtocolObject(){return{name:this.name,variablesReference:this.variable.variablesReference||0,value:this.value,evaluateName:this.evaluateName,memoryReference:this.memoryReference}}get name(){if(this.variable){if(this.variable.name)return this.variable.name;if(this.variable.evaluateName){const D=/\["(.+)"]/.exec(this.variable.evaluateName);if(D)return D[1];{const I=this.variable.evaluateName.split(".");return I[I.length-1]}}}return this.variable.type||String(this.id)}get evaluateName(){var D;return((D=this.variable)===null||D===void 0?void 0:D.evaluateName)||""}get description(){return this._value||this.variable.value||_}get tooltip(){return this.variableType||this.description}get variableType(){return this._variableType||this.variable.type}get value(){return this._value||this.variable.value}get supportSetVariable(){return!!this.session&&!!this.session.capabilities.supportsSetVariable}async setValue(D){if(!this.session||this.session.terminated)return;const{name:I,parent:w}=this;if(!w)return;const T=w.variablesReference,R=await this.session.sendRequest("setVariable",{variablesReference:T,name:I,value:D});this._value=R.body.value,this._variableType=R.body.type,this.variablesReference=R.body.variablesReference||0,this.namedVariables=R.body.namedVariables,this.indexedVariables=R.body.indexedVariables}getRawScope(){let D=this.parent;for(;D!==void 0&&!(D instanceof u);)D=D?.parent;return D.getRawScope()}}t.DebugVariableContainer=h,h.BOOLEAN_REGEX=/^true|false$/i,h.STRING_REGEX=/^(['"]).*\1$/;class u extends s{constructor(D,I,w){super({session:I,variablesReference:D.variablesReference,namedVariables:D.namedVariables,indexedVariables:D.indexedVariables},w,void 0,D.name),this.raw=D,this.session=I}getRawScope(){return this.raw}range(){const D=this.getRawScope();return D.line&&D.column&&D.endLine&&D.endColumn?new l.Range(D.line,D.column,D.endLine,D.endColumn):void 0}}t.DebugScope=u;class c extends s{static is(D){return!!D&&!!D.expression}constructor(D,I,w){super({session:D},w,void 0,I),this.session=D,this.expression=I}get description(){return this._available?this._description||_:c.notAvailable}get available(){return this._available}getRawWatch(){return this.raw}async evaluate(D="watch"){if(this.session)try{this._available=!0;const{expression:I}=this,w=await this.session.evaluate(I,D);w&&(this.name=this.expression,this._description=w.result,this.variablesReference=w.variablesReference,this.namedVariables=w.namedVariables,this.indexedVariables=w.indexedVariables,this.memoryReference=w.memoryReference,this.raw=w)}catch(I){this.name=this.expression,this._description=I.message}else this.name=this.expression,this._available=!1}async getClipboardValue(){if(this.session&&this.session.capabilities.supportsValueFormattingOptions)try{const{expression:D}=this,I=await this.session.evaluate(D,"clipboard");if(I)return I.result}catch{return""}else return this._description}}t.DebugWatchNode=c,c.notAvailable=(0,r.localize)("debug.watch.notAvailable");class E extends h{static is(D){return!!D&&D.uniqueID===E.uniqueID}get uniqueID(){return E.uniqueID}get description(){return this.variable?this.variable.value:_}get tooltip(){return this.variable?this.variable.value:""}}t.DebugConsoleVariableContainer=E,E.uniqueID="DebugConsoleVariable";class f extends s{static is(D){return!!D&&!!D.expression}get available(){return this._available}constructor(D,I,w){super(D,w,void 0,I),this.options=D,this.expression=I,this._description=_}get description(){return this._description}async evaluate(D="repl"){const{expression:I}=this;if(this.session)try{if(typeof I=="string"&&I){const w=await this.session.evaluate(I,D);w&&(this.name=I,this._description=w.result,this.variablesReference=w.variablesReference,this.namedVariables=w.namedVariables,this.indexedVariables=w.indexedVariables,this.memoryReference=w.memoryReference,this._available=!0)}else if(this.options.variablesReference){const w=await this.session.variables(this.options.variablesReference);w.variables.length&&(this.name=w.variables.map(T=>T.value).join(`
33295
- `),this._description="",this._available=!0)}}catch(w){this._available=!1,this.name=I,this._description=w.message}else this._available=!1,this.name=I}}t.DebugConsoleNode=f;class d extends s{static is(D){return!!D&&!D.parent}constructor(D,I=[]){super({session:D},void 0,new m(D)),this.session=D,this.presetChildren=I}get expanded(){return!0}updatePresetChildren(D){this.presetChildren=D}}t.DebugConsoleRoot=d;class y extends s{static is(D){return!!D&&!D.parent}constructor(D,I=[]){super({session:D},void 0),this.session=D,this.presetChildren=I}get expanded(){return!0}updatePresetChildren(D){this.presetChildren=D}}t.DebugWatchRoot=y;class b extends h{static is(D){return!!D&&!D.parent}constructor(D){super(D,{},void 0),this.session=D}get expanded(){return!0}}t.DebugVariableRoot=b;class A extends s{constructor(D,I){super({session:I}),this.expression=D,this.session=I,this._value="",this._available=!1}get name(){return this._value}get available(){return this._available}async evaluate(D="repl"){if(this.session)try{const{expression:I}=this,w=await this.session.evaluate(I,D);w&&(this._value=w.result,this._available=!0,this.variablesReference=w.variablesReference,this.namedVariables=w.namedVariables,this.indexedVariables=w.indexedVariables,this.memoryReference=w.memoryReference)}catch(I){this._value=I.message,this._available=!1}else this._value="Please start a debug session to evaluate",this._available=!1}}t.DebugHoverVariableRoot=A},16170:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(98650),t),n.__exportStar(e(81450),t)},57332:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointsTreeNode=void 0;const n=e(43718),r=e(99797);class o{constructor(_,v){this.label="",this._onDescriptionChange=new n.Emitter;const{breakpoint:m}=v;this._uri=_,this.label=(0,r.isDebugBreakpoint)(m)?_.displayName:"",this.rawData=v,this.rawData.onDescriptionChange=this._onDescriptionChange.event}get breakpoint(){return this.rawData.breakpoint}get uri(){return this._uri}fireDescriptionChange(_){this.rawData.description=_,this._onDescriptionChange.fire(_)}}t.BreakpointsTreeNode=o},97319:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointsService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),_=e(54414),v=e(57517),m=e(28423),p=e(51500),s=e(26199),g=e(64582),a=e(26296),h=e(99797),u=e(38029),c=e(32756),E=e(57332);let f=class extends o.WithEventBus{get inputEditor(){return this._inputEditor}constructor(){super(),this._onDidChangeBreakpointsTreeNode=new o.Emitter,this.onDidChangeBreakpointsTreeNode=this._onDidChangeBreakpointsTreeNode.event,this._onDidFocusedBreakpoints=new o.Emitter,this.onDidFocusedBreakpoints=this._onDidFocusedBreakpoints.event,this.treeNodeMap=new Map,this.enable=(0,m.observableValue)(this,!1),this.inDebugMode=(0,m.observableValue)(this,!1),this.toggleBreakpointEnable=y=>{if((0,h.isDebugBreakpoint)(y)){const b=this.breakpoints.getBreakpoint(o.URI.parse(y.uri),{lineNumber:y.raw.line,column:y.raw.column});b&&(b.enabled=!b.enabled,this.breakpoints.updateBreakpoint(b))}(0,h.isDebugExceptionBreakpoint)(y)&&this.breakpoints.updateExceptionBreakpoints(y.filter,!y.default)},this.init()}launchFocusedBreakpoints(y){this._onDidFocusedBreakpoints.fire(y)}async init(){await this.updateRoots(),this.workspaceService.onWorkspaceChanged(async()=>{this.updateRoots(),this.updateBreakpoints()}),this.breakpoints.onDidChangeBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.onDidChangeExceptionsBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.whenReady.then(()=>{this.updateBreakpoints()}),this.contextKeyService.onDidChangeContext(y=>{y.payload.affectsSome(new Set([g.CONTEXT_IN_DEBUG_MODE_KEY]))&&(0,m.transaction)(b=>{this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,b)})})}getBreakpointDecoration(y,b=!1,A=!0){return new h.DebugDecorator().getDecoration(y,b,A)}onRenameFile(y){this.removeBreakpoints(y.payload.oldUri)}onDeleteFile(y){this.removeBreakpoints(y.payload.oldUri)}removeBreakpoints(y){this.breakpoints.cleanAllMarkers(y),this.updateBreakpoints()}async updateRoots(){(0,m.transaction)(b=>{this.enable.set(this.breakpoints.breakpointsEnabled,b),this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,b)});const y=await this.workspaceService.roots;this.roots=y.map(b=>new o.URI(b.uri))}extractNodes(y){if((0,h.isDebugBreakpoint)(y))return{id:y.id,name:"",description:"",onDescriptionChange:o.Event.None,breakpoint:y};if((0,h.isDebugExceptionBreakpoint)(y))return{id:y.filter,name:y.label,onDescriptionChange:o.Event.None,description:"",breakpoint:y}}async updateBreakpoints(){await this.breakpoints.whenReady,this.treeNodeMap.clear(),[...this.breakpoints.getExceptionBreakpoints(),...this.breakpoints.getBreakpoints()].forEach(b=>{const A=this.extractNodes(b);if(A){const S=(0,h.isDebugBreakpoint)(b)?o.URI.parse(b.uri):h.EXCEPTION_BREAKPOINT_URI,D=this.treeNodeMap.get(S.toString())||[];D.push(new E.BreakpointsTreeNode(S,A)),this.treeNodeMap.set(S.toString(),D)}}),this._onDidChangeBreakpointsTreeNode.fire(this.treeNodeMap)}async getDocumentModelRef(y){const b=this.documentService.getModelReference(y);return b||this.documentService.createModelReference(y)}async refreshBreakpointsInfo(){const y=this.treeNodeMap.values(),b=Array.from(y).reduce((A,S)=>A.concat(S),[]);for await(const A of b){const{rawData:S,uri:D}=A;if((0,h.isDebugBreakpoint)(S.breakpoint)){const I=S.breakpoint.raw.line,w=await this.getDocumentModelRef(D);if(!w)return;const T=w.instance.getMonacoModel(),R=T.getLineCount();if(I>R)return;const M=T.getLineContent(I);A.fireDescriptionChange(M.trim()),w.dispose()}}}removeAllBreakpoints(){this.breakpoints.clearBreakpoints()}delBreakpoint(y){this.breakpoints.delBreakpoint(y)}toggleBreakpoints(){this.breakpoints.breakpointsEnabled=!this.breakpoints.breakpointsEnabled,(0,m.transaction)(y=>{this.enable.set(this.breakpoints.breakpointsEnabled,y)}),this.enable.get()?this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"enabled"):this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"unenabled")}async createBreakpointInput(y){this._inputEditor=await this.editorService.createCodeEditor(y,{...(0,_.getSimpleEditorOptions)(),lineHeight:21,scrollbar:{horizontal:"hidden",vertical:"hidden",handleMouseWheel:!1},acceptSuggestionOnEnter:"on",renderIndentGuides:!1});const A=(await this.documentService.createModelReference(new o.URI("debug/breakpoint/expression/input").withScheme(o.Schemes.walkThroughSnippet))).instance.getMonacoModel();return A.updateOptions({tabSize:2}),this._inputEditor.monacoEditor.setModel(A),Promise.resolve(this.inputEditor)}};t.DebugBreakpointsService=f,n.__decorate([(0,r.Autowired)(c.DebugViewModel),n.__metadata("design:type",c.DebugViewModel)],f.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(h.BreakpointManager),n.__metadata("design:type",h.BreakpointManager)],f.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(a.IDebugSessionManager),n.__metadata("design:type",u.DebugSessionManager)],f.prototype,"sessions",void 0),n.__decorate([(0,r.Autowired)(l.LabelService),n.__metadata("design:type",l.LabelService)],f.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],f.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(_.EditorCollectionService),n.__metadata("design:type",_.EditorCollectionService)],f.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"documentService",void 0),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidRenameFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidRenameFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onRenameFile",null),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidDeleteFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidDeleteFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onDeleteFile",null),t.DebugBreakpointsService=f=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],f)},85347:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointItem=t.BreakpointFileItem=t.DebugBreakpointView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=n.__importStar(e(20868)),m=e(64582),p=e(99797),s=n.__importDefault(e(96547)),g=e(97319),a=({viewState:c})=>{const E=(0,_.useInjectable)(g.DebugBreakpointsService),f=(0,o.useRef)(!1),[d,y]=(0,o.useState)([]),{enable:b,inDebugMode:A,toggleBreakpointEnable:S}=E,D=(0,_.useAutorun)(b),I=(0,_.useAutorun)(A),w=R=>{const{data:M,inDebugMode:O,breakpointEnabled:x}=R;if((0,p.isDebugBreakpoint)(M.breakpoint)){if(!(O?(0,p.isDebugBreakpoint)(M.breakpoint)&&(0,p.isRuntimeBreakpoint)(M.breakpoint):!0))return"sumi-debug-breakpoint-unverified";const{className:F}=E.getBreakpointDecoration(M.breakpoint,O,x);return F}return""},T=(0,o.useCallback)(R=>{const{roots:M}=E,O=[];R.forEach(([x,k],F)=>{var L;if(p.EXCEPTION_BREAKPOINT_URI.toString()===x)k.forEach((U,W)=>{O.push({label:"",order:F*100+W,expandable:!1,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder_fill,children:[],description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(U.breakpoint),data:U.rawData})})});else{const U=_.URI.parse(x),W=M.filter(G=>G.isEqualOrParent(U))[0],j=W?((L=W.relative(U))===null||L===void 0?void 0:L.toString())||"":_.URI.parse(x).displayName,Q=k.map(G=>G.breakpoint);O.push({label:j,order:F,twisterClassName:s.default.tree_item_twister,renderLabel:o.default.createElement(t.BreakpointFileItem,{label:j,breakpointItems:Q,title:U.toString()}),expandable:!0,expanded:!0,children:k.map(G=>({...G,label:"",expandable:!1,twisterClassName:s.default.tree_item_twister,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder,breakpoint:G.breakpoint,iconClassName:(0,r.default)(w({data:G.rawData,inDebugMode:I,breakpointEnabled:D}),s.default.debug_breakpoints_icon),description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(G.breakpoint),data:G.rawData})}))})}}),f.current||y(O)},[d]);return(0,o.useEffect)(()=>{const R=new _.Disposable;return T(Array.from(E.treeNodeMap.entries())),R.addDispose(E.onDidChangeBreakpointsTreeNode(M=>{T(Array.from(M.entries()))})),()=>{f.current=!0,R.dispose()}},[]),(0,o.useEffect)(()=>{d.length>0&&requestAnimationFrame(()=>{E.refreshBreakpointsInfo()})},[d]),o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints,!D&&s.default.debug_breakpoints_disabled)},o.default.createElement(l.BasicRecycleTree,{onIconClick:(R,M)=>{M.raw.breakpoint&&S(M.raw.breakpoint)},sortComparator:(R,M)=>{if(typeof R.order<"u"&&typeof M.order<"u")return R.order>M.order?1:R.order<M.order?-1:0},indent:18,baseIndent:8,treeData:d,height:c.height}))};t.DebugBreakpointView=a;const h=({label:c,title:E,breakpointItems:f})=>{const d=(0,_.useInjectable)(g.DebugBreakpointsService),y=(0,o.useMemo)(()=>f.some(I=>I.enabled),[f]),[b,A]=o.default.useState(y),S=(0,o.useCallback)(I=>{f.filter(T=>T.enabled===I).forEach(T=>{d.toggleBreakpointEnable(T)}),A(!b)},[b]),D=(0,o.useCallback)(I=>{I.stopPropagation(),f.forEach(w=>{d.delBreakpoint(w)})},[]);return o.default.createElement("div",{className:s.default.debug_breakpoints_file_item},o.default.createElement("div",{className:s.default.file_item_control},o.default.createElement(l.CheckBox,{className:(0,r.default)(s.default.debug_breakpoints_icon,s.default.file_item_checkbox),onChange:()=>S(b),checked:b}),o.default.createElement("i",{className:(0,r.default)((0,_.getIcon)("file-text"),s.default.file_item_icon,s.default.debug_breakpoints_icon)}),o.default.createElement("span",{title:E},c)),o.default.createElement("div",{className:s.default.file_item_control_right},o.default.createElement("i",{className:(0,r.default)((0,_.getIcon)("close"),s.default.close_icon),onClick:I=>D(I)})))};t.BreakpointFileItem=h;const u=({data:c,toggle:E})=>{const f=(0,p.isDebugBreakpoint)(c.breakpoint)?c.breakpoint.enabled:!!c.breakpoint.default,d=(0,_.useInjectable)(m.IDebugSessionManager),y=(0,_.useInjectable)(_.CommandService),b=(0,_.useInjectable)(g.DebugBreakpointsService),[A,S]=o.default.useState(f),[D,I]=o.default.useState(void 0),[w,T]=o.default.useState(c.description),R=(0,o.useMemo)(()=>{const L={preview:!0,focus:!0};if(!(0,p.isDebugBreakpoint)(c.breakpoint))return L;if(D)L.range={startColumn:D.column||0,endColumn:D.column||0,startLineNumber:D.line,endLineNumber:D.line};else{const{raw:N}=c.breakpoint;L.range={startColumn:N.column||0,endColumn:N.column||0,startLineNumber:N.line,endLineNumber:N.line}}return L},[D,c.breakpoint]),M=()=>{E(),S(!A)},O=async()=>{c.breakpoint.uri&&(await y.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI(c.breakpoint.uri),R),b.launchFocusedBreakpoints({uri:new _.URI(c.breakpoint.uri),range:R.range}))};o.default.useEffect(()=>{const L=new _.Disposable,N=()=>{if((0,p.isDebugBreakpoint)(c.breakpoint)&&(0,p.isRuntimeBreakpoint)(c.breakpoint)){const U=(0,p.getStatus)(c.breakpoint);I(U)}};return L.addDispose(d.onDidChangeActiveDebugSession(()=>N())),N(),L.addDispose(c.onDescriptionChange(T)),()=>{I(void 0),L.dispose()}},[]);const x=L=>{L.stopPropagation(),b.delBreakpoint(c.breakpoint)},k=async L=>{L.stopPropagation(),await y.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI(c.breakpoint.uri),R);const{range:N}=R,U=new v.Position(N?.startLineNumber||1,N?.startColumn||1);await y.executeCommand(m.DEBUG_COMMANDS.EDIT_BREAKPOINT.id,U)},F=(0,o.useMemo)(()=>w?o.default.createElement("span",{className:s.default.debug_breakpoints_description},w):(0,p.isDebugBreakpoint)(c.breakpoint)?o.default.createElement("span",{className:(0,r.default)(s.default.debug_breakpoints_description,s.default.blank)},`< ${(0,_.localize)("debug.breakpoint.blank")} >`):null,[w,c.breakpoint]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints_item)},o.default.createElement(l.CheckBox,{className:s.default.debug_breakpoints_icon,id:c.id,onChange:M,checked:A}),o.default.createElement("div",{className:s.default.debug_breakpoints_wrapper,onClick:O},c.name&&o.default.createElement("span",{className:s.default.debug_breakpoints_name},c.name),F),(0,p.isDebugBreakpoint)(c.breakpoint)?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:s.default.debug_breakpoints_item_control},R.range&&o.default.createElement("i",{title:(0,_.localize)("debug.menu.edit.breakpoint"),onClick:L=>k(L),className:(0,r.default)(s.default.debug_edit_breakpoints_icon,(0,_.getExternalIcon)("edit"))}),o.default.createElement("i",{title:(0,_.localize)("debug.menu.delete.breakpoint"),onClick:L=>x(L),className:(0,r.default)(s.default.debug_remove_breakpoints_icon,(0,_.getIcon)("close"))})),o.default.createElement(l.Badge,{className:s.default.debug_breakpoints_badge},c.breakpoint.raw.line,!!c.breakpoint.raw.column&&`:${c.breakpoint.raw.column}`)):null)};t.BreakpointItem=u},16067:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConfigurationService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(28423),_=e(51500),v=e(68810),m=e(64582),p=e(26296),s=e(37499),g=e(38029),a=e(35199),h=e(32756);let u=class{constructor(){this.currentValue=(0,l.observableValue)(this,m.DEFAULT_ADD_CONFIGURATION_KEY),this.float=(0,l.observableValue)(this,!1),this.configurationOptions=(0,l.observableValue)(this,[]),this.dynamicConfigurations=(0,l.observableValue)(this,[]),this.isMultiRootWorkspace=(0,l.observableValue)(this,!1),this.workspaceRoots=(0,l.observableValue)(this,[]),this.start=async()=>{const E=this.debugConfigurationManager.current;E?this.debugSessionManager.start(E):this.debugConfigurationManager.addConfiguration()},this.openConfiguration=()=>{const{current:E}=this.debugConfigurationManager,f=E?.workspaceFolderUri;this.debugConfigurationManager.openConfiguration(f)},this.openLaunchEditor=()=>{this.debugConfigurationManager.openLaunchEditor()},this.openDebugConsole=()=>{this.debugConsoleService.activate()},this.addConfiguration=E=>{this.debugConfigurationManager.addConfiguration(typeof E=="string"?E:void 0)},this.getLaunchUri=()=>{const E=this.workspaceVariables.getWorkspaceRootUri();return new o.URI(E.toString()).resolve(`${this.preferenceConfigurations.getPaths()[0]}/launch.json`)},this.insertConfiguration=E=>{this.debugConfigurationManager.insertConfiguration(this.getLaunchUri(),E)},this.showDynamicQuickPickToInsert=async()=>{const E=await this.debugConfigurationManager.showDynamicConfigurationsTypesQuickPick();if(E){const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.insertConfiguration(f)}},this.getDynamicSupportTypes=async()=>await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes(),this.updateConfiguration=(E,f,d)=>{this.debugConfigurationManager.current=this.debugConfigurationManager.find(E,f,d)},this.showDynamicQuickPick=async E=>{const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.debugSessionManager.start({configuration:f,workspaceFolderUri:this.workspaceRoots.get()[0],index:-1})},this.toName=({configuration:E,workspaceFolderUri:f})=>!f||!this.workspaceService.isMultiRootWorkspaceEnabled?E.name:E.name+" ("+new o.URI(f).path.base+")",this._whenReady=this.init()}get whenReady(){return this._whenReady}async init(){await this.debugConfigurationManager.whenReady,await this.updateConfigurationOptions(),this.debugConfigurationManager.onDidChange(async()=>{this.updateConfigurationOptions()}),this.preferenceService.onPreferenceChanged(E=>{const{preferenceName:f,newValue:d}=E;f==="debug.toolbar.float"&&this.float.get()!==d&&this.updateFloat(d)}),this.eventBus.on(m.DebugConfigurationsReadyEvent,()=>{this.updateDynamicConfigurations()}),await this.updateWorkspaceState(),this.workspaceService.onWorkspaceChanged(async()=>{await this.updateWorkspaceState()}),this.updateFloat(!!this.preferenceService.get("debug.toolbar.float"))}async updateWorkspaceState(){const E=(await this.workspaceService.tryGetRoots()).map(f=>f.uri);(0,l.transaction)(f=>{this.isMultiRootWorkspace.set(this.workspaceService.isMultiRootWorkspaceOpened,f),this.workspaceRoots.set(E,f)})}async updateDynamicConfigurations(){const E=await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes();(0,l.transaction)(f=>{this.dynamicConfigurations.set(E,f)})}updateFloat(E){this.float.set(E,void 0)}updateCurrentValue(E){(0,l.transaction)(f=>{this.currentValue.set(E,f)})}async updateConfigurationOptions(){(0,l.transaction)(f=>{this.configurationOptions.set(this.debugConfigurationManager.all,f)});const{current:E}=this.debugConfigurationManager;if(E){const f=this.toValue(E);this.updateCurrentValue(f)}else this.updateCurrentValue(m.DEFAULT_ADD_CONFIGURATION_KEY);this.updateDynamicConfigurations()}toValue({configuration:E,workspaceFolderUri:f,index:d}){if(!f)return E.name;if((0,o.isUndefined)(d)){const y=this.debugConfigurationManager.find(E.name,f);return y&&y.index?this.toValue(y):this.currentValue.get()}return E.name+m.DEFAULT_CONFIGURATION_NAME_SEPARATOR+f+m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR+d}};t.DebugConfigurationService=u,n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(s.DebugConfigurationManager),n.__metadata("design:type",s.DebugConfigurationManager)],u.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(p.IDebugSessionManager),n.__metadata("design:type",g.DebugSessionManager)],u.prototype,"debugSessionManager",void 0),n.__decorate([(0,r.Autowired)(h.DebugViewModel),n.__metadata("design:type",h.DebugViewModel)],u.prototype,"debugViewModel",void 0),n.__decorate([(0,r.Autowired)(a.DebugConsoleService),n.__metadata("design:type",a.DebugConsoleService)],u.prototype,"debugConsoleService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.WorkspaceVariableContribution),n.__metadata("design:type",v.WorkspaceVariableContribution)],u.prototype,"workspaceVariables",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceConfigurations),n.__metadata("design:type",o.PreferenceConfigurations)],u.prototype,"preferenceConfigurations",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],u.prototype,"eventBus",void 0),t.DebugConfigurationService=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},20676:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugControllerView=t.DebugConfigurationContainerView=t.DebugActionBar=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(97267),_=e(41869),v=e(77331),m=e(64582),p=e(66498),s=n.__importDefault(e(90463)),g=e(16067),a=e(84784),h=o.default.memo(({currentValue:E,options:f,dynamicOptions:d,onChangeConfiguration:y,isMultiRootWorkspace:b,addConfigurationLabel:A,editConfigurationLabel:S,toValue:D,workspaceRoots:I,isElectronRenderer:w})=>{const T=o.default.useCallback(O=>O&&O.length?O.map((x,k)=>{const F=b?`${x.configuration.name} (${new _.URI(x.workspaceFolderUri).displayName})`:x.configuration.name;return w?o.default.createElement("option",{key:k,value:D(x),label:F},F):o.default.createElement(l.Option,{key:k,value:D(x),label:F},F)}):w?[o.default.createElement("option",{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,_.localize)("debug.action.no.configuration")},(0,_.localize)("debug.action.no.configuration"))]:[o.default.createElement(l.Option,{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,_.localize)("debug.action.no.configuration")},(0,_.localize)("debug.action.no.configuration"))],[b]),R=o.default.useCallback(()=>{if(b){let O=A;const x=I.map((F,L)=>{const N=`${A} (${new _.URI(F).displayName})`;return O.length<N.length&&(O=N),w?o.default.createElement("option",{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:N},N):o.default.createElement(l.Option,{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:N},N)});return(w?[o.default.createElement("option",{disabled:!0,key:"--",value:O.replace(/./g,"-")},O.replace(/./g,"-"))]:[o.default.createElement(l.Option,{disabled:!0,key:"--",value:"",className:s.default.select_divider_container})]).concat(x)}else{const O=A;return w?[o.default.createElement("option",{disabled:!0,key:"--",value:O.replace(/./g,"-")},O.replace(/./g,"-")),o.default.createElement("option",{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:O},O),o.default.createElement("option",{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]:[o.default.createElement(l.Option,{disabled:!0,key:"--",value:O.replace(/./g,"-"),className:s.default.select_divider_container}),o.default.createElement(l.Option,{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:O},O),o.default.createElement(l.Option,{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]}},[b,A]),M=o.default.useCallback(O=>{if(!b&&O&&O.length)return O.map(k=>{const F=k.label||k.type,L=`${m.DEFAULT_DYNAMIC_CONFIGURATION_KEY}${k.type}`,{popupHint:N}=k;return w?o.default.createElement("option",{key:L,value:L,label:F},F):o.default.createElement(l.Option,{key:L,value:L,label:F},N?o.default.createElement(l.Popover,{id:`debug_configuration_pop_${L}`,title:N,overlayClassName:s.default.config_popover_insert},F):F)})},[b,d]);return w?o.default.createElement(v.Select,{value:E,onChange:y,className:(0,r.default)(s.default.debug_selection,s.default.special_radius)},T(f),R(),d&&M(d)):o.default.createElement(l.Select,{value:E,onChange:y,className:(0,r.default)(s.default.debug_selection,s.default.special_radius),allowOptionsOverflow:!0},T(f),R(),d&&M(d))});t.DebugActionBar=o.default.memo(({runDebug:E,openConfiguration:f,openDebugConsole:d})=>o.default.createElement("div",{className:s.default.debug_actions},o.default.createElement(p.DebugAction,{id:"debug.action.start",icon:"start",label:(0,_.localize)("debug.action.start"),run:E}),o.default.createElement(p.DebugAction,{id:"debug.action.open.configuration",icon:"setting",label:(0,_.localize)("debug.action.open.configuration"),run:f}),o.default.createElement(p.DebugAction,{id:"debug.action.debug.console",icon:"terminal",label:(0,_.localize)("debug.action.debug.console"),run:d})));const u=()=>{const E=(0,_.useInjectable)(g.DebugConfigurationService),f=(0,_.useAutorun)(E.float);return o.default.createElement(o.default.Fragment,null,o.default.createElement(t.DebugControllerView,{className:s.default.debug_configuration_container}),!f&&o.default.createElement(a.DebugToolbarView,{float:!1,className:s.default.debug_action_bar_internal}))};t.DebugConfigurationContainerView=u;const c=E=>{const{toValue:f,openConfiguration:d,addConfiguration:y,openDebugConsole:b,updateConfiguration:A,start:S,showDynamicQuickPick:D,currentValue:I,configurationOptions:w,dynamicConfigurations:T,isMultiRootWorkspace:R,workspaceRoots:M}=(0,_.useInjectable)(g.DebugConfigurationService),O=(0,_.useAutorun)(T),x=(0,_.useAutorun)(I),k=(0,_.useAutorun)(w),F=(0,_.useAutorun)(R),L=(0,_.useAutorun)(M),N=(0,_.useInjectable)(_.AppConfig),U=(0,_.localize)("debug.action.add.configuration"),W=(0,_.localize)("debug.action.edit.configuration"),{CustomActionBar:j}=E,Q=o.default.useCallback(G=>{let Z;if(typeof G=="object"?Z=G.target.value:Z=G,Z.startsWith(m.DEFAULT_ADD_CONFIGURATION_KEY)){const $=Z.slice(m.DEFAULT_ADD_CONFIGURATION_KEY.length);y($?M[$]:M[0])}else if(Z===m.DEFAULT_EDIT_CONFIGURATION_KEY)d();else if(Z.startsWith(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY)){const $=Z.slice(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY.length);D($)}else{const[$,V]=Z.split(m.DEFAULT_CONFIGURATION_NAME_SEPARATOR),[H,K]=V.split(m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR);A($,H,+K)}},[]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_configuration_toolbar,E.className||"")},o.default.createElement(h,{currentValue:x,options:k,dynamicOptions:O,workspaceRoots:L,isMultiRootWorkspace:F,onChangeConfiguration:Q,addConfigurationLabel:U,editConfigurationLabel:W,toValue:f,isElectronRenderer:N.isElectronRenderer}),j?o.default.createElement(j,null):o.default.createElement(t.DebugActionBar,{runDebug:S,openConfiguration:d,openDebugConsole:b}))};t.DebugControllerView=c},96090:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(37406),v=e(28423),m=e(64582),p=e(32756);let s=class{constructor(){this.state=(0,v.observableValue)(this,m.DebugState.Inactive),this.currentSession=(0,v.observableValue)(this,void 0),this.sessions=(0,v.observableValue)(this,[]),this.toolBarMenuMap=new Map,this.doStart=async()=>await this.model.start(),this.doRestart=async()=>{const a=this.instrumentReporter("restart"),h=await this.model.restart();return a(),h},this.doStop=async()=>{if(!this.model.currentSession)return;const a=this.instrumentReporter("stop"),h=await this.model.currentSession.terminate();return a(),h},this.doContinue=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("continue"),h=await this.model.currentThread.continue();return a(),h},this.doPause=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("pause"),h=await this.model.currentThread.pause();return a(),h},this.doStepOver=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("stepOver"),h=await this.model.currentThread.stepOver();return a(),h},this.doStepIn=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("stepIn"),h=await this.model.currentThread.stepIn();return a(),h},this.doStepOut=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("stepOut"),h=await this.model.currentThread.stepOut();return a(),h},this.updateCurrentSession=a=>{this.model.currentSession=a},this.model.onDidChange(()=>{this.updateToolBarMenu(),this.updateModel()})}get mainUIService(){return this.injector.get(_.IElectronMainUIService)}updateModel(){(0,v.transaction)(a=>{this.state.set(this.model.state,a),this.currentSession.set(this.model.currentSession,a),this.sessions.set(Array.from(this.model.sessions).filter(h=>h&&h.state>m.DebugState.Inactive),a)})}updateToolBarMenu(){const a=this.currentSession.get();if(a&&a.id&&!this.toolBarMenuMap.has(a.id)){const h=this.contextMenuService.createMenu({id:l.MenuId.DebugToolBar,contextKeyService:this.contextKeyService.createScoped()});a.on("terminated",()=>{this.toolBarMenuMap.delete(a.id)}),this.toolBarMenuMap.set(a.id,h)}}instrumentReporter(a){var h,u,c,E;const f=this.model.currentSession,d=(h=f.configuration)===null||h===void 0?void 0:h.type,y=this.model.currentThread,b=(u=y?.raw)===null||u===void 0?void 0:u.id;this.model.reportAction(f.id,b,a);const A={type:d,request:(E=(c=this.currentSession.get())===null||c===void 0?void 0:c.configuration)===null||E===void 0?void 0:E.request,sessionId:f.id,threadId:b};this.model.report(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION,a,A);const S=this.model.reportTime(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION_TIME,A);return()=>{S(a)}}};t.DebugToolbarService=s,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(l.AbstractContextMenuService),n.__metadata("design:type",l.AbstractContextMenuService)],s.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(p.DebugViewModel),n.__metadata("design:type",p.DebugViewModel)],s.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],s.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),n.__decorate([o.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],s.prototype,"mainUIService",null),t.DebugToolbarService=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},84784:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarOverlayWidget=t.DebugToolbarView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(76003),_=e(97267),v=e(41869),m=e(25918),p=e(77331),s=e(1149),g=e(28423),a=e(64582),h=e(66498),u=e(5905),c=n.__importDefault(e(90463)),E=e(16067),f=e(96090);let d=class{constructor(){this._x=(0,g.observableValue)(this,0),this._line=(0,g.observableValue)(this,0),this._enable=(0,g.observableValue)(this,!1),this.y=0,this.last=0,this.origin=0,this.state=(0,g.derived)(this,w=>({enable:this._enable.read(w),x:this._x.read(w),line:this._line.read(w)}))}setEnable(w){(0,g.transaction)(T=>{this._enable.set(w,T)})}onMouseDown(w){this.setEnable(!0),this.y=w.clientY,this.origin=w.clientX}onMouseMove(w){w.stopPropagation(),(0,g.transaction)(T=>{this._enable.get()&&(this._x.set(w.clientX-this.origin+this.last,T),this._line.set(w.clientY-this.y>10?1:0,T))})}onMouseUp(){this.setEnable(!1),this.last=this._x.get()}};d=n.__decorate([(0,l.Injectable)()],d);const y=I=>{var w;const{state:T,toolBarMenuMap:R,doStop:M,doStepIn:O,doStepOut:x,doStepOver:k,doContinue:F,doRestart:L,doPause:N,currentSession:U,sessions:W,updateCurrentSession:j}=(0,v.useInjectable)(f.DebugToolbarService),Q=(0,v.useAutorun)(T),G=(0,v.useAutorun)(U),Z=(0,v.useAutorun)(W),{isElectronRenderer:$}=(0,v.useInjectable)(v.AppConfig),V=!!G&&((w=G.configuration)===null||w===void 0?void 0:w.request)==="attach"&&!(0,u.isExtensionHostDebugging)(G.configuration),H=G&&G.id,K=(0,o.useCallback)(me=>{if(me&&me.id){const q=R.get(me.id);if(q)return o.default.createElement(m.InlineMenuBar,{menus:q})}return null},[R]),Y=(0,o.useCallback)(me=>V?o.default.createElement(h.DebugAction,{run:M,enabled:me!==a.DebugState.Inactive,icon:"disconnect",label:(0,v.localize)("debug.action.disattach")}):o.default.createElement(h.DebugAction,{run:M,enabled:me!==a.DebugState.Inactive,icon:"stop",label:(0,v.localize)("debug.action.stop")}),[M]),X=(0,o.useCallback)(me=>me===a.DebugState.Stopped?o.default.createElement(h.DebugAction,{run:F,icon:"continue",label:(0,v.localize)("debug.action.continue")}):o.default.createElement(h.DebugAction,{run:N,enabled:Q===a.DebugState.Running,icon:"pause",label:(0,v.localize)("debug.action.pause")}),[N,F]),re=(0,o.useCallback)(me=>me.map(q=>$?o.default.createElement("option",{key:q.id,value:q.id},q.label):o.default.createElement(_.Option,{key:q.id,label:q.label,value:q.id},q.label)),[]),oe=(0,o.useCallback)(me=>{if(me.length>1)return o.default.createElement("div",{className:(0,r.default)(c.default.debug_selection)},$?o.default.createElement(p.Select,{value:H,onChange:he},re(me)):o.default.createElement(_.Select,{className:(0,r.default)(c.default.debug_selection,c.default.special_radius),size:I.float?"small":"default",value:H,options:me.map(q=>({label:q.label,value:q.id})),onChange:he},re(me)))},[H]),he=(0,o.useCallback)(me=>{let q=me;if($&&(q=me.target.value),!!Z)for(const be of Z)be.id===q&&j(be)},[Z,j]);return o.default.createElement("div",{className:(0,r.default)(c.default.debug_action_bar,I.className||"")},oe(Z.filter(me=>!me.parentSession)),o.default.createElement("div",{className:c.default.debug_actions},X(Q),o.default.createElement(h.DebugAction,{run:k,enabled:Q===a.DebugState.Stopped,icon:"step",label:(0,v.localize)("debug.action.step-over")}),o.default.createElement(h.DebugAction,{run:O,enabled:Q===a.DebugState.Stopped,icon:"step-in",label:(0,v.localize)("debug.action.step-into")}),o.default.createElement(h.DebugAction,{run:x,enabled:Q===a.DebugState.Stopped,icon:"step-out",label:(0,v.localize)("debug.action.step-out")}),o.default.createElement(h.DebugAction,{run:L,enabled:Q!==a.DebugState.Inactive,icon:"reload",label:(0,v.localize)("debug.action.restart")}),Y(Q),K(G)))};t.DebugToolbarView=y;const b="debug.toolbar.top",A="debug.toolbar.height",S=()=>{const I=(0,v.useInjectable)(v.PreferenceService),{isElectronRenderer:w}=(0,v.useInjectable)(v.AppConfig),T=(0,v.useInjectable)(s.LayoutViewSizeConfig),R=(0,v.useDesignStyles)(c.default.debug_toolbar_wrapper,"debug_toolbar_wrapper"),[M,O]=(0,o.useState)(0),x=(0,v.useInjectable)(d),k=(0,v.useAutorun)(x.state),F=(0,v.useInjectable)(f.DebugToolbarService),L=(0,v.useAutorun)(F.state);(0,o.useEffect)(()=>{const W=new v.DisposableCollection,j=I.get(b)||0;if(w){const Q=F.mainUIService;Q.isFullScreen(v.electronEnv.currentWindowId).then(G=>{O(G?j:j+T.calcOnlyTitleBarHeight())}),W.push(Q.on("fullScreenStatusChange",(G,Z)=>{G===v.electronEnv.currentWindowId&&O(Z?j:j+T.calcOnlyTitleBarHeight())}))}else O(j);return()=>{W.dispose()}},[]);const N=I.get(A)||0,U=(0,r.default)({[R]:!0,[c.default.debug_toolbar_wrapper_electron]:w});return L?o.default.createElement("div",{style:{pointerEvents:k.enable?"all":"none"},className:c.default.debug_toolbar_container,onMouseMove:W=>x.onMouseMove(W),onMouseUp:W=>x.onMouseUp()},o.default.createElement("div",{style:{transform:`translateX(${k.x}px) translateY(${M+k.line*N}px)`,height:`${N}px`},className:U},o.default.createElement("div",{className:(0,r.default)(c.default.debug_toolbar_drag_wrapper)},o.default.createElement("div",{className:(0,r.default)((0,v.getIcon)("drag"),c.default.debug_toolbar_drag),onMouseDown:W=>x.onMouseDown(W),onMouseMove:W=>x.onMouseMove(W)})),o.default.createElement(t.DebugToolbarView,{float:!0}))):(x.setEnable(!1),null)},D=()=>{const I=(0,v.useInjectable)(E.DebugConfigurationService);return(0,v.useAutorun)(I.float)?o.default.createElement(S,null):null};t.DebugToolbarOverlayWidget=D},53378:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterModel=void 0;const r=e(85608),o=e(76003),l=e(41869);let _=n=class{constructor(){this._parsedQueries=[]}set filterQuery(m){if(this._parsedQueries=[],m=m.trim(),m&&m!==""){const p=(0,l.splitGlobAware)(m,",").map(s=>s.trim()).filter(s=>!!s.length);for(const s of p)s.startsWith("!")?this._parsedQueries.push({type:"exclude",query:s.slice(1)}):this._parsedQueries.push({type:"include",query:s})}}filter(m){let p=!1,s=!1;for(const{type:g,query:a}of this._parsedQueries){if(g==="exclude"&&n.matchQuery(a,m))return!1;g==="include"&&(p=!0,n.matchQuery(a,m)&&(s=!0))}return p&&s}};t.DebugConsoleFilterModel=_,_.matchQuery=l.matchesFuzzy,t.DebugConsoleFilterModel=_=n=r.__decorate([(0,o.Injectable)({multiple:!0})],_)},1276:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(5905),_=e(53378),v=e(62665),{convertSimple2RegExpPattern:m}=o.strings;let p=class{constructor(){this._onDidValueChange=new o.Emitter,this._onDidFocus=new o.Emitter,this._filterText="",this.filterModel=new _.DebugConsoleFilterModel}get onDidValueChange(){return this._onDidValueChange.event}get onDidFocus(){return this._onDidFocus.event}focusInput(){this._onDidFocus.fire()}get filterText(){return this._filterText}setFilterText(g){return this._filterText!==g&&(this._filterText=g,this.filterModel.filterQuery=this._filterText,this._onDidValueChange.fire(this._filterText)),this}filter(g){const a=v.ansiToText(g);return this._filterText===""||this.filterModel.filter(a)}findMatches(g){const a=new RegExp(m(this._filterText.toLowerCase()),"g");if(this._filterText.trim()==="")return[];const h=(0,l.matchAll)(g.toLowerCase(),a),u=this._filterText.length;return u===0?[]:h.map(E=>({startIndex:E.index!==void 0?E.index:-1,count:u})).filter(E=>E.startIndex>=0)}};t.DebugConsoleFilterService=p,t.DebugConsoleFilterService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},4161:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(14041)),l=e(15857),_=e(41869),v=e(1276),m=n.__importDefault(e(80315)),p=()=>{const s=(0,_.useInjectable)(v.DebugConsoleFilterService),[g,a]=o.default.useState(""),[h,u]=o.default.useState(),c=(0,_.useDesignStyles)(m.default.debug_console_filter,"debug_console_filter"),E=(0,_.useDesignStyles)(m.default.filter_input,"filter_input"),f=(0,r.default)(b=>{a(b),s.setFilterText(b),h&&h.addToHistory(b)},400);o.default.useEffect(()=>{const b=s.onDidValueChange(A=>{a(A)});return()=>{b.dispose()}},[]);const d=b=>{u(b)},y=b=>{h&&(b.keyCode===_.Key.ARROW_UP.keyCode?h.showPreviousValue():b.keyCode===_.Key.ARROW_DOWN.keyCode&&h.showNextValue())};return o.default.useEffect(()=>{const b=s.onDidFocus(()=>{h&&h.focus()});return()=>{b.dispose()}},[h]),o.default.createElement("div",{className:c},o.default.createElement(l.HistoryInputBox,{hasClear:!0,className:E,value:g,placeholder:(0,_.localize)("debug.console.filter.placeholder"),onValueChange:f,onReady:d,onKeyDown:y}))};t.DebugConsoleFilterView=p},80390:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleTreeModel=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(41869),v=e(98650);let m=n=class extends l.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new _.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this._tempScrollOffset=0,this.init(s)}get isScrollBottom(){return this._tempScrollOffset=Math.max(this.state.scrollOffset,this._tempScrollOffset),this._tempScrollOffset===this.state.scrollOffset}init(s){this.root=s,this.root.watcher.on(l.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugConsoleTreeModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugConsoleTreeModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},75563:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleSession=void 0;const n=e(85608),r=n.__importDefault(e(97331)),o=e(76003),l=e(43718),_=e(52416),v=e(92679),m=e(58542),p=e(29539),s=e(16170),g=e(80390);let a=class{constructor(u,c){this.session=u,this.treeModel=c,this.toDispose=new l.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.onDidChangeEmitter=new l.Emitter,this.init()}resolveChildren(){return(this.treeModel.root.flattenedBranch||[]).map(c=>this.treeModel.root.getTreeNodeById(c))}getLastItem(){const{flattenedBranch:u}=this.treeModel.root,c=u?.length?u[u.length-1]:void 0;return c?this.treeModel.root.getTreeNodeById(c):void 0}init(){this.toDispose.push(this.session.on("output",u=>this.logOutput(this.session,u)))}addChildSession(u){this.toDispose.push(u.on("output",c=>this.logOutput(u,c)))}get onDidChange(){return this.onDidChangeEmitter.event}clear(){this.fireDidChange()}async logOutput(u,c){var E;const f="\x1B[2J",d=c.body,{category:y,variablesReference:b,source:A,line:S}=d;if(!this.treeModel)return;const D=y==="stderr"?l.MessageType.Error:y==="stdout"?l.MessageType.Info:y==="console"?l.MessageType.Warning:l.MessageType.Info;if(y==="telemetry"){this.logger.debug(`telemetry/${c.body.output}`,c.body.data);return}if(b){const I=new s.DebugConsoleNode({session:u,variablesReference:b,source:A,line:S},"",(E=this.treeModel)===null||E===void 0?void 0:E.root);await I.evaluate(),this.treeModel.root.insertItem(I)}else if(typeof d.output=="string"){let I=d.output;I.indexOf(f)>=0&&(this.clearConsole(),await this.insertItemWithAnsi((0,l.localize)("debug.console.consoleCleared"),l.MessageType.Info),I=I.substring(I.lastIndexOf(f)+f.length));const w=this.getLastItem();w&&!w.description.endsWith(`
33295
+ `),this._description="",this._available=!0)}}catch(w){this._available=!1,this.name=I,this._description=w.message}else this._available=!1,this.name=I}}t.DebugConsoleNode=f;class d extends s{static is(D){return!!D&&!D.parent}constructor(D,I=[]){super({session:D},void 0,new m(D)),this.session=D,this.presetChildren=I}get expanded(){return!0}updatePresetChildren(D){this.presetChildren=D}}t.DebugConsoleRoot=d;class y extends s{static is(D){return!!D&&!D.parent}constructor(D,I=[]){super({session:D},void 0),this.session=D,this.presetChildren=I}get expanded(){return!0}updatePresetChildren(D){this.presetChildren=D}}t.DebugWatchRoot=y;class b extends h{static is(D){return!!D&&!D.parent}constructor(D){super(D,{},void 0),this.session=D}get expanded(){return!0}}t.DebugVariableRoot=b;class A extends s{constructor(D,I){super({session:I}),this.expression=D,this.session=I,this._value="",this._available=!1}get name(){return this._value}get available(){return this._available}async evaluate(D="repl"){if(this.session)try{const{expression:I}=this,w=await this.session.evaluate(I,D);w&&(this._value=w.result,this._available=!0,this.variablesReference=w.variablesReference,this.namedVariables=w.namedVariables,this.indexedVariables=w.indexedVariables,this.memoryReference=w.memoryReference)}catch(I){this._value=I.message,this._available=!1}else this._value="Please start a debug session to evaluate",this._available=!1}}t.DebugHoverVariableRoot=A},16170:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(98650),t),n.__exportStar(e(81450),t)},57332:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointsTreeNode=void 0;const n=e(43718),r=e(99797);class o{constructor(_,v){this.label="",this._onDescriptionChange=new n.Emitter;const{breakpoint:m}=v;this._uri=_,this.label=(0,r.isDebugBreakpoint)(m)?_.displayName:"",this.rawData=v,this.rawData.onDescriptionChange=this._onDescriptionChange.event}get breakpoint(){return this.rawData.breakpoint}get uri(){return this._uri}fireDescriptionChange(_){this.rawData.description=_,this._onDescriptionChange.fire(_)}}t.BreakpointsTreeNode=o},97319:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointsService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),_=e(54414),v=e(57517),m=e(28423),p=e(51500),s=e(26199),g=e(64582),a=e(26296),h=e(99797),u=e(38029),c=e(32756),E=e(57332);let f=class extends o.WithEventBus{get inputEditor(){return this._inputEditor}constructor(){super(),this._onDidChangeBreakpointsTreeNode=new o.Emitter,this.onDidChangeBreakpointsTreeNode=this._onDidChangeBreakpointsTreeNode.event,this._onDidFocusedBreakpoints=new o.Emitter,this.onDidFocusedBreakpoints=this._onDidFocusedBreakpoints.event,this.treeNodeMap=new Map,this.enable=(0,m.observableValue)(this,!1),this.inDebugMode=(0,m.observableValue)(this,!1),this.toggleBreakpointEnable=y=>{if((0,h.isDebugBreakpoint)(y)){const b=this.breakpoints.getBreakpoint(o.URI.parse(y.uri),{lineNumber:y.raw.line,column:y.raw.column});b&&(b.enabled=!b.enabled,this.breakpoints.updateBreakpoint(b))}(0,h.isDebugExceptionBreakpoint)(y)&&this.breakpoints.updateExceptionBreakpoints(y.filter,!y.default)},this.init()}launchFocusedBreakpoints(y){this._onDidFocusedBreakpoints.fire(y)}async init(){await this.updateRoots(),this.workspaceService.onWorkspaceChanged(async()=>{this.updateRoots(),this.updateBreakpoints()}),this.breakpoints.onDidChangeBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.onDidChangeExceptionsBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.whenReady.then(()=>{this.updateBreakpoints()}),this.contextKeyService.onDidChangeContext(y=>{y.payload.affectsSome(new Set([g.CONTEXT_IN_DEBUG_MODE_KEY]))&&(0,m.transaction)(b=>{this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,b)})})}getBreakpointDecoration(y,b=!1,A=!0){return new h.DebugDecorator().getDecoration(y,b,A)}onRenameFile(y){this.removeBreakpoints(y.payload.oldUri)}onDeleteFile(y){this.removeBreakpoints(y.payload.oldUri)}removeBreakpoints(y){this.breakpoints.cleanAllMarkers(y),this.updateBreakpoints()}async updateRoots(){(0,m.transaction)(b=>{this.enable.set(this.breakpoints.breakpointsEnabled,b),this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,b)});const y=await this.workspaceService.roots;this.roots=y.map(b=>new o.URI(b.uri))}extractNodes(y){if((0,h.isDebugBreakpoint)(y))return{id:y.id,name:"",description:"",onDescriptionChange:o.Event.None,breakpoint:y};if((0,h.isDebugExceptionBreakpoint)(y))return{id:y.filter,name:y.label,onDescriptionChange:o.Event.None,description:"",breakpoint:y}}async updateBreakpoints(){await this.breakpoints.whenReady,this.treeNodeMap.clear(),[...this.breakpoints.getExceptionBreakpoints(),...this.breakpoints.getBreakpoints()].forEach(b=>{const A=this.extractNodes(b);if(A){const S=(0,h.isDebugBreakpoint)(b)?o.URI.parse(b.uri):h.EXCEPTION_BREAKPOINT_URI,D=this.treeNodeMap.get(S.toString())||[];D.push(new E.BreakpointsTreeNode(S,A)),this.treeNodeMap.set(S.toString(),D)}}),this._onDidChangeBreakpointsTreeNode.fire(this.treeNodeMap)}async getDocumentModelRef(y){const b=this.documentService.getModelReference(y);return b||this.documentService.createModelReference(y)}async refreshBreakpointsInfo(){const y=this.treeNodeMap.values(),b=Array.from(y).reduce((A,S)=>A.concat(S),[]);for await(const A of b){const{rawData:S,uri:D}=A;if((0,h.isDebugBreakpoint)(S.breakpoint)){const I=S.breakpoint.raw.line,w=await this.getDocumentModelRef(D);if(!w)return;const T=w.instance.getMonacoModel(),R=T.getLineCount();if(I>R)return;const M=T.getLineContent(I);A.fireDescriptionChange(M.trim()),w.dispose()}}}removeAllBreakpoints(){this.breakpoints.clearBreakpoints()}delBreakpoint(y){this.breakpoints.delBreakpoint(y)}toggleBreakpoints(){this.breakpoints.breakpointsEnabled=!this.breakpoints.breakpointsEnabled,(0,m.transaction)(y=>{this.enable.set(this.breakpoints.breakpointsEnabled,y)}),this.enable.get()?this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"enabled"):this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"unenabled")}async createBreakpointInput(y){this._inputEditor=await this.editorService.createCodeEditor(y,{...(0,_.getSimpleEditorOptions)(),lineHeight:21,scrollbar:{horizontal:"hidden",vertical:"hidden",handleMouseWheel:!1},acceptSuggestionOnEnter:"on",renderIndentGuides:!1});const A=(await this.documentService.createModelReference(new o.URI("debug/breakpoint/expression/input").withScheme(o.Schemes.walkThroughSnippet))).instance.getMonacoModel();return A.updateOptions({tabSize:2}),this._inputEditor.monacoEditor.setModel(A),Promise.resolve(this.inputEditor)}};t.DebugBreakpointsService=f,n.__decorate([(0,r.Autowired)(c.DebugViewModel),n.__metadata("design:type",c.DebugViewModel)],f.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(h.BreakpointManager),n.__metadata("design:type",h.BreakpointManager)],f.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(a.IDebugSessionManager),n.__metadata("design:type",u.DebugSessionManager)],f.prototype,"sessions",void 0),n.__decorate([(0,r.Autowired)(l.LabelService),n.__metadata("design:type",l.LabelService)],f.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],f.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(_.EditorCollectionService),n.__metadata("design:type",_.EditorCollectionService)],f.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"documentService",void 0),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidRenameFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidRenameFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onRenameFile",null),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidDeleteFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidDeleteFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onDeleteFile",null),t.DebugBreakpointsService=f=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],f)},85347:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointItem=t.BreakpointFileItem=t.DebugBreakpointView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=n.__importStar(e(20868)),m=e(64582),p=e(99797),s=n.__importDefault(e(96547)),g=e(97319),a=({viewState:c})=>{const E=(0,_.useInjectable)(g.DebugBreakpointsService),f=(0,o.useRef)(!1),[d,y]=(0,o.useState)([]),{enable:b,inDebugMode:A,toggleBreakpointEnable:S}=E,D=(0,_.useAutorun)(b),I=(0,_.useAutorun)(A),w=R=>{const{data:M,inDebugMode:O,breakpointEnabled:x}=R;if((0,p.isDebugBreakpoint)(M.breakpoint)){if(!(O?(0,p.isDebugBreakpoint)(M.breakpoint)&&(0,p.isRuntimeBreakpoint)(M.breakpoint):!0))return"sumi-debug-breakpoint-unverified";const{className:F}=E.getBreakpointDecoration(M.breakpoint,O,x);return F}return""},T=(0,o.useCallback)(R=>{const{roots:M}=E,O=[];R.forEach(([x,k],F)=>{var L;if(p.EXCEPTION_BREAKPOINT_URI.toString()===x)k.forEach((U,W)=>{O.push({label:"",order:F*100+W,expandable:!1,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder_fill,children:[],description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(U.breakpoint),data:U.rawData})})});else{const U=_.URI.parse(x),W=M.filter(G=>G.isEqualOrParent(U))[0],j=W?((L=W.relative(U))===null||L===void 0?void 0:L.toString())||"":_.URI.parse(x).displayName,Q=k.map(G=>G.breakpoint);O.push({label:j,order:F,twisterClassName:s.default.tree_item_twister,renderLabel:o.default.createElement(t.BreakpointFileItem,{label:j,breakpointItems:Q,title:U.toString()}),expandable:!0,expanded:!0,children:k.map(G=>({...G,label:"",expandable:!1,twisterClassName:s.default.tree_item_twister,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder,breakpoint:G.breakpoint,iconClassName:(0,r.default)(w({data:G.rawData,inDebugMode:I,breakpointEnabled:D}),s.default.debug_breakpoints_icon),description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(G.breakpoint),data:G.rawData})}))})}}),f.current||y(O)},[d]);return(0,o.useEffect)(()=>{const R=new _.Disposable;return T(Array.from(E.treeNodeMap.entries())),R.addDispose(E.onDidChangeBreakpointsTreeNode(M=>{T(Array.from(M.entries()))})),()=>{f.current=!0,R.dispose()}},[]),(0,o.useEffect)(()=>{d.length>0&&requestAnimationFrame(()=>{E.refreshBreakpointsInfo()})},[d]),o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints,!D&&s.default.debug_breakpoints_disabled)},o.default.createElement(l.BasicRecycleTree,{onIconClick:(R,M)=>{M.raw.breakpoint&&S(M.raw.breakpoint)},sortComparator:(R,M)=>{if(typeof R.order<"u"&&typeof M.order<"u")return R.order>M.order?1:R.order<M.order?-1:0},indent:18,baseIndent:8,treeData:d,height:c.height}))};t.DebugBreakpointView=a;const h=({label:c,title:E,breakpointItems:f})=>{const d=(0,_.useInjectable)(g.DebugBreakpointsService),y=(0,o.useMemo)(()=>f.some(I=>I.enabled),[f]),[b,A]=o.default.useState(y),S=(0,o.useCallback)(I=>{f.filter(T=>T.enabled===I).forEach(T=>{d.toggleBreakpointEnable(T)}),A(!b)},[b]),D=(0,o.useCallback)(I=>{I.stopPropagation(),f.forEach(w=>{d.delBreakpoint(w)})},[]);return o.default.createElement("div",{className:s.default.debug_breakpoints_file_item},o.default.createElement("div",{className:s.default.file_item_control},o.default.createElement(l.CheckBox,{className:(0,r.default)(s.default.debug_breakpoints_icon,s.default.file_item_checkbox),onChange:()=>S(b),checked:b}),o.default.createElement("i",{className:(0,r.default)((0,_.getIcon)("file-text"),s.default.file_item_icon,s.default.debug_breakpoints_icon)}),o.default.createElement("span",{title:E},c)),o.default.createElement("div",{className:s.default.file_item_control_right},o.default.createElement("i",{className:(0,r.default)((0,_.getIcon)("close"),s.default.close_icon),onClick:I=>D(I)})))};t.BreakpointFileItem=h;const u=({data:c,toggle:E})=>{const f=(0,p.isDebugBreakpoint)(c.breakpoint)?c.breakpoint.enabled:!!c.breakpoint.default,d=(0,_.useInjectable)(m.IDebugSessionManager),y=(0,_.useInjectable)(_.CommandService),b=(0,_.useInjectable)(g.DebugBreakpointsService),[A,S]=o.default.useState(f),[D,I]=o.default.useState(void 0),[w,T]=o.default.useState(c.description),R=(0,o.useMemo)(()=>{const L={preview:!0,focus:!0};if(!(0,p.isDebugBreakpoint)(c.breakpoint))return L;if(D)L.range={startColumn:D.column||0,endColumn:D.column||0,startLineNumber:D.line,endLineNumber:D.line};else{const{raw:N}=c.breakpoint;L.range={startColumn:N.column||0,endColumn:N.column||0,startLineNumber:N.line,endLineNumber:N.line}}return L},[D,c.breakpoint]),M=()=>{E(),S(!A)},O=async()=>{c.breakpoint.uri&&(await y.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI(c.breakpoint.uri),R),b.launchFocusedBreakpoints({uri:new _.URI(c.breakpoint.uri),range:R.range}))};o.default.useEffect(()=>{const L=new _.Disposable,N=()=>{if((0,p.isDebugBreakpoint)(c.breakpoint)&&(0,p.isRuntimeBreakpoint)(c.breakpoint)){const U=(0,p.getStatus)(c.breakpoint);I(U)}};return L.addDispose(d.onDidChangeActiveDebugSession(()=>N())),N(),L.addDispose(c.onDescriptionChange(T)),()=>{I(void 0),L.dispose()}},[]);const x=L=>{L.stopPropagation(),b.delBreakpoint(c.breakpoint)},k=async L=>{L.stopPropagation(),await y.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,new _.URI(c.breakpoint.uri),R);const{range:N}=R,U=new v.Position(N?.startLineNumber||1,N?.startColumn||1);await y.executeCommand(m.DEBUG_COMMANDS.EDIT_BREAKPOINT.id,U)},F=(0,o.useMemo)(()=>w?o.default.createElement("span",{className:s.default.debug_breakpoints_description},w):(0,p.isDebugBreakpoint)(c.breakpoint)?o.default.createElement("span",{className:(0,r.default)(s.default.debug_breakpoints_description,s.default.blank)},`< ${(0,_.localize)("debug.breakpoint.blank")} >`):null,[w,c.breakpoint]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints_item)},o.default.createElement(l.CheckBox,{className:s.default.debug_breakpoints_icon,id:c.id,onChange:M,checked:A}),o.default.createElement("div",{className:s.default.debug_breakpoints_wrapper,onClick:O},c.name&&o.default.createElement("span",{className:s.default.debug_breakpoints_name},c.name),F),(0,p.isDebugBreakpoint)(c.breakpoint)?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:s.default.debug_breakpoints_item_control},R.range&&o.default.createElement("i",{title:(0,_.localize)("debug.menu.edit.breakpoint"),onClick:L=>k(L),className:(0,r.default)(s.default.debug_edit_breakpoints_icon,(0,_.getExternalIcon)("edit"))}),o.default.createElement("i",{title:(0,_.localize)("debug.menu.delete.breakpoint"),onClick:L=>x(L),className:(0,r.default)(s.default.debug_remove_breakpoints_icon,(0,_.getIcon)("close"))})),o.default.createElement(l.Badge,{className:s.default.debug_breakpoints_badge},c.breakpoint.raw.line,!!c.breakpoint.raw.column&&`:${c.breakpoint.raw.column}`)):null)};t.BreakpointItem=u},16067:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConfigurationService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(28423),_=e(51500),v=e(68810),m=e(64582),p=e(26296),s=e(37499),g=e(38029),a=e(35199),h=e(32756);let u=class{constructor(){this.currentValue=(0,l.observableValue)(this,m.DEFAULT_ADD_CONFIGURATION_KEY),this.float=(0,l.observableValue)(this,!1),this.configurationOptions=(0,l.observableValue)(this,[]),this.dynamicConfigurations=(0,l.observableValue)(this,[]),this.isMultiRootWorkspace=(0,l.observableValue)(this,!1),this.workspaceRoots=(0,l.observableValue)(this,[]),this.start=async()=>{const E=this.debugConfigurationManager.current;E?this.debugSessionManager.start(E):this.debugConfigurationManager.addConfiguration()},this.openConfiguration=()=>{const{current:E}=this.debugConfigurationManager,f=E?.workspaceFolderUri;this.debugConfigurationManager.openConfiguration(f)},this.openLaunchEditor=()=>{this.debugConfigurationManager.openLaunchEditor()},this.openDebugConsole=()=>{this.debugConsoleService.activate()},this.addConfiguration=E=>{this.debugConfigurationManager.addConfiguration(typeof E=="string"?E:void 0)},this.getLaunchUri=()=>{const E=this.workspaceVariables.getWorkspaceRootUri();return new o.URI(E.toString()).resolve(`${this.preferenceConfigurations.getPaths()[0]}/launch.json`)},this.insertConfiguration=E=>{this.debugConfigurationManager.insertConfiguration(this.getLaunchUri(),E)},this.showDynamicQuickPickToInsert=async()=>{const E=await this.debugConfigurationManager.showDynamicConfigurationsTypesQuickPick();if(E){const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.insertConfiguration(f)}},this.getDynamicSupportTypes=async()=>await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes(),this.updateConfiguration=(E,f,d)=>{this.debugConfigurationManager.current=this.debugConfigurationManager.find(E,f,d)},this.showDynamicQuickPick=async E=>{const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.debugSessionManager.start({configuration:f,workspaceFolderUri:this.workspaceRoots.get()[0],index:-1})},this.toName=({configuration:E,workspaceFolderUri:f})=>!f||!this.workspaceService.isMultiRootWorkspaceEnabled?E.name:E.name+" ("+new o.URI(f).path.base+")",this._whenReady=this.init()}get whenReady(){return this._whenReady}async init(){await this.debugConfigurationManager.whenReady,await this.updateConfigurationOptions(),this.debugConfigurationManager.onDidChange(async()=>{this.updateConfigurationOptions()}),this.preferenceService.onPreferenceChanged(E=>{const{preferenceName:f,newValue:d}=E;f==="debug.toolbar.float"&&this.float.get()!==d&&this.updateFloat(d)}),this.eventBus.on(m.DebugConfigurationsReadyEvent,()=>{this.updateDynamicConfigurations()}),await this.updateWorkspaceState(),this.workspaceService.onWorkspaceChanged(async()=>{await this.updateWorkspaceState()}),this.updateFloat(!!this.preferenceService.get("debug.toolbar.float"))}async updateWorkspaceState(){const E=(await this.workspaceService.tryGetRoots()).map(f=>f.uri);(0,l.transaction)(f=>{this.isMultiRootWorkspace.set(this.workspaceService.isMultiRootWorkspaceOpened,f),this.workspaceRoots.set(E,f)})}async updateDynamicConfigurations(){const E=await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes();(0,l.transaction)(f=>{this.dynamicConfigurations.set(E,f)})}updateFloat(E){this.float.set(E,void 0)}updateCurrentValue(E){(0,l.transaction)(f=>{this.currentValue.set(E,f)})}async updateConfigurationOptions(){(0,l.transaction)(f=>{this.configurationOptions.set(this.debugConfigurationManager.all,f)});const{current:E}=this.debugConfigurationManager;if(E){const f=this.toValue(E);this.updateCurrentValue(f)}else this.updateCurrentValue(m.DEFAULT_ADD_CONFIGURATION_KEY);this.updateDynamicConfigurations()}toValue({configuration:E,workspaceFolderUri:f,index:d}){if(!f)return E.name;if((0,o.isUndefined)(d)){const y=this.debugConfigurationManager.find(E.name,f);return y&&y.index?this.toValue(y):this.currentValue.get()}return E.name+m.DEFAULT_CONFIGURATION_NAME_SEPARATOR+f+m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR+d}};t.DebugConfigurationService=u,n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(s.DebugConfigurationManager),n.__metadata("design:type",s.DebugConfigurationManager)],u.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(p.IDebugSessionManager),n.__metadata("design:type",g.DebugSessionManager)],u.prototype,"debugSessionManager",void 0),n.__decorate([(0,r.Autowired)(h.DebugViewModel),n.__metadata("design:type",h.DebugViewModel)],u.prototype,"debugViewModel",void 0),n.__decorate([(0,r.Autowired)(a.DebugConsoleService),n.__metadata("design:type",a.DebugConsoleService)],u.prototype,"debugConsoleService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.WorkspaceVariableContribution),n.__metadata("design:type",v.WorkspaceVariableContribution)],u.prototype,"workspaceVariables",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceConfigurations),n.__metadata("design:type",o.PreferenceConfigurations)],u.prototype,"preferenceConfigurations",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],u.prototype,"eventBus",void 0),t.DebugConfigurationService=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},20676:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugControllerView=t.DebugConfigurationContainerView=t.DebugActionBar=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(97267),_=e(41869),v=e(77331),m=e(64582),p=e(66498),s=n.__importDefault(e(90463)),g=e(16067),a=e(84784),h=o.default.memo(({currentValue:E,options:f,dynamicOptions:d,onChangeConfiguration:y,isMultiRootWorkspace:b,addConfigurationLabel:A,editConfigurationLabel:S,toValue:D,workspaceRoots:I,isElectronRenderer:w})=>{const T=o.default.useCallback(O=>O&&O.length?O.map((x,k)=>{const F=b?`${x.configuration.name} (${new _.URI(x.workspaceFolderUri).displayName})`:x.configuration.name;return w?o.default.createElement("option",{key:k,value:D(x),label:F},F):o.default.createElement(l.Option,{key:k,value:D(x),label:F},F)}):w?[o.default.createElement("option",{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,_.localize)("debug.action.no.configuration")},(0,_.localize)("debug.action.no.configuration"))]:[o.default.createElement(l.Option,{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,_.localize)("debug.action.no.configuration")},(0,_.localize)("debug.action.no.configuration"))],[b]),R=o.default.useCallback(()=>{if(b){let O=A;const x=I.map((F,L)=>{const N=`${A} (${new _.URI(F).displayName})`;return O.length<N.length&&(O=N),w?o.default.createElement("option",{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:N},N):o.default.createElement(l.Option,{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:N},N)});return(w?[o.default.createElement("option",{disabled:!0,key:"--",value:O.replace(/./g,"-")},O.replace(/./g,"-"))]:[o.default.createElement(l.Option,{disabled:!0,key:"--",value:"",className:s.default.select_divider_container})]).concat(x)}else{const O=A;return w?[o.default.createElement("option",{disabled:!0,key:"--",value:O.replace(/./g,"-")},O.replace(/./g,"-")),o.default.createElement("option",{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:O},O),o.default.createElement("option",{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]:[o.default.createElement(l.Option,{disabled:!0,key:"--",value:O.replace(/./g,"-"),className:s.default.select_divider_container}),o.default.createElement(l.Option,{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:O},O),o.default.createElement(l.Option,{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]}},[b,A]),M=o.default.useCallback(O=>{if(!b&&O&&O.length)return O.map(k=>{const F=k.label||k.type,L=`${m.DEFAULT_DYNAMIC_CONFIGURATION_KEY}${k.type}`,{popupHint:N}=k;return w?o.default.createElement("option",{key:L,value:L,label:F},F):o.default.createElement(l.Option,{key:L,value:L,label:F},N?o.default.createElement(l.Popover,{id:`debug_configuration_pop_${L}`,title:N,overlayClassName:s.default.config_popover_insert},F):F)})},[b,d]);return w?o.default.createElement(v.Select,{value:E,onChange:y,className:(0,r.default)(s.default.debug_selection,s.default.special_radius)},T(f),R(),d&&M(d)):o.default.createElement(l.Select,{value:E,onChange:y,className:(0,r.default)(s.default.debug_selection,s.default.special_radius),allowOptionsOverflow:!0},T(f),R(),d&&M(d))});t.DebugActionBar=o.default.memo(({runDebug:E,openConfiguration:f,openDebugConsole:d})=>o.default.createElement("div",{className:s.default.debug_actions},o.default.createElement(p.DebugAction,{id:"debug.action.start",icon:"start",label:(0,_.localize)("debug.action.start"),run:E}),o.default.createElement(p.DebugAction,{id:"debug.action.open.configuration",icon:"setting",label:(0,_.localize)("debug.action.open.configuration"),run:f}),o.default.createElement(p.DebugAction,{id:"debug.action.debug.console",icon:"terminal",label:(0,_.localize)("debug.action.debug.console"),run:d})));const u=()=>{const E=(0,_.useInjectable)(g.DebugConfigurationService),f=(0,_.useAutorun)(E.float);return o.default.createElement(o.default.Fragment,null,o.default.createElement(t.DebugControllerView,{className:s.default.debug_configuration_container}),!f&&o.default.createElement(a.DebugToolbarView,{float:!1,className:s.default.debug_action_bar_internal}))};t.DebugConfigurationContainerView=u;const c=E=>{const{toValue:f,openConfiguration:d,addConfiguration:y,openDebugConsole:b,updateConfiguration:A,start:S,showDynamicQuickPick:D,currentValue:I,configurationOptions:w,dynamicConfigurations:T,isMultiRootWorkspace:R,workspaceRoots:M}=(0,_.useInjectable)(g.DebugConfigurationService),O=(0,_.useAutorun)(T),x=(0,_.useAutorun)(I),k=(0,_.useAutorun)(w),F=(0,_.useAutorun)(R),L=(0,_.useAutorun)(M),N=(0,_.useInjectable)(_.AppConfig),U=(0,_.localize)("debug.action.add.configuration"),W=(0,_.localize)("debug.action.edit.configuration"),{CustomActionBar:j}=E,Q=o.default.useCallback(G=>{let Z;if(typeof G=="object"?Z=G.target.value:Z=G,Z.startsWith(m.DEFAULT_ADD_CONFIGURATION_KEY)||Z===m.DEFAULT_NO_CONFIGURATION_KEY){const $=Z.slice(m.DEFAULT_ADD_CONFIGURATION_KEY.length);y($?M[$]:M[0])}else if(Z===m.DEFAULT_EDIT_CONFIGURATION_KEY)d();else if(Z.startsWith(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY)){const $=Z.slice(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY.length);D($)}else{const[$,V]=Z.split(m.DEFAULT_CONFIGURATION_NAME_SEPARATOR),[H,K]=V.split(m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR);A($,H,+K)}},[]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_configuration_toolbar,E.className||"")},o.default.createElement(h,{currentValue:x,options:k,dynamicOptions:O,workspaceRoots:L,isMultiRootWorkspace:F,onChangeConfiguration:Q,addConfigurationLabel:U,editConfigurationLabel:W,toValue:f,isElectronRenderer:N.isElectronRenderer}),j?o.default.createElement(j,null):o.default.createElement(t.DebugActionBar,{runDebug:S,openConfiguration:d,openDebugConsole:b}))};t.DebugControllerView=c},96090:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(37406),v=e(28423),m=e(64582),p=e(32756);let s=class{constructor(){this.state=(0,v.observableValue)(this,m.DebugState.Inactive),this.currentSession=(0,v.observableValue)(this,void 0),this.sessions=(0,v.observableValue)(this,[]),this.toolBarMenuMap=new Map,this.doStart=async()=>await this.model.start(),this.doRestart=async()=>{const a=this.instrumentReporter("restart"),h=await this.model.restart();return a(),h},this.doStop=async()=>{if(!this.model.currentSession)return;const a=this.instrumentReporter("stop"),h=await this.model.currentSession.terminate();return a(),h},this.doContinue=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("continue"),h=await this.model.currentThread.continue();return a(),h},this.doPause=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("pause"),h=await this.model.currentThread.pause();return a(),h},this.doStepOver=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("stepOver"),h=await this.model.currentThread.stepOver();return a(),h},this.doStepIn=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("stepIn"),h=await this.model.currentThread.stepIn();return a(),h},this.doStepOut=async()=>{if(!this.model.currentThread)return;const a=this.instrumentReporter("stepOut"),h=await this.model.currentThread.stepOut();return a(),h},this.updateCurrentSession=a=>{this.model.currentSession=a},this.model.onDidChange(()=>{this.updateToolBarMenu(),this.updateModel()})}get mainUIService(){return this.injector.get(_.IElectronMainUIService)}updateModel(){(0,v.transaction)(a=>{this.state.set(this.model.state,a),this.currentSession.set(this.model.currentSession,a),this.sessions.set(Array.from(this.model.sessions).filter(h=>h&&h.state>m.DebugState.Inactive),a)})}updateToolBarMenu(){const a=this.currentSession.get();if(a&&a.id&&!this.toolBarMenuMap.has(a.id)){const h=this.contextMenuService.createMenu({id:l.MenuId.DebugToolBar,contextKeyService:this.contextKeyService.createScoped()});a.on("terminated",()=>{this.toolBarMenuMap.delete(a.id)}),this.toolBarMenuMap.set(a.id,h)}}instrumentReporter(a){var h,u,c,E;const f=this.model.currentSession,d=(h=f.configuration)===null||h===void 0?void 0:h.type,y=this.model.currentThread,b=(u=y?.raw)===null||u===void 0?void 0:u.id;this.model.reportAction(f.id,b,a);const A={type:d,request:(E=(c=this.currentSession.get())===null||c===void 0?void 0:c.configuration)===null||E===void 0?void 0:E.request,sessionId:f.id,threadId:b};this.model.report(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION,a,A);const S=this.model.reportTime(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION_TIME,A);return()=>{S(a)}}};t.DebugToolbarService=s,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(l.AbstractContextMenuService),n.__metadata("design:type",l.AbstractContextMenuService)],s.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(p.DebugViewModel),n.__metadata("design:type",p.DebugViewModel)],s.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],s.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),n.__decorate([o.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],s.prototype,"mainUIService",null),t.DebugToolbarService=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},84784:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarOverlayWidget=t.DebugToolbarView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(76003),_=e(97267),v=e(41869),m=e(25918),p=e(77331),s=e(1149),g=e(28423),a=e(64582),h=e(66498),u=e(5905),c=n.__importDefault(e(90463)),E=e(16067),f=e(96090);let d=class{constructor(){this._x=(0,g.observableValue)(this,0),this._line=(0,g.observableValue)(this,0),this._enable=(0,g.observableValue)(this,!1),this.y=0,this.last=0,this.origin=0,this.state=(0,g.derived)(this,w=>({enable:this._enable.read(w),x:this._x.read(w),line:this._line.read(w)}))}setEnable(w){(0,g.transaction)(T=>{this._enable.set(w,T)})}onMouseDown(w){this.setEnable(!0),this.y=w.clientY,this.origin=w.clientX}onMouseMove(w){w.stopPropagation(),(0,g.transaction)(T=>{this._enable.get()&&(this._x.set(w.clientX-this.origin+this.last,T),this._line.set(w.clientY-this.y>10?1:0,T))})}onMouseUp(){this.setEnable(!1),this.last=this._x.get()}};d=n.__decorate([(0,l.Injectable)()],d);const y=I=>{var w;const{state:T,toolBarMenuMap:R,doStop:M,doStepIn:O,doStepOut:x,doStepOver:k,doContinue:F,doRestart:L,doPause:N,currentSession:U,sessions:W,updateCurrentSession:j}=(0,v.useInjectable)(f.DebugToolbarService),Q=(0,v.useAutorun)(T),G=(0,v.useAutorun)(U),Z=(0,v.useAutorun)(W),{isElectronRenderer:$}=(0,v.useInjectable)(v.AppConfig),V=!!G&&((w=G.configuration)===null||w===void 0?void 0:w.request)==="attach"&&!(0,u.isExtensionHostDebugging)(G.configuration),H=G&&G.id,K=(0,o.useCallback)(me=>{if(me&&me.id){const q=R.get(me.id);if(q)return o.default.createElement(m.InlineMenuBar,{menus:q})}return null},[R]),Y=(0,o.useCallback)(me=>V?o.default.createElement(h.DebugAction,{run:M,enabled:me!==a.DebugState.Inactive,icon:"disconnect",label:(0,v.localize)("debug.action.disattach")}):o.default.createElement(h.DebugAction,{run:M,enabled:me!==a.DebugState.Inactive,icon:"stop",label:(0,v.localize)("debug.action.stop")}),[M]),X=(0,o.useCallback)(me=>me===a.DebugState.Stopped?o.default.createElement(h.DebugAction,{run:F,icon:"continue",label:(0,v.localize)("debug.action.continue")}):o.default.createElement(h.DebugAction,{run:N,enabled:Q===a.DebugState.Running,icon:"pause",label:(0,v.localize)("debug.action.pause")}),[N,F]),re=(0,o.useCallback)(me=>me.map(q=>$?o.default.createElement("option",{key:q.id,value:q.id},q.label):o.default.createElement(_.Option,{key:q.id,label:q.label,value:q.id},q.label)),[]),oe=(0,o.useCallback)(me=>{if(me.length>1)return o.default.createElement("div",{className:(0,r.default)(c.default.debug_selection)},$?o.default.createElement(p.Select,{value:H,onChange:he},re(me)):o.default.createElement(_.Select,{className:(0,r.default)(c.default.debug_selection,c.default.special_radius),size:I.float?"small":"default",value:H,options:me.map(q=>({label:q.label,value:q.id})),onChange:he},re(me)))},[H]),he=(0,o.useCallback)(me=>{let q=me;if($&&(q=me.target.value),!!Z)for(const be of Z)be.id===q&&j(be)},[Z,j]);return o.default.createElement("div",{className:(0,r.default)(c.default.debug_action_bar,I.className||"")},oe(Z.filter(me=>!me.parentSession)),o.default.createElement("div",{className:c.default.debug_actions},X(Q),o.default.createElement(h.DebugAction,{run:k,enabled:Q===a.DebugState.Stopped,icon:"step",label:(0,v.localize)("debug.action.step-over")}),o.default.createElement(h.DebugAction,{run:O,enabled:Q===a.DebugState.Stopped,icon:"step-in",label:(0,v.localize)("debug.action.step-into")}),o.default.createElement(h.DebugAction,{run:x,enabled:Q===a.DebugState.Stopped,icon:"step-out",label:(0,v.localize)("debug.action.step-out")}),o.default.createElement(h.DebugAction,{run:L,enabled:Q!==a.DebugState.Inactive,icon:"reload",label:(0,v.localize)("debug.action.restart")}),Y(Q),K(G)))};t.DebugToolbarView=y;const b="debug.toolbar.top",A="debug.toolbar.height",S=()=>{const I=(0,v.useInjectable)(v.PreferenceService),{isElectronRenderer:w}=(0,v.useInjectable)(v.AppConfig),T=(0,v.useInjectable)(s.LayoutViewSizeConfig),R=(0,v.useDesignStyles)(c.default.debug_toolbar_wrapper,"debug_toolbar_wrapper"),[M,O]=(0,o.useState)(0),x=(0,v.useInjectable)(d),k=(0,v.useAutorun)(x.state),F=(0,v.useInjectable)(f.DebugToolbarService),L=(0,v.useAutorun)(F.state);(0,o.useEffect)(()=>{const W=new v.DisposableCollection,j=I.get(b)||0;if(w){const Q=F.mainUIService;Q.isFullScreen(v.electronEnv.currentWindowId).then(G=>{O(G?j:j+T.calcOnlyTitleBarHeight())}),W.push(Q.on("fullScreenStatusChange",(G,Z)=>{G===v.electronEnv.currentWindowId&&O(Z?j:j+T.calcOnlyTitleBarHeight())}))}else O(j);return()=>{W.dispose()}},[]);const N=I.get(A)||0,U=(0,r.default)({[R]:!0,[c.default.debug_toolbar_wrapper_electron]:w});return L?o.default.createElement("div",{style:{pointerEvents:k.enable?"all":"none"},className:c.default.debug_toolbar_container,onMouseMove:W=>x.onMouseMove(W),onMouseUp:W=>x.onMouseUp()},o.default.createElement("div",{style:{transform:`translateX(${k.x}px) translateY(${M+k.line*N}px)`,height:`${N}px`},className:U},o.default.createElement("div",{className:(0,r.default)(c.default.debug_toolbar_drag_wrapper)},o.default.createElement("div",{className:(0,r.default)((0,v.getIcon)("drag"),c.default.debug_toolbar_drag),onMouseDown:W=>x.onMouseDown(W),onMouseMove:W=>x.onMouseMove(W)})),o.default.createElement(t.DebugToolbarView,{float:!0}))):(x.setEnable(!1),null)},D=()=>{const I=(0,v.useInjectable)(E.DebugConfigurationService);return(0,v.useAutorun)(I.float)?o.default.createElement(S,null):null};t.DebugToolbarOverlayWidget=D},53378:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterModel=void 0;const r=e(85608),o=e(76003),l=e(41869);let _=n=class{constructor(){this._parsedQueries=[]}set filterQuery(m){if(this._parsedQueries=[],m=m.trim(),m&&m!==""){const p=(0,l.splitGlobAware)(m,",").map(s=>s.trim()).filter(s=>!!s.length);for(const s of p)s.startsWith("!")?this._parsedQueries.push({type:"exclude",query:s.slice(1)}):this._parsedQueries.push({type:"include",query:s})}}filter(m){let p=!1,s=!1;for(const{type:g,query:a}of this._parsedQueries){if(g==="exclude"&&n.matchQuery(a,m))return!1;g==="include"&&(p=!0,n.matchQuery(a,m)&&(s=!0))}return p&&s}};t.DebugConsoleFilterModel=_,_.matchQuery=l.matchesFuzzy,t.DebugConsoleFilterModel=_=n=r.__decorate([(0,o.Injectable)({multiple:!0})],_)},1276:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(5905),_=e(53378),v=e(62665),{convertSimple2RegExpPattern:m}=o.strings;let p=class{constructor(){this._onDidValueChange=new o.Emitter,this._onDidFocus=new o.Emitter,this._filterText="",this.filterModel=new _.DebugConsoleFilterModel}get onDidValueChange(){return this._onDidValueChange.event}get onDidFocus(){return this._onDidFocus.event}focusInput(){this._onDidFocus.fire()}get filterText(){return this._filterText}setFilterText(g){return this._filterText!==g&&(this._filterText=g,this.filterModel.filterQuery=this._filterText,this._onDidValueChange.fire(this._filterText)),this}filter(g){const a=v.ansiToText(g);return this._filterText===""||this.filterModel.filter(a)}findMatches(g){const a=new RegExp(m(this._filterText.toLowerCase()),"g");if(this._filterText.trim()==="")return[];const h=(0,l.matchAll)(g.toLowerCase(),a),u=this._filterText.length;return u===0?[]:h.map(E=>({startIndex:E.index!==void 0?E.index:-1,count:u})).filter(E=>E.startIndex>=0)}};t.DebugConsoleFilterService=p,t.DebugConsoleFilterService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},4161:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(14041)),l=e(15857),_=e(41869),v=e(1276),m=n.__importDefault(e(80315)),p=()=>{const s=(0,_.useInjectable)(v.DebugConsoleFilterService),[g,a]=o.default.useState(""),[h,u]=o.default.useState(),c=(0,_.useDesignStyles)(m.default.debug_console_filter,"debug_console_filter"),E=(0,_.useDesignStyles)(m.default.filter_input,"filter_input"),f=(0,r.default)(b=>{a(b),s.setFilterText(b),h&&h.addToHistory(b)},400);o.default.useEffect(()=>{const b=s.onDidValueChange(A=>{a(A)});return()=>{b.dispose()}},[]);const d=b=>{u(b)},y=b=>{h&&(b.keyCode===_.Key.ARROW_UP.keyCode?h.showPreviousValue():b.keyCode===_.Key.ARROW_DOWN.keyCode&&h.showNextValue())};return o.default.useEffect(()=>{const b=s.onDidFocus(()=>{h&&h.focus()});return()=>{b.dispose()}},[h]),o.default.createElement("div",{className:c},o.default.createElement(l.HistoryInputBox,{hasClear:!0,className:E,value:g,placeholder:(0,_.localize)("debug.console.filter.placeholder"),onValueChange:f,onReady:d,onKeyDown:y}))};t.DebugConsoleFilterView=p},80390:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleTreeModel=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(41869),v=e(98650);let m=n=class extends l.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new _.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this._tempScrollOffset=0,this.init(s)}get isScrollBottom(){return this._tempScrollOffset=Math.max(this.state.scrollOffset,this._tempScrollOffset),this._tempScrollOffset===this.state.scrollOffset}init(s){this.root=s,this.root.watcher.on(l.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugConsoleTreeModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugConsoleTreeModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},75563:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleSession=void 0;const n=e(85608),r=n.__importDefault(e(97331)),o=e(76003),l=e(43718),_=e(52416),v=e(92679),m=e(58542),p=e(29539),s=e(16170),g=e(80390);let a=class{constructor(u,c){this.session=u,this.treeModel=c,this.toDispose=new l.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.onDidChangeEmitter=new l.Emitter,this.init()}resolveChildren(){return(this.treeModel.root.flattenedBranch||[]).map(c=>this.treeModel.root.getTreeNodeById(c))}getLastItem(){const{flattenedBranch:u}=this.treeModel.root,c=u?.length?u[u.length-1]:void 0;return c?this.treeModel.root.getTreeNodeById(c):void 0}init(){this.toDispose.push(this.session.on("output",u=>this.logOutput(this.session,u)))}addChildSession(u){this.toDispose.push(u.on("output",c=>this.logOutput(u,c)))}get onDidChange(){return this.onDidChangeEmitter.event}clear(){this.fireDidChange()}async logOutput(u,c){var E;const f="\x1B[2J",d=c.body,{category:y,variablesReference:b,source:A,line:S}=d;if(!this.treeModel)return;const D=y==="stderr"?l.MessageType.Error:y==="stdout"?l.MessageType.Info:y==="console"?l.MessageType.Warning:l.MessageType.Info;if(y==="telemetry"){this.logger.debug(`telemetry/${c.body.output}`,c.body.data);return}if(b){const I=new s.DebugConsoleNode({session:u,variablesReference:b,source:A,line:S},"",(E=this.treeModel)===null||E===void 0?void 0:E.root);await I.evaluate(),this.treeModel.root.insertItem(I)}else if(typeof d.output=="string"){let I=d.output;I.indexOf(f)>=0&&(this.clearConsole(),await this.insertItemWithAnsi((0,l.localize)("debug.console.consoleCleared"),l.MessageType.Info),I=I.substring(I.lastIndexOf(f)+f.length));const w=this.getLastItem();w&&!w.description.endsWith(`
33296
33296
  `)&&!w.description.endsWith(`\r
33297
33297
  `)&&w.severity===D?(this.treeModel.root.unlinkItem(w),await this.insertItemWithAnsi(w.description+d.output,D,A,S)):await this.insertItemWithAnsi(d.output,D,A,S)}this.fireDidChange()}async clearConsole(){var u;const c=(u=this.treeModel.root.flattenedBranch)===null||u===void 0?void 0:u.map(E=>this.treeModel.root.getTreeNodeById(E));if(c)for(const E of c)this.treeModel.root.unlinkItem(E)}async insertItemWithAnsi(u,c,E,f){var d;const y=await(0,v.handleANSIOutput)(u,this.linkDetector,this.themeService,void 0);this.treeModel.root.insertItem(new s.AnsiConsoleNode(u,(d=this.treeModel)===null||d===void 0?void 0:d.root,this.linkDetector,y,c,E,f))}async execute(u){var c;this.treeModel.root.insertItem(new s.AnsiConsoleNode(u,this.treeModel.root,this.linkDetector,void 0,l.MessageType.Info));const E=new s.DebugConsoleNode({session:this.session},u,(c=this.treeModel)===null||c===void 0?void 0:c.root);await E.evaluate(),this.treeModel.root.insertItem(E),this.fireDidChange()}append(u){var c;if(!u)return;const E=this.resolveChildren().slice(-1)[0];E instanceof s.AnsiConsoleNode&&E.description===this.uncompletedItemContent?(this.resolveChildren().pop(),this.uncompletedItemContent+=u):this.uncompletedItemContent=u,this.treeModel.root.insertItem(new s.AnsiConsoleNode(this.uncompletedItemContent,(c=this.treeModel)===null||c===void 0?void 0:c.root,this.linkDetector,void 0,l.MessageType.Info)),this.fireDidChange()}appendLine(u){var c;this.treeModel.root.insertItem(new s.AnsiConsoleNode(u,(c=this.treeModel)===null||c===void 0?void 0:c.root,this.linkDetector,void 0,l.MessageType.Info)),this.fireDidChange()}};t.DebugConsoleSession=a,n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],a.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(m.LinkDetector),n.__metadata("design:type",m.LinkDetector)],a.prototype,"linkDetector",void 0),n.__decorate([(0,o.Autowired)(_.IThemeService),n.__metadata("design:type",Object)],a.prototype,"themeService",void 0),t.DebugConsoleSession=a=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__param(0,(0,o.Optional)()),n.__param(1,(0,o.Optional)()),n.__metadata("design:paramtypes",[p.DebugSession,g.DebugConsoleTreeModel])],a)},15153:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleModelService=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(41869),v=e(93899),m=e(64582),p=e(58542),s=e(16170),g=e(98650),a=e(32756),h=e(17280),u=e(80390),c=e(75563),E=r.__importDefault(e(80315)),{Path:f}=_.path;let d=n=class{constructor(){this.debugSessionModelMap=new Map,this._changeEventDispatchQueue=[],this.selectedDecoration=new l.Decoration(E.default.mod_selected),this.contextMenuDecoration=new l.Decoration(E.default.mod_actived),this.loadingDecoration=new l.Decoration(E.default.mod_loading),this._selectedNodes=[],this.onDidRefreshedEmitter=new _.Emitter,this.onDidUpdateTreeModelEmitter=new _.Emitter,this.treeModelDisposableCollection=new _.DisposableCollection,this.debugConsoleDisposableCollection=new _.DisposableCollection,this.activeNodeDecoration=(b,A=!0)=>{var S;if(this.contextMenuNode&&(this.contextMenuDecoration.removeTarget(this.contextMenuNode),this._contextMenuNode=void 0),b){if(this.selectedNodes.length>0)for(const D of this.selectedDecoration.appliedTargets.keys())this.selectedDecoration.removeTarget(D);this.focusedNode,this.selectedDecoration.addTarget(b),this._focusedNode=b,this._selectedNodes=[b],A&&((S=this.treeModel)===null||S===void 0||S.dispatchChange())}},this.activeNodeActivedDecoration=b=>{var A;this.contextMenuNode&&this.contextMenuDecoration.removeTarget(this.contextMenuNode),this.focusedNode&&(this._focusedNode=void 0),this.contextMenuDecoration.addTarget(b),this._contextMenuNode=b,(A=this.treeModel)===null||A===void 0||A.dispatchChange()},this.enactiveNodeDecoration=()=>{var b;this.focusedNode&&(this._focusedNode=void 0),this.contextMenuNode&&this.contextMenuDecoration.removeTarget(this.contextMenuNode),(b=this.treeModel)===null||b===void 0||b.dispatchChange()},this.handleContextMenu=(b,A)=>{var S;b.stopPropagation(),b.preventDefault();const{x:D,y:I}=b.nativeEvent;this.debugContextKey.contextInDebugConsole.set(!0),A?this.activeNodeActivedDecoration(A):this.enactiveNodeDecoration();let w;A?w=A:w=(S=this.treeModel)===null||S===void 0?void 0:S.root;const T=this.contextMenuService.createMenu({id:v.MenuId.DebugConsoleContext,contextKeyService:this.debugContextKey.contextKeyScoped}),R=T.getMergedMenuNodes();T.dispose(),this.ctxMenuRenderer.show({anchor:{x:D,y:I},menuNodes:R,args:[w],onHide:()=>{window.requestAnimationFrame(()=>{this.debugContextKey.contextInDebugConsole.set(!1)})}})},this.handleTreeBlur=()=>{this.enactiveNodeDecoration()},this.handleItemClick=b=>{this.activeNodeDecoration(b)},this.handleTwistierClick=(b,A)=>{if(A===l.TreeNodeType.CompositeTreeNode){if(g.DebugConsoleNode.is(b)&&b.available){this.activeNodeDecoration(b,!1),this.toggleDirectory(b);return}else if(b.variablesReference){this.activeNodeDecoration(b,!1),this.toggleDirectory(b);return}}this.activeNodeDecoration(b)},this.toggleDirectory=async b=>{b.expanded?this.treeHandle.collapseNode(b):this.treeHandle.expandNode(b)},this.flushEventQueue=()=>{let b;if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.length===0)return;this._changeEventDispatchQueue.sort((S,D)=>{const I=f.pathDepth(S),w=f.pathDepth(D);return I-w});const A=[this._changeEventDispatchQueue[0]];for(const S of this._changeEventDispatchQueue)A.some(D=>S.indexOf(D)===0)||A.push(S);return b=(0,_.pSeries)(A.map(S=>async()=>{var D,I;const w=(I=(D=this.treeModel)===null||D===void 0?void 0:D.root)===null||I===void 0?void 0:I.getTreeNodeByPath(S);return w&&l.CompositeTreeNode.is(w)&&await w.refresh(),null})),this._changeEventDispatchQueue=[],b},this.init()}get flushEventQueuePromise(){return this.flushEventQueueDeferred&&this.flushEventQueueDeferred.promise}get contextMenuContextKeyService(){return this._contextMenuContextKeyService||(this._contextMenuContextKeyService=this.contextKeyService.createScoped()),this._contextMenuContextKeyService}get treeHandle(){return this._debugWatchTreeHandle}get decorations(){return this._decorations}get treeModel(){var b;return(b=this._activeDebugSessionModel)===null||b===void 0?void 0:b.treeModel}get debugConsoleSession(){var b;return(b=this._activeDebugSessionModel)===null||b===void 0?void 0:b.debugConsoleSession}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}get contextMenuNode(){return this._contextMenuNode}get onDidUpdateTreeModel(){return this.onDidUpdateTreeModelEmitter.event}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}clear(){this.initTreeModel(this.manager.currentSession,!0)}collapseAll(){var b;(b=this.treeModel)===null||b===void 0||b.root.collapsedAll()}copyAll(){var b;let A="";if(!(!(!((b=this.treeModel)===null||b===void 0)&&b.root)||!this.treeModel.root.children)){for(const S of this.treeModel.root.children)A+=this.getValidText(S)+`
33298
33298
  `;this.clipboardService.writeText(A.slice(0,-1))}}copy(b){b&&this.clipboardService.writeText(this.getValidText(b))}getValidText(b){return b.description.endsWith(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/cli-engine",
3
- "version": "3.9.1-next-1752974346.0",
3
+ "version": "3.9.1-next-1753350817.0",
4
4
  "description": "Integration engine runtime for opensumi-cli and opensumi extension",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "dependencies": {
27
27
  "@koa/cors": "^5.0.0",
28
28
  "@opensumi/di": "^1.8.0",
29
- "@opensumi/ide-core-browser": "3.9.1-next-1752974346.0",
30
- "@opensumi/ide-core-common": "3.9.1-next-1752974346.0",
31
- "@opensumi/ide-core-node": "3.9.1-next-1752974346.0",
32
- "@opensumi/ide-express-file-server": "3.9.1-next-1752974346.0",
33
- "@opensumi/ide-extension": "3.9.1-next-1752974346.0",
34
- "@opensumi/ide-i18n": "3.9.1-next-1752974346.0",
35
- "@opensumi/ide-main-layout": "3.9.1-next-1752974346.0",
36
- "@opensumi/ide-startup": "3.9.1-next-1752974346.0",
29
+ "@opensumi/ide-core-browser": "3.9.1-next-1753350817.0",
30
+ "@opensumi/ide-core-common": "3.9.1-next-1753350817.0",
31
+ "@opensumi/ide-core-node": "3.9.1-next-1753350817.0",
32
+ "@opensumi/ide-express-file-server": "3.9.1-next-1753350817.0",
33
+ "@opensumi/ide-extension": "3.9.1-next-1753350817.0",
34
+ "@opensumi/ide-i18n": "3.9.1-next-1753350817.0",
35
+ "@opensumi/ide-main-layout": "3.9.1-next-1753350817.0",
36
+ "@opensumi/ide-startup": "3.9.1-next-1753350817.0",
37
37
  "chalk": "^4.1.2",
38
38
  "ejs": "^3.1.7",
39
39
  "ip": "^1.1.8",
@@ -72,5 +72,5 @@
72
72
  "webpack": "^5.90.0",
73
73
  "webpack-cli": "^5.1.4"
74
74
  },
75
- "gitHead": "dce7b98696d49eaf5ca9fe376078015005227581"
75
+ "gitHead": "8fbbea3371716bd8697f9e5e75e3e8cb6c99d259"
76
76
  }