@opensumi/cli-engine 3.7.1-next-1737368070.0 → 3.7.1-next-1737534874.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.
- package/lib/browser/browser.js +2 -2
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -28245,7 +28245,7 @@ ${JSON.stringify(r,null,2)}`);const l=n[o]();return new Language(INTERNAL,l)})}}
|
|
|
28245
28245
|
`);return g.length>n.lineBasedCompletionModelConfigs.completionPromptMaxLineSize&&(s=g.slice(-n.lineBasedCompletionModelConfigs.completionPromptMaxLineSize).join(`
|
|
28246
28246
|
`)),s}function _(s){s=s.replace(/^s*[\n]/gm,"");const g=s.split(`
|
|
28247
28247
|
`);return g.length>n.lineBasedCompletionModelConfigs.completionSuffixMaxLineSize&&(s=g.slice(-n.lineBasedCompletionModelConfigs.completionSuffixMaxLineSize).join(`
|
|
28248
|
-
`)),s}t.lineBasedPromptProcessor={processPrefix:p,processSuffix:_}},71863:(L,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AICompletionsService=void 0;const r=e(85608),o=e(76003),l=e(41869),m=e(43718),E=e(52664);let p=n=class extends m.Disposable{constructor(){super(...arguments),this._onVisibleCompletion=new m.Emitter,this.onVisibleCompletion=this._onVisibleCompletion.event,this.cancelIndicator=new m.CancellationTokenSource,this.isDefaultCompletionModel=!0,this._isVisibleCompletion=!1,this.validCompletionThreshold=750}recordRenderTime(){this.lastRenderTime=Date.now()}recordCompletionUseTime(s){this.lastCompletionUseTime=Date.now()-s}get isVisibleCompletion(){return this._isVisibleCompletion}async complete(s){var g,c;this.isDefaultCompletionModel=!0;const h=Date.now();try{const u=await((c=(g=this.aiBackService).requestCompletion)===null||c===void 0?void 0:c.call(g,s,this.cancelIndicator.token));this.recordCompletionUseTime(h);const{sessionId:d,codeModelList:v,isCancel:f}=u;return{items:v.map(a=>({...a,insertText:a.content})),extra:{sessionId:d,isCancel:f}}}catch{return}}async report(s){const{relationId:g,accept:c}=s;s.renderingTime=Date.now()-this.lastRenderTime,s.completionUseTime=this.lastCompletionUseTime,this.reporterEnd(g,{success:!0,isReceive:c,renderingTime:s.renderingTime,code:s.code,actionSource:m.ActionSourceEnum.Completion,actionType:m.ActionTypeEnum.Completion}),this._isVisibleCompletion=!1}async reporterEnd(s,g){const c={...g,isValid:typeof g.renderingTime=="number"?g.renderingTime>this.validCompletionThreshold:!1};c.isValid&&this.aiReporter.end(s,c)}setVisibleCompletion(s){this._isVisibleCompletion===!0&&s===!1&&this.report({sessionId:this.lastSessionId,accept:!1,relationId:this.lastRelationId,code:this.lastCompletionContent}),this._isVisibleCompletion=s,this._onVisibleCompletion.fire(s),s===!0&&this.recordRenderTime()}setLastSessionId(s){this.lastSessionId=s}setLastRelationId(s){this.lastRelationId=s}setLastCompletionContent(s){this.lastCompletionContent=s}async cancelRequest(){this.cancelIndicator.cancel(),this.cancelIndicator=new m.CancellationTokenSource}updateStatusBarItem(s,g){const c=g?`$(loading~spin) ${s}`:`$(magic-wand) ${s}`;this.statusBarService.addElement(n.STATUS_ID,{text:c,alignment:l.StatusBarAlignment.RIGHT,priority:1})}hideStatusBarItem(){this.statusBarService.removeElement(n.STATUS_ID)}};t.AICompletionsService=p,p.STATUS_ID="ai_completion_status",r.__decorate([(0,o.Autowired)(m.AIBackSerivcePath),r.__metadata("design:type",Object)],p.prototype,"aiBackService",void 0),r.__decorate([(0,o.Autowired)(l.IStatusBarService),r.__metadata("design:type",Object)],p.prototype,"statusBarService",void 0),r.__decorate([(0,o.Autowired)(E.IAIReporter),r.__metadata("design:type",Object)],p.prototype,"aiReporter",void 0),t.AICompletionsService=p=n=r.__decorate([(0,o.Injectable)()],p)},71585:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SnippetSemantics=t.SortOption=t.WishListAttributeName=t.NeighboringTabsOption=t.SnippetSelectionOption=t.StrategyType=t.TokenizerName=void 0;var e;(function(p){p.cl100k_base="cl100k_base",p.gpt2="gpt2",p.r50k_base="r50k_base",p.p50k_base="p50k_base",p.p50k_edit="p50k_edit",p.o200k_base="o200k_base"})(e||(t.TokenizerName=e={}));var n;(function(p){p.InterceptBasedOnChar="InterceptBasedOnChar",p.InterceptBasedOnLine="InterceptBasedOnLine",p.InterceptBasedOnFunction="InterceptBasedOnFunction"})(n||(t.StrategyType=n={}));var r;(function(p){p.BestMatch="bestMatch",p.TopK="topK"})(r||(t.SnippetSelectionOption=r={}));var o;(function(p){p.openFileHistory="openFileHistory",p.editFileRecent="editFileRecent",p.editFileHistory="editFileHistory"})(o||(t.NeighboringTabsOption=o={}));var l;(function(p){p.beforeCursor="beforeCursor",p.afterCursor="afterCursor",p.importedFile="importedFile",p.languageMarker="languageMarker",p.pathMarker="pathMarker",p.similarFile="similarFile"})(l||(t.WishListAttributeName=l={}));var m;(function(p){p.Ascending="ascending",p.Descending="descending",p.None="none"})(m||(t.SortOption=m={}));var E;(function(p){p.Function="function",p.Snippet="snippet",p.Variable="variable",p.Parameter="parameter",p.Method="method",p.Class="class",p.Module="module",p.Alias="alias",p.Enum="enum member",p.Interface="interface"})(E||(t.SnippetSemantics=E={}))},84176:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdditionsDeletionsDecorationModel=void 0;const n=e(85608),r=e(20868),o=e(53617),l=e(8191),m=n.__importDefault(e(71800));class E{constructor(_){this.editor=_,this.deletionsDecorations=new o.EnhanceDecorationsCollection(this.editor),this.additionsDecorations=new o.EnhanceDecorationsCollection(this.editor)}generateRange(_,s,g){const c=[];let h=1,u=1;for(const d of _){const v=d.value.split(g),f=v.length,a=h+f-1,b=f>1?v[f-1].length+1:u+d.value.length;d.added&&(c.push({startLineNumber:h+s.startLineNumber-1,startColumn:u,endLineNumber:a+s.startLineNumber-1,endColumn:b}),u=b,h=a),d.removed||(u=b,h=a)}return c}clearDeletionsDecorations(){this.deletionsDecorations.clear()}clearAdditionsDecorations(){this.additionsDecorations.clear()}updateDeletionsDecoration(_,s,g){const c=this.generateRange(_.map(h=>{const u=h.value;return h.removed?{value:u,added:!0}:h.added?{value:u,removed:!0}:h}),s,g);this.deletionsDecorations.set(c.map(h=>({range:h,options:{description:"suggestion_deletions_background",className:m.default.suggestion_deletions_background,stickiness:r.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}})))}updateAdditionsDecoration(_){this.additionsDecorations.set(_.map(s=>({range:s,options:{description:l.REWRITE_DECORATION_INLINE_ADD,className:m.default.suggestion_additions_background,stickiness:r.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}})))}}t.AdditionsDeletionsDecorationModel=E},591:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiLineDecorationModel=t.GHOST_TEXT=t.GHOST_TEXT_DESCRIPTION=void 0;const n=e(43718),r=e(20868),o=e(77714),l=e(2261),m=e(37705),E=e(53617);var p;(function(s){s.beginning="beginning",s.end="end"})(p||(p={})),t.GHOST_TEXT_DESCRIPTION="ghost-text-decoration",t.GHOST_TEXT="ghost-text";class _{constructor(g){this.editor=g,this.ghostTextDecorations=new E.EnhanceDecorationsCollection(this.editor)}splitDiffChanges(g,c){const h=g.flatMap(u=>{const d=u.value.split(c),v=f=>({value:f,added:u.added,removed:u.removed});return d.flatMap((f,a)=>a<d.length-1?[v(f),v(c)]:v(f)).filter(f=>f.value!==o.empty)});for(let u=0;u<h.length-1;u++){const d=h[u],v=h[u+1];d.removed&&v.added&&v.value.startsWith(d.value)&&(d.added=!0,d.removed=!0)}return h}combineContinuousMods(g){const c=[];let h=o.empty;for(const u of g)u.isEolLine?(c.push(h),h=o.empty):h+=u.newValue;return h!==o.empty&&c.push(h),c}processLineModifications(g,c,h,u,d=!0){const v=this.combineContinuousMods(g),f=v.length,a=[],b=[];if(f===0)return{fullLineMods:a,inlineMods:b};const y=v[0],S=v[f-1];if(f===1)return d?!(0,n.isUndefined)(h)&&h.value!==c?b.push({status:p.beginning,newValue:h.value+y,oldValue:h.value}):!(0,n.isUndefined)(u)&&u.value!==c?b.push({status:p.end,newValue:S+u.value,oldValue:u.value}):a.push(y):a.push(y),{fullLineMods:a,inlineMods:b};if((0,n.isUndefined)(h)||h.value===c?a.push(y):b.push({status:p.beginning,newValue:h.value+y,oldValue:h.value}),f>2){const A=v.slice(1,-1);for(const T of A)a.push(T)}return(0,n.isUndefined)(u)||u.value===c?a.push(S):b.push({status:p.end,newValue:S+u.value,oldValue:u.value}),{fullLineMods:a,inlineMods:b}}getEdits(){return this.ghostTextDecorations.getDecorations().map(({editorDecoration:h,range:u})=>{var d;const f=((d=h.options.after)===null||d===void 0?void 0:d.content)||"";return{range:u,text:f}})}clearDecorations(){this.ghostTextDecorations.clear()}updateLineModificationDecorations(g){if(g.length===0){this.clearDecorations();return}const c=g.map(h=>{let u;if(h.newValue.startsWith(h.oldValue))u=h.newValue.slice(h.oldValue.length);else{const d=h.newValue.indexOf(h.oldValue);u=d!==-1?h.newValue.slice(0,d):h.newValue}return{range:r.Range.fromPositions(new r.Position(h.lineNumber,h.column)),options:{description:t.GHOST_TEXT,showIfCollapsed:!0,after:{content:u,inlineClassName:t.GHOST_TEXT_DESCRIPTION}}}});this.ghostTextDecorations.set(c)}applyInlineDecorations(g,c,h,u){var d,v,f,a,b,y,S,A,T;const w=g.getModel();if(!w)return;const D=w.getEOL();c=this.splitDiffChanges(c,D),c.unshift({value:D,added:void 0,removed:void 0});let I=Math.max(h-1,0);const O=w.getValue(),P=w.getLineContent(u.lineNumber),R={},M=[];let k=o.empty,B=P.trim()===o.empty,x,N=[],j=I,K=1;const U=z=>{var G;const Q=!M.some(H=>H.lineNumber===I&&H.lockLineGhostText),{fullLineMods:Z,inlineMods:$}=this.processLineModifications(N,D,x,z,Q);return R[I]=[...(G=R[I])!==null&&G!==void 0?G:[],...Z.map(H=>({content:H,decorations:[new m.LineDecoration(1,H.length+1,"ghost-text",0)]}))],$.forEach(H=>M.push({lineNumber:H.status===p.beginning?I:I+1,column:H.status===p.beginning?K:1,newValue:H.newValue,oldValue:H.oldValue})),{fullLineMods:Z,inlineMods:$}};for(const z of c)if(z.added){const G=z.value===D;G&&(k=o.empty),N.push({isEolLine:G,lineNumber:I,newValue:G?o.empty:z.value,oldValue:G?o.empty:k})}else{const{inlineMods:G}=U(z);if(R[I].length>0&&O.split(D)[I]===o.empty){const Q=R[I];if(Q.length>0){const Z=Q[0].content,$=Q.slice(1);Z.startsWith(P)&&(M.some(H=>H.lineNumber===I+1&&H.lockLineGhostText)?((v=R[S=I+1])!==null&&v!==void 0||(R[S]=[]),R[I+1].unshift(...Q)):(M.push({lineNumber:I+1,column:1,newValue:Z,oldValue:o.empty,lockLineGhostText:!0}),(d=R[y=I+1])!==null&&d!==void 0||(R[y]=[]),R[I+1].unshift(...$)),R[I]=[])}}if(I===u.lineNumber&&G.length>0&&(B=!1,I<u.lineNumber&&((f=R[I])===null||f===void 0?void 0:f.length)>0||I===u.lineNumber&&G.length>0&&K<u.column))return;x=z,N=[],z.value===D?(j++,K=1,k=o.empty):j>I?(I=j,K+=z.value.length,N=[],k+=z.value):(K+=z.value.length,k+=z.value)}const{fullLineMods:Y}=U(void 0);if(B){const z=R[u.lineNumber-1];if(z?.length>0){const G=z[0].content,Q=z.slice(1);M.some(Z=>Z.lineNumber===u.lineNumber&&Z.lockLineGhostText)?((b=R[T=u.lineNumber])!==null&&b!==void 0||(R[T]=[]),R[u.lineNumber].unshift(...z)):(M.push({lineNumber:u.lineNumber,column:u.column,newValue:G.slice(u.column-1),oldValue:P,lockLineGhostText:!0}),(a=R[A=u.lineNumber])!==null&&a!==void 0||(R[A]=[]),R[u.lineNumber].unshift(...Q)),R[u.lineNumber-1]=[]}}else if(I<u.lineNumber&&Y.length>0)return;return{fullLineMods:R,inlineMods:M}}accept(){const g=this.getEdits();g.length!==0&&(this.editor.pushUndoStop(),this.editor.executeEdits("multiLineCompletions.accept",g.map(c=>l.EditOperation.insert(r.Position.lift({lineNumber:c.range.startLineNumber,column:c.range.startColumn}),c.text))))}}t.MultiLineDecorationModel=_},59945:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordChangesToLineChangesMap=t.computeMultiLineDiffChanges=t.mergeMultiLineDiffChanges=t.rewriteDiffComputer=t.multiLineDiffComputer=void 0;const n=e(77714);class r{extractCommon(g,c,h,u){const d=c.length,v=h.length;let f=g.newPos,a=f-u,b=0;for(;f+1<d&&a+1<v&&this.equals(c[f+1],h[a+1]);)f++,a++,b++;return b&&(g.changeResult.push({count:b,value:n.empty}),g.newPos=f),a}equals(g,c){return g===c}tokenize(g){return g.split(n.empty).filter(Boolean)}diff(g,c){const h=I=>({newPos:I.newPos,changeResult:[...I.changeResult]}),u=I=>I.join(n.empty),d=(I,O,P)=>{const R=I.length;let M=0,k=0,B=0;for(;M<R;M++){const x=I[M];x.removed?(x.value=u(P.slice(B,B+x.count)),B+=x.count,M&&I[M-1].added&&([I[M-1],I[M]]=[I[M],I[M-1]])):(x.value=u(O.slice(k,k+x.count)),k+=x.count,x.added||(B+=x.count))}return R>1&&typeof I[R-1].value=="string"&&(I[R-1].added||I[R-1].removed)&&this.equals(n.empty,I[R-1].value)&&(I[R-2].value+=I[R-1].value,I.pop()),I},v=this.tokenize(g),f=this.tokenize(c),a=v.length,b=f.length,y=a+b,S=[{newPos:-1,changeResult:[]}],A=this.extractCommon(S[0],f,v,0),T=(I,O,P)=>{const R=I.length,M=I[R-1];R>0&&M.added===O&&M.removed===P?I[R-1]={count:M.count+1,added:O,removed:P,value:n.empty}:I.push({count:1,added:O,removed:P,value:n.empty})};let w=1;if(S[0].newPos+1>=a&&A+1>=b)return[{value:u(f),count:f.length}];const D=()=>{for(let I=-w;I<=w;I+=2){const O=S[I-1],P=S[I+1];let R,M=(P?P.newPos:0)-I;O&&(S[I-1]=void 0);const k=O&&O.newPos+1<b,B=P&&0<=M&&M<a;if(!k&&!B){S[I]=void 0;continue}if(!k||B&&O.newPos<P.newPos?(R=h(P),T(R.changeResult,void 0,!0)):(R=O,R.newPos++,T(R.changeResult,!0,void 0)),M=this.extractCommon(R,f,v,I),R.newPos+1>=b&&M+1>=a)return d(R.changeResult,f,v);S[I]=R}w++};for(;w<=y;){const I=D();if(I)return I}}}const o=/^[a-zA-Z]+$/u,l=/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/;class m extends r{equals(g,c){const h=g.toLowerCase(),u=c.toLowerCase();return h===u}tokenize(g){const c=g.split(l);for(let h=0;h<c.length-1;h++){const u=c[h+1],d=c[h+2];!u&&d&&o.test(c[h])&&o.test(d)&&(c[h]+=d,c.splice(h+1,2),h--)}return c}}t.multiLineDiffComputer=new r,t.rewriteDiffComputer=new m;const E=(s,g)=>{const c=s.flatMap(h=>{const u=h.value.split(g),d=v=>({value:v,added:h.added,removed:h.removed});return u.flatMap((v,f)=>f<u.length-1?[d(v),d(g)]:d(v)).filter(v=>v.value!==n.empty)});for(let h=0;h<c.length-1;h++){const u=c[h],d=c[h+1];u.removed&&d.added&&d.value.startsWith(u.value)&&(u.added=!0,u.removed=!0)}return c};t.mergeMultiLineDiffChanges=E;const p=(s,g,c,h,u)=>{var d,v;let f=t.rewriteDiffComputer.diff(s,g)||[],a=t.multiLineDiffComputer.diff(s,g)||[];const b=s.split(u),y=g.split(u);b.length===y.length&&b.every((D,I)=>y[I].startsWith(D))&&(a=b.map((D,I)=>{const O=y[I],P=[{value:D}];if(O!==D){const R=O.substring(D.length);P.push({value:R,added:!0},{value:u})}else P[0].value=P[0].value+u;return P}).flat());const S=c.getPosition();if(S){const D={lineNumber:S.lineNumber-h+1,column:S.column},I=b.slice(0,D.lineNumber-1).join(u),O=(d=b[D.lineNumber-1])===null||d===void 0?void 0:d.slice(0,D.column-1),P=I===y.slice(0,D.lineNumber-1).join(u),R=O===((v=y[D.lineNumber-1])===null||v===void 0?void 0:v.slice(0,D.column-1));if(P&&R){const M=N=>{var j;return((j=N[D.lineNumber-1])===null||j===void 0?void 0:j.slice(D.column-1))+u+N.slice(D.lineNumber).join(u)},k=M(y),B=M(b),x=I+(b.slice(0,D.lineNumber-1).length>0?u:n.empty)+O;if(k.endsWith(B)){const N=k.slice(0,k.length-B.length);a=[{value:x},{value:N,added:!0},{value:B}]}}}const A=(0,t.mergeMultiLineDiffChanges)(f,u),T=b.length===y.length&&!A.some(D=>D.added!==!0&&D.removed&&D.value!==u);return{singleLineCharChanges:(0,t.mergeMultiLineDiffChanges)(a,u),charChanges:a,wordChanges:f,isOnlyAddingToEachWord:T}};t.computeMultiLineDiffChanges=p;const _=(s,g,c)=>{const h={},u=c?.getEOL();let d=g.startLineNumber;const v=b=>{h[d]||(h[d]=[]),h[d].push([b])},f=b=>{var y;const S=(y=h[d])===null||y===void 0?void 0:y[h[d].length-1];S?S.push(b):v(b)},a=()=>{d++};return s.forEach(b=>{const{value:y,added:S,removed:A}=b;y.split(u).forEach((w,D)=>{D===0?f({value:w,added:S,removed:A}):(a(),v({value:w,added:S,removed:A}))})}),h};t.wordChangesToLineChangesMap=_},40650:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditsResultValue=void 0;const n=e(43718);class r extends n.Disposable{constructor(l){super(),this.raw=l}get items(){return this.raw.items}}t.CodeEditsResultValue=r},99301:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelligentCompletionsContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57925),m=e(50394),E=e(43718),p=e(54414),_=e(51553),s=e(7511);let g=class{registerCommands(h){h.registerCommand(l.AI_MULTI_LINE_COMPLETION_DISCARD,{execute:()=>{var u;const d=this.workbenchEditorService.currentCodeEditor;d&&((u=s.IntelligentCompletionsController.get(d.monacoEditor))===null||u===void 0||u.discard.get())}}),h.registerCommand(l.AI_MULTI_LINE_COMPLETION_ACCEPT,{execute:()=>{var u;const d=this.workbenchEditorService.currentCodeEditor;d&&((u=s.IntelligentCompletionsController.get(d.monacoEditor))===null||u===void 0||u.accept.get())}})}registerKeybindings(h){h.registerKeybinding({command:l.AI_MULTI_LINE_COMPLETION_DISCARD.id,keybinding:o.Key.ESCAPE.code,when:m.MultiLineEditsIsVisible.raw,priority:100}),h.registerKeybinding({command:l.AI_MULTI_LINE_COMPLETION_ACCEPT.id,keybinding:o.Key.TAB.code,when:m.MultiLineEditsIsVisible.raw},o.KeybindingScope.USER)}};t.IntelligentCompletionsContribution=g,n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorServiceImpl)],g.prototype,"workbenchEditorService",void 0),t.IntelligentCompletionsContribution=g=n.__decorate([(0,E.Domain)(o.ClientAppContribution,o.KeybindingContribution,E.CommandContribution)],g)},7511:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelligentCompletionsController=void 0;const n=e(41869),r=e(50394),o=e(43718),l=e(20868),m=e(28423),E=e(77714),p=e(94170),_=e(69292),s=e(37355),g=e(69899),c=e(23268),h=e(77659),u=e(8191),d=e(99906),v=e(84176),f=e(591),a=e(59945),b=e(78409),y=e(36368),S=e(12979),A=e(25576),T=e(40650);class w extends d.BaseAIMonacoEditorController{constructor(){super(...arguments),this.reportData=(0,m.derived)(this,I=>{const O=this.codeEditsSourceCollection.codeEditsContextBean.read(I),P=this.codeEditsResult.read(I);if(O&&P){const{range:R,insertText:M}=P.items[0],k=M,B=this.model.getValueInRange(R);return x=>{O.reporterEnd({[x]:!0,code:k,originCode:B})}}}),this.lastVisibleTime=(0,m.derived)(this,I=>this.aiNativeContextKey.multiLineEditsIsVisible.get()?Date.now():void 0),this.discard=(0,m.derived)(this,I=>{const O=this.lastVisibleTime.read(I),P=this.reportData.read(I);O&&Date.now()-O>750?P?.("isDrop"):P?.("isValid"),this.hide()}),this.accept=(0,m.derived)(this,I=>{const O=this.reportData.read(I);if(O?.("isReceive"),this.multiLineDecorationModel.accept(),this.rewriteWidget){this.rewriteWidget.accept();const P=this.rewriteWidget.getVirtualEditor();if(P){const R=this.rewriteWidget.getEditArea(),M=P.getDecorationsInRange(l.Range.lift(R)),k=M?.filter(B=>B.options.description===u.REWRITE_DECORATION_INLINE_ADD);k&&this.additionsDeletionsDecorationModel.updateAdditionsDecoration(k.map(B=>B.range))}}this.hide()})}static get(I){return I.getContribution(w.ID)}get model(){return this.monacoEditor.getModel()}get preferenceService(){return this.injector.get(n.PreferenceService)}get keybindingRegistry(){return this.injector.get(n.KeybindingRegistry)}get intelligentCompletionsRegistry(){return this.injector.get(o.IntelligentCompletionsRegistryToken)}get logger(){return this.injector.get(o.ILogger)}mount(){return this.handlerAlwaysVisiblePreference(),this.codeEditsResult=(0,m.observableValue)(this,void 0),this.whenMultiLineEditsVisibleDisposable=new o.Disposable,this.multiLineDecorationModel=new f.MultiLineDecorationModel(this.monacoEditor),this.additionsDeletionsDecorationModel=new v.AdditionsDeletionsDecorationModel(this.monacoEditor),this.aiNativeContextKey=this.injector.get(h.AINativeContextKey,[this.monacoEditor.contextKeyService]),this.codeEditsSourceCollection=this.injector.get(b.CodeEditsSourceCollection,[[S.LintErrorCodeEditsSource,y.LineChangeCodeEditsSource,A.TypingCodeEditsSource],this.monacoEditor]),this.registerFeature(this.monacoEditor),this.featureDisposable}handlerAlwaysVisiblePreference(){let I=new o.Disposable;const O=()=>{I.addDispose(this.keybindingRegistry.registerKeybinding({command:_.inlineSuggestCommitId,keybinding:n.Key.TAB.code,when:c.ContextKeyExpr.and(s.InlineCompletionContextKeys.inlineSuggestionVisible,p.EditorContextKeys.tabMovesFocus.toNegated(),s.InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize,p.EditorContextKeys.hoverFocused.toNegated())},n.KeybindingScope.USER));const M=g.InlineCompletionsController.get(this.monacoEditor);M&&I.addDispose((0,m.autorun)(k=>{const B=M.model.read(k);if(B?.inlineCompletionState.read(k),M._suggestWidgetSelectedItem.get()){const j=M._suggestWidgetAdaptor;j._currentSuggestItemInfo=void 0,j._onDidSelectedItemChange.fire()}}))},P=()=>{I&&(I.dispose(),I=new o.Disposable)};this.preferenceService.getValid(o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,!0)&&O(),this.featureDisposable.addDispose(this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,({newValue:M})=>{M?O():P()}))}destroyRewriteWidget(){this.rewriteWidget&&(this.rewriteWidget.dispose(),this.rewriteWidget=null)}applyInlineDecorations(I){const{items:O}=I,{range:P,insertText:R}=O[0];if(!P)return;const M=this.monacoEditor.getPosition(),k=this.monacoEditor.getModel(),B=R.toString(),x=k?.getValueInRange(P),N=this.model.getEOL(),j=(0,a.computeMultiLineDiffChanges)(x,B,this.monacoEditor,P.startLineNumber,N);if(!j)return;const{singleLineCharChanges:K,charChanges:U,wordChanges:Y,isOnlyAddingToEachWord:z}=j;if(P&&z&&U.length<=20&&Y.length<=20){const Z=this.multiLineDecorationModel.applyInlineDecorations(this.monacoEditor,(0,a.mergeMultiLineDiffChanges)(K,N),P.startLineNumber,M);this.aiNativeContextKey.multiLineEditsIsVisible.reset(),this.multiLineDecorationModel.clearDecorations(),Z?Z&&Z.inlineMods&&(this.aiNativeContextKey.multiLineEditsIsVisible.set(!0),this.multiLineDecorationModel.updateLineModificationDecorations(Z.inlineMods)):this.renderRewriteWidget(Y,k,P,B)}else this.additionsDeletionsDecorationModel.updateDeletionsDecoration(Y,P,N),this.renderRewriteWidget(Y,k,P,B);this.whenMultiLineEditsVisibleDisposable.disposed&&(this.whenMultiLineEditsVisibleDisposable=new o.Disposable),this.whenMultiLineEditsVisibleDisposable.addDispose(this.monacoEditor.onDidChangeCursorPosition(Z=>{if(this.aiNativeContextKey.multiLineEditsIsVisible.get()){const H=Z.position;(H.lineNumber<P.startLineNumber||H.lineNumber>P.endLineNumber)&&(0,o.runWhenIdle)(()=>{this.discard.get()})}else this.whenMultiLineEditsVisibleDisposable.dispose()}))}async renderRewriteWidget(I,O,P,R){this.destroyRewriteWidget();const M=this.monacoEditor.getPosition();if(!M)return;this.rewriteWidget=this.injector.get(u.RewriteWidget,[this.monacoEditor]);const k=this.model.getOffsetAt({lineNumber:P.startLineNumber,column:P.startColumn}),B=this.model.getOffsetAt({lineNumber:P.endLineNumber,column:P.endColumn}),x=this.model.getValue(),N=x.substring(0,k)+R+x.substring(B),j=(0,a.wordChangesToLineChangesMap)(I,P,O);await this.rewriteWidget.defered.promise,this.aiNativeContextKey.multiLineEditsIsVisible.set(!0);const K=Object.values(j).map(U=>({changes:U.map(Y=>Y.filter(z=>z.value.trim()!==E.empty)).filter(Y=>Y.length>0)}));this.rewriteWidget.setInsertText(R),this.rewriteWidget.show({position:M}),this.rewriteWidget.setEditArea(P),K.every(({changes:U})=>U.every(Y=>Y.every(({removed:z})=>z)))?this.rewriteWidget.renderTextLineThrough(K):this.rewriteWidget.renderVirtualEditor(N,I)}hide(){this.cancelToken(),this.aiNativeContextKey.multiLineEditsIsVisible.reset(),this.multiLineDecorationModel.clearDecorations(),this.additionsDeletionsDecorationModel.clearDeletionsDecorations(),this.destroyRewriteWidget()}registerFeature(I){this.featureDisposable.addDispose(o.Event.any(I.onDidChangeCursorPosition,I.onDidChangeModelContent,I.onDidBlurEditorWidget)(()=>{this.additionsDeletionsDecorationModel.clearAdditionsDecorations()}));const O=new Set([r.MultiLineEditsIsVisible.raw]);this.featureDisposable.addDispose(this.whenMultiLineEditsVisibleDisposable),this.featureDisposable.addDispose(this.aiNativeContextKey.contextKeyService.onDidChangeContext(P=>{P.payload.affectsSome(O)&&(this.aiNativeContextKey.multiLineEditsIsVisible.get()||this.whenMultiLineEditsVisibleDisposable.dispose())})),this.featureDisposable.addDispose(o.Event.any(I.onDidChangeModel,I.onDidChangeModelContent)(()=>{(0,o.runWhenIdle)(()=>{this.hide()})})),this.featureDisposable.addDispose((0,m.autorunWithStoreHandleChanges)({createEmptyChangeSummary:()=>({}),handleChange:(P,R)=>P.didChange(this.codeEditsSourceCollection.codeEditsContextBean)?!this.aiNativeContextKey.multiLineEditsIsVisible.get():!1},async(P,R,M)=>{const k=this.codeEditsSourceCollection.codeEditsContextBean.read(P),B=this.intelligentCompletionsRegistry.getCodeEditsProvider();if(k&&B){M.add(o.Disposable.create(()=>k.cancelToken())),k.reporterStart();const x=await B(this.monacoEditor,k.position,k.bean,k.token);x&&x.items.length>0&&(0,m.transaction)(N=>{this.codeEditsResult.set(new T.CodeEditsResultValue(x),N)})}})),this.featureDisposable.addDispose((0,m.autorun)(P=>{const R=this.codeEditsResult.read(P);if(R)try{this.applyInlineDecorations(R)}catch(M){this.logger.warn("IntelligentCompletionsController applyInlineDecorations error",M)}})),this.featureDisposable.addDispose(this.codeEditsSourceCollection)}}t.IntelligentCompletionsController=w,w.ID="editor.contrib.ai.intelligent.completions"},74292:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelligentCompletionsRegistry=void 0;const n=e(85608),r=e(76003),o=e(43718);let l=class extends o.Disposable{registerIntelligentCompletionProvider(E){this.inlineCompletionsProvider=E}registerInlineCompletionsProvider(E){this.inlineCompletionsProvider=E}registerCodeEditsProvider(E){this.codeEditsProvider=E}getInlineCompletionsProvider(){return this.inlineCompletionsProvider}getCodeEditsProvider(){return this.codeEditsProvider}};t.IntelligentCompletionsRegistry=l,t.IntelligentCompletionsRegistry=l=n.__decorate([(0,r.Injectable)()],l)},78409:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditsSourceCollection=t.BaseCodeEditsSource=t.CodeEditsContextBean=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(20868),E=e(28423);class p extends l.Disposable{constructor(c,h){super(),this.raw=c,this.source=h,this.uid=(0,l.uuid)(6)}get priority(){return this.source.priority}get bean(){return this.raw}get position(){return this.raw.position}get token(){return this.source.token}reporterStart(){return this.source.reporterStart()}cancelToken(){return this.source.cancelToken()}reporterEnd(c){return this.source.reporterEnd(c)}}t.CodeEditsContextBean=p;let _=class extends l.Disposable{get token(){return this.cancellationTokenSource.token}cancelToken(){this.cancellationTokenSource.cancel(),this.cancellationTokenSource=new m.CancellationTokenSource,this.reporterEnd({isValid:!1})}constructor(c){super(),this.monacoEditor=c,this.cancellationTokenSource=new m.CancellationTokenSource,this.relationID=(0,E.observableValue)(this,void 0),this.codeEditsContextBean=(0,E.disposableObservableValue)(this,void 0)}get model(){return this.monacoEditor.getModel()}resetBean(){(0,E.transaction)(c=>{this.cancelToken(),this.codeEditsContextBean.set(void 0,c)})}setBean(c){(0,E.transaction)(h=>{const u=new p(c,this);this.codeEditsContextBean.set(u,h)})}reporterStart(){const c=this.codeEditsContextBean.get();if(c){const h=this.aiReporter.start(l.AIServiceType.CodeEdits,{type:l.AIServiceType.CodeEdits,actionSource:c?.bean.typing});(0,E.transaction)(u=>{this.relationID.set(h,u)})}}reporterEnd(c){const h=this.relationID.get();h&&this.aiReporter.end(h,c)}};t.BaseCodeEditsSource=_,n.__decorate([(0,r.Autowired)(l.IAIReporter),n.__metadata("design:type",Object)],_.prototype,"aiReporter",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),t.BaseCodeEditsSource=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],_);let s=class extends l.Disposable{constructor(c,h){super(),this.constructorSources=c,this.monacoEditor=h,this.codeEditsContextBean=(0,E.disposableObservableValue)(this,void 0);const u=this.constructorSources.map(v=>this.injector.get(v,[this.monacoEditor]));u.forEach(v=>this.addDispose(v.mount()));const d=(0,E.derived)(v=>({codeEditsContextBean:new Map(u.map(f=>[f,f.codeEditsContextBean.read(v)]))}));this.addDispose((0,E.autorunDelta)((0,E.debouncedObservable2)(d,0),({lastValue:v,newValue:f})=>{const a=u.filter(S=>{var A;const T=f?.codeEditsContextBean.get(S),w=(A=v?.codeEditsContextBean)===null||A===void 0?void 0:A.get(S);return T&&(!w||T.uid!==w.uid)});let b=0,y;for(const S of a){const A=S.codeEditsContextBean.get();A&&A.priority>=b&&(b=A.priority,y=A)}(0,E.transaction)(S=>{this.codeEditsContextBean.set(y,S)})}))}};t.CodeEditsSourceCollection=s,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CodeEditsSourceCollection=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Array,Object])],s)},36368:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LineChangeCodeEditsSource=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(78409);let m=class extends l.BaseCodeEditsSource{constructor(){super(...arguments),this.priority=2,this.prePosition=this.monacoEditor.getPosition()}mount(){return this.addDispose(this.monacoEditor.onDidChangeCursorPosition(p=>{const _=p.position;this.prePosition&&this.prePosition.lineNumber!==_.lineNumber&&(this.doTrigger(_),this.prePosition=_)})),this}doTrigger(p){var _;!this.preferenceService.getValid(o.AINativeSettingSectionsId.CodeEditsLineChange,!1)||!p||this.setBean({typing:o.ECodeEditsSourceTyping.LineChange,position:p,data:{preLineNumber:(_=this.prePosition)===null||_===void 0?void 0:_.lineNumber,currentLineNumber:p.lineNumber}})}};t.LineChangeCodeEditsSource=m,t.LineChangeCodeEditsSource=m=n.__decorate([(0,r.Injectable)({multiple:!0})],m)},12979:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LintErrorCodeEditsSource=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(51500),m=e(90626),E=e(34835),p=e(78409);var _;(function(g){function c(h){return{message:h.message,range:{startPosition:{lineNumber:h.startLineNumber,column:h.startColumn},endPosition:{lineNumber:h.endLineNumber,column:h.endColumn}},source:h.resource,relatedInformation:h.relatedInformation,severity:E.MarkerSeverity.toString(h.severity)}}g.toData=c})(_||(_={}));let s=class extends p.BaseCodeEditsSource{constructor(){super(...arguments),this.priority=1}mount(){let c=this.monacoEditor.getPosition();return this.addDispose(o.Event.debounce(this.monacoEditor.onDidChangeCursorPosition,(h,u)=>u,o.FRAME_THREE)(async h=>{const u=h.position,d=this.monacoEditor.getSelection();d?.isEmpty()&&(c&&c.lineNumber!==u.lineNumber&&await this.doTrigger(u),c=u)})),this}async doTrigger(c){var h;if(!this.preferenceService.getValid(o.AINativeSettingSectionsId.CodeEditsLintErrors,!1)||!this.model)return;const d=m.StandaloneServices.get(E.IMarkerService),v=this.model.uri;let f=d.read({resource:v,severities:E.MarkerSeverity.Error});if(f=f.filter(a=>Math.abs(a.startLineNumber-c.lineNumber)<=1),f.length){const a=await this.workspaceService.asRelativePath(v.path);this.setBean({typing:o.ECodeEditsSourceTyping.LinterErrors,position:c,data:{relativeWorkspacePath:(h=a?.path)!==null&&h!==void 0?h:v.path,errors:f.map(b=>_.toData(b))}})}}};t.LintErrorCodeEditsSource=s,n.__decorate([(0,r.Autowired)(l.IWorkspaceService),n.__metadata("design:type",Object)],s.prototype,"workspaceService",void 0),t.LintErrorCodeEditsSource=s=n.__decorate([(0,r.Injectable)({multiple:!0})],s)},25576:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypingCodeEditsSource=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(78409);let m=class extends l.BaseCodeEditsSource{constructor(){super(...arguments),this.priority=0}mount(){return this.addDispose(this.monacoEditor.onDidChangeModelContent(p=>{const _=this.monacoEditor.getPosition();_&&this.doTrigger(_,p)})),this}async doTrigger(p,_){!this.preferenceService.getValid(o.AINativeSettingSectionsId.CodeEditsTyping,!1)||!this.model||this.setBean({typing:o.ECodeEditsSourceTyping.Typing,position:p,data:_})}};t.TypingCodeEditsSource=m,t.TypingCodeEditsSource=m=n.__decorate([(0,r.Injectable)({multiple:!0})],m)},35363:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InterfaceNavigationContribution=t.InterfaceNavigationDecorationsContribution=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(13833)),l=e(76003),m=e(41869),E=e(43718),p=e(57517),_=n.__importStar(e(20868)),s=e(90052),g=e(52416),c=e(85679),h=e(53374),u=n.__importDefault(e(26754)),d="PCEtLSBDb3B5cmlnaHQgMjAwMC0yMDIyIEpldEJyYWlucyBzLnIuby4gYW5kIGNvbnRyaWJ1dG9ycy4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgdGhlIEFwYWNoZSAyLjAgbGljZW5zZS4gLS0+Cjxzdmcgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI2LjUiIGZpbGw9IiMyNTM2MjciIHN0cm9rZT0iIzU3OTY1QyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwIDQuNVY1LjVMOC41IDUuNVYxMC41SDEwVjExLjVMOC41IDExLjVINy41TDYgMTEuNVYxMC41SDcuNVY1LjVMNiA1LjVWNC41SDcuNUg4LjVIMTBaIiBmaWxsPSIjNTc5NjVDIi8+Cjwvc3ZnPgo=",v="PCEtLSBDb3B5cmlnaHQgMjAwMC0yMDIyIEpldEJyYWlucyBzLnIuby4gYW5kIGNvbnRyaWJ1dG9ycy4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgdGhlIEFwYWNoZSAyLjAgbGljZW5zZS4gLS0+Cjxzdmcgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI2LjUiIGZpbGw9IiNGMkZDRjMiIHN0cm9rZT0iIzVGQjg2NSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwIDQuNVY1LjVMOC41IDUuNVYxMC41SDEwVjExLjVMOC41IDExLjVINy41TDYgMTEuNVYxMC41SDcuNVY1LjVMNiA1LjVWNC41SDcuNUg4LjVIMTBaIiBmaWxsPSIjNUZCODY1Ii8+Cjwvc3ZnPgo=";let f=class extends m.Disposable{constructor(S,A){super(),this.interfaceNode=S,this.editor=A,this.id="";const T=this.themeService.getCurrentThemeSync().type==="dark"?d:v,D=`${this.iconService.fromIcon("",`data:image/svg+xml;base64,${T}`,g.IconType.Base64)} ${u.default["interface-navigation-icon"]} interface-navigation-glyph`;this.editorDecoration={range:(0,h.toMonacoRange)(S),options:{isWholeLine:!0,glyphMarginClassName:D,description:"interface-decoration",glyphMarginHoverMessage:{value:(0,m.localize)("preference.ai.native.interface.quick.navigation.hover")},stickiness:_.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}get line(){return this.editorDecoration.range.startLineNumber}click(S){var A;return((A=S.target.position)===null||A===void 0?void 0:A.lineNumber)!==this.line||S.target.type!==s.MouseTargetType.GUTTER_GLYPH_MARGIN?!1:(this.editor.setPosition({lineNumber:this.interfaceNode.startPosition.row+1,column:this.interfaceNode.startPosition.column+1}),this.commandService.executeCommand("editor.action.goToImplementation"),!0)}};n.__decorate([(0,l.Autowired)(m.CommandService),n.__metadata("design:type",Object)],f.prototype,"commandService",void 0),n.__decorate([(0,l.Autowired)(g.IIconService),n.__metadata("design:type",Object)],f.prototype,"iconService",void 0),n.__decorate([(0,l.Autowired)(g.IThemeService),n.__metadata("design:type",Object)],f.prototype,"themeService",void 0),f=n.__decorate([(0,l.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],f);let a=class{get currentUri(){return this.editor.currentUri}constructor(S){this.editor=S,this.disposer=new m.Disposable,this.lastDecorations=[],this.supportLanguages=["java","typescript","typescriptreact"]}getInterfaceQuickJumpEnabled(){return this.preferenceService.getValid(E.AINativeSettingSectionsId.InterfaceQuickNavigationEnabled,!0)}async parseJavaInterfaces(S){const A=[];function T(w){if(w.type==="interface_declaration"){const D=w.children.find(P=>P.type==="identifier"),I=w.children.find(P=>P.type==="interface_body"),O=I?.children.filter(P=>P.type==="field_declaration"||P.type==="method_declaration").map(P=>P.children.find(R=>R.type==="identifier")).filter(P=>!!P);A.push({interfaceNode:D,members:O})}w.children.forEach(D=>T(D))}return T(S),A}async parseTypeScriptInterfaces(S){const A=[];function T(w){if(w.type==="interface_declaration"){const D=w.children.find(I=>I.type==="type_identifier");A.push({interfaceNode:D,members:[]})}w.children.forEach(D=>T(D))}return T(S),A}async decorateEditor(){if(!this.getInterfaceQuickJumpEnabled())return;const S=this.editor.monacoEditor.getModel();if(!S)return;const A=S.getLanguageId();if(!this.supportLanguages.includes(A))return;const T=this.languageParserService.createParser(A);if(!T)return;const w=await T.parseAST(S);if(!w)return;let D=[];if(A==="typescript"||A==="typescriptreact")D=await this.parseTypeScriptInterfaces(w);else if(A==="java")D=await this.parseJavaInterfaces(w);else return;D=A==="java"?await this.parseJavaInterfaces(w):await this.parseTypeScriptInterfaces(w);const I=D.map(({interfaceNode:O,members:P})=>{if(!O||!P)return[];const R=[this.injector.get(f,[O,this.editor.monacoEditor])];return P.forEach(M=>{R.push(this.injector.get(f,[M,this.editor.monacoEditor]))}),R}).flat();this.editor.monacoEditor.changeDecorations(O=>{const P=I;O.deltaDecorations(this.lastDecorations.map(R=>R.id),P.map(R=>R.editorDecoration)).forEach((R,M)=>P[M].id=R),this.lastDecorations=P})}contribute(){if(!this.getInterfaceQuickJumpEnabled())return this.disposer;this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModel(async()=>{await this.decorateEditor()}));const S=(0,r.default)(()=>{this.decorateEditor()},3e3);return this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModelContent(S)),this.disposer.addDispose(this.editor.monacoEditor.onMouseDown(A=>{for(const T of this.lastDecorations)if(T.click(A)){A.event.stopPropagation();return}})),this.disposer}};t.InterfaceNavigationDecorationsContribution=a,n.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),n.__metadata("design:type",l.Injector)],a.prototype,"injector",void 0),n.__decorate([(0,l.Autowired)(c.LanguageParserService),n.__metadata("design:type",c.LanguageParserService)],a.prototype,"languageParserService",void 0),n.__decorate([(0,l.Autowired)(m.PreferenceService),n.__metadata("design:type",Object)],a.prototype,"preferenceService",void 0),t.InterfaceNavigationDecorationsContribution=a=n.__decorate([(0,l.Injectable)({multiple:!0}),n.__param(0,(0,l.Optional)()),n.__metadata("design:paramtypes",[Object])],a);let b=class{registerEditorFeature(S){S.registerEditorFeatureContribution({contribute:A=>this.injector.get(a,[A]).contribute()})}};t.InterfaceNavigationContribution=b,n.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),n.__metadata("design:type",l.Injector)],b.prototype,"injector",void 0),t.InterfaceNavigationContribution=b=n.__decorate([(0,m.Domain)(p.BrowserEditorContribution)],b)},44298:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeConflictContribution=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=e(76003),l=e(41869),m=e(38070),E=e(43718),p=e(27833),_=e(57517),s=e(31375),g=n.__importStar(e(20868)),c=e(75526),h=e(24093),u=n.__importDefault(e(89543)),d=e(67641),v=e(80922),f=e(52902),a=e(79865),b=e(28160),y="merge-conflict-codelens-style",S=`
|
|
28248
|
+
`)),s}t.lineBasedPromptProcessor={processPrefix:p,processSuffix:_}},71863:(L,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AICompletionsService=void 0;const r=e(85608),o=e(76003),l=e(41869),m=e(43718),E=e(52664);let p=n=class extends m.Disposable{constructor(){super(...arguments),this._onVisibleCompletion=new m.Emitter,this.onVisibleCompletion=this._onVisibleCompletion.event,this.cancelIndicator=new m.CancellationTokenSource,this.isDefaultCompletionModel=!0,this._isVisibleCompletion=!1,this.validCompletionThreshold=750}recordRenderTime(){this.lastRenderTime=Date.now()}recordCompletionUseTime(s){this.lastCompletionUseTime=Date.now()-s}get isVisibleCompletion(){return this._isVisibleCompletion}async complete(s){var g,c;this.isDefaultCompletionModel=!0;const h=Date.now();try{const u=await((c=(g=this.aiBackService).requestCompletion)===null||c===void 0?void 0:c.call(g,s,this.cancelIndicator.token));this.recordCompletionUseTime(h);const{sessionId:d,codeModelList:v,isCancel:f}=u;return{items:v.map(a=>({...a,insertText:a.content})),extra:{sessionId:d,isCancel:f}}}catch{return}}async report(s){const{relationId:g,accept:c}=s;s.renderingTime=Date.now()-this.lastRenderTime,s.completionUseTime=this.lastCompletionUseTime,this.reporterEnd(g,{success:!0,isReceive:c,renderingTime:s.renderingTime,code:s.code,actionSource:m.ActionSourceEnum.Completion,actionType:m.ActionTypeEnum.Completion}),this._isVisibleCompletion=!1}async reporterEnd(s,g){const c={...g,isValid:typeof g.renderingTime=="number"?g.renderingTime>this.validCompletionThreshold:!1};c.isValid&&this.aiReporter.end(s,c)}setVisibleCompletion(s){this._isVisibleCompletion===!0&&s===!1&&this.report({sessionId:this.lastSessionId,accept:!1,relationId:this.lastRelationId,code:this.lastCompletionContent}),this._isVisibleCompletion=s,this._onVisibleCompletion.fire(s),s===!0&&this.recordRenderTime()}setLastSessionId(s){this.lastSessionId=s}setLastRelationId(s){this.lastRelationId=s}setLastCompletionContent(s){this.lastCompletionContent=s}async cancelRequest(){this.cancelIndicator.cancel(),this.cancelIndicator=new m.CancellationTokenSource}updateStatusBarItem(s,g){const c=g?`$(loading~spin) ${s}`:`$(magic-wand) ${s}`;this.statusBarService.addElement(n.STATUS_ID,{text:c,alignment:l.StatusBarAlignment.RIGHT,priority:1})}hideStatusBarItem(){this.statusBarService.removeElement(n.STATUS_ID)}};t.AICompletionsService=p,p.STATUS_ID="ai_completion_status",r.__decorate([(0,o.Autowired)(m.AIBackSerivcePath),r.__metadata("design:type",Object)],p.prototype,"aiBackService",void 0),r.__decorate([(0,o.Autowired)(l.IStatusBarService),r.__metadata("design:type",Object)],p.prototype,"statusBarService",void 0),r.__decorate([(0,o.Autowired)(E.IAIReporter),r.__metadata("design:type",Object)],p.prototype,"aiReporter",void 0),t.AICompletionsService=p=n=r.__decorate([(0,o.Injectable)()],p)},71585:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SnippetSemantics=t.SortOption=t.WishListAttributeName=t.NeighboringTabsOption=t.SnippetSelectionOption=t.StrategyType=t.TokenizerName=void 0;var e;(function(p){p.cl100k_base="cl100k_base",p.gpt2="gpt2",p.r50k_base="r50k_base",p.p50k_base="p50k_base",p.p50k_edit="p50k_edit",p.o200k_base="o200k_base"})(e||(t.TokenizerName=e={}));var n;(function(p){p.InterceptBasedOnChar="InterceptBasedOnChar",p.InterceptBasedOnLine="InterceptBasedOnLine",p.InterceptBasedOnFunction="InterceptBasedOnFunction"})(n||(t.StrategyType=n={}));var r;(function(p){p.BestMatch="bestMatch",p.TopK="topK"})(r||(t.SnippetSelectionOption=r={}));var o;(function(p){p.openFileHistory="openFileHistory",p.editFileRecent="editFileRecent",p.editFileHistory="editFileHistory"})(o||(t.NeighboringTabsOption=o={}));var l;(function(p){p.beforeCursor="beforeCursor",p.afterCursor="afterCursor",p.importedFile="importedFile",p.languageMarker="languageMarker",p.pathMarker="pathMarker",p.similarFile="similarFile"})(l||(t.WishListAttributeName=l={}));var m;(function(p){p.Ascending="ascending",p.Descending="descending",p.None="none"})(m||(t.SortOption=m={}));var E;(function(p){p.Function="function",p.Snippet="snippet",p.Variable="variable",p.Parameter="parameter",p.Method="method",p.Class="class",p.Module="module",p.Alias="alias",p.Enum="enum member",p.Interface="interface"})(E||(t.SnippetSemantics=E={}))},84176:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdditionsDeletionsDecorationModel=void 0;const n=e(85608),r=e(20868),o=e(53617),l=e(8191),m=n.__importDefault(e(71800));class E{constructor(_){this.editor=_,this.deletionsDecorations=new o.EnhanceDecorationsCollection(this.editor),this.additionsDecorations=new o.EnhanceDecorationsCollection(this.editor)}generateRange(_,s,g){const c=[];let h=1,u=1;for(const d of _){const v=d.value.split(g),f=v.length,a=h+f-1,b=f>1?v[f-1].length+1:u+d.value.length;d.added&&(c.push({startLineNumber:h+s.startLineNumber-1,startColumn:u,endLineNumber:a+s.startLineNumber-1,endColumn:b}),u=b,h=a),d.removed||(u=b,h=a)}return c}clearDeletionsDecorations(){this.deletionsDecorations.clear()}clearAdditionsDecorations(){this.additionsDecorations.clear()}updateDeletionsDecoration(_,s,g){const c=this.generateRange(_.map(h=>{const u=h.value;return h.removed?{value:u,added:!0}:h.added?{value:u,removed:!0}:h}),s,g);this.deletionsDecorations.set(c.map(h=>({range:h,options:{description:"suggestion_deletions_background",className:m.default.suggestion_deletions_background,stickiness:r.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}})))}updateAdditionsDecoration(_){this.additionsDecorations.set(_.map(s=>({range:s,options:{description:l.REWRITE_DECORATION_INLINE_ADD,className:m.default.suggestion_additions_background,stickiness:r.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}})))}}t.AdditionsDeletionsDecorationModel=E},591:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiLineDecorationModel=t.GHOST_TEXT=t.GHOST_TEXT_DESCRIPTION=void 0;const n=e(43718),r=e(20868),o=e(77714),l=e(2261),m=e(37705),E=e(53617);var p;(function(s){s.beginning="beginning",s.end="end"})(p||(p={})),t.GHOST_TEXT_DESCRIPTION="ghost-text-decoration",t.GHOST_TEXT="ghost-text";class _{constructor(g){this.editor=g,this.ghostTextDecorations=new E.EnhanceDecorationsCollection(this.editor)}splitDiffChanges(g,c){const h=g.flatMap(u=>{const d=u.value.split(c),v=f=>({value:f,added:u.added,removed:u.removed});return d.flatMap((f,a)=>a<d.length-1?[v(f),v(c)]:v(f)).filter(f=>f.value!==o.empty)});for(let u=0;u<h.length-1;u++){const d=h[u],v=h[u+1];d.removed&&v.added&&v.value.startsWith(d.value)&&(d.added=!0,d.removed=!0)}return h}combineContinuousMods(g){const c=[];let h=o.empty;for(const u of g)u.isEolLine?(c.push(h),h=o.empty):h+=u.newValue;return h!==o.empty&&c.push(h),c}processLineModifications(g,c,h,u,d=!0){const v=this.combineContinuousMods(g),f=v.length,a=[],b=[];if(f===0)return{fullLineMods:a,inlineMods:b};const y=v[0],S=v[f-1];if(f===1)return d?!(0,n.isUndefined)(h)&&h.value!==c?b.push({status:p.beginning,newValue:h.value+y,oldValue:h.value}):!(0,n.isUndefined)(u)&&u.value!==c?b.push({status:p.end,newValue:S+u.value,oldValue:u.value}):a.push(y):a.push(y),{fullLineMods:a,inlineMods:b};if((0,n.isUndefined)(h)||h.value===c?a.push(y):b.push({status:p.beginning,newValue:h.value+y,oldValue:h.value}),f>2){const A=v.slice(1,-1);for(const T of A)a.push(T)}return(0,n.isUndefined)(u)||u.value===c?a.push(S):b.push({status:p.end,newValue:S+u.value,oldValue:u.value}),{fullLineMods:a,inlineMods:b}}getEdits(){return this.ghostTextDecorations.getDecorations().map(({editorDecoration:h,range:u})=>{var d;const f=((d=h.options.after)===null||d===void 0?void 0:d.content)||"";return{range:u,text:f}})}clearDecorations(){this.ghostTextDecorations.clear()}updateLineModificationDecorations(g){if(g.length===0){this.clearDecorations();return}const c=g.map(h=>{let u;if(h.newValue.startsWith(h.oldValue))u=h.newValue.slice(h.oldValue.length);else{const d=h.newValue.indexOf(h.oldValue);u=d!==-1?h.newValue.slice(0,d):h.newValue}return{range:r.Range.fromPositions(new r.Position(h.lineNumber,h.column)),options:{description:t.GHOST_TEXT,showIfCollapsed:!0,after:{content:u,inlineClassName:t.GHOST_TEXT_DESCRIPTION}}}});this.ghostTextDecorations.set(c)}applyInlineDecorations(g,c,h,u){var d,v,f,a,b,y,S,A,T;const w=g.getModel();if(!w)return;const D=w.getEOL();c=this.splitDiffChanges(c,D),c.unshift({value:D,added:void 0,removed:void 0});let I=Math.max(h-1,0);const O=w.getValue(),P=w.getLineContent(u.lineNumber),R={},M=[];let k=o.empty,B=P.trim()===o.empty,x,N=[],j=I,K=1;const U=z=>{var G;const Q=!M.some(H=>H.lineNumber===I&&H.lockLineGhostText),{fullLineMods:Z,inlineMods:$}=this.processLineModifications(N,D,x,z,Q);return R[I]=[...(G=R[I])!==null&&G!==void 0?G:[],...Z.map(H=>({content:H,decorations:[new m.LineDecoration(1,H.length+1,"ghost-text",0)]}))],$.forEach(H=>M.push({lineNumber:H.status===p.beginning?I:I+1,column:H.status===p.beginning?K:1,newValue:H.newValue,oldValue:H.oldValue})),{fullLineMods:Z,inlineMods:$}};for(const z of c)if(z.added){const G=z.value===D;G&&(k=o.empty),N.push({isEolLine:G,lineNumber:I,newValue:G?o.empty:z.value,oldValue:G?o.empty:k})}else{const{inlineMods:G}=U(z);if(R[I].length>0&&O.split(D)[I]===o.empty){const Q=R[I];if(Q.length>0){const Z=Q[0].content,$=Q.slice(1);Z.startsWith(P)&&(M.some(H=>H.lineNumber===I+1&&H.lockLineGhostText)?((v=R[S=I+1])!==null&&v!==void 0||(R[S]=[]),R[I+1].unshift(...Q)):(M.push({lineNumber:I+1,column:1,newValue:Z,oldValue:o.empty,lockLineGhostText:!0}),(d=R[y=I+1])!==null&&d!==void 0||(R[y]=[]),R[I+1].unshift(...$)),R[I]=[])}}if(I===u.lineNumber&&G.length>0&&(B=!1,I<u.lineNumber&&((f=R[I])===null||f===void 0?void 0:f.length)>0||I===u.lineNumber&&G.length>0&&K<u.column))return;x=z,N=[],z.value===D?(j++,K=1,k=o.empty):j>I?(I=j,K+=z.value.length,N=[],k+=z.value):(K+=z.value.length,k+=z.value)}const{fullLineMods:Y}=U(void 0);if(B){const z=R[u.lineNumber-1];if(z?.length>0){const G=z[0].content,Q=z.slice(1);M.some(Z=>Z.lineNumber===u.lineNumber&&Z.lockLineGhostText)?((b=R[T=u.lineNumber])!==null&&b!==void 0||(R[T]=[]),R[u.lineNumber].unshift(...z)):(M.push({lineNumber:u.lineNumber,column:u.column,newValue:G.slice(u.column-1),oldValue:P,lockLineGhostText:!0}),(a=R[A=u.lineNumber])!==null&&a!==void 0||(R[A]=[]),R[u.lineNumber].unshift(...Q)),R[u.lineNumber-1]=[]}}else if(I<u.lineNumber&&Y.length>0)return;return{fullLineMods:R,inlineMods:M}}accept(){const g=this.getEdits();g.length!==0&&(this.editor.pushUndoStop(),this.editor.executeEdits("multiLineCompletions.accept",g.map(c=>l.EditOperation.insert(r.Position.lift({lineNumber:c.range.startLineNumber,column:c.range.startColumn}),c.text))))}}t.MultiLineDecorationModel=_},59945:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordChangesToLineChangesMap=t.computeMultiLineDiffChanges=t.mergeMultiLineDiffChanges=t.rewriteDiffComputer=t.multiLineDiffComputer=void 0;const n=e(77714);class r{extractCommon(g,c,h,u){const d=c.length,v=h.length;let f=g.newPos,a=f-u,b=0;for(;f+1<d&&a+1<v&&this.equals(c[f+1],h[a+1]);)f++,a++,b++;return b&&(g.changeResult.push({count:b,value:n.empty}),g.newPos=f),a}equals(g,c){return g===c}tokenize(g){return g.split(n.empty).filter(Boolean)}diff(g,c){const h=I=>({newPos:I.newPos,changeResult:[...I.changeResult]}),u=I=>I.join(n.empty),d=(I,O,P)=>{const R=I.length;let M=0,k=0,B=0;for(;M<R;M++){const x=I[M];x.removed?(x.value=u(P.slice(B,B+x.count)),B+=x.count,M&&I[M-1].added&&([I[M-1],I[M]]=[I[M],I[M-1]])):(x.value=u(O.slice(k,k+x.count)),k+=x.count,x.added||(B+=x.count))}return R>1&&typeof I[R-1].value=="string"&&(I[R-1].added||I[R-1].removed)&&this.equals(n.empty,I[R-1].value)&&(I[R-2].value+=I[R-1].value,I.pop()),I},v=this.tokenize(g),f=this.tokenize(c),a=v.length,b=f.length,y=a+b,S=[{newPos:-1,changeResult:[]}],A=this.extractCommon(S[0],f,v,0),T=(I,O,P)=>{const R=I.length,M=I[R-1];R>0&&M.added===O&&M.removed===P?I[R-1]={count:M.count+1,added:O,removed:P,value:n.empty}:I.push({count:1,added:O,removed:P,value:n.empty})};let w=1;if(S[0].newPos+1>=a&&A+1>=b)return[{value:u(f),count:f.length}];const D=()=>{for(let I=-w;I<=w;I+=2){const O=S[I-1],P=S[I+1];let R,M=(P?P.newPos:0)-I;O&&(S[I-1]=void 0);const k=O&&O.newPos+1<b,B=P&&0<=M&&M<a;if(!k&&!B){S[I]=void 0;continue}if(!k||B&&O.newPos<P.newPos?(R=h(P),T(R.changeResult,void 0,!0)):(R=O,R.newPos++,T(R.changeResult,!0,void 0)),M=this.extractCommon(R,f,v,I),R.newPos+1>=b&&M+1>=a)return d(R.changeResult,f,v);S[I]=R}w++};for(;w<=y;){const I=D();if(I)return I}}}const o=/^[a-zA-Z]+$/u,l=/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/;class m extends r{equals(g,c){const h=g.toLowerCase(),u=c.toLowerCase();return h===u}tokenize(g){const c=g.split(l);for(let h=0;h<c.length-1;h++){const u=c[h+1],d=c[h+2];!u&&d&&o.test(c[h])&&o.test(d)&&(c[h]+=d,c.splice(h+1,2),h--)}return c}}t.multiLineDiffComputer=new r,t.rewriteDiffComputer=new m;const E=(s,g)=>{const c=s.flatMap(h=>{const u=h.value.split(g),d=v=>({value:v,added:h.added,removed:h.removed});return u.flatMap((v,f)=>f<u.length-1?[d(v),d(g)]:d(v)).filter(v=>v.value!==n.empty)});for(let h=0;h<c.length-1;h++){const u=c[h],d=c[h+1];u.removed&&d.added&&d.value.startsWith(u.value)&&(u.added=!0,u.removed=!0)}return c};t.mergeMultiLineDiffChanges=E;const p=(s,g,c,h,u)=>{var d,v;let f=t.rewriteDiffComputer.diff(s,g)||[],a=t.multiLineDiffComputer.diff(s,g)||[];const b=s.split(u),y=g.split(u);b.length===y.length&&b.every((D,I)=>y[I].startsWith(D))&&(a=b.map((D,I)=>{const O=y[I],P=[{value:D}];if(O!==D){const R=O.substring(D.length);P.push({value:R,added:!0},{value:u})}else P[0].value=P[0].value+u;return P}).flat());const S=c.getPosition();if(S){const D={lineNumber:S.lineNumber-h+1,column:S.column},I=b.slice(0,D.lineNumber-1).join(u),O=(d=b[D.lineNumber-1])===null||d===void 0?void 0:d.slice(0,D.column-1),P=I===y.slice(0,D.lineNumber-1).join(u),R=O===((v=y[D.lineNumber-1])===null||v===void 0?void 0:v.slice(0,D.column-1));if(P&&R){const M=N=>{var j;return((j=N[D.lineNumber-1])===null||j===void 0?void 0:j.slice(D.column-1))+u+N.slice(D.lineNumber).join(u)},k=M(y),B=M(b),x=I+(b.slice(0,D.lineNumber-1).length>0?u:n.empty)+O;if(k.endsWith(B)){const N=k.slice(0,k.length-B.length);a=[{value:x},{value:N,added:!0},{value:B}]}}}const A=(0,t.mergeMultiLineDiffChanges)(f,u),T=b.length===y.length&&!A.some(D=>D.added!==!0&&D.removed&&D.value!==u);return{singleLineCharChanges:(0,t.mergeMultiLineDiffChanges)(a,u),charChanges:a,wordChanges:f,isOnlyAddingToEachWord:T}};t.computeMultiLineDiffChanges=p;const _=(s,g,c)=>{const h={},u=c?.getEOL();let d=g.startLineNumber;const v=b=>{h[d]||(h[d]=[]),h[d].push([b])},f=b=>{var y;const S=(y=h[d])===null||y===void 0?void 0:y[h[d].length-1];S?S.push(b):v(b)},a=()=>{d++};return s.forEach(b=>{const{value:y,added:S,removed:A}=b;y.split(u).forEach((w,D)=>{D===0?f({value:w,added:S,removed:A}):(a(),v({value:w,added:S,removed:A}))})}),h};t.wordChangesToLineChangesMap=_},40650:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditsResultValue=void 0;const n=e(43718);class r extends n.Disposable{constructor(l){super(),this.raw=l}get items(){return this.raw.items}}t.CodeEditsResultValue=r},99301:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelligentCompletionsContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57925),m=e(50394),E=e(43718),p=e(54414),_=e(51553),s=e(7511);let g=class{registerCommands(h){h.registerCommand(l.AI_MULTI_LINE_COMPLETION_DISCARD,{execute:()=>{var u;const d=this.workbenchEditorService.currentCodeEditor;d&&((u=s.IntelligentCompletionsController.get(d.monacoEditor))===null||u===void 0||u.discard.get())}}),h.registerCommand(l.AI_MULTI_LINE_COMPLETION_ACCEPT,{execute:()=>{var u;const d=this.workbenchEditorService.currentCodeEditor;d&&((u=s.IntelligentCompletionsController.get(d.monacoEditor))===null||u===void 0||u.accept.get())}})}registerKeybindings(h){h.registerKeybinding({command:l.AI_MULTI_LINE_COMPLETION_DISCARD.id,keybinding:o.Key.ESCAPE.code,when:m.MultiLineEditsIsVisible.raw,priority:100}),h.registerKeybinding({command:l.AI_MULTI_LINE_COMPLETION_ACCEPT.id,keybinding:o.Key.TAB.code,when:m.MultiLineEditsIsVisible.raw},o.KeybindingScope.USER)}};t.IntelligentCompletionsContribution=g,n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorServiceImpl)],g.prototype,"workbenchEditorService",void 0),t.IntelligentCompletionsContribution=g=n.__decorate([(0,E.Domain)(o.ClientAppContribution,o.KeybindingContribution,E.CommandContribution)],g)},7511:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelligentCompletionsController=void 0;const n=e(41869),r=e(50394),o=e(43718),l=e(20868),m=e(28423),E=e(77714),p=e(94170),_=e(69292),s=e(37355),g=e(69899),c=e(23268),h=e(77659),u=e(8191),d=e(99906),v=e(84176),f=e(591),a=e(59945),b=e(78409),y=e(36368),S=e(12979),A=e(25576),T=e(40650);class w extends d.BaseAIMonacoEditorController{constructor(){super(...arguments),this.reportData=(0,m.derived)(this,I=>{const O=this.codeEditsSourceCollection.codeEditsContextBean.read(I),P=this.codeEditsResult.read(I);if(O&&P){const{range:R,insertText:M}=P.items[0],k=M,B=this.model.getValueInRange(R);return x=>{O.reporterEnd({[x]:!0,code:k,originCode:B})}}}),this.lastVisibleTime=(0,m.derived)(this,I=>this.aiNativeContextKey.multiLineEditsIsVisible.get()?Date.now():void 0),this.discard=(0,m.derived)(this,I=>{const O=this.lastVisibleTime.read(I),P=this.reportData.read(I);O&&Date.now()-O>750?P?.("isDrop"):P?.("isValid"),this.hide()}),this.accept=(0,m.derived)(this,I=>{const O=this.reportData.read(I);if(O?.("isReceive"),this.multiLineDecorationModel.accept(),this.rewriteWidget){this.rewriteWidget.accept();const P=this.rewriteWidget.getVirtualEditor();if(P){const R=this.rewriteWidget.getEditArea(),M=P.getDecorationsInRange(l.Range.lift(R)),k=M?.filter(B=>B.options.description===u.REWRITE_DECORATION_INLINE_ADD);k&&this.additionsDeletionsDecorationModel.updateAdditionsDecoration(k.map(B=>B.range))}}this.hide()})}static get(I){return I.getContribution(w.ID)}get model(){return this.monacoEditor.getModel()}get preferenceService(){return this.injector.get(n.PreferenceService)}get keybindingRegistry(){return this.injector.get(n.KeybindingRegistry)}get intelligentCompletionsRegistry(){return this.injector.get(o.IntelligentCompletionsRegistryToken)}get logger(){return this.injector.get(o.ILogger)}mount(){return this.handlerAlwaysVisiblePreference(),this.codeEditsResult=(0,m.observableValue)(this,void 0),this.whenMultiLineEditsVisibleDisposable=new o.Disposable,this.multiLineDecorationModel=new f.MultiLineDecorationModel(this.monacoEditor),this.additionsDeletionsDecorationModel=new v.AdditionsDeletionsDecorationModel(this.monacoEditor),this.aiNativeContextKey=this.injector.get(h.AINativeContextKey,[this.monacoEditor.contextKeyService]),this.codeEditsSourceCollection=this.injector.get(b.CodeEditsSourceCollection,[[S.LintErrorCodeEditsSource,y.LineChangeCodeEditsSource,A.TypingCodeEditsSource],this.monacoEditor]),this.registerFeature(this.monacoEditor),this.featureDisposable}handlerAlwaysVisiblePreference(){let I=new o.Disposable;const O=()=>{I.addDispose(this.keybindingRegistry.registerKeybinding({command:_.inlineSuggestCommitId,keybinding:n.Key.TAB.code,when:c.ContextKeyExpr.and(s.InlineCompletionContextKeys.inlineSuggestionVisible,p.EditorContextKeys.tabMovesFocus.toNegated(),s.InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize,p.EditorContextKeys.hoverFocused.toNegated())},n.KeybindingScope.USER));const M=g.InlineCompletionsController.get(this.monacoEditor);M&&I.addDispose((0,m.autorun)(k=>{const B=M.model.read(k);if(B?.inlineCompletionState.read(k),M._suggestWidgetSelectedItem.get()){const j=M._suggestWidgetAdaptor;j._currentSuggestItemInfo=void 0,j._onDidSelectedItemChange.fire()}}))},P=()=>{I&&(I.dispose(),I=new o.Disposable)};this.preferenceService.getValid(o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,!0)&&O(),this.featureDisposable.addDispose(this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,({newValue:M})=>{M?O():P()}))}destroyRewriteWidget(){this.rewriteWidget&&(this.rewriteWidget.dispose(),this.rewriteWidget=null)}applyInlineDecorations(I){const{items:O}=I,{range:P,insertText:R}=O[0];if(!P)return;const M=this.monacoEditor.getPosition(),k=this.monacoEditor.getModel(),B=R.toString(),x=k?.getValueInRange(P),N=this.model.getEOL(),j=(0,a.computeMultiLineDiffChanges)(x,B,this.monacoEditor,P.startLineNumber,N);if(!j)return;const{singleLineCharChanges:K,charChanges:U,wordChanges:Y,isOnlyAddingToEachWord:z}=j;if(P&&z&&U.length<=20&&Y.length<=20){const Z=this.multiLineDecorationModel.applyInlineDecorations(this.monacoEditor,(0,a.mergeMultiLineDiffChanges)(K,N),P.startLineNumber,M);this.aiNativeContextKey.multiLineEditsIsVisible.reset(),this.multiLineDecorationModel.clearDecorations(),Z?Z&&Z.inlineMods&&(this.aiNativeContextKey.multiLineEditsIsVisible.set(!0),this.multiLineDecorationModel.updateLineModificationDecorations(Z.inlineMods)):this.renderRewriteWidget(Y,k,P,B)}else this.additionsDeletionsDecorationModel.updateDeletionsDecoration(Y,P,N),this.renderRewriteWidget(Y,k,P,B);this.whenMultiLineEditsVisibleDisposable.disposed&&(this.whenMultiLineEditsVisibleDisposable=new o.Disposable),this.whenMultiLineEditsVisibleDisposable.addDispose(this.monacoEditor.onDidChangeCursorPosition(Z=>{if(this.aiNativeContextKey.multiLineEditsIsVisible.get()){const H=Z.position;(H.lineNumber<P.startLineNumber||H.lineNumber>P.endLineNumber)&&(0,o.runWhenIdle)(()=>{this.discard.get()})}else this.whenMultiLineEditsVisibleDisposable.dispose()}))}async renderRewriteWidget(I,O,P,R){this.destroyRewriteWidget();const M=this.monacoEditor.getPosition();if(!M)return;this.rewriteWidget=this.injector.get(u.RewriteWidget,[this.monacoEditor]);const k=this.model.getOffsetAt({lineNumber:P.startLineNumber,column:P.startColumn}),B=this.model.getOffsetAt({lineNumber:P.endLineNumber,column:P.endColumn}),x=this.model.getValue(),N=x.substring(0,k)+R+x.substring(B),j=(0,a.wordChangesToLineChangesMap)(I,P,O);await this.rewriteWidget.defered.promise,this.aiNativeContextKey.multiLineEditsIsVisible.set(!0);const K=Object.values(j).map(U=>({changes:U.map(Y=>Y.filter(z=>z.value.trim()!==E.empty)).filter(Y=>Y.length>0)}));this.rewriteWidget.setInsertText(R),this.rewriteWidget.show({position:M}),this.rewriteWidget.setEditArea(P),K.every(({changes:U})=>U.every(Y=>Y.every(({removed:z})=>z)))?this.rewriteWidget.renderTextLineThrough(K):this.rewriteWidget.renderVirtualEditor(N,I)}hide(){this.cancelToken(),this.aiNativeContextKey.multiLineEditsIsVisible.reset(),this.multiLineDecorationModel.clearDecorations(),this.additionsDeletionsDecorationModel.clearDeletionsDecorations(),this.destroyRewriteWidget()}registerFeature(I){this.featureDisposable.addDispose(o.Event.any(I.onDidChangeCursorPosition,I.onDidChangeModelContent,I.onDidBlurEditorWidget)(()=>{this.additionsDeletionsDecorationModel.clearAdditionsDecorations()}));const O=new Set([r.MultiLineEditsIsVisible.raw]);this.featureDisposable.addDispose(this.whenMultiLineEditsVisibleDisposable),this.featureDisposable.addDispose(this.aiNativeContextKey.contextKeyService.onDidChangeContext(P=>{P.payload.affectsSome(O)&&(this.aiNativeContextKey.multiLineEditsIsVisible.get()||this.whenMultiLineEditsVisibleDisposable.dispose())})),this.featureDisposable.addDispose(o.Event.any(I.onDidChangeModel,I.onDidChangeModelContent)(()=>{(0,o.runWhenIdle)(()=>{this.hide()})})),this.featureDisposable.addDispose((0,m.autorunWithStoreHandleChanges)({createEmptyChangeSummary:()=>({}),handleChange:(P,R)=>P.didChange(this.codeEditsSourceCollection.codeEditsContextBean)?!this.aiNativeContextKey.multiLineEditsIsVisible.get():!1},async(P,R,M)=>{const k=this.codeEditsSourceCollection.codeEditsContextBean.read(P),B=this.intelligentCompletionsRegistry.getCodeEditsProvider();if(k&&B){M.add(o.Disposable.create(()=>k.cancelToken())),k.reporterStart();const x=await B(this.monacoEditor,k.position,k.bean,k.token);x&&x.items.length>0&&(0,m.transaction)(N=>{this.codeEditsResult.set(new T.CodeEditsResultValue(x),N)})}})),this.featureDisposable.addDispose((0,m.autorun)(P=>{const R=this.codeEditsResult.read(P);if(R)try{this.applyInlineDecorations(R)}catch(M){this.logger.warn("IntelligentCompletionsController applyInlineDecorations error",M)}})),this.featureDisposable.addDispose(this.codeEditsSourceCollection)}}t.IntelligentCompletionsController=w,w.ID="editor.contrib.ai.intelligent.completions"},74292:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelligentCompletionsRegistry=void 0;const n=e(85608),r=e(76003),o=e(43718);let l=class extends o.Disposable{registerIntelligentCompletionProvider(E){this.inlineCompletionsProvider=E}registerInlineCompletionsProvider(E){this.inlineCompletionsProvider=E}registerCodeEditsProvider(E){this.codeEditsProvider=E}getInlineCompletionsProvider(){return this.inlineCompletionsProvider}getCodeEditsProvider(){return this.codeEditsProvider}};t.IntelligentCompletionsRegistry=l,t.IntelligentCompletionsRegistry=l=n.__decorate([(0,r.Injectable)()],l)},78409:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditsSourceCollection=t.BaseCodeEditsSource=t.CodeEditsContextBean=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(20868),E=e(28423);class p extends l.Disposable{constructor(c,h){super(),this.raw=c,this.source=h,this.uid=(0,l.uuid)(6)}get priority(){return this.source.priority}get bean(){return this.raw}get position(){return this.raw.position}get token(){return this.source.token}reporterStart(){return this.source.reporterStart()}cancelToken(){return this.source.cancelToken()}reporterEnd(c){return this.source.reporterEnd(c)}}t.CodeEditsContextBean=p;let _=class extends l.Disposable{get token(){return this.cancellationTokenSource.token}cancelToken(){this.cancellationTokenSource.cancel(),this.cancellationTokenSource=new m.CancellationTokenSource,this.reporterEnd({isValid:!1})}constructor(c){super(),this.monacoEditor=c,this.cancellationTokenSource=new m.CancellationTokenSource,this.relationID=(0,E.observableValue)(this,void 0),this.codeEditsContextBean=(0,E.disposableObservableValue)(this,void 0)}get model(){return this.monacoEditor.getModel()}resetBean(){(0,E.transaction)(c=>{this.cancelToken(),this.codeEditsContextBean.set(void 0,c)})}setBean(c){(0,E.transaction)(h=>{const u=new p(c,this);this.codeEditsContextBean.set(u,h)})}reporterStart(){const c=this.codeEditsContextBean.get();if(c){const h=this.aiReporter.start(l.AIServiceType.CodeEdits,{type:l.AIServiceType.CodeEdits,actionSource:c?.bean.typing});(0,E.transaction)(u=>{this.relationID.set(h,u)})}}reporterEnd(c){const h=this.relationID.get();h&&this.aiReporter.end(h,c)}};t.BaseCodeEditsSource=_,n.__decorate([(0,r.Autowired)(l.IAIReporter),n.__metadata("design:type",Object)],_.prototype,"aiReporter",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),t.BaseCodeEditsSource=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],_);let s=class extends l.Disposable{constructor(c,h){super(),this.constructorSources=c,this.monacoEditor=h,this.codeEditsContextBean=(0,E.disposableObservableValue)(this,void 0);const u=this.constructorSources.map(v=>this.injector.get(v,[this.monacoEditor]));u.forEach(v=>this.addDispose(v.mount()));const d=(0,E.derived)(v=>({codeEditsContextBean:new Map(u.map(f=>[f,f.codeEditsContextBean.read(v)]))}));this.addDispose((0,E.autorunDelta)((0,E.debouncedObservable2)(d,0),({lastValue:v,newValue:f})=>{const a=u.filter(S=>{var A;const T=f?.codeEditsContextBean.get(S),w=(A=v?.codeEditsContextBean)===null||A===void 0?void 0:A.get(S);return T&&(!w||T.uid!==w.uid)});let b=0,y;for(const S of a){const A=S.codeEditsContextBean.get();A&&A.priority>=b&&(b=A.priority,y=A)}(0,E.transaction)(S=>{this.codeEditsContextBean.set(y,S)})}))}};t.CodeEditsSourceCollection=s,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CodeEditsSourceCollection=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Array,Object])],s)},36368:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LineChangeCodeEditsSource=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(28423),m=e(78409);let E=class extends m.BaseCodeEditsSource{constructor(){super(...arguments),this.priority=2}mount(){const _=(0,l.observableFromEvent)(this,this.monacoEditor.onDidChangeModelContent,h=>h),s=(0,l.observableFromEvent)(this,this.monacoEditor.onDidChangeCursorPosition,h=>h),g=(0,l.derivedHandleChanges)({owner:this,createEmptyChangeSummary:()=>({change:void 0}),handleChange:(h,u)=>(h.didChange(s)?u.change=void 0:u.change=_.get(),!0)},(h,u)=>(s.read(h),_.read(h),u.change));this.addDispose((0,l.recomputeInitiallyAndOnChange)(g));let c;return this.addDispose((0,l.autorunDelta)(g,({lastValue:h})=>{c=h})),this.addDispose((0,l.autorunDelta)(s,({lastValue:h,newValue:u})=>{const d=c;if(!this.preferenceService.getValid(o.AINativeSettingSectionsId.CodeEditsLineChange,!1))return!1;const f=h?.position,a=u?.position;f&&f.lineNumber!==a?.lineNumber&&this.setBean({typing:o.ECodeEditsSourceTyping.LineChange,position:a,data:{preLineNumber:f.lineNumber,currentLineNumber:a.lineNumber,change:d}}),c=void 0})),this}};t.LineChangeCodeEditsSource=E,t.LineChangeCodeEditsSource=E=n.__decorate([(0,r.Injectable)({multiple:!0})],E)},12979:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LintErrorCodeEditsSource=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(51500),m=e(90626),E=e(34835),p=e(78409);var _;(function(g){function c(h){return{message:h.message,range:{startPosition:{lineNumber:h.startLineNumber,column:h.startColumn},endPosition:{lineNumber:h.endLineNumber,column:h.endColumn}},source:h.resource,relatedInformation:h.relatedInformation,severity:E.MarkerSeverity.toString(h.severity)}}g.toData=c})(_||(_={}));let s=class extends p.BaseCodeEditsSource{constructor(){super(...arguments),this.priority=1}mount(){let c=this.monacoEditor.getPosition();return this.addDispose(o.Event.debounce(this.monacoEditor.onDidChangeCursorPosition,(h,u)=>u,o.FRAME_THREE)(async h=>{const u=h.position,d=this.monacoEditor.getSelection();d?.isEmpty()&&(c&&c.lineNumber!==u.lineNumber&&await this.doTrigger(u),c=u)})),this}async doTrigger(c){var h;if(!this.preferenceService.getValid(o.AINativeSettingSectionsId.CodeEditsLintErrors,!1)||!this.model)return;const d=m.StandaloneServices.get(E.IMarkerService),v=this.model.uri;let f=d.read({resource:v,severities:E.MarkerSeverity.Error});if(f=f.filter(a=>Math.abs(a.startLineNumber-c.lineNumber)<=1),f.length){const a=await this.workspaceService.asRelativePath(v.path);this.setBean({typing:o.ECodeEditsSourceTyping.LinterErrors,position:c,data:{relativeWorkspacePath:(h=a?.path)!==null&&h!==void 0?h:v.path,errors:f.map(b=>_.toData(b))}})}}};t.LintErrorCodeEditsSource=s,n.__decorate([(0,r.Autowired)(l.IWorkspaceService),n.__metadata("design:type",Object)],s.prototype,"workspaceService",void 0),t.LintErrorCodeEditsSource=s=n.__decorate([(0,r.Injectable)({multiple:!0})],s)},25576:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypingCodeEditsSource=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(78409);let m=class extends l.BaseCodeEditsSource{constructor(){super(...arguments),this.priority=0}mount(){return this.addDispose(this.monacoEditor.onDidChangeModelContent(p=>{const _=this.monacoEditor.getPosition();_&&this.doTrigger(_,p)})),this}async doTrigger(p,_){!this.preferenceService.getValid(o.AINativeSettingSectionsId.CodeEditsTyping,!1)||!this.model||this.setBean({typing:o.ECodeEditsSourceTyping.Typing,position:p,data:_})}};t.TypingCodeEditsSource=m,t.TypingCodeEditsSource=m=n.__decorate([(0,r.Injectable)({multiple:!0})],m)},35363:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InterfaceNavigationContribution=t.InterfaceNavigationDecorationsContribution=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(13833)),l=e(76003),m=e(41869),E=e(43718),p=e(57517),_=n.__importStar(e(20868)),s=e(90052),g=e(52416),c=e(85679),h=e(53374),u=n.__importDefault(e(26754)),d="PCEtLSBDb3B5cmlnaHQgMjAwMC0yMDIyIEpldEJyYWlucyBzLnIuby4gYW5kIGNvbnRyaWJ1dG9ycy4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgdGhlIEFwYWNoZSAyLjAgbGljZW5zZS4gLS0+Cjxzdmcgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI2LjUiIGZpbGw9IiMyNTM2MjciIHN0cm9rZT0iIzU3OTY1QyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwIDQuNVY1LjVMOC41IDUuNVYxMC41SDEwVjExLjVMOC41IDExLjVINy41TDYgMTEuNVYxMC41SDcuNVY1LjVMNiA1LjVWNC41SDcuNUg4LjVIMTBaIiBmaWxsPSIjNTc5NjVDIi8+Cjwvc3ZnPgo=",v="PCEtLSBDb3B5cmlnaHQgMjAwMC0yMDIyIEpldEJyYWlucyBzLnIuby4gYW5kIGNvbnRyaWJ1dG9ycy4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgdGhlIEFwYWNoZSAyLjAgbGljZW5zZS4gLS0+Cjxzdmcgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSI2LjUiIGZpbGw9IiNGMkZDRjMiIHN0cm9rZT0iIzVGQjg2NSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwIDQuNVY1LjVMOC41IDUuNVYxMC41SDEwVjExLjVMOC41IDExLjVINy41TDYgMTEuNVYxMC41SDcuNVY1LjVMNiA1LjVWNC41SDcuNUg4LjVIMTBaIiBmaWxsPSIjNUZCODY1Ii8+Cjwvc3ZnPgo=";let f=class extends m.Disposable{constructor(S,A){super(),this.interfaceNode=S,this.editor=A,this.id="";const T=this.themeService.getCurrentThemeSync().type==="dark"?d:v,D=`${this.iconService.fromIcon("",`data:image/svg+xml;base64,${T}`,g.IconType.Base64)} ${u.default["interface-navigation-icon"]} interface-navigation-glyph`;this.editorDecoration={range:(0,h.toMonacoRange)(S),options:{isWholeLine:!0,glyphMarginClassName:D,description:"interface-decoration",glyphMarginHoverMessage:{value:(0,m.localize)("preference.ai.native.interface.quick.navigation.hover")},stickiness:_.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}get line(){return this.editorDecoration.range.startLineNumber}click(S){var A;return((A=S.target.position)===null||A===void 0?void 0:A.lineNumber)!==this.line||S.target.type!==s.MouseTargetType.GUTTER_GLYPH_MARGIN?!1:(this.editor.setPosition({lineNumber:this.interfaceNode.startPosition.row+1,column:this.interfaceNode.startPosition.column+1}),this.commandService.executeCommand("editor.action.goToImplementation"),!0)}};n.__decorate([(0,l.Autowired)(m.CommandService),n.__metadata("design:type",Object)],f.prototype,"commandService",void 0),n.__decorate([(0,l.Autowired)(g.IIconService),n.__metadata("design:type",Object)],f.prototype,"iconService",void 0),n.__decorate([(0,l.Autowired)(g.IThemeService),n.__metadata("design:type",Object)],f.prototype,"themeService",void 0),f=n.__decorate([(0,l.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],f);let a=class{get currentUri(){return this.editor.currentUri}constructor(S){this.editor=S,this.disposer=new m.Disposable,this.lastDecorations=[],this.supportLanguages=["java","typescript","typescriptreact"]}getInterfaceQuickJumpEnabled(){return this.preferenceService.getValid(E.AINativeSettingSectionsId.InterfaceQuickNavigationEnabled,!0)}async parseJavaInterfaces(S){const A=[];function T(w){if(w.type==="interface_declaration"){const D=w.children.find(P=>P.type==="identifier"),I=w.children.find(P=>P.type==="interface_body"),O=I?.children.filter(P=>P.type==="field_declaration"||P.type==="method_declaration").map(P=>P.children.find(R=>R.type==="identifier")).filter(P=>!!P);A.push({interfaceNode:D,members:O})}w.children.forEach(D=>T(D))}return T(S),A}async parseTypeScriptInterfaces(S){const A=[];function T(w){if(w.type==="interface_declaration"){const D=w.children.find(I=>I.type==="type_identifier");A.push({interfaceNode:D,members:[]})}w.children.forEach(D=>T(D))}return T(S),A}async decorateEditor(){if(!this.getInterfaceQuickJumpEnabled())return;const S=this.editor.monacoEditor.getModel();if(!S)return;const A=S.getLanguageId();if(!this.supportLanguages.includes(A))return;const T=this.languageParserService.createParser(A);if(!T)return;const w=await T.parseAST(S);if(!w)return;let D=[];if(A==="typescript"||A==="typescriptreact")D=await this.parseTypeScriptInterfaces(w);else if(A==="java")D=await this.parseJavaInterfaces(w);else return;D=A==="java"?await this.parseJavaInterfaces(w):await this.parseTypeScriptInterfaces(w);const I=D.map(({interfaceNode:O,members:P})=>{if(!O||!P)return[];const R=[this.injector.get(f,[O,this.editor.monacoEditor])];return P.forEach(M=>{R.push(this.injector.get(f,[M,this.editor.monacoEditor]))}),R}).flat();this.editor.monacoEditor.changeDecorations(O=>{const P=I;O.deltaDecorations(this.lastDecorations.map(R=>R.id),P.map(R=>R.editorDecoration)).forEach((R,M)=>P[M].id=R),this.lastDecorations=P})}contribute(){if(!this.getInterfaceQuickJumpEnabled())return this.disposer;this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModel(async()=>{await this.decorateEditor()}));const S=(0,r.default)(()=>{this.decorateEditor()},3e3);return this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModelContent(S)),this.disposer.addDispose(this.editor.monacoEditor.onMouseDown(A=>{for(const T of this.lastDecorations)if(T.click(A)){A.event.stopPropagation();return}})),this.disposer}};t.InterfaceNavigationDecorationsContribution=a,n.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),n.__metadata("design:type",l.Injector)],a.prototype,"injector",void 0),n.__decorate([(0,l.Autowired)(c.LanguageParserService),n.__metadata("design:type",c.LanguageParserService)],a.prototype,"languageParserService",void 0),n.__decorate([(0,l.Autowired)(m.PreferenceService),n.__metadata("design:type",Object)],a.prototype,"preferenceService",void 0),t.InterfaceNavigationDecorationsContribution=a=n.__decorate([(0,l.Injectable)({multiple:!0}),n.__param(0,(0,l.Optional)()),n.__metadata("design:paramtypes",[Object])],a);let b=class{registerEditorFeature(S){S.registerEditorFeatureContribution({contribute:A=>this.injector.get(a,[A]).contribute()})}};t.InterfaceNavigationContribution=b,n.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),n.__metadata("design:type",l.Injector)],b.prototype,"injector",void 0),t.InterfaceNavigationContribution=b=n.__decorate([(0,m.Domain)(p.BrowserEditorContribution)],b)},44298:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeConflictContribution=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=e(76003),l=e(41869),m=e(38070),E=e(43718),p=e(27833),_=e(57517),s=e(31375),g=n.__importStar(e(20868)),c=e(75526),h=e(24093),u=n.__importDefault(e(89543)),d=e(67641),v=e(80922),f=e(52902),a=e(79865),b=e(28160),y="merge-conflict-codelens-style",S=`
|
|
28249
28249
|
.monaco-editor .codelens-decoration {
|
|
28250
28250
|
& > a[title*=AI] {
|
|
28251
28251
|
background-image: radial-gradient(circle at -21% -22%, #00f6ff, #9c03ff);
|
|
@@ -28371,7 +28371,7 @@ ${a}`)}return this.keybindingsChanged.fire({affectsCommands:[v.command]}),{dispo
|
|
|
28371
28371
|
`)}))}}}t.TextMateTokenizer=m},54324:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextmateService=void 0,t.getEncodedLanguageId=y,t.getLegalThemeName=S;const n=e(85608),r=e(27107),o=e(25726),l=e(76003),m=e(41869),E=e(6858),p=e(43718),_=e(42933),s=e(52902),g=e(33096),c=e(89944),h=e(96068),u=e(14162),d=e(90626),v=e(96689),f=e(41977),a=e(58837);let b=!1;function y(I){return s.monaco.languages.getEncodedLanguageId(I)}function S(I){return I.toLowerCase().replace(/[^a-z0-9-]/g,"-")}class A{createOnigScanner(O){return new r.OnigScanner(O)}createOnigString(O){return new r.OnigString(O)}}function T(I){if(!Array.isArray(I))return!1;for(let O=0,P=I.length;O<P;O++)if(typeof I[O]!="string")return!1;return!0}function w(I){return T(I)&&I.length===2}let D=class extends m.WithEventBus{constructor(){super(...arguments),this.registeredGrammarDisposableCollection=new Map,this.injections=new Map,this.activatedLanguage=new Set,this.languageConfigLocation=new Map,this.languageConfiguration=new Map,this.initialized=!1,this.dynamicLanguages=[]}init(){this.initGrammarRegistry(),this.listenThemeChange(),this.listenPreferenceChange()}listenThemeChange(){this.eventBus.on(c.ThemeChangedEvent,O=>{const P=O.payload.theme.themeData;P!==this.editorTheme&&(this.editorTheme=P,this.setTheme(P))})}async registerLanguage(O,P){return this.registerLanguages([O],P)}reviveLanguageConfiguration(O,P){return{wordPattern:this.createRegex(P.wordPattern),autoClosingPairs:this.extractValidAutoClosingPairs(O,P),brackets:this.extractValidBrackets(O,P),comments:this.extractValidCommentRule(O,P),folding:this.convertFolding(P.folding),surroundingPairs:this.extractValidSurroundingPairs(O,P),indentationRules:this.convertIndentationRules(P.indentationRules),autoCloseBefore:P.autoCloseBefore,colorizedBracketPairs:this.extractValidColorizedBracketPairs(O,P),onEnterRules:this.extractValidOnEnterRules(O,P)}}get monacoLanguageService(){return d.StandaloneServices.get(u.ILanguageService)}isEmbeddedLanguageOnly(O){return!O.filenames&&!O.extensions&&!O.filenamePatterns&&!O.firstLine&&!O.mimetypes&&(!O.aliases||O.aliases.length===0)}async registerLanguages(O,P){const R=O.map(M=>({id:M.id,aliases:M.aliases,extensions:M.extensions,filenamePatterns:M.filenamePatterns,filenames:M.filenames,firstLine:M.firstLine,mimetypes:M.mimetypes}));if(this.dynamicLanguages.push(...R.filter(M=>!this.isEmbeddedLanguageOnly(M))),this.monacoLanguageService._registry._registerLanguages(R),O.forEach(async M=>{this.languageConfigLocation.set(M.id,P),this.addDispose(s.monaco.languages.onLanguage(M.id,async()=>{await this.loadLanguageConfiguration(M,P),this.activateLanguage(M.id)})),this.languageConfiguration.set(M.id,M)}),this.initialized){const M=this.editorDocumentModelService.getAllModels().map(k=>k.uri);for(const k of M){const B=this.editorDocumentModelService.getModelReference(p.URI.parse(k.codeUri.toString()));if(B&&B.instance){const x=B.instance.getMonacoModel().getLanguageId();if(this.languageConfiguration.has(x)){const N=this.languageConfigLocation.get(x);await this.loadLanguageConfiguration(this.languageConfiguration.get(x),N),this.activateLanguage(x)}}B?.dispose()}}}async registerGrammar(O,P){if(O.path){const R=O.path.replace(/^\.\//,"");O.location=P.resolve(R)}this.doRegisterGrammar(O)}unregisterGrammar(O){const P=this.registeredGrammarDisposableCollection.get(O.scopeName);P&&P.dispose()}doRegisterGrammar(O){const P=new p.Disposable;if(O.injectTo)for(const R of O.injectTo){let M=this.injections.get(R);M||(M=[],P.addDispose(p.Disposable.create(()=>{this.injections.delete(R)})),this.injections.set(R,M)),M.push(O.scopeName)}P.addDispose(p.Disposable.create(this.textmateRegistry.registerTextmateGrammarScope(O.scopeName,{async getGrammarDefinition(){return{format:/\.json$/.test(O.path)?"json":"plist",location:O.location,content:await O.resolvedConfiguration}},getInjections:R=>{const M=R.split(".");let k=[];for(let B=1;B<=M.length;B++){const x=M.slice(0,B).join(".");k=[...k,...this.injections.get(x)||[]]}return k}}))),O.language&&(P.addDispose(p.Disposable.create(this.textmateRegistry.mapLanguageIdToTextmateGrammar(O.language,O.scopeName))),P.addDispose(p.Disposable.create(this.textmateRegistry.registerGrammarConfiguration(O.language,()=>({embeddedLanguages:this.convertEmbeddedLanguages(O.embeddedLanguages),tokenTypes:this.convertTokenTypes(O.tokenTypes),balancedBracketSelectors:(0,h.asStringArray)(O.balancedBracketScopes,["*"]),unbalancedBracketSelectors:(0,h.asStringArray)(O.unbalancedBracketScopes,[])}))))),this.registeredGrammarDisposableCollection.set(O.scopeName,P)}async loadLanguageConfiguration(O,P){let R;if(typeof O.resolvedConfiguration=="object"){const M=await O.resolvedConfiguration;R=this.reviveLanguageConfiguration(O.id,M)}else if(O.configuration){const M=O.configuration.replace(/^\.\//,""),k=P.resolve(M),x=(await this.fileServiceClient.resolveContent(k.toString())).content;if(x){const N=this.safeParseJSON(x);N&&(R=this.reviveLanguageConfiguration(O.id,N))}}R&&s.monaco.languages.setLanguageConfiguration(O.id,R)}async activateLanguage(O){this.eventBus.fire(new m.ExtensionActivateEvent({topic:"onLanguage",data:O})),!this.activatedLanguage.has(O)&&(this.activatedLanguage.add(O),this.setTokensProviderByLanguageId(O))}async setTokensProviderByLanguageId(O){const P=this.textmateRegistry.getScope(O);if(!P||!this.textmateRegistry.getProvider(P))return;const M={lineLimit:this.preferenceService.getValid("editor.maxTokenizationLineLength",2e4)},k=this.textmateRegistry.getGrammarConfiguration(O)(),B=y(O);try{const x=await this.grammarRegistry.loadGrammarWithConfiguration(P,B,k),N=k.tokenizerOption?k.tokenizerOption:M,j=k.embeddedLanguages&&Object.keys(k.embeddedLanguages).length>0;if(x){const K=new a.TextMateTokenizer(x,N,j);this.addDispose(K.onDidEncounterLanguage(async U=>{const Y=this.monacoLanguageService._registry.languageIdCodec.decodeLanguageId(U),z=this.languageConfigLocation.get(Y);z&&this.languageConfiguration.has(Y)&&(await this.loadLanguageConfiguration(this.languageConfiguration.get(Y),z),this.activateLanguage(Y))})),s.monaco.languages.setTokensProvider(O,K)}}catch(x){this.logger.warn("No grammar for this language id",O,x)}}setTheme(O){this.generateEncodedTokenColors(O),s.monaco.editor.defineTheme(S(O.name),O),s.monaco.editor.setTheme(S(O.name))}generateEncodedTokenColors(O){this.grammarRegistry.setTheme(O),O.encodedTokensColors=this.grammarRegistry.getColorMap(),O.encodedTokensColors[0]=null}createRegex(O){if(typeof O=="string")return new RegExp(O,"");if((0,p.isObject)(O)){if(typeof O.pattern!="string"||typeof O.flags<"u"&&typeof O.flags!="string")return;try{return new RegExp(O.pattern,O.flags)}catch{return}}}safeParseJSON(O){let P;try{return P=(0,m.parseWithComments)(O),P}catch(R){this.logger.error(`Language configuration file parsing error, ${R.stack}`);return}}convertFolding(O){if(!O)return;const P={offSide:O.offSide};return O.markers&&(P.markers={end:O.markers.end,start:O.markers.start}),P}convertIndentationRules(O){if(!O)return;const P={decreaseIndentPattern:this.createRegex(O.decreaseIndentPattern),increaseIndentPattern:this.createRegex(O.increaseIndentPattern)};return O.indentNextLinePattern&&(P.indentNextLinePattern=this.createRegex(O.indentNextLinePattern)),O.unIndentedLinePattern&&(P.unIndentedLinePattern=this.createRegex(O.unIndentedLinePattern)),P}convertEmbeddedLanguages(O){if(typeof O>"u"||O===null)return;const P=Object.create(null),R=Object.keys(O),M=R.length;for(let k=0;k<M;k++){const B=R[k],x=O[B];P[B]=y(x)}return P}convertTokenTypes(O){if(typeof O>"u"||O===null)return;const P=Object.create(null),R=Object.keys(O),M=R.length;for(let k=0;k<M;k++){const B=R[k];switch(O[B]){case"string":P[B]=2;break;case"other":P[B]=0;break;case"comment":P[B]=1;break}}return P}extractValidSurroundingPairs(O,P){if(!P)return;const R=P.surroundingPairs;if(typeof R>"u")return;if(!Array.isArray(R)){this.logger.warn(`[${O}: language configuration: expected \`surroundingPairs\` to be an array.`);return}let M;for(let k=0,B=R.length;k<B;k++){const x=R[k];if(Array.isArray(x)){if(!w(x)){this.logger.warn(`[${O}: language configuration: expected \`surroundingPairs[${k}]\` to be an array of two strings or an object.`);continue}M=M||[],M.push({open:x[0],close:x[1]})}else{if(typeof x!="object"){this.logger.warn(`[${O}: language configuration: expected \`surroundingPairs[${k}]\` to be an array of two strings or an object.`);continue}if(typeof x.open!="string"){this.logger.warn(`[${O}: language configuration: expected \`surroundingPairs[${k}].open\` to be a string.`);continue}if(typeof x.close!="string"){this.logger.warn(`[${O}: language configuration: expected \`surroundingPairs[${k}].close\` to be a string.`);continue}M=M||[],M.push({open:x.open,close:x.close})}}return M}extractValidColorizedBracketPairs(O,P){const R=P.colorizedBracketPairs;if(typeof R>"u")return;if(!Array.isArray(R)){this.logger.warn(`[${O}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const M=[];for(let k=0,B=R.length;k<B;k++){const x=R[k];if(!w(x)){this.logger.warn(`[${O}]: language configuration: expected \`colorizedBracketPairs[${k}]\` to be an array of two strings.`);continue}M.push([x[0],x[1]])}return M}extractValidOnEnterRules(O,P){const R=P.onEnterRules;if(typeof R>"u")return;if(!Array.isArray(R)){this.logger.warn(`[${O}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let M;for(let k=0,B=R.length;k<B;k++){const x=R[k];if(!(0,p.isObject)(x)){this.logger.warn(`[${O}]: language configuration: expected \`onEnterRules[${k}]\` to be an object.`);continue}if(!(0,p.isObject)(x.action)){this.logger.warn(`[${O}]: language configuration: expected \`onEnterRules[${k}].action\` to be an object.`);continue}let N;if(x.action.indent==="none")N=g.IndentAction.None;else if(x.action.indent==="indent")N=g.IndentAction.Indent;else if(x.action.indent==="indentOutdent")N=g.IndentAction.IndentOutdent;else if(x.action.indent==="outdent")N=g.IndentAction.Outdent;else{this.logger.warn(`[${O}]: language configuration: expected \`onEnterRules[${k}].action.indent\` to be 'none', 'indent', 'indentOutdent' or 'outdent'.`);continue}const j={indentAction:N};x.action.appendText&&(typeof x.action.appendText=="string"?j.appendText=x.action.appendText:this.logger.warn(`[${O}]: language configuration: expected \`onEnterRules[${k}].action.appendText\` to be undefined or a string.`)),x.action.removeText&&(typeof x.action.removeText=="number"?j.removeText=x.action.removeText:this.logger.warn(`[${O}]: language configuration: expected \`onEnterRules[${k}].action.removeText\` to be undefined or a number.`));const K=this.createRegex(x.beforeText);if(!K)continue;const U={beforeText:K,action:j};if(x.afterText){const Y=this.createRegex(x.afterText);Y&&(U.afterText=Y)}if(x.previousLineText){const Y=this.createRegex(x.previousLineText);Y&&(U.previousLineText=Y)}M=M||[],M.push(U)}return M}extractValidBrackets(O,P){const R=P.brackets;if(typeof R>"u")return;if(!Array.isArray(R)){this.logger.warn(`[${O}]: language configuration: expected \`brackets\` to be an array.`);return}let M;for(let k=0,B=R.length;k<B;k++){const x=R[k];if(!w(x)){this.logger.warn(`[${O}]: language configuration: expected \`brackets[${k}]\` to be an array of two strings.`);continue}M=M||[],M.push(x)}return M}extractValidAutoClosingPairs(O,P){const R=P.autoClosingPairs;if(typeof R>"u")return;if(!Array.isArray(R)){this.logger.warn(`[${O}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let M;for(let k=0,B=R.length;k<B;k++){const x=R[k];if(Array.isArray(x)){if(!w(x)){this.logger.warn(`[${O}]: language configuration: expected \`autoClosingPairs[${k}]\` to be an array of two strings or an object.`);continue}M=M||[],M.push({open:x[0],close:x[1]})}else{if(typeof x!="object"){this.logger.warn(`[${O}]: language configuration: expected \`autoClosingPairs[${k}]\` to be an array of two strings or an object.`);continue}if(typeof x.open!="string"){this.logger.warn(`[${O}]: language configuration: expected \`autoClosingPairs[${k}].open\` to be a string.`);continue}if(typeof x.close!="string"){this.logger.warn(`[${O}]: language configuration: expected \`autoClosingPairs[${k}].close\` to be a string.`);continue}if(typeof x.notIn<"u"&&!T(x.notIn)){this.logger.warn(`[${O}]: language configuration: expected \`autoClosingPairs[${k}].notIn\` to be a string array.`);continue}M=M||[],M.push({open:x.open,close:x.close,notIn:x.notIn})}}return M}extractValidCommentRule(O,P){const R=P.comments;if(typeof R>"u")return;if(typeof R!="object"){this.logger.warn(`[${O}]: language configuration: expected \`comments\` to be an object.`);return}let M;return typeof R.lineComment<"u"&&(typeof R.lineComment!="string"?this.logger.warn(`[${O}]: language configuration: expected \`comments.lineComment\` to be a string.`):(M=M||{},M.lineComment=R.lineComment)),typeof R.blockComment<"u"&&(w(R.blockComment)?(M=M||{},M.blockComment=R.blockComment):this.logger.warn(`[${O}]: language configuration: expected \`comments.blockComment\` to be an array of two strings.`)),M}async initGrammarRegistry(){this.grammarRegistry=new o.Registry({onigLib:this.getOnigLib(),loadGrammar:async O=>{const P=this.textmateRegistry.getProvider(O);if(P){const R=await P.getGrammarDefinition();if(!R.content){const B=(await this.fileServiceClient.resolveContent(R.location.toString())).content;R.content=R.format==="json"?this.safeParseJSON(B):B}let M;return typeof R.content=="string"?M=(0,o.parseRawGrammar)(R.content,R.format==="json"?"grammar.json":"grammar.plist"):M=R.content,M}},getInjections:O=>{const P=this.textmateRegistry.getProvider(O);return P&&P.getInjections?P.getInjections(O):[]}}),this.activateLanguages()}getLanguages(){return[...s.monaco.languages.getLanguages(),...this.dynamicLanguages]}activateLanguages(){for(const{id:O}of this.getLanguages())this.editorDocumentModelService.hasLanguage(O)&&this.activateLanguage(O)}async getOnigLib(){if(b)return new A;const O=await this.rendererRuntime.provideResourceUri(E.EKnownResources.OnigWasm),R=await(await fetch(O)).arrayBuffer();return await(0,r.loadWASM)(R),b=!0,new A}listenPreferenceChange(){this.preferenceService.onPreferenceChanged(O=>{if(O.preferenceName==="editor.maxTokenizationLineLength")for(const P of this.activatedLanguage)this.setTokensProviderByLanguageId(P)})}async testTokenize(O,P){const R=this.textmateRegistry.getScope(P);if(!R)return;const M=this.textmateRegistry.getGrammarConfiguration(P)(),k=y(P),B=await this.grammarRegistry.loadGrammarWithConfiguration(R,k,M);let x=o.INITIAL;const N=B.tokenizeLine(O,x),j=(0,m.getDebugLogger)("tokenize");j.log(`
|
|
28372
28372
|
Tokenizing line: ${O}`);for(let K=0;K<N.tokens.length;K++){const U=N.tokens[K];j.log(` - token from ${U.startIndex} to ${U.endIndex} (${O.substring(U.startIndex,U.endIndex)}) with scopes ${U.scopes.join(", ")}`)}x=N.ruleStack}dispose(){super.dispose(),this.monacoLanguageService._requestedRichLanguages?this.monacoLanguageService._requestedRichLanguages.clear():this.logger.warn("monaco language service not found _requestedRichLanguages"),this.monacoLanguageService._requestedBasicLanguages?this.monacoLanguageService._requestedBasicLanguages.clear():this.logger.warn("monaco language service not found _requestedBasicLanguages")}};t.TextmateService=D,n.__decorate([(0,l.Autowired)(),n.__metadata("design:type",f.TextmateRegistry)],D.prototype,"textmateRegistry",void 0),n.__decorate([(0,l.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],D.prototype,"fileServiceClient",void 0),n.__decorate([(0,l.Autowired)(m.PreferenceService),n.__metadata("design:type",Object)],D.prototype,"preferenceService",void 0),n.__decorate([(0,l.Autowired)(m.ILogger),n.__metadata("design:type",Object)],D.prototype,"logger",void 0),n.__decorate([(0,l.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],D.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,l.Autowired)(E.RendererRuntime),n.__metadata("design:type",E.RendererRuntime)],D.prototype,"rendererRuntime",void 0),t.TextmateService=D=n.__decorate([(0,l.Injectable)()],D)},88412:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyContribution=t.executeProvideSubtypesCommand=t.executeProvideSupertypesCommand=t.executePrepareTypeHierarchyCommand=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(40191),m=e(28694),E=e(82196);t.executePrepareTypeHierarchyCommand={id:"_executePrepareTypeHierarchy"},t.executeProvideSupertypesCommand={id:"_executeProvideSupertypes"},t.executeProvideSubtypesCommand={id:"_executeProvideSubtypes"};const p=new l.RawContextKey("editorHasCallHierarchyProvider",!1);let _=class{registerCommands(g){g.registerCommand(t.executePrepareTypeHierarchyCommand,{execute:(c,h)=>this.typeHierarchyService.prepareTypeHierarchyProvider(c,h)}),g.registerCommand(t.executeProvideSupertypesCommand,{execute:c=>this.typeHierarchyService.provideSupertypes(c)}),g.registerCommand(t.executeProvideSubtypesCommand,{execute:c=>this.typeHierarchyService.provideSubtypes(c)})}registerEditorFeature(g){this.ctxHasProvider=p.bind(this.contextKeyService),g.registerEditorFeatureContribution({contribute:c=>{const h=c.monacoEditor;return o.Event.any(h.onDidChangeModel,h.onDidChangeModelLanguage,m.TypeHierarchyProviderRegistry.onDidChange)(()=>{h.hasModel()&&this.ctxHasProvider.set(m.TypeHierarchyProviderRegistry.has(h.getModel()))})}})}};t.TypeHierarchyContribution=_,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],_.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(m.ITypeHierarchyService),n.__metadata("design:type",Object)],_.prototype,"typeHierarchyService",void 0),t.TypeHierarchyContribution=_=n.__decorate([(0,o.Domain)(o.CommandContribution,E.BrowserEditorContribution)],_)},7795:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyService=t.TypeHierarchyModel=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(28694),m=e(96689),{isNonEmptyArray:E}=o.arrays;class p{static async create(g,c,h){const[u]=l.TypeHierarchyProviderRegistry.ordered(g);if(!u)return;const d=await u.prepareTypeHierarchy(g,c,h);if(d)return new p(d.roots.reduce((v,f)=>v+f._sessionId,""),u,d.roots,new o.RefCountedDisposable(d))}constructor(g,c,h,u){this.id=g,this.provider=c,this.roots=h,this.ref=u,this.root=h[0]}dispose(){this.ref.release()}fork(g){const c=this;return new class extends p{constructor(){super(c.id,c.provider,[g],c.ref.acquire())}}}async provideSupertypes(g,c){try{const h=await this.provider.provideSupertypes(g,c);if(E(h))return h}catch(h){(0,o.onUnexpectedExternalError)(h)}return[]}async provideSubtypes(g,c){try{const h=await this.provider.provideSubtypes(g,c);if(E(h))return h}catch(h){(0,o.onUnexpectedExternalError)(h)}return[]}}t.TypeHierarchyModel=p;let _=class{constructor(){this.models=new Map}registerTypeHierarchyProvider(g,c){l.TypeHierarchyProviderRegistry.register(g,c)}async prepareTypeHierarchyProvider(g,c){let h=this.modelService.getModelReference(o.URI.parse(g.toString())),u=h?.instance.getMonacoModel();if(h?.dispose(),!u){const d=await this.modelService.createModelReference(o.URI.parse(g.toString()));u=d.instance.getMonacoModel(),h=d}try{const d=await p.create(u,c,o.CancellationToken.None);return d?(this.models.set(d.id,d),this.models.forEach((v,f,a)=>{a.size>10&&(v.dispose(),this.models.delete(f))}),[d.root]):[]}finally{h?.dispose()}}async provideSupertypes(g){const c=this.models.get(g._sessionId);if(c)return c.provideSupertypes(g,o.CancellationToken.None)}async provideSubtypes(g){const c=this.models.get(g._sessionId);if(c)return c.provideSubtypes(g,o.CancellationToken.None)}};t.TypeHierarchyService=_,n.__decorate([(0,r.Autowired)(m.IEditorDocumentModelService),n.__metadata("design:type",Object)],_.prototype,"modelService",void 0),t.TypeHierarchyService=_=n.__decorate([(0,r.Injectable)()],_)},93532:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationMenuModel=t.NavigationBarViewService=t.NavigationMenuContainer=t.NavigationMenu=t.NavigationItem=t.NavigationBar=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(76003),m=e(97267),E=e(41869),p=e(28423),_=e(26209),s=n.__importDefault(e(69418)),g=e(82196),c=e(50674),h=({editorGroup:a})=>{const b=(0,E.useInjectable)(g.IBreadCrumbService),y=(0,E.useDesignStyles)(s.default.navigation_container,"navigation_container"),S=(0,E.useDesignStyles)(s.default.navigation_icon,"navigation_icon");if((0,c.useUpdateOnGroupTabChange)(a),(0,E.useUpdateOnEvent)(b.onDidUpdateBreadCrumbResults,[],T=>{var w;const D=a.currentEditor&&a.currentEditor.currentDocumentModel?a.currentEditor:null,I=a.currentEditor&&a.currentEditor.currentDocumentModel?a.currentEditor.currentDocumentModel.uri:(w=a.currentResource)===null||w===void 0?void 0:w.uri;return!!I&&T.editor===D&&T.uri.isEqual(I)}),a.resources.length===0||!a.currentResource)return null;let A;return a.currentEditor&&a.currentEditor.currentDocumentModel?A=b.getBreadCrumbs(a.currentEditor.currentDocumentModel.uri,a.currentEditor):A=b.getBreadCrumbs(a.currentResource.uri,null),A?A.length===0?null:o.default.createElement("div",{className:(0,r.default)("kt-navigation-container",y),onContextMenu:T=>{T.preventDefault()}},A.map((T,w)=>o.default.createElement(o.default.Fragment,{key:w+"-crumb:"+T.name},w>0&&o.default.createElement(m.Icon,{icon:"right",size:"small",className:S}),o.default.createElement(t.NavigationItem,{part:T,editorGroup:a})))):null};t.NavigationBar=h,t.NavigationItem=(0,o.memo)(({part:a,editorGroup:b})=>{const y=(0,E.useInjectable)(v),S=(0,E.useInjectable)(_.BreadCrumbsMenuService),A=(0,o.useRef)(),T=(0,E.useDesignStyles)(s.default["navigation-part"],"navigation-part"),w=(0,o.useCallback)(async()=>{if(a.getSiblings&&A.current){const{left:D,top:I,height:O}=A.current.getBoundingClientRect(),P=await a.getSiblings();let R=D;window.innerWidth-R<210&&(R=window.innerWidth-200-5),y.showMenu(P.parts,R,I+O+5,P.currentIndex,a.uri,b)}},[A.current,a]);return o.default.createElement("span",{onClick:w,onContextMenu:D=>{!a.isSymbol&&a.uri&&S.show(D.nativeEvent.x,D.nativeEvent.y,b,a.uri),D.preventDefault()},className:T,ref:A},a.icon&&o.default.createElement("span",{className:a.icon}),o.default.createElement("span",null,a.name))});const u=({model:a})=>{let b=window.innerHeight-a.y-20,y=a.y;const S=a.parts.length*22;b<100&&b<S&&(b=100,y=window.innerHeight-20-b);const A=(0,o.useRef)(),T=(0,E.useDesignStyles)(s.default.navigation_menu,"navigation_menu"),w=(0,E.useDesignStyles)(s.default.navigation_menu_item,"navigation_menu_item"),D=(0,E.useInjectable)(v),I=(0,E.useAutorun)(a.subMenu),O=(0,o.useCallback)(()=>{E.fastdom.measure(()=>{try{if(A.current){const P=A.current.querySelector(`.${s.default.navigation_menu_item_current}`);P&&P.scrollIntoView({behavior:"auto",block:"center"})}}catch{}})},[A.current]);return o.default.createElement("div",{className:T,style:{left:a.x+"px",top:y+"px",maxHeight:b+"px",height:S+"px"}},o.default.createElement(m.Scrollbars,{className:s.default.navigation_menu_items,universal:!0,forwardedRef:P=>{A.current=P,O()}},a.parts.map((P,R)=>{let M;const k=P.getChildren?async()=>{if(M){const{left:x,top:N,width:j}=M.getBoundingClientRect();let K=x+j+5;window.innerWidth-K<210&&(K=x-j-5);const U=await P.getChildren();a.showSubMenu(U,K,N,a)}}:void 0,B=P.onClick?()=>{P.onClick(),D.dispose()}:void 0;return o.default.createElement("div",{onClick:B||k,ref:x=>M=x,className:(0,r.default)(w,{[s.default.navigation_menu_item_current]:R===a.initialIndex}),key:"menu-"+P.name},o.default.createElement("span",{className:P.icon||(0,E.getIcon)("smile")}),o.default.createElement("span",{className:s.default.navigation_menu_item_label},P.name),P.getChildren&&o.default.createElement("span",{className:s.default.navigation_right,onClick:B&&k?x=>{x.stopPropagation(),k()}:void 0},o.default.createElement(m.Icon,{icon:"right",size:"small"})))})),I&&o.default.createElement(t.NavigationMenu,{model:I}))};t.NavigationMenu=u;const d=()=>{const a=(0,o.useRef)(),b=(0,E.useInjectable)(v),y=(0,E.useAutorun)(b.current);return(0,o.useEffect)(()=>{if(a.current){const S=new E.Disposable;return S.addDispose(new E.DomListener(window,"mouseup",()=>{b.dispose()})),S.addDispose(new E.DomListener(a.current,"mouseup",A=>{A.stopPropagation()})),S.dispose.bind(S)}}),y?o.default.createElement("div",{tabIndex:1,ref:a},o.default.createElement(t.NavigationMenu,{model:y})):null};t.NavigationMenuContainer=d;let v=class{constructor(){this.current=(0,p.observableValue)(this,null)}showMenu(b,y,S,A,T,w){(0,p.transaction)(D=>{this.current.set(new f(b,y,S,A,T),D)})}dispose(){(0,p.transaction)(b=>{const y=this.current.get();y?.dispose(),this.current.set(null,b)})}};t.NavigationBarViewService=v,t.NavigationBarViewService=v=n.__decorate([(0,l.Injectable)()],v);class f{constructor(b,y,S,A=-1,T){this.parts=b,this.x=y,this.y=S,this.initialIndex=A,this.uri=T,this.subMenu=(0,p.observableValue)(this,null)}showSubMenu(b,y,S,A){(0,p.transaction)(T=>{this.subMenu.set(new f(b,y,S,-1,A),T)})}dispose(){(0,p.transaction)(b=>{const y=this.subMenu.get();y?.dispose(),this.subMenu.set(null,b)})}}t.NavigationMenuModel=f},71145:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotebookService=void 0;const n=e(85608),r=e(76003),o=e(41869);let l=class extends o.WithEventBus{constructor(){super(...arguments),this._onDidOpenNotebookDocument=new o.Emitter,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new o.Emitter,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidSaveNotebookDocument=new o.Emitter,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new o.Emitter,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}};t.NotebookService=l,t.NotebookService=l=n.__decorate([(0,r.Injectable)()],l)},34885:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorPreferenceContribution=void 0;const n=e(85608),r=e(41869),o=e(24328);let l=class{constructor(){this.schema=o.editorPreferenceSchema}};t.EditorPreferenceContribution=l,t.EditorPreferenceContribution=l=n.__decorate([(0,r.Domain)(r.PreferenceContribution)],l)},6043:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffEditorOptionsConverters=t.textModelUpdateOptionsConverters=t.editorOptionsConverters=void 0,t.isEditorOption=l,t.isDiffEditorOption=m,t.getConvertedMonacoOptions=s;const n=e(41869),{removeUndefined:r}=n.objects;t.editorOptionsConverters=new Map([["editor.ariaLabel",{monaco:"ariaLabel"}],["editor.rulers",{monaco:"rulers"}],["editor.wordSeparators",{monaco:"wordSeparators"}],["editor.selectionClipboard",{monaco:"selectionClipboard"}],["editor.lineNumbers",{monaco:"lineNumbers"}],["editor.renderFinalNewline",{monaco:"renderFinalNewline"}],["editor.selectOnLineNumbers",{monaco:"selectOnLineNumbers"}],["editor.lineNumbersMinChars",{monaco:"lineNumbersMinChars"}],["editor.glyphMargin",{monaco:"glyphMargin"}],["editor.lineDecorationsWidth",{monaco:"lineDecorationsWidth"}],["editor.revealHorizontalRightPadding",{monaco:"revealHorizontalRightPadding"}],["editor.roundedSelection",{monaco:"roundedSelection"}],["editor.extraEditorClassName",{monaco:"extraEditorClassName"}],["editor.readOnly",{monaco:"readOnly"}],["editor.scrollbar",{monaco:"scrollbar"}],["editor.minimap",{monaco:"minimap",convert:g=>({enabled:g})}],["editor.find",{monaco:"find"}],["editor.fixedOverflowWidgets",{monaco:"fixedOverflowWidgets"}],["editor.overviewRulerLanes",{monaco:"overviewRulerLanes"}],["editor.overviewRulerBorder",{monaco:"overviewRulerBorder"}],["editor.cursorBlinking",{monaco:"cursorBlinking"}],["editor.mouseWheelZoom",{monaco:"mouseWheelZoom"}],["editor.cursorSmoothCaretAnimation",{monaco:"cursorSmoothCaretAnimation"}],["editor.cursorStyle",{monaco:"cursorStyle"}],["editor.cursorWidth",{monaco:"cursorWidth"}],["editor.fontLigatures",{monaco:"fontLigatures"}],["editor.columnSelection",{monaco:"columnSelection"}],["editor.disableLayerHinting",{monaco:"disableLayerHinting"}],["editor.disableMonospaceOptimizations",{monaco:"disableMonospaceOptimizations"}],["editor.hideCursorInOverviewRuler",{monaco:"hideCursorInOverviewRuler"}],["editor.scrollBeyondLastLine",{monaco:"scrollBeyondLastLine"}],["editor.scrollBeyondLastColumn",{monaco:"scrollBeyondLastColumn"}],["editor.smoothScrolling",{monaco:"smoothScrolling"}],["editor.automaticLayout",{monaco:"automaticLayout"}],["editor.wordWrap",{monaco:"wordWrap"}],["editor.wordWrapColumn",{monaco:"wordWrapColumn"}],["editor.wordWrapMinified",{monaco:"wordWrapMinified"}],["editor.wrappingIndent",{monaco:"wrappingIndent"}],["editor.wordWrapBreakBeforeCharacters",{monaco:"wordWrapBreakBeforeCharacters"}],["editor.wordWrapBreakAfterCharacters",{monaco:"wordWrapBreakAfterCharacters"}],["editor.wordWrapBreakObtrusiveCharacters",{monaco:"wordWrapBreakObtrusiveCharacters"}],["editor.stopRenderingLineAfter",{monaco:"stopRenderingLineAfter"}],["editor.hover",{monaco:"hover"}],["editor.links",{monaco:"links"}],["editor.colorDecorators",{monaco:"colorDecorators"}],["editor.contextmenu",{monaco:"contextmenu"}],["editor.mouseWheelScrollSensitivity",{monaco:"mouseWheelScrollSensitivity"}],["editor.fastScrollSensitivity",{monaco:"fastScrollSensitivity"}],["editor.multiCursorModifier",{monaco:"multiCursorModifier"}],["editor.multiCursorMergeOverlapping",{monaco:"multiCursorMergeOverlapping"}],["editor.accessibilitySupport",{monaco:"accessibilitySupport"}],["editor.suggest",{monaco:"suggest"}],["editor.gotoLocation",{monaco:"gotoLocation"}],["editor.quickSuggestions",{monaco:"quickSuggestions"}],["editor.quickSuggestionsDelay",{monaco:"quickSuggestionsDelay"}],["editor.parameterHints",{monaco:"parameterHints"}],["editor.autoClosingBrackets",{monaco:"autoClosingBrackets"}],["editor.autoClosingQuotes",{monaco:"autoClosingQuotes"}],["editor.autoSurround",{monaco:"autoSurround"}],["editor.autoIndent",{monaco:"autoIndent"}],["editor.formatOnType",{monaco:"formatOnType"}],["editor.formatOnPaste",{monaco:"formatOnPaste"}],["editor.dragAndDrop",{monaco:"dragAndDrop"}],["editor.suggestOnTriggerCharacters",{monaco:"suggestOnTriggerCharacters"}],["editor.acceptSuggestionOnEnter",{monaco:"acceptSuggestionOnEnter"}],["editor.acceptSuggestionOnCommitCharacter",{monaco:"acceptSuggestionOnCommitCharacter"}],["editor.snippetSuggestions",{monaco:"snippetSuggestions"}],["editor.emptySelectionClipboard",{monaco:"emptySelectionClipboard"}],["editor.copyWithSyntaxHighlighting",{monaco:"copyWithSyntaxHighlighting"}],["editor.wordBasedSuggestions",{monaco:"wordBasedSuggestions"}],["editor.suggestSelection",{monaco:"suggestSelection"}],["editor.suggestFontSize",{monaco:"suggestFontSize"}],["editor.suggestLineHeight",{monaco:"suggestLineHeight"}],["editor.tabCompletion",{monaco:"tabCompletion"}],["editor.selectionHighlight",{monaco:"selectionHighlight"}],["editor.occurrencesHighlight",{monaco:"occurrencesHighlight"}],["editor.codeLens",{monaco:"codeLens"}],["editor.lightbulb",{monaco:"lightbulb"}],["editor.codeActionsOnSave",{monaco:"codeActionsOnSave"}],["editor.codeActionsOnSaveTimeout",{monaco:"codeActionsOnSaveTimeout"}],["editor.folding",{monaco:"folding"}],["editor.foldingStrategy",{monaco:"foldingStrategy"}],["editor.showFoldingControls",{monaco:"showFoldingControls"}],["editor.matchBrackets",{monaco:"matchBrackets"}],["editor.renderWhitespace",{monaco:"renderWhitespace"}],["editor.renderControlCharacters",{monaco:"renderControlCharacters"}],["editor.renderIndentGuides",{monaco:"guides.indentation"}],["editor.highlightActiveIndentGuide",{monaco:"guides.highlightActiveIndentation"}],["editor.guides",{monaco:"guides"}],["editor.renderLineHighlight",{monaco:"renderLineHighlight"}],["editor.useTabStops",{monaco:"useTabStops"}],["editor.fontFamily",{monaco:"fontFamily"}],["editor.fontWeight",{monaco:"fontWeight"}],["editor.fontSize",{monaco:"fontSize"}],["editor.lineHeight",{monaco:"lineHeight"}],["editor.letterSpacing",{monaco:"letterSpacing"}],["editor.showUnused",{monaco:"showUnused"}],["editor.rename.enablePreview",{monaco:"editor.rename.enablePreview"}],["editor.semanticHighlighting",{monaco:"semanticHighlighting"}],["editor.bracketPairColorization",{monaco:"bracketPairColorization"}],["editor.wrappingStrategy",{monaco:"wrappingStrategy"}],["editor.experimental.stickyScroll.enabled",{monaco:"experimental",convert:g=>({stickyScroll:{enabled:g}})}],["editor.forceReadOnly",{monaco:"readOnly",convert:g=>{if(g)return!0}}],["editor.unicodeHighlight",{monaco:"unicodeHighlight"}],["editor.inlineSuggest.showToolbar",{monaco:"inlineSuggest",convert:g=>{if(g)return{showToolbar:g}}}]]),t.textModelUpdateOptionsConverters=new Map([["editor.tabSize",{monaco:"tabSize"}],["editor.indentSize",{monaco:"indentSize"}],["editor.insertSpaces",{monaco:"insertSpaces"}],["editor.trimAutoWhitespace",{monaco:"trimAutoWhitespace"}]]),t.diffEditorOptionsConverters=new Map([["diffEditor.enableSplitViewResizing",{monaco:"enableSplitViewResizing"}],["diffEditor.renderSideBySide",{monaco:"renderSideBySide"}],["diffEditor.ignoreTrimWhitespace",{monaco:"ignoreTrimWhitespace"}],["diffEditor.renderIndicators",{monaco:"renderIndicators"}],["diffEditor.originalEditable",{monaco:"originalEditable"}],["diffEditor.minimap",{monaco:"minimap",convert:g=>({enabled:g})}],["diffEditor.experimental.stickyScroll.enabled",{monaco:"experimental",convert:g=>({stickyScroll:{enabled:g}})}],["diffEditor.hideUnchangedRegions.enabled",{monaco:"hideUnchangedRegions",convert:g=>({enabled:g})}],["diffEditor.hideUnchangedRegions.revealLineCount",{monaco:"hideUnchangedRegions",convert:g=>({revealLineCount:g})}],["diffEditor.hideUnchangedRegions.minimumLineCount",{monaco:"hideUnchangedRegions",convert:g=>({minimumLineCount:g})}],["diffEditor.hideUnchangedRegions.contextLineCount",{monaco:"hideUnchangedRegions",convert:g=>({contextLineCount:g})}],["diffEditor.experimental.showMoves",{monaco:"experimental",convert:g=>({showMoves:g})}],["diffEditor.experimental.showEmptyDecorations",{monaco:"experimental",convert:g=>({showEmptyDecorations:g})}]]);function o(g,c){if(c.has(g))return!0;{const h=c.keys();for(const u of h)if(g.startsWith(u))return!0}return!1}function l(g){return o(g,t.editorOptionsConverters)||o(g,t.textModelUpdateOptionsConverters)||o(g,t.diffEditorOptionsConverters)}function m(g){return o(g,t.diffEditorOptionsConverters)}const E=[...t.editorOptionsConverters.keys()],p=[...t.textModelUpdateOptionsConverters.keys()],_=[...t.diffEditorOptionsConverters.keys()];function s(g,c,h,u){const d=c?n.Uri.parse(c):void 0,v=(T,w)=>T.reduce((D,I)=>{const O=g.getValue(I,{resource:d,overrideIdentifier:h});if(O!==void 0){const P=w.get(I);if(!P)return D[I]=O,D;const R=P?P.monaco:I,M=P?.convert?P.convert(O):O;D[R]?Object.assign(D[R],M):D[R]=M}return D},{}),f=u?u.filter(T=>t.editorOptionsConverters.has(T)):[...E],a=u?u.filter(T=>t.textModelUpdateOptionsConverters.has(T)):[...p],b=u?u.filter(T=>t.diffEditorOptionsConverters.has(T)):[..._],y=r(v(f,t.editorOptionsConverters)),S=r(v(a,t.textModelUpdateOptionsConverters)),A=r(v(b,t.diffEditorOptionsConverters));return{editorOptions:y,modelOptions:S,diffOptions:A}}},24328:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorPreferences=t.editorPreferenceSchema=t.DIFF_EDITOR_DEFAULTS=t.EDITOR_DEFAULTS=t.EDITOR_INLINE_SUGGEST_DEFAULTS=t.EDITOR_SUGGEST_DEFAULTS=t.EDITOR_MODEL_DEFAULTS=t.EDITOR_FONT_DEFAULTS=t.USUAL_WORD_SEPARATORS=void 0;const n=e(41869),r=e(82196);t.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";const o="Consolas, 'Courier New', monospace",l="Menlo, Monaco, 'Courier New', monospace",m="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'";t.EDITOR_FONT_DEFAULTS={fontFamily:n.isOSX?l:n.isLinux?m:o,fontWeight:"normal",fontSize:12,tabSize:2,renderWhitespace:!1,cursorStyle:"line",insertSpace:!0,wordWrap:"off",wordWrapColumn:80,lineHeight:0,letterSpacing:0},t.EDITOR_MODEL_DEFAULTS={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},t.EDITOR_SUGGEST_DEFAULTS={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,maxVisibleSuggestions:12,showMethods:!0,showFunctions:!0,showConstructors:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0,detailsVisible:!0,preview:!0,statusBar:{visible:!1}},t.EDITOR_INLINE_SUGGEST_DEFAULTS={enabled:!0,showToolbar:"onHover"},t.EDITOR_DEFAULTS={inDiffEditor:!1,wordSeparators:t.USUAL_WORD_SEPARATORS,lineNumbersMinChars:3,lineDecorationsWidth:10,readOnly:!1,columnSelection:!1,mouseStyle:"text",disableLayerHinting:!1,automaticLayout:!0,wordWrap:"off",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:1,wordWrapBreakBeforeCharacters:"([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B",wordWrapBreakAfterCharacters:" })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63",wordWrapBreakObtrusiveCharacters:".",autoClosingBrackets:"languageDefined",autoClosingQuotes:"languageDefined",autoSurround:"languageDefined",autoIndent:!0,dragAndDrop:!0,emptySelectionClipboard:!0,copyWithSyntaxHighlighting:!0,useTabStops:!0,multiCursorModifier:"altKey",multiCursorMergeOverlapping:!0,accessibilitySupport:"off",showUnused:!0,wrappingStrategy:"simple",viewInfo:{extraEditorClassName:"",disableMonospaceOptimizations:!1,rulers:[],ariaLabel:(0,n.localize)("editorViewAccessibleLabel","Editor Content"),renderLineNumbers:0,renderCustomLineNumbers:null,renderFinalNewline:!0,selectOnLineNumbers:!0,glyphMargin:!0,revealHorizontalRightPadding:30,roundedSelection:!0,overviewRulerLanes:2,overviewRulerBorder:!0,cursorBlinking:1,mouseWheelZoom:!1,cursorSmoothCaretAnimation:!1,cursorStyle:1,cursorWidth:0,hideCursorInOverviewRuler:!1,scrollBeyondLastLine:!0,scrollBeyondLastColumn:5,smoothScrolling:!1,stopRenderingLineAfter:1e4,renderWhitespace:"none",renderControlCharacters:!1,fontLigatures:!1,renderLineHighlight:"none",scrollbar:{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:10,horizontalSliderSize:10,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,mouseWheelScrollSensitivity:1,fastScrollSensitivity:5},minimap:{enabled:!0,side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120},guides:{indentation:!0,highlightActiveIndentGuide:!0,bracketPairs:!0},fixedOverflowWidgets:!0},contribInfo:{selectionClipboard:!0,hover:{enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0},links:!0,contextmenu:!0,quickSuggestions:{other:!0,comments:!1,strings:!1},quickSuggestionsDelay:10,parameterHints:{enabled:!0,cycle:!1},formatOnType:!1,formatOnPaste:!1,suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:"on",acceptSuggestionOnCommitCharacter:!0,wordBasedSuggestions:!1,suggestSelection:"recentlyUsed",suggestFontSize:0,suggestLineHeight:0,tabCompletion:"off",gotoLocation:{multiple:"peek"},selectionHighlight:!0,occurrencesHighlight:!0,codeLens:!0,folding:!0,foldingStrategy:"auto",showFoldingControls:"mouseover",matchBrackets:!0,find:{seedSearchStringFromSelection:!0,autoFindInSelection:!1,globalFindClipboard:!1,addExtraSpaceOnTop:!0},colorDecorators:!0,lightbulbEnabled:r.ShowLightbulbIconMode.On,codeActionsOnSave:{},codeActionsOnSaveTimeout:750}},t.DIFF_EDITOR_DEFAULTS={renderIndicators:!0,minimap:!1,renderSideBySide:!0,ignoreTrimWhitespace:!1,hideUnchangedRegions:{enabled:!0,revealLineCount:20,minimumLineCount:3,contextLineCount:3},experimental:{showMoves:!1,showEmptyDecorations:!0,collapseUnchangedRegions:!0,stickyScroll:{enable:!1}}};const E={"editor.ariaLabel":{type:"string",default:t.EDITOR_DEFAULTS.viewInfo.ariaLabel,description:"%editor.configuration.ariaLabel%"},"editor.extraEditorClassName":{type:"string",description:"%editor.configuration.extraEditorClassName%"},"editor.fixedOverflowWidgets":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.fixedOverflowWidgets,description:"%editor.configuration.fixedOverflowWidgets%"},"editor.revealHorizontalRightPadding":{type:"number",description:"%editor.configuration.revealHorizontalRightPadding%"},"editor.selectOnLineNumbers":{type:"boolean",description:"%editor.configuration.selectOnLineNumbers%"},"editor.wordWrapMinified":{type:"boolean",description:"%editor.configuration.wordWrapMinified%"},"editor.wordWrapBreakAfterCharacters":{type:"string",default:" })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63",description:"%editor.configuration.wordWrapBreakAfterCharacters%"},"editor.wrappingStrategy":{type:"string",enum:["advanced","simple"],default:"simple",description:"%editor.configuration.wrappingStrategy%"},"editor.wordWrapBreakBeforeCharacters":{type:"string",default:"([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B",description:"%editor.configuration.wordWrapBreakBeforeCharacters%"},"editor.lineNumbersMinChars":{type:"number",default:t.EDITOR_DEFAULTS.lineNumbersMinChars,description:"%editor.configuration.lineNumbersMinChars%"},"editor.lineDecorationsWidth":{type:"number",default:t.EDITOR_DEFAULTS.lineDecorationsWidth,description:"%editor.configuration.lineDecorationsWidth%"},"editor.fontFamily":{type:"string",default:t.EDITOR_FONT_DEFAULTS.fontFamily,description:"%editor.configuration.fontFamily%"},"editor.fontWeight":{type:"string",default:t.EDITOR_FONT_DEFAULTS.fontWeight,description:"%editor.configuration.fontWeight%"},"editor.fontSize":{type:"number",default:t.EDITOR_FONT_DEFAULTS.fontSize,description:(0,n.localize)("fontSize","Controls the font size in pixels.")},"editor.lineHeight":{type:"number",default:t.EDITOR_FONT_DEFAULTS.lineHeight,description:(0,n.localize)("lineHeight","Controls the line height. Use 0 to compute the line height from the font size.")},"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[(0,n.localize)("editor.configuration.suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),(0,n.localize)("editor.configuration.suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:"insert",description:"%editor.configuration.suggest.insertMode%"},"editor.suggest.filterGraceful":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.filterGraceful,description:"%editor.configuration.suggest.filterGraceful%"},"editor.suggest.localityBonus":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.localityBonus,description:"%editor.configuration.suggest.localityBonus%"},"editor.suggest.shareSuggestSelections":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.shareSuggestSelections,description:"%editor.configuration.suggest.shareSuggestSelections%"},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.snippetsPreventQuickSuggestions,description:"%editor.configuration.suggest.snippetsPreventQuickSuggestions%"},"editor.suggest.showIcons":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.showIcons,description:"%editor.configuration.suggest.showIcons%"},"editor.suggest.maxVisibleSuggestions":{type:"number",default:t.EDITOR_SUGGEST_DEFAULTS.maxVisibleSuggestions,minimum:1,maximum:15,description:"%editor.configuration.suggest.maxVisibleSuggestions%"},"editor.suggest.showMethods":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showMethods%"},"editor.suggest.showFunctions":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFunctions%"},"editor.suggest.showConstructors":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showConstructors%"},"editor.suggest.showFields":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFields%"},"editor.suggest.showVariables":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showVariables%"},"editor.suggest.showClasses":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showClasss%"},"editor.suggest.showStructs":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showStructs%"},"editor.suggest.showInterfaces":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showInterfaces%"},"editor.suggest.showModules":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showModules%"},"editor.suggest.showProperties":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showPropertys%"},"editor.suggest.showEvents":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showEvents%"},"editor.suggest.showOperators":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showOperators%"},"editor.suggest.showUnits":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showUnits%"},"editor.suggest.showValues":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showValues%"},"editor.suggest.showConstants":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showConstants%"},"editor.suggest.showEnums":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showEnums%"},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showEnumMembers%"},"editor.suggest.showKeywords":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showKeywords%"},"editor.suggest.showWords":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showTexts%"},"editor.suggest.showColors":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showColors%"},"editor.suggest.showFiles":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFiles%"},"editor.suggest.showReferences":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showReferences%"},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showCustomcolors%"},"editor.suggest.showFolders":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFolders%"},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showTypeParameters%"},"editor.suggest.showSnippets":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showSnippets%"},"editor.suggest.showUsers":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showUsers%"},"editor.suggest.showIssues":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showIssues%"},"editor.suggest.statusBar.visible":{type:"boolean",default:!1,description:"%editor.configuration.suggest.statusBar.visible%"},"editor.suggest.preview":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.preview,description:"%editor.configuration.suggest.preview%"},"editor.suggest.details.visible":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.detailsVisible,description:"%editor.configuration.suggest.details.visible%"},"editor.inlineSuggest.enabled":{type:"boolean",default:t.EDITOR_INLINE_SUGGEST_DEFAULTS.enabled,description:"%editor.configuration.inlineSuggest.enabled%"},"editor.inlineSuggest.showToolbar":{type:"string",default:t.EDITOR_INLINE_SUGGEST_DEFAULTS.showToolbar,enum:["always","onHover","never"],enumDescriptions:[(0,n.localize)("editor.configuration.inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),(0,n.localize)("editor.configuration.inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),(0,n.localize)("editor.configuration.inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:"%editor.configuration.inlineSuggest.showToolbar%"},"editor.experimental.stickyScroll.enabled":{type:"boolean",default:!0,description:"%editor.configuration.experimental.stickyScroll%"},"editor.customCodeActionMenu.showHeaders":{type:"boolean",default:!0,description:"%editor.configuration.customCodeActionMenu.showHeaders"},"editor.useCustomCodeActionMenu":{type:"boolean",default:!0,description:"%editor.configuration.useCustomCodeActionMenu%"},"editor.letterSpacing":{type:"number",default:t.EDITOR_FONT_DEFAULTS.letterSpacing,description:"%editor.configuration.letterSpacing%"},"editor.lineNumbers":{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[(0,n.localize)("editor.configuration.lineNumbers.off","Line numbers are not rendered."),(0,n.localize)("editor.configuration.lineNumbers.on","Line numbers are rendered as absolute number."),(0,n.localize)("editor.configuration.lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),(0,n.localize)("editor.configuration.lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:"%editor.configuration.lineNumbers%"},"editor.renderFinalNewline":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.renderFinalNewline,description:"%editor.configuration.renderFinalNewline%"},"editor.rulers":{type:"array",items:{type:"number"},default:t.EDITOR_DEFAULTS.viewInfo.rulers,description:"%editor.configuration.rulers%"},"editor.wordSeparators":{type:"string",default:t.EDITOR_DEFAULTS.wordSeparators,description:"%editor.configuration.wordSeparators%"},"editor.tabSize":{type:"number",default:t.EDITOR_MODEL_DEFAULTS.tabSize,minimum:1,markdownDescription:"%editor.configuration.tabSize%"},"editor.insertSpaces":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.insertSpaces,markdownDescription:"%editor.configuration.insertSpaces%"},"editor.detectIndentation":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.detectIndentation,markdownDescription:"%editor.configuration.detectIndentation%"},"editor.roundedSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.roundedSelection,description:"%editor.configuration.roundedSelection%"},"editor.scrollBeyondLastLine":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.scrollBeyondLastLine,description:"%editor.configuration.scrollBeyondLastLine%"},"editor.scrollBeyondLastColumn":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.scrollBeyondLastColumn,description:"%editor.configuration.scrollBeyondLastColumn%"},"editor.smoothScrolling":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.smoothScrolling,description:"%editor.configuration.smoothScrolling%"},"editor.minimap.enabled":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.minimap.enabled,description:"%editor.configuration.minimap.enabled%"},"editor.minimap.side":{type:"string",enum:["left","right"],default:t.EDITOR_DEFAULTS.viewInfo.minimap.side,description:"%editor.configuration.minimap.side%"},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:t.EDITOR_DEFAULTS.viewInfo.minimap.showSlider,description:"%editor.configuration.minimap.showSlider%"},"editor.minimap.renderCharacters":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.minimap.renderCharacters,description:"%editor.configuration.minimap.renderCharacters%"},"editor.minimap.maxColumn":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.minimap.maxColumn,description:"%editor.configuration.minimap.maxColumn%"},"editor.hover.enabled":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.hover.enabled,description:"%editor.configuration.hover.enabled%"},"editor.hover.delay":{type:"number",default:t.EDITOR_DEFAULTS.contribInfo.hover.delay,description:"%editor.configuration.hover.delay%"},"editor.hover.sticky":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.hover.sticky,description:"%editor.configuration.hover.sticky%"},"editor.hover.hidingDelay":{type:"number",default:t.EDITOR_DEFAULTS.contribInfo.hover.hidingDelay,description:"%editor.configuration.hover.hidingDelay%"},"editor.hover.above":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.hover.above,description:"%editor.configuration.hover.above%"},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,description:"%editor.configuration.find.seedSearchStringFromSelection%"},"editor.find.autoFindInSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection,description:"%editor.configuration.find.autoFindInSelection%"},"editor.find.globalFindClipboard":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.find.globalFindClipboard,description:"%editor.configuration.find.globalFindClipboard%",included:n.isOSX},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:!0,description:"%editor.configuration.find.addExtraSpaceOnTop%"},"editor.wordWrap":{type:"string",enum:["off","on","wordWrapColumn","bounded"],markdownEnumDescriptions:[(0,n.localize)("editor.configuration.wordWrap.off","Lines will never wrap."),(0,n.localize)("editor.configuration.wordWrap.on","Lines will wrap at the viewport width."),(0,n.localize)("editor.configuration.wordWrap.wordWrapColumn","Lines will wrap at `#editor.wordWrapColumn#`."),(0,n.localize)("editor.configuration.wordWrap.bounded","Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],default:t.EDITOR_DEFAULTS.wordWrap,description:"%editor.configuration.wordWrap%"},"editor.wordWrapColumn":{type:"integer",default:t.EDITOR_DEFAULTS.wordWrapColumn,minimum:1,markdownDescription:"%editor.configuration.wordWrapColumn%"},"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[(0,n.localize)("editor.configuration.wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),(0,n.localize)("editor.configuration.wrappingIndent.same","Wrapped lines get the same indentation as the parent."),(0,n.localize)("editor.configuration.wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),(0,n.localize)("editor.configuration.wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],default:"same",description:"%editor.configuration.wrappingIndent%"},"editor.mouseWheelScrollSensitivity":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.scrollbar.mouseWheelScrollSensitivity,markdownDescription:"%editor.configuration.mouseWheelScrollSensitivity%"},"editor.fastScrollSensitivity":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.scrollbar.fastScrollSensitivity,markdownDescription:"%editor.configuration.fastScrollSensitivity%"},"editor.multiCursorModifier":{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[(0,n.localize)("editor.configuration.multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),(0,n.localize)("editor.configuration.multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"alt",markdownDescription:(0,n.localize)("multiCursorModifier","The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")},"editor.multiCursorMergeOverlapping":{type:"boolean",default:t.EDITOR_DEFAULTS.multiCursorMergeOverlapping,description:"%editor.configuration.multiCursorMergeOverlapping%"},"editor.quickSuggestions":{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:!1,description:(0,n.localize)("editor.configuration.quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:!1,description:(0,n.localize)("editor.configuration.quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:!0,description:"%editor.configuration.quickSuggestions.other%"}}}],default:t.EDITOR_DEFAULTS.contribInfo.quickSuggestions,description:"%editor.configuration.quickSuggestions%"},"editor.quickSuggestionsDelay":{type:"integer",default:t.EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay,minimum:0,description:"%editor.configuration.quickSuggestionsDelay%"},"editor.parameterHints.enabled":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.parameterHints.enabled,description:"%editor.configuration.parameterHints.enabled%"},"editor.parameterHints.cycle":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.parameterHints.cycle,description:"%editor.configuration.parameterHints.cycle%"},"editor.autoClosingBrackets":{type:"string",enum:["always","languageDefined","beforeWhitespace","never"],enumDescriptions:["",(0,n.localize)("editor.configuration.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),(0,n.localize)("editor.configuration.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],default:t.EDITOR_DEFAULTS.autoClosingBrackets,description:"%editor.configuration.autoClosingBrackets%"},"editor.autoClosingQuotes":{type:"string",enum:["always","languageDefined","beforeWhitespace","never"],enumDescriptions:["",(0,n.localize)("editor.configuration.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),(0,n.localize)("editor.configuration.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],default:t.EDITOR_DEFAULTS.autoClosingQuotes,description:"%editor.configuration.autoClosingQuotes%"},"editor.autoSurround":{type:"string",enum:["languageDefined","brackets","quotes","never"],enumDescriptions:[(0,n.localize)("editor.configuration.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),(0,n.localize)("editor.configuration.autoSurround.brackets","Surround with brackets but not quotes."),(0,n.localize)("editor.configuration.autoSurround.quotes","Surround with quotes but not brackets."),""],default:t.EDITOR_DEFAULTS.autoSurround,description:"%editor.configuration.autoSurround%"},"editor.formatOnType":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.formatOnType,description:"%editor.configuration.formatOnType%"},"editor.formatOnPaste":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.formatOnPaste,description:"%editor.configuration.formatOnPaste%"},"editor.autoIndent":{type:"boolean",default:t.EDITOR_DEFAULTS.autoIndent,description:"%editor.configuration.autoIndent%"},"editor.suggestOnTriggerCharacters":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters,description:"%editor.configuration.suggestOnTriggerCharacters%"},"editor.acceptSuggestionOnEnter":{type:"string",enum:["on","smart","off"],default:t.EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter,markdownEnumDescriptions:["",(0,n.localize)("editor.configuration.acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:(0,n.localize)("editor.configuration.acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")},"editor.acceptSuggestionOnCommitCharacter":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter,markdownDescription:(0,n.localize)("editor.configuration.acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")},"editor.snippetSuggestions":{type:"string",enum:["top","bottom","inline","none"],enumDescriptions:[(0,n.localize)("editor.configuration.snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),(0,n.localize)("editor.configuration.snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),(0,n.localize)("editor.configuration.snippetSuggestions.inline","Show snippets suggestions with other suggestions."),(0,n.localize)("editor.configuration.snippetSuggestions.none","Do not show snippet suggestions.")],default:"inline",description:"%editor.configuration.snippetSuggestions%"},"editor.emptySelectionClipboard":{type:"boolean",default:t.EDITOR_DEFAULTS.emptySelectionClipboard,description:"%editor.configuration.emptySelectionClipboard%"},"editor.copyWithSyntaxHighlighting":{type:"boolean",default:t.EDITOR_DEFAULTS.copyWithSyntaxHighlighting,description:"%editor.configuration.copyWithSyntaxHighlighting%"},"editor.wordBasedSuggestions":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions,description:"%editor.configuration.wordBasedSuggestions%"},"editor.suggestSelection":{type:"string",enum:["first","recentlyUsed","recentlyUsedByPrefix"],markdownEnumDescriptions:[(0,n.localize)("editor.configuration.suggestSelection.first","Always select the first suggestion."),(0,n.localize)("editor.configuration.suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),(0,n.localize)("editor.configuration.suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],default:"recentlyUsed",description:"%editor.configuration.suggestSelection%"},"editor.suggestFontSize":{type:"integer",default:0,minimum:0,markdownDescription:"%editor.configuration.suggestFontSize%"},"editor.suggestLineHeight":{type:"integer",default:0,minimum:0,markdownDescription:"%editor.configuration.suggestLineHeight%"},"editor.tabCompletion":{type:"string",default:"off",enum:["on","off","onlySnippets"],enumDescriptions:[(0,n.localize)("editor.configuration.tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),(0,n.localize)("editor.configuration.tabCompletion.off","Disable tab completions."),(0,n.localize)("editor.configuration.tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:"%editor.configuration.tabCompletion%"},"editor.suggest.filteredTypes":{type:"object",default:{keyword:!0,snippet:!0},markdownDescription:"%editor.configuration.suggest.filtered%",properties:{method:{type:"boolean",default:!0,markdownDescription:(0,n.localize)("editor.configuration.suggest.filtered.method","When set to `false` IntelliSense never shows `method` suggestions.")},function:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.function%"},constructor:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.constructor%"},field:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.field%"},variable:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.variable%"},class:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.class%"},struct:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.struct%"},interface:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.interface%"},module:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.module%"},property:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.property%"},event:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.event%"},operator:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.operator%"},unit:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.unit%"},value:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.value"},constant:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.constant%"},enum:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.enum%"},enumMember:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.enumMember%"},keyword:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.keyword%"},text:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.text%"},color:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.color%"},file:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.file%"},reference:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.reference%"},customcolor:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.customcolor%"},folder:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.folder%"},typeParameter:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.typeParameter%"},snippet:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.snippet%"}}},"editor.gotoLocation.multiple":{description:"%editor.configuration.editor.gotoLocation.multiple%",type:"string",enum:["peek","gotoAndPeek","goto"],default:t.EDITOR_DEFAULTS.contribInfo.gotoLocation.multiple,enumDescriptions:[(0,n.localize)("editor.configuration.gotoLocation.multiple.peek","Show peek view of the results (default)"),(0,n.localize)("editor.configuration.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),(0,n.localize)("editor.configuration.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},"editor.selectionHighlight":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.selectionHighlight,description:"%editor.configuration.selectionHighlight%"},"editor.columnSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.columnSelection,description:"%editor.configuration.columnSelection%"},"editor.occurrencesHighlight":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,description:"%editor.configuration.occurrencesHighlight%"},"editor.overviewRulerLanes":{type:"integer",default:3,description:"%editor.configuration.overviewRulerLanes%"},"editor.overviewRulerBorder":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.overviewRulerBorder,description:"%editor.configuration.overviewRulerBorder%"},"editor.cursorBlinking":{type:"string",enum:["blink","smooth","phase","expand","solid"],default:"blink",description:"%editor.configuration.cursorBlinking%"},"editor.mouseWheelZoom":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.mouseWheelZoom,markdownDescription:"%editor.configuration.mouseWheelZoom%"},"editor.cursorSmoothCaretAnimation":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.cursorSmoothCaretAnimation,description:"%editor.configuration.cursorSmoothCaretAnimation%"},"editor.cursorStyle":{type:"string",enum:["block","block-outline","line","line-thin","underline","underline-thin"],default:t.EDITOR_FONT_DEFAULTS.cursorStyle,description:"%editor.configuration.cursorStyle%"},"editor.cursorWidth":{type:"integer",default:t.EDITOR_DEFAULTS.viewInfo.cursorWidth,markdownDescription:"%editor.configuration.cursorWidth%"},"editor.fontLigatures":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.fontLigatures,description:"%editor.configuration.fontLigatures%"},"editor.hideCursorInOverviewRuler":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.hideCursorInOverviewRuler,description:"%editor.configuration.hideCursorInOverviewRuler%"},"editor.renderWhitespace":{type:"string",enum:["none","boundary","selection","all"],enumDescriptions:["",(0,n.localize)("editor.configuration.renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),(0,n.localize)("editor.configuration.renderWhitespace.selection","Render whitespace characters only on selected text."),""],default:t.EDITOR_DEFAULTS.viewInfo.renderWhitespace,description:"%editor.configuration.renderWhitespace%"},"editor.rename.enablePreview":{type:"boolean",default:!0,description:"%editor.configuration.rename.enablePreview%"},"editor.renderControlCharacters":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.renderControlCharacters,description:"%editor.configuration.renderControlCharacters%"},"editor.guides.indentation":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.guides.indentation,description:"%editor.configuration.guides.indentation%"},"editor.guides.highlightActiveIndentation":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.guides.highlightActiveIndentGuide,description:"%editor.configuration.guides.highlightActiveIndentation%"},"editor.guides.bracketPairs":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.guides.bracketPairs,description:"%editor.configuration.guides.bracketPairs%"},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],enumDescriptions:["","","",(0,n.localize)("editor.configuration.renderLineHighlight.all","Highlights both the gutter and the current line.")],default:t.EDITOR_DEFAULTS.viewInfo.renderLineHighlight,description:"%editor.configuration.renderLineHighlight%"},"editor.codeLens":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.codeLens,description:"%editor.configuration.codeLens%"},"editor.folding":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.folding,description:"%editor.configuration.folding%"},"editor.foldingStrategy":{type:"string",enum:["auto","indentation"],default:t.EDITOR_DEFAULTS.contribInfo.foldingStrategy,markdownDescription:"%editor.configuration.foldingStrategy%"},"editor.showFoldingControls":{type:"string",enum:["always","mouseover"],default:t.EDITOR_DEFAULTS.contribInfo.showFoldingControls,description:"%editor.configuration.showFoldingControls%"},"editor.matchBrackets":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.matchBrackets,description:"%editor.configuration.matchBrackets%"},"editor.glyphMargin":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.glyphMargin,description:"%editor.configuration.glyphMargin%"},"editor.useTabStops":{type:"boolean",default:t.EDITOR_DEFAULTS.useTabStops,description:"%editor.configuration.useTabStops%"},"editor.trimAutoWhitespace":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,description:"%editor.configuration.trimAutoWhitespace%"},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:"%editor.configuration.stablePeek%"},"editor.dragAndDrop":{type:"boolean",default:t.EDITOR_DEFAULTS.dragAndDrop,description:"%editor.configuration.dragAndDrop%"},"editor.accessibilitySupport":{type:"string",enum:["auto","on","off"],enumDescriptions:[(0,n.localize)("editor.configuration.accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),(0,n.localize)("editor.configuration.accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader."),(0,n.localize)("editor.configuration.accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:t.EDITOR_DEFAULTS.accessibilitySupport,description:(0,n.localize)("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers.")},"editor.showUnused":{type:"boolean",default:t.EDITOR_DEFAULTS.showUnused,description:"%editor.configuration.showUnused%"},"editor.comments.insertSpace":{type:"boolean",default:!0,description:"%editor.configuration.comments.insertSpace%"},"editor.comments.ignoreEmptyLines":{type:"boolean",default:!0,description:"%editor.configuration.comments.ignoreEmptyLines%"},"editor.links":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.links,description:"%editor.configuration.links%"},"editor.colorDecorators":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.colorDecorators,description:"%editor.configuration.colorDecorators%"},"editor.lightbulb.enabled":{type:"string",default:t.EDITOR_DEFAULTS.contribInfo.lightbulbEnabled,enum:[r.ShowLightbulbIconMode.Off,r.ShowLightbulbIconMode.OnCode,r.ShowLightbulbIconMode.On],enumDescriptions:[],description:"%editor.configuration.lightbulb.enabled%"},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:"%editor.configuration.maxTokenizationLineLength%"},"editor.codeActionsOnSave":{type:"object",properties:{"source.organizeImports":{type:"boolean",description:"%editor.configuration.codeActionsOnSave.organizeImports%"},"source.fixAll":{type:"boolean",description:"%editor.configuration.codeActionsOnSave.fixAll%"}},additionalProperties:{type:"boolean"},default:t.EDITOR_DEFAULTS.contribInfo.codeActionsOnSave,description:"%editor.configuration.codeActionsOnSave%"},"editor.codeActionsOnSaveTimeout":{type:"number",default:t.EDITOR_DEFAULTS.contribInfo.codeActionsOnSaveTimeout,description:"%editor.configuration.codeActionsOnSaveTimeout%"},"editor.codeActionsOnSaveNotification":{type:"boolean",default:!0,description:"%editor.configuration.codeActionsOnSaveNotification%"},"editor.selectionClipboard":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.selectionClipboard,description:"%editor.configuration.selectionClipboard%",included:n.isLinux},"editor.largeFileOptimizations":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.largeFileOptimizations,description:"%editor.configuration.largeFileOptimizations%"},"editor.defaultFormatter":{type:"string",description:"%editor.configuration.defaultFormatter%"},"editor.unicodeHighlight.ambiguousCharacters":{type:"boolean",default:!0,description:"%editor.configuration.unicodeHighlight.ambiguousCharacters%"},"editor.unicodeHighlight.allowedCharacters":{type:"object",default:{},description:"%editor.configuration.unicodeHighlight.allowedCharacters%"},"editor.unicodeHighlight.allowedLocales":{type:"object",default:{},description:"%editor.configuration.unicodeHighlight.allowedLocales%"},"diffEditor.renderIndicators":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.renderIndicators,description:"%editor.configuration.renderIndicators%"},"diffEditor.minimap":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.minimap},"diffEditor.experimental.stickyScroll.enabled":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.stickyScroll.enable}},p={"editor.tokenColorCustomizations":{type:"object",description:"%editor.configuration.tokenColorCustomizations%",default:{}},"editor.askIfDiff":{type:"boolean",default:!0,description:"%editor.configuration.askIfDiff%"},"editor.showActionWhenGroupEmpty":{type:"boolean",default:!1,description:"%editor.configuration.showActionWhenGroupEmpty%"},"editor.autoSave":{type:"string",enum:["off","afterDelay","editorFocusChange","windowLostFocus"],default:"off",description:"%editor.configuration.autoSave%"},"editor.autoSaveDelay":{type:"number",default:1e3,markdownDescription:"%editor.configuration.autoSaveDelay%"},"editor.preferredFormatter":{type:"object",default:{},description:"%editor.configuration.preferredFormatter%"},"editor.previewMode":{type:"boolean",default:!0,description:"%editor.configuration.previewMode%"},"editor.preventScrollAfterFocused":{type:"boolean",default:!1,description:"%editor.configuration.preventScrollAfterFocused%"},"editor.wrapTab":{type:"boolean",default:!1,description:"%editor.configuration.wrapTab%"},"editor.enablePreviewFromCodeNavigation":{type:"boolean",default:!1,markdownDescription:"%editor.configuration.enablePreviewFromCodeNavigation%"},"editor.minimap":{type:"boolean",default:!0},"editor.forceReadOnly":{type:"boolean",default:!1,description:"%editor.configuration.forceReadOnly%"},"editor.languageFeatureEnabledMaxSize":{type:"number",default:4*1024*1024*1024,description:"%editor.configuration.languageFeatureEnabledMaxSize%"},"editor.docExtHostSyncMaxSize":{type:"number",default:4*1024*1024*1024,description:"%editor.configuration.docExtHostSyncMaxSize%"},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],default:"all",description:"%editor.configuration.renderLineHighlight%"},"editor.fontFamily":{type:"string",default:t.EDITOR_FONT_DEFAULTS.fontFamily},"editor.fontSize":{type:"number",default:t.EDITOR_FONT_DEFAULTS.fontSize,minimum:6},"editor.tabSize":{type:"number",default:t.EDITOR_FONT_DEFAULTS.tabSize,minimum:1,description:"%editor.configuration.tabSize%"},"editor.formatOnPaste":{type:"boolean",default:!1},"editor.detectIndentation":{type:"boolean",default:!0},"editor.renderWhitespace":{type:"boolean",default:t.EDITOR_FONT_DEFAULTS.renderWhitespace},"editor.cursorStyle":{type:"string",enum:["line","block","block-outline","line-thin","underline","underline-thin"],default:t.EDITOR_FONT_DEFAULTS.cursorStyle},"editor.insertSpaces":{type:"boolean",default:t.EDITOR_FONT_DEFAULTS.insertSpace},"editor.wordWrap":{type:"string",enum:["off","on"],default:t.EDITOR_FONT_DEFAULTS.wordWrap},"editor.wordWrapColumn":{type:"number",default:t.EDITOR_FONT_DEFAULTS.wordWrapColumn,description:"%editor.configuration.wordWrapColumn%"},"editor.readonlyFiles":{type:"array",default:[],items:{type:"string"}},"editor.formatOnSave":{type:"boolean",default:!1,description:"%editor.configuration.formatOnSave%"},"editor.formatOnSaveTimeout":{type:"number",default:750,markdownDescription:"%editor.configuration.formatOnSaveTimeout%"},"editor.lineHeight":{type:"number",default:0,description:"%editor.lineHeight.description%"},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:"%editor.configuration.maxTokenizationLineLength%"},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[(0,n.localize)("editor.configuration.semanticHighlighting.true","Semantic highlighting enabled for all color themes."),(0,n.localize)("editor.configuration.semanticHighlighting.false","Semantic highlighting disabled for all color themes."),(0,n.localize)("editor.configuration.semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:!0,description:"%editor.configuration.semanticHighlighting.enabled%"},"editor.bracketPairColorization.enabled":{type:"boolean",default:!0,description:"%editor.configuration.bracketPairColorization.enabled%"},"editor.largeFile":{type:"number",default:4*1024*1024*1024,description:"%editor.configuration.largeFileSize%"},"editor.quickSuggestionsDelay":{type:"integer",default:100,description:"%editor.configuration.quickSuggestionsDelay%"},"editor.modelDisposeTime":{type:"integer",default:3e3},"workbench.editorAssociations":{type:"object",markdownDescription:"%editor.configuration.workbench.editorAssociations%",default:{},additionalProperties:{type:"string"}},"editor.experimental.stickyScroll.enabled":{type:"boolean",default:!1,description:"%editor.configuration.experimental.stickyScroll.enabled%"},"editor.mouseBackForwardToNavigate":{type:"boolean",default:!0,description:"%editor.configuration.mouseBackForwardToNavigate%"},"diffEditor.renderSideBySide":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.renderSideBySide,description:"%diffEditor.configuration.renderSideBySide%"},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.ignoreTrimWhitespace,description:"%diffEditor.configuration.ignoreTrimWhitespace%"},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.enabled,description:"Controls whether the diff editor shows unchanged regions."},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.revealLineCount,description:"Controls how many lines are used for unchanged regions.",minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.minimumLineCount,description:"Controls how many lines are used as a minimum for unchanged regions.",minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.contextLineCount,description:"Controls how many lines are used as context when comparing unchanged regions.",minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.showMoves,description:"Controls whether the diff editor should show detected code moves."},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.showEmptyDecorations,description:"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted."},"diffEditor.experimental.collapseUnchangedRegions":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.collapseUnchangedRegions,description:"Controls whether the diff editor shows unchanged regions."}};t.editorPreferenceSchema={type:"object",properties:{...E,...p}},t.EditorPreferences=Symbol("EditorPreference")},90915:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorPreferenceProxy=o;const n=e(41869),r=e(24328);function o(l,m,E){return(0,n.createPreferenceProxy)(l,r.editorPreferenceSchema,{resourceUri:m,overrideIdentifier:E})}},53135:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GoToLineQuickOpenHandler=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(74404),m=n.__importStar(e(20868)),E=e(55979),p=e(82196);class _ extends E.AbstractGotoLineQuickAccessProvider{clearDecorations(c){super.clearDecorations(c)}preview(c,h){c.revealRangeInCenter(h,m.editor.ScrollType.Smooth),this.addDecorations(c,h)}goTo(c,h,u=!0){this.gotoLocation({editor:c},{range:h,preserveFocus:u,keyMods:{alt:!1,ctrlCmd:!1}})}}let s=class{constructor(){this.prefix=":",this.description=(0,o.localize)("quickopen.goToLine.desc"),this.quickAccess=new _}getFirstSelection(){const c=this.workbenchEditorService.currentEditor,h=c?.getSelections();return h?.[0]}getRange(c=1,h=1){return{startLineNumber:c,endLineNumber:c,startColumn:h,endColumn:h}}init(){var c;this.savedViewState=(0,o.withNullAsUndefined)((c=this.workbenchEditorService.currentEditor)===null||c===void 0?void 0:c.monacoEditor.saveViewState())}getModel(){var c,h,u,d,v;const f=this.workbenchEditorService.currentEditor,a=this.getFirstSelection();if(!a||!f)return{onType:(A,T)=>{T([new l.QuickOpenItem({label:(0,o.localize)("quickopen.goToLine.notValid"),run:()=>!1})])}};const b=(c=a.positionLineNumber)!==null&&c!==void 0?c:1,y=(h=a.positionColumn)!==null&&h!==void 0?h:1,S=(v=(d=(u=f.currentDocumentModel)===null||u===void 0?void 0:u.getMonacoModel())===null||d===void 0?void 0:d.getLineCount())!==null&&v!==void 0?v:1;return{onType:(A,T)=>{const w=A.split(/,|:|#|:|,/).map(O=>parseInt(O,10)).filter(O=>!isNaN(O)),D=w[0],I=w[1];if(D){let O=(0,o.formatLocalize)("quickopen.goToLine.lineInfo",D);I&&(O+=(0,o.formatLocalize)("quickopen.goToLine.colInfo",I));const P=this.getRange(D,I);T([new l.QuickOpenItem({label:O,run:R=>R===l.Mode.PREVIEW?(this.quickAccess.preview(f.monacoEditor,P),!1):(this.quickAccess.goTo(f.monacoEditor,P,!0),!0)})])}else this.quickAccess.clearDecorations(f.monacoEditor),T([new l.QuickOpenItem({label:(0,o.formatLocalize)("quickopen.goToLine.defaultMessage",b,y,S),run:()=>!1})])}}}getOptions(){return{}}onClose(c){const h=this.workbenchEditorService.currentEditor;h&&(h.monacoEditor.focus(),this.quickAccess.clearDecorations(h.monacoEditor),c&&this.savedViewState&&h.monacoEditor.restoreViewState(this.savedViewState))}};t.GoToLineQuickOpenHandler=s,n.__decorate([(0,r.Autowired)(l.PrefixQuickOpenService),n.__metadata("design:type",Object)],s.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],s.prototype,"workbenchEditorService",void 0),t.GoToLineQuickOpenHandler=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},50236:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolInformationQuickOpenItem=t.WorkspaceSymbolQuickOpenHandler=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(97821),E=e(51500),p=e(40540),_=e(23418);let s=class extends m.QuickOpenBaseAction{constructor(){super({id:"workspace-symbol:splitToRight",tooltip:(0,l.localize)("quickOpen.openOnTheRightSide"),class:(0,o.getIcon)("embed")})}async run(d){await d.openSide()}};s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s);let g=class{hasActions(){return!0}getActions(){return[this.workspaceSymbolOpenSideActionOpen]}};n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s)],g.prototype,"workspaceSymbolOpenSideActionOpen",void 0),g=n.__decorate([(0,r.Injectable)()],g);let c=class{constructor(){this.prefix="#",this.cancellationSource=new o.CancellationTokenSource}get description(){return(0,l.localize)("editor.workspaceSymbol.description")}getModel(){return{onType:(d,v)=>{if(d===""){v([new o.QuickOpenItem({label:(0,l.localize)("editor.workspaceSymbol.search"),run:()=>!1})]);return}if(d==="#")return void v([new o.QuickOpenItem({label:(0,l.localize)("editor.workspaceSymbolClass.search"),run:()=>!1})]);if(this.languageService.workspaceSymbolProviders.length===0){v([new o.QuickOpenItem({label:(0,l.localize)("editor.workspaceSymbol.notfound"),run:()=>!1})]);return}const f=d[0]==="#",a=[];this.cancellationSource.cancel();const b=new o.CancellationTokenSource;this.cancellationSource=b;const y={query:f?d.slice(1):d},S=this.reporterService.time(l.REPORT_NAME.QUICK_OPEN_MEASURE);Promise.all(this.languageService.workspaceSymbolProviders.map(async A=>{let T=await A.provideWorkspaceSymbols(y,b.token);if(f&&(T=T?.filter(w=>w.kind===p.SymbolKind.Class)),T&&T.length&&!b.token.isCancellationRequested){const w=await Promise.all(T.map(async D=>{const I=await this.workspaceService.asRelativePath(new o.URI(D.location.uri).parent);return new h(D,A,this.workbenchEditorService,b.token,I?.path||"")}));a.push(...w),v(a,this.workspaceSymbolActionProvider)}return T})).catch(A=>{this.logger.log(A)}).finally(()=>{b.token.isCancellationRequested||(a.length||v([]),S.timeEnd(f?"class":"symbol",{lookFor:d,stat:{symbol:a.length}}))})}}}getOptions(){return{fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},showItemsWithoutHighlight:!0,fuzzyMatchDescription:!1,getPlaceholderItem:(d,v)=>new o.QuickOpenItem({label:(0,l.localize)(v.startsWith("##")?"editor.workspaceSymbolClass.notfound":"editor.workspaceSymbol.notfound"),run:()=>!1})}}onClose(){this.cancellationSource.cancel()}onToggle(){this.cancellationSource.cancel()}};t.WorkspaceSymbolQuickOpenHandler=c,n.__decorate([(0,r.Autowired)(_.ILanguageService),n.__metadata("design:type",Object)],c.prototype,"languageService",void 0),n.__decorate([(0,r.Autowired)(E.IWorkspaceService),n.__metadata("design:type",Object)],c.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],c.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],c.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",g)],c.prototype,"workspaceSymbolActionProvider",void 0),n.__decorate([(0,r.Autowired)(l.IReporterService),n.__metadata("design:type",Object)],c.prototype,"reporterService",void 0),t.WorkspaceSymbolQuickOpenHandler=c=n.__decorate([(0,r.Injectable)()],c);class h extends o.QuickOpenItem{constructor(d,v,f,a,b){super({}),this.symbol=d,this.provider=v,this.workbenchEditorService=f,this.token=a,this.relativePath=b}getLabel(){return this.symbol.name}getUri(){return new o.URI(this.symbol.location.uri)}getIconClass(){return(0,o.getSymbolIcon)(this.symbol.kind)}getDescription(){const d=this.symbol.containerName;return`${d?`${d} \xB7 `:""}${decodeURIComponent(this.relativePath)}`}fromRange(d){if(!d)return;const{start:v,end:f}=d;return{startLineNumber:v.line+1,startColumn:v.character+1,endLineNumber:f.line+1,endColumn:f.character+1}}open(d,v){this.workbenchEditorService.open(d,{range:this.fromRange(v)})}run(d){const v=this.getUri();return d===o.QuickOpenMode.OPEN&&this.provider.resolveWorkspaceSymbol(this.symbol,this.token).then(f=>{f?this.open(v,f.location.range):this.open(v,this.symbol.location.range)}),!0}openSide(){const d=this.getUri();return this.provider.resolveWorkspaceSymbol(this.symbol,this.token).then(v=>{this.workbenchEditorService.open(d,{preview:!1,split:_.EditorGroupSplitAction.Right,range:this.fromRange(v?v.location.range:this.symbol.location.range),focus:!0})})}}t.SymbolInformationQuickOpenItem=h},80200:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(23418),{addElement:E}=l.arrays;let p=class extends o.WithEventBus{constructor(){super(),this.providers=[],this.resources=new Map,this.gettingResources=new Map,this.resourceDecoration=new Map,this.cachedProvider=new l.LRUMap(500,200),this.onRegisterResourceProviderEmitter=new l.Emitter,this.onRegisterResourceProvider=this.onRegisterResourceProviderEmitter.event,this.onUnregisterResourceProviderEmitter=new l.Emitter,this.onUnregisterResourceProvider=this.onUnregisterResourceProviderEmitter.event}onResourceNeedUpdateEvent(c){const h=c.payload;if(this.resources.has(h.toString())){const u=this.resources.get(h.toString());this.doGetResource(h).then(d=>{u&&(Object.assign(u?.resource,d?.resource),u.provider=d?.provider),this.eventBus.fire(new m.ResourceDidUpdateEvent(h))})}}onResourceDecorationNeedChangeEvent(c){this.getResourceDecoration(c.payload.uri);let h=!1;const u=this.resourceDecoration.get(c.payload.uri.toString())||{};new Set([...Object.keys(u),...Object.keys(c.payload.decoration)]).forEach(d=>{u[d]!==c.payload.decoration[d]&&(h=!0)}),h&&(Object.assign(this.resourceDecoration.get(c.payload.uri.toString()),c.payload.decoration),this.eventBus.fire(new m.ResourceDecorationChangeEvent(c.payload)))}getSupportedSchemes(){return Array.from(this.providers.values()).map(c=>c.scheme).filter(Boolean)}async getResource(c){if(!this.resources.has(c.toString())){const h=await this.doGetResource(c);if(!h)return null;const u={resource:h.resource,provider:h.provider};this.resources.set(c.toString(),u)}return this.resources.get(c.toString()).resource}handlesUri(c){return!!this.calculateProvider(c)}async doGetResource(c){if(!this.gettingResources.has(c.toString())){const h=(async()=>{const u=this.calculateProvider(c);if(u){const d=await u.provideResource(c);return d.uri=c,{resource:d,provider:u}}else return this.logger.error("URI has no resource provider: "+c),null})();this.gettingResources.set(c.toString(),h),h.finally(()=>{this.gettingResources.delete(c.toString())})}return this.gettingResources.get(c.toString())}registerResourceProvider(c){this.onRegisterResourceProviderEmitter.fire(c);const h=new l.Disposable;return h.addDispose(E(this.providers,c)),h.addDispose({dispose:()=>{for(const u of this.resources.values())u.provider===c&&(u.provider=s,this.onUnregisterResourceProviderEmitter.fire(c));this.cachedProvider.clear()}}),this.cachedProvider.clear(),h}async shouldCloseResource(c,h){const u=this.getProvider(c.uri);return!u||!u.shouldCloseResource?!0:await u.shouldCloseResource(c,h)}async shouldCloseResourceWithoutConfirm(c){const h=this.getProvider(c.uri);return h&&h.shouldCloseResourceWithoutConfirm?await h.shouldCloseResourceWithoutConfirm(c):!1}async close(c,h){const u=this.getProvider(c.uri);return!u||!u.close?!0:await u.close(c,h)}calculateProvider(c){if(this.cachedProvider.has(c.toString()))return this.cachedProvider.get(c.toString());let h,u={weight:-1,index:-1};function d(v,f,a){u={weight:f,index:a},h=v}return this.providers.forEach((v,f)=>{let a=-1;v.handlesUri?a=v.handlesUri(c):v.scheme&&(a=v.scheme===c.scheme?10:-1),a>=0&&(a>u.weight||a===u.weight&&f>u.index)&&d(v,a,f)}),this.cachedProvider.set(c.toString(),h),h}getProvider(c){const h=this.resources.get(c.toString());if(h)return h.provider}getResourceDecoration(c){return this.resourceDecoration.has(c.toString())||this.resourceDecoration.set(c.toString(),{..._}),this.resourceDecoration.get(c.toString())}getResourceSubname(c,h){const u=this.getProvider(c.uri);return u&&u.provideResourceSubname?u.provideResourceSubname(c,h):null}disposeResource(c){const h=this.getProvider(c.uri);if(this.resources.delete(c.uri.toString()),this.resourceDecoration.delete(c.uri.toString()),!(!h||!h.onDisposeResource))return h.onDisposeResource(c)}};t.ResourceServiceImpl=p,n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),n.__decorate([(0,o.OnEvent)(m.ResourceNeedUpdateEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.ResourceNeedUpdateEvent]),n.__metadata("design:returntype",void 0)],p.prototype,"onResourceNeedUpdateEvent",null),n.__decorate([(0,o.OnEvent)(m.ResourceDecorationNeedChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.ResourceDecorationNeedChangeEvent]),n.__metadata("design:returntype",void 0)],p.prototype,"onResourceDecorationNeedChangeEvent",null),t.ResourceServiceImpl=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p);const _={dirty:!1,readOnly:!1},s={handlesUri:()=>-1,provideResource:g=>({uri:g,name:"",icon:""})}},52795:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorActions=t.Tabs=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),m=e(25918),E=e(1149),p=e(63373),_=e(93899),s=e(48560),g=e(43718),c=e(23418),h=e(19352),u=n.__importDefault(e(62711)),d=e(78680),v=e(82196),f=e(50674),a=e(72570).UU,b=({group:S})=>{const A=(0,o.useRef)(),T=(0,o.useRef)(),w=(0,o.useRef)(),D=(0,o.useRef)(null),I=(0,o.useRef)(null),O=(0,s.useInjectable)(c.ResourceService),P=(0,s.useInjectable)(l.IEventBus),R=(0,o.useContext)(l.ConfigContext),M=(0,s.useInjectable)(c.WorkbenchEditorService),k=(0,s.useInjectable)(d.TabTitleMenuService),B=(0,s.useInjectable)(l.PreferenceService),x=(0,s.useInjectable)(_.IMenuRegistry),N=(0,s.useInjectable)(v.IEditorTabService),j=(0,s.useInjectable)(E.LayoutViewSizeConfig),K=(0,s.useInjectable)(l.ComponentRegistry),U=(0,l.useDesignStyles)(u.default.tab_right,"tab_right"),Y=(0,l.useDesignStyles)(u.default.close_tab,"close_tab"),z=(0,l.useDesignStyles)(u.default.kt_editor_close_icon,"kt_editor_close_icon"),G=(0,l.useDesignStyles)(u.default.kt_editor_tabs_content,"kt_editor_tabs_content"),Q=(0,l.useDesignStyles)(u.default.kt_editor_tabs_current_last,"kt_editor_tabs_current_last"),Z=(0,l.useDesignStyles)(u.default.kt_editor_tab,"kt_editor_tab"),$=(0,l.useDesignStyles)(u.default.kt_editor_tab_current_prev,"kt_editor_tab_current_prev"),H=(0,l.useDesignStyles)(u.default.kt_editor_tab_current_next,"kt_editor_tab_current_next"),X=(0,l.useDesignStyles)(u.default.kt_editor_tab_current,"kt_editor_tab_current"),J=(0,l.useDesignStyles)(u.default.kt_editor_tab_dirty,"kt_editor_tab_dirty"),re=(0,l.useDesignStyles)(u.default.kt_editor_tabs,"kt_editor_tabs"),ce=(0,l.useDesignStyles)(u.default.kt_editor_tabs_scroll_wrapper,"kt_editor_tabs_scroll_wrapper"),[fe,Ae]=(0,o.useState)({}),[te,Le]=(0,o.useState)(!!B.get("editor.wrapTab")),[Te,oe]=(0,o.useState)(new Map),[le,Ee]=(0,o.useState)(),we=(0,o.useMemo)(()=>(0,l.getSlotLocation)(a,R.layoutConfig),[]),ve=o.default.useMemo(()=>{var Be,ze;const Qe=(ze=(Be=K.getComponentRegistryInfo(c.TabbarRightExtraContentId))===null||Be===void 0?void 0:Be.views)===null||ze===void 0?void 0:ze[0];if(Qe)return Qe},[]);(0,f.useUpdateOnGroupTabChange)(S),(0,s.useUpdateOnEventBusEvent)(c.ResourceDidUpdateEvent,[S.resources],Be=>!!w&&S.resources.findIndex(ze=>ze.uri.isEqual(Be))!==-1),(0,o.useEffect)(()=>{const Be=new l.Disposable;return Be.addDispose(S.onDidEditorGroupContentLoading(ze=>{var Qe;(Qe=S.resourceStatus.get(ze))===null||Qe===void 0||Qe.finally(()=>{Ae(Object.assign({},fe,{[ze.uri.toString()]:!1}))}),Ae(Object.assign({},fe,{[ze.uri.toString()]:!0}))})),Be.addDispose(S.onDidEditorGroupTabChanged(()=>{te||Ce()})),()=>{Be.dispose()}},[S]);const be=(0,o.useCallback)((Be,ze,Qe)=>{if(Be.dataTransfer.getData("uri")){const He=new l.URI(Be.dataTransfer.getData("uri"));let vt;Be.dataTransfer.getData("uri-source-group")&&(vt=M.getEditorGroup(Be.dataTransfer.getData("uri-source-group"))),S.dropUri(He,v.DragOverPosition.CENTER,vt,Qe)}Be.dataTransfer.files.length>0&&P.fire(new v.EditorGroupFileDropEvent({group:S,tabIndex:ze,files:Be.dataTransfer.files}))},[S]),Ce=(0,o.useCallback)(()=>{l.fastdom.measure(()=>{try{if(A.current&&S.currentResource){const Be=A.current.querySelector("."+u.default.kt_editor_tab+"[data-uri='"+S.currentResource.uri.toString()+"']");Be&&Be.scrollIntoView({block:"nearest",inline:"nearest"})}}catch{}})},[S,A.current]),Ne=(0,o.useCallback)(()=>{D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{l.fastdom.measure(()=>{var Be;const ze=(Be=I.current)===null||Be===void 0?void 0:Be.offsetWidth;ze!==le&&Ee(ze)})},200)},[I.current,D.current,le]);(0,o.useEffect)(()=>{te||queueMicrotask(()=>{Ce()})},[te,A.current]),(0,o.useEffect)(()=>{if(!te){const Be=new l.Disposable;return A.current&&Be.addDispose(new l.DomListener(A.current,"mousewheel",y)),Be.addDispose(P.onDirective(l.ResizeEvent.createDirective(we),()=>{Ce()})),Be.addDispose(P.onDirective(v.GridResizeEvent.createDirective(S.grid.uid),()=>{Ce()})),()=>{Be.dispose()}}},[te]);const tt=(0,o.useCallback)(()=>{l.fastdom.measureAtNextFrame(()=>{if(w.current&&te){const Be=new Map;let ze,Qe;const He=Array.from(w.current.children);He.pop(),He.forEach(vt=>{vt.offsetTop!==ze&&(ze=vt.offsetTop,Qe&&Be.set(He.indexOf(Qe),!0)),Qe=vt,Be.set(He.indexOf(vt),!1)}),oe(Be)}})},[w.current,te]);(0,o.useEffect)(()=>{Ne()},[I.current,te]),(0,o.useEffect)(tt,[te,w.current,S,S.resources.length]),(0,o.useEffect)(()=>{const Be=new l.DisposableCollection;return Be.push(P.onDirective(l.ResizeEvent.createDirective(we),()=>{tt()})),Be.push(B.onPreferenceChanged(ze=>{ze.preferenceName==="editor.wrapTab"&&Le(!!ze.newValue)})),Be.push(M.onDidCurrentEditorGroupChanged(()=>{Ne()})),Be.push(l.Event.debounce(l.Event.filter(x.onDidChangeMenu,ze=>ze===_.MenuId.EditorTitle),()=>{},200)(()=>{Ne()})),()=>{Be.dispose()}},[]),(0,o.useEffect)(()=>{const Be=new l.DisposableCollection;return Be.push(S.onDidEditorFocusChange(()=>{Ne()})),()=>{Be.dispose()}},[S]);const Fe=(0,o.useCallback)(Be=>{Be.preventDefault(),Be.stopPropagation(),T.current&&T.current.classList.add(u.default.kt_on_drag_over)},[T.current]),$e=(0,o.useCallback)(Be=>{T.current&&T.current.classList.remove(u.default.kt_on_drag_over)},[T.current]),Se=(0,o.useCallback)(Be=>{T.current&&T.current.classList.remove(u.default.kt_on_drag_over),be&&be(Be,-1)},[be,T.current]),ae=(0,o.useCallback)(Be=>{Be.target===Be.currentTarget&&M.createUntitledResource()},[M]),ye=o.default.useCallback((Be,ze)=>{const Qe=O.getResourceDecoration(Be.uri),He=O.getResourceSubname(Be,S.resources);return N.renderEditorTab(o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:fe[Be.uri.toString()]?"loading_indicator":(0,r.default)(Be.icon)}," "),o.default.createElement("div",{tabIndex:0,role:"tab","aria-selected":ze?"true":"false"},Be.name),He?o.default.createElement("div",{className:u.default.subname},He):null,Qe.readOnly?o.default.createElement("span",{className:(0,r.default)((0,l.getExternalIcon)("lock"),u.default.editor_readonly_icon)}):null,o.default.createElement("div",{className:U},o.default.createElement("div",{className:(0,r.default)({[u.default.kt_hidden]:!Qe.dirty,[u.default.dirty]:!0})}),o.default.createElement("div",{className:Y,onMouseDown:vt=>{vt.stopPropagation(),S.close(Be.uri)}},N.renderTabCloseComponent(o.default.createElement("div",{className:(0,r.default)((0,l.getIcon)("close"),z),tabIndex:0,role:"button","aria-label":(0,g.formatLocalize)("editor.closeTab.title",Be.name)}))))),ze)},[N]),Re=()=>{const Be=S.resources.length===0,ze=S.resources.findIndex(Qe=>S.currentResource===Qe);return o.default.createElement("div",{draggable:!1,className:(0,r.default)({[G]:!0,[u.default.kt_editor_tabs_content_empty]:Be,[Q]:ze===S.resources.length-1}),ref:w,role:"tablist"},S.resources.map((Qe,He)=>{let vt;const at=O.getResourceDecoration(Qe.uri);return o.default.createElement("div",{draggable:!0,title:Qe.title,className:(0,r.default)({[Z]:!0,[u.default.last_in_row]:Te.get(He),[$]:ze-1===He,[H]:ze+1===He,[X]:S.currentResource===Qe,[u.default.kt_editor_tab_preview]:S.previewURI&&S.previewURI.isEqual(Qe.uri),[J]:at.dirty}),style:te&&He===S.resources.length-1?{marginRight:le,height:j.editorTabsHeight}:{height:j.editorTabsHeight},onContextMenu:It=>{k.show(It.nativeEvent.x,It.nativeEvent.y,Qe&&Qe.uri,S),It.preventDefault()},key:Qe.uri.toString(),onMouseUp:It=>{It.nativeEvent.button===l.MouseEventButton.Middle&&(It.preventDefault(),It.stopPropagation(),S.close(Qe.uri))},onMouseDown:It=>{It.nativeEvent.button===l.MouseEventButton.Left&&S.open(Qe.uri,{focus:!0})},"data-uri":Qe.uri.toString(),onDragOver:It=>{It.preventDefault(),It.stopPropagation(),vt&&vt.classList.add(u.default.kt_on_drag_over)},onDragLeave:It=>{vt&&vt.classList.remove(u.default.kt_on_drag_over)},onDrop:It=>{vt&&vt.classList.remove(u.default.kt_on_drag_over),be&&be(It,He,Qe)},onDoubleClick:It=>{S.pinPreviewed(Qe.uri)},ref:It=>vt=It,onDragStart:It=>{It.dataTransfer.setData("uri",Qe.uri.toString()),It.dataTransfer.setData("uri-source-group",S.name)}},ye(Qe,S.currentResource===Qe))}))};return o.default.createElement("div",{id:p.VIEW_CONTAINERS.EDITOR_TABS,className:re},o.default.createElement("div",{className:ce,ref:T,onDragOver:Fe,onDragLeave:$e,onDrop:Se,onDoubleClick:ae},te?o.default.createElement("div",{className:u.default.kt_editor_wrap_container},Re()):o.default.createElement(h.Scroll,{forwardedRef:Be=>Be?A.current=Be:null,className:u.default.kt_editor_tabs_scroll},Re())),o.default.createElement(t.EditorActions,{className:(0,r.default)({[u.default.kt_editor_wrap_mode_action]:te}),ref:I,group:S}),(0,l.renderView)(ve))};t.Tabs=b,t.EditorActions=(0,o.forwardRef)((S,A)=>{const T=(0,l.useDesignStyles)(u.default.editor_actions,"editor_actions"),{group:w,className:D}=S,I=(0,o.useCallback)(()=>{var K,U;return w.currentResource?[w.currentResource.uri,w,((K=w.currentOrPreviousFocusedEditor)===null||K===void 0?void 0:K.currentUri)||((U=w.currentEditor)===null||U===void 0?void 0:U.currentUri)]:void 0},[w]),O=(0,s.useInjectable)(v.IEditorActionRegistry),P=(0,s.useInjectable)(c.WorkbenchEditorService),R=(0,s.useInjectable)(E.LayoutViewSizeConfig),M=O.getMenu(w),[k,B]=(0,o.useState)(P.currentEditorGroup===w),[x,N]=(0,o.useState)(I()),j=M.getMergedMenuNodes().length===0;return(0,o.useEffect)(()=>{const K=new l.DisposableCollection;return K.push(P.onDidCurrentEditorGroupChanged(()=>{B(P.currentEditorGroup===w)})),K.push(P.onActiveResourceChange(()=>{N(I())})),K.push(w.onDidEditorGroupTabChanged(()=>{N(I())})),()=>{K.dispose()}},[w]),o.default.createElement("div",{ref:A,className:(0,r.default)(T,D,{[u.default.editor_actions_no_actions]:j}),style:{height:R.editorTabsHeight}},o.default.createElement(m.InlineMenuBar,{menus:M,context:x,regroup:(K,U)=>k?[K,U]:[[],U]}))});function y(S){(this.offsetWidth+this.scrollLeft+S.deltaX>this.scrollWidth||this.scrollLeft+S.deltaX<0)&&S.preventDefault()}},82196:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEditorTabService=t.ResoucesOfActiveComponentChangedEvent=t.CodeEditorDidVisibleEvent=t.EditorComponentDisposeEvent=t.ResourceOpenTypeChangedEvent=t.IEditorFeatureRegistry=t.IBreadCrumbService=t.CompareResult=t.ICompareService=t.IEditorActionRegistry=t.EditorDecorationTypeRemovedEvent=t.EditorDecorationChangeEvent=t.EditorDecorationProviderRegistrationEvent=t.RegisterEditorSideComponentEvent=t.EditorGroupsResetSizeEvent=t.EditorGroupIndexChangedEvent=t.EditorConfigurationChangedEvent=t.EditorVisibleChangeEvent=t.EditorSelectionChangeEvent=t.IEditorDecorationCollectionService=t.EditorGroupFileDropEvent=t.EditorActiveResourceStateChangedEvent=t.EditorGroupChangeEvent=t.EditorGroupDisposeEvent=t.EditorGroupCloseEvent=t.EditorGroupOpenEvent=t.GridResizeEvent=t.BrowserEditorContribution=t.EditorComponentRegistry=t.RegisterEditorComponentEvent=t.RegisterEditorComponentResolverEvent=t.EditorComponentRenderMode=void 0;const n=e(85608),r=e(41869);n.__exportStar(e(23418),t);var o;(function(R){R[R.ONE_PER_RESOURCE=1]="ONE_PER_RESOURCE",R[R.ONE_PER_GROUP=2]="ONE_PER_GROUP",R[R.ONE_PER_WORKBENCH=3]="ONE_PER_WORKBENCH"})(o||(t.EditorComponentRenderMode=o={}));class l extends r.BasicEvent{}t.RegisterEditorComponentResolverEvent=l;class m extends r.BasicEvent{}t.RegisterEditorComponentEvent=m;class E{}t.EditorComponentRegistry=E,t.BrowserEditorContribution=Symbol("BrowserEditorContribution");class p extends r.BasicEvent{static createDirective(M){return`grid-resize-${M}`}}t.GridResizeEvent=p;class _ extends r.BasicEvent{}t.EditorGroupOpenEvent=_;class s extends r.BasicEvent{}t.EditorGroupCloseEvent=s;class g extends r.BasicEvent{}t.EditorGroupDisposeEvent=g;class c extends r.BasicEvent{}t.EditorGroupChangeEvent=c;class h extends r.BasicEvent{}t.EditorActiveResourceStateChangedEvent=h;class u extends r.BasicEvent{}t.EditorGroupFileDropEvent=u,t.IEditorDecorationCollectionService=Symbol("IEditorDecorationCollectionService");class d extends r.BasicEvent{}t.EditorSelectionChangeEvent=d;class v extends r.BasicEvent{}t.EditorVisibleChangeEvent=v;class f extends r.BasicEvent{}t.EditorConfigurationChangedEvent=f;class a extends r.BasicEvent{}t.EditorGroupIndexChangedEvent=a;class b extends r.BasicEvent{}t.EditorGroupsResetSizeEvent=b;class y extends r.BasicEvent{}t.RegisterEditorSideComponentEvent=y;class S extends r.BasicEvent{}t.EditorDecorationProviderRegistrationEvent=S;class A extends r.BasicEvent{}t.EditorDecorationChangeEvent=A;class T extends r.BasicEvent{}t.EditorDecorationTypeRemovedEvent=T,t.IEditorActionRegistry=Symbol("IEditorActionRegistry"),t.ICompareService=Symbol("ICompareService");var w;(function(R){R.revert="revert",R.accept="accept",R.cancel="cancel"})(w||(t.CompareResult=w={})),t.IBreadCrumbService=Symbol("IBreadScrumbService"),t.IEditorFeatureRegistry=Symbol("IEditorFeatureRegistry");class D extends r.BasicEvent{}t.ResourceOpenTypeChangedEvent=D;class I extends r.BasicEvent{}t.EditorComponentDisposeEvent=I;class O extends r.BasicEvent{}t.CodeEditorDidVisibleEvent=O;class P extends r.BasicEvent{}t.ResoucesOfActiveComponentChangedEvent=P,t.IEditorTabService=Symbol("IEditorTabService")},17878:(L,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UntitledSchemeResourceProvider=t.UntitledSchemeDocumentProvider=t.UntitledDocumentIdCounter=void 0;const r=e(85608),o=e(76003),l=e(41869),m=e(72665),E=e(51500),p=e(23418),_=e(96689);let s=n=class{constructor(){this._id=1}async update(){this._id=await this.getLatestUnitiedIndex()}async getLatestUnitiedIndex(u){var d;await this.workspaceService.whenReady;const a=(u||((d=this.workspaceService.workspace)===null||d===void 0?void 0:d.children)||[]).filter(b=>l.URI.file(b.uri).displayName.startsWith(n.UNTITLED_FILE_NAME_PREFIX)).map(b=>{const y=l.URI.file(b.uri).displayName.match(new RegExp(`^${n.UNTITLED_FILE_NAME_PREFIX}(\\d+)`,"i"));return y?parseInt(y[1],10):-1}).filter(b=>b!==-1);return a.length>0?Math.max(...a)+1:1}get id(){return this._id++}};t.UntitledDocumentIdCounter=s,s.UNTITLED_FILE_NAME_PREFIX="Untitled-",r.__decorate([(0,o.Autowired)(E.IWorkspaceService),r.__metadata("design:type",Object)],s.prototype,"workspaceService",void 0),t.UntitledDocumentIdCounter=s=n=r.__decorate([(0,o.Injectable)()],s);let g=class{constructor(){this._onDidChangeContent=new l.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(u){return u===l.Schemes.untitled}async provideEncoding(u){return this.preferenceService.get("files.encoding",void 0,u.toString(),(0,l.getLanguageIdFromMonaco)(u))||"utf8"}async provideEOL(u){const d=await this.applicationService.getBackendOS(),v=this.preferenceService.get("files.eol","auto",u.toString(),(0,l.getLanguageIdFromMonaco)(u));return v!=="auto"?v:d===l.OperatingSystem.Windows?`\r
|
|
28373
28373
|
`:`
|
|
28374
|
-
`}async provideEditorDocumentModelContent(u,d){return""}isReadonly(u){return!1}isAlwaysDirty(u){return!0}disposeEvenDirty(u){return!0}closeAutoSave(u){return!0}async saveDocumentModel(u,d,v,f,a,b=!1){const{name:y}=u.getParsedQuery(),S=u.path.toString()!=="/"?l.path.dirname(u.path.toString()):this.appConfig.workspaceDir,A=await this.commandService.tryExecuteCommand("file.save",{showNameInput:!0,defaultFileName:y||u.displayName,defaultUri:l.URI.file(l.isWindows?S.replaceAll("\\","/"):S)});return A&&(await this.editorDocumentModelService.saveEditorDocumentModel(A,d,v,f,a,b),await this.workbenchEditorService.open(A,{preview:!1,focus:!0,replace:!0,forceClose:!0})),{state:l.SaveTaskResponseState.SUCCESS}}onDidDisposeModel(){}};t.UntitledSchemeDocumentProvider=g,r.__decorate([(0,o.Autowired)(_.IEditorDocumentModelService),r.__metadata("design:type",Object)],g.prototype,"editorDocumentModelService",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",p.WorkbenchEditorService)],g.prototype,"workbenchEditorService",void 0),r.__decorate([(0,o.Autowired)(l.CommandService),r.__metadata("design:type",Object)],g.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(l.IApplicationService),r.__metadata("design:type",Object)],g.prototype,"applicationService",void 0),r.__decorate([(0,o.Autowired)(s),r.__metadata("design:type",s)],g.prototype,"untitledIndex",void 0),r.__decorate([(0,o.Autowired)(l.PreferenceService),r.__metadata("design:type",Object)],g.prototype,"preferenceService",void 0),t.UntitledSchemeDocumentProvider=g=r.__decorate([(0,o.Injectable)()],g);let c=class extends l.WithEventBus{constructor(){super(...arguments),this.scheme=l.Schemes.untitled}provideResource(u){const{name:d}=u.getParsedQuery();return{name:d||u.displayName,uri:u,icon:"",metadata:null}}async shouldCloseResourceWithoutConfirm(u){const d=this.documentModelService.getModelDescription(u.uri,"close-resource-check");return!!(d&&d.dirty)}async close(u,d){const v=this.documentModelService.getModelReference(u.uri,"close-resource-check");if(!v)return!1;if(d===p.AskSaveResult.SAVE){const f=await v.instance.save();return v.dispose(),f}else return d===p.AskSaveResult.REVERT?(await v.instance.revert(),v.dispose(),!0):!d||d===p.AskSaveResult.CANCEL?(v.dispose(),!1):(v.dispose(),!0)}async shouldCloseResource(u){const d=this.documentModelService.getModelDescription(u.uri,"close-resource-check");if(!d||!d.dirty)return!0;const v={[(0,l.localize)("file.prompt.dontSave","Don't Save")]:p.AskSaveResult.REVERT,[(0,l.localize)("file.prompt.save","Save")]:p.AskSaveResult.SAVE,[(0,l.localize)("file.prompt.cancel","Cancel")]:p.AskSaveResult.CANCEL},f=await this.dialogService.open({message:(0,l.formatLocalize)("saveChangesMessage",u.name),type:l.MessageType.Info,buttons:Object.keys(v)});return await this.close(u,v[f])}};t.UntitledSchemeResourceProvider=c,r.__decorate([(0,o.Autowired)(m.IDialogService),r.__metadata("design:type",Object)],c.prototype,"dialogService",void 0),r.__decorate([(0,o.Autowired)(_.IEditorDocumentModelService),r.__metadata("design:type",Object)],c.prototype,"documentModelService",void 0),t.UntitledSchemeResourceProvider=c=r.__decorate([(0,o.Injectable)()],c)},33835:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditor=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(23418),m=e(96689),E=p=>{const _=r.default.useRef(),s=(0,o.useInjectable)(l.EditorCollectionService),g=(0,o.useInjectable)(m.IEditorDocumentModelService),[c,h]=r.default.useState(void 0),[u,d]=r.default.useState(void 0),[v,f]=r.default.useState(void 0),[a,b]=r.default.useState(void 0);let y=!1;return r.default.useEffect(()=>{if(_.current){c&&c.dispose();const S=s.createCodeEditor(_.current,{automaticLayout:!0,...p.options});h(S),u&&S.open(u)}return()=>{y=!0,c&&c.dispose(),u&&u.dispose()}},[_.current]),p&&c&&p.editorRef&&p.editorRef(c),v&&a!==v&&(b(v),g.createModelReference(new o.URI(v),"editor-react-component").then(S=>{u&&u.dispose(),!y&&S.instance.uri.toString()===v?d(S):S.dispose()})),u&&c&&c.currentDocumentModel!==u.instance&&c.open(u),p.uri&&p.uri.toString()!==v&&f(p.uri.toString()),r.default.createElement("div",{ref:S=>S&&(_.current=S),...p})};t.CodeEditor=E},50674:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdateOnGroupTabChange=r;const n=e(41869);function r(o){return(0,n.useUpdateOnEvent)(o.onDidEditorGroupTabChanged,[o])}},6670:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorSuggestWidgetContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(76835);let E=class{contribute(_){const s=new o.DisposableCollection,g=_.monacoEditor.getContribution(m.SuggestController.ID);if(g&&g.widget&&g.widget.value){const c=g.widget.value;s.push(c.onDidSelect(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidSelect",data:h}))})),s.push(c.onDidHide(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidHide",data:h}))})),s.push(c.onDidShow(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidShow",data:h}))})),s.push(c.onDidFocus(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidFocus",data:h}))})),c&&c._setDetailsVisible&&c._setDetailsVisible(this.preferenceService.get("editor.suggest.details.visible",!0))}return s}};t.EditorSuggestWidgetContribution=E,n.__decorate([(0,r.Autowired)(l.IEventBus),n.__metadata("design:type",Object)],E.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),t.EditorSuggestWidgetContribution=E=n.__decorate([(0,r.Injectable)()],E)},67903:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorTopPaddingContribution=void 0;class e{contribute(r){return r.monacoEditor.onDidChangeModel(()=>{r.monacoEditor.changeViewZones(o=>{o.addZone({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:0})})})}}t.EditorTopPaddingContribution=e},51553:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorGroup=t.WorkbenchEditorServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(91830),m=e(75524),E=e(43718),p=e(14951),_=n.__importStar(e(20868)),s=e(72665),g=e(23418),c=e(96689),h=e(76759),u=e(47049),d=e(82196),v=e(17878),f=10,a=T=>!!(T.supportsRevive&&!T.deleted);let b=class extends E.WithEventBus{constructor(){super(),this.editorGroups=[],this._onDidEditorGroupsChanged=new E.Emitter,this.onDidEditorGroupsChanged=this._onDidEditorGroupsChanged.event,this._sortedEditorGroups=[],this._onActiveResourceChange=new E.Emitter,this.onActiveResourceChange=this._onActiveResourceChange.event,this._onActiveEditorUriChange=new E.Emitter,this.onActiveEditorUriChange=this._onActiveEditorUriChange.event,this._onCursorChange=new E.Emitter,this.onCursorChange=this._onCursorChange.event,this._onDidCurrentEditorGroupChanged=new E.Emitter,this.onDidCurrentEditorGroupChanged=this._onDidCurrentEditorGroupChanged.event,this._restoring=!0,this.contributionsReady=new E.Deferred,this.untitledCloseIndex=[],this.gridReady=!1,this._onDidGridReady=new E.Emitter,this.onDidGridReady=this._onDidGridReady.event,this.editorGroupIdGen=0,this.untitledIndex.update(),this.initialize()}setEditorContextKeyService(w){this.editorContextKeyService=w}setCurrentGroup(w){var D;if(w){if(this._currentEditorGroup===w)return;this._currentEditorGroup=w,this._onActiveResourceChange.fire(w.currentResource),this.eventBus.fire(new d.EditorActiveResourceStateChangedEvent({resource:w.currentResource,openType:w.currentOpenType,editorUri:(D=this.currentEditor)===null||D===void 0?void 0:D.currentUri})),this._onDidCurrentEditorGroupChanged.fire(this._currentEditorGroup)}}onEditorGroupChangeEvent(w){var D;w.payload.group===this.currentEditorGroup&&this.eventBus.fire(new d.EditorActiveResourceStateChangedEvent({resource:w.payload.newResource,openType:w.payload.newOpenType,editorUri:(D=this.currentEditor)===null||D===void 0?void 0:D.currentUri}))}getAllOpenedUris(){const w=[];for(const D of this.editorGroups)for(const I of D.resources)w.findIndex(P=>P.isEqual(I.uri))===-1&&w.push(I.uri);return w}async getAllOpenedDocuments(){const w=[];for(const D of this.editorGroups)for(const I of D.resources){if(I.uri.scheme!=="file")continue;if(w.findIndex(P=>P.uri.isEqual(I.uri))===-1){const P=await D.getDocumentModelRef(I.uri);P&&w.push(P.instance)}}return w}async save(w){if(this.editorGroups.length)try{for(const D of this.editorGroups){const I=D.resources.find(O=>O.uri.isEqual(w));I&&await D.saveResource(I)}return w}catch(D){throw new Error(`Save Failed: ${D.message}`)}}getDefaultSavePath(w){const D=w.path.toString()!=="/"?E.path.dirname(w.path.toString()):this.appConfig.workspaceDir;return E.isWindows?D.replace(/\\/g,"/"):D}async saveAs(w){var D,I;if(!(!this._currentEditorGroup||!((D=this._currentEditorGroup.currentResource)===null||D===void 0)&&D.deleted))try{const O=this.getDefaultSavePath(w);return await this.windowDialogService.showSaveDialog({saveLabel:"SaveAs File:",showNameInput:!0,defaultFileName:(I=this._currentEditorGroup.currentResource)===null||I===void 0?void 0:I.name,defaultUri:E.URI.file(O),saveAs:!0})}catch(O){throw new Error(`SaveAs Failed: ${O.message}`)}}async saveAll(w,D){for(const I of this.editorGroups)await I.saveAll(w,D)}hasDirty(){for(const w of this.editorGroups)if(w.hasDirty())return!0;return!1}calcDirtyCount(){const w=new Set;return this.editorGroups.reduce((D,I)=>D+I.calcDirtyCount(w),0)}createEditorGroup(){const w=this.injector.get(y,[this.generateRandomEditorGroupName(),this.editorGroupIdGen++]);this.editorGroups.push(w);const D=new E.Disposable(w.onDidEditorGroupBodyChanged(()=>{w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveResourceChange.fire(w.currentResource))}),w.onDidEditorFocusChange(()=>{var O;w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveEditorUriChange.fire((O=w.currentOrPreviousFocusedEditor)===null||O===void 0?void 0:O.currentUri))}));w.addDispose({dispose:()=>{D.dispose()}});const I=w.onDidEditorGroupTabChanged(()=>{this.saveOpenedResourceState()});return w.addDispose({dispose:()=>{I.dispose()}}),w.onCurrentEditorCursorChange(O=>{this._currentEditorGroup===w&&this._onCursorChange.fire(O)}),w}generateRandomEditorGroupName(){let w=(0,E.makeRandomHexString)(5);for(;this.editorGroups.findIndex(D=>D.name===w)!==-1;)w=(0,E.makeRandomHexString)(5);return w}initialize(){return this.initializing||(this.initializing=this.doInitialize()),this.initializing}async doInitialize(){this.openedResourceState=await this.initializeState(),await this.contributionsReady.promise,await this.restoreState(),this._currentEditorGroup=this.editorGroups[0]}async initializeState(){return await this.getStorage(E.STORAGE_NAMESPACE.WORKBENCH)}get currentEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentEditor}get currentCodeEditor(){return this.currentEditorGroup.currentCodeEditor}get currentEditorGroup(){return this._currentEditorGroup}get currentOrPreviousFocusedEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentOrPreviousFocusedEditor}async open(w,D){await this.initialize();let I=this.currentEditorGroup,O;if(D&&typeof D.groupIndex<"u"?O=D.groupIndex:D&&D.relativeGroupIndex&&(O=this.currentEditorGroup.index+D.relativeGroupIndex),typeof O=="number"&&O>=0){if(O>=this.editorGroups.length)return I.open(w,Object.assign({},D,{split:g.EditorGroupSplitAction.Right}));I=this.sortedEditorGroups[O]||this.currentEditorGroup}return I.open(w,D)}async openUris(w){await this.initialize(),await this.currentEditorGroup.openUris(w)}getEditorGroup(w){return this.editorGroups.find(D=>D.name===w)}get currentResource(){return this.currentEditorGroup?this.currentEditorGroup.currentResource:null}removeGroup(w){const D=this.editorGroups.findIndex(I=>I===w);if(D!==-1){if(this.editorGroups.length===1)return;this.editorGroups.splice(D,1),this.currentEditorGroup===w&&this.setCurrentGroup(this.editorGroups[0]);for(let I=D;I<this.editorGroups.length;I++)this.eventBus.fire(new d.EditorGroupIndexChangedEvent({group:this.editorGroups[I],index:I}))}}async saveOpenedResourceState(){if(this._restoring)return;const w=this.topGrid.serialize();await this.openedResourceState.set("grid",w)}prepareContextKeyService(){const w=I=>{let O=null;const P=this.documentModelManager.getModelDescription(I,"resourceContextKey");return P&&(O=P.languageId),O},D=new l.ResourceContextKey(this.editorContextKeyService,I=>{const O=w(I);return O||w(I)});this.onActiveResourceChange(I=>{this.currentEditor&&this.currentEditor.currentUri?D.set(this.currentEditor.currentUri):I?D.set(I.uri):D.reset()}),this.currentEditor&&this.currentEditor.currentUri?D.set(this.currentEditor.currentUri):this.currentResource?D.set(this.currentResource.uri):D.reset()}onDomCreated(w){this.editorContextKeyService&&this.editorContextKeyService.attachToDomNode(w)}notifyGroupChanged(){this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}async restoreState(){let w={editorGroup:{uris:[],previewIndex:-1}};this.appConfig.disableRestoreEditorGroupState||(w=this.openedResourceState.get("grid",w)),this.topGrid=new u.EditorGrid,this.addDispose(this.topGrid),this.addDispose(this.topGrid.onDidGridAndDesendantStateChange(()=>{this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}));const D=[],I=this.topGrid.deserialize(w,()=>this.createEditorGroup(),D).then(()=>{this.topGrid.children.length===0&&!this.topGrid.editorGroup&&this.topGrid.setEditorGroup(this.createEditorGroup()),this.gridReady=!0,this._onDidGridReady.fire(),this.notifyGroupChanged()});return Promise.all(D).then(()=>{this._restoring=!1;for(const O of this.contributions.getContributions())O.onDidRestoreState&&O.onDidRestoreState()}),I}async closeAll(w,D){for(const I of this.editorGroups.slice(0))w?await I.close(w,{force:D}):await I.closeAll()}async closeAllOnlyConfirmOnce(){const w=[];for(const B of this.editorGroups)for(const x of B.resources)w.push(x);const I=(await Promise.all(w.map(async B=>({shouldClose:await this.resourceService.shouldCloseResourceWithoutConfirm(B),resource:B})))).filter(B=>B.shouldClose);if(I.length===0)return!1;const O={[(0,E.localize)("file.prompt.dontSave","Don't Save")]:d.AskSaveResult.REVERT,[(0,E.localize)("file.prompt.save","Save")]:d.AskSaveResult.SAVE,[(0,E.localize)("file.prompt.cancel","Cancel")]:d.AskSaveResult.CANCEL};let R=I.slice(0,f).map(B=>B.resource.name).join("\u3001");I.length>f&&(I.length-f===1?R+=(0,E.localize)("file.prompt.more.one"):R+=(0,E.formatLocalize)("file.prompt.more.number",I.length-f));const M=await this.dialogService.open({message:(0,o.toMarkdown)((0,E.formatLocalize)("saveNFilesChangesMessage",I.length,R),this.openner),type:E.MessageType.Info,buttons:Object.keys(O)}),k=O[M];return k===d.AskSaveResult.SAVE?(await Promise.all(I.map(B=>{var x,N;return(N=(x=this.resourceService).close)===null||N===void 0?void 0:N.call(x,B.resource,d.AskSaveResult.SAVE)})),!1):k===d.AskSaveResult.REVERT?(await Promise.all(I.map(B=>{var x,N;return(N=(x=this.resourceService).close)===null||N===void 0?void 0:N.call(x,B.resource,d.AskSaveResult.REVERT)})),!1):!0}async close(w,D){return this.closeAll(w,D)}get sortedEditorGroups(){return this._sortedEditorGroups||(this._sortedEditorGroups=[],this.topGrid.sortEditorGroups(this._sortedEditorGroups)),this._sortedEditorGroups}handleOnCloseUntitledResource(w){if(w.payload.resource.uri.scheme===E.Schemes.untitled){const{index:D}=w.payload.resource.uri.getParsedQuery();this.untitledCloseIndex.push(parseInt(D,10)),this.untitledCloseIndex.sort((I,O)=>I-O)}}createUntitledURI(){const w=this.untitledCloseIndex.shift()||this.untitledIndex.id;return new E.URI().withScheme(E.Schemes.untitled).withQuery(`name=${v.UntitledDocumentIdCounter.UNTITLED_FILE_NAME_PREFIX}${w}&index=${w}`)}createUntitledResource(w={uri:this.createUntitledURI()}){return this.open(w.uri,{preview:!1,focus:!0,...w.resourceOpenOptions})}};t.WorkbenchEditorServiceImpl=b,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],b.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(g.ResourceService),n.__metadata("design:type",g.ResourceService)],b.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],b.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],b.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(E.StorageProvider),n.__metadata("design:type",Function)],b.prototype,"getStorage",void 0),n.__decorate([(0,r.Autowired)(s.IDialogService),n.__metadata("design:type",Object)],b.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],b.prototype,"openner",void 0),n.__decorate([(0,r.Autowired)(d.BrowserEditorContribution),n.__metadata("design:type",Object)],b.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(c.IEditorDocumentModelService),n.__metadata("design:type",Object)],b.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(v.UntitledDocumentIdCounter),n.__metadata("design:type",v.UntitledDocumentIdCounter)],b.prototype,"untitledIndex",void 0),n.__decorate([(0,r.Autowired)(s.IWindowDialogService),n.__metadata("design:type",Object)],b.prototype,"windowDialogService",void 0),n.__decorate([(0,E.OnEvent)(d.EditorGroupChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[d.EditorGroupChangeEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"onEditorGroupChangeEvent",null),n.__decorate([(0,E.OnEvent)(d.EditorGroupCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[d.EditorGroupCloseEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"handleOnCloseUntitledResource",null),t.WorkbenchEditorServiceImpl=b=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],b);let y=class extends E.WithEventBus{constructor(w,D){super(),this.name=w,this.groupId=D,this.openingPromise=new Map,this._onDidEditorFocusChange=this.registerDispose(new E.Emitter),this.onDidEditorFocusChange=this._onDidEditorFocusChange.event,this._onDidEditorGroupTabChanged=new E.Emitter,this.onDidEditorGroupTabChanged=this._onDidEditorGroupTabChanged.event,this._onDidEditorGroupTabOperation=new E.Emitter,this.onDidEditorGroupTabOperation=this._onDidEditorGroupTabOperation.event,this._onDidEditorGroupBodyChanged=new E.Emitter,this.onDidEditorGroupBodyChanged=this._onDidEditorGroupBodyChanged.event,this._onDidEditorGroupContentLoading=new E.Emitter,this.onDidEditorGroupContentLoading=this._onDidEditorGroupContentLoading.event,this.previewURI=null,this.resources=[],this.resourceStatus=new Map,this.cachedResourcesActiveOpenTypes=new Map,this.cachedResourcesOpenTypes=new Map,this.availableOpenTypes=[],this.activeComponents=new Map,this.activateComponentsProps=new Map,this.holdDocumentModelRefs=new Map,this.toDispose=[],this._prevDomHeight=0,this._prevDomWidth=0,this._onCurrentEditorCursorChange=new E.Emitter,this.onCurrentEditorCursorChange=this._onCurrentEditorCursorChange.event,this.resourceOpenHistory=[],this._domNode=null,this._diffEditorDomNode=null,this._diffEditorDomNodeAttached=!1,this._mergeEditorDomNode=null,this._mergeEditorDomNodeAttached=!1,this.codeEditorReady=new E.ReadyEvent,this.diffEditorReady=new E.ReadyEvent,this.diffEditorDomReady=new E.ReadyEvent,this.mergeEditorReady=new E.ReadyEvent,this.mergeEditorDomReady=new E.ReadyEvent,this._restoringState=!1,this.eventBus.onDirective(o.ResizeEvent.createDirective((0,o.getSlotLocation)("@opensumi/ide-editor",this.config.layoutConfig)),()=>{this.doLayoutEditors()}),this.eventBus.on(d.GridResizeEvent,I=>{I.payload.gridId===this.grid.uid&&this.doLayoutEditors()}),this.eventBus.on(d.EditorComponentDisposeEvent,I=>{this.activeComponents.delete(I.payload),this.activateComponentsProps.delete(I.payload)}),this.listenToExplorerAutoRevealConfig()}listenToExplorerAutoRevealConfig(){this.explorerAutoRevealConfig=!!this.preferenceService.get("explorer.autoReveal"),this.disposables.push(this.preferenceService.onPreferenceChanged(w=>{w.preferenceName==="explorer.autoReveal"&&(this.explorerAutoRevealConfig=w.newValue)}))}attachDiffEditorDom(w){this._diffEditorDomNodeAttached||(this._diffEditorDomNode=w,this.diffEditorDomReady.ready(),this._diffEditorDomNodeAttached=!0)}attachMergeEditorDom(w){this._mergeEditorDomNodeAttached||(this._mergeEditorDomNode=w,this.mergeEditorDomReady.ready(),this._mergeEditorDomNodeAttached=!0)}attachToDom(w){this._domNode=w,w&&(this.contextKeyService.attachToDomNode(w),this.layoutEditors())}layoutEditors(){o.fastdom.measure(()=>{if(this._domNode){const w=this._domNode.offsetWidth,D=this._domNode.offsetHeight;(w!==this._prevDomWidth||D!==this._prevDomHeight)&&this.doLayoutEditors(),this._prevDomWidth=w,this._prevDomHeight=D}})}_layoutEditorWorker(){if(this.currentOpenType)switch(this.currentOpenType.type){case d.EditorOpenType.code:this.codeEditor&&this.codeEditor.layout();break;case d.EditorOpenType.diff:this.diffEditor&&this.diffEditor.layout();break;default:break}}doLayoutEditors(){this._measure&&this._measure.dispose(),this._measure=o.fastdom.mutate(()=>{this._layoutEditorWorker()})}setContextKeys(){var w;if(!this._resourceContext){const D=I=>{let O=null;const P=this.documentModelManager.getModelDescription(I,"resourceContextKey");return P&&(O=P.languageId),O};this._resourceContext=new l.ResourceContextKey(this.contextKeyService,I=>D(I)),this._diffResourceContextKey=new l.ResourceContextKey(this.contextKeyService,I=>D(I),"diffResource"),this._editorLangIDContextKey=this.contextKeyService.createKey("editorLangId",""),this._isInDiffEditorContextKey=this.contextKeyService.createKey("isInDiffEditor",!1),this._activeEditorIsDirtyContextKey=this.contextKeyService.createKey("activeEditorIsDirty",!1),this._isInDiffRightEditorContextKey=this.contextKeyService.createKey("isInDiffRightEditor",!1),this._isInEditorComponentContextKey=this.contextKeyService.createKey("inEditorComponent",!1)}this.currentOrPreviousFocusedEditor&&this.currentOrPreviousFocusedEditor.currentUri?(this._resourceContext.set(this.currentOrPreviousFocusedEditor.currentUri),this.currentOrPreviousFocusedEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentOrPreviousFocusedEditor.currentDocumentModel.languageId)):this.currentEditor&&this.currentEditor.currentUri?(this._resourceContext.set(this.currentEditor.currentUri),this.currentEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentEditor.currentDocumentModel.languageId)):(this.currentResource?this._resourceContext.set(this.currentResource.uri):this._resourceContext.reset(),this._editorLangIDContextKey.reset()),this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty()),this._isInDiffEditorContextKey.set(this.isDiffEditorMode()),this._isInDiffRightEditorContextKey.set(this.isDiffEditorMode()),this._isInEditorComponentContextKey.set(this.isComponentMode()),this.isDiffEditorMode()&&this._diffResourceContextKey.set((w=this.currentResource)===null||w===void 0?void 0:w.uri),this.updateContextKeyWhenDiffEditorChangesFocus()}updateContextKeyWhenDiffEditorChangesFocus(){if(this.updateContextKeyWhenEditorChangesFocusDisposer||!this.diffEditor)return;const w=()=>{this.currentFocusedEditor||(this.setContextKeys(),this._onDidEditorFocusChange.fire())};this.updateContextKeyWhenEditorChangesFocusDisposer=new E.Disposable(this.diffEditor.modifiedEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.modifiedEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.diffEditor.originalEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.originalEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onFocus(()=>{this.codeEditor.currentUri&&this.locateInFileTree(this.codeEditor.currentUri),this._currentOrPreviousFocusedEditor=this.codeEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onBlur(w),this.diffEditor.originalEditor.onBlur(w),this.diffEditor.modifiedEditor.onBlur(w)),this.addDispose(this.updateContextKeyWhenEditorChangesFocusDisposer)}get contextKeyService(){return this._contextKeyService||(this._contextKeyService=this.workbenchEditorService.editorContextKeyService.createScoped()),this._contextKeyService}get index(){return this.workbenchEditorService.sortedEditorGroups.indexOf(this)}onResourceDecorationChangeEvent(w){w.payload.decoration.dirty&&this.previewURI&&this.previewURI.isEqual(w.payload.uri)&&this.pinPreviewed(),this.resources.find(I=>I.uri.isEqual(w.payload.uri))&&this.notifyTabChanged()}resetOpenType(){this._currentOpenType=null}oResourceOpenTypeChangedEvent(w){const D=w.payload;this.cachedResourcesOpenTypes.has(D.toString())&&this.cachedResourcesOpenTypes.delete(D.toString()),this.currentResource&&this.currentResource.uri.isEqual(D)&&(this.resetOpenType(),this.notifyBodyChanged(),this.displayResourceComponent(this.currentResource,{}))}async onRegisterEditorComponentEvent(){if(this.currentResource){const w=this.currentResource,D=await this.editorComponentRegistry.resolveEditorComponent(w);this.currentResource===w&&(this.availableOpenTypes=D,this.cachedResourcesOpenTypes.set(w.uri.toString(),D))}}pinPreviewed(w){const D=this.previewURI;w===void 0?this.previewURI=null:this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),D!==this.previewURI&&this.notifyTabChanged()}notifyTabChanged(){this._restoringState||this._onDidEditorGroupTabChanged.fire()}notifyBodyChanged(){this._onDidEditorGroupBodyChanged.fire()}notifyTabLoading(w){this._onDidEditorGroupContentLoading.fire(w)}get currentEditor(){return this.currentOpenType?this.currentOpenType.type===d.EditorOpenType.code?this.codeEditor:this.currentOpenType.type===d.EditorOpenType.diff?this.diffEditor.modifiedEditor:null:null}get currentOrPreviousFocusedEditor(){return this._currentOrPreviousFocusedEditor||this.currentEditor}get currentFocusedEditor(){if(this.currentOpenType){if(this.currentOpenType.type===d.EditorOpenType.code){if(this.codeEditor.monacoEditor.hasWidgetFocus())return this.codeEditor}else if(this.currentOpenType.type===d.EditorOpenType.diff){if(this.diffEditor.modifiedEditor.monacoEditor.hasTextFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasTextFocus())return this.diffEditor.originalEditor;if(this.diffEditor.modifiedEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.originalEditor}}return null}get currentCodeEditor(){return this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code?this.codeEditor:null}createEditor(w){this.codeEditor=this.collectionService.createCodeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.addDispose(this.codeEditor.onRefOpen(()=>{this.doLayoutEditors()})),this.toDispose.push(this.codeEditor.onCursorPositionChanged(D=>{this._onCurrentEditorCursorChange.fire(D)})),this.toDispose.push(this.codeEditor.onSelectionsChanged(D=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.eventBus.fire(new d.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:D.selections,source:D.source,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onVisibleRangesChanged(D=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.eventBus.fire(new d.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:D,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.eventBus.fire(new d.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:this.codeEditor.currentUri}))})),this.eventBus.fire(new d.CodeEditorDidVisibleEvent({groupName:this.name,type:d.EditorOpenType.code,editorId:this.codeEditor.getId()})),this.toDispose.push(this.codeEditor.monacoEditor.onDidChangeModelContent(()=>{this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty())})),this.codeEditorReady.ready()}createMergeEditor(w){this.mergeEditor=this.collectionService.createMergeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),this.mergeEditorReady.ready()}createDiffEditor(w){this.diffEditor=this.collectionService.createDiffEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.diffEditor.onRefOpen(()=>{this.doLayoutEditors()}),this.addDiffEditorEventListeners(this.diffEditor.originalEditor,"original"),this.addDiffEditorEventListeners(this.diffEditor.modifiedEditor,"modified"),this.eventBus.fire(new d.CodeEditorDidVisibleEvent({groupName:this.name,type:d.EditorOpenType.diff,editorId:this.diffEditor.modifiedEditor.getId()})),this.eventBus.fire(new d.CodeEditorDidVisibleEvent({groupName:this.name,type:d.EditorOpenType.diff,editorId:this.diffEditor.originalEditor.getId()})),this.diffEditorReady.ready()}addDiffEditorEventListeners(w,D){this.toDispose.push(w.onSelectionsChanged(I=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.eventBus.fire(new d.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:I.selections,source:I.source,editorUri:E.URI.from(w.monacoEditor.getModel().uri),side:D}))})),this.toDispose.push(w.onVisibleRangesChanged(I=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.eventBus.fire(new d.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:I,editorUri:w.currentUri}))})),this.toDispose.push(w.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.eventBus.fire(new d.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:w.currentUri}))}))}async split(w,D,I){var O,P,R;const M=this.workbenchEditorService.createEditorGroup(),k=w===g.EditorGroupSplitAction.Left||w===g.EditorGroupSplitAction.Right?u.SplitDirection.Horizontal:u.SplitDirection.Vertical,B=w===g.EditorGroupSplitAction.Left||w===g.EditorGroupSplitAction.Top;if(this.grid.split(k,M,B),I&&!I.scrollTop&&(I.scrollTop=(O=this.currentEditor)===null||O===void 0?void 0:O.monacoEditor.getScrollTop()),I&&!I.scrollLeft&&(I.scrollLeft=(P=this.currentEditor)===null||P===void 0?void 0:P.monacoEditor.getScrollLeft()),I&&!I?.range){const x=(R=this.currentCodeEditor)===null||R===void 0?void 0:R.monacoEditor.getSelection();x&&(I.range=new _.Range(x.startLineNumber,x.startColumn,x.endLineNumber,x.endColumn))}return M.open(D,{...I,preview:!1,revealRangeInCenter:!1})}async open(w,D={}){if(w.scheme===E.Schemes.file&&this.recentFilesManager.setMostRecentlyOpenedFile(w.withoutFragment().toString()),D&&D.split)return this.split(D.split,w,Object.assign({},D,{split:void 0,preview:!1}));if(!this.openingPromise.has(w.toString())){const O=this.doOpen(w,D);this.openingPromise.set(w.toString(),O),O.then(()=>{this.openingPromise.delete(w.toString())},()=>{this.openingPromise.delete(w.toString())})}return this.preferenceService.get("editor.previewMode")&&((0,E.isUndefinedOrNull)(D.preview)?!0:D.preview)||this.openingPromise.get(w.toString()).then(()=>{this.pinPreviewed(w)}),this.openingPromise.get(w.toString())}async pin(w){return this.pinPreviewed(w)}getPreventScrollOption(w={}){var D;return(D=w.preventScroll)!==null&&D!==void 0?D:this.preferenceService.get("editor.preventScrollAfterFocused")}async doOpen(w,D={}){var I,O,P;if(!this.resourceService.handlesUri(w))return this.openerService.open(w),!1;let R;try{const M=this.preferenceService.get("editor.previewMode")&&((0,E.isUndefinedOrNull)(D.preview)?!0:D.preview);if(this.currentResource&&this.currentResource.uri.isEqual(w)&&(!D.forceOpenType||D.forceOpenType.type===((I=this.currentOpenType)===null||I===void 0?void 0:I.type))){if(D.focus&&this.currentEditor){const k=this.getPreventScrollOption(D);(O=this._domNode)===null||O===void 0||O.focus({preventScroll:k}),this.currentEditor.monacoEditor.focus()}return D.range&&this.currentEditor&&(this.currentEditor.monacoEditor.setSelection(D.range),setTimeout(()=>{var k;(k=this.currentEditor)===null||k===void 0||k.monacoEditor.revealRangeInCenter(D.range,0)},0)),this.locationInTree(D,w),this.notifyTabChanged(),{group:this,resource:this.currentResource}}else{const k=this._currentOpenType,B=this._currentResource;let x=null,N=this.resources.find(U=>U.uri.toString()===w.toString());if(!N){if(N=await this.resourceService.getResource(w),!N)throw new Error("This uri cannot be opened!: "+w);if(N.deleted){if(D.deletedPolicy==="fail")throw new Error("resource deleted "+w);if(D.deletedPolicy==="skip")return!1}D&&D.label&&(N.name=D.label),D&&(0,E.isDefined)(D.supportsRevive)&&(N.supportsRevive=D.supportsRevive);let U=null;if(D&&D.index!==void 0&&D.index<this.resources.length)U=this.resources[D.index],this.resources.splice(D.index,0,N),x={type:"open",resource:N,index:D.index};else if(this.currentResource){const Y=this.resources.indexOf(this.currentResource);this.resources.splice(Y+1,0,N),x={type:"open",resource:N,index:Y+1},U=this.currentResource}else this.resources.push(N),x={type:"open",resource:N,index:this.resources.length-1};M&&(this.previewURI&&await this.close(this.previewURI,{treatAsNotCurrent:!0,force:D.forceClose}),this.previewURI=N.uri),D.replace&&U&&await this.close(U.uri,{treatAsNotCurrent:!0,force:D.forceClose})}if(D.backend)return this.notifyTabChanged(),!1;if(B&&this.resourceOpenHistory[this.resourceOpenHistory.length-1]!==B.uri){this.resourceOpenHistory.push(B.uri);const U=(P=this.currentCodeEditor)===null||P===void 0?void 0:P.getSelections();U&&U.length>0&&this.recentFilesManager.updateMostRecentlyOpenedFile(B.uri.toString(),{lineNumber:U[0].selectionStartLineNumber,column:U[0].selectionStartColumn})}this._currentOpenType=null,this._currentResource=N;const j=this.reporterService.time(E.REPORT_NAME.EDITOR_REACTIVE);R=new E.Deferred,this.resourceStatus.set(N,R.promise);const K=setTimeout(()=>{this.notifyTabLoading(N)},60);this.notifyTabChanged(),this.notifyBodyChanged();try{await this.displayResourceComponent(N,D)}finally{x&&this._onDidEditorGroupTabOperation.fire(x)}return this._currentOrPreviousFocusedEditor=this.currentEditor,clearTimeout(K),R.resolve(),j.timeEnd(N.uri.toString()),this._onDidEditorFocusChange.fire(),this.setContextKeys(),this.eventBus.fire(new d.EditorGroupOpenEvent({group:this,resource:N})),this.locationInTree(D,w),this.eventBus.fire(new d.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:k,oldResource:B})),{group:this,resource:N}}}catch(M){return(0,E.getDebugLogger)().error(M),R&&R.reject(),(0,h.isEditorError)(M,h.EditorTabChangedError)||this.messageService.error((0,E.formatLocalize)("editor.failToOpen",w.displayName,M.message),[],!0),!1}}locationInTree(w,D){w?.backend||(w?.disableNavigate||this.locateInFileTree(D),w.disableNavigateOnOpendEditor||this.locateInOpenedEditor(D))}locateInFileTree(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.FILE_COMMANDS.LOCATION.id,w)}locateInOpenedEditor(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.OPEN_EDITORS_COMMANDS.LOCATION.id,w)}async openUris(w){for(const D of w)await this.open(D)}async getDocumentModelRef(w){const D=w.toString();return this.holdDocumentModelRefs.has(D)||this.holdDocumentModelRefs.set(D,await this.documentModelManager.createModelReference(w,"editor-group-"+this.name)),this.holdDocumentModelRefs.get(D)}disposeDocumentRef(w){if(w.scheme==="diff"){const D=w.getParsedQuery();this.doDisposeDocRef(new E.URI(D.original)),this.doDisposeDocRef(new E.URI(D.modified))}else w.scheme==="mergeEditor"?this.mergeEditor&&this.mergeEditor.dispose():this.doDisposeDocRef(w)}doDisposeDocRef(w){const D=w.toString();this.holdDocumentModelRefs.has(D)&&(this.holdDocumentModelRefs.get(D).dispose(),this.holdDocumentModelRefs.delete(D))}async openCodeEditor(w,D){this.resolveTabChanged(w,this.currentResource),await this.codeEditorReady.onceReady(async()=>{var I;const O=await this.getDocumentModelRef(w.uri);if(await this.codeEditor.open(O),D.range){const P=new _.Range(D.range.startLineNumber,D.range.startColumn,D.range.endLineNumber,D.range.endColumn);this.codeEditor.monacoEditor.setSelection(P),D.revealRangeInCenter&&setTimeout(()=>{this.codeEditor.monacoEditor.revealRangeInCenter(P,1)})}if(queueMicrotask(()=>{D.scrollTop&&this.codeEditor.monacoEditor.setScrollTop(D.scrollTop),D.scrollLeft&&this.codeEditor.monacoEditor.setScrollLeft(D.scrollLeft)}),D.focus){const P=this.getPreventScrollOption(D);(I=this._domNode)===null||I===void 0||I.focus({preventScroll:P});const R=this.eventBus.on(d.CodeEditorDidVisibleEvent,M=>{var k;if(M.payload.groupName===this.name&&M.payload.type===d.EditorOpenType.code){if(R.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.codeEditor&&(!((k=this.codeEditor.currentUri)===null||k===void 0)&&k.isEqual(w.uri)))try{this.codeEditor.focus()}catch{}}})}O.instance.dirty&&this.pinPreviewed(w.uri)})}async openDiffEditor(w,D){this.diffEditor||await this.diffEditorDomReady.onceReady(()=>{var R;const M=document.createElement("div");(R=this._diffEditorDomNode)===null||R===void 0||R.appendChild(M),this.createDiffEditor(M)});const I=w,[O,P]=await Promise.all([this.getDocumentModelRef(I.metadata.original),this.getDocumentModelRef(I.metadata.modified)]);await this.diffEditorReady.onceReady(async()=>{var R;if(!(!O||!P)&&(await this.diffEditor.compare(O,P,D,w.uri),D.focus)){const M=this.getPreventScrollOption(D);(R=this._domNode)===null||R===void 0||R.focus({preventScroll:M});const k=this.eventBus.on(d.CodeEditorDidVisibleEvent,B=>{if(B.payload.groupName===this.name&&B.payload.type===d.EditorOpenType.diff){if(k.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.diffEditor.modifiedEditor)try{this.diffEditor.focus()}catch{}}})}})}async openMergeEditor(w){const{metadata:D}=w;if(!D)return;this.mergeEditor||await this.mergeEditorDomReady.onceReady(()=>{var K;const U=document.createElement("div");(K=this._mergeEditorDomNode)===null||K===void 0||K.appendChild(U),this.createMergeEditor(U)});const{ancestor:I,input1:O,input2:P,output:R}=D,M=m.MergeEditorInputData.from(O),k=m.MergeEditorInputData.from(P),[B,x,N,j]=await Promise.all([this.getDocumentModelRef(E.URI.parse(I)),this.getDocumentModelRef(M.uri),this.getDocumentModelRef(E.URI.parse(R)),this.getDocumentModelRef(k.uri)]);await this.mergeEditorReady.onceReady(async()=>{await this.mergeEditor.open({ancestor:{uri:E.URI.parse(D.ancestor),textModel:B.instance.getMonacoModel(),baseContent:B.instance.baseContent||""},input1:M.setTextModel(x.instance.getMonacoModel()),input2:k.setTextModel(j.instance.getMonacoModel()),output:{uri:E.URI.parse(D.output),textModel:N.instance.getMonacoModel()}})})}async openCustomEditor(w,D){const I=this.editorComponentRegistry.getEditorComponent(D),O=this.editorComponentRegistry.getEditorInitialProps(D);if(I){if(this.activateComponentsProps.set(I,O),I.renderMode===d.EditorComponentRenderMode.ONE_PER_RESOURCE){const P=this.activeComponents.get(I)||[];P.findIndex(M=>M.uri.toString()===w.uri.toString())===-1&&P.push(w),this.activeComponents.set(I,P)}else if(I.renderMode===d.EditorComponentRenderMode.ONE_PER_GROUP)this.activeComponents.set(I,[w]);else if(I.renderMode===d.EditorComponentRenderMode.ONE_PER_WORKBENCH){const P=[];this.workbenchEditorService.editorGroups.forEach(R=>{if(R===this)return;const M=R.resources.find(k=>k.uri.isEqual(w.uri));M&&P.push(R.close(M.uri))}),await Promise.all(P).catch((0,E.getDebugLogger)().error),this.activeComponents.set(I,[w])}}else throw new Error("Cannot find Editor Component with id: "+D);this._onCurrentEditorCursorChange.fire({position:null,selectionLength:0})}async displayResourceComponent(w,D){D.revealRangeInCenter===void 0&&(D.revealRangeInCenter=!0);const I=w,O=await this.resolveOpenType(w,D);if(O){const{activeOpenType:P,openTypes:R}=O;switch(this.availableOpenTypes=R,D.preserveFocus&&(D.focus=!1),P.type){case d.EditorOpenType.code:await this.openCodeEditor(w,D);break;case d.EditorOpenType.diff:await this.openDiffEditor(w,D);break;case d.EditorOpenType.mergeEditor:await this.openMergeEditor(w);break;case d.EditorOpenType.component:await this.openCustomEditor(w,P.componentId);break;default:return}this.resolveTabChanged(I,this.currentResource),this._currentOpenType=P,this.notifyBodyChanged(),this.doLayoutEditors(),this.cachedResourcesActiveOpenTypes.set(w.uri.toString(),P)}}resolveTabChanged(w,D){if(w!==D)throw new h.EditorTabChangedError}getLastOpenType(w){return this.cachedResourcesActiveOpenTypes.get(w.uri.toString())}async resolveOpenType(w,D){const I=this.cachedResourcesOpenTypes.get(w.uri.toString())||await this.editorComponentRegistry.resolveEditorComponent(w),O=this.preferenceService.get("workbench.editorAssociations"),P=S(I,this.cachedResourcesActiveOpenTypes.get(w.uri.toString()),w,O,D.forceOpenType);return this.cachedResourcesOpenTypes.set(w.uri.toString(),I),{activeOpenType:P,openTypes:I}}async close(w,{treatAsNotCurrent:D,force:I}={}){const O=this.resources.findIndex(P=>P.uri.toString()===w.toString());if(O!==-1){const P=this.resources[O];if(!I&&!await this.shouldClose(P))return!1;if(this.resources.splice(O,1),this._onDidEditorGroupTabOperation.fire({type:"close",resource:P,index:O}),this.eventBus.fire(new d.EditorGroupCloseEvent({group:this,resource:P})),this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),P===this.currentResource&&!D){let R;for(;this.resourceOpenHistory.length>0;)if(this.resources.findIndex(M=>M.uri===this.resourceOpenHistory[this.resourceOpenHistory.length-1])!==-1){R=this.resourceOpenHistory.pop();break}else this.resourceOpenHistory.pop();if(R)this.open(R);else{let M=O;for(;M>0&&!this.resources[M];)M--;this.resources[M]?this.open(this.resources[M].uri):this.backToEmpty()}}else this.notifyTabChanged();this.removeResouceFromActiveComponents(P),this.disposeDocumentRef(w)}return this.resources.length===0&&(this.grid.parent&&this.dispose(),this.availableOpenTypes=[]),!0}removeResouceFromActiveComponents(w){this.activeComponents.forEach((D,I)=>{const O=D.indexOf(w);O!==-1&&(D.splice(O,1),this.eventBus.fire(new d.ResoucesOfActiveComponentChangedEvent({component:I,resources:D})))})}async shouldClose(w){const D=this.workbenchEditorService.editorGroups.map(I=>I.resources);if(await this.resourceService.shouldCloseResource(w,D)){let I=0;for(const O of D)for(const P of O)if(P.uri.isEqual(w.uri)&&(I++,I>=2))break;return I<=1&&this.resourceService.disposeResource(w),!0}else return!1}backToEmpty(){const w=this._currentOpenType,D=this._currentResource;this._currentResource=null,this.resetOpenType(),this.notifyTabChanged(),this.notifyBodyChanged(),this._currentOrPreviousFocusedEditor=null,this._onDidEditorFocusChange.fire(),this.eventBus.fire(new d.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:w,oldResource:D}))}async closeAll(){for(const D of this.resources)if(!await this.shouldClose(D))return!1;return this.resources.splice(0,this.resources.length).reverse().forEach((D,I)=>{this.clearResourceOnClose(D),this._onDidEditorGroupTabOperation.fire({type:"close",resource:D,index:I})}),this.activeComponents.clear(),this.workbenchEditorService.editorGroups.length>1&&this.dispose(),this.previewURI=null,this.backToEmpty(),!0}async closeSaved(){const w=this.resources.filter(D=>{const I=this.resourceService.getResourceDecoration(D.uri);if(!I||!I.dirty)return!0});for(const D of w)if(!await this.shouldClose(D))return;for(const D of w)await this.close(D.uri)}async closeToRight(w){const D=this.resources.findIndex(I=>I.uri.toString()===w.toString());if(D!==-1){const I=this.resources.slice(D+1);for(const O of I)if(!await this.shouldClose(O))return;this.resources.splice(D+1),I.reverse().forEach((O,P)=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:O,index:D+1+(I.length-1-P)})});for(const O of I)this.clearResourceOnClose(O);this.open(w)}}clearResourceOnClose(w){this.eventBus.fire(new d.EditorGroupCloseEvent({group:this,resource:w})),this.removeResouceFromActiveComponents(w)}async closeOthers(w){const D=this.resources.findIndex(I=>I.uri.toString()===w.toString());if(D!==-1){const I=this.resources.filter((P,R)=>R!==D);for(const P of I)if(!await this.shouldClose(P))return;const O=this.resources;this.resources=[this.resources[D]],I.reverse().forEach(P=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:P,index:O.indexOf(P)})});for(const P of I)this.clearResourceOnClose(P);await this.open(w)}}get currentResource(){return this._currentResource}get currentOpenType(){return this._currentOpenType}async changeOpenType(w){const D=this.availableOpenTypes.find(O=>O.type===w||O.componentId===w);if(!D||!this.currentResource||A(D,this.currentOpenType))return;const I=this.currentOpenType;await this.displayResourceComponent(this.currentResource,{forceOpenType:D}),this.eventBus.fire(new d.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:I,oldResource:this.currentResource}))}async dropUri(w,D,I,O){if(D!==d.DragOverPosition.CENTER)await this.split((0,g.getSplitActionFromDragDrop)(D),w,{preview:!1,focus:!0});else if(!O)await this.open(w,{preview:!1,focus:!0});else{const P=this.resources.indexOf(O);if(P===-1)await this.open(w,{preview:!1,focus:!0});else{const R=this.resources.findIndex(M=>M.uri.toString()===w.toString());if(R===-1)await this.open(w,{index:P,preview:!1});else{const M=this.resources[R];R>P?(this.resources.splice(R,1),this.resources.splice(P,0,M),this._onDidEditorGroupTabOperation.fire({type:"move",resource:M,oldIndex:R,index:P}),await this.open(w,{preview:!1})):R<P&&(this.resources.splice(P+1,0,M),this.resources.splice(R,1),this._onDidEditorGroupTabOperation.fire({type:"move",resource:M,oldIndex:R,index:P}),await this.open(w,{preview:!1}))}}}I&&(I!==this?await I.close(w):D!==d.DragOverPosition.CENTER&&await this.close(w))}gainFocus(){this.workbenchEditorService.setCurrentGroup(this)}focus(){this.gainFocus(),this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.codeEditor.focus(),this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.diffEditor.focus()}dispose(){var w;(w=this.grid)===null||w===void 0||w.dispose(),this.workbenchEditorService.removeGroup(this),super.dispose(),this.codeEditor&&this.codeEditor.dispose(),this.diffEditor&&this.diffEditor.dispose(),this.toDispose.forEach(D=>D.dispose()),this.eventBus.fire(new d.EditorGroupDisposeEvent({group:this}))}getState(){const w=this.resources.filter(a).map(D=>D.uri.toString());return{uris:w,current:this.currentResource&&a(this.currentResource)?this.currentResource.uri.toString():void 0,previewIndex:this.previewURI?w.indexOf(this.previewURI.toString()):-1}}isCodeEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code}isDiffEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff}activeEditorIsDirty(){return this.hasDirty()&&this.workbenchEditorService.currentEditorGroup===this}isComponentMode(){return!!this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.component}async restoreState(w){this._restoringState=!0,this.previewURI=w.uris[w.previewIndex]?new E.URI(w.uris[w.previewIndex]):null,await Promise.all(w.uris.map(async I=>{await this.doOpen(new E.URI(I),{disableNavigate:!0,backend:!0,preview:!1,deletedPolicy:"skip"})}));let D;w.current?D=new E.URI(w.current):w.uris.length>0&&(D=new E.URI(w.uris[w.uris.length-1])),D&&(await this.open(D,{deletedPolicy:"skip"})||this.resources[0]&&await this.open(this.resources[0].uri)),this._restoringState=!1,this.notifyTabChanged()}async saveAll(w,D){for(const I of this.resources)!w&&I.uri.scheme===E.Schemes.untitled||await this.saveResource(I,D)}async saveResource(w,D=g.SaveReason.Manual){if(await this.saveByOpenType(w,D))return;const I=this.documentModelManager.getModelReference(w.uri);I&&(await I.instance.save(void 0,D),I.dispose())}async saveByOpenType(w,D){const I=this.cachedResourcesActiveOpenTypes.get(w.uri.toString());if(I&&I.saveResource)try{return await I.saveResource(w,D),!0}catch(O){this.logger.error(O)}return!1}async saveCurrent(w=g.SaveReason.Manual){const D=this.currentResource;if(D&&!await this.saveByOpenType(D,w)&&this.currentEditor)return this.currentEditor.save()}hasDirty(){for(const w of this.resources){const D=this.documentModelManager.getModelDescription(w.uri);if(D&&D.dirty)return!0}return!1}calcDirtyCount(w=new Set){let D=0;for(const I of this.resources){const O=this.documentModelManager.getModelDescription(I.uri,"calc-dirty-count");w.has(I.uri.toString())||(w.add(I.uri.toString()),O&&O.dirty&&(D+=1))}return D}componentUndo(){const w=this.currentOpenType;w?.undo&&w.undo(this.currentResource)}componentRedo(){const w=this.currentOpenType;w?.redo&&w.redo(this.currentResource)}toJSON(){return{name:this.name}}};t.EditorGroup=y,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",g.EditorCollectionService)],y.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",g.ResourceService)],y.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",d.EditorComponentRegistry)],y.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(g.WorkbenchEditorService),n.__metadata("design:type",b)],y.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(c.IEditorDocumentModelService),n.__metadata("design:type",Object)],y.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(E.CommandService),n.__metadata("design:type",Object)],y.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],y.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.RecentFilesManager),n.__metadata("design:type",o.RecentFilesManager)],y.prototype,"recentFilesManager",void 0),n.__decorate([(0,r.Autowired)(s.IMessageService),n.__metadata("design:type",Object)],y.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(E.IReporterService),n.__metadata("design:type",Object)],y.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],y.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],y.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(E.ILogger),n.__metadata("design:type",Object)],y.prototype,"logger",void 0),n.__decorate([(0,E.OnEvent)(g.ResourceDecorationChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[g.ResourceDecorationChangeEvent]),n.__metadata("design:returntype",void 0)],y.prototype,"onResourceDecorationChangeEvent",null),n.__decorate([(0,E.OnEvent)(d.ResourceOpenTypeChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[d.ResourceOpenTypeChangedEvent]),n.__metadata("design:returntype",void 0)],y.prototype,"oResourceOpenTypeChangedEvent",null),n.__decorate([(0,E.OnEvent)(d.RegisterEditorComponentEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",Promise)],y.prototype,"onRegisterEditorComponentEvent",null),t.EditorGroup=y=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Number])],y);function S(T,w,D,I,O){if(O)return T.find(P=>A(P,O))||T[0];if(w)return T.find(P=>A(P,w))||T[0];if(I){const P=T.find(R=>{const M=Object.keys(I).find(x=>(0,E.match)(x,D.uri.path.toString().toLowerCase())||(0,E.match)(x,D.uri.path.base.toLowerCase())),k=M&&I[M];if(!k)return!1;const B=`${E.CUSTOM_EDITOR_SCHEME}-${k}`;return R.componentId===B});if(P)return P}return T[0]}function A(T,w){return T.type===w.type&&(T.type!==d.EditorOpenType.component||T.componentId===w.componentId)}},94180:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarLeftExtraContentId=t.TabbarRightExtraContentId=void 0,t.TabbarRightExtraContentId="tabbar-right-extra-content",t.TabbarLeftExtraContentId="tabbar-left-extra-content"},93107:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDocPersistentCacheProvider=void 0,t.isDocContentCache=e,t.isDocChangesCache=n,t.parseCacheValueFrom=r,t.IDocPersistentCacheProvider=Symbol("IDocPersistentCacheProvider");function e(o){return o.hasOwnProperty("content")}function n(o){return o.hasOwnProperty("changeMatrix")}function r(o){const l=o.text,m=o.range.startLineNumber,E=o.range.startColumn,p=o.range.endLineNumber,_=o.range.endColumn;return[l,m,E,p,_]}},55113:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AUTO_SAVE_MODE=t.SaveReason=t.Direction=t.EditorGroupSplitAction=t.DragOverPosition=t.EditorOpenType=t.IEditorPriority=t.OverviewRulerLane=t.WorkbenchEditorService=t.DidApplyEditorDecorationFromProvider=t.DidChangeEditorGroupUriEvent=t.CollectionEditorsUpdateEvent=t.EditorCollectionService=t.EditorType=t.ShowLightbulbIconMode=void 0,t.getSimpleEditorOptions=y,t.isTextEditorViewState=S;const n=e(85608),r=e(76003),o=e(43718);var l=e(20868);Object.defineProperty(t,"ShowLightbulbIconMode",{enumerable:!0,get:function(){return l.ShowLightbulbIconMode}});var m;(function(A){A[A.CODE=0]="CODE",A[A.ORIGINAL_DIFF=1]="ORIGINAL_DIFF",A[A.MODIFIED_DIFF=2]="MODIFIED_DIFF",A.MERGE_EDITOR_DIFF="MERGE_EDITOR_DIFF"})(m||(t.EditorType=m={}));let E=class{};t.EditorCollectionService=E,t.EditorCollectionService=E=n.__decorate([(0,r.Injectable)()],E);class p extends o.BasicEvent{}t.CollectionEditorsUpdateEvent=p;class _ extends o.BasicEvent{}t.DidChangeEditorGroupUriEvent=_;class s extends o.BasicEvent{}t.DidApplyEditorDecorationFromProvider=s;class g{}t.WorkbenchEditorService=g;var c;(function(A){A[A.Left=1]="Left",A[A.Center=2]="Center",A[A.Right=4]="Right",A[A.Full=7]="Full"})(c||(t.OverviewRulerLane=c={}));var h;(function(A){A.builtin="builtin",A.option="option",A.exclusive="exclusive",A.default="default"})(h||(t.IEditorPriority=h={}));var u;(function(A){A.code="code",A.diff="diff",A.mergeEditor="mergeEditor",A.component="component"})(u||(t.EditorOpenType=u={}));var d;(function(A){A.LEFT="left",A.RIGHT="right",A.TOP="top",A.BOTTOM="bottom",A.CENTER="center"})(d||(t.DragOverPosition=d={}));var v;(function(A){A[A.Top=1]="Top",A[A.Bottom=2]="Bottom",A[A.Left=3]="Left",A[A.Right=4]="Right"})(v||(t.EditorGroupSplitAction=v={}));var f;(function(A){A.UP="up",A.DOWN="down",A.LEFT="left",A.RIGHT="right"})(f||(t.Direction=f={}));var a;(function(A){A[A.Manual=1]="Manual",A[A.AfterDelay=2]="AfterDelay",A[A.FocusOut=3]="FocusOut"})(a||(t.SaveReason=a={}));var b;(function(A){A.OFF="off",A.AFTER_DELAY="afterDelay",A.EDITOR_FOCUS_CHANGE="editorFocusChange",A.WINDOWS_LOST_FOCUS="windowLostFocus"})(b||(t.AUTO_SAVE_MODE=b={}));function y(){return{fontSize:12,fontWeight:"normal",lineHeight:0,wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden"},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},guides:{highlightActiveIndentation:!1,indentation:!1,bracketPairs:!1}}}function S(A){const T=A;if(!T)return!1;const w=T;if(w.modified)return S(w.modified);const D=T;return!!(D.contributionsState&&D.viewState&&Array.isArray(D.cursorState))}},23418:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(94180),t),n.__exportStar(e(93107),t),n.__exportStar(e(55113),t),n.__exportStar(e(23950),t),n.__exportStar(e(27693),t),n.__exportStar(e(46225),t),n.__exportStar(e(4308),t),n.__exportStar(e(39467),t)},27693:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ILanguageStatusService=void 0,t.ILanguageStatusService=Symbol("ILanguageStatusService")},23950:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticTag=t.DiagnosticSeverity=t.ILanguageService=void 0,t.asSeverity=l,t.asRelatedInformations=m,t.asRelatedInformation=E,t.asMonacoDiagnostics=p,t.asMonacoDiagnostic=_;const n=e(43718);t.ILanguageService=Symbol("ILanguageService");var r;(function(s){s[s.Error=1]="Error",s[s.Warning=2]="Warning",s[s.Information=3]="Information",s[s.Hint=4]="Hint"})(r||(t.DiagnosticSeverity=r={}));var o;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(o||(t.DiagnosticTag=o={}));function l(s){return s===1?n.MarkerSeverity.Error:s===2?n.MarkerSeverity.Warning:s===3?n.MarkerSeverity.Info:n.MarkerSeverity.Hint}function m(s){if(s)return s.map(g=>E(g))}function E(s){return{resource:n.Uri.parse(s.location.uri),startLineNumber:s.location.range.start.line+1,startColumn:s.location.range.start.character+1,endLineNumber:s.location.range.end.line+1,endColumn:s.location.range.end.character+1,message:s.message}}function p(s){if(s)return s.map(g=>_(g))}function _(s){return{code:typeof s.code=="number"?s.code.toString():typeof s.code=="object"?{value:s.code.value.toString(),target:s.code.target}:s.code,severity:l(s.severity),message:s.message,source:s.source,startLineNumber:s.range.start.line+1,startColumn:s.range.start.character+1,endLineNumber:s.range.end.line+1,endColumn:s.range.end.character+1,relatedInformation:m(s.relatedInformation),tags:s.tags}}},46225:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notebookCellScheme=t.INotebookService=t.CellKind=t.NotebookCellsChangeType=void 0;var e;(function(r){r[r.ModelChange=1]="ModelChange",r[r.Move=2]="Move",r[r.ChangeCellLanguage=5]="ChangeCellLanguage",r[r.Initialize=6]="Initialize",r[r.ChangeCellMetadata=7]="ChangeCellMetadata",r[r.Output=8]="Output",r[r.OutputItem=9]="OutputItem",r[r.ChangeCellContent=10]="ChangeCellContent",r[r.ChangeDocumentMetadata=11]="ChangeDocumentMetadata",r[r.ChangeCellInternalMetadata=12]="ChangeCellInternalMetadata",r[r.ChangeCellMime=13]="ChangeCellMime",r[r.Unknown=100]="Unknown"})(e||(t.NotebookCellsChangeType=e={}));var n;(function(r){r[r.Markup=1]="Markup",r[r.Code=2]="Code"})(n||(t.CellKind=n={})),t.INotebookService=Symbol("INotebookService"),t.notebookCellScheme="vscode-notebook-cell"},4308:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AskSaveResult=t.DIFF_SCHEME=t.ResourceDecorationNeedChangeEvent=t.ResourceDecorationChangeEvent=t.ResourceRemoveEvent=t.ResourceDidUpdateEvent=t.ResourceNeedUpdateEvent=t.ResourceService=void 0,t.isDiffResource=_;const n=e(43718);class r{}t.ResourceService=r;class o extends n.BasicEvent{}t.ResourceNeedUpdateEvent=o;class l extends n.BasicEvent{}t.ResourceDidUpdateEvent=l;class m extends n.BasicEvent{}t.ResourceRemoveEvent=m;class E extends n.BasicEvent{}t.ResourceDecorationChangeEvent=E;class p extends n.BasicEvent{}t.ResourceDecorationNeedChangeEvent=p,t.DIFF_SCHEME="diff";function _(g){return g.uri.scheme===t.DIFF_SCHEME}var s;(function(g){g[g.REVERT=1]="REVERT",g[g.SAVE=2]="SAVE",g[g.CANCEL=3]="CANCEL"})(s||(t.AskSaveResult=s={}))},39467:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSplitActionFromDragDrop=r;const n=e(55113);function r(o){return{[n.DragOverPosition.LEFT]:n.EditorGroupSplitAction.Left,[n.DragOverPosition.RIGHT]:n.EditorGroupSplitAction.Right,[n.DragOverPosition.BOTTOM]:n.EditorGroupSplitAction.Bottom,[n.DragOverPosition.TOP]:n.EditorGroupSplitAction.Top}[o]}},54414:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(23418),t)},32595:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerContribution=t.EXPLORER_CONTAINER_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(30144);Object.defineProperty(t,"EXPLORER_CONTAINER_ID",{enumerable:!0,get:function(){return l.EXPLORER_CONTAINER_ID}});const m=e(21634),E=e(68456),p=e(43718);let _=class{registerComponent(g){g.register("@opensumi/ide-explorer",[],{iconClass:(0,o.getIcon)("explorer"),title:(0,o.localize)("explorer.title"),priority:10,containerId:l.EXPLORER_CONTAINER_ID,activateKeyBinding:"ctrlcmd+shift+e"})}onStart(){this.extensionsSchemaService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:l.EXPLORER_CONTAINER_ID,frameworkKind:["opensumi"],jsonSchema:{...m.browserViews.properties,description:(0,o.formatLocalize)("sumiContributes.browserViews.location.custom",(0,o.localize)("explorer.title"))}})}};t.ExplorerContribution=_,n.__decorate([(0,r.Autowired)(p.IExtensionsSchemaService),n.__metadata("design:type",Object)],_.prototype,"extensionsSchemaService",void 0),t.ExplorerContribution=_=n.__decorate([(0,o.Domain)(o.ClientAppContribution,E.ComponentContribution)],_)},59027:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32595);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[l.ExplorerContribution]}};t.ExplorerModule=m,t.ExplorerModule=m=n.__decorate([(0,r.Injectable)()],m)},18531:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressFileServerContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32242),m=e(90242);let E=class{registerStaticResolver(_){_.registerStaticResourceProvider({scheme:o.Schemes.file,resolveStaticResource:s=>{const g=new o.URI(this.appConfig.staticServicePath||m.EXPRESS_SERVER_PATH),[c,h]=s.codeUri.path.split("?");return g.resolve(`assets${decodeURIComponent(c)}`).withQuery(h)},roots:[this.appConfig.staticServicePath||m.EXPRESS_SERVER_PATH]})}};t.ExpressFileServerContribution=E,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],E.prototype,"appConfig",void 0),t.ExpressFileServerContribution=E=n.__decorate([(0,o.Domain)(l.StaticResourceContribution)],E)},98885:(L,t,e)=>{"use strict";var n;n={value:!0},t.Q=void 0;const r=e(85608),o=e(76003),l=e(41869),m=e(18531);let E=class extends l.BrowserModule{constructor(){super(...arguments),this.providers=[m.ExpressFileServerContribution]}};t.Q=E,t.Q=E=r.__decorate([(0,o.Injectable)()],E)},90242:(L,t,e)=>{"use strict";var n=e(39907);Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_MIME=t.EXPRESS_SERVER_PATH=t.EXPRESS_SERVER_PORT=void 0,t.EXPRESS_SERVER_PORT=8e3,t.EXPRESS_SERVER_PATH=n.env.STATIC_SERVER_PATH||`http://127.0.0.1:${t.EXPRESS_SERVER_PORT}/`,t.ALLOW_MIME={gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",svg:"image/svg+xml",ttf:"font/ttf",eot:"font/eot",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",js:"application/javascript",css:"text/css",mp4:"video/mp4",ogg:"video/ogg",webm:"video/webm"}},21082:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENSION_SCHEME=t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=void 0;const n=e(30144);t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=n.EXTENSION_CONTAINER_ID,t.EXTENSION_SCHEME="extension"},6449:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionOverview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(68974),m=e(95422),E=e(43718),p=e(93374),_=e(29150),s=n.__importDefault(e(40769));var g;(function(u){u.details="Details",u.changelog="ChangeLog",u.deps="Dependencies"})(g||(g={}));const c=[g.details,g.changelog,g.deps],h=({resource:u})=>{var d,v,f,a,b,y,S,A,T,w,D,I,O,P,R,M,k,B,x,N,j,K,U,Y,z;const G=(0,m.useInjectable)(_.VSXExtensionServiceToken),[Q,Z]=(0,r.useState)(!0),[$,H]=(0,r.useState)(((d=u.metadata)===null||d===void 0?void 0:d.state)===_.InstallState.INSTALLED?4:0),[X,J]=(0,r.useState)(g.details),[re,ce]=(0,r.useState)({}),fe=(0,r.useCallback)(oe=>{const le=c[oe];le&&J(le)},[]),Ae=(0,r.useCallback)(async()=>{var oe;const le=await G.getRemoteRawExtension((oe=u.metadata)===null||oe===void 0?void 0:oe.extensionId);if(le){const Ee=["readme","changelog"].map(be=>{var Ce,Ne;const tt=(Ce=le.files)===null||Ce===void 0?void 0:Ce[be];return tt?fetch(tt).then(Fe=>Fe.text()):(Ne=le[be])!==null&&Ne!==void 0?Ne:""}),[we,ve]=await Promise.all(Ee);ce({readme:we,changelog:ve,downloadCount:le.downloadCount})}Z(!1)},[u]),te=(0,r.useCallback)(async()=>{var oe;const le=await G.getLocalExtension((oe=u.metadata)===null||oe===void 0?void 0:oe.extensionId);le&&(H(1),G.install(le).finally(()=>{H(4)}))},[u]),Le=(0,r.useCallback)(async()=>{var oe;const le=await G.getLocalExtension((oe=u.metadata)===null||oe===void 0?void 0:oe.extensionId);le&&(H(2),G.uninstall(le).finally(()=>{H(3)}))},[u]);(0,r.useEffect)(()=>{Ae()},[u]);const Te=(0,r.useMemo)(()=>{var oe,le,Ee;const we=[];if(((oe=u.metadata)===null||oe===void 0?void 0:oe.state)!==_.InstallState.NOT_INSTALLED)if($!==3)we.push(r.default.createElement(o.Button,{size:"small",key:"uninstall",onClick:Le,disabled:$===2},(0,E.localize)($===2?"marketplace.extension.uninstalling":"marketplace.extension.uninstall")));else return we.push(r.default.createElement(o.Button,{size:"small",key:"uninstalled",disabled:!0},(0,E.localize)("marketplace.extension.uninstalled"))),we;return((le=u.metadata)===null||le===void 0?void 0:le.state)===_.InstallState.NOT_INSTALLED?$===4?we.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,E.localize)("marketplace.extension.installed"))):we.push(r.default.createElement(o.Button,{size:"small",key:"install",onClick:te,disabled:$!==0},(0,E.localize)($===1?"marketplace.extension.installing":"marketplace.extension.install"))):((Ee=u.metadata)===null||Ee===void 0?void 0:Ee.state)===_.InstallState.SHOULD_UPDATE?$===4?we.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,E.localize)("marketplace.extension.installed"))):we.push(r.default.createElement(o.Button,{size:"small",key:"update",onClick:te,disabled:$!==0},(0,E.localize)($===1?"marketplace.extension.updating":"marketplace.extension.update"))):we.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,E.localize)("marketplace.extension.installed"))),we},[u,$]);return r.default.createElement("div",{className:s.default.extension_overview_container},r.default.createElement(l.Progress,{loading:Q}),r.default.createElement("div",{className:s.default.extension_overview_header},!((v=u.metadata)===null||v===void 0)&&v.iconUrl?r.default.createElement("img",{src:(f=u.metadata)===null||f===void 0?void 0:f.iconUrl,alt:(0,E.replaceLocalizePlaceholder)((a=u.metadata)===null||a===void 0?void 0:a.displayName,(b=u.metadata)===null||b===void 0?void 0:b.extensionId)}):r.default.createElement("div",{className:s.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:s.default.extension_detail},r.default.createElement("div",{className:s.default.extension_name},r.default.createElement("h1",null,r.default.createElement("a",{href:`${(y=u.metadata)===null||y===void 0?void 0:y.openVSXRegistry}/extension/${(S=u.metadata)===null||S===void 0?void 0:S.namespace.toLowerCase()}/${(A=u.metadata)===null||A===void 0?void 0:A.name.toLowerCase()}`,target:"_blank",rel:"noopener noreferrer"},(0,E.replaceLocalizePlaceholder)((T=u.metadata)===null||T===void 0?void 0:T.displayName,(w=u.metadata)===null||w===void 0?void 0:w.extensionId)||((D=u.metadata)===null||D===void 0?void 0:D.name))),r.default.createElement("span",{className:s.default.extension_id},((I=u.metadata)===null||I===void 0?void 0:I.namespace.toLowerCase())+"."+((O=u.metadata)===null||O===void 0?void 0:O.name.toLowerCase()))),r.default.createElement("div",{className:s.default.manifest},r.default.createElement("span",null,r.default.createElement("a",{href:(P=u.metadata)===null||P===void 0?void 0:P.namespaceUrl,target:"_blank",rel:"noopener noreferrer"},(R=u.metadata)===null||R===void 0?void 0:R.namespace)),r.default.createElement("span",null,r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),((M=u.metadata)===null||M===void 0?void 0:M.downloadCount)||re.downloadCount),((k=u.metadata)===null||k===void 0?void 0:k.averageRating)&&r.default.createElement("span",null,(B=u.metadata)===null||B===void 0?void 0:B.averageRating),((x=u.metadata)===null||x===void 0?void 0:x.repository)&&r.default.createElement("span",null,r.default.createElement("a",{href:(N=u.metadata)===null||N===void 0?void 0:N.repository,target:"blank"},"Repository")),((j=u.metadata)===null||j===void 0?void 0:j.license)&&r.default.createElement("span",null,r.default.createElement("a",{href:(K=u.metadata)===null||K===void 0?void 0:K.files.license,target:"blank"},"License")),r.default.createElement("span",null,"v",(U=u.metadata)===null||U===void 0?void 0:U.version)),r.default.createElement("div",{className:s.default.description},(0,E.replaceLocalizePlaceholder)((Y=u.metadata)===null||Y===void 0?void 0:Y.description,(z=u.metadata)===null||z===void 0?void 0:z.extensionId)),r.default.createElement("div",{className:s.default.buttons},Te))),r.default.createElement("div",{className:s.default.extension_overview_body},r.default.createElement(o.Tabs,{className:s.default.tabs,value:X,onChange:fe,tabs:[g.details,g.changelog]}),r.default.createElement("div",{className:s.default.extension_content},X===g.details&&re.readme&&r.default.createElement(p.Markdown,{content:re.readme}),X===g.changelog&&re.changelog&&r.default.createElement(p.Markdown,{content:re.changelog}))))};t.ExtensionOverview=h},87791:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extension=t.ExtensionViewType=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),m=e(43718),E=e(29150),p=n.__importDefault(e(90425));var _;(function(s){s[s.MARKETPLACE=0]="MARKETPLACE",s[s.INSTALLED=1]="INSTALLED"})(_||(t.ExtensionViewType=_={})),t.Extension=r.default.memo(({extension:s,onInstall:g,onClick:c,type:h,installedExtensions:u,openVSXRegistry:d})=>{const v=(0,l.useDesignStyles)(p.default.extension_item,"extension_item"),[f,a]=(0,r.useState)(),b=u?.find(I=>I.namespace===s.namespace&&I.name===s.name),y=!!(h===_.INSTALLED||b),S=y&&h===_.MARKETPLACE&&b?.version!==s.version,[A,T]=(0,r.useState)(y),w=(0,r.useCallback)(I=>{I.stopPropagation(),a(!0),g(s).then(()=>{a(!1),T(!0)})},[s]),D=(0,r.useCallback)(()=>{c(s,A?S?E.InstallState.SHOULD_UPDATE:E.InstallState.INSTALLED:E.InstallState.NOT_INSTALLED)},[s]);return r.default.createElement("div",{className:v,onClick:D},s.iconUrl?r.default.createElement("img",{className:p.default.icon,src:s.iconUrl,alt:(0,m.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)}):r.default.createElement("div",{className:p.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:p.default.extension_detail},r.default.createElement("div",{className:p.default.base_info},r.default.createElement("span",{className:p.default.display_name},(0,m.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)||s.name),r.default.createElement("span",{className:p.default.version},s.version),!A&&r.default.createElement("span",{className:p.default.download_count},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),s.downloadCount)),r.default.createElement("span",{className:p.default.description},(0,m.replaceLocalizePlaceholder)(s.description,`${s.publisher}.${s.name}`)),r.default.createElement("div",{className:p.default.footer},r.default.createElement("span",{className:p.default.namespace},s.namespace),h===_.MARKETPLACE&&(y?S?r.default.createElement(o.Button,{type:"primary",size:"small",onClick:w,disabled:f},(0,m.localize)(f?"marketplace.extension.updating":"marketplace.extension.update")):r.default.createElement("span",{className:p.default.state_text},(0,m.localize)("marketplace.extension.installed")):r.default.createElement(o.Button,{type:"primary",size:"small",onClick:w,disabled:f},(0,m.localize)(f?"marketplace.extension.installing":"marketplace.extension.install"))),h===_.INSTALLED&&r.default.createElement(o.Button,{type:"primary",size:"small",onClick:w,disabled:!0},(0,m.localize)("marketplace.extension.installed")))))})},38105:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OpenVsxExtensionManagerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(29150),m=e(70274),E=e(67761);let p=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[m.VSXExtensionContribution,{token:l.VSXExtensionServiceToken,useClass:E.VSXExtensionService}],this.backServices=[{servicePath:l.VSXExtensionServicePath}]}};t.OpenVsxExtensionManagerModule=p,t.OpenVsxExtensionManagerModule=p=n.__decorate([(0,r.Injectable)()],p)},70274:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(57517),E=e(63067),p=e(52416),_=e(29150),s=e(21082),g=e(6449),c=e(73689);let h=class{initialize(){}onDidRender(){const d=this.mainLayoutService.getTabbarHandler(s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID);d&&(d.isActivated()?this.vsxExtensionService.getOpenVSXRegistry().then(()=>{this.vsxExtensionService.search("")}):d.onActivate(async()=>{!this.vsxExtensionService.openVSXRegistry&&await this.vsxExtensionService.getOpenVSXRegistry(),this.vsxExtensionService.search("")}))}registerResource(d){d.registerResourceProvider({scheme:s.EXTENSION_SCHEME,provideResource:async v=>{const{extensionId:f,state:a}=v.getParsedQuery(),b=await this.vsxExtensionService.getLocalExtension(f),y=this.iconService.fromIcon("",b?.iconUrl,p.IconType.Background);return{uri:v,metadata:{...b,extensionId:f,state:a,openVSXRegistry:this.vsxExtensionService.openVSXRegistry},icon:y||(0,o.getIcon)("extension"),name:(0,l.replaceLocalizePlaceholder)(b?.displayName,f)||""}}})}registerEditorComponent(d){const v=`${s.EXTENSION_SCHEME}_detail`;d.registerEditorComponent({component:g.ExtensionOverview,uid:v,scheme:s.EXTENSION_SCHEME}),d.registerEditorComponentResolver(s.EXTENSION_SCHEME,(f,a,b)=>{b?.([{type:m.EditorOpenType.component,componentId:v}])})}registerComponent(d){d.register("@opensumi/ide-extension-manager",[],{iconClass:(0,o.getIcon)("extension"),title:(0,l.localize)("marketplace.extension.container"),priority:5,containerId:s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,component:c.VSXExtensionView,activateKeyBinding:"ctrlcmd+shift+x"})}};t.VSXExtensionContribution=h,n.__decorate([(0,r.Autowired)(E.IMainLayoutService),n.__metadata("design:type",Object)],h.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(_.VSXExtensionServiceToken),n.__metadata("design:type",Object)],h.prototype,"vsxExtensionService",void 0),n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],h.prototype,"iconService",void 0),t.VSXExtensionContribution=h=n.__decorate([(0,l.Domain)(o.ClientAppContribution,E.MainLayoutContribution,o.ComponentContribution,m.BrowserEditorContribution)],h)},67761:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57517),m=e(98453),E=e(71354),p=e(28423),_=e(52416),s=e(12456),g=e(29150);let c=class extends o.Disposable{get extensions(){return this.extensionsObservable.get()}get installedExtensions(){return this.installedExtensionsObservable.get()}get openVSXRegistry(){return this.openVSXRegistryObservable.get()}constructor(){super(),this.extensionsObservable=(0,p.observableValue)(this,[]),this.installedExtensionsObservable=(0,p.observableValue)(this,[]),this.openVSXRegistryObservable=(0,p.observableValue)(this,""),this.tasks=new Map,this.getInstalledExtensions(),this.disposables.push(this.extensionInstanceService.onDidChange(()=>{this.getInstalledExtensions(),this.search(this.searchValue)}))}updateStatusBar(){if(this.tasks.size===0){this.installStatus&&(this.installStatus.dispose(),this.installStatus=void 0);return}const u="sumi-upload-file-status";if(this.tasks.size===1){const d=(0,o.localize)("marketplace.extension.installing"),v={text:d,alignment:o.StatusBarAlignment.RIGHT,tooltip:d,iconClass:"kaitian-icon kticon-cloud-server"};this.installStatus=this.statusBarService.addElement(u,v)}}async install(u){var d,v;const f=this.getExtensionId(u);if(this.tasks.has(f)||!u.downloadUrl)return;const a=this.backService.install({id:f,name:(d=u.name)!==null&&d!==void 0?d:"-",url:u.downloadUrl,version:(v=u.version)!==null&&v!==void 0?v:"-"});return this.tasks.set(f,a),this.updateStatusBar(),a.then(async b=>{if(this.tasks.delete(f),this.updateStatusBar(),await this.extensionManagementService.postChangedExtension(!1,b),this.themeService.getAvailableThemeInfos().some(T=>T.extensionId===u.originId)){this.commandService.executeCommand(s.THEME_TOGGLE_COMMAND.id,{extensionId:u.originId});return}if(this.iconService.getAvailableThemeInfos().some(T=>T.extensionId===u.originId)){this.commandService.executeCommand(s.ICON_THEME_TOGGLE_COMMAND.id,{extensionId:u.originId});return}if(this.productIconService.getAvailableThemeInfos().some(T=>T.extensionId===u.originId)){this.commandService.executeCommand(s.PRODUCT_ICON_THEME_TOGGLE_COMMAND.id,{extensionId:u.originId});return}})}async uninstall(u){u&&u.path&&await this.extensionManagementService.postUninstallExtension(u.path)}async disable(u){u&&u.path&&this.extensionManagementService.postDisableExtension(u.path)}async enable(u){u&&u.path&&this.extensionManagementService.postEnableExtension(u.path)}getExtensionId(u){var d,v,f;return(d=u?.extensionId)!==null&&d!==void 0?d:((v=u?.namespace)===null||v===void 0?void 0:v.toLowerCase())+"."+((f=u?.name)===null||f===void 0?void 0:f.toLowerCase())}async getLocalExtension(u){return u?this.extensions.find(v=>this.getExtensionId(v)===u)||this.installedExtensions.find(v=>this.getExtensionId(v)===u):void 0}async getRemoteRawExtension(u){if(!u)return;const d={extensionId:u},v=await this.backService.getExtension(d);if(v&&v.extensions&&v.extensions.length>=1)return Object.assign({},v.extensions[0])}async getOpenVSXRegistry(){const u=await this.backService.getOpenVSXRegistry();(0,p.transaction)(d=>{this.openVSXRegistryObservable.set(u,d)})}async openExtensionEditor(u,d){this.workbenchEditorService.open(new o.URI(`extension://?extensionId=${u}&state=${d}`),{preview:!0})}async search(u){const d={query:u,size:50,sortBy:"downloadCount"};this.searchValue=u;const v=await this.backService.search(d);v.extensions&&(0,p.transaction)(f=>{this.extensionsObservable.set(v.extensions.filter(a=>!this.installedExtensions.find(b=>this.getExtensionId(b)===this.getExtensionId(a))).map(a=>({...a,publisher:a.namespace,iconUrl:a.files.icon,downloadUrl:a.files.download,readme:a.files.readme})),f)})}async searchInstalledExtensions(u){(0,p.transaction)(d=>{const v=this.installedExtensions;this.installedExtensionsObservable.set(v.sort((f,a)=>{const b=(0,o.fuzzyScore)(u,u.toLowerCase(),0,f.name,f.name.toLowerCase(),0,!0),y=(0,o.fuzzyScore)(u,u.toLowerCase(),0,a.name,a.name.toLowerCase(),0,!0);return b?y?y[0]-b[0]:-1:1}),d)})}getInstalledExtensions(){const u=this.extensionInstanceService.getExtensionInstances().map(d=>{const v=d.extensionId;return{namespace:v&&v.includes(".")?v.split(".")[0]:d.packageJSON.publisher,name:d.packageJSON.name,id:d.extensionId,version:d.packageJSON.version,displayName:d.packageJSON.displayName,description:d.packageJSON.description,publisher:d.packageJSON.publisher,iconUrl:d.packageJSON.icon&&d.extensionLocation.toString()+`/${d.packageJSON.icon}`,path:d.path,realpath:d.realPath}});(0,p.transaction)(d=>{this.installedExtensionsObservable.set(u,d)})}};t.VSXExtensionService=c,n.__decorate([(0,r.Autowired)(g.VSXExtensionServicePath),n.__metadata("design:type",Object)],c.prototype,"backService",void 0),n.__decorate([(0,r.Autowired)(l.WorkbenchEditorService),n.__metadata("design:type",l.WorkbenchEditorService)],c.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(E.AbstractExtInstanceManagementService),n.__metadata("design:type",E.AbstractExtInstanceManagementService)],c.prototype,"extensionInstanceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.ExtensionManagementService)],c.prototype,"extensionManagementService",void 0),n.__decorate([(0,r.Autowired)(_.IThemeService),n.__metadata("design:type",Object)],c.prototype,"themeService",void 0),n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],c.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(_.IProductIconService),n.__metadata("design:type",Object)],c.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],c.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.IStatusBarService),n.__metadata("design:type",Object)],c.prototype,"statusBarService",void 0),n.__decorate([(0,o.pMemoize)(h=>h),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",Promise)],c.prototype,"search",null),t.VSXExtensionService=c=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],c)},73689:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importStar(e(14041)),l=e(14041),m=e(97267),E=e(41869),p=e(68974),_=e(43718),s=e(5567),g=e(29150),c=e(21082),h=e(87791),u=n.__importDefault(e(68143)),d=[g.TabActiveKey.MARKETPLACE,g.TabActiveKey.INSTALLED],v=()=>{const[f,a]=(0,l.useState)(g.TabActiveKey.MARKETPLACE),[b,y]=(0,l.useState)(!1),S=(0,E.useInjectable)(g.VSXExtensionServiceToken),A=(0,E.useAutorun)(S.extensionsObservable),T=(0,E.useAutorun)(S.installedExtensionsObservable),w=(0,E.useAutorun)(S.openVSXRegistryObservable),D=(0,r.default)(R=>{y(!0);let M;f===g.TabActiveKey.MARKETPLACE?M=S.search(R):M=S.searchInstalledExtensions(R),typeof M=="object"&&M.then&&M.then(()=>{y(!1)})},500),I=(0,l.useCallback)(R=>S.install(R),[]),O=(0,l.useCallback)((R,M)=>{const k=S.getExtensionId(R);S.openExtensionEditor(k,M)},[]),P=(0,l.useCallback)(R=>{const M=d[R];M&&a(M)},[]);return o.createElement("div",{className:u.default.panel},o.createElement(m.Tabs,{mini:!0,className:u.default.tabs,value:d.indexOf(f),onChange:P,tabs:[(0,_.localize)("marketplace.panel.tab.marketplace"),(0,_.localize)("marketplace.tab.installed")]}),o.createElement("div",{style:{padding:"8px"}},o.createElement(s.AutoFocusedInput,{containerId:c.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,placeholder:(0,_.localize)("marketplace.panel.tab.placeholder.search"),value:"",onChange:R=>D(R.target.value)})),f===g.TabActiveKey.MARKETPLACE&&o.createElement("div",{className:u.default.extensions_view},o.createElement(p.Progress,{loading:b}),A.map((R,M)=>o.createElement(h.Extension,{key:`${M}:${R.namespace}-${R.name}`,onClick:O,onInstall:I,extension:R,type:h.ExtensionViewType.MARKETPLACE,installedExtensions:T,openVSXRegistry:w}))),f===g.TabActiveKey.INSTALLED&&o.createElement("div",{className:u.default.extensions_view},T.map((R,M)=>o.createElement(h.Extension,{key:`${M}:${R.namespace}-${R.name}`,onClick:O,onInstall:I,extension:R,type:h.ExtensionViewType.INSTALLED,openVSXRegistry:w}))))};t.VSXExtensionView=v},29150:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IOpenvsxMarketplaceService=t.VSXExtensionServicePath=t.VSXExtensionServiceToken=t.VSXExtension=t.InstallState=t.TabActiveKey=t.EnableScope=void 0;var e;(function(l){l.GLOBAL="GLOBAL",l.WORKSPACE="WORKSPACE"})(e||(t.EnableScope=e={}));var n;(function(l){l.MARKETPLACE="marketplace",l.INSTALLED="installed"})(n||(t.TabActiveKey=n={}));var r;(function(l){l.INSTALLED="INSTALLED",l.NOT_INSTALLED="NOT_INSTALLED",l.SHOULD_UPDATE="SHOULD_UPDATE"})(r||(t.InstallState=r={}));class o{}t.VSXExtension=o,o.KEYS=new Set(["version","iconUrl","publisher","name","displayName","description","averageRating","downloadCount","downloadUrl","readmeUrl","licenseUrl","repository","license","readme","preview","namespaceAccess","publishedBy"]),t.VSXExtensionServiceToken=Symbol("VSXExtensionSerivceToken"),t.VSXExtensionServicePath="VSXExtensionServicePath",t.IOpenvsxMarketplaceService=Symbol("IOpenvsxMarketplaceService")},53599:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageContribution=t.ExtensionStorageModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93584),m=e(7446),E=e(16132),p=e(10207),_=e(19227);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IExtensionStorageService,useClass:p.ExtensionStorageService},{token:l.IExtensionStoragePathServer,useClass:E.ExtensionStoragePathServer},{token:l.IExtensionStorageServer,useClass:m.ExtensionStorageServer},g]}};t.ExtensionStorageModule=s,t.ExtensionStorageModule=s=n.__decorate([(0,o.Domain)(_.name)],s);let g=class{onReconnect(){this.extensionStorageService.reConnectInit()}};t.ExtensionStorageContribution=g,n.__decorate([(0,r.Autowired)(l.IExtensionStorageService),n.__metadata("design:type",Object)],g.prototype,"extensionStorageService",void 0),t.ExtensionStorageContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],g),n.__exportStar(e(10207),t)},16132:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStoragePathServer=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(96405),E=e(14951),p=e(73344),_=e(51500),{Path:s}=l.path;let g=class{constructor(){this.windowsDataFolders=[l.StoragePaths.WINDOWS_APP_DATA_DIR,l.StoragePaths.WINDOWS_ROAMING_DIR],this.deferredWorkspaceStoragePath=new l.Deferred,this.deferredStoragePath=new l.Deferred,this.storagePathInitialized=!1}get workspaceSuffixName(){return this.appConfig.workspaceSuffixName||_.DEFAULT_WORKSPACE_SUFFIX_NAME}async provideHostLogPath(){const h=await this.getLogsDirPath();if(!h)throw new Error("Unable to get parent log directory");const u=h,d=l.URI.file(u).toString();return await this.fileSystem.access(d)||await this.fileSystem.createFolder(d),new l.URI(h)}async provideHostStoragePath(h,u,d){const v=await this.getWorkspaceStorageDirPath(d);if(!v)throw new Error("Unable to get parent storage directory");await this.fileSystem.access(l.URI.file(v).toString())||await this.fileSystem.createFolder(l.URI.file(v).toString());const f=await this.buildWorkspaceId(h,u,d),a=new s(v).join(f).toString();await this.fileSystem.access(l.URI.file(a).toString())||await this.fileSystem.createFolder(l.URI.file(a).toString());const b=new l.URI(a);return this.storagePathInitialized||(this.deferredWorkspaceStoragePath.resolve(b.path.toString()),this.deferredStoragePath.resolve(v),this.storagePathInitialized=!0),this.cachedStoragePath=b}async getLastWorkspaceStoragePath(){var h;return this.storagePathInitialized?(h=this.cachedStoragePath)===null||h===void 0?void 0:h.path.toString():this.deferredWorkspaceStoragePath.promise}async getLastStoragePath(){return this.deferredStoragePath.promise}doHash(h){return this.hashCalculateService.calculate(h)}async buildWorkspaceId(h,u,d){const v=await this.getUserHomeDir(),f=y=>y.resolve(d||_.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${_.UNTITLED_WORKSPACE}.${this.workspaceSuffixName}`).withScheme(l.Schemes.file),a=y=>y.resolve(d||_.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${_.UNTITLED_WORKSPACE}`).withScheme(l.Schemes.file);if(!h){const y=a(new l.URI(v));return this.doHash(y.toString())}if(f(new l.URI(v)).toString()===h.uri){const y=u.map(S=>S.uri).sort().join(",");return this.doHash(y)}else{const y=new l.URI(h.uri);return this.doHash(y.toString())}}async getLogsDirPath(){const h=await this.loggerManager.getLogFolder();return new s(h).join(l.StoragePaths.EXTENSIONS_LOGS_DIR).toString()}async getWorkspaceStorageDirPath(h){const u=await this.getWorkspaceDataDirPath(h);return new s(u).join(l.StoragePaths.EXTENSIONS_WORKSPACE_STORAGE_DIR).toString()}async getWorkspaceDataDirPath(h){const u=await this.getUserHomeDir(),d=h;return new s(u).join(...l.isWindows?this.windowsDataFolders:[""],d).toString()}async getUserHomeDir(){const h=await this.fileSystem.getCurrentUserHome();if(!h)throw new Error("Unable to get user home directory");return await this.fileSystem.getFsPath(h.uri)}};t.ExtensionStoragePathServer=g,n.__decorate([(0,r.Autowired)(E.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(p.ILoggerManagerClient),n.__metadata("design:type",Object)],g.prototype,"loggerManager",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(m.IHashCalculateService),n.__metadata("design:type",Object)],g.prototype,"hashCalculateService",void 0),t.ExtensionStoragePathServer=g=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],g)},7446:(L,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageServer=void 0;const r=e(85608),o=e(76003),l=e(43718),m=e(14951),E=e(93584),{Path:p}=l.path;let _=n=class{constructor(){this.deferredWorkspaceDataDirPath=new l.Deferred,this.storageThrottler=new l.Throttler,this.storageTasks={},this.storageExistPromises=new Map}async init(g,c,h){return this.storageDelayer=new l.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),await this.setupDirectories(g,c,h||E.DEFAULT_EXTENSION_STORAGE_DIR_NAME)}async asAccess(g,c){if(c)return await this.fileSystem.access(g);if(!this.storageExistPromises.has(g)){const h=this.fileSystem.access(g);this.storageExistPromises.set(g,h)}return await this.storageExistPromises.get(g)}async setupDirectories(g,c,h){const u=await this.extensionStoragePathsServer.getWorkspaceDataDirPath(h),d=l.URI.file(u).toString();await this.fileSystem.access(d)||await this.fileSystem.createFolder(d),this.workspaceDataDirPath=u,this.globalDataPath=new p(this.workspaceDataDirPath).join(l.StoragePaths.EXTENSIONS_GLOBAL_STORAGE_DIR).toString();const v=l.URI.file(this.globalDataPath).toString();await this.fileSystem.access(v)||await this.fileSystem.createFolder(v),this.deferredWorkspaceDataDirPath.resolve(this.workspaceDataDirPath);const f=await this.extensionStoragePathsServer.provideHostLogPath(),a=await this.extensionStoragePathsServer.provideHostStoragePath(g,c,h);return{logUri:f.codeUri,storageUri:a.codeUri,globalStorageUri:l.Uri.file(this.globalDataPath)}}async resolveStorageTask(g){const c=Object.keys(g);for(const h of c){const u=await this.readFromFile(h);for(const{key:d,value:v}of g[h])v===void 0||(0,l.isEmptyObject)(v)?delete u[d]:u[d]=v;await this.writeToFile(h,u)}}doSet(){const g={...this.storageTasks};return this.storageTasks={},this.resolveStorageTask(g)}async set(g,c,h){const u=await this.getDataPath(h);if(!u)throw new Error("Cannot save data: no opened workspace");return this.storageTasks[u]||(this.storageTasks[u]=[]),this.storageTasks[u].push({key:g,value:c}),this.storageDelayer.trigger(()=>this.storageThrottler.queue(this.doSet.bind(this)))}async get(g,c){const h=await this.getDataPath(c);return h?(await this.readFromFile(h))[g]:{}}async getAll(g){const c=await this.getDataPath(g);return c?await this.readFromFile(c):{}}async getDataPath(g){if(this.workspaceDataDirPath===void 0&&await this.deferredWorkspaceDataDirPath.promise,g)return new p(this.globalDataPath).join("global-state.json").toString();{const c=await this.extensionStoragePathsServer.getLastWorkspaceStoragePath();return c?new p(c).join("workspace-state.json").toString():void 0}}async readFromFile(g){const c=l.URI.file(g);if(!await this.asAccess(c.toString(),!0))return{};try{const{content:u}=await this.fileSystem.readFile(c.toString());return JSON.parse(u.toString())}catch(u){return this.logger.error('Failed to parse data from "',c.toString(),'". Reason:',u),{}}}async writeToFile(g,c){const h=l.URI.file(g);await this.asAccess(h.parent.toString())||await this.fileSystem.createFolder(h.parent.toString());const d=JSON.stringify(c);let v=await this.fileSystem.getFileStat(h.toString());v||(v=await this.fileSystem.createFile(h.toString())),await this.fileSystem.setContent(v,d)}};t.ExtensionStorageServer=_,_.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(E.IExtensionStoragePathServer),r.__metadata("design:type",Object)],_.prototype,"extensionStoragePathsServer",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],_.prototype,"fileSystem",void 0),r.__decorate([(0,o.Autowired)(l.ILogger),r.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.ExtensionStorageServer=_=n=r.__decorate([(0,o.Injectable)()],_)},10207:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(51500),E=e(93584);let p=class{constructor(){this._init=this.init(),this.updateEnvState()}get whenReady(){return this._init}get extensionStoragePath(){return this._extensionStoragePath}async init(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,c=this.appConfig.extensionStorageDirName||E.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,c),this._extensionStoragePath}async updateEnvState(){await this.get(l.firstSessionDateStorageKey,!0)===void 0&&await this.set(l.firstSessionDateStorageKey,{date:new Date().toUTCString()},!0)}set(s,g,c){return this.extensionStorageServer.set(s,g,c)}get(s,g){return this.extensionStorageServer.get(s,g)}getAll(s=!1){return this.extensionStorageServer.getAll(s)}async reConnectInit(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,c=this.appConfig.extensionStorageDirName||E.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,c),this._extensionStoragePath}};t.ExtensionStorageService=p,n.__decorate([(0,r.Autowired)(E.IExtensionStorageServer),n.__metadata("design:type",Object)],p.prototype,"extensionStorageServer",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),t.ExtensionStorageService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},93584:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(85853),t),n.__exportStar(e(56969),t),n.__exportStar(e(23618),t)},85853:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=t.IExtensionStoragePathServer=void 0,t.IExtensionStoragePathServer=Symbol("IExtensionStoragePathServer"),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=".sumi"},56969:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IExtensionStorageService=t.IExtensionStorageServer=void 0,t.IExtensionStorageServer=Symbol("ExtensionStorageServer"),t.IExtensionStorageService=Symbol("ExtensionStorageService")},23618:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},50492:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(93584),t)},57962:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivationEventServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(80076)),o=e(76003),l=e(43718);let m=class{constructor(){this.eventListeners=new Map,this.collectTopicData=new l.MultiMap,this.wildCardTopics=new Set,this.activatedEventSet=new Set,this.wildCardTopics.add("workspaceContains")}getTopicsData(p){return this.collectTopicData.get(p)||[]}async fireEvent(p,_=""){this.activatedEventSet.add(JSON.stringify({topic:p,data:_}));let s;if(this.wildCardTopics.has(p)?s=this.eventListeners.get(p):this.eventListeners.has(p)?s=this.eventListeners.get(p):s=this.eventListeners.get(p+":"+_),s){const g=await Promise.allSettled(s.map(c=>this.tryRun(p,_,c)));for(const c of g)c.status==="rejected"&&this.logger.error(`fire event ${p}:${_} error: ${c.reason}`)}}addWildCardTopic(p){return this.wildCardTopics.add(p),{dispose:()=>{this.wildCardTopics.delete(p)}}}onEvent(p,_){const s=p.indexOf(":");let g,c;return s===-1?(g=p,c=""):(g=p.substr(0,s),c=p.substr(s+1)),this.addListener(g,{topic:g,data:c,execute:_})}addListener(p,_){if(this.collectTopicData.set(_.topic,_.data),this.wildCardTopics.has(p))return this.eventListeners.has(p)||this.eventListeners.set(p,[]),this.eventListeners.get(p).push(_),{dispose:()=>{const s=this.eventListeners.get(p).indexOf(_);s!==-1&&this.eventListeners.get(p).splice(s,1)}};{const s=p+":"+_.data;return this.eventListeners.has(s)||this.eventListeners.set(s,[]),this.eventListeners.get(s).push(_),{dispose:()=>{const g=this.eventListeners.get(s).indexOf(_);g!==-1&&this.eventListeners.get(s).splice(g,1)}}}}async tryRun(p,_,s){this.wildCardTopics.has(p)?(0,r.default)(s.data)(_)&&await s.execute():await s.execute()}};t.ActivationEventServiceImpl=m,n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.ActivationEventServiceImpl=m=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],m)},63056:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionNoExportsView=t.ExtensionLoadingView=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(68974),m=n.__importDefault(e(17267)),E=({style:_})=>r.default.createElement("div",{style:_||{},className:m.default.kt_extension_view},r.default.createElement(l.Progress,{loading:!0}));t.ExtensionLoadingView=E;const p=(_,s)=>r.default.createElement("div",{className:m.default.kt_extension_no_exports_view},(0,o.formatLocalize)("extension.no.view.found",_,s));t.ExtensionNoExportsView=p},56405:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PortalRoot=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),m=e(87420),E=e(25600),p=_=>{var s;const[g,c]=o.default.useState(null),h=(0,l.useInjectable)(E.AbstractViewExtProcessService),u=(0,l.useInjectable)(m.IThemeService);o.default.useEffect(()=>{const v=new l.DisposableCollection;return u.getCurrentTheme().then(f=>c(f.type)),v.push(u.onThemeChange(f=>{f.type&&f.type!==g&&c(f.type)})),v.dispose.bind(v)},[]);const d=_.original;return o.default.createElement(d,{..._.otherProps,className:(0,r.default)((s=_.otherProps)===null||s===void 0?void 0:s.className,(0,m.getThemeTypeSelector)(g)),getContainer:()=>h.getPortalShadowRoot(_.extensionId)})};t.PortalRoot=p},82443:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TREE_VIEW_NODE_HEIGHT=t.TreeViewNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),m=e(41869),E=e(25918),p=e(93899),_=e(95422),s=e(69589),g=e(42912),c=n.__importDefault(e(50790)),h=({item:u,onClick:d,onChange:v,onContextMenu:f,itemType:a,leftPadding:b=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,treeViewId:T,decorationService:w,draggable:D,onDragStart:I,onDragEnter:O,onDragLeave:P,onDragOver:R,onDrop:M})=>{const k=(0,_.useInjectable)(g.IIconService),B=(0,m.useDesignStyles)(c.default.expansion_toggle,"expansion_toggle"),x=(0,m.useDesignStyles)(c.default.tree_view_node,"tree_view_node"),[N,j]=(0,o.useState)(u.uri&&w.getDecoration(u.uri,!1));(0,o.useEffect)(()=>{const be=w.onDidChangeDecorations(Ce=>{u.uri&&Ce.affectsResource(u.uri)&&j(w.getDecoration(u.uri,!1))});return()=>{be.dispose()}},[]);const K=(0,_.useInjectable)(g.IThemeService),U=(0,o.useCallback)(be=>{(a===l.TreeNodeType.TreeNode||a===l.TreeNodeType.CompositeTreeNode)&&d(be,u,a)},[u,a,d]),Y=(0,o.useCallback)(be=>{(a===l.TreeNodeType.TreeNode||a===l.TreeNodeType.CompositeTreeNode)&&(y?y(be,u,a):d(be,u,a))},[u,a,y,d]),z=(0,o.useCallback)(be=>{be.nativeEvent.which===0||!f||(a===l.TreeNodeType.TreeNode||a===l.TreeNodeType.CompositeTreeNode)&&f(be,u,a)},[u,a,f]),G=(0,o.useCallback)(be=>{I&&I(be,u)},[u,I]),Q=(0,o.useCallback)(be=>{O&&O(be,u)},[u,O]),Z=(0,o.useCallback)(be=>{P&&P(be,u)},[u,P]),$=(0,o.useCallback)(be=>{R&&R(be,u)},[u,R]),H=(0,o.useCallback)(be=>{M&&M(be,u)},[u,M]),X=(0,o.useCallback)(be=>{v(u),be.stopPropagation()},[u,v]),J=a===l.TreeNodeType.CompositeTreeNode,re=J?`${A+(u.depth||0)*(b||0)}px`:`${A+(u.depth||0)*(b||0)+8}px`,ce={height:t.TREE_VIEW_NODE_HEIGHT,lineHeight:`${t.TREE_VIEW_NODE_HEIGHT}px`,paddingLeft:re},fe=(be,Ce)=>S&&S?.classlist.indexOf(c.default.mod_loading)>-1?o.default.createElement(l.Loading,null):o.default.createElement("div",{onClick:Ce,className:(0,r.default)(c.default.tree_view_node_segment,B,(0,m.getIcon)("arrow-right"),{[`${c.default.mod_collapsed}`]:!be.expanded})}),Ae=be=>o.default.createElement("div",{className:(0,r.default)(c.default.file_icon,be.icon),style:{maxHeight:t.TREE_VIEW_NODE_HEIGHT}}),te=be=>{var Ce;return be.checkboxInfo===void 0?null:o.default.createElement(l.CheckBox,{"data-node-id":be.treeItemId,readOnly:!0,onChange:Ne=>X(Ne),checked:!!be.checkboxInfo.checked,id:be.treeItemId,role:(Ce=be.checkboxInfo.accessibilityInformation)===null||Ce===void 0?void 0:Ce.role,title:be.checkboxInfo.tooltip})},Le=be=>{const Ce=()=>{if(be.highlights){let Ne=[],tt=0;const Fe=be.highlights.sort(($e,Se)=>$e[0]-Se[0]);return Ne=Fe.map(($e,Se)=>{const[ae,ye]=$e,Re=be.displayName.slice(tt,ae);tt=ye;const Be=be.displayName.slice(ae,ye),ze=[o.default.createElement("span",{key:`line_begin_${Se}_${Re}`},Re),o.default.createElement("span",{className:c.default.highlight,key:`line_hightlight_${Se}_${Be}`},Be)];if(Se===Fe.length-1){const Qe=be.displayName.slice(ye);ze.push(o.default.createElement("span",{key:`line_end_${Se}_${Qe}`},Qe))}return ze}),Ne}else return be.displayName};return o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_segment,c.default.tree_view_node_displayname,be.strikethrough&&c.default.strikethrough)},Ce())},Te=()=>o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_segment,c.default.tree_view_node_tail)},oe()),oe=()=>{if(u.actions.length>0)return o.default.createElement("div",{className:c.default.tree_view_actions},o.default.createElement(E.TitleActionList,{className:c.default.inlineMenu,context:[{treeViewId:T,treeItemId:u.treeItemId}],nav:u.actions,menuId:p.MenuId.ViewItemContext}))},le=be=>{if(J)return fe(be,Y)},Ee=()=>u.tooltip||u.name,we=be=>o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_segment_grow,c.default.tree_view_node_description)},!be.name&&!be.description?"\u2014\u2014":be.description),ve=()=>{if(!N)return null;const be=N.badge||"",Ce=N.color,Ne=Ce&&K.getColor({id:Ce});return o.default.createElement("div",{className:c.default.tree_view_node_tail,style:{color:Ne}},(0,s.transformLabelWithCodicon)(be.slice(),{},k.fromString.bind(k)))};return o.default.createElement("div",{key:u.id,onClick:U,onContextMenu:z,onDragStart:G,onDragOver:$,onDragEnter:Q,onDragLeave:Z,onDrop:H,title:Ee(),className:(0,r.default)(x,S?S.classlist:null),"data-id":u.id,style:ce,draggable:D},o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_content)},le(u),te(u),Ae(u),o.default.createElement("div",{className:c.default.tree_view_node_overflow_wrap},Le(u),we(u)),Te(),ve()))};t.TreeViewNode=h,t.TREE_VIEW_NODE_HEIGHT=22},81302:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTabBarTreeView=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),m=e(68974),E=e(41893),p=e(24429),_=e(72260),s=e(82443),g=n.__importDefault(e(17267)),c=({viewState:d,model:v,dataProvider:f,treeViewId:a})=>{const b=(0,l.useInjectable)(_.IMainLayoutService),y=(0,l.useInjectable)(E.IDecorationsService),S=(0,r.useMemo)(()=>b.getViewAccordionService(a),[]),A=(0,r.useMemo)(()=>{const G=S?.getViewState(a);return G?!G.collapsed&&!G.hidden:!1},[S]),{height:T}=d,{canSelectMany:w}=v.treeViewOptions||{},D=(0,r.useRef)(null),I=(0,r.useCallback)(G=>{v.handleTreeHandler({...G,getModel:()=>v.treeModel,hasDirectFocus:()=>D.current===document.activeElement})},[v]),O=(0,r.useCallback)((G,Q)=>{G.stopPropagation();const{toggleDirectory:Z}=v;Z(Q)},[v]),P=(0,r.useCallback)(G=>R(G)?!1:G.shiftKey,[]),R=(0,r.useCallback)(G=>{const{metaKey:Q,ctrlKey:Z}=G;return l.isOSX&&Q||Z},[]),M=(0,r.useCallback)((G,Q,Z)=>{G.stopPropagation();const{handleItemClick:$,handleItemToggleClick:H,handleItemRangeClick:X}=v;if(!Q)return;const J=P(event),re=R(event);w?J?X(Q,Z):re?H(Q,Z):$(Q,Z):$(Q,Z)},[w,v]),k=(0,r.useCallback)(G=>{const{handleCheckBoxChange:Q}=v;G&&Q(G)},[v]),B=(0,r.useCallback)((G,Q)=>{const{handleContextMenu:Z}=v;Z(G,Q)},[v]),x=G=>{const{handleContextMenu:Q}=v;Q(G)},N=(0,r.useCallback)(()=>{const{enactiveNodeDecoration:G}=v;G()},[v]),j=(0,r.useCallback)((G,Q)=>{const{handleDragStart:Z}=v;Z(G,Q)},[v]),K=(0,r.useCallback)((G,Q)=>{const{handleDragOver:Z}=v;Z(G,Q)},[v]),U=(0,r.useCallback)((G,Q)=>{const{handleDragEnter:Z}=v;Z(G,Q)},[v]),Y=(0,r.useCallback)((G,Q)=>{const{handleDrop:Z}=v;Z(G,Q)},[v]),z=(0,r.useCallback)((G,Q)=>{const{handleDragLeave:Z}=v;Z(G,Q)},[v]);return(0,r.useEffect)(()=>{var G;const Q=()=>{v.handleTreeBlur()};return(G=D.current)===null||G===void 0||G.addEventListener("blur",Q,!0),()=>{var Z;(Z=D.current)===null||Z===void 0||Z.removeEventListener("blur",Q,!0)}},[D.current]),r.default.createElement("div",{className:g.default.kt_extension_view,tabIndex:-1,ref:D,onContextMenu:x,onClick:N,"data-tree-view-id":a},r.default.createElement(u,{height:T,isVisible:A,handleTreeReady:I,handleItemClicked:M,handleCheckBoxChange:k,handleTwistierClick:O,handleContextMenu:B,handleDragStart:j,handleDragOver:K,handleDragEnter:U,handleDragLeave:z,handleDrop:Y,draggable:v.draggable,treeViewId:a,model:v,dataProvider:f,decorationService:y}))};t.ExtensionTabBarTreeView=c;function h(d,v){return d.isVisible===v.isVisible&&d.model===v.model&&d.treeViewId===v.treeViewId&&d.height===v.height}const u=(0,r.memo)(({model:d,treeViewId:v,height:f,isVisible:a,dataProvider:b,handleTreeReady:y,handleItemClicked:S,handleCheckBoxChange:A,handleTwistierClick:T,handleContextMenu:w,handleDragStart:D,handleDragOver:I,handleDragEnter:O,handleDragLeave:P,handleDrop:R,draggable:M,decorationService:k})=>{const[B,x]=(0,r.useState)(!1),[N,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let U=!1;return(async()=>(await d.whenReady,d.treeModel&&a&&await d.treeModel.ensureReady,U||x(!0)))(),()=>{U=!0,d&&d.removeNodeDecoration()}},[d,a]),(0,r.useEffect)(()=>{const U=b.onDidChangeEmpty(()=>{b.isTreeEmpty!==N&&j(b.isTreeEmpty)});return()=>U.dispose()},[]);const K=(0,r.useCallback)(U=>r.default.createElement(s.TreeViewNode,{item:U.item,itemType:U.itemType,decorations:d.decorations.getDecorations(U.item),onClick:S,onChange:A,onTwistierClick:T,onContextMenu:w,onDragStart:D,onDragOver:I,onDragEnter:O,onDragLeave:P,onDrop:R,defaultLeftPadding:8,leftPadding:8,treeViewId:v,draggable:M,decorationService:k}),[d.treeModel]);if(B){if(N)return r.default.createElement(p.WelcomeView,{viewId:v});if(d.treeModel)return r.default.createElement(o.RecycleTree,{height:f,itemHeight:s.TREE_VIEW_NODE_HEIGHT,onReady:y,model:d.treeModel},K)}else return r.default.createElement(m.Progress,{loading:!0});return null},h);u.displayName="ExtensionsTreeView"},88341:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionWebviewView=t.WebviewViewShouldShowEvent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(99220);class m extends o.BasicEvent{}t.WebviewViewShouldShowEvent=m;const E=({viewId:p})=>{const _=r.default.useRef(null),s=(0,o.useInjectable)(o.IEventBus),g=(0,o.useInjectable)(l.ExtensionService);return r.default.useEffect(()=>{const c=new o.CancellationTokenSource,h=new o.Disposable({dispose:()=>c.cancel()});return g.eagerExtensionsActivated.promise.then(()=>{c.token.isCancellationRequested||_.current&&s.fire(new m({viewType:p,container:_.current,title:"",cancellationToken:c.token,disposer:h}))}),()=>{h.dispose()}},[]),r.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"},className:"webview-view-component",ref:_})};t.ExtensionWebviewView=E},17428:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(81302),t),n.__exportStar(e(63056),t)},21167:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkthroughsEditorView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),m=e(41869),E=e(93374),p=e(52416),_=e(99220),s=e(17441),g=n.__importDefault(e(42076)),c=({resource:{uri:v}})=>{const f=(0,m.useInjectable)(s.WalkthroughsService),a=(0,m.useInjectable)(m.IContextKeyService),{query:b,authority:y}=v,[S,A]=(0,o.useState)(),[T,w]=(0,o.useState)();(0,o.useEffect)(()=>{S&&S.steps.length>0&&(T||w(S.steps[0].id))},[S,T]),(0,o.useEffect)(()=>{b&&A(f.getWalkthrough(b))},[b,S]);const D=(0,o.useCallback)(()=>{var I;return S&&((I=S.steps.find(O=>O.id===T))===null||I===void 0?void 0:I.media)},[T,S]);return o.default.createElement("div",{className:g.default.getting_started_container},o.default.createElement("div",{className:g.default.getting_started_detailsContent},o.default.createElement("div",{className:g.default.category_container},o.default.createElement("div",{className:g.default.category_icon},S&&S.icon.type==="image"&&o.default.createElement("img",{src:S.icon.path})),o.default.createElement("div",{className:g.default.category_description_container},o.default.createElement("h2",{className:g.default.category_title},S?.title),o.default.createElement("div",{className:g.default.category_description},S?.description))),o.default.createElement("div",{className:g.default.steps_container},o.default.createElement("div",{className:g.default.getting_started_detail_container},o.default.createElement("div",{className:g.default.step_list_container},S?S.steps.filter(I=>a.match(I.when)).map(I=>o.default.createElement(h,{key:I.id,step:I,isExpanded:I.id===T,onSelected:w})):null))),o.default.createElement("div",{className:g.default.getting_started_media},T&&o.default.createElement(u,{media:D(),extensionId:y,stepId:T}))))};t.WalkthroughsEditorView=c;const h=({step:v,isExpanded:f,onSelected:a})=>{const b=(0,m.useInjectable)(m.IOpenerService),y=(0,m.useInjectable)(s.WalkthroughsService),S=(0,m.useInjectable)(p.IIconService),[A,T]=(0,o.useState)(!1),{description:w}=v;(0,o.useEffect)(()=>{const R=y.onDidProgressStep(M=>{const{id:k,done:B}=M;k===v.id&&B&&T(B)});return()=>R.dispose()},[]);const D=(0,o.useCallback)(()=>{T(!A),y.progressByEvent(_.CompletionEventsType.stepSelected+":"+v.id)},[A,v.id]),I=(0,o.useCallback)(R=>{const{href:M}=R;b.open(M),/^http(s)?:\/\//.test(M)&&y.progressByEvent(_.CompletionEventsType.onLink+":"+M)},[]),O=(0,o.useCallback)(()=>{if(w.length===0)return null;const R=[];return w.map((M,k)=>{if(M.nodes.length===1&&typeof M.nodes[0]!="string"){const B=M.nodes[0];R.push(o.default.createElement("div",{key:k.toString()+R.length,title:B.title},o.default.createElement(l.Button,{onClick:()=>I(B)},(0,m.transformLabelWithCodicon)(B.label,{},S.fromString.bind(S)))))}else{const B=M.nodes.map((x,N)=>typeof x=="string"?x:o.default.createElement("a",{key:x.label+"#"+N,title:x.title,onClick:()=>I(x)},x.label));R.push(o.default.createElement("p",{key:k.toString()+R.length.toString()+B.length.toString()},B))}}),o.default.createElement("div",{className:g.default.step_description_container},o.default.createElement(o.default.Fragment,null,R))},[w]),P=(0,o.useCallback)(()=>(0,m.transformLabelWithCodicon)(v.title,{},S.fromString.bind(S)),[v.title]);return o.default.createElement("div",{className:(0,r.default)(g.default.getting_started_step,f&&g.default.expanded),onClick:()=>a(v.id)},o.default.createElement("div",{className:g.default.checkbox},o.default.createElement(l.CheckBox,{id:v.id,onChange:D,checked:A})),o.default.createElement("div",{className:g.default.step_container},o.default.createElement("h3",{className:g.default.step_title},P()),f&&O()))},u=({media:v,extensionId:f,stepId:a})=>{const b=(0,m.useInjectable)(p.IThemeService),y=(0,m.useInjectable)(s.WalkthroughsService),[S,A]=(0,o.useState)(""),[T,w]=(0,o.useState)(""),D=(0,o.useCallback)(async I=>v?.type==="image"?"":I?(await y.getFileContent(f,I)).toString():"",[v]);if((0,o.useEffect)(()=>{const I=y.getStepsByExtension(a);I&&(v&&v.type==="svg"&&I.media.svg&&D(I.media.svg).then(A),v&&v.type==="markdown"&&I.media.markdown&&D(I.media.markdown).then(w))},[v,a]),!v)return null;if(v.type==="image"){const I=b.getCurrentThemeSync().type,O=v.path[I].toString(!0).replace(/ /g,"%20");return o.default.createElement(o.default.Fragment,null,o.default.createElement("img",{alt:v.altText,srcSet:O.toLowerCase().endsWith(".svg")?O:O+" 1.5x"}))}return v.type==="svg"?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:g.default.media_svg_container,dangerouslySetInnerHTML:{__html:S}})):v.type==="markdown"?o.default.createElement(o.default.Fragment,null,o.default.createElement(d,{content:T,media:v})):null},d=({content:v,media:f})=>{const a=(0,m.useInjectable)(m.IOpenerService);if(f.type!=="markdown")return null;const b=(0,o.useCallback)(()=>f.base.resolve("/").toString(),[f,v]);return o.default.createElement(E.Markdown,{content:v,options:{baseUrl:b()},onLinkClick:y=>a.open(y)})}},87444:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtCommandManagementImpl=void 0;const n=e(85608),r=e(76003),o=e(43718);let l=class extends o.Disposable{constructor(){super(...arguments),this.commandEnvRegistry=new Map,this.proxyCommandExecutorRegistry=new Map}dispose(){this.commandEnvRegistry.clear(),this.proxyCommandExecutorRegistry.clear()}registerProxyCommandExecutor(E,p){this.proxyCommandExecutorRegistry.set(E,p)}async executeExtensionCommand(E,p,_){const s=this.proxyCommandExecutorRegistry.get(E);if(!s)throw new Error('Proxy command executor "'+E+'" is not existed');return s.$executeExtensionCommand(p,..._)}registerExtensionCommandEnv(E,p="node"){return this.commandEnvRegistry.set(E,p),{dispose:()=>{this.commandEnvRegistry.delete(E)}}}getExtensionCommandEnv(E){return this.commandEnvRegistry.get(E)}};t.ExtCommandManagementImpl=l,t.ExtCommandManagementImpl=l=n.__decorate([(0,r.Injectable)()],l)},49413:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtInstanceManagementService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(99220),E=e(42734);let p=class extends o.Disposable{constructor(){super(),this.onDidChangeEmitter=new l.Emitter,this.extensionMap=new Map,this._whenReady=this.init()}async init(){this.workspaceStorage=await this.storageProvider(o.STORAGE_NAMESPACE.EXTENSIONS),this.globalStorage=await this.storageProvider(o.STORAGE_NAMESPACE.GLOBAL_EXTENSIONS)}get whenReady(){return this._whenReady}get onDidChange(){return this.onDidChangeEmitter.event}dispose(){this.disposeExtensionInstances()}getExtensionInstances(){return Array.from(this.extensionMap.values())}disposeExtensionInstances(){for(const s of this.extensionMap.values())s.dispose();this.extensionMap=new Map}disposeExtensionInstancesByPath(s){s.forEach(g=>{this.extensionMap.has(g)&&this.extensionMap.get(g).dispose()})}resetExtensionInstances(){for(const s of this.extensionMap.values())s.reset()}getExtensionInstanceByPath(s){return this.extensionMap.get(s)}getExtensionInstanceByExtId(s){for(const g of this.extensionMap.values())if(g.id===s)return g}deleteExtensionInstanceByPath(s){this.extensionMap.delete(s),this.onDidChangeEmitter.fire()}addExtensionInstance(s){this.extensionMap.set(s.path,s),this.onDidChangeEmitter.fire()}async checkExtensionEnable(s){await this.whenReady;const g=this.globalStorage.get(s.extensionId,m.EXTENSION_ENABLE.ENABLE);return this.workspaceStorage.get(s.extensionId,g)===m.EXTENSION_ENABLE.ENABLE}async createExtensionInstance(s,g,c){const h=typeof s=="string"?await this.extensionNodeClient.getExtension(s,(0,l.getLanguageId)(),{}):s;if(h)return this.injector.get(E.Extension,[h,await this.checkExtensionEnable(h),g||(this.appConfig.extensionDir?h.realPath.startsWith(this.appConfig.extensionDir):!1),!!c])}checkIsBuiltin(s){const g=this.getExtensionCandidateByPath(s.realPath);return(this.appConfig.extensionDir?s.realPath.startsWith(this.appConfig.extensionDir):!1)||(g?g.isBuiltin:!1)}checkIsDevelopment(s){const g=this.getExtensionCandidateByPath(s.realPath);return!!g?.isDevelopment}getExtensionCandidateByPath(s){return this.appConfig.extensionCandidate&&this.appConfig.extensionCandidate.find(g=>g.path===s)}};t.ExtInstanceManagementService=p,n.__decorate([(0,r.Autowired)(o.StorageProvider),n.__metadata("design:type",Function)],p.prototype,"storageProvider",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],p.prototype,"extensionNodeClient",void 0),t.ExtInstanceManagementService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},98453:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionManagementService=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(14951),m=e(99220),E=e(82389),p=e(71354),_=e(35321);let s=class extends o.WithEventBus{async getExtensionProps(c,h){const u=await this.extensionNodeClient.getExtension(c,(0,o.getLanguageId)(),h);if(u){const d=this.getExtensionByPath(c);if(d)return{...d.toJSON(),extraMetadata:u.extraMetadata}}}getExtensionByPath(c){return this.extInstanceManagementService.getExtensionInstances().find(h=>c===h.path)}getExtensionByExtId(c){return this.extInstanceManagementService.getExtensionInstances().find(h=>c===h.id)}async postChangedExtension(c,h,u){const{upgrade:d,extensionPath:v,oldExtensionPath:f,isBuiltin:a}=typeof c=="boolean"?{upgrade:c,extensionPath:h,oldExtensionPath:u,isBuiltin:!1}:c,b=this.extInstanceManagementService.getExtensionInstanceByPath(v);if(b){this.logger.warn(`Extension ${b.id} already exists, skip activate`);return}const y=await this.extInstanceManagementService.createExtensionInstance(v,!!a);if(y)return d&&this.disableExtension(f),await this.enableExtension(y)}async postEnableExtension(c){const h=await this.extInstanceManagementService.getExtensionInstanceByPath(c);if(h)return await this.enableExtension(h)}async postDisableExtension(c){return this.disableExtension(c)}async postUninstallExtension(c){return this.uninstallExtension(c)}getAllExtensionJson(){return this.extInstanceManagementService.getExtensionInstances().map(c=>c.toJSON())}disableExtension(c){const h=this.extInstanceManagementService.getExtensionInstanceByPath(c);h&&(h.disable(),this.extInstanceManagementService.deleteExtensionInstanceByPath(c))}async enableExtension(c){this.extInstanceManagementService.addExtensionInstance(c),c.enable(),await c.initialize(),this.eventBus.fire(new p.ExtensionDidEnabledEvent(c.toJSON())),this.sumiContributesService.register(c.id,c.packageJSON.sumiContributes||{}),this.contributesService.register(c.id,c.contributes),this.sumiContributesService.initialize(),this.contributesService.initialize()}async removeExtension(c){try{return await this.fileService.delete(o.URI.file(c).toString()),!0}catch(h){return this.logger.error(h),!1}}async uninstallExtension(c){const h=this.extInstanceManagementService.getExtensionInstanceByPath(c);h&&(h.dispose(),this.extInstanceManagementService.deleteExtensionInstanceByPath(c)),await this.removeExtension(c),this.eventBus.fire(new p.ExtensionDidUninstalledEvent)}};t.ExtensionManagementService=s,n.__decorate([(0,r.Autowired)(p.AbstractExtInstanceManagementService),n.__metadata("design:type",p.AbstractExtInstanceManagementService)],s.prototype,"extInstanceManagementService",void 0),n.__decorate([(0,r.Autowired)(m.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],s.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(_.VSCodeContributesServiceToken),n.__metadata("design:type",_.VSCodeContributesService)],s.prototype,"contributesService",void 0),n.__decorate([(0,r.Autowired)(E.SumiContributionsServiceToken),n.__metadata("design:type",E.SumiContributionsService)],s.prototype,"sumiContributesService",void 0),n.__decorate([(0,r.Autowired)(l.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),t.ExtensionManagementService=s=n.__decorate([(0,r.Injectable)()],s)},20670:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeExtProcessService=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(18740),m=e(41869),E=e(99220),p=e(72464),_=e(46147),s=e(37846),g=e(28949),c=e(51072),h=e(17802);let u=class{constructor(){this._apiFactoryDisposables=new m.DisposableStore,this.ready=new m.Deferred,this._extHostUpdated=new m.Deferred,this.extensions=[]}disposeApiFactory(){this._apiFactoryDisposables.clear()}async disposeProcess(){this.disposeApiFactory(),await this.extensionNodeClient.disposeClientExtProcess(this.clientId,!1)}async activate(){return await this.createExtProcess(),this.protocol&&(this.ready.resolve(),await this.createBrowserMainThreadAPI(),await(await this.getProxy()).$updateExtHostData(),this._extHostUpdated.resolve()),this.protocol}async activeExtension(v,f){!this.appConfig.noExtHost&&!f&&(await this._extHostUpdated.promise,await(await this.getProxy()).$activateExtension(v.id))}async updateExtensionData(v){if(this.extensions=v,this.protocol){const f=await this.getProxy();await f.$updateExtHostData(),f.$fireChangeEvent()}}getExtension(v){return this.extensions.find(f=>f.id===v)}async $activateExtension(v){const f=this.extensions.find(a=>a.path===v);f&&await f.activate()}async $getExtensions(){return this.extensions.map(v=>v.toJSON())}async getProxy(){return await this.ready.promise,this.protocol.getProxy(_.ExtHostAPIIdentifier.ExtHostExtensionService)}async createBrowserMainThreadAPI(){const v=(0,h.initSharedAPIProxy)(this.protocol,this.injector);this._apiFactoryDisposables.add(v),this._apiFactoryDisposables.add((0,m.toDisposable)((0,c.initNodeThreadAPIProxy)(this.protocol,this.injector,this))),this._apiFactoryDisposables.add((0,m.toDisposable)((0,g.createSumiAPIFactory)(this.protocol,this.injector))),this._apiFactoryDisposables.add(this.createExternalSumiAPIFactory()),await v.setup()}getSpawnOptions(){return{}}createExternalSumiAPIFactory(){const v=new m.Disposable,f=this.mainThreadExtenderContributionProvider.getContributions();for(const b of f)b.registerMainThreadExtender(this.mainThreadExtenderService);const a=this.mainThreadExtenderService.getMainThreadExtenders();for(const b of a){const y=this.injector.get(b.serviceClass,[this.protocol]);this.protocol.set(b.identifier,y),v.addDispose(y)}return v}async getActivatedExtensions(){return await(await this.getProxy()).$getActivatedExtensions()}get clientId(){return this.applicationService.clientId}async createExtProcess(){await this.extensionNodeClient.createProcess(this.clientId,{enableDebugExtensionHost:this.appConfig.enableDebugExtensionHost,inspectExtensionHost:this.appConfig.inspectExtensionHost,extensionConnectOption:this.appConfig.extensionConnectOption,extHostSpawnOptions:this.getSpawnOptions()}),await this.initExtProtocol()}async initExtProtocol(){var v,f;this.channel&&this.channel.dispose(),this.protocol&&((f=(v=this.protocol).dispose)===null||f===void 0||f.call(v)),this.channel=await this.channelHandler.openChannel(E.CONNECTION_HANDLE_BETWEEN_EXTENSION_AND_MAIN_THREAD),this.connection=this.channel.createConnection(),this.protocol=new o.SumiConnectionMultiplexer(this.connection,{timeout:this.appConfig.rpcMessageTimeout,name:"node-ext-host",io:(0,o.createExtMessageIO)(s.knownProtocols)})}};t.NodeExtProcessService=u,n.__decorate([(0,r.Autowired)(m.AppConfig),n.__metadata("design:type",Object)],u.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],u.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(E.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],u.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(m.IApplicationService),n.__metadata("design:type",Object)],u.prototype,"applicationService",void 0),n.__decorate([(0,r.Autowired)(l.WSChannelHandler),n.__metadata("design:type",l.WSChannelHandler)],u.prototype,"channelHandler",void 0),n.__decorate([(0,r.Autowired)(p.IMainThreadExtenderService),n.__metadata("design:type",Object)],u.prototype,"mainThreadExtenderService",void 0),n.__decorate([(0,r.Autowired)(p.MainThreadExtenderContribution),n.__metadata("design:type",Object)],u.prototype,"mainThreadExtenderContributionProvider",void 0),t.NodeExtProcessService=u=n.__decorate([(0,r.Injectable)()],u)},90731:(L,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewExtProcessService=void 0;const r=e(85608),o=e(76003),l=e(65973),m=e(8919),E=e(41869),p=e(40827),_=e(43718),s=e(61656),g=e(99220),c=e(25600),h=e(17428),u=e(54107),d=e(9438),v=e(8403),f=e(31738),{Path:a,posix:b}=E.path,y="load";let S=n=class extends _.Disposable{constructor(){super(...arguments),this.debugLogger=(0,_.getDebugLogger)(),this.extensions=[],this.activatedViewExtensionMap=new Map,this.portalShadowRootMap=new Map,this.shadowRootBodyMap=new Map}getExtension(T){return this.extensions.find(w=>w.id===T)}async initExtension(T){this.extensions=T}async getActivatedExtensions(){return[]}getProxy(){}async $activateExtension(T){}async $getExtensions(){return this.extensions.map(T=>T.toJSON())}async disposeProcess(){}activate(){const T=this.requireInterceptorContributionProvider.getContributions();for(const w of T)w.registerRequireInterceptor(this.requireInterceptorService);this.extendExtensionErrorStackTrace()}extendExtensionErrorStackTrace(){Error.stackTraceLimit=100,Error.prepareStackTrace=(T,w)=>{let D,I=`Error: ${T.message}`;for(const O of w)if(I+=`
|
|
28374
|
+
`}async provideEditorDocumentModelContent(u,d){return""}isReadonly(u){return!1}isAlwaysDirty(u){return!0}disposeEvenDirty(u){return!0}closeAutoSave(u){return!0}async saveDocumentModel(u,d,v,f,a,b=!1){const{name:y}=u.getParsedQuery(),S=u.path.toString()!=="/"?l.path.dirname(u.path.toString()):this.appConfig.workspaceDir,A=await this.commandService.tryExecuteCommand("file.save",{showNameInput:!0,defaultFileName:y||u.displayName,defaultUri:l.URI.file(l.isWindows?S.replaceAll("\\","/"):S)});return A&&(await this.editorDocumentModelService.saveEditorDocumentModel(A,d,v,f,a,b),await this.workbenchEditorService.open(A,{preview:!1,focus:!0,replace:!0,forceClose:!0})),{state:l.SaveTaskResponseState.SUCCESS}}onDidDisposeModel(){}};t.UntitledSchemeDocumentProvider=g,r.__decorate([(0,o.Autowired)(_.IEditorDocumentModelService),r.__metadata("design:type",Object)],g.prototype,"editorDocumentModelService",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",p.WorkbenchEditorService)],g.prototype,"workbenchEditorService",void 0),r.__decorate([(0,o.Autowired)(l.CommandService),r.__metadata("design:type",Object)],g.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(l.IApplicationService),r.__metadata("design:type",Object)],g.prototype,"applicationService",void 0),r.__decorate([(0,o.Autowired)(s),r.__metadata("design:type",s)],g.prototype,"untitledIndex",void 0),r.__decorate([(0,o.Autowired)(l.PreferenceService),r.__metadata("design:type",Object)],g.prototype,"preferenceService",void 0),t.UntitledSchemeDocumentProvider=g=r.__decorate([(0,o.Injectable)()],g);let c=class extends l.WithEventBus{constructor(){super(...arguments),this.scheme=l.Schemes.untitled}provideResource(u){const{name:d}=u.getParsedQuery();return{name:d||u.displayName,uri:u,icon:"",metadata:null}}async shouldCloseResourceWithoutConfirm(u){const d=this.documentModelService.getModelDescription(u.uri,"close-resource-check");return!!(d&&d.dirty)}async close(u,d){const v=this.documentModelService.getModelReference(u.uri,"close-resource-check");if(!v)return!1;if(d===p.AskSaveResult.SAVE){const f=await v.instance.save();return v.dispose(),f}else return d===p.AskSaveResult.REVERT?(await v.instance.revert(),v.dispose(),!0):!d||d===p.AskSaveResult.CANCEL?(v.dispose(),!1):(v.dispose(),!0)}async shouldCloseResource(u){const d=this.documentModelService.getModelDescription(u.uri,"close-resource-check");if(!d||!d.dirty)return!0;const v={[(0,l.localize)("file.prompt.dontSave","Don't Save")]:p.AskSaveResult.REVERT,[(0,l.localize)("file.prompt.save","Save")]:p.AskSaveResult.SAVE,[(0,l.localize)("file.prompt.cancel","Cancel")]:p.AskSaveResult.CANCEL},f=await this.dialogService.open({message:(0,l.formatLocalize)("saveChangesMessage",u.name),type:l.MessageType.Info,buttons:Object.keys(v)});return await this.close(u,v[f])}};t.UntitledSchemeResourceProvider=c,r.__decorate([(0,o.Autowired)(m.IDialogService),r.__metadata("design:type",Object)],c.prototype,"dialogService",void 0),r.__decorate([(0,o.Autowired)(_.IEditorDocumentModelService),r.__metadata("design:type",Object)],c.prototype,"documentModelService",void 0),t.UntitledSchemeResourceProvider=c=r.__decorate([(0,o.Injectable)()],c)},33835:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditor=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(23418),m=e(96689),E=p=>{const _=r.default.useRef(),s=(0,o.useInjectable)(l.EditorCollectionService),g=(0,o.useInjectable)(m.IEditorDocumentModelService),[c,h]=r.default.useState(void 0),[u,d]=r.default.useState(void 0),[v,f]=r.default.useState(void 0),[a,b]=r.default.useState(void 0);let y=!1;return r.default.useEffect(()=>{if(_.current){c&&c.dispose();const S=s.createCodeEditor(_.current,{automaticLayout:!0,...p.options});h(S),u&&S.open(u)}return()=>{y=!0,c&&c.dispose(),u&&u.dispose()}},[_.current]),p&&c&&p.editorRef&&p.editorRef(c),v&&a!==v&&(b(v),g.createModelReference(new o.URI(v),"editor-react-component").then(S=>{u&&u.dispose(),!y&&S.instance.uri.toString()===v?d(S):S.dispose()})),u&&c&&c.currentDocumentModel!==u.instance&&c.open(u),p.uri&&p.uri.toString()!==v&&f(p.uri.toString()),r.default.createElement("div",{ref:S=>S&&(_.current=S),...p})};t.CodeEditor=E},50674:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdateOnGroupTabChange=r;const n=e(41869);function r(o){return(0,n.useUpdateOnEvent)(o.onDidEditorGroupTabChanged,[o])}},6670:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorSuggestWidgetContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(76835);let E=class{contribute(_){const s=new o.DisposableCollection,g=_.monacoEditor.getContribution(m.SuggestController.ID);if(g&&g.widget&&g.widget.value){const c=g.widget.value;s.push(c.onDidSelect(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidSelect",data:h}))})),s.push(c.onDidHide(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidHide",data:h}))})),s.push(c.onDidShow(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidShow",data:h}))})),s.push(c.onDidFocus(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidFocus",data:h}))})),c&&c._setDetailsVisible&&c._setDetailsVisible(this.preferenceService.get("editor.suggest.details.visible",!0))}return s}};t.EditorSuggestWidgetContribution=E,n.__decorate([(0,r.Autowired)(l.IEventBus),n.__metadata("design:type",Object)],E.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),t.EditorSuggestWidgetContribution=E=n.__decorate([(0,r.Injectable)()],E)},67903:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorTopPaddingContribution=void 0;class e{contribute(r){return r.monacoEditor.onDidChangeModel(()=>{r.monacoEditor.changeViewZones(o=>{o.addZone({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:0})})})}}t.EditorTopPaddingContribution=e},51553:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorGroup=t.WorkbenchEditorServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(91830),m=e(75524),E=e(43718),p=e(14951),_=n.__importStar(e(20868)),s=e(72665),g=e(23418),c=e(96689),h=e(76759),u=e(47049),d=e(82196),v=e(17878),f=10,a=T=>!!(T.supportsRevive&&!T.deleted);let b=class extends E.WithEventBus{constructor(){super(),this.editorGroups=[],this._onDidEditorGroupsChanged=new E.Emitter,this.onDidEditorGroupsChanged=this._onDidEditorGroupsChanged.event,this._sortedEditorGroups=[],this._onActiveResourceChange=new E.Emitter,this.onActiveResourceChange=this._onActiveResourceChange.event,this._onActiveEditorUriChange=new E.Emitter,this.onActiveEditorUriChange=this._onActiveEditorUriChange.event,this._onCursorChange=new E.Emitter,this.onCursorChange=this._onCursorChange.event,this._onDidCurrentEditorGroupChanged=new E.Emitter,this.onDidCurrentEditorGroupChanged=this._onDidCurrentEditorGroupChanged.event,this._restoring=!0,this.contributionsReady=new E.Deferred,this.untitledCloseIndex=[],this.gridReady=!1,this._onDidGridReady=new E.Emitter,this.onDidGridReady=this._onDidGridReady.event,this.editorGroupIdGen=0,this.untitledIndex.update(),this.initialize()}setEditorContextKeyService(w){this.editorContextKeyService=w}setCurrentGroup(w){var D;if(w){if(this._currentEditorGroup===w)return;this._currentEditorGroup=w,this._onActiveResourceChange.fire(w.currentResource),this.eventBus.fire(new d.EditorActiveResourceStateChangedEvent({resource:w.currentResource,openType:w.currentOpenType,editorUri:(D=this.currentEditor)===null||D===void 0?void 0:D.currentUri})),this._onDidCurrentEditorGroupChanged.fire(this._currentEditorGroup)}}onEditorGroupChangeEvent(w){var D;w.payload.group===this.currentEditorGroup&&this.eventBus.fire(new d.EditorActiveResourceStateChangedEvent({resource:w.payload.newResource,openType:w.payload.newOpenType,editorUri:(D=this.currentEditor)===null||D===void 0?void 0:D.currentUri}))}getAllOpenedUris(){const w=[];for(const D of this.editorGroups)for(const I of D.resources)w.findIndex(P=>P.isEqual(I.uri))===-1&&w.push(I.uri);return w}async getAllOpenedDocuments(){const w=[];for(const D of this.editorGroups)for(const I of D.resources){if(I.uri.scheme!=="file")continue;if(w.findIndex(P=>P.uri.isEqual(I.uri))===-1){const P=await D.getDocumentModelRef(I.uri);P&&w.push(P.instance)}}return w}async save(w){if(this.editorGroups.length)try{for(const D of this.editorGroups){const I=D.resources.find(O=>O.uri.isEqual(w));I&&await D.saveResource(I)}return w}catch(D){throw new Error(`Save Failed: ${D.message}`)}}getDefaultSavePath(w){const D=w.path.toString()!=="/"?E.path.dirname(w.path.toString()):this.appConfig.workspaceDir;return E.isWindows?D.replace(/\\/g,"/"):D}async saveAs(w){var D,I;if(!(!this._currentEditorGroup||!((D=this._currentEditorGroup.currentResource)===null||D===void 0)&&D.deleted))try{const O=this.getDefaultSavePath(w);return await this.windowDialogService.showSaveDialog({saveLabel:"SaveAs File:",showNameInput:!0,defaultFileName:(I=this._currentEditorGroup.currentResource)===null||I===void 0?void 0:I.name,defaultUri:E.URI.file(O),saveAs:!0})}catch(O){throw new Error(`SaveAs Failed: ${O.message}`)}}async saveAll(w,D){for(const I of this.editorGroups)await I.saveAll(w,D)}hasDirty(){for(const w of this.editorGroups)if(w.hasDirty())return!0;return!1}calcDirtyCount(){const w=new Set;return this.editorGroups.reduce((D,I)=>D+I.calcDirtyCount(w),0)}createEditorGroup(){const w=this.injector.get(y,[this.generateRandomEditorGroupName(),this.editorGroupIdGen++]);this.editorGroups.push(w);const D=new E.Disposable(w.onDidEditorGroupBodyChanged(()=>{w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveResourceChange.fire(w.currentResource))}),w.onDidEditorFocusChange(()=>{var O;w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveEditorUriChange.fire((O=w.currentOrPreviousFocusedEditor)===null||O===void 0?void 0:O.currentUri))}));w.addDispose({dispose:()=>{D.dispose()}});const I=w.onDidEditorGroupTabChanged(()=>{this.saveOpenedResourceState()});return w.addDispose({dispose:()=>{I.dispose()}}),w.onCurrentEditorCursorChange(O=>{this._currentEditorGroup===w&&this._onCursorChange.fire(O)}),w}generateRandomEditorGroupName(){let w=(0,E.makeRandomHexString)(5);for(;this.editorGroups.findIndex(D=>D.name===w)!==-1;)w=(0,E.makeRandomHexString)(5);return w}initialize(){return this.initializing||(this.initializing=this.doInitialize()),this.initializing}async doInitialize(){this.openedResourceState=await this.initializeState(),await this.contributionsReady.promise,await this.restoreState(),this._currentEditorGroup=this.editorGroups[0]}async initializeState(){return await this.getStorage(E.STORAGE_NAMESPACE.WORKBENCH)}get currentEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentEditor}get currentCodeEditor(){return this.currentEditorGroup.currentCodeEditor}get currentEditorGroup(){return this._currentEditorGroup}get currentOrPreviousFocusedEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentOrPreviousFocusedEditor}async open(w,D){await this.initialize();let I=this.currentEditorGroup,O;if(D&&typeof D.groupIndex<"u"?O=D.groupIndex:D&&D.relativeGroupIndex&&(O=this.currentEditorGroup.index+D.relativeGroupIndex),typeof O=="number"&&O>=0){if(O>=this.editorGroups.length)return I.open(w,Object.assign({},D,{split:g.EditorGroupSplitAction.Right}));I=this.sortedEditorGroups[O]||this.currentEditorGroup}return I.open(w,D)}async openUris(w){await this.initialize(),await this.currentEditorGroup.openUris(w)}getEditorGroup(w){return this.editorGroups.find(D=>D.name===w)}get currentResource(){return this.currentEditorGroup?this.currentEditorGroup.currentResource:null}removeGroup(w){const D=this.editorGroups.findIndex(I=>I===w);if(D!==-1){if(this.editorGroups.length===1)return;this.editorGroups.splice(D,1),this.currentEditorGroup===w&&this.setCurrentGroup(this.editorGroups[0]);for(let I=D;I<this.editorGroups.length;I++)this.eventBus.fire(new d.EditorGroupIndexChangedEvent({group:this.editorGroups[I],index:I}))}}async saveOpenedResourceState(){if(this._restoring)return;const w=this.topGrid.serialize();await this.openedResourceState.set("grid",w)}prepareContextKeyService(){const w=I=>{let O=null;const P=this.documentModelManager.getModelDescription(I,"resourceContextKey");return P&&(O=P.languageId),O},D=new l.ResourceContextKey(this.editorContextKeyService,I=>{const O=w(I);return O||w(I)});this.onActiveResourceChange(I=>{this.currentEditor&&this.currentEditor.currentUri?D.set(this.currentEditor.currentUri):I?D.set(I.uri):D.reset()}),this.currentEditor&&this.currentEditor.currentUri?D.set(this.currentEditor.currentUri):this.currentResource?D.set(this.currentResource.uri):D.reset()}onDomCreated(w){this.editorContextKeyService&&this.editorContextKeyService.attachToDomNode(w)}notifyGroupChanged(){this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}async restoreState(){let w={editorGroup:{uris:[],previewIndex:-1}};this.appConfig.disableRestoreEditorGroupState||(w=this.openedResourceState.get("grid",w)),this.topGrid=new u.EditorGrid,this.addDispose(this.topGrid),this.addDispose(this.topGrid.onDidGridAndDesendantStateChange(()=>{this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}));const D=[],I=this.topGrid.deserialize(w,()=>this.createEditorGroup(),D).then(()=>{this.topGrid.children.length===0&&!this.topGrid.editorGroup&&this.topGrid.setEditorGroup(this.createEditorGroup()),this.gridReady=!0,this._onDidGridReady.fire(),this.notifyGroupChanged()});return Promise.all(D).then(()=>{this._restoring=!1;for(const O of this.contributions.getContributions())O.onDidRestoreState&&O.onDidRestoreState()}),I}async closeAll(w,D){for(const I of this.editorGroups.slice(0))w?await I.close(w,{force:D}):await I.closeAll()}async closeAllOnlyConfirmOnce(){const w=[];for(const B of this.editorGroups)for(const x of B.resources)w.push(x);const I=(await Promise.all(w.map(async B=>({shouldClose:await this.resourceService.shouldCloseResourceWithoutConfirm(B),resource:B})))).filter(B=>B.shouldClose);if(I.length===0)return!1;const O={[(0,E.localize)("file.prompt.dontSave","Don't Save")]:d.AskSaveResult.REVERT,[(0,E.localize)("file.prompt.save","Save")]:d.AskSaveResult.SAVE,[(0,E.localize)("file.prompt.cancel","Cancel")]:d.AskSaveResult.CANCEL};let R=I.slice(0,f).map(B=>B.resource.name).join("\u3001");I.length>f&&(I.length-f===1?R+=(0,E.localize)("file.prompt.more.one"):R+=(0,E.formatLocalize)("file.prompt.more.number",I.length-f));const M=await this.dialogService.open({message:(0,o.toMarkdown)((0,E.formatLocalize)("saveNFilesChangesMessage",I.length,R),this.openner),type:E.MessageType.Info,buttons:Object.keys(O)}),k=O[M];return k===d.AskSaveResult.SAVE?(await Promise.all(I.map(B=>{var x,N;return(N=(x=this.resourceService).close)===null||N===void 0?void 0:N.call(x,B.resource,d.AskSaveResult.SAVE)})),!1):k===d.AskSaveResult.REVERT?(await Promise.all(I.map(B=>{var x,N;return(N=(x=this.resourceService).close)===null||N===void 0?void 0:N.call(x,B.resource,d.AskSaveResult.REVERT)})),!1):!0}async close(w,D){return this.closeAll(w,D)}get sortedEditorGroups(){return this._sortedEditorGroups||(this._sortedEditorGroups=[],this.topGrid.sortEditorGroups(this._sortedEditorGroups)),this._sortedEditorGroups}handleOnCloseUntitledResource(w){if(w.payload.resource.uri.scheme===E.Schemes.untitled){const{index:D}=w.payload.resource.uri.getParsedQuery();this.untitledCloseIndex.push(parseInt(D,10)),this.untitledCloseIndex.sort((I,O)=>I-O)}}createUntitledURI(){const w=this.untitledCloseIndex.shift()||this.untitledIndex.id;return new E.URI().withScheme(E.Schemes.untitled).withQuery(`name=${v.UntitledDocumentIdCounter.UNTITLED_FILE_NAME_PREFIX}${w}&index=${w}`)}createUntitledResource(w={uri:this.createUntitledURI()}){return this.open(w.uri,{preview:!1,focus:!0,...w.resourceOpenOptions})}};t.WorkbenchEditorServiceImpl=b,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],b.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(g.ResourceService),n.__metadata("design:type",g.ResourceService)],b.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],b.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],b.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(E.StorageProvider),n.__metadata("design:type",Function)],b.prototype,"getStorage",void 0),n.__decorate([(0,r.Autowired)(s.IDialogService),n.__metadata("design:type",Object)],b.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],b.prototype,"openner",void 0),n.__decorate([(0,r.Autowired)(d.BrowserEditorContribution),n.__metadata("design:type",Object)],b.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(c.IEditorDocumentModelService),n.__metadata("design:type",Object)],b.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(v.UntitledDocumentIdCounter),n.__metadata("design:type",v.UntitledDocumentIdCounter)],b.prototype,"untitledIndex",void 0),n.__decorate([(0,r.Autowired)(s.IWindowDialogService),n.__metadata("design:type",Object)],b.prototype,"windowDialogService",void 0),n.__decorate([(0,E.OnEvent)(d.EditorGroupChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[d.EditorGroupChangeEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"onEditorGroupChangeEvent",null),n.__decorate([(0,E.OnEvent)(d.EditorGroupCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[d.EditorGroupCloseEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"handleOnCloseUntitledResource",null),t.WorkbenchEditorServiceImpl=b=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],b);let y=class extends E.WithEventBus{constructor(w,D){super(),this.name=w,this.groupId=D,this.openingPromise=new Map,this._onDidEditorFocusChange=this.registerDispose(new E.Emitter),this.onDidEditorFocusChange=this._onDidEditorFocusChange.event,this._onDidEditorGroupTabChanged=new E.Emitter,this.onDidEditorGroupTabChanged=this._onDidEditorGroupTabChanged.event,this._onDidEditorGroupTabOperation=new E.Emitter,this.onDidEditorGroupTabOperation=this._onDidEditorGroupTabOperation.event,this._onDidEditorGroupBodyChanged=new E.Emitter,this.onDidEditorGroupBodyChanged=this._onDidEditorGroupBodyChanged.event,this._onDidEditorGroupContentLoading=new E.Emitter,this.onDidEditorGroupContentLoading=this._onDidEditorGroupContentLoading.event,this.previewURI=null,this.resources=[],this.resourceStatus=new Map,this.cachedResourcesActiveOpenTypes=new Map,this.cachedResourcesOpenTypes=new Map,this.availableOpenTypes=[],this.activeComponents=new Map,this.activateComponentsProps=new Map,this.holdDocumentModelRefs=new Map,this.toDispose=[],this._prevDomHeight=0,this._prevDomWidth=0,this._onCurrentEditorCursorChange=new E.Emitter,this.onCurrentEditorCursorChange=this._onCurrentEditorCursorChange.event,this.resourceOpenHistory=[],this._domNode=null,this._diffEditorDomNode=null,this._diffEditorDomNodeAttached=!1,this._mergeEditorDomNode=null,this._mergeEditorDomNodeAttached=!1,this.codeEditorReady=new E.ReadyEvent,this.diffEditorReady=new E.ReadyEvent,this.diffEditorDomReady=new E.ReadyEvent,this.mergeEditorReady=new E.ReadyEvent,this.mergeEditorDomReady=new E.ReadyEvent,this._restoringState=!1,this.eventBus.onDirective(o.ResizeEvent.createDirective((0,o.getSlotLocation)("@opensumi/ide-editor",this.config.layoutConfig)),()=>{this.doLayoutEditors()}),this.eventBus.on(d.GridResizeEvent,I=>{I.payload.gridId===this.grid.uid&&this.doLayoutEditors()}),this.eventBus.on(d.EditorComponentDisposeEvent,I=>{this.activeComponents.delete(I.payload),this.activateComponentsProps.delete(I.payload)}),this.listenToExplorerAutoRevealConfig()}listenToExplorerAutoRevealConfig(){this.explorerAutoRevealConfig=!!this.preferenceService.get("explorer.autoReveal"),this.disposables.push(this.preferenceService.onPreferenceChanged(w=>{w.preferenceName==="explorer.autoReveal"&&(this.explorerAutoRevealConfig=w.newValue)}))}attachDiffEditorDom(w){this._diffEditorDomNodeAttached||(this._diffEditorDomNode=w,this.diffEditorDomReady.ready(),this._diffEditorDomNodeAttached=!0)}attachMergeEditorDom(w){this._mergeEditorDomNodeAttached||(this._mergeEditorDomNode=w,this.mergeEditorDomReady.ready(),this._mergeEditorDomNodeAttached=!0)}attachToDom(w){this._domNode=w,w&&(this.contextKeyService.attachToDomNode(w),this.layoutEditors())}layoutEditors(){o.fastdom.measure(()=>{if(this._domNode){const w=this._domNode.offsetWidth,D=this._domNode.offsetHeight;(w!==this._prevDomWidth||D!==this._prevDomHeight)&&this.doLayoutEditors(),this._prevDomWidth=w,this._prevDomHeight=D}})}_layoutEditorWorker(){if(this.currentOpenType)switch(this.currentOpenType.type){case d.EditorOpenType.code:this.codeEditor&&this.codeEditor.layout();break;case d.EditorOpenType.diff:this.diffEditor&&this.diffEditor.layout();break;default:break}}doLayoutEditors(){this._measure&&this._measure.dispose(),this._measure=o.fastdom.mutate(()=>{this._layoutEditorWorker()})}setContextKeys(){var w;if(!this._resourceContext){const D=I=>{let O=null;const P=this.documentModelManager.getModelDescription(I,"resourceContextKey");return P&&(O=P.languageId),O};this._resourceContext=new l.ResourceContextKey(this.contextKeyService,I=>D(I)),this._diffResourceContextKey=new l.ResourceContextKey(this.contextKeyService,I=>D(I),"diffResource"),this._editorLangIDContextKey=this.contextKeyService.createKey("editorLangId",""),this._isInDiffEditorContextKey=this.contextKeyService.createKey("isInDiffEditor",!1),this._activeEditorIsDirtyContextKey=this.contextKeyService.createKey("activeEditorIsDirty",!1),this._isInDiffRightEditorContextKey=this.contextKeyService.createKey("isInDiffRightEditor",!1),this._isInEditorComponentContextKey=this.contextKeyService.createKey("inEditorComponent",!1)}this.currentOrPreviousFocusedEditor&&this.currentOrPreviousFocusedEditor.currentUri?(this._resourceContext.set(this.currentOrPreviousFocusedEditor.currentUri),this.currentOrPreviousFocusedEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentOrPreviousFocusedEditor.currentDocumentModel.languageId)):this.currentEditor&&this.currentEditor.currentUri?(this._resourceContext.set(this.currentEditor.currentUri),this.currentEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentEditor.currentDocumentModel.languageId)):(this.currentResource?this._resourceContext.set(this.currentResource.uri):this._resourceContext.reset(),this._editorLangIDContextKey.reset()),this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty()),this._isInDiffEditorContextKey.set(this.isDiffEditorMode()),this._isInDiffRightEditorContextKey.set(this.isDiffEditorMode()),this._isInEditorComponentContextKey.set(this.isComponentMode()),this.isDiffEditorMode()&&this._diffResourceContextKey.set((w=this.currentResource)===null||w===void 0?void 0:w.uri),this.updateContextKeyWhenDiffEditorChangesFocus()}updateContextKeyWhenDiffEditorChangesFocus(){if(this.updateContextKeyWhenEditorChangesFocusDisposer||!this.diffEditor)return;const w=()=>{this.currentFocusedEditor||(this.setContextKeys(),this._onDidEditorFocusChange.fire())};this.updateContextKeyWhenEditorChangesFocusDisposer=new E.Disposable(this.diffEditor.modifiedEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.modifiedEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.diffEditor.originalEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.originalEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onFocus(()=>{this.codeEditor.currentUri&&this.locateInFileTree(this.codeEditor.currentUri),this._currentOrPreviousFocusedEditor=this.codeEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onBlur(w),this.diffEditor.originalEditor.onBlur(w),this.diffEditor.modifiedEditor.onBlur(w)),this.addDispose(this.updateContextKeyWhenEditorChangesFocusDisposer)}get contextKeyService(){return this._contextKeyService||(this._contextKeyService=this.workbenchEditorService.editorContextKeyService.createScoped()),this._contextKeyService}get index(){return this.workbenchEditorService.sortedEditorGroups.indexOf(this)}onResourceDecorationChangeEvent(w){w.payload.decoration.dirty&&this.previewURI&&this.previewURI.isEqual(w.payload.uri)&&this.pinPreviewed(),this.resources.find(I=>I.uri.isEqual(w.payload.uri))&&this.notifyTabChanged()}resetOpenType(){this._currentOpenType=null}oResourceOpenTypeChangedEvent(w){const D=w.payload;this.cachedResourcesOpenTypes.has(D.toString())&&this.cachedResourcesOpenTypes.delete(D.toString()),this.currentResource&&this.currentResource.uri.isEqual(D)&&(this.resetOpenType(),this.notifyBodyChanged(),this.displayResourceComponent(this.currentResource,{}))}async onRegisterEditorComponentEvent(){if(this.currentResource){const w=this.currentResource,D=await this.editorComponentRegistry.resolveEditorComponent(w);this.currentResource===w&&(this.availableOpenTypes=D,this.cachedResourcesOpenTypes.set(w.uri.toString(),D))}}pinPreviewed(w){const D=this.previewURI;w===void 0?this.previewURI=null:this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),D!==this.previewURI&&this.notifyTabChanged()}notifyTabChanged(){this._restoringState||this._onDidEditorGroupTabChanged.fire()}notifyBodyChanged(){this._onDidEditorGroupBodyChanged.fire()}notifyTabLoading(w){this._onDidEditorGroupContentLoading.fire(w)}get currentEditor(){return this.currentOpenType?this.currentOpenType.type===d.EditorOpenType.code?this.codeEditor:this.currentOpenType.type===d.EditorOpenType.diff?this.diffEditor.modifiedEditor:null:null}get currentOrPreviousFocusedEditor(){return this._currentOrPreviousFocusedEditor||this.currentEditor}get currentFocusedEditor(){if(this.currentOpenType){if(this.currentOpenType.type===d.EditorOpenType.code){if(this.codeEditor.monacoEditor.hasWidgetFocus())return this.codeEditor}else if(this.currentOpenType.type===d.EditorOpenType.diff){if(this.diffEditor.modifiedEditor.monacoEditor.hasTextFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasTextFocus())return this.diffEditor.originalEditor;if(this.diffEditor.modifiedEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.originalEditor}}return null}get currentCodeEditor(){return this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code?this.codeEditor:null}createEditor(w){this.codeEditor=this.collectionService.createCodeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.addDispose(this.codeEditor.onRefOpen(()=>{this.doLayoutEditors()})),this.toDispose.push(this.codeEditor.onCursorPositionChanged(D=>{this._onCurrentEditorCursorChange.fire(D)})),this.toDispose.push(this.codeEditor.onSelectionsChanged(D=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.eventBus.fire(new d.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:D.selections,source:D.source,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onVisibleRangesChanged(D=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.eventBus.fire(new d.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:D,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.eventBus.fire(new d.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:this.codeEditor.currentUri}))})),this.eventBus.fire(new d.CodeEditorDidVisibleEvent({groupName:this.name,type:d.EditorOpenType.code,editorId:this.codeEditor.getId()})),this.toDispose.push(this.codeEditor.monacoEditor.onDidChangeModelContent(()=>{this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty())})),this.codeEditorReady.ready()}createMergeEditor(w){this.mergeEditor=this.collectionService.createMergeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),this.mergeEditorReady.ready()}createDiffEditor(w){this.diffEditor=this.collectionService.createDiffEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.diffEditor.onRefOpen(()=>{this.doLayoutEditors()}),this.addDiffEditorEventListeners(this.diffEditor.originalEditor,"original"),this.addDiffEditorEventListeners(this.diffEditor.modifiedEditor,"modified"),this.eventBus.fire(new d.CodeEditorDidVisibleEvent({groupName:this.name,type:d.EditorOpenType.diff,editorId:this.diffEditor.modifiedEditor.getId()})),this.eventBus.fire(new d.CodeEditorDidVisibleEvent({groupName:this.name,type:d.EditorOpenType.diff,editorId:this.diffEditor.originalEditor.getId()})),this.diffEditorReady.ready()}addDiffEditorEventListeners(w,D){this.toDispose.push(w.onSelectionsChanged(I=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.eventBus.fire(new d.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:I.selections,source:I.source,editorUri:E.URI.from(w.monacoEditor.getModel().uri),side:D}))})),this.toDispose.push(w.onVisibleRangesChanged(I=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.eventBus.fire(new d.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:I,editorUri:w.currentUri}))})),this.toDispose.push(w.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.eventBus.fire(new d.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:w.currentUri}))}))}async split(w,D,I){var O,P,R;const M=this.workbenchEditorService.createEditorGroup(),k=w===g.EditorGroupSplitAction.Left||w===g.EditorGroupSplitAction.Right?u.SplitDirection.Horizontal:u.SplitDirection.Vertical,B=w===g.EditorGroupSplitAction.Left||w===g.EditorGroupSplitAction.Top;if(this.grid.split(k,M,B),I&&!I.scrollTop&&(I.scrollTop=(O=this.currentEditor)===null||O===void 0?void 0:O.monacoEditor.getScrollTop()),I&&!I.scrollLeft&&(I.scrollLeft=(P=this.currentEditor)===null||P===void 0?void 0:P.monacoEditor.getScrollLeft()),I&&!I?.range){const x=(R=this.currentCodeEditor)===null||R===void 0?void 0:R.monacoEditor.getSelection();x&&(I.range=new _.Range(x.startLineNumber,x.startColumn,x.endLineNumber,x.endColumn))}return M.open(D,{...I,preview:!1,revealRangeInCenter:!1})}async open(w,D={}){if(w.scheme===E.Schemes.file&&this.recentFilesManager.setMostRecentlyOpenedFile(w.withoutFragment().toString()),D&&D.split)return this.split(D.split,w,Object.assign({},D,{split:void 0,preview:!1}));if(!this.openingPromise.has(w.toString())){const O=this.doOpen(w,D);this.openingPromise.set(w.toString(),O),O.then(()=>{this.openingPromise.delete(w.toString())},()=>{this.openingPromise.delete(w.toString())})}return this.preferenceService.get("editor.previewMode")&&((0,E.isUndefinedOrNull)(D.preview)?!0:D.preview)||this.openingPromise.get(w.toString()).then(()=>{this.pinPreviewed(w)}),this.openingPromise.get(w.toString())}async pin(w){return this.pinPreviewed(w)}getPreventScrollOption(w={}){var D;return(D=w.preventScroll)!==null&&D!==void 0?D:this.preferenceService.get("editor.preventScrollAfterFocused")}async doOpen(w,D={}){var I,O,P;if(!this.resourceService.handlesUri(w))return this.openerService.open(w),!1;let R;try{const M=this.preferenceService.get("editor.previewMode")&&((0,E.isUndefinedOrNull)(D.preview)?!0:D.preview);if(this.currentResource&&this.currentResource.uri.isEqual(w)&&(!D.forceOpenType||D.forceOpenType.type===((I=this.currentOpenType)===null||I===void 0?void 0:I.type))){if(D.focus&&this.currentEditor){const k=this.getPreventScrollOption(D);(O=this._domNode)===null||O===void 0||O.focus({preventScroll:k}),this.currentEditor.monacoEditor.focus()}return D.range&&this.currentEditor&&(this.currentEditor.monacoEditor.setSelection(D.range),setTimeout(()=>{var k;(k=this.currentEditor)===null||k===void 0||k.monacoEditor.revealRangeInCenter(D.range,0)},0)),this.locationInTree(D,w),this.notifyTabChanged(),{group:this,resource:this.currentResource}}else{const k=this._currentOpenType,B=this._currentResource;let x=null,N=this.resources.find(U=>U.uri.toString()===w.toString());if(!N){if(N=await this.resourceService.getResource(w),!N)throw new Error("This uri cannot be opened!: "+w);if(N.deleted){if(D.deletedPolicy==="fail")throw new Error("resource deleted "+w);if(D.deletedPolicy==="skip")return!1}D&&D.label&&(N.name=D.label),D&&(0,E.isDefined)(D.supportsRevive)&&(N.supportsRevive=D.supportsRevive);let U=null;if(D&&D.index!==void 0&&D.index<this.resources.length)U=this.resources[D.index],this.resources.splice(D.index,0,N),x={type:"open",resource:N,index:D.index};else if(this.currentResource){const Y=this.resources.indexOf(this.currentResource);this.resources.splice(Y+1,0,N),x={type:"open",resource:N,index:Y+1},U=this.currentResource}else this.resources.push(N),x={type:"open",resource:N,index:this.resources.length-1};M&&(this.previewURI&&await this.close(this.previewURI,{treatAsNotCurrent:!0,force:D.forceClose}),this.previewURI=N.uri),D.replace&&U&&await this.close(U.uri,{treatAsNotCurrent:!0,force:D.forceClose})}if(D.backend)return this.notifyTabChanged(),!1;if(B&&this.resourceOpenHistory[this.resourceOpenHistory.length-1]!==B.uri){this.resourceOpenHistory.push(B.uri);const U=(P=this.currentCodeEditor)===null||P===void 0?void 0:P.getSelections();U&&U.length>0&&this.recentFilesManager.updateMostRecentlyOpenedFile(B.uri.toString(),{lineNumber:U[0].selectionStartLineNumber,column:U[0].selectionStartColumn})}this._currentOpenType=null,this._currentResource=N;const j=this.reporterService.time(E.REPORT_NAME.EDITOR_REACTIVE);R=new E.Deferred,this.resourceStatus.set(N,R.promise);const K=setTimeout(()=>{this.notifyTabLoading(N)},60);this.notifyTabChanged(),this.notifyBodyChanged();try{await this.displayResourceComponent(N,D)}finally{x&&this._onDidEditorGroupTabOperation.fire(x)}return this._currentOrPreviousFocusedEditor=this.currentEditor,clearTimeout(K),R.resolve(),j.timeEnd(N.uri.toString()),this._onDidEditorFocusChange.fire(),this.setContextKeys(),this.eventBus.fire(new d.EditorGroupOpenEvent({group:this,resource:N})),this.locationInTree(D,w),this.eventBus.fire(new d.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:k,oldResource:B})),{group:this,resource:N}}}catch(M){return(0,E.getDebugLogger)().error(M),R&&R.reject(),(0,h.isEditorError)(M,h.EditorTabChangedError)||this.messageService.error((0,E.formatLocalize)("editor.failToOpen",w.displayName,M.message),[],!0),!1}}locationInTree(w,D){w?.backend||(w?.disableNavigate||this.locateInFileTree(D),w.disableNavigateOnOpendEditor||this.locateInOpenedEditor(D))}locateInFileTree(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.FILE_COMMANDS.LOCATION.id,w)}locateInOpenedEditor(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.OPEN_EDITORS_COMMANDS.LOCATION.id,w)}async openUris(w){for(const D of w)await this.open(D)}async getDocumentModelRef(w){const D=w.toString();return this.holdDocumentModelRefs.has(D)||this.holdDocumentModelRefs.set(D,await this.documentModelManager.createModelReference(w,"editor-group-"+this.name)),this.holdDocumentModelRefs.get(D)}disposeDocumentRef(w){if(w.scheme==="diff"){const D=w.getParsedQuery();this.doDisposeDocRef(new E.URI(D.original)),this.doDisposeDocRef(new E.URI(D.modified))}else w.scheme==="mergeEditor"?this.mergeEditor&&this.mergeEditor.dispose():this.doDisposeDocRef(w)}doDisposeDocRef(w){const D=w.toString();this.holdDocumentModelRefs.has(D)&&(this.holdDocumentModelRefs.get(D).dispose(),this.holdDocumentModelRefs.delete(D))}async openCodeEditor(w,D){this.resolveTabChanged(w,this.currentResource),await this.codeEditorReady.onceReady(async()=>{var I;const O=await this.getDocumentModelRef(w.uri);if(await this.codeEditor.open(O),D.range){const P=new _.Range(D.range.startLineNumber,D.range.startColumn,D.range.endLineNumber,D.range.endColumn);this.codeEditor.monacoEditor.setSelection(P),D.revealRangeInCenter&&setTimeout(()=>{this.codeEditor.monacoEditor.revealRangeInCenter(P,1)})}if(queueMicrotask(()=>{D.scrollTop&&this.codeEditor.monacoEditor.setScrollTop(D.scrollTop),D.scrollLeft&&this.codeEditor.monacoEditor.setScrollLeft(D.scrollLeft)}),D.focus){const P=this.getPreventScrollOption(D);(I=this._domNode)===null||I===void 0||I.focus({preventScroll:P});const R=this.eventBus.on(d.CodeEditorDidVisibleEvent,M=>{var k;if(M.payload.groupName===this.name&&M.payload.type===d.EditorOpenType.code){if(R.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.codeEditor&&(!((k=this.codeEditor.currentUri)===null||k===void 0)&&k.isEqual(w.uri)))try{this.codeEditor.focus()}catch{}}})}O.instance.dirty&&this.pinPreviewed(w.uri)})}async openDiffEditor(w,D){this.diffEditor||await this.diffEditorDomReady.onceReady(()=>{var R;const M=document.createElement("div");(R=this._diffEditorDomNode)===null||R===void 0||R.appendChild(M),this.createDiffEditor(M)});const I=w,[O,P]=await Promise.all([this.getDocumentModelRef(I.metadata.original),this.getDocumentModelRef(I.metadata.modified)]);await this.diffEditorReady.onceReady(async()=>{var R;if(!(!O||!P)&&(await this.diffEditor.compare(O,P,D,w.uri),D.focus)){const M=this.getPreventScrollOption(D);(R=this._domNode)===null||R===void 0||R.focus({preventScroll:M});const k=this.eventBus.on(d.CodeEditorDidVisibleEvent,B=>{if(B.payload.groupName===this.name&&B.payload.type===d.EditorOpenType.diff){if(k.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.diffEditor.modifiedEditor)try{this.diffEditor.focus()}catch{}}})}})}async openMergeEditor(w){const{metadata:D}=w;if(!D)return;this.mergeEditor||await this.mergeEditorDomReady.onceReady(()=>{var K;const U=document.createElement("div");(K=this._mergeEditorDomNode)===null||K===void 0||K.appendChild(U),this.createMergeEditor(U)});const{ancestor:I,input1:O,input2:P,output:R}=D,M=m.MergeEditorInputData.from(O),k=m.MergeEditorInputData.from(P),[B,x,N,j]=await Promise.all([this.getDocumentModelRef(E.URI.parse(I)),this.getDocumentModelRef(M.uri),this.getDocumentModelRef(E.URI.parse(R)),this.getDocumentModelRef(k.uri)]);await this.mergeEditorReady.onceReady(async()=>{await this.mergeEditor.open({ancestor:{uri:E.URI.parse(D.ancestor),textModel:B.instance.getMonacoModel(),baseContent:B.instance.baseContent||""},input1:M.setTextModel(x.instance.getMonacoModel()),input2:k.setTextModel(j.instance.getMonacoModel()),output:{uri:E.URI.parse(D.output),textModel:N.instance.getMonacoModel()}})})}async openCustomEditor(w,D){const I=this.editorComponentRegistry.getEditorComponent(D),O=this.editorComponentRegistry.getEditorInitialProps(D);if(I){if(this.activateComponentsProps.set(I,O),I.renderMode===d.EditorComponentRenderMode.ONE_PER_RESOURCE){const P=this.activeComponents.get(I)||[];P.findIndex(M=>M.uri.toString()===w.uri.toString())===-1&&P.push(w),this.activeComponents.set(I,P)}else if(I.renderMode===d.EditorComponentRenderMode.ONE_PER_GROUP)this.activeComponents.set(I,[w]);else if(I.renderMode===d.EditorComponentRenderMode.ONE_PER_WORKBENCH){const P=[];this.workbenchEditorService.editorGroups.forEach(R=>{if(R===this)return;const M=R.resources.find(k=>k.uri.isEqual(w.uri));M&&P.push(R.close(M.uri))}),await Promise.all(P).catch((0,E.getDebugLogger)().error),this.activeComponents.set(I,[w])}}else throw new Error("Cannot find Editor Component with id: "+D);this._onCurrentEditorCursorChange.fire({position:null,selectionLength:0})}async displayResourceComponent(w,D){D.revealRangeInCenter===void 0&&(D.revealRangeInCenter=!0);const I=w,O=await this.resolveOpenType(w,D);if(O){const{activeOpenType:P,openTypes:R}=O;switch(this.availableOpenTypes=R,D.preserveFocus&&(D.focus=!1),P.type){case d.EditorOpenType.code:await this.openCodeEditor(w,D);break;case d.EditorOpenType.diff:await this.openDiffEditor(w,D);break;case d.EditorOpenType.mergeEditor:await this.openMergeEditor(w);break;case d.EditorOpenType.component:await this.openCustomEditor(w,P.componentId);break;default:return}this.resolveTabChanged(I,this.currentResource),this._currentOpenType=P,this.notifyBodyChanged(),this.doLayoutEditors(),this.cachedResourcesActiveOpenTypes.set(w.uri.toString(),P)}}resolveTabChanged(w,D){if(w!==D)throw new h.EditorTabChangedError}getLastOpenType(w){return this.cachedResourcesActiveOpenTypes.get(w.uri.toString())}async resolveOpenType(w,D){const I=this.cachedResourcesOpenTypes.get(w.uri.toString())||await this.editorComponentRegistry.resolveEditorComponent(w),O=this.preferenceService.get("workbench.editorAssociations"),P=S(I,this.cachedResourcesActiveOpenTypes.get(w.uri.toString()),w,O,D.forceOpenType);return this.cachedResourcesOpenTypes.set(w.uri.toString(),I),{activeOpenType:P,openTypes:I}}async close(w,{treatAsNotCurrent:D,force:I}={}){const O=this.resources.findIndex(P=>P.uri.toString()===w.toString());if(O!==-1){const P=this.resources[O];if(!I&&!await this.shouldClose(P))return!1;if(this.resources.splice(O,1),this._onDidEditorGroupTabOperation.fire({type:"close",resource:P,index:O}),this.eventBus.fire(new d.EditorGroupCloseEvent({group:this,resource:P})),this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),P===this.currentResource&&!D){let R;for(;this.resourceOpenHistory.length>0;)if(this.resources.findIndex(M=>M.uri===this.resourceOpenHistory[this.resourceOpenHistory.length-1])!==-1){R=this.resourceOpenHistory.pop();break}else this.resourceOpenHistory.pop();if(R)this.open(R);else{let M=O;for(;M>0&&!this.resources[M];)M--;this.resources[M]?this.open(this.resources[M].uri):this.backToEmpty()}}else this.notifyTabChanged();this.removeResouceFromActiveComponents(P),this.disposeDocumentRef(w)}return this.resources.length===0&&(this.grid.parent&&this.dispose(),this.availableOpenTypes=[]),!0}removeResouceFromActiveComponents(w){this.activeComponents.forEach((D,I)=>{const O=D.indexOf(w);O!==-1&&(D.splice(O,1),this.eventBus.fire(new d.ResoucesOfActiveComponentChangedEvent({component:I,resources:D})))})}async shouldClose(w){const D=this.workbenchEditorService.editorGroups.map(I=>I.resources);if(await this.resourceService.shouldCloseResource(w,D)){let I=0;for(const O of D)for(const P of O)if(P.uri.isEqual(w.uri)&&(I++,I>=2))break;return I<=1&&this.resourceService.disposeResource(w),!0}else return!1}backToEmpty(){const w=this._currentOpenType,D=this._currentResource;this._currentResource=null,this.resetOpenType(),this.notifyTabChanged(),this.notifyBodyChanged(),this._currentOrPreviousFocusedEditor=null,this._onDidEditorFocusChange.fire(),this.eventBus.fire(new d.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:w,oldResource:D}))}async closeAll(){for(const D of this.resources)if(!await this.shouldClose(D))return!1;return this.resources.splice(0,this.resources.length).reverse().forEach((D,I)=>{this.clearResourceOnClose(D),this._onDidEditorGroupTabOperation.fire({type:"close",resource:D,index:I})}),this.activeComponents.clear(),this.workbenchEditorService.editorGroups.length>1&&this.dispose(),this.previewURI=null,this.backToEmpty(),!0}async closeSaved(){const w=this.resources.filter(D=>{const I=this.resourceService.getResourceDecoration(D.uri);if(!I||!I.dirty)return!0});for(const D of w)if(!await this.shouldClose(D))return;for(const D of w)await this.close(D.uri)}async closeToRight(w){const D=this.resources.findIndex(I=>I.uri.toString()===w.toString());if(D!==-1){const I=this.resources.slice(D+1);for(const O of I)if(!await this.shouldClose(O))return;this.resources.splice(D+1),I.reverse().forEach((O,P)=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:O,index:D+1+(I.length-1-P)})});for(const O of I)this.clearResourceOnClose(O);this.open(w)}}clearResourceOnClose(w){this.eventBus.fire(new d.EditorGroupCloseEvent({group:this,resource:w})),this.removeResouceFromActiveComponents(w)}async closeOthers(w){const D=this.resources.findIndex(I=>I.uri.toString()===w.toString());if(D!==-1){const I=this.resources.filter((P,R)=>R!==D);for(const P of I)if(!await this.shouldClose(P))return;const O=this.resources;this.resources=[this.resources[D]],I.reverse().forEach(P=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:P,index:O.indexOf(P)})});for(const P of I)this.clearResourceOnClose(P);await this.open(w)}}get currentResource(){return this._currentResource}get currentOpenType(){return this._currentOpenType}async changeOpenType(w){const D=this.availableOpenTypes.find(O=>O.type===w||O.componentId===w);if(!D||!this.currentResource||A(D,this.currentOpenType))return;const I=this.currentOpenType;await this.displayResourceComponent(this.currentResource,{forceOpenType:D}),this.eventBus.fire(new d.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:I,oldResource:this.currentResource}))}async dropUri(w,D,I,O){if(D!==d.DragOverPosition.CENTER)await this.split((0,g.getSplitActionFromDragDrop)(D),w,{preview:!1,focus:!0});else if(!O)await this.open(w,{preview:!1,focus:!0});else{const P=this.resources.indexOf(O);if(P===-1)await this.open(w,{preview:!1,focus:!0});else{const R=this.resources.findIndex(M=>M.uri.toString()===w.toString());if(R===-1)await this.open(w,{index:P,preview:!1});else{const M=this.resources[R];R>P?(this.resources.splice(R,1),this.resources.splice(P,0,M),this._onDidEditorGroupTabOperation.fire({type:"move",resource:M,oldIndex:R,index:P}),await this.open(w,{preview:!1})):R<P&&(this.resources.splice(P+1,0,M),this.resources.splice(R,1),this._onDidEditorGroupTabOperation.fire({type:"move",resource:M,oldIndex:R,index:P}),await this.open(w,{preview:!1}))}}}I&&(I!==this?await I.close(w):D!==d.DragOverPosition.CENTER&&await this.close(w))}gainFocus(){this.workbenchEditorService.setCurrentGroup(this)}focus(){this.gainFocus(),this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code&&this.codeEditor.focus(),this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff&&this.diffEditor.focus()}dispose(){var w;(w=this.grid)===null||w===void 0||w.dispose(),this.workbenchEditorService.removeGroup(this),super.dispose(),this.codeEditor&&this.codeEditor.dispose(),this.diffEditor&&this.diffEditor.dispose(),this.toDispose.forEach(D=>D.dispose()),this.eventBus.fire(new d.EditorGroupDisposeEvent({group:this}))}getState(){const w=this.resources.filter(a).map(D=>D.uri.toString());return{uris:w,current:this.currentResource&&a(this.currentResource)?this.currentResource.uri.toString():void 0,previewIndex:this.previewURI?w.indexOf(this.previewURI.toString()):-1}}isCodeEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.code}isDiffEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.diff}activeEditorIsDirty(){return this.hasDirty()&&this.workbenchEditorService.currentEditorGroup===this}isComponentMode(){return!!this.currentOpenType&&this.currentOpenType.type===d.EditorOpenType.component}async restoreState(w){this._restoringState=!0,this.previewURI=w.uris[w.previewIndex]?new E.URI(w.uris[w.previewIndex]):null;for(const I of w.uris)await this.doOpen(new E.URI(I),{disableNavigate:!0,backend:!0,preview:!1,deletedPolicy:"skip"});let D;w.current?D=new E.URI(w.current):w.uris.length>0&&(D=new E.URI(w.uris[w.uris.length-1])),D&&(await this.open(D,{deletedPolicy:"skip"})||this.resources[0]&&await this.open(this.resources[0].uri)),this._restoringState=!1,this.notifyTabChanged()}async saveAll(w,D){for(const I of this.resources)!w&&I.uri.scheme===E.Schemes.untitled||await this.saveResource(I,D)}async saveResource(w,D=g.SaveReason.Manual){if(await this.saveByOpenType(w,D))return;const I=this.documentModelManager.getModelReference(w.uri);I&&(await I.instance.save(void 0,D),I.dispose())}async saveByOpenType(w,D){const I=this.cachedResourcesActiveOpenTypes.get(w.uri.toString());if(I&&I.saveResource)try{return await I.saveResource(w,D),!0}catch(O){this.logger.error(O)}return!1}async saveCurrent(w=g.SaveReason.Manual){const D=this.currentResource;if(D&&!await this.saveByOpenType(D,w)&&this.currentEditor)return this.currentEditor.save()}hasDirty(){for(const w of this.resources){const D=this.documentModelManager.getModelDescription(w.uri);if(D&&D.dirty)return!0}return!1}calcDirtyCount(w=new Set){let D=0;for(const I of this.resources){const O=this.documentModelManager.getModelDescription(I.uri,"calc-dirty-count");w.has(I.uri.toString())||(w.add(I.uri.toString()),O&&O.dirty&&(D+=1))}return D}componentUndo(){const w=this.currentOpenType;w?.undo&&w.undo(this.currentResource)}componentRedo(){const w=this.currentOpenType;w?.redo&&w.redo(this.currentResource)}toJSON(){return{name:this.name}}};t.EditorGroup=y,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",g.EditorCollectionService)],y.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",g.ResourceService)],y.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",d.EditorComponentRegistry)],y.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(g.WorkbenchEditorService),n.__metadata("design:type",b)],y.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(c.IEditorDocumentModelService),n.__metadata("design:type",Object)],y.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(E.CommandService),n.__metadata("design:type",Object)],y.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],y.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.RecentFilesManager),n.__metadata("design:type",o.RecentFilesManager)],y.prototype,"recentFilesManager",void 0),n.__decorate([(0,r.Autowired)(s.IMessageService),n.__metadata("design:type",Object)],y.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(E.IReporterService),n.__metadata("design:type",Object)],y.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],y.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],y.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(E.ILogger),n.__metadata("design:type",Object)],y.prototype,"logger",void 0),n.__decorate([(0,E.OnEvent)(g.ResourceDecorationChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[g.ResourceDecorationChangeEvent]),n.__metadata("design:returntype",void 0)],y.prototype,"onResourceDecorationChangeEvent",null),n.__decorate([(0,E.OnEvent)(d.ResourceOpenTypeChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[d.ResourceOpenTypeChangedEvent]),n.__metadata("design:returntype",void 0)],y.prototype,"oResourceOpenTypeChangedEvent",null),n.__decorate([(0,E.OnEvent)(d.RegisterEditorComponentEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",Promise)],y.prototype,"onRegisterEditorComponentEvent",null),t.EditorGroup=y=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Number])],y);function S(T,w,D,I,O){if(O)return T.find(P=>A(P,O))||T[0];if(w)return T.find(P=>A(P,w))||T[0];if(I){const P=T.find(R=>{const M=Object.keys(I).find(x=>(0,E.match)(x,D.uri.path.toString().toLowerCase())||(0,E.match)(x,D.uri.path.base.toLowerCase())),k=M&&I[M];if(!k)return!1;const B=`${E.CUSTOM_EDITOR_SCHEME}-${k}`;return R.componentId===B});if(P)return P}return T[0]}function A(T,w){return T.type===w.type&&(T.type!==d.EditorOpenType.component||T.componentId===w.componentId)}},94180:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarLeftExtraContentId=t.TabbarRightExtraContentId=void 0,t.TabbarRightExtraContentId="tabbar-right-extra-content",t.TabbarLeftExtraContentId="tabbar-left-extra-content"},93107:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDocPersistentCacheProvider=void 0,t.isDocContentCache=e,t.isDocChangesCache=n,t.parseCacheValueFrom=r,t.IDocPersistentCacheProvider=Symbol("IDocPersistentCacheProvider");function e(o){return o.hasOwnProperty("content")}function n(o){return o.hasOwnProperty("changeMatrix")}function r(o){const l=o.text,m=o.range.startLineNumber,E=o.range.startColumn,p=o.range.endLineNumber,_=o.range.endColumn;return[l,m,E,p,_]}},55113:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AUTO_SAVE_MODE=t.SaveReason=t.Direction=t.EditorGroupSplitAction=t.DragOverPosition=t.EditorOpenType=t.IEditorPriority=t.OverviewRulerLane=t.WorkbenchEditorService=t.DidApplyEditorDecorationFromProvider=t.DidChangeEditorGroupUriEvent=t.CollectionEditorsUpdateEvent=t.EditorCollectionService=t.EditorType=t.ShowLightbulbIconMode=void 0,t.getSimpleEditorOptions=y,t.isTextEditorViewState=S;const n=e(85608),r=e(76003),o=e(43718);var l=e(20868);Object.defineProperty(t,"ShowLightbulbIconMode",{enumerable:!0,get:function(){return l.ShowLightbulbIconMode}});var m;(function(A){A[A.CODE=0]="CODE",A[A.ORIGINAL_DIFF=1]="ORIGINAL_DIFF",A[A.MODIFIED_DIFF=2]="MODIFIED_DIFF",A.MERGE_EDITOR_DIFF="MERGE_EDITOR_DIFF"})(m||(t.EditorType=m={}));let E=class{};t.EditorCollectionService=E,t.EditorCollectionService=E=n.__decorate([(0,r.Injectable)()],E);class p extends o.BasicEvent{}t.CollectionEditorsUpdateEvent=p;class _ extends o.BasicEvent{}t.DidChangeEditorGroupUriEvent=_;class s extends o.BasicEvent{}t.DidApplyEditorDecorationFromProvider=s;class g{}t.WorkbenchEditorService=g;var c;(function(A){A[A.Left=1]="Left",A[A.Center=2]="Center",A[A.Right=4]="Right",A[A.Full=7]="Full"})(c||(t.OverviewRulerLane=c={}));var h;(function(A){A.builtin="builtin",A.option="option",A.exclusive="exclusive",A.default="default"})(h||(t.IEditorPriority=h={}));var u;(function(A){A.code="code",A.diff="diff",A.mergeEditor="mergeEditor",A.component="component"})(u||(t.EditorOpenType=u={}));var d;(function(A){A.LEFT="left",A.RIGHT="right",A.TOP="top",A.BOTTOM="bottom",A.CENTER="center"})(d||(t.DragOverPosition=d={}));var v;(function(A){A[A.Top=1]="Top",A[A.Bottom=2]="Bottom",A[A.Left=3]="Left",A[A.Right=4]="Right"})(v||(t.EditorGroupSplitAction=v={}));var f;(function(A){A.UP="up",A.DOWN="down",A.LEFT="left",A.RIGHT="right"})(f||(t.Direction=f={}));var a;(function(A){A[A.Manual=1]="Manual",A[A.AfterDelay=2]="AfterDelay",A[A.FocusOut=3]="FocusOut"})(a||(t.SaveReason=a={}));var b;(function(A){A.OFF="off",A.AFTER_DELAY="afterDelay",A.EDITOR_FOCUS_CHANGE="editorFocusChange",A.WINDOWS_LOST_FOCUS="windowLostFocus"})(b||(t.AUTO_SAVE_MODE=b={}));function y(){return{fontSize:12,fontWeight:"normal",lineHeight:0,wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden"},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},guides:{highlightActiveIndentation:!1,indentation:!1,bracketPairs:!1}}}function S(A){const T=A;if(!T)return!1;const w=T;if(w.modified)return S(w.modified);const D=T;return!!(D.contributionsState&&D.viewState&&Array.isArray(D.cursorState))}},23418:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(94180),t),n.__exportStar(e(93107),t),n.__exportStar(e(55113),t),n.__exportStar(e(23950),t),n.__exportStar(e(27693),t),n.__exportStar(e(46225),t),n.__exportStar(e(4308),t),n.__exportStar(e(39467),t)},27693:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ILanguageStatusService=void 0,t.ILanguageStatusService=Symbol("ILanguageStatusService")},23950:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticTag=t.DiagnosticSeverity=t.ILanguageService=void 0,t.asSeverity=l,t.asRelatedInformations=m,t.asRelatedInformation=E,t.asMonacoDiagnostics=p,t.asMonacoDiagnostic=_;const n=e(43718);t.ILanguageService=Symbol("ILanguageService");var r;(function(s){s[s.Error=1]="Error",s[s.Warning=2]="Warning",s[s.Information=3]="Information",s[s.Hint=4]="Hint"})(r||(t.DiagnosticSeverity=r={}));var o;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(o||(t.DiagnosticTag=o={}));function l(s){return s===1?n.MarkerSeverity.Error:s===2?n.MarkerSeverity.Warning:s===3?n.MarkerSeverity.Info:n.MarkerSeverity.Hint}function m(s){if(s)return s.map(g=>E(g))}function E(s){return{resource:n.Uri.parse(s.location.uri),startLineNumber:s.location.range.start.line+1,startColumn:s.location.range.start.character+1,endLineNumber:s.location.range.end.line+1,endColumn:s.location.range.end.character+1,message:s.message}}function p(s){if(s)return s.map(g=>_(g))}function _(s){return{code:typeof s.code=="number"?s.code.toString():typeof s.code=="object"?{value:s.code.value.toString(),target:s.code.target}:s.code,severity:l(s.severity),message:s.message,source:s.source,startLineNumber:s.range.start.line+1,startColumn:s.range.start.character+1,endLineNumber:s.range.end.line+1,endColumn:s.range.end.character+1,relatedInformation:m(s.relatedInformation),tags:s.tags}}},46225:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notebookCellScheme=t.INotebookService=t.CellKind=t.NotebookCellsChangeType=void 0;var e;(function(r){r[r.ModelChange=1]="ModelChange",r[r.Move=2]="Move",r[r.ChangeCellLanguage=5]="ChangeCellLanguage",r[r.Initialize=6]="Initialize",r[r.ChangeCellMetadata=7]="ChangeCellMetadata",r[r.Output=8]="Output",r[r.OutputItem=9]="OutputItem",r[r.ChangeCellContent=10]="ChangeCellContent",r[r.ChangeDocumentMetadata=11]="ChangeDocumentMetadata",r[r.ChangeCellInternalMetadata=12]="ChangeCellInternalMetadata",r[r.ChangeCellMime=13]="ChangeCellMime",r[r.Unknown=100]="Unknown"})(e||(t.NotebookCellsChangeType=e={}));var n;(function(r){r[r.Markup=1]="Markup",r[r.Code=2]="Code"})(n||(t.CellKind=n={})),t.INotebookService=Symbol("INotebookService"),t.notebookCellScheme="vscode-notebook-cell"},4308:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AskSaveResult=t.DIFF_SCHEME=t.ResourceDecorationNeedChangeEvent=t.ResourceDecorationChangeEvent=t.ResourceRemoveEvent=t.ResourceDidUpdateEvent=t.ResourceNeedUpdateEvent=t.ResourceService=void 0,t.isDiffResource=_;const n=e(43718);class r{}t.ResourceService=r;class o extends n.BasicEvent{}t.ResourceNeedUpdateEvent=o;class l extends n.BasicEvent{}t.ResourceDidUpdateEvent=l;class m extends n.BasicEvent{}t.ResourceRemoveEvent=m;class E extends n.BasicEvent{}t.ResourceDecorationChangeEvent=E;class p extends n.BasicEvent{}t.ResourceDecorationNeedChangeEvent=p,t.DIFF_SCHEME="diff";function _(g){return g.uri.scheme===t.DIFF_SCHEME}var s;(function(g){g[g.REVERT=1]="REVERT",g[g.SAVE=2]="SAVE",g[g.CANCEL=3]="CANCEL"})(s||(t.AskSaveResult=s={}))},39467:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSplitActionFromDragDrop=r;const n=e(55113);function r(o){return{[n.DragOverPosition.LEFT]:n.EditorGroupSplitAction.Left,[n.DragOverPosition.RIGHT]:n.EditorGroupSplitAction.Right,[n.DragOverPosition.BOTTOM]:n.EditorGroupSplitAction.Bottom,[n.DragOverPosition.TOP]:n.EditorGroupSplitAction.Top}[o]}},54414:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(23418),t)},32595:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerContribution=t.EXPLORER_CONTAINER_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(30144);Object.defineProperty(t,"EXPLORER_CONTAINER_ID",{enumerable:!0,get:function(){return l.EXPLORER_CONTAINER_ID}});const m=e(21634),E=e(68456),p=e(43718);let _=class{registerComponent(g){g.register("@opensumi/ide-explorer",[],{iconClass:(0,o.getIcon)("explorer"),title:(0,o.localize)("explorer.title"),priority:10,containerId:l.EXPLORER_CONTAINER_ID,activateKeyBinding:"ctrlcmd+shift+e"})}onStart(){this.extensionsSchemaService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:l.EXPLORER_CONTAINER_ID,frameworkKind:["opensumi"],jsonSchema:{...m.browserViews.properties,description:(0,o.formatLocalize)("sumiContributes.browserViews.location.custom",(0,o.localize)("explorer.title"))}})}};t.ExplorerContribution=_,n.__decorate([(0,r.Autowired)(p.IExtensionsSchemaService),n.__metadata("design:type",Object)],_.prototype,"extensionsSchemaService",void 0),t.ExplorerContribution=_=n.__decorate([(0,o.Domain)(o.ClientAppContribution,E.ComponentContribution)],_)},59027:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32595);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[l.ExplorerContribution]}};t.ExplorerModule=m,t.ExplorerModule=m=n.__decorate([(0,r.Injectable)()],m)},18531:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressFileServerContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32242),m=e(90242);let E=class{registerStaticResolver(_){_.registerStaticResourceProvider({scheme:o.Schemes.file,resolveStaticResource:s=>{const g=new o.URI(this.appConfig.staticServicePath||m.EXPRESS_SERVER_PATH),[c,h]=s.codeUri.path.split("?");return g.resolve(`assets${decodeURIComponent(c)}`).withQuery(h)},roots:[this.appConfig.staticServicePath||m.EXPRESS_SERVER_PATH]})}};t.ExpressFileServerContribution=E,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],E.prototype,"appConfig",void 0),t.ExpressFileServerContribution=E=n.__decorate([(0,o.Domain)(l.StaticResourceContribution)],E)},98885:(L,t,e)=>{"use strict";var n;n={value:!0},t.Q=void 0;const r=e(85608),o=e(76003),l=e(41869),m=e(18531);let E=class extends l.BrowserModule{constructor(){super(...arguments),this.providers=[m.ExpressFileServerContribution]}};t.Q=E,t.Q=E=r.__decorate([(0,o.Injectable)()],E)},90242:(L,t,e)=>{"use strict";var n=e(39907);Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_MIME=t.EXPRESS_SERVER_PATH=t.EXPRESS_SERVER_PORT=void 0,t.EXPRESS_SERVER_PORT=8e3,t.EXPRESS_SERVER_PATH=n.env.STATIC_SERVER_PATH||`http://127.0.0.1:${t.EXPRESS_SERVER_PORT}/`,t.ALLOW_MIME={gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",svg:"image/svg+xml",ttf:"font/ttf",eot:"font/eot",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",js:"application/javascript",css:"text/css",mp4:"video/mp4",ogg:"video/ogg",webm:"video/webm"}},21082:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENSION_SCHEME=t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=void 0;const n=e(30144);t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=n.EXTENSION_CONTAINER_ID,t.EXTENSION_SCHEME="extension"},6449:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionOverview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(68974),m=e(95422),E=e(43718),p=e(93374),_=e(29150),s=n.__importDefault(e(40769));var g;(function(u){u.details="Details",u.changelog="ChangeLog",u.deps="Dependencies"})(g||(g={}));const c=[g.details,g.changelog,g.deps],h=({resource:u})=>{var d,v,f,a,b,y,S,A,T,w,D,I,O,P,R,M,k,B,x,N,j,K,U,Y,z;const G=(0,m.useInjectable)(_.VSXExtensionServiceToken),[Q,Z]=(0,r.useState)(!0),[$,H]=(0,r.useState)(((d=u.metadata)===null||d===void 0?void 0:d.state)===_.InstallState.INSTALLED?4:0),[X,J]=(0,r.useState)(g.details),[re,ce]=(0,r.useState)({}),fe=(0,r.useCallback)(oe=>{const le=c[oe];le&&J(le)},[]),Ae=(0,r.useCallback)(async()=>{var oe;const le=await G.getRemoteRawExtension((oe=u.metadata)===null||oe===void 0?void 0:oe.extensionId);if(le){const Ee=["readme","changelog"].map(be=>{var Ce,Ne;const tt=(Ce=le.files)===null||Ce===void 0?void 0:Ce[be];return tt?fetch(tt).then(Fe=>Fe.text()):(Ne=le[be])!==null&&Ne!==void 0?Ne:""}),[we,ve]=await Promise.all(Ee);ce({readme:we,changelog:ve,downloadCount:le.downloadCount})}Z(!1)},[u]),te=(0,r.useCallback)(async()=>{var oe;const le=await G.getLocalExtension((oe=u.metadata)===null||oe===void 0?void 0:oe.extensionId);le&&(H(1),G.install(le).finally(()=>{H(4)}))},[u]),Le=(0,r.useCallback)(async()=>{var oe;const le=await G.getLocalExtension((oe=u.metadata)===null||oe===void 0?void 0:oe.extensionId);le&&(H(2),G.uninstall(le).finally(()=>{H(3)}))},[u]);(0,r.useEffect)(()=>{Ae()},[u]);const Te=(0,r.useMemo)(()=>{var oe,le,Ee;const we=[];if(((oe=u.metadata)===null||oe===void 0?void 0:oe.state)!==_.InstallState.NOT_INSTALLED)if($!==3)we.push(r.default.createElement(o.Button,{size:"small",key:"uninstall",onClick:Le,disabled:$===2},(0,E.localize)($===2?"marketplace.extension.uninstalling":"marketplace.extension.uninstall")));else return we.push(r.default.createElement(o.Button,{size:"small",key:"uninstalled",disabled:!0},(0,E.localize)("marketplace.extension.uninstalled"))),we;return((le=u.metadata)===null||le===void 0?void 0:le.state)===_.InstallState.NOT_INSTALLED?$===4?we.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,E.localize)("marketplace.extension.installed"))):we.push(r.default.createElement(o.Button,{size:"small",key:"install",onClick:te,disabled:$!==0},(0,E.localize)($===1?"marketplace.extension.installing":"marketplace.extension.install"))):((Ee=u.metadata)===null||Ee===void 0?void 0:Ee.state)===_.InstallState.SHOULD_UPDATE?$===4?we.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,E.localize)("marketplace.extension.installed"))):we.push(r.default.createElement(o.Button,{size:"small",key:"update",onClick:te,disabled:$!==0},(0,E.localize)($===1?"marketplace.extension.updating":"marketplace.extension.update"))):we.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,E.localize)("marketplace.extension.installed"))),we},[u,$]);return r.default.createElement("div",{className:s.default.extension_overview_container},r.default.createElement(l.Progress,{loading:Q}),r.default.createElement("div",{className:s.default.extension_overview_header},!((v=u.metadata)===null||v===void 0)&&v.iconUrl?r.default.createElement("img",{src:(f=u.metadata)===null||f===void 0?void 0:f.iconUrl,alt:(0,E.replaceLocalizePlaceholder)((a=u.metadata)===null||a===void 0?void 0:a.displayName,(b=u.metadata)===null||b===void 0?void 0:b.extensionId)}):r.default.createElement("div",{className:s.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:s.default.extension_detail},r.default.createElement("div",{className:s.default.extension_name},r.default.createElement("h1",null,r.default.createElement("a",{href:`${(y=u.metadata)===null||y===void 0?void 0:y.openVSXRegistry}/extension/${(S=u.metadata)===null||S===void 0?void 0:S.namespace.toLowerCase()}/${(A=u.metadata)===null||A===void 0?void 0:A.name.toLowerCase()}`,target:"_blank",rel:"noopener noreferrer"},(0,E.replaceLocalizePlaceholder)((T=u.metadata)===null||T===void 0?void 0:T.displayName,(w=u.metadata)===null||w===void 0?void 0:w.extensionId)||((D=u.metadata)===null||D===void 0?void 0:D.name))),r.default.createElement("span",{className:s.default.extension_id},((I=u.metadata)===null||I===void 0?void 0:I.namespace.toLowerCase())+"."+((O=u.metadata)===null||O===void 0?void 0:O.name.toLowerCase()))),r.default.createElement("div",{className:s.default.manifest},r.default.createElement("span",null,r.default.createElement("a",{href:(P=u.metadata)===null||P===void 0?void 0:P.namespaceUrl,target:"_blank",rel:"noopener noreferrer"},(R=u.metadata)===null||R===void 0?void 0:R.namespace)),r.default.createElement("span",null,r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),((M=u.metadata)===null||M===void 0?void 0:M.downloadCount)||re.downloadCount),((k=u.metadata)===null||k===void 0?void 0:k.averageRating)&&r.default.createElement("span",null,(B=u.metadata)===null||B===void 0?void 0:B.averageRating),((x=u.metadata)===null||x===void 0?void 0:x.repository)&&r.default.createElement("span",null,r.default.createElement("a",{href:(N=u.metadata)===null||N===void 0?void 0:N.repository,target:"blank"},"Repository")),((j=u.metadata)===null||j===void 0?void 0:j.license)&&r.default.createElement("span",null,r.default.createElement("a",{href:(K=u.metadata)===null||K===void 0?void 0:K.files.license,target:"blank"},"License")),r.default.createElement("span",null,"v",(U=u.metadata)===null||U===void 0?void 0:U.version)),r.default.createElement("div",{className:s.default.description},(0,E.replaceLocalizePlaceholder)((Y=u.metadata)===null||Y===void 0?void 0:Y.description,(z=u.metadata)===null||z===void 0?void 0:z.extensionId)),r.default.createElement("div",{className:s.default.buttons},Te))),r.default.createElement("div",{className:s.default.extension_overview_body},r.default.createElement(o.Tabs,{className:s.default.tabs,value:X,onChange:fe,tabs:[g.details,g.changelog]}),r.default.createElement("div",{className:s.default.extension_content},X===g.details&&re.readme&&r.default.createElement(p.Markdown,{content:re.readme}),X===g.changelog&&re.changelog&&r.default.createElement(p.Markdown,{content:re.changelog}))))};t.ExtensionOverview=h},87791:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extension=t.ExtensionViewType=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),m=e(43718),E=e(29150),p=n.__importDefault(e(90425));var _;(function(s){s[s.MARKETPLACE=0]="MARKETPLACE",s[s.INSTALLED=1]="INSTALLED"})(_||(t.ExtensionViewType=_={})),t.Extension=r.default.memo(({extension:s,onInstall:g,onClick:c,type:h,installedExtensions:u,openVSXRegistry:d})=>{const v=(0,l.useDesignStyles)(p.default.extension_item,"extension_item"),[f,a]=(0,r.useState)(),b=u?.find(I=>I.namespace===s.namespace&&I.name===s.name),y=!!(h===_.INSTALLED||b),S=y&&h===_.MARKETPLACE&&b?.version!==s.version,[A,T]=(0,r.useState)(y),w=(0,r.useCallback)(I=>{I.stopPropagation(),a(!0),g(s).then(()=>{a(!1),T(!0)})},[s]),D=(0,r.useCallback)(()=>{c(s,A?S?E.InstallState.SHOULD_UPDATE:E.InstallState.INSTALLED:E.InstallState.NOT_INSTALLED)},[s]);return r.default.createElement("div",{className:v,onClick:D},s.iconUrl?r.default.createElement("img",{className:p.default.icon,src:s.iconUrl,alt:(0,m.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)}):r.default.createElement("div",{className:p.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:p.default.extension_detail},r.default.createElement("div",{className:p.default.base_info},r.default.createElement("span",{className:p.default.display_name},(0,m.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)||s.name),r.default.createElement("span",{className:p.default.version},s.version),!A&&r.default.createElement("span",{className:p.default.download_count},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),s.downloadCount)),r.default.createElement("span",{className:p.default.description},(0,m.replaceLocalizePlaceholder)(s.description,`${s.publisher}.${s.name}`)),r.default.createElement("div",{className:p.default.footer},r.default.createElement("span",{className:p.default.namespace},s.namespace),h===_.MARKETPLACE&&(y?S?r.default.createElement(o.Button,{type:"primary",size:"small",onClick:w,disabled:f},(0,m.localize)(f?"marketplace.extension.updating":"marketplace.extension.update")):r.default.createElement("span",{className:p.default.state_text},(0,m.localize)("marketplace.extension.installed")):r.default.createElement(o.Button,{type:"primary",size:"small",onClick:w,disabled:f},(0,m.localize)(f?"marketplace.extension.installing":"marketplace.extension.install"))),h===_.INSTALLED&&r.default.createElement(o.Button,{type:"primary",size:"small",onClick:w,disabled:!0},(0,m.localize)("marketplace.extension.installed")))))})},38105:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OpenVsxExtensionManagerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(29150),m=e(70274),E=e(67761);let p=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[m.VSXExtensionContribution,{token:l.VSXExtensionServiceToken,useClass:E.VSXExtensionService}],this.backServices=[{servicePath:l.VSXExtensionServicePath}]}};t.OpenVsxExtensionManagerModule=p,t.OpenVsxExtensionManagerModule=p=n.__decorate([(0,r.Injectable)()],p)},70274:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(57517),E=e(63067),p=e(52416),_=e(29150),s=e(21082),g=e(6449),c=e(73689);let h=class{initialize(){}onDidRender(){const d=this.mainLayoutService.getTabbarHandler(s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID);d&&(d.isActivated()?this.vsxExtensionService.getOpenVSXRegistry().then(()=>{this.vsxExtensionService.search("")}):d.onActivate(async()=>{!this.vsxExtensionService.openVSXRegistry&&await this.vsxExtensionService.getOpenVSXRegistry(),this.vsxExtensionService.search("")}))}registerResource(d){d.registerResourceProvider({scheme:s.EXTENSION_SCHEME,provideResource:async v=>{const{extensionId:f,state:a}=v.getParsedQuery(),b=await this.vsxExtensionService.getLocalExtension(f),y=this.iconService.fromIcon("",b?.iconUrl,p.IconType.Background);return{uri:v,metadata:{...b,extensionId:f,state:a,openVSXRegistry:this.vsxExtensionService.openVSXRegistry},icon:y||(0,o.getIcon)("extension"),name:(0,l.replaceLocalizePlaceholder)(b?.displayName,f)||""}}})}registerEditorComponent(d){const v=`${s.EXTENSION_SCHEME}_detail`;d.registerEditorComponent({component:g.ExtensionOverview,uid:v,scheme:s.EXTENSION_SCHEME}),d.registerEditorComponentResolver(s.EXTENSION_SCHEME,(f,a,b)=>{b?.([{type:m.EditorOpenType.component,componentId:v}])})}registerComponent(d){d.register("@opensumi/ide-extension-manager",[],{iconClass:(0,o.getIcon)("extension"),title:(0,l.localize)("marketplace.extension.container"),priority:5,containerId:s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,component:c.VSXExtensionView,activateKeyBinding:"ctrlcmd+shift+x"})}};t.VSXExtensionContribution=h,n.__decorate([(0,r.Autowired)(E.IMainLayoutService),n.__metadata("design:type",Object)],h.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(_.VSXExtensionServiceToken),n.__metadata("design:type",Object)],h.prototype,"vsxExtensionService",void 0),n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],h.prototype,"iconService",void 0),t.VSXExtensionContribution=h=n.__decorate([(0,l.Domain)(o.ClientAppContribution,E.MainLayoutContribution,o.ComponentContribution,m.BrowserEditorContribution)],h)},67761:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57517),m=e(98453),E=e(71354),p=e(28423),_=e(52416),s=e(12456),g=e(29150);let c=class extends o.Disposable{get extensions(){return this.extensionsObservable.get()}get installedExtensions(){return this.installedExtensionsObservable.get()}get openVSXRegistry(){return this.openVSXRegistryObservable.get()}constructor(){super(),this.extensionsObservable=(0,p.observableValue)(this,[]),this.installedExtensionsObservable=(0,p.observableValue)(this,[]),this.openVSXRegistryObservable=(0,p.observableValue)(this,""),this.tasks=new Map,this.getInstalledExtensions(),this.disposables.push(this.extensionInstanceService.onDidChange(()=>{this.getInstalledExtensions(),this.search(this.searchValue)}))}updateStatusBar(){if(this.tasks.size===0){this.installStatus&&(this.installStatus.dispose(),this.installStatus=void 0);return}const u="sumi-upload-file-status";if(this.tasks.size===1){const d=(0,o.localize)("marketplace.extension.installing"),v={text:d,alignment:o.StatusBarAlignment.RIGHT,tooltip:d,iconClass:"kaitian-icon kticon-cloud-server"};this.installStatus=this.statusBarService.addElement(u,v)}}async install(u){var d,v;const f=this.getExtensionId(u);if(this.tasks.has(f)||!u.downloadUrl)return;const a=this.backService.install({id:f,name:(d=u.name)!==null&&d!==void 0?d:"-",url:u.downloadUrl,version:(v=u.version)!==null&&v!==void 0?v:"-"});return this.tasks.set(f,a),this.updateStatusBar(),a.then(async b=>{if(this.tasks.delete(f),this.updateStatusBar(),await this.extensionManagementService.postChangedExtension(!1,b),this.themeService.getAvailableThemeInfos().some(T=>T.extensionId===u.originId)){this.commandService.executeCommand(s.THEME_TOGGLE_COMMAND.id,{extensionId:u.originId});return}if(this.iconService.getAvailableThemeInfos().some(T=>T.extensionId===u.originId)){this.commandService.executeCommand(s.ICON_THEME_TOGGLE_COMMAND.id,{extensionId:u.originId});return}if(this.productIconService.getAvailableThemeInfos().some(T=>T.extensionId===u.originId)){this.commandService.executeCommand(s.PRODUCT_ICON_THEME_TOGGLE_COMMAND.id,{extensionId:u.originId});return}})}async uninstall(u){u&&u.path&&await this.extensionManagementService.postUninstallExtension(u.path)}async disable(u){u&&u.path&&this.extensionManagementService.postDisableExtension(u.path)}async enable(u){u&&u.path&&this.extensionManagementService.postEnableExtension(u.path)}getExtensionId(u){var d,v,f;return(d=u?.extensionId)!==null&&d!==void 0?d:((v=u?.namespace)===null||v===void 0?void 0:v.toLowerCase())+"."+((f=u?.name)===null||f===void 0?void 0:f.toLowerCase())}async getLocalExtension(u){return u?this.extensions.find(v=>this.getExtensionId(v)===u)||this.installedExtensions.find(v=>this.getExtensionId(v)===u):void 0}async getRemoteRawExtension(u){if(!u)return;const d={extensionId:u},v=await this.backService.getExtension(d);if(v&&v.extensions&&v.extensions.length>=1)return Object.assign({},v.extensions[0])}async getOpenVSXRegistry(){const u=await this.backService.getOpenVSXRegistry();(0,p.transaction)(d=>{this.openVSXRegistryObservable.set(u,d)})}async openExtensionEditor(u,d){this.workbenchEditorService.open(new o.URI(`extension://?extensionId=${u}&state=${d}`),{preview:!0})}async search(u){const d={query:u,size:50,sortBy:"downloadCount"};this.searchValue=u;const v=await this.backService.search(d);v.extensions&&(0,p.transaction)(f=>{this.extensionsObservable.set(v.extensions.filter(a=>!this.installedExtensions.find(b=>this.getExtensionId(b)===this.getExtensionId(a))).map(a=>({...a,publisher:a.namespace,iconUrl:a.files.icon,downloadUrl:a.files.download,readme:a.files.readme})),f)})}async searchInstalledExtensions(u){(0,p.transaction)(d=>{const v=this.installedExtensions;this.installedExtensionsObservable.set(v.sort((f,a)=>{const b=(0,o.fuzzyScore)(u,u.toLowerCase(),0,f.name,f.name.toLowerCase(),0,!0),y=(0,o.fuzzyScore)(u,u.toLowerCase(),0,a.name,a.name.toLowerCase(),0,!0);return b?y?y[0]-b[0]:-1:1}),d)})}getInstalledExtensions(){const u=this.extensionInstanceService.getExtensionInstances().map(d=>{const v=d.extensionId;return{namespace:v&&v.includes(".")?v.split(".")[0]:d.packageJSON.publisher,name:d.packageJSON.name,id:d.extensionId,version:d.packageJSON.version,displayName:d.packageJSON.displayName,description:d.packageJSON.description,publisher:d.packageJSON.publisher,iconUrl:d.packageJSON.icon&&d.extensionLocation.toString()+`/${d.packageJSON.icon}`,path:d.path,realpath:d.realPath}});(0,p.transaction)(d=>{this.installedExtensionsObservable.set(u,d)})}};t.VSXExtensionService=c,n.__decorate([(0,r.Autowired)(g.VSXExtensionServicePath),n.__metadata("design:type",Object)],c.prototype,"backService",void 0),n.__decorate([(0,r.Autowired)(l.WorkbenchEditorService),n.__metadata("design:type",l.WorkbenchEditorService)],c.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(E.AbstractExtInstanceManagementService),n.__metadata("design:type",E.AbstractExtInstanceManagementService)],c.prototype,"extensionInstanceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.ExtensionManagementService)],c.prototype,"extensionManagementService",void 0),n.__decorate([(0,r.Autowired)(_.IThemeService),n.__metadata("design:type",Object)],c.prototype,"themeService",void 0),n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],c.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(_.IProductIconService),n.__metadata("design:type",Object)],c.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],c.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.IStatusBarService),n.__metadata("design:type",Object)],c.prototype,"statusBarService",void 0),n.__decorate([(0,o.pMemoize)(h=>h),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",Promise)],c.prototype,"search",null),t.VSXExtensionService=c=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],c)},73689:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importStar(e(14041)),l=e(14041),m=e(97267),E=e(41869),p=e(68974),_=e(43718),s=e(5567),g=e(29150),c=e(21082),h=e(87791),u=n.__importDefault(e(68143)),d=[g.TabActiveKey.MARKETPLACE,g.TabActiveKey.INSTALLED],v=()=>{const[f,a]=(0,l.useState)(g.TabActiveKey.MARKETPLACE),[b,y]=(0,l.useState)(!1),S=(0,E.useInjectable)(g.VSXExtensionServiceToken),A=(0,E.useAutorun)(S.extensionsObservable),T=(0,E.useAutorun)(S.installedExtensionsObservable),w=(0,E.useAutorun)(S.openVSXRegistryObservable),D=(0,r.default)(R=>{y(!0);let M;f===g.TabActiveKey.MARKETPLACE?M=S.search(R):M=S.searchInstalledExtensions(R),typeof M=="object"&&M.then&&M.then(()=>{y(!1)})},500),I=(0,l.useCallback)(R=>S.install(R),[]),O=(0,l.useCallback)((R,M)=>{const k=S.getExtensionId(R);S.openExtensionEditor(k,M)},[]),P=(0,l.useCallback)(R=>{const M=d[R];M&&a(M)},[]);return o.createElement("div",{className:u.default.panel},o.createElement(m.Tabs,{mini:!0,className:u.default.tabs,value:d.indexOf(f),onChange:P,tabs:[(0,_.localize)("marketplace.panel.tab.marketplace"),(0,_.localize)("marketplace.tab.installed")]}),o.createElement("div",{style:{padding:"8px"}},o.createElement(s.AutoFocusedInput,{containerId:c.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,placeholder:(0,_.localize)("marketplace.panel.tab.placeholder.search"),value:"",onChange:R=>D(R.target.value)})),f===g.TabActiveKey.MARKETPLACE&&o.createElement("div",{className:u.default.extensions_view},o.createElement(p.Progress,{loading:b}),A.map((R,M)=>o.createElement(h.Extension,{key:`${M}:${R.namespace}-${R.name}`,onClick:O,onInstall:I,extension:R,type:h.ExtensionViewType.MARKETPLACE,installedExtensions:T,openVSXRegistry:w}))),f===g.TabActiveKey.INSTALLED&&o.createElement("div",{className:u.default.extensions_view},T.map((R,M)=>o.createElement(h.Extension,{key:`${M}:${R.namespace}-${R.name}`,onClick:O,onInstall:I,extension:R,type:h.ExtensionViewType.INSTALLED,openVSXRegistry:w}))))};t.VSXExtensionView=v},29150:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IOpenvsxMarketplaceService=t.VSXExtensionServicePath=t.VSXExtensionServiceToken=t.VSXExtension=t.InstallState=t.TabActiveKey=t.EnableScope=void 0;var e;(function(l){l.GLOBAL="GLOBAL",l.WORKSPACE="WORKSPACE"})(e||(t.EnableScope=e={}));var n;(function(l){l.MARKETPLACE="marketplace",l.INSTALLED="installed"})(n||(t.TabActiveKey=n={}));var r;(function(l){l.INSTALLED="INSTALLED",l.NOT_INSTALLED="NOT_INSTALLED",l.SHOULD_UPDATE="SHOULD_UPDATE"})(r||(t.InstallState=r={}));class o{}t.VSXExtension=o,o.KEYS=new Set(["version","iconUrl","publisher","name","displayName","description","averageRating","downloadCount","downloadUrl","readmeUrl","licenseUrl","repository","license","readme","preview","namespaceAccess","publishedBy"]),t.VSXExtensionServiceToken=Symbol("VSXExtensionSerivceToken"),t.VSXExtensionServicePath="VSXExtensionServicePath",t.IOpenvsxMarketplaceService=Symbol("IOpenvsxMarketplaceService")},53599:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageContribution=t.ExtensionStorageModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93584),m=e(7446),E=e(16132),p=e(10207),_=e(19227);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IExtensionStorageService,useClass:p.ExtensionStorageService},{token:l.IExtensionStoragePathServer,useClass:E.ExtensionStoragePathServer},{token:l.IExtensionStorageServer,useClass:m.ExtensionStorageServer},g]}};t.ExtensionStorageModule=s,t.ExtensionStorageModule=s=n.__decorate([(0,o.Domain)(_.name)],s);let g=class{onReconnect(){this.extensionStorageService.reConnectInit()}};t.ExtensionStorageContribution=g,n.__decorate([(0,r.Autowired)(l.IExtensionStorageService),n.__metadata("design:type",Object)],g.prototype,"extensionStorageService",void 0),t.ExtensionStorageContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],g),n.__exportStar(e(10207),t)},16132:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStoragePathServer=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(96405),E=e(14951),p=e(73344),_=e(51500),{Path:s}=l.path;let g=class{constructor(){this.windowsDataFolders=[l.StoragePaths.WINDOWS_APP_DATA_DIR,l.StoragePaths.WINDOWS_ROAMING_DIR],this.deferredWorkspaceStoragePath=new l.Deferred,this.deferredStoragePath=new l.Deferred,this.storagePathInitialized=!1}get workspaceSuffixName(){return this.appConfig.workspaceSuffixName||_.DEFAULT_WORKSPACE_SUFFIX_NAME}async provideHostLogPath(){const h=await this.getLogsDirPath();if(!h)throw new Error("Unable to get parent log directory");const u=h,d=l.URI.file(u).toString();return await this.fileSystem.access(d)||await this.fileSystem.createFolder(d),new l.URI(h)}async provideHostStoragePath(h,u,d){const v=await this.getWorkspaceStorageDirPath(d);if(!v)throw new Error("Unable to get parent storage directory");await this.fileSystem.access(l.URI.file(v).toString())||await this.fileSystem.createFolder(l.URI.file(v).toString());const f=await this.buildWorkspaceId(h,u,d),a=new s(v).join(f).toString();await this.fileSystem.access(l.URI.file(a).toString())||await this.fileSystem.createFolder(l.URI.file(a).toString());const b=new l.URI(a);return this.storagePathInitialized||(this.deferredWorkspaceStoragePath.resolve(b.path.toString()),this.deferredStoragePath.resolve(v),this.storagePathInitialized=!0),this.cachedStoragePath=b}async getLastWorkspaceStoragePath(){var h;return this.storagePathInitialized?(h=this.cachedStoragePath)===null||h===void 0?void 0:h.path.toString():this.deferredWorkspaceStoragePath.promise}async getLastStoragePath(){return this.deferredStoragePath.promise}doHash(h){return this.hashCalculateService.calculate(h)}async buildWorkspaceId(h,u,d){const v=await this.getUserHomeDir(),f=y=>y.resolve(d||_.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${_.UNTITLED_WORKSPACE}.${this.workspaceSuffixName}`).withScheme(l.Schemes.file),a=y=>y.resolve(d||_.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${_.UNTITLED_WORKSPACE}`).withScheme(l.Schemes.file);if(!h){const y=a(new l.URI(v));return this.doHash(y.toString())}if(f(new l.URI(v)).toString()===h.uri){const y=u.map(S=>S.uri).sort().join(",");return this.doHash(y)}else{const y=new l.URI(h.uri);return this.doHash(y.toString())}}async getLogsDirPath(){const h=await this.loggerManager.getLogFolder();return new s(h).join(l.StoragePaths.EXTENSIONS_LOGS_DIR).toString()}async getWorkspaceStorageDirPath(h){const u=await this.getWorkspaceDataDirPath(h);return new s(u).join(l.StoragePaths.EXTENSIONS_WORKSPACE_STORAGE_DIR).toString()}async getWorkspaceDataDirPath(h){const u=await this.getUserHomeDir(),d=h;return new s(u).join(...l.isWindows?this.windowsDataFolders:[""],d).toString()}async getUserHomeDir(){const h=await this.fileSystem.getCurrentUserHome();if(!h)throw new Error("Unable to get user home directory");return await this.fileSystem.getFsPath(h.uri)}};t.ExtensionStoragePathServer=g,n.__decorate([(0,r.Autowired)(E.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(p.ILoggerManagerClient),n.__metadata("design:type",Object)],g.prototype,"loggerManager",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(m.IHashCalculateService),n.__metadata("design:type",Object)],g.prototype,"hashCalculateService",void 0),t.ExtensionStoragePathServer=g=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],g)},7446:(L,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageServer=void 0;const r=e(85608),o=e(76003),l=e(43718),m=e(14951),E=e(93584),{Path:p}=l.path;let _=n=class{constructor(){this.deferredWorkspaceDataDirPath=new l.Deferred,this.storageThrottler=new l.Throttler,this.storageTasks={},this.storageExistPromises=new Map}async init(g,c,h){return this.storageDelayer=new l.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),await this.setupDirectories(g,c,h||E.DEFAULT_EXTENSION_STORAGE_DIR_NAME)}async asAccess(g,c){if(c)return await this.fileSystem.access(g);if(!this.storageExistPromises.has(g)){const h=this.fileSystem.access(g);this.storageExistPromises.set(g,h)}return await this.storageExistPromises.get(g)}async setupDirectories(g,c,h){const u=await this.extensionStoragePathsServer.getWorkspaceDataDirPath(h),d=l.URI.file(u).toString();await this.fileSystem.access(d)||await this.fileSystem.createFolder(d),this.workspaceDataDirPath=u,this.globalDataPath=new p(this.workspaceDataDirPath).join(l.StoragePaths.EXTENSIONS_GLOBAL_STORAGE_DIR).toString();const v=l.URI.file(this.globalDataPath).toString();await this.fileSystem.access(v)||await this.fileSystem.createFolder(v),this.deferredWorkspaceDataDirPath.resolve(this.workspaceDataDirPath);const f=await this.extensionStoragePathsServer.provideHostLogPath(),a=await this.extensionStoragePathsServer.provideHostStoragePath(g,c,h);return{logUri:f.codeUri,storageUri:a.codeUri,globalStorageUri:l.Uri.file(this.globalDataPath)}}async resolveStorageTask(g){const c=Object.keys(g);for(const h of c){const u=await this.readFromFile(h);for(const{key:d,value:v}of g[h])v===void 0||(0,l.isEmptyObject)(v)?delete u[d]:u[d]=v;await this.writeToFile(h,u)}}doSet(){const g={...this.storageTasks};return this.storageTasks={},this.resolveStorageTask(g)}async set(g,c,h){const u=await this.getDataPath(h);if(!u)throw new Error("Cannot save data: no opened workspace");return this.storageTasks[u]||(this.storageTasks[u]=[]),this.storageTasks[u].push({key:g,value:c}),this.storageDelayer.trigger(()=>this.storageThrottler.queue(this.doSet.bind(this)))}async get(g,c){const h=await this.getDataPath(c);return h?(await this.readFromFile(h))[g]:{}}async getAll(g){const c=await this.getDataPath(g);return c?await this.readFromFile(c):{}}async getDataPath(g){if(this.workspaceDataDirPath===void 0&&await this.deferredWorkspaceDataDirPath.promise,g)return new p(this.globalDataPath).join("global-state.json").toString();{const c=await this.extensionStoragePathsServer.getLastWorkspaceStoragePath();return c?new p(c).join("workspace-state.json").toString():void 0}}async readFromFile(g){const c=l.URI.file(g);if(!await this.asAccess(c.toString(),!0))return{};try{const{content:u}=await this.fileSystem.readFile(c.toString());return JSON.parse(u.toString())}catch(u){return this.logger.error('Failed to parse data from "',c.toString(),'". Reason:',u),{}}}async writeToFile(g,c){const h=l.URI.file(g);await this.asAccess(h.parent.toString())||await this.fileSystem.createFolder(h.parent.toString());const d=JSON.stringify(c);let v=await this.fileSystem.getFileStat(h.toString());v||(v=await this.fileSystem.createFile(h.toString())),await this.fileSystem.setContent(v,d)}};t.ExtensionStorageServer=_,_.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(E.IExtensionStoragePathServer),r.__metadata("design:type",Object)],_.prototype,"extensionStoragePathsServer",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],_.prototype,"fileSystem",void 0),r.__decorate([(0,o.Autowired)(l.ILogger),r.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.ExtensionStorageServer=_=n=r.__decorate([(0,o.Injectable)()],_)},10207:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(51500),E=e(93584);let p=class{constructor(){this._init=this.init(),this.updateEnvState()}get whenReady(){return this._init}get extensionStoragePath(){return this._extensionStoragePath}async init(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,c=this.appConfig.extensionStorageDirName||E.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,c),this._extensionStoragePath}async updateEnvState(){await this.get(l.firstSessionDateStorageKey,!0)===void 0&&await this.set(l.firstSessionDateStorageKey,{date:new Date().toUTCString()},!0)}set(s,g,c){return this.extensionStorageServer.set(s,g,c)}get(s,g){return this.extensionStorageServer.get(s,g)}getAll(s=!1){return this.extensionStorageServer.getAll(s)}async reConnectInit(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,c=this.appConfig.extensionStorageDirName||E.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,c),this._extensionStoragePath}};t.ExtensionStorageService=p,n.__decorate([(0,r.Autowired)(E.IExtensionStorageServer),n.__metadata("design:type",Object)],p.prototype,"extensionStorageServer",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),t.ExtensionStorageService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},93584:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(85853),t),n.__exportStar(e(56969),t),n.__exportStar(e(23618),t)},85853:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=t.IExtensionStoragePathServer=void 0,t.IExtensionStoragePathServer=Symbol("IExtensionStoragePathServer"),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=".sumi"},56969:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IExtensionStorageService=t.IExtensionStorageServer=void 0,t.IExtensionStorageServer=Symbol("ExtensionStorageServer"),t.IExtensionStorageService=Symbol("ExtensionStorageService")},23618:(L,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},50492:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(93584),t)},57962:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivationEventServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(80076)),o=e(76003),l=e(43718);let m=class{constructor(){this.eventListeners=new Map,this.collectTopicData=new l.MultiMap,this.wildCardTopics=new Set,this.activatedEventSet=new Set,this.wildCardTopics.add("workspaceContains")}getTopicsData(p){return this.collectTopicData.get(p)||[]}async fireEvent(p,_=""){this.activatedEventSet.add(JSON.stringify({topic:p,data:_}));let s;if(this.wildCardTopics.has(p)?s=this.eventListeners.get(p):this.eventListeners.has(p)?s=this.eventListeners.get(p):s=this.eventListeners.get(p+":"+_),s){const g=await Promise.allSettled(s.map(c=>this.tryRun(p,_,c)));for(const c of g)c.status==="rejected"&&this.logger.error(`fire event ${p}:${_} error: ${c.reason}`)}}addWildCardTopic(p){return this.wildCardTopics.add(p),{dispose:()=>{this.wildCardTopics.delete(p)}}}onEvent(p,_){const s=p.indexOf(":");let g,c;return s===-1?(g=p,c=""):(g=p.substr(0,s),c=p.substr(s+1)),this.addListener(g,{topic:g,data:c,execute:_})}addListener(p,_){if(this.collectTopicData.set(_.topic,_.data),this.wildCardTopics.has(p))return this.eventListeners.has(p)||this.eventListeners.set(p,[]),this.eventListeners.get(p).push(_),{dispose:()=>{const s=this.eventListeners.get(p).indexOf(_);s!==-1&&this.eventListeners.get(p).splice(s,1)}};{const s=p+":"+_.data;return this.eventListeners.has(s)||this.eventListeners.set(s,[]),this.eventListeners.get(s).push(_),{dispose:()=>{const g=this.eventListeners.get(s).indexOf(_);g!==-1&&this.eventListeners.get(s).splice(g,1)}}}}async tryRun(p,_,s){this.wildCardTopics.has(p)?(0,r.default)(s.data)(_)&&await s.execute():await s.execute()}};t.ActivationEventServiceImpl=m,n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.ActivationEventServiceImpl=m=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],m)},63056:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionNoExportsView=t.ExtensionLoadingView=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(68974),m=n.__importDefault(e(17267)),E=({style:_})=>r.default.createElement("div",{style:_||{},className:m.default.kt_extension_view},r.default.createElement(l.Progress,{loading:!0}));t.ExtensionLoadingView=E;const p=(_,s)=>r.default.createElement("div",{className:m.default.kt_extension_no_exports_view},(0,o.formatLocalize)("extension.no.view.found",_,s));t.ExtensionNoExportsView=p},56405:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PortalRoot=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),m=e(87420),E=e(25600),p=_=>{var s;const[g,c]=o.default.useState(null),h=(0,l.useInjectable)(E.AbstractViewExtProcessService),u=(0,l.useInjectable)(m.IThemeService);o.default.useEffect(()=>{const v=new l.DisposableCollection;return u.getCurrentTheme().then(f=>c(f.type)),v.push(u.onThemeChange(f=>{f.type&&f.type!==g&&c(f.type)})),v.dispose.bind(v)},[]);const d=_.original;return o.default.createElement(d,{..._.otherProps,className:(0,r.default)((s=_.otherProps)===null||s===void 0?void 0:s.className,(0,m.getThemeTypeSelector)(g)),getContainer:()=>h.getPortalShadowRoot(_.extensionId)})};t.PortalRoot=p},82443:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TREE_VIEW_NODE_HEIGHT=t.TreeViewNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),m=e(41869),E=e(25918),p=e(93899),_=e(95422),s=e(69589),g=e(42912),c=n.__importDefault(e(50790)),h=({item:u,onClick:d,onChange:v,onContextMenu:f,itemType:a,leftPadding:b=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,treeViewId:T,decorationService:w,draggable:D,onDragStart:I,onDragEnter:O,onDragLeave:P,onDragOver:R,onDrop:M})=>{const k=(0,_.useInjectable)(g.IIconService),B=(0,m.useDesignStyles)(c.default.expansion_toggle,"expansion_toggle"),x=(0,m.useDesignStyles)(c.default.tree_view_node,"tree_view_node"),[N,j]=(0,o.useState)(u.uri&&w.getDecoration(u.uri,!1));(0,o.useEffect)(()=>{const be=w.onDidChangeDecorations(Ce=>{u.uri&&Ce.affectsResource(u.uri)&&j(w.getDecoration(u.uri,!1))});return()=>{be.dispose()}},[]);const K=(0,_.useInjectable)(g.IThemeService),U=(0,o.useCallback)(be=>{(a===l.TreeNodeType.TreeNode||a===l.TreeNodeType.CompositeTreeNode)&&d(be,u,a)},[u,a,d]),Y=(0,o.useCallback)(be=>{(a===l.TreeNodeType.TreeNode||a===l.TreeNodeType.CompositeTreeNode)&&(y?y(be,u,a):d(be,u,a))},[u,a,y,d]),z=(0,o.useCallback)(be=>{be.nativeEvent.which===0||!f||(a===l.TreeNodeType.TreeNode||a===l.TreeNodeType.CompositeTreeNode)&&f(be,u,a)},[u,a,f]),G=(0,o.useCallback)(be=>{I&&I(be,u)},[u,I]),Q=(0,o.useCallback)(be=>{O&&O(be,u)},[u,O]),Z=(0,o.useCallback)(be=>{P&&P(be,u)},[u,P]),$=(0,o.useCallback)(be=>{R&&R(be,u)},[u,R]),H=(0,o.useCallback)(be=>{M&&M(be,u)},[u,M]),X=(0,o.useCallback)(be=>{v(u),be.stopPropagation()},[u,v]),J=a===l.TreeNodeType.CompositeTreeNode,re=J?`${A+(u.depth||0)*(b||0)}px`:`${A+(u.depth||0)*(b||0)+8}px`,ce={height:t.TREE_VIEW_NODE_HEIGHT,lineHeight:`${t.TREE_VIEW_NODE_HEIGHT}px`,paddingLeft:re},fe=(be,Ce)=>S&&S?.classlist.indexOf(c.default.mod_loading)>-1?o.default.createElement(l.Loading,null):o.default.createElement("div",{onClick:Ce,className:(0,r.default)(c.default.tree_view_node_segment,B,(0,m.getIcon)("arrow-right"),{[`${c.default.mod_collapsed}`]:!be.expanded})}),Ae=be=>o.default.createElement("div",{className:(0,r.default)(c.default.file_icon,be.icon),style:{maxHeight:t.TREE_VIEW_NODE_HEIGHT}}),te=be=>{var Ce;return be.checkboxInfo===void 0?null:o.default.createElement(l.CheckBox,{"data-node-id":be.treeItemId,readOnly:!0,onChange:Ne=>X(Ne),checked:!!be.checkboxInfo.checked,id:be.treeItemId,role:(Ce=be.checkboxInfo.accessibilityInformation)===null||Ce===void 0?void 0:Ce.role,title:be.checkboxInfo.tooltip})},Le=be=>{const Ce=()=>{if(be.highlights){let Ne=[],tt=0;const Fe=be.highlights.sort(($e,Se)=>$e[0]-Se[0]);return Ne=Fe.map(($e,Se)=>{const[ae,ye]=$e,Re=be.displayName.slice(tt,ae);tt=ye;const Be=be.displayName.slice(ae,ye),ze=[o.default.createElement("span",{key:`line_begin_${Se}_${Re}`},Re),o.default.createElement("span",{className:c.default.highlight,key:`line_hightlight_${Se}_${Be}`},Be)];if(Se===Fe.length-1){const Qe=be.displayName.slice(ye);ze.push(o.default.createElement("span",{key:`line_end_${Se}_${Qe}`},Qe))}return ze}),Ne}else return be.displayName};return o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_segment,c.default.tree_view_node_displayname,be.strikethrough&&c.default.strikethrough)},Ce())},Te=()=>o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_segment,c.default.tree_view_node_tail)},oe()),oe=()=>{if(u.actions.length>0)return o.default.createElement("div",{className:c.default.tree_view_actions},o.default.createElement(E.TitleActionList,{className:c.default.inlineMenu,context:[{treeViewId:T,treeItemId:u.treeItemId}],nav:u.actions,menuId:p.MenuId.ViewItemContext}))},le=be=>{if(J)return fe(be,Y)},Ee=()=>u.tooltip||u.name,we=be=>o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_segment_grow,c.default.tree_view_node_description)},!be.name&&!be.description?"\u2014\u2014":be.description),ve=()=>{if(!N)return null;const be=N.badge||"",Ce=N.color,Ne=Ce&&K.getColor({id:Ce});return o.default.createElement("div",{className:c.default.tree_view_node_tail,style:{color:Ne}},(0,s.transformLabelWithCodicon)(be.slice(),{},k.fromString.bind(k)))};return o.default.createElement("div",{key:u.id,onClick:U,onContextMenu:z,onDragStart:G,onDragOver:$,onDragEnter:Q,onDragLeave:Z,onDrop:H,title:Ee(),className:(0,r.default)(x,S?S.classlist:null),"data-id":u.id,style:ce,draggable:D},o.default.createElement("div",{className:(0,r.default)(c.default.tree_view_node_content)},le(u),te(u),Ae(u),o.default.createElement("div",{className:c.default.tree_view_node_overflow_wrap},Le(u),we(u)),Te(),ve()))};t.TreeViewNode=h,t.TREE_VIEW_NODE_HEIGHT=22},81302:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTabBarTreeView=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),m=e(68974),E=e(41893),p=e(24429),_=e(72260),s=e(82443),g=n.__importDefault(e(17267)),c=({viewState:d,model:v,dataProvider:f,treeViewId:a})=>{const b=(0,l.useInjectable)(_.IMainLayoutService),y=(0,l.useInjectable)(E.IDecorationsService),S=(0,r.useMemo)(()=>b.getViewAccordionService(a),[]),A=(0,r.useMemo)(()=>{const G=S?.getViewState(a);return G?!G.collapsed&&!G.hidden:!1},[S]),{height:T}=d,{canSelectMany:w}=v.treeViewOptions||{},D=(0,r.useRef)(null),I=(0,r.useCallback)(G=>{v.handleTreeHandler({...G,getModel:()=>v.treeModel,hasDirectFocus:()=>D.current===document.activeElement})},[v]),O=(0,r.useCallback)((G,Q)=>{G.stopPropagation();const{toggleDirectory:Z}=v;Z(Q)},[v]),P=(0,r.useCallback)(G=>R(G)?!1:G.shiftKey,[]),R=(0,r.useCallback)(G=>{const{metaKey:Q,ctrlKey:Z}=G;return l.isOSX&&Q||Z},[]),M=(0,r.useCallback)((G,Q,Z)=>{G.stopPropagation();const{handleItemClick:$,handleItemToggleClick:H,handleItemRangeClick:X}=v;if(!Q)return;const J=P(event),re=R(event);w?J?X(Q,Z):re?H(Q,Z):$(Q,Z):$(Q,Z)},[w,v]),k=(0,r.useCallback)(G=>{const{handleCheckBoxChange:Q}=v;G&&Q(G)},[v]),B=(0,r.useCallback)((G,Q)=>{const{handleContextMenu:Z}=v;Z(G,Q)},[v]),x=G=>{const{handleContextMenu:Q}=v;Q(G)},N=(0,r.useCallback)(()=>{const{enactiveNodeDecoration:G}=v;G()},[v]),j=(0,r.useCallback)((G,Q)=>{const{handleDragStart:Z}=v;Z(G,Q)},[v]),K=(0,r.useCallback)((G,Q)=>{const{handleDragOver:Z}=v;Z(G,Q)},[v]),U=(0,r.useCallback)((G,Q)=>{const{handleDragEnter:Z}=v;Z(G,Q)},[v]),Y=(0,r.useCallback)((G,Q)=>{const{handleDrop:Z}=v;Z(G,Q)},[v]),z=(0,r.useCallback)((G,Q)=>{const{handleDragLeave:Z}=v;Z(G,Q)},[v]);return(0,r.useEffect)(()=>{var G;const Q=()=>{v.handleTreeBlur()};return(G=D.current)===null||G===void 0||G.addEventListener("blur",Q,!0),()=>{var Z;(Z=D.current)===null||Z===void 0||Z.removeEventListener("blur",Q,!0)}},[D.current]),r.default.createElement("div",{className:g.default.kt_extension_view,tabIndex:-1,ref:D,onContextMenu:x,onClick:N,"data-tree-view-id":a},r.default.createElement(u,{height:T,isVisible:A,handleTreeReady:I,handleItemClicked:M,handleCheckBoxChange:k,handleTwistierClick:O,handleContextMenu:B,handleDragStart:j,handleDragOver:K,handleDragEnter:U,handleDragLeave:z,handleDrop:Y,draggable:v.draggable,treeViewId:a,model:v,dataProvider:f,decorationService:y}))};t.ExtensionTabBarTreeView=c;function h(d,v){return d.isVisible===v.isVisible&&d.model===v.model&&d.treeViewId===v.treeViewId&&d.height===v.height}const u=(0,r.memo)(({model:d,treeViewId:v,height:f,isVisible:a,dataProvider:b,handleTreeReady:y,handleItemClicked:S,handleCheckBoxChange:A,handleTwistierClick:T,handleContextMenu:w,handleDragStart:D,handleDragOver:I,handleDragEnter:O,handleDragLeave:P,handleDrop:R,draggable:M,decorationService:k})=>{const[B,x]=(0,r.useState)(!1),[N,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let U=!1;return(async()=>(await d.whenReady,d.treeModel&&a&&await d.treeModel.ensureReady,U||x(!0)))(),()=>{U=!0,d&&d.removeNodeDecoration()}},[d,a]),(0,r.useEffect)(()=>{const U=b.onDidChangeEmpty(()=>{b.isTreeEmpty!==N&&j(b.isTreeEmpty)});return()=>U.dispose()},[]);const K=(0,r.useCallback)(U=>r.default.createElement(s.TreeViewNode,{item:U.item,itemType:U.itemType,decorations:d.decorations.getDecorations(U.item),onClick:S,onChange:A,onTwistierClick:T,onContextMenu:w,onDragStart:D,onDragOver:I,onDragEnter:O,onDragLeave:P,onDrop:R,defaultLeftPadding:8,leftPadding:8,treeViewId:v,draggable:M,decorationService:k}),[d.treeModel]);if(B){if(N)return r.default.createElement(p.WelcomeView,{viewId:v});if(d.treeModel)return r.default.createElement(o.RecycleTree,{height:f,itemHeight:s.TREE_VIEW_NODE_HEIGHT,onReady:y,model:d.treeModel},K)}else return r.default.createElement(m.Progress,{loading:!0});return null},h);u.displayName="ExtensionsTreeView"},88341:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionWebviewView=t.WebviewViewShouldShowEvent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(99220);class m extends o.BasicEvent{}t.WebviewViewShouldShowEvent=m;const E=({viewId:p})=>{const _=r.default.useRef(null),s=(0,o.useInjectable)(o.IEventBus),g=(0,o.useInjectable)(l.ExtensionService);return r.default.useEffect(()=>{const c=new o.CancellationTokenSource,h=new o.Disposable({dispose:()=>c.cancel()});return g.eagerExtensionsActivated.promise.then(()=>{c.token.isCancellationRequested||_.current&&s.fire(new m({viewType:p,container:_.current,title:"",cancellationToken:c.token,disposer:h}))}),()=>{h.dispose()}},[]),r.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"},className:"webview-view-component",ref:_})};t.ExtensionWebviewView=E},17428:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(81302),t),n.__exportStar(e(63056),t)},21167:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkthroughsEditorView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),m=e(41869),E=e(93374),p=e(52416),_=e(99220),s=e(17441),g=n.__importDefault(e(42076)),c=({resource:{uri:v}})=>{const f=(0,m.useInjectable)(s.WalkthroughsService),a=(0,m.useInjectable)(m.IContextKeyService),{query:b,authority:y}=v,[S,A]=(0,o.useState)(),[T,w]=(0,o.useState)();(0,o.useEffect)(()=>{S&&S.steps.length>0&&(T||w(S.steps[0].id))},[S,T]),(0,o.useEffect)(()=>{b&&A(f.getWalkthrough(b))},[b,S]);const D=(0,o.useCallback)(()=>{var I;return S&&((I=S.steps.find(O=>O.id===T))===null||I===void 0?void 0:I.media)},[T,S]);return o.default.createElement("div",{className:g.default.getting_started_container},o.default.createElement("div",{className:g.default.getting_started_detailsContent},o.default.createElement("div",{className:g.default.category_container},o.default.createElement("div",{className:g.default.category_icon},S&&S.icon.type==="image"&&o.default.createElement("img",{src:S.icon.path})),o.default.createElement("div",{className:g.default.category_description_container},o.default.createElement("h2",{className:g.default.category_title},S?.title),o.default.createElement("div",{className:g.default.category_description},S?.description))),o.default.createElement("div",{className:g.default.steps_container},o.default.createElement("div",{className:g.default.getting_started_detail_container},o.default.createElement("div",{className:g.default.step_list_container},S?S.steps.filter(I=>a.match(I.when)).map(I=>o.default.createElement(h,{key:I.id,step:I,isExpanded:I.id===T,onSelected:w})):null))),o.default.createElement("div",{className:g.default.getting_started_media},T&&o.default.createElement(u,{media:D(),extensionId:y,stepId:T}))))};t.WalkthroughsEditorView=c;const h=({step:v,isExpanded:f,onSelected:a})=>{const b=(0,m.useInjectable)(m.IOpenerService),y=(0,m.useInjectable)(s.WalkthroughsService),S=(0,m.useInjectable)(p.IIconService),[A,T]=(0,o.useState)(!1),{description:w}=v;(0,o.useEffect)(()=>{const R=y.onDidProgressStep(M=>{const{id:k,done:B}=M;k===v.id&&B&&T(B)});return()=>R.dispose()},[]);const D=(0,o.useCallback)(()=>{T(!A),y.progressByEvent(_.CompletionEventsType.stepSelected+":"+v.id)},[A,v.id]),I=(0,o.useCallback)(R=>{const{href:M}=R;b.open(M),/^http(s)?:\/\//.test(M)&&y.progressByEvent(_.CompletionEventsType.onLink+":"+M)},[]),O=(0,o.useCallback)(()=>{if(w.length===0)return null;const R=[];return w.map((M,k)=>{if(M.nodes.length===1&&typeof M.nodes[0]!="string"){const B=M.nodes[0];R.push(o.default.createElement("div",{key:k.toString()+R.length,title:B.title},o.default.createElement(l.Button,{onClick:()=>I(B)},(0,m.transformLabelWithCodicon)(B.label,{},S.fromString.bind(S)))))}else{const B=M.nodes.map((x,N)=>typeof x=="string"?x:o.default.createElement("a",{key:x.label+"#"+N,title:x.title,onClick:()=>I(x)},x.label));R.push(o.default.createElement("p",{key:k.toString()+R.length.toString()+B.length.toString()},B))}}),o.default.createElement("div",{className:g.default.step_description_container},o.default.createElement(o.default.Fragment,null,R))},[w]),P=(0,o.useCallback)(()=>(0,m.transformLabelWithCodicon)(v.title,{},S.fromString.bind(S)),[v.title]);return o.default.createElement("div",{className:(0,r.default)(g.default.getting_started_step,f&&g.default.expanded),onClick:()=>a(v.id)},o.default.createElement("div",{className:g.default.checkbox},o.default.createElement(l.CheckBox,{id:v.id,onChange:D,checked:A})),o.default.createElement("div",{className:g.default.step_container},o.default.createElement("h3",{className:g.default.step_title},P()),f&&O()))},u=({media:v,extensionId:f,stepId:a})=>{const b=(0,m.useInjectable)(p.IThemeService),y=(0,m.useInjectable)(s.WalkthroughsService),[S,A]=(0,o.useState)(""),[T,w]=(0,o.useState)(""),D=(0,o.useCallback)(async I=>v?.type==="image"?"":I?(await y.getFileContent(f,I)).toString():"",[v]);if((0,o.useEffect)(()=>{const I=y.getStepsByExtension(a);I&&(v&&v.type==="svg"&&I.media.svg&&D(I.media.svg).then(A),v&&v.type==="markdown"&&I.media.markdown&&D(I.media.markdown).then(w))},[v,a]),!v)return null;if(v.type==="image"){const I=b.getCurrentThemeSync().type,O=v.path[I].toString(!0).replace(/ /g,"%20");return o.default.createElement(o.default.Fragment,null,o.default.createElement("img",{alt:v.altText,srcSet:O.toLowerCase().endsWith(".svg")?O:O+" 1.5x"}))}return v.type==="svg"?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:g.default.media_svg_container,dangerouslySetInnerHTML:{__html:S}})):v.type==="markdown"?o.default.createElement(o.default.Fragment,null,o.default.createElement(d,{content:T,media:v})):null},d=({content:v,media:f})=>{const a=(0,m.useInjectable)(m.IOpenerService);if(f.type!=="markdown")return null;const b=(0,o.useCallback)(()=>f.base.resolve("/").toString(),[f,v]);return o.default.createElement(E.Markdown,{content:v,options:{baseUrl:b()},onLinkClick:y=>a.open(y)})}},87444:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtCommandManagementImpl=void 0;const n=e(85608),r=e(76003),o=e(43718);let l=class extends o.Disposable{constructor(){super(...arguments),this.commandEnvRegistry=new Map,this.proxyCommandExecutorRegistry=new Map}dispose(){this.commandEnvRegistry.clear(),this.proxyCommandExecutorRegistry.clear()}registerProxyCommandExecutor(E,p){this.proxyCommandExecutorRegistry.set(E,p)}async executeExtensionCommand(E,p,_){const s=this.proxyCommandExecutorRegistry.get(E);if(!s)throw new Error('Proxy command executor "'+E+'" is not existed');return s.$executeExtensionCommand(p,..._)}registerExtensionCommandEnv(E,p="node"){return this.commandEnvRegistry.set(E,p),{dispose:()=>{this.commandEnvRegistry.delete(E)}}}getExtensionCommandEnv(E){return this.commandEnvRegistry.get(E)}};t.ExtCommandManagementImpl=l,t.ExtCommandManagementImpl=l=n.__decorate([(0,r.Injectable)()],l)},49413:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtInstanceManagementService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(99220),E=e(42734);let p=class extends o.Disposable{constructor(){super(),this.onDidChangeEmitter=new l.Emitter,this.extensionMap=new Map,this._whenReady=this.init()}async init(){this.workspaceStorage=await this.storageProvider(o.STORAGE_NAMESPACE.EXTENSIONS),this.globalStorage=await this.storageProvider(o.STORAGE_NAMESPACE.GLOBAL_EXTENSIONS)}get whenReady(){return this._whenReady}get onDidChange(){return this.onDidChangeEmitter.event}dispose(){this.disposeExtensionInstances()}getExtensionInstances(){return Array.from(this.extensionMap.values())}disposeExtensionInstances(){for(const s of this.extensionMap.values())s.dispose();this.extensionMap=new Map}disposeExtensionInstancesByPath(s){s.forEach(g=>{this.extensionMap.has(g)&&this.extensionMap.get(g).dispose()})}resetExtensionInstances(){for(const s of this.extensionMap.values())s.reset()}getExtensionInstanceByPath(s){return this.extensionMap.get(s)}getExtensionInstanceByExtId(s){for(const g of this.extensionMap.values())if(g.id===s)return g}deleteExtensionInstanceByPath(s){this.extensionMap.delete(s),this.onDidChangeEmitter.fire()}addExtensionInstance(s){this.extensionMap.set(s.path,s),this.onDidChangeEmitter.fire()}async checkExtensionEnable(s){await this.whenReady;const g=this.globalStorage.get(s.extensionId,m.EXTENSION_ENABLE.ENABLE);return this.workspaceStorage.get(s.extensionId,g)===m.EXTENSION_ENABLE.ENABLE}async createExtensionInstance(s,g,c){const h=typeof s=="string"?await this.extensionNodeClient.getExtension(s,(0,l.getLanguageId)(),{}):s;if(h)return this.injector.get(E.Extension,[h,await this.checkExtensionEnable(h),g||(this.appConfig.extensionDir?h.realPath.startsWith(this.appConfig.extensionDir):!1),!!c])}checkIsBuiltin(s){const g=this.getExtensionCandidateByPath(s.realPath);return(this.appConfig.extensionDir?s.realPath.startsWith(this.appConfig.extensionDir):!1)||(g?g.isBuiltin:!1)}checkIsDevelopment(s){const g=this.getExtensionCandidateByPath(s.realPath);return!!g?.isDevelopment}getExtensionCandidateByPath(s){return this.appConfig.extensionCandidate&&this.appConfig.extensionCandidate.find(g=>g.path===s)}};t.ExtInstanceManagementService=p,n.__decorate([(0,r.Autowired)(o.StorageProvider),n.__metadata("design:type",Function)],p.prototype,"storageProvider",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],p.prototype,"extensionNodeClient",void 0),t.ExtInstanceManagementService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},98453:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionManagementService=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(14951),m=e(99220),E=e(82389),p=e(71354),_=e(35321);let s=class extends o.WithEventBus{async getExtensionProps(c,h){const u=await this.extensionNodeClient.getExtension(c,(0,o.getLanguageId)(),h);if(u){const d=this.getExtensionByPath(c);if(d)return{...d.toJSON(),extraMetadata:u.extraMetadata}}}getExtensionByPath(c){return this.extInstanceManagementService.getExtensionInstances().find(h=>c===h.path)}getExtensionByExtId(c){return this.extInstanceManagementService.getExtensionInstances().find(h=>c===h.id)}async postChangedExtension(c,h,u){const{upgrade:d,extensionPath:v,oldExtensionPath:f,isBuiltin:a}=typeof c=="boolean"?{upgrade:c,extensionPath:h,oldExtensionPath:u,isBuiltin:!1}:c,b=this.extInstanceManagementService.getExtensionInstanceByPath(v);if(b){this.logger.warn(`Extension ${b.id} already exists, skip activate`);return}const y=await this.extInstanceManagementService.createExtensionInstance(v,!!a);if(y)return d&&this.disableExtension(f),await this.enableExtension(y)}async postEnableExtension(c){const h=await this.extInstanceManagementService.getExtensionInstanceByPath(c);if(h)return await this.enableExtension(h)}async postDisableExtension(c){return this.disableExtension(c)}async postUninstallExtension(c){return this.uninstallExtension(c)}getAllExtensionJson(){return this.extInstanceManagementService.getExtensionInstances().map(c=>c.toJSON())}disableExtension(c){const h=this.extInstanceManagementService.getExtensionInstanceByPath(c);h&&(h.disable(),this.extInstanceManagementService.deleteExtensionInstanceByPath(c))}async enableExtension(c){this.extInstanceManagementService.addExtensionInstance(c),c.enable(),await c.initialize(),this.eventBus.fire(new p.ExtensionDidEnabledEvent(c.toJSON())),this.sumiContributesService.register(c.id,c.packageJSON.sumiContributes||{}),this.contributesService.register(c.id,c.contributes),this.sumiContributesService.initialize(),this.contributesService.initialize()}async removeExtension(c){try{return await this.fileService.delete(o.URI.file(c).toString()),!0}catch(h){return this.logger.error(h),!1}}async uninstallExtension(c){const h=this.extInstanceManagementService.getExtensionInstanceByPath(c);h&&(h.dispose(),this.extInstanceManagementService.deleteExtensionInstanceByPath(c)),await this.removeExtension(c),this.eventBus.fire(new p.ExtensionDidUninstalledEvent)}};t.ExtensionManagementService=s,n.__decorate([(0,r.Autowired)(p.AbstractExtInstanceManagementService),n.__metadata("design:type",p.AbstractExtInstanceManagementService)],s.prototype,"extInstanceManagementService",void 0),n.__decorate([(0,r.Autowired)(m.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],s.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(_.VSCodeContributesServiceToken),n.__metadata("design:type",_.VSCodeContributesService)],s.prototype,"contributesService",void 0),n.__decorate([(0,r.Autowired)(E.SumiContributionsServiceToken),n.__metadata("design:type",E.SumiContributionsService)],s.prototype,"sumiContributesService",void 0),n.__decorate([(0,r.Autowired)(l.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),t.ExtensionManagementService=s=n.__decorate([(0,r.Injectable)()],s)},20670:(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeExtProcessService=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(18740),m=e(41869),E=e(99220),p=e(72464),_=e(46147),s=e(37846),g=e(28949),c=e(51072),h=e(17802);let u=class{constructor(){this._apiFactoryDisposables=new m.DisposableStore,this.ready=new m.Deferred,this._extHostUpdated=new m.Deferred,this.extensions=[]}disposeApiFactory(){this._apiFactoryDisposables.clear()}async disposeProcess(){this.disposeApiFactory(),await this.extensionNodeClient.disposeClientExtProcess(this.clientId,!1)}async activate(){return await this.createExtProcess(),this.protocol&&(this.ready.resolve(),await this.createBrowserMainThreadAPI(),await(await this.getProxy()).$updateExtHostData(),this._extHostUpdated.resolve()),this.protocol}async activeExtension(v,f){!this.appConfig.noExtHost&&!f&&(await this._extHostUpdated.promise,await(await this.getProxy()).$activateExtension(v.id))}async updateExtensionData(v){if(this.extensions=v,this.protocol){const f=await this.getProxy();await f.$updateExtHostData(),f.$fireChangeEvent()}}getExtension(v){return this.extensions.find(f=>f.id===v)}async $activateExtension(v){const f=this.extensions.find(a=>a.path===v);f&&await f.activate()}async $getExtensions(){return this.extensions.map(v=>v.toJSON())}async getProxy(){return await this.ready.promise,this.protocol.getProxy(_.ExtHostAPIIdentifier.ExtHostExtensionService)}async createBrowserMainThreadAPI(){const v=(0,h.initSharedAPIProxy)(this.protocol,this.injector);this._apiFactoryDisposables.add(v),this._apiFactoryDisposables.add((0,m.toDisposable)((0,c.initNodeThreadAPIProxy)(this.protocol,this.injector,this))),this._apiFactoryDisposables.add((0,m.toDisposable)((0,g.createSumiAPIFactory)(this.protocol,this.injector))),this._apiFactoryDisposables.add(this.createExternalSumiAPIFactory()),await v.setup()}getSpawnOptions(){return{}}createExternalSumiAPIFactory(){const v=new m.Disposable,f=this.mainThreadExtenderContributionProvider.getContributions();for(const b of f)b.registerMainThreadExtender(this.mainThreadExtenderService);const a=this.mainThreadExtenderService.getMainThreadExtenders();for(const b of a){const y=this.injector.get(b.serviceClass,[this.protocol]);this.protocol.set(b.identifier,y),v.addDispose(y)}return v}async getActivatedExtensions(){return await(await this.getProxy()).$getActivatedExtensions()}get clientId(){return this.applicationService.clientId}async createExtProcess(){await this.extensionNodeClient.createProcess(this.clientId,{enableDebugExtensionHost:this.appConfig.enableDebugExtensionHost,inspectExtensionHost:this.appConfig.inspectExtensionHost,extensionConnectOption:this.appConfig.extensionConnectOption,extHostSpawnOptions:this.getSpawnOptions()}),await this.initExtProtocol()}async initExtProtocol(){var v,f;this.channel&&this.channel.dispose(),this.protocol&&((f=(v=this.protocol).dispose)===null||f===void 0||f.call(v)),this.channel=await this.channelHandler.openChannel(E.CONNECTION_HANDLE_BETWEEN_EXTENSION_AND_MAIN_THREAD),this.connection=this.channel.createConnection(),this.protocol=new o.SumiConnectionMultiplexer(this.connection,{timeout:this.appConfig.rpcMessageTimeout,name:"node-ext-host",io:(0,o.createExtMessageIO)(s.knownProtocols)})}};t.NodeExtProcessService=u,n.__decorate([(0,r.Autowired)(m.AppConfig),n.__metadata("design:type",Object)],u.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],u.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(E.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],u.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(m.IApplicationService),n.__metadata("design:type",Object)],u.prototype,"applicationService",void 0),n.__decorate([(0,r.Autowired)(l.WSChannelHandler),n.__metadata("design:type",l.WSChannelHandler)],u.prototype,"channelHandler",void 0),n.__decorate([(0,r.Autowired)(p.IMainThreadExtenderService),n.__metadata("design:type",Object)],u.prototype,"mainThreadExtenderService",void 0),n.__decorate([(0,r.Autowired)(p.MainThreadExtenderContribution),n.__metadata("design:type",Object)],u.prototype,"mainThreadExtenderContributionProvider",void 0),t.NodeExtProcessService=u=n.__decorate([(0,r.Injectable)()],u)},90731:(L,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewExtProcessService=void 0;const r=e(85608),o=e(76003),l=e(65973),m=e(8919),E=e(41869),p=e(40827),_=e(43718),s=e(61656),g=e(99220),c=e(25600),h=e(17428),u=e(54107),d=e(9438),v=e(8403),f=e(31738),{Path:a,posix:b}=E.path,y="load";let S=n=class extends _.Disposable{constructor(){super(...arguments),this.debugLogger=(0,_.getDebugLogger)(),this.extensions=[],this.activatedViewExtensionMap=new Map,this.portalShadowRootMap=new Map,this.shadowRootBodyMap=new Map}getExtension(T){return this.extensions.find(w=>w.id===T)}async initExtension(T){this.extensions=T}async getActivatedExtensions(){return[]}getProxy(){}async $activateExtension(T){}async $getExtensions(){return this.extensions.map(T=>T.toJSON())}async disposeProcess(){}activate(){const T=this.requireInterceptorContributionProvider.getContributions();for(const w of T)w.registerRequireInterceptor(this.requireInterceptorService);this.extendExtensionErrorStackTrace()}extendExtensionErrorStackTrace(){Error.stackTraceLimit=100,Error.prepareStackTrace=(T,w)=>{let D,I=`Error: ${T.message}`;for(const O of w)if(I+=`
|
|
28375
28375
|
at ${O.toString()}`,!D&&O.isEval()){const P=O.getEvalOrigin(),R=this.getExtension.apply(this,[P]);if(R){D=R;const M=O.getColumnNumber(),k=O.getLineNumber();I=`
|
|
28376
28376
|
at ${D.name} (${D.workerScriptPath}:${k}:${M})`+I}}if(D){const O=`${D&&D.name} - ${T.name||"Error"}: ${T.message||""}${I}`;return this.debugLogger.log("get error",O),this.reportRuntimeError(T,D,O),O}return T.stack}}reportRuntimeError(T,w,D){var I;T&&T.message&&this.reporterService.point(_.REPORT_NAME.RUNTIME_ERROR_EXTENSION,w.id,{stackTraceMessage:D,error:T.message,version:(I=w.packageJSON)===null||I===void 0?void 0:I.version})}getRegisterViewKind(T){return n.tabBarLocation.includes(T)?"replace":"add"}async activeExtension(T,w){var D;const{extendConfig:I,packageJSON:O,contributes:P}=T;if(!((D=I?.browser)===null||D===void 0)&&D.main){(0,l.warning)(!1,"[Deprecated warning]: kaitian.js is deprecated, please use `package.json#sumiContributes` instead"),await this.activateExtensionByDeprecatedExtendConfig(T);return}O.sumiContributes&&P?.browserMain&&await this.activeExtensionContributes(T)}async activeExtensionContributes(T){var w;const{contributes:D}=T,I=new E.URI(T.extensionLocation.with({path:b.join(T.extensionLocation.path,D.browserMain)})),{moduleExports:O,proxiedHead:P}=await this.getExtensionModuleExports(I.toString(),T);if(D.browserViews){const{browserViews:M}=D;this.appConfig.useExperimentalShadowDom&&this.registerPortalShadowRoot(T.id);const k=Object.keys(M).reduce((B,x)=>(B[x]={type:this.getRegisterViewKind(x),view:M[x].view.map(({id:N,titleComponentId:j,title:K,...U})=>({...U,title:(0,_.replaceLocalizePlaceholder)(K,T.id),id:N,component:this.getModuleExportsComponent(O,T,N,P),titleComponent:j&&this.getModuleExportsComponent(O,T,j,P)}))},B),{});this.registerBrowserComponent(k,T)}if(D.toolbar&&(!((w=D.toolbar)===null||w===void 0)&&w.actions)){for(const M of D.toolbar.actions)if(M.type==="button"&&M.popoverComponent){const k=O[M.popoverComponent];if(!k){this.logger.error(`Can not find CustomPopover from extension ${T.id}, id: ${M.popoverComponent}`);continue}if(this.appConfig.useExperimentalShadowDom){const B=x=>(0,v.getShadowRoot)(k,T,x,M.popoverComponent,P,this.appConfig.componentCDNType,this.appConfig.extensionBrowserStyleSheet);this.toolbarPopoverRegistry.registerComponent(`${T.id}:${M.popoverComponent}`,B)}else this.toolbarPopoverRegistry.registerComponent(`${T.id}:${M.popoverComponent}`,k)}}const R=M=>{if(D.scm&&D.scm.additional){const{input:k}=D.scm.additional;if(!k)return;const{addonBefore:B,addonAfter:x}=k,N=(j,K)=>{j.forEach(U=>{const Y=O[U];if(Y||this.logger.error(`Can not find ${K} from extension ${T.id}, id: ${Y}`),this.appConfig.useExperimentalShadowDom){const z=G=>(0,v.getShadowRoot)(Y,T,G,j,P,this.appConfig.componentCDNType,this.appConfig.extensionBrowserStyleSheet);M.input.appendProps({[K]:z})}else M.input.appendProps({[K]:Y})})};B&&N(B,"addonBefore"),x&&N(x,"addonAfter")}};this.addDispose(this.scmService.onDidAddRepository(M=>{R(M)})),this.scmService.repositories.forEach(M=>{R(M)})}async activateExtensionByDeprecatedExtendConfig(T){const{extendConfig:w}=T;this.logger.verbose(`register view by Deprecated config ${T.id}`);const D=await this.staticResourceService.resolveStaticResource(E.URI.file(new a(T.path).join(w.browser.main).toString()));try{const I=T;if(this.appConfig.useExperimentalShadowDom){this.registerPortalShadowRoot(T.id);const{moduleExports:O,proxiedHead:P}=await this.loadBrowserModuleUseInterceptor(D.toString(),T,!0);this.registerBrowserComponent(this.normalizeDeprecatedViewsConfig(O,T,P),I)}else{const{moduleExports:O}=await this.loadBrowserModule(D.toString(),T,!0);this.registerBrowserComponent(this.normalizeDeprecatedViewsConfig(O,T),I)}}catch(I){I.errorCode===y?this.logger.error(`[Extension-Host] failed to load ${T.name} - browser module, path:
|
|
28377
28377
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/cli-engine",
|
|
3
|
-
"version": "3.7.1-next-
|
|
3
|
+
"version": "3.7.1-next-1737534874.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.7.1-next-
|
|
30
|
-
"@opensumi/ide-core-common": "3.7.1-next-
|
|
31
|
-
"@opensumi/ide-core-node": "3.7.1-next-
|
|
32
|
-
"@opensumi/ide-express-file-server": "3.7.1-next-
|
|
33
|
-
"@opensumi/ide-extension": "3.7.1-next-
|
|
34
|
-
"@opensumi/ide-i18n": "3.7.1-next-
|
|
35
|
-
"@opensumi/ide-main-layout": "3.7.1-next-
|
|
36
|
-
"@opensumi/ide-startup": "3.7.1-next-
|
|
29
|
+
"@opensumi/ide-core-browser": "3.7.1-next-1737534874.0",
|
|
30
|
+
"@opensumi/ide-core-common": "3.7.1-next-1737534874.0",
|
|
31
|
+
"@opensumi/ide-core-node": "3.7.1-next-1737534874.0",
|
|
32
|
+
"@opensumi/ide-express-file-server": "3.7.1-next-1737534874.0",
|
|
33
|
+
"@opensumi/ide-extension": "3.7.1-next-1737534874.0",
|
|
34
|
+
"@opensumi/ide-i18n": "3.7.1-next-1737534874.0",
|
|
35
|
+
"@opensumi/ide-main-layout": "3.7.1-next-1737534874.0",
|
|
36
|
+
"@opensumi/ide-startup": "3.7.1-next-1737534874.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": "
|
|
75
|
+
"gitHead": "c003e4f34881a58178bf3d6cc75b8ada1f912458"
|
|
76
76
|
}
|