UNPKG

monaco-editor

Version:
2 lines • 1.26 MB
define("vs/toggleHighContrast-qGX7E9o7",["exports","./editorWorkerHost-fVE1cjcC","./editor-KLE6jdfb"],(function(hC,a,o){"use strict";var pn,pi,fn,mn,_n,zt,fi,Xs,mi,mt,_i,Qs,vn,bn,vi,bi,Ci,Cn,Sn,yn,wn,In,Vt,xn,En,Ln,Dn,Rn,Tn,Nn,yi,wi,Mn,Pn,Ws,Hs,On,An,et,Vn,Bn,Li,Kn,Un,tt,Di,kn,jn,to,$n,bt,Ri,io,qn,no,so,Ti,Ni,Gn,Zn,Xn,Yn,oo,Mi,ro,Qn,ao,lo,Pi,Jn,co,Wn,Hn,es,it,Ct,nt;class uC extends o.Action2{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:a.localize2(101,"Toggle Collapse Unchanged Regions"),icon:a.Codicon.map,toggled:o.ContextKeyExpr.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:o.ContextKeyExpr.has("isInDiffEditor"),menu:{when:o.ContextKeyExpr.has("isInDiffEditor"),id:o.MenuId.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(o.IConfigurationService),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class vf extends o.Action2{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:a.localize2(102,"Toggle Show Moved Code Blocks"),precondition:o.ContextKeyExpr.has("isInDiffEditor")})}run(e,...t){const i=e.get(o.IConfigurationService),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class bf extends o.Action2{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:a.localize2(103,"Toggle Use Inline View When Space Is Limited"),precondition:o.ContextKeyExpr.has("isInDiffEditor")})}run(e,...t){const i=e.get(o.IConfigurationService),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const ho=a.localize2(104,"Diff Editor");class gC extends o.EditorAction2{constructor(){super({id:"diffEditor.switchSide",title:a.localize2(105,"Switch Side"),icon:a.Codicon.arrowSwap,precondition:o.ContextKeyExpr.has("isInDiffEditor"),f1:!0,category:ho})}runEditorCommand(e,t,i){const n=Ai(e);if(n instanceof o.DiffEditorWidget){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class pC extends o.EditorAction2{constructor(){super({id:"diffEditor.exitCompareMove",title:a.localize2(106,"Exit Compare Move"),icon:a.Codicon.close,precondition:o.EditorContextKeys.comparingMovedCode,f1:!1,category:ho,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Ai(e);n instanceof o.DiffEditorWidget&&n.exitCompareMove()}}class fC extends o.EditorAction2{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:a.localize2(107,"Collapse All Unchanged Regions"),icon:a.Codicon.fold,precondition:o.ContextKeyExpr.has("isInDiffEditor"),f1:!0,category:ho})}runEditorCommand(e,t,...i){const n=Ai(e);n instanceof o.DiffEditorWidget&&n.collapseAllUnchangedRegions()}}class mC extends o.EditorAction2{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:a.localize2(108,"Show All Unchanged Regions"),icon:a.Codicon.unfold,precondition:o.ContextKeyExpr.has("isInDiffEditor"),f1:!0,category:ho})}runEditorCommand(e,t,...i){const n=Ai(e);n instanceof o.DiffEditorWidget&&n.showAllUnchangedRegions()}}class hd extends o.Action2{constructor(){super({id:"diffEditor.revert",title:a.localize2(109,"Revert"),f1:!0,category:ho,precondition:o.ContextKeyExpr.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=Ai(e);t instanceof o.DiffEditorWidget&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=_C(e,t.originalUri,t.modifiedUri);i instanceof o.DiffEditorWidget&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const Cf=a.localize2(110,"Accessible Diff Viewer"),_c=class _c extends o.Action2{constructor(){super({id:_c.id,title:a.localize2(111,"Go to Next Difference"),category:Cf,precondition:o.ContextKeyExpr.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){Ai(e)?.accessibleDiffViewerNext()}};_c.id="editor.action.accessibleDiffViewer.next";let uo=_c;const vc=class vc extends o.Action2{constructor(){super({id:vc.id,title:a.localize2(112,"Go to Previous Difference"),category:Cf,precondition:o.ContextKeyExpr.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Ai(e)?.accessibleDiffViewerPrev()}};vc.id="editor.action.accessibleDiffViewer.prev";let qr=vc;function _C(c,e,t){return c.get(o.ICodeEditorService).listDiffEditors().find(s=>{const r=s.getModifiedEditor(),l=s.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&l&&l.getModel()?.uri.toString()===e.toString()})||null}function Ai(c){const t=c.get(o.ICodeEditorService).listDiffEditors(),i=o.getActiveElement();if(i){for(const n of t)if(n.getContainerDomNode().contains(i))return n}return null}o.registerAction2(uC),o.registerAction2(vf),o.registerAction2(bf),o.MenuRegistry.appendMenuItem(o.MenuId.EditorTitle,{command:{id:new bf().desc.id,title:a.localize(135,"Use Inline View When Space Is Limited"),toggled:o.ContextKeyExpr.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:o.ContextKeyExpr.has("isInDiffEditor")},order:11,group:"1_diff",when:o.ContextKeyExpr.and(o.EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached,o.ContextKeyExpr.has("isInDiffEditor"))}),o.MenuRegistry.appendMenuItem(o.MenuId.EditorTitle,{command:{id:new vf().desc.id,title:a.localize(136,"Show Moved Code Blocks"),icon:a.Codicon.move,toggled:o.ContextKeyEqualsExpr.create("config.diffEditor.experimental.showMoves",!0),precondition:o.ContextKeyExpr.has("isInDiffEditor")},order:10,group:"1_diff",when:o.ContextKeyExpr.has("isInDiffEditor")}),o.registerAction2(hd);for(const c of[{icon:a.Codicon.arrowRight,key:o.EditorContextKeys.diffEditorInlineMode.toNegated()},{icon:a.Codicon.discard,key:o.EditorContextKeys.diffEditorInlineMode}])o.MenuRegistry.appendMenuItem(o.MenuId.DiffEditorHunkToolbar,{command:{id:new hd().desc.id,title:a.localize(137,"Revert Block"),icon:c.icon},when:o.ContextKeyExpr.and(o.EditorContextKeys.diffEditorModifiedWritable,c.key),order:5,group:"primary"}),o.MenuRegistry.appendMenuItem(o.MenuId.DiffEditorSelectionToolbar,{command:{id:new hd().desc.id,title:a.localize(138,"Revert Selection"),icon:c.icon},when:o.ContextKeyExpr.and(o.EditorContextKeys.diffEditorModifiedWritable,c.key),order:5,group:"primary"});o.registerAction2(gC),o.registerAction2(pC),o.registerAction2(fC),o.registerAction2(mC),o.MenuRegistry.appendMenuItem(o.MenuId.EditorTitle,{command:{id:uo.id,title:a.localize(139,"Open Accessible Diff Viewer"),precondition:o.ContextKeyExpr.has("isInDiffEditor")},order:10,group:"2_diff",when:o.ContextKeyExpr.and(o.EditorContextKeys.accessibleDiffViewerVisible.negate(),o.ContextKeyExpr.has("isInDiffEditor"))}),o.CommandsRegistry.registerCommandAlias("editor.action.diffReview.next",uo.id),o.registerAction2(uo),o.CommandsRegistry.registerCommandAlias("editor.action.diffReview.prev",qr.id),o.registerAction2(qr);var vC=function(c,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,i);else for(var l=c.length-1;l>=0;l--)(r=c[l])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bC=function(c,e){return function(t,i){e(t,i,c)}},ud;const Gr=new o.RawContextKey("selectionAnchorSet",!1);let Bt=(pn=class{static get(e){return e.getContribution(ud.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Gr.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(a.Selection.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new o.MarkdownString().appendText(a.localize(834,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),o.alert(a.localize(835,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(a.Selection.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},ud=pn,pn.ID="editor.contrib.selectionAnchorController",pn);Bt=ud=vC([bC(1,o.IContextKeyService)],Bt);class CC extends o.EditorAction{constructor(){super({id:"editor.action.setSelectionAnchor",label:a.localize2(836,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:o.EditorContextKeys.editorTextFocus,primary:a.KeyChord(2089,2080),weight:100}})}async run(e,t){Bt.get(t)?.setSelectionAnchor()}}class SC extends o.EditorAction{constructor(){super({id:"editor.action.goToSelectionAnchor",label:a.localize2(837,"Go to Selection Anchor"),precondition:Gr})}async run(e,t){Bt.get(t)?.goToSelectionAnchor()}}class yC extends o.EditorAction{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:a.localize2(838,"Select from Anchor to Cursor"),precondition:Gr,kbOpts:{kbExpr:o.EditorContextKeys.editorTextFocus,primary:a.KeyChord(2089,2089),weight:100}})}async run(e,t){Bt.get(t)?.selectFromAnchorToCursor()}}class wC extends o.EditorAction{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:a.localize2(839,"Cancel Selection Anchor"),precondition:Gr,kbOpts:{kbExpr:o.EditorContextKeys.editorTextFocus,primary:9,weight:100}})}async run(e,t){Bt.get(t)?.cancelSelectionAnchor()}}o.registerEditorContribution(Bt.ID,Bt,4),o.registerEditorAction(CC),o.registerEditorAction(SC),o.registerEditorAction(yC),o.registerEditorAction(wC);const IC=o.registerColor("editorOverviewRuler.bracketMatchForeground","#A0A0A0",a.localize(840,"Overview ruler marker color for matching brackets."));class xC extends o.EditorAction{constructor(){super({id:"editor.action.jumpToBracket",label:a.localize2(842,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:o.EditorContextKeys.editorTextFocus,primary:3165,weight:100}})}run(e,t){Fi.get(t)?.jumpToBracket()}}class EC extends o.EditorAction{constructor(){super({id:"editor.action.selectToBracket",label:a.localize2(843,"Select to Bracket"),precondition:void 0,metadata:{description:a.localize2(844,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),Fi.get(t)?.selectToBracket(n)}}class LC extends o.EditorAction{constructor(){super({id:"editor.action.removeBrackets",label:a.localize2(845,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:o.EditorContextKeys.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Fi.get(t)?.removeBrackets(this.id)}}class DC{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const gi=class gi extends a.Disposable{static get(e){return e.getContribution(gi.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new a.RunOnceScheduler(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(n);if(l)r=l[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(r=d.range.getStartPosition())}}return r?new a.Selection(r.lineNumber,r.column,r.lineNumber,r.column):new a.Selection(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const h=t.bracketPairs.findNextBracket(s);h&&h.range&&(r=t.bracketPairs.matchBracket(h.range.getStartPosition()))}let l=null,d=null;if(r){r.sort(a.Range.compareRangesUsingStarts);const[h,u]=r;if(l=e?h.getStartPosition():h.getEndPosition(),d=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(s)){const g=l;l=d,d=g}}l&&d&&i.push(new a.Selection(l.lineNumber,l.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let g=0,p=e.length;g<p;g++){const f=e[g];f.isEmpty()&&(s[r++]=f.getStartPosition())}s.length>1&&s.sort(a.Position.compare);const l=[];let d=0,h=0;const u=n.length;for(let g=0,p=s.length;g<p;g++){const f=s[g];for(;h<u&&n[h].position.isBefore(f);)h++;if(h<u&&n[h].position.equals(f))l[d++]=n[h];else{let m=t.bracketPairs.matchBracket(f,20),_=gi._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(f,20),_=gi._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[d++]=new DC(f,m,_)}}this._lastBracketsData=l,this._lastVersionId=i}};gi.ID="editor.contrib.bracketMatchingController",gi._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=o.ModelDecorationOptions.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline",overviewRuler:{color:o.themeColorFromId(IC),position:a.OverviewRulerLane.Center}}),gi._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=o.ModelDecorationOptions.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline"});let Fi=gi;o.registerEditorContribution(Fi.ID,Fi,1),o.registerEditorAction(EC),o.registerEditorAction(xC),o.registerEditorAction(LC),o.MenuRegistry.appendMenuItem(o.MenuId.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:a.localize(841,"Go to &&Bracket")},order:2}),o.registerThemingParticipant((c,e)=>{const t=c.getColor(o.editorBracketMatchForeground);t&&e.addRule(`.monaco-editor .bracket-match-inline { color: ${t} !important; }`)});class RC{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new a.Range(i,n-1,i,n),l=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new a.Range(i,s,i,s),l)}else{const r=new a.Range(i,s,i,s+1),l=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new a.Range(i,n,i,n),l)}}computeCursorState(e,t){return this._isMovingLeft?new a.Selection(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new a.Selection(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class Sf extends o.EditorAction{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new RC(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class TC extends Sf{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:a.localize2(846,"Move Selected Text Left"),precondition:o.EditorContextKeys.writable})}}class NC extends Sf{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:a.localize2(847,"Move Selected Text Right"),precondition:o.EditorContextKeys.writable})}}o.registerEditorAction(TC),o.registerEditorAction(NC);class MC extends o.EditorAction{constructor(){super({id:"editor.action.transposeLetters",label:a.localize2(848,"Transpose Letters"),precondition:o.EditorContextKeys.writable,kbOpts:{kbExpr:o.EditorContextKeys.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const l=r.startLineNumber,d=r.startColumn,h=i.getLineMaxColumn(l);if(l===1&&(d===1||d===2&&h===2))continue;const u=d===h?r.getPosition():o.MoveOperations.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),g=o.MoveOperations.leftPosition(i,u),p=o.MoveOperations.leftPosition(i,g),f=i.getValueInRange(a.Range.fromPositions(p,g)),m=i.getValueInRange(a.Range.fromPositions(g,u)),_=a.Range.fromPositions(p,u);n.push(new o.ReplaceCommand(_,m+f))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}o.registerEditorAction(MC);const ft=class ft{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+ft.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ft((this.value?[this.value,...e]:e).join(ft.sep))}};ft.sep=".",ft.None=new ft("@@none@@"),ft.Empty=new ft("");let q=ft;var PC=function(c,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,i);else for(var l=c.length-1;l>=0;l--)(r=c[l])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},OC=function(c,e){return function(t,i){e(t,i,c)}};const AC=o.ModelDecorationOptions.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:a.noBreakWhitespace,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),bc=class bc extends a.Disposable{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=o.$(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=o.$("span.icon");this.domNode.append(t),t.classList.add(...o.ThemeIcon.asClassNameArray(a.Codicon.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(75);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(61)||n.hasChanged(75))&&i()})),this._register(o.addDisposableListener(this.domNode,o.EventType.CLICK,n=>{this.delegate.cancel()}))}getId(){return bc.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};bc.baseId="editor.widget.inlineProgressWidget";let gd=bc,Zr=class extends a.Disposable{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new a.MutableDisposable),this._currentWidget=this._register(new a.MutableDisposable),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=a.disposableTimeout(()=>{const l=a.Range.fromPositions(e);this._currentDecorations.set([{range:l,options:AC}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(gd,this.id,this._editor,l,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Zr=PC([OC(2,o.IInstantiationService)],Zr);var FC=function(c,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,i);else for(var l=c.length-1;l>=0;l--)(r=c[l])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yf=function(c,e){return function(t,i){e(t,i,c)}},Xr;let me=(pi=class{static get(e){return e.getContribution(Xr.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new a.MutableDisposable,this._messageListeners=new a.DisposableStore,this._mouseOverMessage=!1,this._editor=e,this._visible=Xr.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(o.alert(o.isMarkdownString(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),o.isMarkdownString(e)){const n=this._messageListeners.add(o.renderMarkdown(e,{actionHandler:(s,r)=>{this.closeMessage(),o.openLinkFromMarkdown(this._openerService,s,r.isTrusted)}}));this._messageWidget.value=new pd(this._editor,t,n.element)}else this._messageWidget.value=new pd(this._editor,t,e);this._messageListeners.add(a.Event.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&o.isAncestor(o.getActiveElement(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(o.addDisposableListener(this._messageWidget.value.getDomNode(),o.EventType.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(o.addDisposableListener(this._messageWidget.value.getDomNode(),o.EventType.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new a.Range(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(pd.fadeOut(this._messageWidget.value))}},Xr=pi,pi.ID="editor.contrib.messageController",pi.MESSAGE_VISIBLE=new o.RawContextKey("messageVisible",!1,a.localize(1333,"Whether the editor is currently showing an inline message")),pi);me=Xr=FC([yf(1,o.IContextKeyService),yf(2,o.IOpenerService)],me);const zC=o.EditorCommand.bindToContribution(me.get);o.registerEditorCommand(new zC({id:"leaveEditorMessage",precondition:me.MESSAGE_VISIBLE,handler:c=>c.closeMessage(),kbOpts:{weight:130,primary:9}}));let pd=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const l=document.createElement("div");l.classList.add("anchor","below"),this._domNode.appendChild(l),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};o.registerEditorContribution(me.ID,me,4);var fd=function(c,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,i);else for(var l=c.length-1;l>=0;l--)(r=c[l])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},go=function(c,e){return function(t,i){e(t,i,c)}};class md{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Cc=class Cc extends md{constructor(){super(q.Empty.append("text","plain")),this.id=Cc.id,this.dropMimeTypes=[o.Mimes.text],this.pasteMimeTypes=[o.Mimes.text]}async getEdit(e,t){const i=e.get(o.Mimes.text);if(!i||e.has(o.Mimes.uriList))return;const n=await i.asString();return{handledMimeType:o.Mimes.text,title:a.localize(965,"Insert Plain Text"),insertText:n,kind:this.kind}}};Cc.id="text";let zi=Cc;class wf extends md{constructor(){super(q.Empty.append("uri","path","absolute")),this.dropMimeTypes=[o.Mimes.uriList],this.pasteMimeTypes=[o.Mimes.uriList]}async getEdit(e,t){const i=await If(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:l,originalText:d})=>l.scheme===a.Schemas.file?l.fsPath:(n++,d)).join(" ");let r;return n>0?r=i.length>1?a.localize(966,"Insert Uris"):a.localize(967,"Insert Uri"):r=i.length>1?a.localize(968,"Insert Paths"):a.localize(969,"Insert Path"),{handledMimeType:o.Mimes.uriList,insertText:s,title:r,kind:this.kind}}}let Yr=class extends md{constructor(e){super(q.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[o.Mimes.uriList],this.pasteMimeTypes=[o.Mimes.uriList]}async getEdit(e,t){const i=await If(e);if(!i.length||t.isCancellationRequested)return;const n=a.coalesce(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?o.relativePath(r.uri,s):void 0}));if(n.length)return{handledMimeType:o.Mimes.uriList,insertText:n.join(" "),title:i.length>1?a.localize(970,"Insert Relative Paths"):a.localize(971,"Insert Relative Path"),kind:this.kind}}};Yr=fd([go(0,o.IWorkspaceContextService)],Yr);class VC{constructor(){this.kind=new q("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:o.Mimes.text}]}async provideDocumentPasteEdits(e,t,i,n,s){if(n.triggerKind!==a.DocumentPasteTriggerKind.PasteAs&&!n.only?.contains(this.kind))return;const l=await i.get("text/html")?.asString();if(!(!l||s.isCancellationRequested))return{dispose(){},edits:[{insertText:l,yieldTo:this._yieldTo,title:a.localize(972,"Insert HTML"),kind:this.kind}]}}}async function If(c){const e=c.get(o.Mimes.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of o.UriList.parse(t))try{i.push({uri:a.URI.parse(n),originalText:n})}catch{}return i}const Vi={scheme:"*",hasAccessToAllModels:!0};let _d=class extends a.Disposable{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(Vi,new zi)),this._register(e.documentDropEditProvider.register(Vi,new wf)),this._register(e.documentDropEditProvider.register(Vi,new Yr(t)))}};_d=fd([go(0,o.ILanguageFeaturesService),go(1,o.IWorkspaceContextService)],_d);let vd=class extends a.Disposable{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(Vi,new zi)),this._register(e.documentPasteEditProvider.register(Vi,new wf)),this._register(e.documentPasteEditProvider.register(Vi,new Yr(t))),this._register(e.documentPasteEditProvider.register(Vi,new VC))}};vd=fd([go(0,o.ILanguageFeaturesService),go(1,o.IWorkspaceContextService)],vd);const Be=class Be{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=Be._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Be.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(Be.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Be.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(Be.isVariableCharacter(i)||Be.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Be._table[i]>"u"&&!Be.isDigitCharacter(i)&&!Be.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Be._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let bd=Be;class is{constructor(){this._children=[]}appendChild(e){return e instanceof re&&this._children[this._children.length-1]instanceof re?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function r(l,d){for(const h of l)h.parent=d,r(h.children,h)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof po)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class re extends is{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new re(this.value)}}class xf extends is{}class De extends xf{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof ns?this._children[0]:void 0}clone(){const e=new De(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class ns extends is{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof re&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new ns;return this.options.forEach(e.appendChild,e),e}}class Cd extends is{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof je&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof je){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new Cd;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class je extends is{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":this.shorthandName==="kebabcase"?e?this._toKebabCase(e):"":this.shorthandName==="snakecase"?e?this._toSnakeCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,"").replace(/[\s_]+/g,"-");const i=e.trim().replace(/^_+|_+$/g,""),n=i.match(new RegExp("\\p{Lu}{2,}(?=\\p{Lu}\\p{Ll}+[0-9]*|[\\s_-]|$)|\\p{Lu}?\\p{Ll}+[0-9]*|\\p{Lu}(?=\\p{Lu}\\p{Ll})|\\p{Lu}(?=[\\s_-]|$)|[0-9]+","gu"));return n?n.map(s=>s.toLowerCase()).join("-"):i.split(/[\s_-]+/).filter(s=>s.length>0).map(s=>s.toLowerCase()).join("-")}_toPascalCase(e){const t=e.match(/[\p{L}0-9]+/gu);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[\p{L}0-9]+/gu);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toSnakeCase(e){return e.replace(new RegExp("(\\p{Ll})(\\p{Lu})","gu"),"$1_$2").replace(/[\s\-]+/g,"_").toLowerCase()}clone(){return new je(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Bi extends xf{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new re(t)],!0):!1}clone(){const e=new Bi(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Ef(c,e){const t=[...c];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class po extends is{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof De&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return Ef([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof De&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Bi&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new po;return e._children=this.children.map(t=>t.clone()),e}walk(e){Ef(this.children,e)}}class Ki{constructor(){this._scanner=new bd,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new po;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(d=>(d instanceof De&&(d.isFinalTabstop?n.set(0,void 0):!n.has(d.index)&&d.children.length>0?n.set(d.index,d.children):s.push(d)),!0));const r=(d,h)=>{const u=n.get(d.index);if(!u)return;const g=new De(d.index);g.transform=d.transform;for(const p of u){const f=p.clone();g.appendChild(f),f instanceof De&&n.has(f.index)&&!h.has(f.index)&&(h.add(f.index),r(f,h),h.delete(f.index))}t.replace(d,[g])},l=new Set;for(const d of s)r(d,l);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new De(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new re(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new De(Number(t)):new Bi(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new De(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new re("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new ns;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new re(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new Bi(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new re("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new Cd;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new re(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new je(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new je(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new je(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new je(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new je(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new je(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new je(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new re(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function Lf(c,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new o.ResourceTextEdit(c,{range:i,text:typeof t.insertText=="string"?Ki.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function Df(c){function e(r,l){return"mimeType"in r?r.mimeType===l.handledMimeType:!!l.kind&&r.kind.contains(l.kind)}const t=new Map;for(const r of c)for(const l of r.yieldTo??[])for(const d of c)if(d!==r&&e(l,d)){let h=t.get(r);h||(h=[],t.set(r,h)),h.push(d)}if(!t.size)return Array.from(c);const i=new Set,n=[];function s(r){if(!r.length)return[];const l=r[0];if(n.includes(l))return console.warn("Yield to cycle detected",l),r;if(i.has(l))return s(r.slice(1));let d=[];const h=t.get(l);return h&&(n.push(l),d=s(h),n.pop()),i.add(l),[...d,l,...s(r.slice(1))]}return s(Array.from(c))}function Sd(c,e){return e&&(c.stack||c.stacktrace)?a.localize(33,"{0}: {1}",Tf(c),Rf(c.stack)||Rf(c.stacktrace)):Tf(c)}function Rf(c){return Array.isArray(c)?c.join(` `):c}function Tf(c){return c.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${c.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof c.code=="string"&&typeof c.errno=="number"&&typeof c.syscall=="string"?a.localize(34,"A system error occurred ({0})",c.message):c.message||a.localize(35,"An unknown error occurred. Please consult the log for more details.")}function Qr(c=null,e=!1){if(!c)return a.localize(36,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(c)){const t=a.coalesce(c),i=Qr(t[0],e);return t.length>1?a.localize(37,"{0} ({1} errors in total)",i,t.length):i}if(a.isString(c))return c;if(c.detail){const t=c.detail;if(t.error)return Sd(t.error,e);if(t.exception)return Sd(t.exception,e)}return c.stack?Sd(c,e):c.message?c.message:a.localize(38,"An unknown error occurred. Please consult the log for more details.")}var yd=function(c,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,i);else for(var l=c.length-1;l>=0;l--)(r=c[l])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Kt=function(c,e){return function(t,i){e(t,i,c)}},wd;const Nf="acceptSelectedCodeAction",Mf="previewSelectedCodeAction";class BC{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??e.label??""}disposeTemplate(e){}}class KC{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}}let Id=class{get templateId(){return"action"}constructor(e,t,i,n,s,r,l,d,h){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=i,this._hasAnySubmenuActions=n,this._groupTitleByIndex=s,this._linkHandler=r,this._hideDefaultKeybindingTooltip=l,this._keybindingService=d,this._openerService=h}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=document.createElement("span");n.className="action-item-badge",e.append(n);const s=document.createElement("span");s.className="description",e.append(s);const r=document.createElement("span");r.className="group-title",e.append(r);const l=document.createElement("span");l.className="detail",e.append(l);const d=new o.KeybindingLabel(e,a.OS),h=document.createElement("div");h.className="action-list-item-toolbar",e.append(h);const u=document.createElement("div");u.className="action-list-submenu-indicator",e.append(u);const g=new a.DisposableStore;return{container:e,icon:t,text:i,detail:l,badge:n,description:s,groupTitle:r,keybinding:d,toolbar:h,submenuIndicator:u,elementDisposables:g}}renderElement(e,t,i){if(i.elementDisposables.clear(),e.group?.icon?(i.icon.className=o.ThemeIcon.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=o.asCssVariable(e.group.icon.color.id))):(i.icon.className=o.ThemeIcon.asClassName(a.Codicon.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;if(o.setVisibility(!e.hideIcon,i.icon),e.isSectionToggle){const d=e.group?.icon===a.Codicon.chevronDown;i.container.setAttribute("aria-expanded",String(d))}else i.container.removeAttribute("aria-expanded");if(i.previousClassName&&i.container.classList.remove(i.previousClassName),i.container.classList.toggle("action-list-custom",!!e.className),e.className&&i.container.classList.add(e.className),i.previousClassName=e.className,i.text.textContent=ot(e.label),e.badge?(i.badge.textContent=e.badge,i.badge.style.display=""):(i.badge.textContent="",i.badge.style.display="none"),e.keybinding)i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px";else if(e.description){if(o.clearNode(i.description),typeof e.description=="string")i.description.textContent=ot(e.description);else{const d=o.renderMarkdown(e.description,{actionHandler:h=>{const u=a.URI.parse(h);this._linkHandler?this._linkHandler(u,e):this._openerService.open(u,{allowCommands:!0})}});i.elementDisposables.add(d),i.description.appendChild(d.element)}i.description.style.display="inline"}else i.description.textContent="",i.description.style.display="none";const n=this._groupTitleByIndex.get(t);n?(i.groupTitle.textContent=n,i.groupTitle.style.display=""):(i.groupTitle.textContent="",i.groupTitle.style.display="none"),e.detail?(i.detail.textContent=ot(e.detail),i.detail.style.display=""):(i.detail.textContent="",i.detail.style.display="none");const s=this._keybindingService.lookupKeybinding(Nf)?.getLabel(),r=this._keybindingService.lookupKeybinding(Mf)?.getLabel();i.container.classList.toggle("option-disabled",!!e.disabled),e.hover!==void 0?i.container.title="":e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:this._hideDefaultKeybindingTooltip?i.container.title="":s&&r?this._supportsPreview&&e.canPreview?i.container.title=a.localize(1705,"{0} to Apply, {1} to Preview",s,r):i.container.title=a.localize(1706,"{0} to Apply",s):i.container.title="",o.clearNode(i.toolbar);const l=[...e.toolbarActions??[]];if(e.onRemove&&l.push(o.toAction({id:"actionList.remove",label:a.localize(1707,"Remove"),class:o.ThemeIcon.asClassName(a.Codicon.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),i.container.classList.toggle("has-toolbar",l.length>0),l.length>0){const d=new o.ActionBar(i.toolbar);i.elementDisposables.add(d),d.push(l,{icon:!0,label:!1})}e.submenuActions?.length&&!e.hover?.content?(i.submenuIndicator.className="action-list-submenu-indicator has-submenu "+o.ThemeIcon.asClassName(a.Codicon.chevronRight),i.submenuIndicator.style.display="",i.submenuIndicator.style.visibility="",i.elementDisposables.add(o.addDisposableListener(i.submenuIndicator,o.EventType.CLICK,d=>{d.stopPropagation(),this._onShowSubmenu?.(e)}))):this._hasAnySubmenuActions?(i.submenuIndicator.className="action-list-submenu-indicator",i.submenuIndicator.style.display="",i.submenuIndicator.style.visibility="hidden"):(i.submenuIndicator.className="action-list-submenu-indicator",i.submenuIndicator.style.display="none")}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};Id=yd([Kt(7,o.IKey