o||fp||C0&&p--,E.columnSelect(m,_,b.fromViewLineNumber,b.fromViewVisualColumn,b.toViewLineNumber,p)}static columnSelectRight(m,_,b){let p=0;const n=Math.min(b.fromViewLineNumber,b.toViewLineNumber),o=Math.max(b.fromViewLineNumber,b.toViewLineNumber);for(let i=n;i<=o;i++){const s=_.getLineMaxColumn(i),g=m.visibleColumnFromColumn(_,new k.Position(i,s));p=Math.max(p,g)}let t=b.toViewVisualColumn;return tn.getLineMinColumn(o.lineNumber))return o.delta(void 0,-d.prevCharLength(n.getLineContent(o.lineNumber),o.column-1));if(o.lineNumber>1){const t=o.lineNumber-1;return new I.Position(t,n.getLineMaxColumn(t))}else return o}static leftPositionAtomicSoftTabs(n,o,t){if(o.column<=n.getLineIndentColumn(o.lineNumber)){const i=n.getLineMinColumn(o.lineNumber),s=n.getLineContent(o.lineNumber),g=y.AtomicTabMoveOperations.atomicPosition(s,o.column-1,t,0);if(g!==-1&&g+1>=i)return new I.Position(o.lineNumber,g+1)}return this.leftPosition(n,o)}static left(n,o,t){const i=n.stickyTabStops?b.leftPositionAtomicSoftTabs(o,t,n.tabSize):b.leftPosition(o,t);return new _(i.lineNumber,i.column,0)}static moveLeft(n,o,t,i,s){let g,c;if(t.hasSelection()&&!i)g=t.selection.startLineNumber,c=t.selection.startColumn;else{const l=t.position.delta(void 0,-(s-1)),a=o.normalizePosition(b.clipPositionColumn(l,o),0),r=b.left(n,o,a);g=r.lineNumber,c=r.column}return t.move(i,g,c,0)}static clipPositionColumn(n,o){return new I.Position(n.lineNumber,b.clipRange(n.column,o.getLineMinColumn(n.lineNumber),o.getLineMaxColumn(n.lineNumber)))}static clipRange(n,o,t){return nt?t:n}static rightPosition(n,o,t){return tr?(t=r,c?i=o.getLineMaxColumn(t):i=Math.min(o.getLineMaxColumn(t),i)):i=n.columnFromVisibleColumn(o,t,a),f?s=0:s=a-k.CursorColumns.visibleColumnFromColumn(o.getLineContent(t),i,n.tabSize),l!==void 0){const h=new I.Position(t,i),v=o.normalizePosition(h,l);s=s+(i-v.column),t=v.lineNumber,i=v.column}return new _(t,i,s)}static down(n,o,t,i,s,g,c){return this.vertical(n,o,t,i,s,t+g,c,4)}static moveDown(n,o,t,i,s){let g,c;t.hasSelection()&&!i?(g=t.selection.endLineNumber,c=t.selection.endColumn):(g=t.position.lineNumber,c=t.position.column);let l=0,a;do if(a=b.down(n,o,g+l,c,t.leftoverVisibleColumns,s,!0),o.normalizePosition(new I.Position(a.lineNumber,a.column),2).lineNumber>g)break;while(l++<10&&g+l1&&this._isBlankLine(o,s);)s--;for(;s>1&&!this._isBlankLine(o,s);)s--;return t.move(i,s,o.getLineMinColumn(s),0)}static moveToNextBlankLine(n,o,t,i){const s=o.getLineCount();let g=t.position.lineNumber;for(;g=C.length+1)return!1;const f=C.charAt(u.column-2),h=i.get(f);if(!h)return!1;if((0,I.isQuote)(f)){if(t==="never")return!1}else if(o==="never")return!1;const v=C.charAt(u.column-1);let w=!1;for(const S of h)S.open===f&&S.close===v&&(w=!0);if(!w)return!1;if(n==="auto"){let S=!1;for(let L=0,D=c.length;L1){const s=o.getLineContent(i.lineNumber),g=d.firstNonWhitespaceIndex(s),c=g===-1?s.length+1:g+1;if(i.column<=c){const l=t.visibleColumnFromColumn(o,i),a=E.CursorColumns.prevIndentTabStop(l,t.indentSize),r=t.columnFromVisibleColumn(o,i.lineNumber,a);return new m.Range(i.lineNumber,r,i.lineNumber,i.column)}}return m.Range.fromPositions(b.getPositionAfterDeleteLeft(i,o),i)}static getPositionAfterDeleteLeft(n,o){if(n.column>1){const t=d.getLeftDeleteOffset(n.column-1,o.getLineContent(n.lineNumber));return n.with(void 0,t+1)}else if(n.lineNumber>1){const t=n.lineNumber-1;return new _.Position(t,o.getLineMaxColumn(t))}else return n}static cut(n,o,t){const i=[];let s=null;t.sort((g,c)=>_.Position.compare(g.getStartPosition(),c.getEndPosition()));for(let g=0,c=t.length;g1&&s?.endLineNumber!==a.lineNumber?(r=a.lineNumber-1,u=o.getLineMaxColumn(a.lineNumber-1),C=a.lineNumber,f=o.getLineMaxColumn(a.lineNumber)):(r=a.lineNumber,u=1,C=a.lineNumber,f=o.getLineMaxColumn(a.lineNumber));const h=new m.Range(r,u,C,f);s=h,h.isEmpty()?i[g]=null:i[g]=new k.ReplaceCommand(h,"")}else i[g]=null;else i[g]=new k.ReplaceCommand(l,"")}return new I.EditOperationResult(0,i,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}e.DeleteOperations=b}),define(ne[199],se([1,0,11,76,234,166,9,4]),function(oe,e,d,k,I,E,y,m){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WordPartOperations=e.WordOperations=void 0;class _{static _createWord(o,t,i,s,g){return{start:s,end:g,wordType:t,nextCharClass:i}}static _createIntlWord(o,t){return{start:o.index,end:o.index+o.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(o,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,o,i)}static _doFindPreviousWordOnLine(o,t,i){let s=0;const g=t.findPrevIntlWordBeforeOrAtOffset(o,i.column-2);for(let c=i.column-2;c>=0;c--){const l=o.charCodeAt(c),a=t.get(l);if(g&&c===g.index)return this._createIntlWord(g,a);if(a===0){if(s===2)return this._createWord(o,s,a,c+1,this._findEndOfWord(o,t,s,c+1));s=1}else if(a===2){if(s===1)return this._createWord(o,s,a,c+1,this._findEndOfWord(o,t,s,c+1));s=2}else if(a===1&&s!==0)return this._createWord(o,s,a,c+1,this._findEndOfWord(o,t,s,c+1))}return s!==0?this._createWord(o,s,1,0,this._findEndOfWord(o,t,s,0)):null}static _findEndOfWord(o,t,i,s){const g=t.findNextIntlWordAtOrAfterOffset(o,s),c=o.length;for(let l=s;l=0;c--){const l=o.charCodeAt(c),a=t.get(l);if(g&&c===g.index)return c;if(a===1||i===1&&a===2||i===2&&a===0)return c+1}return 0}static moveWordLeft(o,t,i,s,g){let c=i.lineNumber,l=i.column;l===1&&c>1&&(c=c-1,l=t.getLineMaxColumn(c));let a=_._findPreviousWordOnLine(o,t,new y.Position(c,l));if(s===0)return new y.Position(c,a?a.start+1:1);if(s===1)return!g&&a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=_._findPreviousWordOnLine(o,t,new y.Position(c,a.start+1))),new y.Position(c,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=_._findPreviousWordOnLine(o,t,new y.Position(c,a.start+1));return new y.Position(c,a?a.start+1:1)}return a&&l<=a.end+1&&(a=_._findPreviousWordOnLine(o,t,new y.Position(c,a.start+1))),new y.Position(c,a?a.end+1:1)}static _moveWordPartLeft(o,t){const i=t.lineNumber,s=o.getLineMaxColumn(i);if(t.column===1)return i>1?new y.Position(i-1,o.getLineMaxColumn(i-1)):t;const g=o.getLineContent(i);for(let c=t.column-1;c>1;c--){const l=g.charCodeAt(c-2),a=g.charCodeAt(c-1);if(l===95&&a!==95)return new y.Position(i,c);if(l===45&&a!==45)return new y.Position(i,c);if((d.isLowerAsciiLetter(l)||d.isAsciiDigit(l))&&d.isUpperAsciiLetter(a))return new y.Position(i,c);if(d.isUpperAsciiLetter(l)&&d.isUpperAsciiLetter(a)&&c+1=a.start+1&&(a=_._findNextWordOnLine(o,t,new y.Position(g,a.end+1))),a?c=a.start+1:c=t.getLineMaxColumn(g);return new y.Position(g,c)}static _moveWordPartRight(o,t){const i=t.lineNumber,s=o.getLineMaxColumn(i);if(t.column===s)return i1?r=1:(a--,r=s.getLineMaxColumn(a)):(u&&r<=u.end+1&&(u=_._findPreviousWordOnLine(i,s,new y.Position(a,u.start+1))),u?r=u.end+1:r>1?r=1:(a--,r=s.getLineMaxColumn(a))),new m.Range(a,r,l.lineNumber,l.column)}static deleteInsideWord(o,t,i){if(!i.isEmpty())return i;const s=new y.Position(i.positionLineNumber,i.positionColumn),g=this._deleteInsideWordWhitespace(t,s);return g||this._deleteInsideWordDetermineDeleteRange(o,t,s)}static _charAtIsWhitespace(o,t){const i=o.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(o,t){const i=o.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let g=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,g))return null;let c=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,c))return null;for(;g>0&&this._charAtIsWhitespace(i,g-1);)g--;for(;c+11?new m.Range(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberC.start+1<=i.column&&i.column<=C.end+1,l=(C,f)=>(C=Math.min(C,i.column),f=Math.max(f,i.column),new m.Range(i.lineNumber,C,i.lineNumber,f)),a=C=>{let f=C.start+1,h=C.end+1,v=!1;for(;h-11&&this._charAtIsWhitespace(s,f-2);)f--;return l(f,h)},r=_._findPreviousWordOnLine(o,t,i);if(r&&c(r))return a(r);const u=_._findNextWordOnLine(o,t,i);return u&&c(u)?a(u):r&&u?l(r.end+1,u.start+1):r?l(r.start+1,r.end+1):u?l(u.start+1,u.end+1):l(1,g+1)}static _deleteWordPartLeft(o,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=_._moveWordPartLeft(o,i);return new m.Range(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(o,t){const i=o.length;for(let s=t;s=f.start+1&&(f=_._findNextWordOnLine(i,s,new y.Position(a,f.end+1))),f?r=f.start+1:r!!o)}}),define(ne[235],se([1,0,19,76,233,199,9,4]),function(oe,e,d,k,I,E,y,m){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CursorMove=e.CursorMoveCommands=void 0;class _{static addCursorDown(n,o,t){const i=[];let s=0;for(let g=0,c=o.length;ga&&(r=a,u=n.model.getLineMaxColumn(r)),k.CursorState.fromModelState(new k.SingleCursorState(new m.Range(g.lineNumber,1,r,u),2,0,new y.Position(r,u),0))}const l=o.modelState.selectionStart.getStartPosition().lineNumber;if(g.lineNumberl){const a=n.getLineCount();let r=c.lineNumber+1,u=1;return r>a&&(r=a,u=n.getLineMaxColumn(r)),k.CursorState.fromViewState(o.viewState.move(!0,r,u,0))}else{const a=o.modelState.selectionStart.getEndPosition();return k.CursorState.fromModelState(o.modelState.move(!0,a.lineNumber,a.column,0))}}static word(n,o,t,i){const s=n.model.validatePosition(i);return k.CursorState.fromModelState(E.WordOperations.word(n.cursorConfig,n.model,o.modelState,t,s))}static cancelSelection(n,o){if(!o.modelState.hasSelection())return new k.CursorState(o.modelState,o.viewState);const t=o.viewState.position.lineNumber,i=o.viewState.position.column;return k.CursorState.fromViewState(new k.SingleCursorState(new m.Range(t,i,t,i),0,0,new y.Position(t,i),0))}static moveTo(n,o,t,i,s){if(t){if(o.modelState.selectionStartKind===1)return this.word(n,o,t,i);if(o.modelState.selectionStartKind===2)return this.line(n,o,t,i,s)}const g=n.model.validatePosition(i),c=s?n.coordinatesConverter.validateViewPosition(new y.Position(s.lineNumber,s.column),g):n.coordinatesConverter.convertModelPositionToViewPosition(g);return k.CursorState.fromViewState(o.viewState.move(t,c.lineNumber,c.column,0))}static simpleMove(n,o,t,i,s,g){switch(t){case 0:return g===4?this._moveHalfLineLeft(n,o,i):this._moveLeft(n,o,i,s);case 1:return g===4?this._moveHalfLineRight(n,o,i):this._moveRight(n,o,i,s);case 2:return g===2?this._moveUpByViewLines(n,o,i,s):this._moveUpByModelLines(n,o,i,s);case 3:return g===2?this._moveDownByViewLines(n,o,i,s):this._moveDownByModelLines(n,o,i,s);case 4:return g===2?o.map(c=>k.CursorState.fromViewState(I.MoveOperations.moveToPrevBlankLine(n.cursorConfig,n,c.viewState,i))):o.map(c=>k.CursorState.fromModelState(I.MoveOperations.moveToPrevBlankLine(n.cursorConfig,n.model,c.modelState,i)));case 5:return g===2?o.map(c=>k.CursorState.fromViewState(I.MoveOperations.moveToNextBlankLine(n.cursorConfig,n,c.viewState,i))):o.map(c=>k.CursorState.fromModelState(I.MoveOperations.moveToNextBlankLine(n.cursorConfig,n.model,c.modelState,i)));case 6:return this._moveToViewMinColumn(n,o,i);case 7:return this._moveToViewFirstNonWhitespaceColumn(n,o,i);case 8:return this._moveToViewCenterColumn(n,o,i);case 9:return this._moveToViewMaxColumn(n,o,i);case 10:return this._moveToViewLastNonWhitespaceColumn(n,o,i);default:return null}}static viewportMove(n,o,t,i,s){const g=n.getCompletelyVisibleViewRange(),c=n.coordinatesConverter.convertViewRangeToModelRange(g);switch(t){case 11:{const l=this._firstLineNumberInRange(n.model,c,s),a=n.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(n,o[0],i,l,a)]}case 13:{const l=this._lastLineNumberInRange(n.model,c,s),a=n.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(n,o[0],i,l,a)]}case 12:{const l=Math.round((c.startLineNumber+c.endLineNumber)/2),a=n.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(n,o[0],i,l,a)]}case 14:{const l=[];for(let a=0,r=o.length;at.endLineNumber-1?g=t.endLineNumber-1:sk.CursorState.fromViewState(I.MoveOperations.moveLeft(n.cursorConfig,n,s.viewState,t,i)))}static _moveHalfLineLeft(n,o,t){const i=[];for(let s=0,g=o.length;sk.CursorState.fromViewState(I.MoveOperations.moveRight(n.cursorConfig,n,s.viewState,t,i)))}static _moveHalfLineRight(n,o,t){const i=[];for(let s=0,g=o.length;sn.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(n=>n.asCursorState())}getViewPositions(){return this.cursors.map(n=>n.viewState.position)}getTopMostViewPosition(){return(0,k.findFirstMin)(this.cursors,(0,d.compareBy)(n=>n.viewState.position,y.Position.compare)).viewState.position}getBottomMostViewPosition(){return(0,k.findLastMax)(this.cursors,(0,d.compareBy)(n=>n.viewState.position,y.Position.compare)).viewState.position}getSelections(){return this.cursors.map(n=>n.modelState.selection)}getViewSelections(){return this.cursors.map(n=>n.viewState.selection)}setSelections(n){this.setStates(I.CursorState.fromModelSelections(n))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(n){n!==null&&(this.cursors[0].setState(this.context,n[0].modelState,n[0].viewState),this._setSecondaryStates(n.slice(1)))}_setSecondaryStates(n){const o=this.cursors.length-1,t=n.length;if(ot){const i=o-t;for(let s=0;s=n+1&&this.lastAddedCursorIndex--,this.cursors[n+1].dispose(this.context),this.cursors.splice(n+1,1)}normalize(){if(this.cursors.length===1)return;const n=this.cursors.slice(0),o=[];for(let t=0,i=n.length;tt.selection,m.Range.compareRangesUsingStarts));for(let t=0;tu&&v.index--;n.splice(u,1),o.splice(r,1),this._removeSecondaryCursor(u-1),t--}}}}e.CursorCollection=b}),define(ne[568],se([1,0,131]),function(oe,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CharacterPairSupport=void 0;class k{static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])>
+ `}static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
+ `}constructor(E){if(E.autoClosingPairs?this._autoClosingPairs=E.autoClosingPairs.map(y=>new d.StandardAutoClosingPairConditional(y)):E.brackets?this._autoClosingPairs=E.brackets.map(y=>new d.StandardAutoClosingPairConditional({open:y[0],close:y[1]})):this._autoClosingPairs=[],E.__electricCharacterSupport&&E.__electricCharacterSupport.docComment){const y=E.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new d.StandardAutoClosingPairConditional({open:y.open,close:y.close||""}))}this._autoCloseBeforeForQuotes=typeof E.autoCloseBefore=="string"?E.autoCloseBefore:k.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof E.autoCloseBefore=="string"?E.autoCloseBefore:k.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=E.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(E){return E?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}e.CharacterPairSupport=k}),define(ne[569],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndentRulesSupport=void 0;function d(I){return I.global&&(I.lastIndex=0),!0}class k{constructor(E){this._indentationRules=E}shouldIncrease(E){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&d(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(E))}shouldDecrease(E){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&d(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(E))}shouldIndentNextLine(E){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&d(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(E))}shouldIgnore(E){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&d(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(E))}getIndentMetadata(E){let y=0;return this.shouldIncrease(E)&&(y+=1),this.shouldDecrease(E)&&(y+=2),this.shouldIndentNextLine(E)&&(y+=4),this.shouldIgnore(E)&&(y+=8),y}}e.IndentRulesSupport=k}),define(ne[570],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BasicInplaceReplace=void 0;class d{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}static{this.INSTANCE=new d}navigateValueSet(I,E,y,m,_){if(I&&E){const b=this.doNavigateValueSet(E,_);if(b)return{range:I,value:b}}if(y&&m){const b=this.doNavigateValueSet(m,_);if(b)return{range:y,value:b}}return null}doNavigateValueSet(I,E){const y=this.numberReplace(I,E);return y!==null?y:this.textReplace(I,E)}numberReplace(I,E){const y=Math.pow(10,I.length-(I.lastIndexOf(".")+1));let m=Number(I);const _=parseFloat(I);return!isNaN(m)&&!isNaN(_)&&m===_?m===0&&!E?null:(m=Math.floor(m*y),m+=E?y:-y,String(m/y)):null}textReplace(I,E){return this.valueSetsReplace(this._defaultValueSet,I,E)}valueSetsReplace(I,E,y){let m=null;for(let _=0,b=I.length;m===null&&_=0?(m+=y?1:-1,m<0?m=I.length-1:m%=I.length,I[m]):null}}e.BasicInplaceReplace=d}),define(ne[571],se([1,0,8,11,131]),function(oe,e,d,k,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnEnterSupport=void 0;class E{constructor(m){m=m||{},m.brackets=m.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],m.brackets.forEach(_=>{const b=E._createOpenBracketRegExp(_[0]),p=E._createCloseBracketRegExp(_[1]);b&&p&&this._brackets.push({open:_[0],openRegExp:b,close:_[1],closeRegExp:p})}),this._regExpRules=m.onEnterRules||[]}onEnter(m,_,b,p){if(m>=3)for(let n=0,o=this._regExpRules.length;ns.reg?(s.reg.lastIndex=0,s.reg.test(s.text)):!0))return t.action}if(m>=2&&b.length>0&&p.length>0)for(let n=0,o=this._brackets.length;n=2&&b.length>0){for(let n=0,o=this._brackets.length;n{const S=n(v.token,w.token);return S!==0?S:v.index-w.index});let c=0,l="000000",a="ffffff";for(;s.length>=1&&s[0].token==="";){const v=s.shift();v.fontStyle!==-1&&(c=v.fontStyle),v.foreground!==null&&(l=v.foreground),v.background!==null&&(a=v.background)}const r=new m;for(const v of g)r.getId(v);const u=r.getId(l),C=r.getId(a),f=new o(c,u,C),h=new t(f);for(let v=0,w=s.length;v"u"){const a=this._match(c),r=p(c);l=(a.metadata|r<<8)>>>0,this._cache.set(c,l)}return(l|g<<0)>>>0}}e.TokenTheme=_;const b=/\b(comment|string|regex|regexp)\b/;function p(s){const g=s.match(b);if(!g)return 0;switch(g[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function n(s,g){return sg?1:0}class o{constructor(g,c,l){this._themeTrieElementRuleBrand=void 0,this._fontStyle=g,this._foreground=c,this._background=l,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new o(this._fontStyle,this._foreground,this._background)}acceptOverwrite(g,c,l){g!==-1&&(this._fontStyle=g),c!==0&&(this._foreground=c),l!==0&&(this._background=l),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}e.ThemeTrieElementRule=o;class t{constructor(g){this._themeTrieElementBrand=void 0,this._mainRule=g,this._children=new Map}match(g){if(g==="")return this._mainRule;const c=g.indexOf(".");let l,a;c===-1?(l=g,a=""):(l=g.substring(0,c),a=g.substring(c+1));const r=this._children.get(l);return typeof r<"u"?r.match(a):this._mainRule}insert(g,c,l,a){if(g===""){this._mainRule.acceptOverwrite(c,l,a);return}const r=g.indexOf(".");let u,C;r===-1?(u=g,C=""):(u=g.substring(0,r),C=g.substring(r+1));let f=this._children.get(u);typeof f>"u"&&(f=new t(this._mainRule.clone()),this._children.set(u,f)),f.insert(C,c,l,a)}}e.ThemeTrieElement=t;function i(s){const g=[];for(let c=1,l=s.length;c=m&&(h=h-C%m),h}function t(C,f){return C.reduce((h,v)=>o(h,f(v)),e.lengthZero)}function i(C,f){return C===f}function s(C,f){const h=C,v=f;if(v-h<=0)return e.lengthZero;const S=Math.floor(h/m),L=Math.floor(v/m),D=v-L*m;if(S===L){const T=h-S*m;return _(0,D-T)}else return _(L-S,D)}function g(C,f){return C=f}function a(C){return _(C.lineNumber-1,C.column-1)}function r(C,f){const h=C,v=Math.floor(h/m),w=h-v*m,S=f,L=Math.floor(S/m),D=S-L*m;return new k.Range(v+1,w+1,L+1,D+1)}function u(C){const f=(0,d.splitLines)(C);return _(f.length-1,f[f.length-1].length)}}),define(ne[200],se([1,0,4,106]),function(oe,e,d,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BeforeEditPositionMapper=e.TextEditInfo=void 0;class I{static fromModelContentChanges(_){return _.map(p=>{const n=d.Range.lift(p.range);return new I((0,k.positionToLength)(n.getStartPosition()),(0,k.positionToLength)(n.getEndPosition()),(0,k.lengthOfString)(p.text))}).reverse()}constructor(_,b,p){this.startOffset=_,this.endOffset=b,this.newLength=p}toString(){return`[${(0,k.lengthToObj)(this.startOffset)}...${(0,k.lengthToObj)(this.endOffset)}) -> ${(0,k.lengthToObj)(this.newLength)}`}}e.TextEditInfo=I;class E{constructor(_){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=_.map(b=>y.from(b))}getOffsetBeforeChange(_){return this.adjustNextEdit(_),this.translateCurToOld(_)}getDistanceToNextChange(_){this.adjustNextEdit(_);const b=this.edits[this.nextEditIdx],p=b?this.translateOldToCur(b.offsetObj):null;return p===null?null:(0,k.lengthDiffNonNegative)(_,p)}translateOldToCur(_){return _.lineCount===this.deltaLineIdxInOld?(0,k.toLength)(_.lineCount+this.deltaOldToNewLineCount,_.columnCount+this.deltaOldToNewColumnCount):(0,k.toLength)(_.lineCount+this.deltaOldToNewLineCount,_.columnCount)}translateCurToOld(_){const b=(0,k.lengthToObj)(_);return b.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?(0,k.toLength)(b.lineCount-this.deltaOldToNewLineCount,b.columnCount-this.deltaOldToNewColumnCount):(0,k.toLength)(b.lineCount-this.deltaOldToNewLineCount,b.columnCount)}adjustNextEdit(_){for(;this.nextEditIdx!0)||[];return o&&a.unshift(o),a}const l=[];for(;o&&!(0,I.lengthIsZero)(c);){const[a,r]=o.splitAt(c);l.push(a),c=(0,I.lengthDiffNonNegative)(a.lengthAfter,c),o=r??p.dequeue()}return(0,I.lengthIsZero)(c)||l.push(new y(!1,c,c)),l}const i=[];function s(c,l,a){if(i.length>0&&(0,I.lengthEquals)(i[i.length-1].endOffset,c)){const r=i[i.length-1];i[i.length-1]=new k.TextEditInfo(r.startOffset,l,(0,I.lengthAdd)(r.newLength,a))}else i.push({startOffset:c,endOffset:l,newLength:a})}let g=I.lengthZero;for(const c of n){const l=t(c.lengthBefore);if(c.modified){const a=(0,I.sumLengths)(l,u=>u.lengthBefore),r=(0,I.lengthAdd)(g,a);s(g,r,c.lengthAfter),g=r}else for(const a of l){const r=g;g=(0,I.lengthAdd)(g,a.lengthBefore),a.modified&&s(r,g,a.lengthAfter)}}return i}class y{constructor(b,p,n){this.modified=b,this.lengthBefore=p,this.lengthAfter=n}splitAt(b){const p=(0,I.lengthDiffNonNegative)(b,this.lengthAfter);return(0,I.lengthEquals)(p,I.lengthZero)?[this,void 0]:this.modified?[new y(this.modified,this.lengthBefore,b),new y(this.modified,I.lengthZero,p)]:[new y(this.modified,b,b),new y(this.modified,p,p)]}toString(){return`${this.modified?"M":"U"}:${(0,I.lengthToObj)(this.lengthBefore)} -> ${(0,I.lengthToObj)(this.lengthAfter)}`}}function m(_){const b=[];let p=I.lengthZero;for(const n of _){const o=(0,I.lengthDiffNonNegative)(p,n.startOffset);(0,I.lengthIsZero)(o)||b.push(new y(!1,o,o));const t=(0,I.lengthDiffNonNegative)(n.startOffset,n.endOffset);b.push(new y(!0,t,n.newLength)),p=n.endOffset}return b}}),define(ne[573],se([1,0,106]),function(oe,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeReader=void 0;class k{constructor(m){this.lastOffset=d.lengthZero,this.nextNodes=[m],this.offsets=[d.lengthZero],this.idxs=[]}readLongestNodeAt(m,_){if((0,d.lengthLessThan)(m,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=m;;){const b=E(this.nextNodes);if(!b)return;const p=E(this.offsets);if((0,d.lengthLessThan)(m,p))return;if((0,d.lengthLessThan)(p,m))if((0,d.lengthAdd)(p,b.length)<=m)this.nextNodeAfterCurrent();else{const n=I(b);n!==-1?(this.nextNodes.push(b.getChild(n)),this.offsets.push(p),this.idxs.push(n)):this.nextNodeAfterCurrent()}else{if(_(b))return this.nextNodeAfterCurrent(),b;{const n=I(b);if(n===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(b.getChild(n)),this.offsets.push(p),this.idxs.push(n)}}}}nextNodeAfterCurrent(){for(;;){const m=E(this.offsets),_=E(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const b=E(this.nextNodes),p=I(b,this.idxs[this.idxs.length-1]);if(p!==-1){this.nextNodes.push(b.getChild(p)),this.offsets.push((0,d.lengthAdd)(m,_.length)),this.idxs[this.idxs.length-1]=p;break}else this.idxs.pop()}}}e.NodeReader=k;function I(y,m=-1){for(;;){if(m++,m>=y.childrenLength)return-1;if(y.getChild(m))return m}}function E(y){return y.length>0?y[y.length-1]:void 0}}),define(ne[149],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DenseKeyProvider=e.identityKeyProvider=e.SmallImmutableSet=void 0;const d=[];class k{static{this.cache=new Array(129)}static create(y,m){if(y<=128&&m.length===0){let _=k.cache[y];return _||(_=new k(y,m),k.cache[y]=_),_}return new k(y,m)}static{this.empty=k.create(0,d)}static getEmpty(){return this.empty}constructor(y,m){this.items=y,this.additionalItems=m}add(y,m){const _=m.getKey(y);let b=_>>5;if(b===0){const n=1<<_|this.items;return n===this.items?this:k.create(n,this.additionalItems)}b--;const p=this.additionalItems.slice(0);for(;p.length=b.length)return null;const s=p,g=b[s].listHeight;for(p++;p=2?I(s===0&&p===b.length?b:b.slice(s,p),!1):b[s]}let o=n(),t=n();if(!t)return o;for(let s=n();s;s=n())E(o,t)<=E(t,s)?(o=y(o,t),t=s):t=y(t,s);return y(o,t)}function I(b,p=!1){if(b.length===0)return null;if(b.length===1)return b[0];let n=b.length;for(;n>3;){const o=n>>1;for(let t=0;t=3?b[2]:null,p)}function E(b,p){return Math.abs(b.listHeight-p.listHeight)}function y(b,p){return b.listHeight===p.listHeight?d.ListAstNode.create23(b,p,null,!1):b.listHeight>p.listHeight?m(b,p):_(p,b)}function m(b,p){b=b.toMutable();let n=b;const o=[];let t;for(;;){if(p.listHeight===n.listHeight){t=p;break}if(n.kind!==4)throw new Error("unexpected");o.push(n),n=n.makeLastElementMutable()}for(let i=o.length-1;i>=0;i--){const s=o[i];t?s.childrenLength>=3?t=d.ListAstNode.create23(s.unappendChild(),t,null,!1):(s.appendChildOfSameHeight(t),t=void 0):s.handleChildrenChanged()}return t?d.ListAstNode.create23(b,t,null,!1):b}function _(b,p){b=b.toMutable();let n=b;const o=[];for(;p.listHeight!==n.listHeight;){if(n.kind!==4)throw new Error("unexpected");o.push(n),n=n.makeFirstElementMutable()}let t=p;for(let i=o.length-1;i>=0;i--){const s=o[i];t?s.childrenLength>=3?t=d.ListAstNode.create23(t,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(t),t=void 0):s.handleChildrenChanged()}return t?d.ListAstNode.create23(t,b,null,!1):b}}),define(ne[320],se([1,0,201,200,149,106,574,573]),function(oe,e,d,k,I,E,y,m){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseDocument=_;function _(p,n,o,t){return new b(p,n,o,t).parseDocument()}class b{constructor(n,o,t,i){if(this.tokenizer=n,this.createImmutableLists=i,this._itemsConstructed=0,this._itemsFromCache=0,t&&i)throw new Error("Not supported");this.oldNodeReader=t?new m.NodeReader(t):void 0,this.positionMapper=new k.BeforeEditPositionMapper(o)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let n=this.parseList(I.SmallImmutableSet.getEmpty(),0);return n||(n=d.ListAstNode.getEmpty()),n}parseList(n,o){const t=[];for(;;){let s=this.tryReadChildFromCache(n);if(!s){const g=this.tokenizer.peek();if(!g||g.kind===2&&g.bracketIds.intersects(n))break;s=this.parseChild(n,o+1)}s.kind===4&&s.childrenLength===0||t.push(s)}return this.oldNodeReader?(0,y.concat23Trees)(t):(0,y.concat23TreesOfSameHeight)(t,this.createImmutableLists)}tryReadChildFromCache(n){if(this.oldNodeReader){const o=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(o===null||!(0,E.lengthIsZero)(o)){const t=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),i=>o!==null&&!(0,E.lengthLessThan)(i.length,o)?!1:i.canBeReused(n));if(t)return this._itemsFromCache++,this.tokenizer.skip(t.length),t}}}parseChild(n,o){this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new d.InvalidBracketAstNode(t.bracketIds,t.length);case 0:return t.astNode;case 1:{if(o>300)return new d.TextAstNode(t.length);const i=n.merge(t.bracketIds),s=this.parseList(i,o+1),g=this.tokenizer.peek();return g&&g.kind===2&&(g.bracketId===t.bracketId||g.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),d.PairAstNode.create(t.astNode,s,g.astNode)):d.PairAstNode.create(t.astNode,s,null)}default:throw new Error("unexpected")}}}}),define(ne[236],se([1,0,8,148,201,106,149]),function(oe,e,d,k,I,E,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FastTokenizer=e.TextBufferTokenizer=e.Token=void 0;class m{constructor(o,t,i,s,g){this.length=o,this.kind=t,this.bracketId=i,this.bracketIds=s,this.astNode=g}}e.Token=m;class _{constructor(o,t){this.textModel=o,this.bracketTokens=t,this.reader=new b(this.textModel,this.bracketTokens),this._offset=E.lengthZero,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=o.getLineCount(),this.textBufferLastLineLength=o.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return(0,E.toLength)(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(o){this.didPeek=!1,this._offset=(0,E.lengthAdd)(this._offset,o);const t=(0,E.lengthToObj)(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let o;return this.peeked?(this.didPeek=!1,o=this.peeked):o=this.reader.read(),o&&(this._offset=(0,E.lengthAdd)(this._offset,o.length)),o}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}e.TextBufferTokenizer=_;class b{constructor(o,t){this.textModel=o,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=o.getLineCount(),this.textBufferLastLineLength=o.getLineLength(this.textBufferLineCount)}setPosition(o,t){o===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=o,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const g=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=(0,E.lengthGetColumnCountIfZeroLineCount)(g.length),g}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const o=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const g=this.lineTokens,c=g.getCount();let l=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=(0,E.lengthDiff)(o,t,this.lineIdx,this.lineCharOffset);return new m(s,0,-1,y.SmallImmutableSet.getEmpty(),new I.TextAstNode(s))}}class p{constructor(o,t){this.text=o,this._offset=E.lengthZero,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`|
+`,"gi"):null,g=[];let c,l=0,a=0,r=0,u=0;const C=[];for(let v=0;v<60;v++)C.push(new m((0,E.toLength)(0,v),0,-1,y.SmallImmutableSet.getEmpty(),new I.TextAstNode((0,E.toLength)(0,v))));const f=[];for(let v=0;v<60;v++)f.push(new m((0,E.toLength)(1,v),0,-1,y.SmallImmutableSet.getEmpty(),new I.TextAstNode((0,E.toLength)(1,v))));if(s)for(s.lastIndex=0;(c=s.exec(o))!==null;){const v=c.index,w=c[0];if(w===`
+`)l++,a=v+1;else{if(r!==v){let S;if(u===l){const L=v-r;if(L_(o)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const n=this.getRegExpStr();this._regExpGlobal=n?new RegExp(n,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(n){return this.map.get(n.toLowerCase())}findClosingTokenText(n){for(const[o,t]of this.map)if(t.kind===2&&t.bracketIds.intersects(n))return o}get isEmpty(){return this.map.size===0}}e.BracketTokens=m;function _(p){let n=(0,d.escapeRegExpCharacters)(p);return/^[\w ]+/.test(p)&&(n=`\\b${n}`),/[\w ]+$/.test(p)&&(n=`${n}\\b`),n}class b{constructor(n,o){this.denseKeyProvider=n,this.getLanguageConfiguration=o,this.languageIdToBracketTokens=new Map}didLanguageChange(n){return this.languageIdToBracketTokens.has(n)}getSingleLanguageBracketTokens(n){let o=this.languageIdToBracketTokens.get(n);return o||(o=m.createFromLanguage(this.getLanguageConfiguration(n),this.denseKeyProvider),this.languageIdToBracketTokens.set(n,o)),o}}e.LanguageAgnosticBracketTokens=b}),define(ne[575],se([1,0,321,106,320,149,236]),function(oe,e,d,k,I,E,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fixBracketsInLine=m;function m(b,p){const n=new E.DenseKeyProvider,o=new d.LanguageAgnosticBracketTokens(n,l=>p.getLanguageConfiguration(l)),t=new y.TextBufferTokenizer(new _([b]),o),i=(0,I.parseDocument)(t,[],void 0,!0);let s="";const g=b.getLineContent();function c(l,a){if(l.kind===2)if(c(l.openingBracket,a),a=(0,k.lengthAdd)(a,l.openingBracket.length),l.child&&(c(l.child,a),a=(0,k.lengthAdd)(a,l.child.length)),l.closingBracket)c(l.closingBracket,a),a=(0,k.lengthAdd)(a,l.closingBracket.length);else{const u=o.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);s+=u}else if(l.kind!==3){if(l.kind===0||l.kind===1)s+=g.substring((0,k.lengthGetColumnCountIfZeroLineCount)(a),(0,k.lengthGetColumnCountIfZeroLineCount)((0,k.lengthAdd)(a,l.length)));else if(l.kind===4)for(const r of l.children)c(r,a),a=(0,k.lengthAdd)(a,r.length)}}return c(i,k.lengthZero),s}class _{constructor(p){this.lines=p,this.tokenization={getLineTokens:n=>this.lines[n-1]}}getLineCount(){return this.lines.length}getLineLength(p){return this.lines[p-1].getLineContent().length}}}),define(ne[576],se([1,0,13]),function(oe,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FixedArray=void 0;class k{constructor(y){this._default=y,this._store=[]}get(y){return y=this._store.length;)this._store[this._store.length]=this._default;this._store[y]=m}replace(y,m,_){if(y>=this._store.length)return;if(m===0){this.insert(y,_);return}else if(_===0){this.delete(y,m);return}const b=this._store.slice(0,y),p=this._store.slice(y+m),n=I(_,this._default);this._store=b.concat(n,p)}delete(y,m){m===0||y>=this._store.length||this._store.splice(y,m)}insert(y,m){if(m===0||y>=this._store.length)return;const _=[];for(let b=0;b0&&o>0||t>0&&i>0)return;const s=Math.abs(o-i),g=Math.abs(n-t);if(s===0){b.spacesDiff=g,g>0&&0<=t-1&&t-10?b++:v>1&&p++,k(n,o,u,h,g),g.looksLikeAlignment&&!(m&&y===g.spacesDiff)))continue;const S=g.spacesDiff;S<=i&&s[S]++,n=u,o=h}let c=m;b!==p&&(c=b{const u=s[r];u>a&&(a=u,l=r)}),l===4&&s[4]>0&&s[2]>0&&s[2]>=s[4]/2&&(l=2)}return{insertSpaces:c,tabSize:l}}}),define(ne[578],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IntervalTree=e.SENTINEL=e.IntervalNode=void 0,e.getNodeColor=d,e.nodeAcceptEdit=l,e.recomputeMaxEnd=P,e.intervalCompare=O;function d(F){return(F.metadata&1)>>>0}function k(F,x){F.metadata=F.metadata&254|x<<0}function I(F){return(F.metadata&2)>>>1===1}function E(F,x){F.metadata=F.metadata&253|(x?1:0)<<1}function y(F){return(F.metadata&4)>>>2===1}function m(F,x){F.metadata=F.metadata&251|(x?1:0)<<2}function _(F){return(F.metadata&64)>>>6===1}function b(F,x){F.metadata=F.metadata&191|(x?1:0)<<6}function p(F){return(F.metadata&24)>>>3}function n(F,x){F.metadata=F.metadata&231|x<<3}function o(F){return(F.metadata&32)>>>5===1}function t(F,x){F.metadata=F.metadata&223|(x?1:0)<<5}class i{constructor(x,W,V){this.metadata=0,this.parent=this,this.left=this,this.right=this,k(this,1),this.start=W,this.end=V,this.delta=0,this.maxEnd=V,this.id=x,this.ownerId=0,this.options=null,m(this,!1),b(this,!1),n(this,1),t(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=W,this.cachedAbsoluteEnd=V,this.range=null,E(this,!1)}reset(x,W,V,q){this.start=W,this.end=V,this.maxEnd=V,this.cachedVersionId=x,this.cachedAbsoluteStart=W,this.cachedAbsoluteEnd=V,this.range=q}setOptions(x){this.options=x;const W=this.options.className;m(this,W==="squiggly-error"||W==="squiggly-warning"||W==="squiggly-info"),b(this,this.options.glyphMarginClassName!==null),n(this,this.options.stickiness),t(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(x,W,V){this.cachedVersionId!==V&&(this.range=null),this.cachedVersionId=V,this.cachedAbsoluteStart=x,this.cachedAbsoluteEnd=W}detach(){this.parent=null,this.left=null,this.right=null}}e.IntervalNode=i,e.SENTINEL=new i(null,0,0),e.SENTINEL.parent=e.SENTINEL,e.SENTINEL.left=e.SENTINEL,e.SENTINEL.right=e.SENTINEL,k(e.SENTINEL,0);class s{constructor(){this.root=e.SENTINEL,this.requestNormalizeDelta=!1}intervalSearch(x,W,V,q,H,z){return this.root===e.SENTINEL?[]:h(this,x,W,V,q,H,z)}search(x,W,V,q){return this.root===e.SENTINEL?[]:f(this,x,W,V,q)}collectNodesFromOwner(x){return u(this,x)}collectNodesPostOrder(){return C(this)}insert(x){v(this,x),this._normalizeDeltaIfNecessary()}delete(x){S(this,x),this._normalizeDeltaIfNecessary()}resolveNode(x,W){const V=x;let q=0;for(;x!==this.root;)x===x.parent.right&&(q+=x.parent.delta),x=x.parent;const H=V.start+q,z=V.end+q;V.setCachedOffsets(H,z,W)}acceptReplace(x,W,V,q){const H=a(this,x,x+W);for(let z=0,U=H.length;zW||V===1?!1:V===2?!0:x}function l(F,x,W,V,q){const H=p(F),z=H===0||H===2,U=H===1||H===2,j=W-x,Y=V,G=Math.min(j,Y),K=F.start;let R=!1;const J=F.end;let ie=!1;x<=K&&J<=W&&o(F)&&(F.start=x,R=!0,F.end=x,ie=!0);{const he=q?1:j>0?2:0;!R&&c(K,z,x,he)&&(R=!0),!ie&&c(J,U,x,he)&&(ie=!0)}if(G>0&&!q){const he=j>Y?2:0;!R&&c(K,z,x+G,he)&&(R=!0),!ie&&c(J,U,x+G,he)&&(ie=!0)}{const he=q?1:0;!R&&c(K,z,W,he)&&(F.start=x+Y,R=!0),!ie&&c(J,U,W,he)&&(F.end=x+Y,ie=!0)}const ue=Y-j;R||(F.start=Math.max(0,K+ue)),ie||(F.end=Math.max(0,J+ue)),F.start>F.end&&(F.end=F.start)}function a(F,x,W){let V=F.root,q=0,H=0,z=0,U=0;const j=[];let Y=0;for(;V!==e.SENTINEL;){if(I(V)){E(V.left,!1),E(V.right,!1),V===V.parent.right&&(q-=V.parent.delta),V=V.parent;continue}if(!I(V.left)){if(H=q+V.maxEnd,HW){E(V,!0);continue}if(U=q+V.end,U>=x&&(V.setCachedOffsets(z,U,0),j[Y++]=V),E(V,!0),V.right!==e.SENTINEL&&!I(V.right)){q+=V.delta,V=V.right;continue}}return E(F.root,!1),j}function r(F,x,W,V){let q=F.root,H=0,z=0,U=0;const j=V-(W-x);for(;q!==e.SENTINEL;){if(I(q)){E(q.left,!1),E(q.right,!1),q===q.parent.right&&(H-=q.parent.delta),P(q),q=q.parent;continue}if(!I(q.left)){if(z=H+q.maxEnd,zW){q.start+=j,q.end+=j,q.delta+=j,(q.delta<-1073741824||q.delta>1073741824)&&(F.requestNormalizeDelta=!0),E(q,!0);continue}if(E(q,!0),q.right!==e.SENTINEL&&!I(q.right)){H+=q.delta,q=q.right;continue}}E(F.root,!1)}function u(F,x){let W=F.root;const V=[];let q=0;for(;W!==e.SENTINEL;){if(I(W)){E(W.left,!1),E(W.right,!1),W=W.parent;continue}if(W.left!==e.SENTINEL&&!I(W.left)){W=W.left;continue}if(W.ownerId===x&&(V[q++]=W),E(W,!0),W.right!==e.SENTINEL&&!I(W.right)){W=W.right;continue}}return E(F.root,!1),V}function C(F){let x=F.root;const W=[];let V=0;for(;x!==e.SENTINEL;){if(I(x)){E(x.left,!1),E(x.right,!1),x=x.parent;continue}if(x.left!==e.SENTINEL&&!I(x.left)){x=x.left;continue}if(x.right!==e.SENTINEL&&!I(x.right)){x=x.right;continue}W[V++]=x,E(x,!0)}return E(F.root,!1),W}function f(F,x,W,V,q){let H=F.root,z=0,U=0,j=0;const Y=[];let G=0;for(;H!==e.SENTINEL;){if(I(H)){E(H.left,!1),E(H.right,!1),H===H.parent.right&&(z-=H.parent.delta),H=H.parent;continue}if(H.left!==e.SENTINEL&&!I(H.left)){H=H.left;continue}U=z+H.start,j=z+H.end,H.setCachedOffsets(U,j,V);let K=!0;if(x&&H.ownerId&&H.ownerId!==x&&(K=!1),W&&y(H)&&(K=!1),q&&!_(H)&&(K=!1),K&&(Y[G++]=H),E(H,!0),H.right!==e.SENTINEL&&!I(H.right)){z+=H.delta,H=H.right;continue}}return E(F.root,!1),Y}function h(F,x,W,V,q,H,z){let U=F.root,j=0,Y=0,G=0,K=0;const R=[];let J=0;for(;U!==e.SENTINEL;){if(I(U)){E(U.left,!1),E(U.right,!1),U===U.parent.right&&(j-=U.parent.delta),U=U.parent;continue}if(!I(U.left)){if(Y=j+U.maxEnd,YW){E(U,!0);continue}if(K=j+U.end,K>=x){U.setCachedOffsets(G,K,H);let ie=!0;V&&U.ownerId&&U.ownerId!==V&&(ie=!1),q&&y(U)&&(ie=!1),z&&!_(U)&&(ie=!1),ie&&(R[J++]=U)}if(E(U,!0),U.right!==e.SENTINEL&&!I(U.right)){j+=U.delta,U=U.right;continue}}return E(F.root,!1),R}function v(F,x){if(F.root===e.SENTINEL)return x.parent=e.SENTINEL,x.left=e.SENTINEL,x.right=e.SENTINEL,k(x,0),F.root=x,F.root;w(F,x),N(x.parent);let W=x;for(;W!==F.root&&d(W.parent)===1;)if(W.parent===W.parent.parent.left){const V=W.parent.parent.right;d(V)===1?(k(W.parent,0),k(V,0),k(W.parent.parent,1),W=W.parent.parent):(W===W.parent.right&&(W=W.parent,T(F,W)),k(W.parent,0),k(W.parent.parent,1),M(F,W.parent.parent))}else{const V=W.parent.parent.left;d(V)===1?(k(W.parent,0),k(V,0),k(W.parent.parent,1),W=W.parent.parent):(W===W.parent.left&&(W=W.parent,M(F,W)),k(W.parent,0),k(W.parent.parent,1),T(F,W.parent.parent))}return k(F.root,0),x}function w(F,x){let W=0,V=F.root;const q=x.start,H=x.end;for(;;)if(O(q,H,V.start+W,V.end+W)<0)if(V.left===e.SENTINEL){x.start-=W,x.end-=W,x.maxEnd-=W,V.left=x;break}else V=V.left;else if(V.right===e.SENTINEL){x.start-=W+V.delta,x.end-=W+V.delta,x.maxEnd-=W+V.delta,V.right=x;break}else W+=V.delta,V=V.right;x.parent=V,x.left=e.SENTINEL,x.right=e.SENTINEL,k(x,1)}function S(F,x){let W,V;if(x.left===e.SENTINEL?(W=x.right,V=x,W.delta+=x.delta,(W.delta<-1073741824||W.delta>1073741824)&&(F.requestNormalizeDelta=!0),W.start+=x.delta,W.end+=x.delta):x.right===e.SENTINEL?(W=x.left,V=x):(V=L(x.right),W=V.right,W.start+=V.delta,W.end+=V.delta,W.delta+=V.delta,(W.delta<-1073741824||W.delta>1073741824)&&(F.requestNormalizeDelta=!0),V.start+=x.delta,V.end+=x.delta,V.delta=x.delta,(V.delta<-1073741824||V.delta>1073741824)&&(F.requestNormalizeDelta=!0)),V===F.root){F.root=W,k(W,0),x.detach(),D(),P(W),F.root.parent=e.SENTINEL;return}const q=d(V)===1;if(V===V.parent.left?V.parent.left=W:V.parent.right=W,V===x?W.parent=V.parent:(V.parent===x?W.parent=V:W.parent=V.parent,V.left=x.left,V.right=x.right,V.parent=x.parent,k(V,d(x)),x===F.root?F.root=V:x===x.parent.left?x.parent.left=V:x.parent.right=V,V.left!==e.SENTINEL&&(V.left.parent=V),V.right!==e.SENTINEL&&(V.right.parent=V)),x.detach(),q){N(W.parent),V!==x&&(N(V),N(V.parent)),D();return}N(W),N(W.parent),V!==x&&(N(V),N(V.parent));let H;for(;W!==F.root&&d(W)===0;)W===W.parent.left?(H=W.parent.right,d(H)===1&&(k(H,0),k(W.parent,1),T(F,W.parent),H=W.parent.right),d(H.left)===0&&d(H.right)===0?(k(H,1),W=W.parent):(d(H.right)===0&&(k(H.left,0),k(H,1),M(F,H),H=W.parent.right),k(H,d(W.parent)),k(W.parent,0),k(H.right,0),T(F,W.parent),W=F.root)):(H=W.parent.left,d(H)===1&&(k(H,0),k(W.parent,1),M(F,W.parent),H=W.parent.left),d(H.left)===0&&d(H.right)===0?(k(H,1),W=W.parent):(d(H.left)===0&&(k(H.right,0),k(H,1),T(F,H),H=W.parent.left),k(H,d(W.parent)),k(W.parent,0),k(H.left,0),M(F,W.parent),W=F.root));k(W,0),D()}function L(F){for(;F.left!==e.SENTINEL;)F=F.left;return F}function D(){e.SENTINEL.parent=e.SENTINEL,e.SENTINEL.delta=0,e.SENTINEL.start=0,e.SENTINEL.end=0}function T(F,x){const W=x.right;W.delta+=x.delta,(W.delta<-1073741824||W.delta>1073741824)&&(F.requestNormalizeDelta=!0),W.start+=x.delta,W.end+=x.delta,x.right=W.left,W.left!==e.SENTINEL&&(W.left.parent=x),W.parent=x.parent,x.parent===e.SENTINEL?F.root=W:x===x.parent.left?x.parent.left=W:x.parent.right=W,W.left=x,x.parent=W,P(x),P(W)}function M(F,x){const W=x.left;x.delta-=W.delta,(x.delta<-1073741824||x.delta>1073741824)&&(F.requestNormalizeDelta=!0),x.start-=W.delta,x.end-=W.delta,x.left=W.right,W.right!==e.SENTINEL&&(W.right.parent=x),W.parent=x.parent,x.parent===e.SENTINEL?F.root=W:x===x.parent.right?x.parent.right=W:x.parent.left=W,W.right=x,x.parent=W,P(x),P(W)}function A(F){let x=F.end;if(F.left!==e.SENTINEL){const W=F.left.maxEnd;W>x&&(x=W)}if(F.right!==e.SENTINEL){const W=F.right.maxEnd+F.delta;W>x&&(x=W)}return x}function P(F){F.maxEnd=A(F)}function N(F){for(;F!==e.SENTINEL;){const x=A(F);if(F.maxEnd===x)return;F.maxEnd=x,F=F.parent}}function O(F,x,W,V){return F===W?x-V:F-W}}),define(ne[579],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SENTINEL=e.TreeNode=void 0,e.leftest=k,e.righttest=I,e.leftRotate=_,e.rightRotate=b,e.rbDelete=p,e.fixInsert=n,e.updateTreeMetadata=o,e.recomputeTreeMetadata=t;class d{constructor(s,g){this.piece=s,this.color=g,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==e.SENTINEL)return k(this.right);let s=this;for(;s.parent!==e.SENTINEL&&s.parent.left!==s;)s=s.parent;return s.parent===e.SENTINEL?e.SENTINEL:s.parent}prev(){if(this.left!==e.SENTINEL)return I(this.left);let s=this;for(;s.parent!==e.SENTINEL&&s.parent.right!==s;)s=s.parent;return s.parent===e.SENTINEL?e.SENTINEL:s.parent}detach(){this.parent=null,this.left=null,this.right=null}}e.TreeNode=d,e.SENTINEL=new d(null,0),e.SENTINEL.parent=e.SENTINEL,e.SENTINEL.left=e.SENTINEL,e.SENTINEL.right=e.SENTINEL,e.SENTINEL.color=0;function k(i){for(;i.left!==e.SENTINEL;)i=i.left;return i}function I(i){for(;i.right!==e.SENTINEL;)i=i.right;return i}function E(i){return i===e.SENTINEL?0:i.size_left+i.piece.length+E(i.right)}function y(i){return i===e.SENTINEL?0:i.lf_left+i.piece.lineFeedCnt+y(i.right)}function m(){e.SENTINEL.parent=e.SENTINEL}function _(i,s){const g=s.right;g.size_left+=s.size_left+(s.piece?s.piece.length:0),g.lf_left+=s.lf_left+(s.piece?s.piece.lineFeedCnt:0),s.right=g.left,g.left!==e.SENTINEL&&(g.left.parent=s),g.parent=s.parent,s.parent===e.SENTINEL?i.root=g:s.parent.left===s?s.parent.left=g:s.parent.right=g,g.left=s,s.parent=g}function b(i,s){const g=s.left;s.left=g.right,g.right!==e.SENTINEL&&(g.right.parent=s),g.parent=s.parent,s.size_left-=g.size_left+(g.piece?g.piece.length:0),s.lf_left-=g.lf_left+(g.piece?g.piece.lineFeedCnt:0),s.parent===e.SENTINEL?i.root=g:s===s.parent.right?s.parent.right=g:s.parent.left=g,g.right=s,s.parent=g}function p(i,s){let g,c;if(s.left===e.SENTINEL?(c=s,g=c.right):s.right===e.SENTINEL?(c=s,g=c.left):(c=k(s.right),g=c.right),c===i.root){i.root=g,g.color=0,s.detach(),m(),i.root.parent=e.SENTINEL;return}const l=c.color===1;if(c===c.parent.left?c.parent.left=g:c.parent.right=g,c===s?(g.parent=c.parent,t(i,g)):(c.parent===s?g.parent=c:g.parent=c.parent,t(i,g),c.left=s.left,c.right=s.right,c.parent=s.parent,c.color=s.color,s===i.root?i.root=c:s===s.parent.left?s.parent.left=c:s.parent.right=c,c.left!==e.SENTINEL&&(c.left.parent=c),c.right!==e.SENTINEL&&(c.right.parent=c),c.size_left=s.size_left,c.lf_left=s.lf_left,t(i,c)),s.detach(),g.parent.left===g){const r=E(g),u=y(g);if(r!==g.parent.size_left||u!==g.parent.lf_left){const C=r-g.parent.size_left,f=u-g.parent.lf_left;g.parent.size_left=r,g.parent.lf_left=u,o(i,g.parent,C,f)}}if(t(i,g.parent),l){m();return}let a;for(;g!==i.root&&g.color===0;)g===g.parent.left?(a=g.parent.right,a.color===1&&(a.color=0,g.parent.color=1,_(i,g.parent),a=g.parent.right),a.left.color===0&&a.right.color===0?(a.color=1,g=g.parent):(a.right.color===0&&(a.left.color=0,a.color=1,b(i,a),a=g.parent.right),a.color=g.parent.color,g.parent.color=0,a.right.color=0,_(i,g.parent),g=i.root)):(a=g.parent.left,a.color===1&&(a.color=0,g.parent.color=1,b(i,g.parent),a=g.parent.left),a.left.color===0&&a.right.color===0?(a.color=1,g=g.parent):(a.left.color===0&&(a.right.color=0,a.color=1,_(i,a),a=g.parent.left),a.color=g.parent.color,g.parent.color=0,a.left.color=0,b(i,g.parent),g=i.root));g.color=0,m()}function n(i,s){for(t(i,s);s!==i.root&&s.parent.color===1;)if(s.parent===s.parent.parent.left){const g=s.parent.parent.right;g.color===1?(s.parent.color=0,g.color=0,s.parent.parent.color=1,s=s.parent.parent):(s===s.parent.right&&(s=s.parent,_(i,s)),s.parent.color=0,s.parent.parent.color=1,b(i,s.parent.parent))}else{const g=s.parent.parent.left;g.color===1?(s.parent.color=0,g.color=0,s.parent.parent.color=1,s=s.parent.parent):(s===s.parent.left&&(s=s.parent,b(i,s)),s.parent.color=0,s.parent.parent.color=1,_(i,s.parent.parent))}i.root.color=0}function o(i,s,g,c){for(;s!==i.root&&s!==e.SENTINEL;)s.parent.left===s&&(s.parent.size_left+=g,s.parent.lf_left+=c),s=s.parent}function t(i,s){let g=0,c=0;if(s!==i.root){for(;s!==i.root&&s===s.parent.right;)s=s.parent;if(s!==i.root)for(s=s.parent,g=E(s.left)-s.size_left,c=y(s.left)-s.lf_left,s.size_left+=g,s.lf_left+=c;s!==i.root&&(g!==0||c!==0);)s.parent.left===s&&(s.parent.size_left+=g,s.parent.lf_left+=c),s=s.parent}}}),define(ne[322],se([1,0,13,192]),function(oe,e,d,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrefixSumIndexOfResult=e.ConstantTimePrefixSumComputer=e.PrefixSumComputer=void 0;class I{constructor(_){this.values=_,this.prefixSum=new Uint32Array(_.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(_,b){_=(0,k.toUint32)(_);const p=this.values,n=this.prefixSum,o=b.length;return o===0?!1:(this.values=new Uint32Array(p.length+o),this.values.set(p.subarray(0,_),0),this.values.set(p.subarray(_),_+o),this.values.set(b,_),_-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(_,b){return _=(0,k.toUint32)(_),b=(0,k.toUint32)(b),this.values[_]===b?!1:(this.values[_]=b,_-1=p.length)return!1;const o=p.length-_;return b>=o&&(b=o),b===0?!1:(this.values=new Uint32Array(p.length-b),this.values.set(p.subarray(0,_),0),this.values.set(p.subarray(_+b),_),this.prefixSum=new Uint32Array(this.values.length),_-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(_){return _<0?0:(_=(0,k.toUint32)(_),this._getPrefixSum(_))}_getPrefixSum(_){if(_<=this.prefixSumValidIndex[0])return this.prefixSum[_];let b=this.prefixSumValidIndex[0]+1;b===0&&(this.prefixSum[0]=this.values[0],b++),_>=this.values.length&&(_=this.values.length-1);for(let p=b;p<=_;p++)this.prefixSum[p]=this.prefixSum[p-1]+this.values[p];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],_),this.prefixSum[_]}getIndexOf(_){_=Math.floor(_),this.getTotalSum();let b=0,p=this.values.length-1,n=0,o=0,t=0;for(;b<=p;)if(n=b+(p-b)/2|0,o=this.prefixSum[n],t=o-this.values[n],_=o)b=n+1;else break;return new y(n,_-t)}}e.PrefixSumComputer=I;class E{constructor(_){this._values=_,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(_){return this._ensureValid(),_===0?0:this._prefixSum[_-1]}getIndexOf(_){this._ensureValid();const b=this._indexBySum[_],p=b>0?this._prefixSum[b-1]:0;return new y(b,_-p)}removeValues(_,b){this._values.splice(_,b),this._invalidate(_)}insertValues(_,b){this._values=(0,d.arrayInsert)(this._values,_,b),this._invalidate(_)}_invalidate(_){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,_-1)}_ensureValid(){if(!this._isValid){for(let _=this._validEndIndex+1,b=this._values.length;_0?this._prefixSum[_-1]:0;this._prefixSum[_]=n+p;for(let o=0;o=0;let a=null;try{a=d.createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:l,global:!0,unicode:!0})}catch{return null}if(!a)return null;let r=!this.isRegex&&!l;return r&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(r=this.matchCase),new y.SearchData(a,this.wordSeparators?(0,k.getMapForWordSeparators)(this.wordSeparators,[]):null,r?this.searchString:null)}}e.SearchParams=_;function b(c){if(!c||c.length===0)return!1;for(let l=0,a=c.length;l=a)break;const u=c.charCodeAt(l);if(u===110||u===114||u===87)return!0}}return!1}function p(c,l,a){if(!a)return new y.FindMatch(c,null);const r=[];for(let u=0,C=l.length;u>0);a[C]>=l?u=C-1:a[C+1]>=l?(r=C,u=C):r=C+1}return r+1}}class o{static findMatches(l,a,r,u,C){const f=a.parseSearchRequest();return f?f.regex.multiline?this._doFindMatchesMultiline(l,r,new g(f.wordSeparators,f.regex),u,C):this._doFindMatchesLineByLine(l,r,f,u,C):[]}static _getMultilineMatchRange(l,a,r,u,C,f){let h,v=0;u?(v=u.findLineFeedCountBeforeOffset(C),h=a+C+v):h=a+C;let w;if(u){const T=u.findLineFeedCountBeforeOffset(C+f.length)-v;w=h+f.length+T}else w=h+f.length;const S=l.getPositionAt(h),L=l.getPositionAt(w);return new E.Range(S.lineNumber,S.column,L.lineNumber,L.column)}static _doFindMatchesMultiline(l,a,r,u,C){const f=l.getOffsetAt(a.getStartPosition()),h=l.getValueInRange(a,1),v=l.getEOL()===`\r
+`?new n(h):null,w=[];let S=0,L;for(r.reset(0);L=r.next(h);)if(w[S++]=p(this._getMultilineMatchRange(l,f,h,v,L.index,L[0]),L,u),S>=C)return w;return w}static _doFindMatchesLineByLine(l,a,r,u,C){const f=[];let h=0;if(a.startLineNumber===a.endLineNumber){const w=l.getLineContent(a.startLineNumber).substring(a.startColumn-1,a.endColumn-1);return h=this._findMatchesInLine(r,w,a.startLineNumber,a.startColumn-1,h,f,u,C),f}const v=l.getLineContent(a.startLineNumber).substring(a.startColumn-1);h=this._findMatchesInLine(r,v,a.startLineNumber,a.startColumn-1,h,f,u,C);for(let w=a.startLineNumber+1;w=v))return C;return C}const S=new g(l.wordSeparators,l.regex);let L;S.reset(0);do if(L=S.next(a),L&&(f[C++]=p(new E.Range(r,L.index+1+u,r,L.index+1+L[0].length+u),L,h),C>=v))return C;while(L);return C}static findNextMatch(l,a,r,u){const C=a.parseSearchRequest();if(!C)return null;const f=new g(C.wordSeparators,C.regex);return C.regex.multiline?this._doFindNextMatchMultiline(l,r,f,u):this._doFindNextMatchLineByLine(l,r,f,u)}static _doFindNextMatchMultiline(l,a,r,u){const C=new I.Position(a.lineNumber,1),f=l.getOffsetAt(C),h=l.getLineCount(),v=l.getValueInRange(new E.Range(C.lineNumber,C.column,h,l.getLineMaxColumn(h)),1),w=l.getEOL()===`\r
+`?new n(v):null;r.reset(a.column-1);const S=r.next(v);return S?p(this._getMultilineMatchRange(l,f,v,w,S.index,S[0]),S,u):a.lineNumber!==1||a.column!==1?this._doFindNextMatchMultiline(l,new I.Position(1,1),r,u):null}static _doFindNextMatchLineByLine(l,a,r,u){const C=l.getLineCount(),f=a.lineNumber,h=l.getLineContent(f),v=this._findFirstMatchInLine(r,h,f,a.column,u);if(v)return v;for(let w=1;w<=C;w++){const S=(f+w-1)%C,L=l.getLineContent(S+1),D=this._findFirstMatchInLine(r,L,S+1,1,u);if(D)return D}return null}static _findFirstMatchInLine(l,a,r,u,C){l.reset(u-1);const f=l.next(a);return f?p(new E.Range(r,f.index+1,r,f.index+1+f[0].length),f,C):null}static findPreviousMatch(l,a,r,u){const C=a.parseSearchRequest();if(!C)return null;const f=new g(C.wordSeparators,C.regex);return C.regex.multiline?this._doFindPreviousMatchMultiline(l,r,f,u):this._doFindPreviousMatchLineByLine(l,r,f,u)}static _doFindPreviousMatchMultiline(l,a,r,u){const C=this._doFindMatchesMultiline(l,new E.Range(1,1,a.lineNumber,a.column),r,u,10*m);if(C.length>0)return C[C.length-1];const f=l.getLineCount();return a.lineNumber!==f||a.column!==l.getLineMaxColumn(f)?this._doFindPreviousMatchMultiline(l,new I.Position(f,l.getLineMaxColumn(f)),r,u):null}static _doFindPreviousMatchLineByLine(l,a,r,u){const C=l.getLineCount(),f=a.lineNumber,h=l.getLineContent(f).substring(0,a.column-1),v=this._findLastMatchInLine(r,h,f,u);if(v)return v;for(let w=1;w<=C;w++){const S=(C+f-w-1)%C,L=l.getLineContent(S+1),D=this._findLastMatchInLine(r,L,S+1,u);if(D)return D}return null}static _findLastMatchInLine(l,a,r,u){let C=null,f;for(l.reset(0);f=l.next(a);)C=p(new E.Range(r,f.index+1,r,f.index+1+f[0].length),f,u);return C}}e.TextModelSearch=o;function t(c,l,a,r,u){if(r===0)return!0;const C=l.charCodeAt(r-1);if(c.get(C)!==0||C===13||C===10)return!0;if(u>0){const f=l.charCodeAt(r);if(c.get(f)!==0)return!0}return!1}function i(c,l,a,r,u){if(r+u===a)return!0;const C=l.charCodeAt(r+u);if(c.get(C)!==0||C===13||C===10)return!0;if(u>0){const f=l.charCodeAt(r+u-1);if(c.get(f)!==0)return!0}return!1}function s(c,l,a,r,u){return t(c,l,a,r,u)&&i(c,l,a,r,u)}class g{constructor(l,a){this._wordSeparators=l,this._searchRegex=a,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(l){this._searchRegex.lastIndex=l,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(l){const a=l.length;let r;do{if(this._prevMatchStartIndex+this._prevMatchLength===a||(r=this._searchRegex.exec(l),!r))return null;const u=r.index,C=r[0].length;if(u===this._prevMatchStartIndex&&C===this._prevMatchLength){if(C===0){d.getNextCodePoint(l,a,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=u,this._prevMatchLength=C,!this._wordSeparators||s(this._wordSeparators,l,a,u,C))return r}while(r);return null}}e.Searcher=g}),define(ne[324],se([1,0,9,4,40,579,202]),function(oe,e,d,k,I,E,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PieceTreeBase=e.StringBuffer=e.Piece=void 0,e.createLineStartsFast=p,e.createLineStarts=n;const m=65535;function _(c){let l;return c[c.length-1]<65536?l=new Uint16Array(c.length):l=new Uint32Array(c.length),l.set(c,0),l}class b{constructor(l,a,r,u,C){this.lineStarts=l,this.cr=a,this.lf=r,this.crlf=u,this.isBasicASCII=C}}function p(c,l=!0){const a=[0];let r=1;for(let u=0,C=c.length;u126)&&(f=!1)}const h=new b(_(c),r,u,C,f);return c.length=0,h}class o{constructor(l,a,r,u,C){this.bufferIndex=l,this.start=a,this.end=r,this.lineFeedCnt=u,this.length=C}}e.Piece=o;class t{constructor(l,a){this.buffer=l,this.lineStarts=a}}e.StringBuffer=t;class i{constructor(l,a){this._pieces=[],this._tree=l,this._BOM=a,this._index=0,l.root!==E.SENTINEL&&l.iterate(l.root,r=>(r!==E.SENTINEL&&this._pieces.push(r.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class s{constructor(l){this._limit=l,this._cache=[]}get(l){for(let a=this._cache.length-1;a>=0;a--){const r=this._cache[a];if(r.nodeStartOffset<=l&&r.nodeStartOffset+r.node.piece.length>=l)return r}return null}get2(l){for(let a=this._cache.length-1;a>=0;a--){const r=this._cache[a];if(r.nodeStartLineNumber&&r.nodeStartLineNumber=l)return r}return null}set(l){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(l)}validate(l){let a=!1;const r=this._cache;for(let u=0;u=l){r[u]=null,a=!0;continue}}if(a){const u=[];for(const C of r)C!==null&&u.push(C);this._cache=u}}}class g{constructor(l,a,r){this.create(l,a,r)}create(l,a,r){this._buffers=[new t("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=E.SENTINEL,this._lineCnt=1,this._length=0,this._EOL=a,this._EOLLength=a.length,this._EOLNormalized=r;let u=null;for(let C=0,f=l.length;C0){l[C].lineStarts||(l[C].lineStarts=p(l[C].buffer));const h=new o(C+1,{line:0,column:0},{line:l[C].lineStarts.length-1,column:l[C].buffer.length-l[C].lineStarts[l[C].lineStarts.length-1]},l[C].lineStarts.length-1,l[C].buffer.length);this._buffers.push(l[C]),u=this.rbInsertRight(u,h)}this._searchCache=new s(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(l){const a=m,r=a-Math.floor(a/3),u=r*2;let C="",f=0;const h=[];if(this.iterate(this.root,v=>{const w=this.getNodeContent(v),S=w.length;if(f<=r||f+S0){const v=C.replace(/\r\n|\r|\n/g,l);h.push(new t(v,p(v)))}this.create(h,l,!0)}getEOL(){return this._EOL}setEOL(l){this._EOL=l,this._EOLLength=this._EOL.length,this.normalizeEOL(l)}createSnapshot(l){return new i(this,l)}getOffsetAt(l,a){let r=0,u=this.root;for(;u!==E.SENTINEL;)if(u.left!==E.SENTINEL&&u.lf_left+1>=l)u=u.left;else if(u.lf_left+u.piece.lineFeedCnt+1>=l){r+=u.size_left;const C=this.getAccumulatedValue(u,l-u.lf_left-2);return r+=C+a-1}else l-=u.lf_left+u.piece.lineFeedCnt,r+=u.size_left+u.piece.length,u=u.right;return r}getPositionAt(l){l=Math.floor(l),l=Math.max(0,l);let a=this.root,r=0;const u=l;for(;a!==E.SENTINEL;)if(a.size_left!==0&&a.size_left>=l)a=a.left;else if(a.size_left+a.piece.length>=l){const C=this.getIndexOf(a,l-a.size_left);if(r+=a.lf_left+C.index,C.index===0){const f=this.getOffsetAt(r+1,1),h=u-f;return new d.Position(r+1,h+1)}return new d.Position(r+1,C.remainder+1)}else if(l-=a.size_left+a.piece.length,r+=a.lf_left+a.piece.lineFeedCnt,a.right===E.SENTINEL){const C=this.getOffsetAt(r+1,1),f=u-l-C;return new d.Position(r+1,f+1)}else a=a.right;return new d.Position(1,1)}getValueInRange(l,a){if(l.startLineNumber===l.endLineNumber&&l.startColumn===l.endColumn)return"";const r=this.nodeAt2(l.startLineNumber,l.startColumn),u=this.nodeAt2(l.endLineNumber,l.endColumn),C=this.getValueInRange2(r,u);return a?a!==this._EOL||!this._EOLNormalized?C.replace(/\r\n|\r|\n/g,a):a===this.getEOL()&&this._EOLNormalized?C:C.replace(/\r\n|\r|\n/g,a):C}getValueInRange2(l,a){if(l.node===a.node){const h=l.node,v=this._buffers[h.piece.bufferIndex].buffer,w=this.offsetInBuffer(h.piece.bufferIndex,h.piece.start);return v.substring(w+l.remainder,w+a.remainder)}let r=l.node;const u=this._buffers[r.piece.bufferIndex].buffer,C=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);let f=u.substring(C+l.remainder,C+r.piece.length);for(r=r.next();r!==E.SENTINEL;){const h=this._buffers[r.piece.bufferIndex].buffer,v=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(r===a.node){f+=h.substring(v,v+a.remainder);break}else f+=h.substr(v,r.piece.length);r=r.next()}return f}getLinesContent(){const l=[];let a=0,r="",u=!1;return this.iterate(this.root,C=>{if(C===E.SENTINEL)return!0;const f=C.piece;let h=f.length;if(h===0)return!0;const v=this._buffers[f.bufferIndex].buffer,w=this._buffers[f.bufferIndex].lineStarts,S=f.start.line,L=f.end.line;let D=w[S]+f.start.column;if(u&&(v.charCodeAt(D)===10&&(D++,h--),l[a++]=r,r="",u=!1,h===0))return!0;if(S===L)return!this._EOLNormalized&&v.charCodeAt(D+h-1)===13?(u=!0,r+=v.substr(D,h-1)):r+=v.substr(D,h),!0;r+=this._EOLNormalized?v.substring(D,Math.max(D,w[S+1]-this._EOLLength)):v.substring(D,w[S+1]).replace(/(\r\n|\r|\n)$/,""),l[a++]=r;for(let T=S+1;Tx+M,a.reset(0)):(O=D.buffer,F=x=>x,a.reset(M));do if(P=a.next(O),P){if(F(P.index)>=A)return S;this.positionInBuffer(l,F(P.index)-T,N);const x=this.getLineFeedCnt(l.piece.bufferIndex,C,N),W=N.line===C.line?N.column-C.column+u:N.column+1,V=W+P[0].length;if(L[S++]=(0,y.createFindMatch)(new k.Range(r+x,W,r+x,V),P,v),F(P.index)+P[0].length>=A||S>=w)return S}while(P);return S}findMatchesLineByLine(l,a,r,u){const C=[];let f=0;const h=new y.Searcher(a.wordSeparators,a.regex);let v=this.nodeAt2(l.startLineNumber,l.startColumn);if(v===null)return[];const w=this.nodeAt2(l.endLineNumber,l.endColumn);if(w===null)return[];let S=this.positionInBuffer(v.node,v.remainder);const L=this.positionInBuffer(w.node,w.remainder);if(v.node===w.node)return this.findMatchesInNode(v.node,h,l.startLineNumber,l.startColumn,S,L,a,r,u,f,C),C;let D=l.startLineNumber,T=v.node;for(;T!==w.node;){const A=this.getLineFeedCnt(T.piece.bufferIndex,S,T.piece.end);if(A>=1){const N=this._buffers[T.piece.bufferIndex].lineStarts,O=this.offsetInBuffer(T.piece.bufferIndex,T.piece.start),F=N[S.line+A],x=D===l.startLineNumber?l.startColumn:1;if(f=this.findMatchesInNode(T,h,D,x,S,this.positionInBuffer(T,F-O),a,r,u,f,C),f>=u)return C;D+=A}const P=D===l.startLineNumber?l.startColumn-1:0;if(D===l.endLineNumber){const N=this.getLineContent(D).substring(P,l.endColumn-1);return f=this._findMatchesInLine(a,h,N,l.endLineNumber,P,f,C,r,u),C}if(f=this._findMatchesInLine(a,h,this.getLineContent(D).substr(P),D,P,f,C,r,u),f>=u)return C;D++,v=this.nodeAt2(D,1),T=v.node,S=this.positionInBuffer(v.node,v.remainder)}if(D===l.endLineNumber){const A=D===l.startLineNumber?l.startColumn-1:0,P=this.getLineContent(D).substring(A,l.endColumn-1);return f=this._findMatchesInLine(a,h,P,l.endLineNumber,A,f,C,r,u),C}const M=D===l.startLineNumber?l.startColumn:1;return f=this.findMatchesInNode(w.node,h,D,M,S,L,a,r,u,f,C),C}_findMatchesInLine(l,a,r,u,C,f,h,v,w){const S=l.wordSeparators;if(!v&&l.simpleSearch){const D=l.simpleSearch,T=D.length,M=r.length;let A=-T;for(;(A=r.indexOf(D,A+T))!==-1;)if((!S||(0,y.isValidMatch)(S,r,M,A,T))&&(h[f++]=new I.FindMatch(new k.Range(u,A+1+C,u,A+1+T+C),null),f>=w))return f;return f}let L;a.reset(0);do if(L=a.next(r),L&&(h[f++]=(0,y.createFindMatch)(new k.Range(u,L.index+1+C,u,L.index+1+L[0].length+C),L,v),f>=w))return f;while(L);return f}insert(l,a,r=!1){if(this._EOLNormalized=this._EOLNormalized&&r,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==E.SENTINEL){const{node:u,remainder:C,nodeStartOffset:f}=this.nodeAt(l),h=u.piece,v=h.bufferIndex,w=this.positionInBuffer(u,C);if(u.piece.bufferIndex===0&&h.end.line===this._lastChangeBufferPos.line&&h.end.column===this._lastChangeBufferPos.column&&f+h.length===l&&a.lengthl){const S=[];let L=new o(h.bufferIndex,w,h.end,this.getLineFeedCnt(h.bufferIndex,w,h.end),this.offsetInBuffer(v,h.end)-this.offsetInBuffer(v,w));if(this.shouldCheckCRLF()&&this.endWithCR(a)&&this.nodeCharCodeAt(u,C)===10){const A={line:L.start.line+1,column:0};L=new o(L.bufferIndex,A,L.end,this.getLineFeedCnt(L.bufferIndex,A,L.end),L.length-1),a+=`
+`}if(this.shouldCheckCRLF()&&this.startWithLF(a))if(this.nodeCharCodeAt(u,C-1)===13){const A=this.positionInBuffer(u,C-1);this.deleteNodeTail(u,A),a="\r"+a,u.piece.length===0&&S.push(u)}else this.deleteNodeTail(u,w);else this.deleteNodeTail(u,w);const D=this.createNewPieces(a);L.length>0&&this.rbInsertRight(u,L);let T=u;for(let M=0;M=0;f--)C=this.rbInsertLeft(C,u[f]);this.validateCRLFWithPrevNode(C),this.deleteNodes(r)}insertContentToNodeRight(l,a){this.adjustCarriageReturnFromNext(l,a)&&(l+=`
+`);const r=this.createNewPieces(l),u=this.rbInsertRight(a,r[0]);let C=u;for(let f=1;f=D)w=L+1;else break;return r?(r.line=L,r.column=v-T,null):{line:L,column:v-T}}getLineFeedCnt(l,a,r){if(r.column===0)return r.line-a.line;const u=this._buffers[l].lineStarts;if(r.line===u.length-1)return r.line-a.line;const C=u[r.line+1],f=u[r.line]+r.column;if(C>f+1)return r.line-a.line;const h=f-1;return this._buffers[l].buffer.charCodeAt(h)===13?r.line-a.line+1:r.line-a.line}offsetInBuffer(l,a){return this._buffers[l].lineStarts[a.line]+a.column}deleteNodes(l){for(let a=0;am){const S=[];for(;l.length>m;){const D=l.charCodeAt(m-1);let T;D===13||D>=55296&&D<=56319?(T=l.substring(0,m-1),l=l.substring(m-1)):(T=l.substring(0,m),l=l.substring(m));const M=p(T);S.push(new o(this._buffers.length,{line:0,column:0},{line:M.length-1,column:T.length-M[M.length-1]},M.length-1,T.length)),this._buffers.push(new t(T,M))}const L=p(l);return S.push(new o(this._buffers.length,{line:0,column:0},{line:L.length-1,column:l.length-L[L.length-1]},L.length-1,l.length)),this._buffers.push(new t(l,L)),S}let a=this._buffers[0].buffer.length;const r=p(l,!1);let u=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===a&&a!==0&&this.startWithLF(l)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},u=this._lastChangeBufferPos;for(let S=0;S=l-1)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt>l-1){const v=this.getAccumulatedValue(r,l-r.lf_left-2),w=this.getAccumulatedValue(r,l-r.lf_left-1),S=this._buffers[r.piece.bufferIndex].buffer,L=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return f+=r.size_left,this._searchCache.set({node:r,nodeStartOffset:f,nodeStartLineNumber:h-(l-1-r.lf_left)}),S.substring(L+v,L+w-a)}else if(r.lf_left+r.piece.lineFeedCnt===l-1){const v=this.getAccumulatedValue(r,l-r.lf_left-2),w=this._buffers[r.piece.bufferIndex].buffer,S=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);u=w.substring(S+v,S+r.piece.length);break}else l-=r.lf_left+r.piece.lineFeedCnt,f+=r.size_left+r.piece.length,r=r.right}for(r=r.next();r!==E.SENTINEL;){const f=this._buffers[r.piece.bufferIndex].buffer;if(r.piece.lineFeedCnt>0){const h=this.getAccumulatedValue(r,0),v=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return u+=f.substring(v,v+h-a),u}else{const h=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);u+=f.substr(h,r.piece.length)}r=r.next()}return u}computeBufferMetadata(){let l=this.root,a=1,r=0;for(;l!==E.SENTINEL;)a+=l.lf_left+l.piece.lineFeedCnt,r+=l.size_left+l.piece.length,l=l.right;this._lineCnt=a,this._length=r,this._searchCache.validate(this._length)}getIndexOf(l,a){const r=l.piece,u=this.positionInBuffer(l,a),C=u.line-r.start.line;if(this.offsetInBuffer(r.bufferIndex,r.end)-this.offsetInBuffer(r.bufferIndex,r.start)===a){const f=this.getLineFeedCnt(l.piece.bufferIndex,r.start,u);if(f!==C)return{index:f,remainder:0}}return{index:C,remainder:u.column}}getAccumulatedValue(l,a){if(a<0)return 0;const r=l.piece,u=this._buffers[r.bufferIndex].lineStarts,C=r.start.line+a+1;return C>r.end.line?u[r.end.line]+r.end.column-u[r.start.line]-r.start.column:u[C]-u[r.start.line]-r.start.column}deleteNodeTail(l,a){const r=l.piece,u=r.lineFeedCnt,C=this.offsetInBuffer(r.bufferIndex,r.end),f=a,h=this.offsetInBuffer(r.bufferIndex,f),v=this.getLineFeedCnt(r.bufferIndex,r.start,f),w=v-u,S=h-C,L=r.length+S;l.piece=new o(r.bufferIndex,r.start,f,v,L),(0,E.updateTreeMetadata)(this,l,S,w)}deleteNodeHead(l,a){const r=l.piece,u=r.lineFeedCnt,C=this.offsetInBuffer(r.bufferIndex,r.start),f=a,h=this.getLineFeedCnt(r.bufferIndex,f,r.end),v=this.offsetInBuffer(r.bufferIndex,f),w=h-u,S=C-v,L=r.length+S;l.piece=new o(r.bufferIndex,f,r.end,h,L),(0,E.updateTreeMetadata)(this,l,S,w)}shrinkNode(l,a,r){const u=l.piece,C=u.start,f=u.end,h=u.length,v=u.lineFeedCnt,w=a,S=this.getLineFeedCnt(u.bufferIndex,u.start,w),L=this.offsetInBuffer(u.bufferIndex,a)-this.offsetInBuffer(u.bufferIndex,C);l.piece=new o(u.bufferIndex,u.start,w,S,L),(0,E.updateTreeMetadata)(this,l,L-h,S-v);const D=new o(u.bufferIndex,r,f,this.getLineFeedCnt(u.bufferIndex,r,f),this.offsetInBuffer(u.bufferIndex,f)-this.offsetInBuffer(u.bufferIndex,r)),T=this.rbInsertRight(l,D);this.validateCRLFWithPrevNode(T)}appendToNode(l,a){this.adjustCarriageReturnFromNext(a,l)&&(a+=`
+`);const r=this.shouldCheckCRLF()&&this.startWithLF(a)&&this.endWithCR(l),u=this._buffers[0].buffer.length;this._buffers[0].buffer+=a;const C=p(a,!1);for(let T=0;Tl)a=a.left;else if(a.size_left+a.piece.length>=l){u+=a.size_left;const C={node:a,remainder:l-a.size_left,nodeStartOffset:u};return this._searchCache.set(C),C}else l-=a.size_left+a.piece.length,u+=a.size_left+a.piece.length,a=a.right;return null}nodeAt2(l,a){let r=this.root,u=0;for(;r!==E.SENTINEL;)if(r.left!==E.SENTINEL&&r.lf_left>=l-1)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt>l-1){const C=this.getAccumulatedValue(r,l-r.lf_left-2),f=this.getAccumulatedValue(r,l-r.lf_left-1);return u+=r.size_left,{node:r,remainder:Math.min(C+a-1,f),nodeStartOffset:u}}else if(r.lf_left+r.piece.lineFeedCnt===l-1){const C=this.getAccumulatedValue(r,l-r.lf_left-2);if(C+a-1<=r.piece.length)return{node:r,remainder:C+a-1,nodeStartOffset:u};a-=r.piece.length-C;break}else l-=r.lf_left+r.piece.lineFeedCnt,u+=r.size_left+r.piece.length,r=r.right;for(r=r.next();r!==E.SENTINEL;){if(r.piece.lineFeedCnt>0){const C=this.getAccumulatedValue(r,0),f=this.offsetOfNode(r);return{node:r,remainder:Math.min(a-1,C),nodeStartOffset:f}}else if(r.piece.length>=a-1){const C=this.offsetOfNode(r);return{node:r,remainder:a-1,nodeStartOffset:C}}else a-=r.piece.length;r=r.next()}return null}nodeCharCodeAt(l,a){if(l.piece.lineFeedCnt<1)return-1;const r=this._buffers[l.piece.bufferIndex],u=this.offsetInBuffer(l.piece.bufferIndex,l.piece.start)+a;return r.buffer.charCodeAt(u)}offsetOfNode(l){if(!l)return 0;let a=l.size_left;for(;l!==this.root;)l.parent.right===l&&(a+=l.parent.size_left+l.parent.piece.length),l=l.parent;return a}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
+`)}startWithLF(l){if(typeof l=="string")return l.charCodeAt(0)===10;if(l===E.SENTINEL||l.piece.lineFeedCnt===0)return!1;const a=l.piece,r=this._buffers[a.bufferIndex].lineStarts,u=a.start.line,C=r[u]+a.start.column;return u===r.length-1||r[u+1]>C+1?!1:this._buffers[a.bufferIndex].buffer.charCodeAt(C)===10}endWithCR(l){return typeof l=="string"?l.charCodeAt(l.length-1)===13:l===E.SENTINEL||l.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(l,l.piece.length-1)===13}validateCRLFWithPrevNode(l){if(this.shouldCheckCRLF()&&this.startWithLF(l)){const a=l.prev();this.endWithCR(a)&&this.fixCRLF(a,l)}}validateCRLFWithNextNode(l){if(this.shouldCheckCRLF()&&this.endWithCR(l)){const a=l.next();this.startWithLF(a)&&this.fixCRLF(l,a)}}fixCRLF(l,a){const r=[],u=this._buffers[l.piece.bufferIndex].lineStarts;let C;l.piece.end.column===0?C={line:l.piece.end.line-1,column:u[l.piece.end.line]-u[l.piece.end.line-1]-1}:C={line:l.piece.end.line,column:l.piece.end.column-1};const f=l.piece.length-1,h=l.piece.lineFeedCnt-1;l.piece=new o(l.piece.bufferIndex,l.piece.start,C,h,f),(0,E.updateTreeMetadata)(this,l,-1,-1),l.piece.length===0&&r.push(l);const v={line:a.piece.start.line+1,column:0},w=a.piece.length-1,S=this.getLineFeedCnt(a.piece.bufferIndex,v,a.piece.end);a.piece=new o(a.piece.bufferIndex,v,a.piece.end,S,w),(0,E.updateTreeMetadata)(this,a,-1,-1),a.piece.length===0&&r.push(a);const L=this.createNewPieces(`\r
+`);this.rbInsertRight(l,L[0]);for(let D=0;D0?this.wrappedTextIndentLength:0}getLineLength(n){const o=n>0?this.breakOffsets[n-1]:0;let i=this.breakOffsets[n]-o;return n>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(n){return this.getLineLength(n)}translateToInputOffset(n,o){n>0&&(o=Math.max(0,o-this.wrappedTextIndentLength));let i=n===0?o:this.breakOffsets[n-1]+o;if(this.injectionOffsets!==null)for(let s=0;sthis.injectionOffsets[s];s++)i0?this.breakOffsets[s-1]:0,o===0)if(n<=g)i=s-1;else if(n>l)t=s+1;else break;else if(n=l)t=s+1;else break}let c=n-g;return s>0&&(c+=this.wrappedTextIndentLength),new b(s,c)}normalizeOutputPosition(n,o,t){if(this.injectionOffsets!==null){const i=this.outputPositionToOffsetInInputWithInjections(n,o),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(i,t);if(s!==i)return this.offsetInInputWithInjectionsToOutputPosition(s,t)}if(t===0){if(n>0&&o===this.getMinOutputOffset(n))return new b(n-1,this.getMaxOutputOffset(n-1))}else if(t===1){const i=this.getOutputLineCount()-1;if(n0&&(o=Math.max(0,o-this.wrappedTextIndentLength)),(n>0?this.breakOffsets[n-1]:0)+o}normalizeOffsetInInputWithInjectionsAroundInjections(n,o){const t=this.getInjectedTextAtOffset(n);if(!t)return n;if(o===2){if(n===t.offsetInInputWithInjections+t.length&&y(this.injectionOptions[t.injectedTextIndex].cursorStops))return t.offsetInInputWithInjections+t.length;{let i=t.offsetInInputWithInjections;if(m(this.injectionOptions[t.injectedTextIndex].cursorStops))return i;let s=t.injectedTextIndex-1;for(;s>=0&&this.injectionOffsets[s]===this.injectionOffsets[t.injectedTextIndex]&&!(y(this.injectionOptions[s].cursorStops)||(i-=this.injectionOptions[s].content.length,m(this.injectionOptions[s].cursorStops)));)s--;return i}}else if(o===1||o===4){let i=t.offsetInInputWithInjections+t.length,s=t.injectedTextIndex;for(;s+1=0&&this.injectionOffsets[s-1]===this.injectionOffsets[s];)i-=this.injectionOptions[s-1].content.length,s--;return i}(0,d.assertNever)(o)}getInjectedText(n,o){const t=this.outputPositionToOffsetInInputWithInjections(n,o),i=this.getInjectedTextAtOffset(t);return i?{options:this.injectionOptions[i.injectedTextIndex]}:null}getInjectedTextAtOffset(n){const o=this.injectionOffsets,t=this.injectionOptions;if(o!==null){let i=0;for(let s=0;sn)break;if(n<=l)return{injectedTextIndex:s,offsetInInputWithInjections:c,length:g};i+=g}}}}e.ModelLineProjectionData=E;function y(p){return p==null?!0:p===I.InjectedTextCursorStops.Right||p===I.InjectedTextCursorStops.Both}function m(p){return p==null?!0:p===I.InjectedTextCursorStops.Left||p===I.InjectedTextCursorStops.Both}class _{constructor(n){this.options=n}}e.InjectedText=_;class b{constructor(n,o){this.outputLineIndex=n,this.outputOffset=o}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(n){return new k.Position(n+this.outputLineIndex,this.outputOffset+1)}}e.OutputPosition=b}),define(ne[326],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditorWorkerHost=void 0;class d{static{this.CHANNEL_NAME="editorWorkerHost"}static getChannel(I){return I.getChannel(d.CHANNEL_NAME)}static setChannel(I,E){I.setChannel(d.CHANNEL_NAME,E)}}e.EditorWorkerHost=d}),define(ne[582],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findSectionHeaders=I;const d=new RegExp("\\bMARK:\\s*(.*)$","d"),k=/^-+|-+$/g;function I(b,p){let n=[];if(p.findRegionSectionHeaders&&p.foldingRules?.markers){const o=E(b,p);n=n.concat(o)}if(p.findMarkSectionHeaders){const o=y(b);n=n.concat(o)}return n}function E(b,p){const n=[],o=b.getLineCount();for(let t=1;t<=o;t++){const i=b.getLineContent(t),s=i.match(p.foldingRules.markers.start);if(s){const g={startLineNumber:t,startColumn:s[0].length+1,endLineNumber:t,endColumn:i.length+1};if(g.endColumn>g.startColumn){const c={range:g,..._(i.substring(s[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&n.push(c)}}}return n}function y(b){const p=[],n=b.getLineCount();for(let o=1;o<=n;o++){const t=b.getLineContent(o);m(t,o,p)}return p}function m(b,p,n){d.lastIndex=0;const o=d.exec(b);if(o){const t=o.indices[1][0]+1,i=o.indices[1][1]+1,s={startLineNumber:p,startColumn:t,endLineNumber:p,endColumn:i};if(s.endColumn>s.startColumn){const g={range:s,..._(o[1]),shouldBeInComments:!0};(g.text||g.hasSeparatorLine)&&n.push(g)}}}function _(b){b=b.trim();const p=b.startsWith("-");return b=b.replace(k,""),{text:b,hasSeparatorLine:p}}}),define(ne[327],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DraggedTreeItemsIdentifier=e.TreeViewsDnDService=void 0;class d{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(E){if(E&&this._dragOperations.has(E)){const y=this._dragOperations.get(E);return this._dragOperations.delete(E),y}}}e.TreeViewsDnDService=d;class k{constructor(E){this.identifier=E}}e.DraggedTreeItemsIdentifier=k}),define(ne[328],se([1,0,4,202,11,90,147]),function(oe,e,d,k,I,E,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeTextModelHighlighter=void 0;class m{static computeUnicodeHighlights(o,t,i){const s=i?i.startLineNumber:1,g=i?i.endLineNumber:o.getLineCount(),c=new b(t),l=c.getCandidateCodePoints();let a;l==="allNonBasicAscii"?a=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):a=new RegExp(`${_(Array.from(l))}`,"g");const r=new k.Searcher(null,a),u=[];let C=!1,f,h=0,v=0,w=0;e:for(let S=s,L=g;S<=L;S++){const D=o.getLineContent(S),T=D.length;r.reset(0);do if(f=r.next(D),f){let M=f.index,A=f.index+f[0].length;if(M>0){const F=D.charCodeAt(M-1);I.isHighSurrogate(F)&&M--}if(A+1=1e3){C=!0;break e}u.push(new d.Range(S,M+1,S,A+1))}}while(f)}return{ranges:u,hasMore:C,ambiguousCharacterCount:h,invisibleCharacterCount:v,nonBasicAsciiCharacterCount:w}}static computeUnicodeHighlightReason(o,t){const i=new b(t);switch(i.shouldHighlightNonBasicASCII(o,null)){case 0:return null;case 2:return{kind:1};case 3:{const g=o.codePointAt(0),c=i.ambiguousCharacters.getPrimaryConfusable(g),l=I.AmbiguousCharacters.getLocales().filter(a=>!I.AmbiguousCharacters.getInstance(new Set([...t.allowedLocales,a])).isAmbiguous(g));return{kind:0,confusableWith:String.fromCodePoint(c),notAmbiguousInLocales:l}}case 1:return{kind:2}}}}e.UnicodeTextModelHighlighter=m;function _(n,o){return`[${I.escapeRegExpCharacters(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class b{constructor(o){this.options=o,this.allowedCodePoints=new Set(o.allowedCodePoints),this.ambiguousCharacters=I.AmbiguousCharacters.getInstance(new Set(o.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const o=new Set;if(this.options.invisibleCharacters)for(const t of I.InvisibleCharacters.codePoints)p(String.fromCodePoint(t))||o.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())o.add(t);for(const t of this.allowedCodePoints)o.delete(t);return o}shouldHighlightNonBasicASCII(o,t){const i=o.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let s=!1,g=!1;if(t)for(const c of t){const l=c.codePointAt(0),a=I.isBasicASCII(c);s=s||a,!a&&!this.ambiguousCharacters.isAmbiguous(l)&&!I.InvisibleCharacters.isInvisibleCharacter(l)&&(g=!0)}return!s&&g?0:this.options.invisibleCharacters&&!p(o)&&I.InvisibleCharacters.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function p(n){return n===" "||n===`
+`||n===" "}}),define(ne[238],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WrappingIndent=e.TrackedRangeStickiness=e.TextEditorCursorStyle=e.TextEditorCursorBlinkingStyle=e.SymbolTag=e.SymbolKind=e.SignatureHelpTriggerKind=e.ShowLightbulbIconMode=e.SelectionDirection=e.ScrollbarVisibility=e.ScrollType=e.RenderMinimap=e.RenderLineNumbersType=e.PositionAffinity=e.PartialAcceptTriggerKind=e.OverviewRulerLane=e.OverlayWidgetPositionPreference=e.NewSymbolNameTriggerKind=e.NewSymbolNameTag=e.MouseTargetType=e.MinimapSectionHeaderStyle=e.MinimapPosition=e.MarkerTag=e.MarkerSeverity=e.KeyCode=e.InlineEditTriggerKind=e.InlineCompletionTriggerKind=e.InlayHintKind=e.InjectedTextCursorStops=e.IndentAction=e.HoverVerbosityAction=e.GlyphMarginLane=e.EndOfLineSequence=e.EndOfLinePreference=e.EditorOption=e.EditorAutoIndentStrategy=e.DocumentHighlightKind=e.DefaultEndOfLine=e.CursorChangeReason=e.ContentWidgetPositionPreference=e.CompletionTriggerKind=e.CompletionItemTag=e.CompletionItemKind=e.CompletionItemInsertTextRule=e.CodeActionTriggerType=e.AccessibilitySupport=void 0;var d;(function(R){R[R.Unknown=0]="Unknown",R[R.Disabled=1]="Disabled",R[R.Enabled=2]="Enabled"})(d||(e.AccessibilitySupport=d={}));var k;(function(R){R[R.Invoke=1]="Invoke",R[R.Auto=2]="Auto"})(k||(e.CodeActionTriggerType=k={}));var I;(function(R){R[R.None=0]="None",R[R.KeepWhitespace=1]="KeepWhitespace",R[R.InsertAsSnippet=4]="InsertAsSnippet"})(I||(e.CompletionItemInsertTextRule=I={}));var E;(function(R){R[R.Method=0]="Method",R[R.Function=1]="Function",R[R.Constructor=2]="Constructor",R[R.Field=3]="Field",R[R.Variable=4]="Variable",R[R.Class=5]="Class",R[R.Struct=6]="Struct",R[R.Interface=7]="Interface",R[R.Module=8]="Module",R[R.Property=9]="Property",R[R.Event=10]="Event",R[R.Operator=11]="Operator",R[R.Unit=12]="Unit",R[R.Value=13]="Value",R[R.Constant=14]="Constant",R[R.Enum=15]="Enum",R[R.EnumMember=16]="EnumMember",R[R.Keyword=17]="Keyword",R[R.Text=18]="Text",R[R.Color=19]="Color",R[R.File=20]="File",R[R.Reference=21]="Reference",R[R.Customcolor=22]="Customcolor",R[R.Folder=23]="Folder",R[R.TypeParameter=24]="TypeParameter",R[R.User=25]="User",R[R.Issue=26]="Issue",R[R.Snippet=27]="Snippet"})(E||(e.CompletionItemKind=E={}));var y;(function(R){R[R.Deprecated=1]="Deprecated"})(y||(e.CompletionItemTag=y={}));var m;(function(R){R[R.Invoke=0]="Invoke",R[R.TriggerCharacter=1]="TriggerCharacter",R[R.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(m||(e.CompletionTriggerKind=m={}));var _;(function(R){R[R.EXACT=0]="EXACT",R[R.ABOVE=1]="ABOVE",R[R.BELOW=2]="BELOW"})(_||(e.ContentWidgetPositionPreference=_={}));var b;(function(R){R[R.NotSet=0]="NotSet",R[R.ContentFlush=1]="ContentFlush",R[R.RecoverFromMarkers=2]="RecoverFromMarkers",R[R.Explicit=3]="Explicit",R[R.Paste=4]="Paste",R[R.Undo=5]="Undo",R[R.Redo=6]="Redo"})(b||(e.CursorChangeReason=b={}));var p;(function(R){R[R.LF=1]="LF",R[R.CRLF=2]="CRLF"})(p||(e.DefaultEndOfLine=p={}));var n;(function(R){R[R.Text=0]="Text",R[R.Read=1]="Read",R[R.Write=2]="Write"})(n||(e.DocumentHighlightKind=n={}));var o;(function(R){R[R.None=0]="None",R[R.Keep=1]="Keep",R[R.Brackets=2]="Brackets",R[R.Advanced=3]="Advanced",R[R.Full=4]="Full"})(o||(e.EditorAutoIndentStrategy=o={}));var t;(function(R){R[R.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",R[R.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",R[R.accessibilitySupport=2]="accessibilitySupport",R[R.accessibilityPageSize=3]="accessibilityPageSize",R[R.ariaLabel=4]="ariaLabel",R[R.ariaRequired=5]="ariaRequired",R[R.autoClosingBrackets=6]="autoClosingBrackets",R[R.autoClosingComments=7]="autoClosingComments",R[R.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",R[R.autoClosingDelete=9]="autoClosingDelete",R[R.autoClosingOvertype=10]="autoClosingOvertype",R[R.autoClosingQuotes=11]="autoClosingQuotes",R[R.autoIndent=12]="autoIndent",R[R.automaticLayout=13]="automaticLayout",R[R.autoSurround=14]="autoSurround",R[R.bracketPairColorization=15]="bracketPairColorization",R[R.guides=16]="guides",R[R.codeLens=17]="codeLens",R[R.codeLensFontFamily=18]="codeLensFontFamily",R[R.codeLensFontSize=19]="codeLensFontSize",R[R.colorDecorators=20]="colorDecorators",R[R.colorDecoratorsLimit=21]="colorDecoratorsLimit",R[R.columnSelection=22]="columnSelection",R[R.comments=23]="comments",R[R.contextmenu=24]="contextmenu",R[R.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",R[R.cursorBlinking=26]="cursorBlinking",R[R.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",R[R.cursorStyle=28]="cursorStyle",R[R.cursorSurroundingLines=29]="cursorSurroundingLines",R[R.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",R[R.cursorWidth=31]="cursorWidth",R[R.disableLayerHinting=32]="disableLayerHinting",R[R.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",R[R.domReadOnly=34]="domReadOnly",R[R.dragAndDrop=35]="dragAndDrop",R[R.dropIntoEditor=36]="dropIntoEditor",R[R.emptySelectionClipboard=37]="emptySelectionClipboard",R[R.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",R[R.extraEditorClassName=39]="extraEditorClassName",R[R.fastScrollSensitivity=40]="fastScrollSensitivity",R[R.find=41]="find",R[R.fixedOverflowWidgets=42]="fixedOverflowWidgets",R[R.folding=43]="folding",R[R.foldingStrategy=44]="foldingStrategy",R[R.foldingHighlight=45]="foldingHighlight",R[R.foldingImportsByDefault=46]="foldingImportsByDefault",R[R.foldingMaximumRegions=47]="foldingMaximumRegions",R[R.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",R[R.fontFamily=49]="fontFamily",R[R.fontInfo=50]="fontInfo",R[R.fontLigatures=51]="fontLigatures",R[R.fontSize=52]="fontSize",R[R.fontWeight=53]="fontWeight",R[R.fontVariations=54]="fontVariations",R[R.formatOnPaste=55]="formatOnPaste",R[R.formatOnType=56]="formatOnType",R[R.glyphMargin=57]="glyphMargin",R[R.gotoLocation=58]="gotoLocation",R[R.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",R[R.hover=60]="hover",R[R.inDiffEditor=61]="inDiffEditor",R[R.inlineSuggest=62]="inlineSuggest",R[R.inlineEdit=63]="inlineEdit",R[R.letterSpacing=64]="letterSpacing",R[R.lightbulb=65]="lightbulb",R[R.lineDecorationsWidth=66]="lineDecorationsWidth",R[R.lineHeight=67]="lineHeight",R[R.lineNumbers=68]="lineNumbers",R[R.lineNumbersMinChars=69]="lineNumbersMinChars",R[R.linkedEditing=70]="linkedEditing",R[R.links=71]="links",R[R.matchBrackets=72]="matchBrackets",R[R.minimap=73]="minimap",R[R.mouseStyle=74]="mouseStyle",R[R.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",R[R.mouseWheelZoom=76]="mouseWheelZoom",R[R.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",R[R.multiCursorModifier=78]="multiCursorModifier",R[R.multiCursorPaste=79]="multiCursorPaste",R[R.multiCursorLimit=80]="multiCursorLimit",R[R.occurrencesHighlight=81]="occurrencesHighlight",R[R.overviewRulerBorder=82]="overviewRulerBorder",R[R.overviewRulerLanes=83]="overviewRulerLanes",R[R.padding=84]="padding",R[R.pasteAs=85]="pasteAs",R[R.parameterHints=86]="parameterHints",R[R.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",R[R.placeholder=88]="placeholder",R[R.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",R[R.quickSuggestions=90]="quickSuggestions",R[R.quickSuggestionsDelay=91]="quickSuggestionsDelay",R[R.readOnly=92]="readOnly",R[R.readOnlyMessage=93]="readOnlyMessage",R[R.renameOnType=94]="renameOnType",R[R.renderControlCharacters=95]="renderControlCharacters",R[R.renderFinalNewline=96]="renderFinalNewline",R[R.renderLineHighlight=97]="renderLineHighlight",R[R.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",R[R.renderValidationDecorations=99]="renderValidationDecorations",R[R.renderWhitespace=100]="renderWhitespace",R[R.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",R[R.roundedSelection=102]="roundedSelection",R[R.rulers=103]="rulers",R[R.scrollbar=104]="scrollbar",R[R.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",R[R.scrollBeyondLastLine=106]="scrollBeyondLastLine",R[R.scrollPredominantAxis=107]="scrollPredominantAxis",R[R.selectionClipboard=108]="selectionClipboard",R[R.selectionHighlight=109]="selectionHighlight",R[R.selectOnLineNumbers=110]="selectOnLineNumbers",R[R.showFoldingControls=111]="showFoldingControls",R[R.showUnused=112]="showUnused",R[R.snippetSuggestions=113]="snippetSuggestions",R[R.smartSelect=114]="smartSelect",R[R.smoothScrolling=115]="smoothScrolling",R[R.stickyScroll=116]="stickyScroll",R[R.stickyTabStops=117]="stickyTabStops",R[R.stopRenderingLineAfter=118]="stopRenderingLineAfter",R[R.suggest=119]="suggest",R[R.suggestFontSize=120]="suggestFontSize",R[R.suggestLineHeight=121]="suggestLineHeight",R[R.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",R[R.suggestSelection=123]="suggestSelection",R[R.tabCompletion=124]="tabCompletion",R[R.tabIndex=125]="tabIndex",R[R.unicodeHighlighting=126]="unicodeHighlighting",R[R.unusualLineTerminators=127]="unusualLineTerminators",R[R.useShadowDOM=128]="useShadowDOM",R[R.useTabStops=129]="useTabStops",R[R.wordBreak=130]="wordBreak",R[R.wordSegmenterLocales=131]="wordSegmenterLocales",R[R.wordSeparators=132]="wordSeparators",R[R.wordWrap=133]="wordWrap",R[R.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",R[R.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",R[R.wordWrapColumn=136]="wordWrapColumn",R[R.wordWrapOverride1=137]="wordWrapOverride1",R[R.wordWrapOverride2=138]="wordWrapOverride2",R[R.wrappingIndent=139]="wrappingIndent",R[R.wrappingStrategy=140]="wrappingStrategy",R[R.showDeprecated=141]="showDeprecated",R[R.inlayHints=142]="inlayHints",R[R.editorClassName=143]="editorClassName",R[R.pixelRatio=144]="pixelRatio",R[R.tabFocusMode=145]="tabFocusMode",R[R.layoutInfo=146]="layoutInfo",R[R.wrappingInfo=147]="wrappingInfo",R[R.defaultColorDecorators=148]="defaultColorDecorators",R[R.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",R[R.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(t||(e.EditorOption=t={}));var i;(function(R){R[R.TextDefined=0]="TextDefined",R[R.LF=1]="LF",R[R.CRLF=2]="CRLF"})(i||(e.EndOfLinePreference=i={}));var s;(function(R){R[R.LF=0]="LF",R[R.CRLF=1]="CRLF"})(s||(e.EndOfLineSequence=s={}));var g;(function(R){R[R.Left=1]="Left",R[R.Center=2]="Center",R[R.Right=3]="Right"})(g||(e.GlyphMarginLane=g={}));var c;(function(R){R[R.Increase=0]="Increase",R[R.Decrease=1]="Decrease"})(c||(e.HoverVerbosityAction=c={}));var l;(function(R){R[R.None=0]="None",R[R.Indent=1]="Indent",R[R.IndentOutdent=2]="IndentOutdent",R[R.Outdent=3]="Outdent"})(l||(e.IndentAction=l={}));var a;(function(R){R[R.Both=0]="Both",R[R.Right=1]="Right",R[R.Left=2]="Left",R[R.None=3]="None"})(a||(e.InjectedTextCursorStops=a={}));var r;(function(R){R[R.Type=1]="Type",R[R.Parameter=2]="Parameter"})(r||(e.InlayHintKind=r={}));var u;(function(R){R[R.Automatic=0]="Automatic",R[R.Explicit=1]="Explicit"})(u||(e.InlineCompletionTriggerKind=u={}));var C;(function(R){R[R.Invoke=0]="Invoke",R[R.Automatic=1]="Automatic"})(C||(e.InlineEditTriggerKind=C={}));var f;(function(R){R[R.DependsOnKbLayout=-1]="DependsOnKbLayout",R[R.Unknown=0]="Unknown",R[R.Backspace=1]="Backspace",R[R.Tab=2]="Tab",R[R.Enter=3]="Enter",R[R.Shift=4]="Shift",R[R.Ctrl=5]="Ctrl",R[R.Alt=6]="Alt",R[R.PauseBreak=7]="PauseBreak",R[R.CapsLock=8]="CapsLock",R[R.Escape=9]="Escape",R[R.Space=10]="Space",R[R.PageUp=11]="PageUp",R[R.PageDown=12]="PageDown",R[R.End=13]="End",R[R.Home=14]="Home",R[R.LeftArrow=15]="LeftArrow",R[R.UpArrow=16]="UpArrow",R[R.RightArrow=17]="RightArrow",R[R.DownArrow=18]="DownArrow",R[R.Insert=19]="Insert",R[R.Delete=20]="Delete",R[R.Digit0=21]="Digit0",R[R.Digit1=22]="Digit1",R[R.Digit2=23]="Digit2",R[R.Digit3=24]="Digit3",R[R.Digit4=25]="Digit4",R[R.Digit5=26]="Digit5",R[R.Digit6=27]="Digit6",R[R.Digit7=28]="Digit7",R[R.Digit8=29]="Digit8",R[R.Digit9=30]="Digit9",R[R.KeyA=31]="KeyA",R[R.KeyB=32]="KeyB",R[R.KeyC=33]="KeyC",R[R.KeyD=34]="KeyD",R[R.KeyE=35]="KeyE",R[R.KeyF=36]="KeyF",R[R.KeyG=37]="KeyG",R[R.KeyH=38]="KeyH",R[R.KeyI=39]="KeyI",R[R.KeyJ=40]="KeyJ",R[R.KeyK=41]="KeyK",R[R.KeyL=42]="KeyL",R[R.KeyM=43]="KeyM",R[R.KeyN=44]="KeyN",R[R.KeyO=45]="KeyO",R[R.KeyP=46]="KeyP",R[R.KeyQ=47]="KeyQ",R[R.KeyR=48]="KeyR",R[R.KeyS=49]="KeyS",R[R.KeyT=50]="KeyT",R[R.KeyU=51]="KeyU",R[R.KeyV=52]="KeyV",R[R.KeyW=53]="KeyW",R[R.KeyX=54]="KeyX",R[R.KeyY=55]="KeyY",R[R.KeyZ=56]="KeyZ",R[R.Meta=57]="Meta",R[R.ContextMenu=58]="ContextMenu",R[R.F1=59]="F1",R[R.F2=60]="F2",R[R.F3=61]="F3",R[R.F4=62]="F4",R[R.F5=63]="F5",R[R.F6=64]="F6",R[R.F7=65]="F7",R[R.F8=66]="F8",R[R.F9=67]="F9",R[R.F10=68]="F10",R[R.F11=69]="F11",R[R.F12=70]="F12",R[R.F13=71]="F13",R[R.F14=72]="F14",R[R.F15=73]="F15",R[R.F16=74]="F16",R[R.F17=75]="F17",R[R.F18=76]="F18",R[R.F19=77]="F19",R[R.F20=78]="F20",R[R.F21=79]="F21",R[R.F22=80]="F22",R[R.F23=81]="F23",R[R.F24=82]="F24",R[R.NumLock=83]="NumLock",R[R.ScrollLock=84]="ScrollLock",R[R.Semicolon=85]="Semicolon",R[R.Equal=86]="Equal",R[R.Comma=87]="Comma",R[R.Minus=88]="Minus",R[R.Period=89]="Period",R[R.Slash=90]="Slash",R[R.Backquote=91]="Backquote",R[R.BracketLeft=92]="BracketLeft",R[R.Backslash=93]="Backslash",R[R.BracketRight=94]="BracketRight",R[R.Quote=95]="Quote",R[R.OEM_8=96]="OEM_8",R[R.IntlBackslash=97]="IntlBackslash",R[R.Numpad0=98]="Numpad0",R[R.Numpad1=99]="Numpad1",R[R.Numpad2=100]="Numpad2",R[R.Numpad3=101]="Numpad3",R[R.Numpad4=102]="Numpad4",R[R.Numpad5=103]="Numpad5",R[R.Numpad6=104]="Numpad6",R[R.Numpad7=105]="Numpad7",R[R.Numpad8=106]="Numpad8",R[R.Numpad9=107]="Numpad9",R[R.NumpadMultiply=108]="NumpadMultiply",R[R.NumpadAdd=109]="NumpadAdd",R[R.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",R[R.NumpadSubtract=111]="NumpadSubtract",R[R.NumpadDecimal=112]="NumpadDecimal",R[R.NumpadDivide=113]="NumpadDivide",R[R.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",R[R.ABNT_C1=115]="ABNT_C1",R[R.ABNT_C2=116]="ABNT_C2",R[R.AudioVolumeMute=117]="AudioVolumeMute",R[R.AudioVolumeUp=118]="AudioVolumeUp",R[R.AudioVolumeDown=119]="AudioVolumeDown",R[R.BrowserSearch=120]="BrowserSearch",R[R.BrowserHome=121]="BrowserHome",R[R.BrowserBack=122]="BrowserBack",R[R.BrowserForward=123]="BrowserForward",R[R.MediaTrackNext=124]="MediaTrackNext",R[R.MediaTrackPrevious=125]="MediaTrackPrevious",R[R.MediaStop=126]="MediaStop",R[R.MediaPlayPause=127]="MediaPlayPause",R[R.LaunchMediaPlayer=128]="LaunchMediaPlayer",R[R.LaunchMail=129]="LaunchMail",R[R.LaunchApp2=130]="LaunchApp2",R[R.Clear=131]="Clear",R[R.MAX_VALUE=132]="MAX_VALUE"})(f||(e.KeyCode=f={}));var h;(function(R){R[R.Hint=1]="Hint",R[R.Info=2]="Info",R[R.Warning=4]="Warning",R[R.Error=8]="Error"})(h||(e.MarkerSeverity=h={}));var v;(function(R){R[R.Unnecessary=1]="Unnecessary",R[R.Deprecated=2]="Deprecated"})(v||(e.MarkerTag=v={}));var w;(function(R){R[R.Inline=1]="Inline",R[R.Gutter=2]="Gutter"})(w||(e.MinimapPosition=w={}));var S;(function(R){R[R.Normal=1]="Normal",R[R.Underlined=2]="Underlined"})(S||(e.MinimapSectionHeaderStyle=S={}));var L;(function(R){R[R.UNKNOWN=0]="UNKNOWN",R[R.TEXTAREA=1]="TEXTAREA",R[R.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",R[R.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",R[R.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",R[R.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",R[R.CONTENT_TEXT=6]="CONTENT_TEXT",R[R.CONTENT_EMPTY=7]="CONTENT_EMPTY",R[R.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",R[R.CONTENT_WIDGET=9]="CONTENT_WIDGET",R[R.OVERVIEW_RULER=10]="OVERVIEW_RULER",R[R.SCROLLBAR=11]="SCROLLBAR",R[R.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",R[R.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(L||(e.MouseTargetType=L={}));var D;(function(R){R[R.AIGenerated=1]="AIGenerated"})(D||(e.NewSymbolNameTag=D={}));var T;(function(R){R[R.Invoke=0]="Invoke",R[R.Automatic=1]="Automatic"})(T||(e.NewSymbolNameTriggerKind=T={}));var M;(function(R){R[R.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",R[R.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",R[R.TOP_CENTER=2]="TOP_CENTER"})(M||(e.OverlayWidgetPositionPreference=M={}));var A;(function(R){R[R.Left=1]="Left",R[R.Center=2]="Center",R[R.Right=4]="Right",R[R.Full=7]="Full"})(A||(e.OverviewRulerLane=A={}));var P;(function(R){R[R.Word=0]="Word",R[R.Line=1]="Line",R[R.Suggest=2]="Suggest"})(P||(e.PartialAcceptTriggerKind=P={}));var N;(function(R){R[R.Left=0]="Left",R[R.Right=1]="Right",R[R.None=2]="None",R[R.LeftOfInjectedText=3]="LeftOfInjectedText",R[R.RightOfInjectedText=4]="RightOfInjectedText"})(N||(e.PositionAffinity=N={}));var O;(function(R){R[R.Off=0]="Off",R[R.On=1]="On",R[R.Relative=2]="Relative",R[R.Interval=3]="Interval",R[R.Custom=4]="Custom"})(O||(e.RenderLineNumbersType=O={}));var F;(function(R){R[R.None=0]="None",R[R.Text=1]="Text",R[R.Blocks=2]="Blocks"})(F||(e.RenderMinimap=F={}));var x;(function(R){R[R.Smooth=0]="Smooth",R[R.Immediate=1]="Immediate"})(x||(e.ScrollType=x={}));var W;(function(R){R[R.Auto=1]="Auto",R[R.Hidden=2]="Hidden",R[R.Visible=3]="Visible"})(W||(e.ScrollbarVisibility=W={}));var V;(function(R){R[R.LTR=0]="LTR",R[R.RTL=1]="RTL"})(V||(e.SelectionDirection=V={}));var q;(function(R){R.Off="off",R.OnCode="onCode",R.On="on"})(q||(e.ShowLightbulbIconMode=q={}));var H;(function(R){R[R.Invoke=1]="Invoke",R[R.TriggerCharacter=2]="TriggerCharacter",R[R.ContentChange=3]="ContentChange"})(H||(e.SignatureHelpTriggerKind=H={}));var z;(function(R){R[R.File=0]="File",R[R.Module=1]="Module",R[R.Namespace=2]="Namespace",R[R.Package=3]="Package",R[R.Class=4]="Class",R[R.Method=5]="Method",R[R.Property=6]="Property",R[R.Field=7]="Field",R[R.Constructor=8]="Constructor",R[R.Enum=9]="Enum",R[R.Interface=10]="Interface",R[R.Function=11]="Function",R[R.Variable=12]="Variable",R[R.Constant=13]="Constant",R[R.String=14]="String",R[R.Number=15]="Number",R[R.Boolean=16]="Boolean",R[R.Array=17]="Array",R[R.Object=18]="Object",R[R.Key=19]="Key",R[R.Null=20]="Null",R[R.EnumMember=21]="EnumMember",R[R.Struct=22]="Struct",R[R.Event=23]="Event",R[R.Operator=24]="Operator",R[R.TypeParameter=25]="TypeParameter"})(z||(e.SymbolKind=z={}));var U;(function(R){R[R.Deprecated=1]="Deprecated"})(U||(e.SymbolTag=U={}));var j;(function(R){R[R.Hidden=0]="Hidden",R[R.Blink=1]="Blink",R[R.Smooth=2]="Smooth",R[R.Phase=3]="Phase",R[R.Expand=4]="Expand",R[R.Solid=5]="Solid"})(j||(e.TextEditorCursorBlinkingStyle=j={}));var Y;(function(R){R[R.Line=1]="Line",R[R.Block=2]="Block",R[R.Underline=3]="Underline",R[R.LineThin=4]="LineThin",R[R.BlockOutline=5]="BlockOutline",R[R.UnderlineThin=6]="UnderlineThin"})(Y||(e.TextEditorCursorStyle=Y={}));var G;(function(R){R[R.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",R[R.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",R[R.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",R[R.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(G||(e.TrackedRangeStickiness=G={}));var K;(function(R){R[R.None=0]="None",R[R.Same=1]="Same",R[R.Indent=2]="Indent",R[R.DeepIndent=3]="DeepIndent"})(K||(e.WrappingIndent=K={}))}),define(ne[583],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BracketPairWithMinIndentationInfo=e.BracketPairInfo=e.BracketInfo=void 0;class d{constructor(y,m,_,b){this.range=y,this.nestingLevel=m,this.nestingLevelOfEqualBracketType=_,this.isInvalid=b}}e.BracketInfo=d;class k{constructor(y,m,_,b,p,n){this.range=y,this.openingBracketRange=m,this.closingBracketRange=_,this.nestingLevel=b,this.nestingLevelOfEqualBracketType=p,this.bracketPairNode=n}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}e.BracketPairInfo=k;class I extends k{constructor(y,m,_,b,p,n,o){super(y,m,_,b,p,n),this.minVisibleColumnIndentation=o}}e.BracketPairWithMinIndentationInfo=I}),define(ne[584],se([1,0,6,2,583,200,321,106,320,149,236,13,319]),function(oe,e,d,k,I,E,y,m,_,b,p,n,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BracketPairsTree=void 0;class t extends k.Disposable{didLanguageChange(r){return this.brackets.didLanguageChange(r)}constructor(r,u){if(super(),this.textModel=r,this.getLanguageConfiguration=u,this.didChangeEmitter=new d.Emitter,this.denseKeyProvider=new b.DenseKeyProvider,this.brackets=new y.LanguageAgnosticBracketTokens(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],r.tokenization.hasTokens)r.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const C=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),f=new p.FastTokenizer(this.textModel.getValue(),C);this.initialAstWithoutTokens=(0,_.parseDocument)(f,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const r=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,r||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:r}){const u=r.map(C=>new E.TextEditInfo((0,m.toLength)(C.fromLineNumber-1,0),(0,m.toLength)(C.toLineNumber,0),(0,m.toLength)(C.toLineNumber-C.fromLineNumber+1,0)));this.handleEdits(u,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(r){const u=E.TextEditInfo.fromModelContentChanges(r.changes);this.handleEdits(u,!1)}handleEdits(r,u){const C=(0,o.combineTextEditInfos)(this.queuedTextEdits,r);this.queuedTextEdits=C,this.initialAstWithoutTokens&&!u&&(this.queuedTextEditsForInitialAstWithoutTokens=(0,o.combineTextEditInfos)(this.queuedTextEditsForInitialAstWithoutTokens,r))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(r,u,C){const h=u,v=new p.TextBufferTokenizer(this.textModel,this.brackets);return(0,_.parseDocument)(v,r,h,C)}getBracketsInRange(r,u){this.flushQueue();const C=(0,m.toLength)(r.startLineNumber-1,r.startColumn-1),f=(0,m.toLength)(r.endLineNumber-1,r.endColumn-1);return new n.CallbackIterable(h=>{const v=this.initialAstWithoutTokens||this.astWithTokens;g(v,m.lengthZero,v.length,C,f,h,0,0,new Map,u)})}getBracketPairsInRange(r,u){this.flushQueue();const C=(0,m.positionToLength)(r.getStartPosition()),f=(0,m.positionToLength)(r.getEndPosition());return new n.CallbackIterable(h=>{const v=this.initialAstWithoutTokens||this.astWithTokens,w=new c(h,u,this.textModel);l(v,m.lengthZero,v.length,C,f,w,0,new Map)})}getFirstBracketAfter(r){this.flushQueue();const u=this.initialAstWithoutTokens||this.astWithTokens;return s(u,m.lengthZero,u.length,(0,m.positionToLength)(r))}getFirstBracketBefore(r){this.flushQueue();const u=this.initialAstWithoutTokens||this.astWithTokens;return i(u,m.lengthZero,u.length,(0,m.positionToLength)(r))}}e.BracketPairsTree=t;function i(a,r,u,C){if(a.kind===4||a.kind===2){const f=[];for(const h of a.children)u=(0,m.lengthAdd)(r,h.length),f.push({nodeOffsetStart:r,nodeOffsetEnd:u}),r=u;for(let h=f.length-1;h>=0;h--){const{nodeOffsetStart:v,nodeOffsetEnd:w}=f[h];if((0,m.lengthLessThan)(v,C)){const S=i(a.children[h],v,w,C);if(S)return S}}return null}else{if(a.kind===3)return null;if(a.kind===1){const f=(0,m.lengthsToRange)(r,u);return{bracketInfo:a.bracketInfo,range:f}}}return null}function s(a,r,u,C){if(a.kind===4||a.kind===2){for(const f of a.children){if(u=(0,m.lengthAdd)(r,f.length),(0,m.lengthLessThan)(C,u)){const h=s(f,r,u,C);if(h)return h}r=u}return null}else{if(a.kind===3)return null;if(a.kind===1){const f=(0,m.lengthsToRange)(r,u);return{bracketInfo:a.bracketInfo,range:f}}}return null}function g(a,r,u,C,f,h,v,w,S,L,D=!1){if(v>200)return!0;e:for(;;)switch(a.kind){case 4:{const T=a.childrenLength;for(let M=0;M200)return!0;let S=!0;if(a.kind===2){let L=0;if(w){let M=w.get(a.openingBracket.text);M===void 0&&(M=0),L=M,M++,w.set(a.openingBracket.text,M)}const D=(0,m.lengthAdd)(r,a.openingBracket.length);let T=-1;if(h.includeMinIndentation&&(T=a.computeMinIndentation(r,h.textModel)),S=h.push(new I.BracketPairWithMinIndentationInfo((0,m.lengthsToRange)(r,u),(0,m.lengthsToRange)(r,D),a.closingBracket?(0,m.lengthsToRange)((0,m.lengthAdd)(D,a.child?.length||m.lengthZero),u):void 0,v,L,a,T)),r=D,S&&a.child){const M=a.child;if(u=(0,m.lengthAdd)(r,M.length),(0,m.lengthLessThanEqual)(r,f)&&(0,m.lengthGreaterThanEqual)(u,C)&&(S=l(M,r,u,C,f,h,v+1,w),!S))return!1}w?.set(a.openingBracket.text,L)}else{let L=r;for(const D of a.children){const T=L;if(L=(0,m.lengthAdd)(L,D.length),(0,m.lengthLessThanEqual)(T,f)&&(0,m.lengthLessThanEqual)(C,L)&&(S=l(D,T,L,C,f,h,v,w),!S))return!1}}return S}}),define(ne[132],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InternalModelContentChangeEvent=e.ModelInjectedTextChangedEvent=e.ModelRawContentChangedEvent=e.ModelRawEOLChanged=e.ModelRawLinesInserted=e.ModelRawLinesDeleted=e.ModelRawLineChanged=e.LineInjectedText=e.ModelRawFlush=void 0;class d{constructor(){this.changeType=1}}e.ModelRawFlush=d;class k{static applyInjectedText(o,t){if(!t||t.length===0)return o;let i="",s=0;for(const g of t)i+=o.substring(s,g.column-1),s=g.column-1,i+=g.options.content;return i+=o.substring(s),i}static fromDecorations(o){const t=[];for(const i of o)i.options.before&&i.options.before.content.length>0&&t.push(new k(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new k(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(o,t,i,s,g){this.ownerId=o,this.lineNumber=t,this.column=i,this.options=s,this.order=g}}e.LineInjectedText=k;class I{constructor(o,t,i){this.changeType=2,this.lineNumber=o,this.detail=t,this.injectedText=i}}e.ModelRawLineChanged=I;class E{constructor(o,t){this.changeType=3,this.fromLineNumber=o,this.toLineNumber=t}}e.ModelRawLinesDeleted=E;class y{constructor(o,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=o,this.toLineNumber=t,this.detail=i}}e.ModelRawLinesInserted=y;class m{constructor(){this.changeType=5}}e.ModelRawEOLChanged=m;class _{constructor(o,t,i,s){this.changes=o,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(o){for(let t=0,i=this.changes.length;tg)throw new b.BugIndicatingError("Illegal value for lineNumber");const c=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,l=!!(c&&c.offSide);let a=-2,r=-1,u=-2,C=-1;const f=O=>{if(a!==-1&&(a===-2||a>O-1)){a=-1,r=-1;for(let F=O-2;F>=0;F--){const x=this._computeIndentLevel(F);if(x>=0){a=F,r=x;break}}}if(u===-2){u=-1,C=-1;for(let F=O;F=0){u=F,C=x;break}}}};let h=-2,v=-1,w=-2,S=-1;const L=O=>{if(h===-2){h=-1,v=-1;for(let F=O-2;F>=0;F--){const x=this._computeIndentLevel(F);if(x>=0){h=F,v=x;break}}}if(w!==-1&&(w===-2||w=0){w=F,S=x;break}}}};let D=0,T=!0,M=0,A=!0,P=0,N=0;for(let O=0;T||A;O++){const F=t-O,x=t+O;O>1&&(F<1||F1&&(x>g||x>s)&&(A=!1),O>5e4&&(T=!1,A=!1);let W=-1;if(T&&F>=1){const q=this._computeIndentLevel(F-1);q>=0?(u=F-1,C=q,W=Math.ceil(q/this.textModel.getOptions().indentSize)):(f(F),W=this._getIndentLevelForWhitespaceLine(l,r,C))}let V=-1;if(A&&x<=g){const q=this._computeIndentLevel(x-1);q>=0?(h=x-1,v=q,V=Math.ceil(q/this.textModel.getOptions().indentSize)):(L(x),V=this._getIndentLevelForWhitespaceLine(l,v,S))}if(O===0){N=W;continue}if(O===1){if(x<=g&&V>=0&&N+1===V){T=!1,D=x,M=x,P=V;continue}if(F>=1&&W>=0&&W-1===N){A=!1,D=F,M=F,P=W;continue}if(D=t,M=t,P=N,P===0)return{startLineNumber:D,endLineNumber:M,indent:P}}T&&(W>=P?D=F:T=!1),A&&(V>=P?M=x:A=!1)}return{startLineNumber:D,endLineNumber:M,indent:P}}getLinesBracketGuides(t,i,s,g){const c=[];for(let f=t;f<=i;f++)c.push([]);const l=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new E.Range(t,1,i,this.textModel.getLineMaxColumn(i))).toArray();let r;if(s&&a.length>0){const f=(t<=s.lineNumber&&s.lineNumber<=i?a:this.textModel.bracketPairs.getBracketPairsInRange(E.Range.fromPositions(s)).toArray()).filter(h=>E.Range.strictContainsPosition(h.range,s));r=(0,d.findLast)(f,h=>l||h.range.startLineNumber!==h.range.endLineNumber)?.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,C=new n;for(const f of a){if(!f.closingBracketRange)continue;const h=r&&f.range.equalsRange(r);if(!h&&!g.includeInactive)continue;const v=C.getInlineClassName(f.nestingLevel,f.nestingLevelOfEqualBracketType,u)+(g.highlightActive&&h?" "+C.activeClassName:""),w=f.openingBracketRange.getStartPosition(),S=f.closingBracketRange.getStartPosition(),L=g.horizontalGuides===_.HorizontalGuidesState.Enabled||g.horizontalGuides===_.HorizontalGuidesState.EnabledForActive&&h;if(f.range.startLineNumber===f.range.endLineNumber){l&&L&&c[f.range.startLineNumber-t].push(new _.IndentGuide(-1,f.openingBracketRange.getEndPosition().column,v,new _.IndentGuideHorizontalLine(!1,S.column),-1,-1));continue}const D=this.getVisibleColumnFromPosition(S),T=this.getVisibleColumnFromPosition(f.openingBracketRange.getStartPosition()),M=Math.min(T,D,f.minVisibleColumnIndentation+1);let A=!1;k.firstNonWhitespaceIndex(this.textModel.getLineContent(f.closingBracketRange.startLineNumber))=t&&T>M&&c[w.lineNumber-t].push(new _.IndentGuide(M,-1,v,new _.IndentGuideHorizontalLine(!1,w.column),-1,-1)),S.lineNumber<=i&&D>M&&c[S.lineNumber-t].push(new _.IndentGuide(M,-1,v,new _.IndentGuideHorizontalLine(!A,S.column),-1,-1)))}for(const f of c)f.sort((h,v)=>h.visibleColumn-v.visibleColumn);return c}getVisibleColumnFromPosition(t){return I.CursorColumns.visibleColumnFromColumn(this.textModel.getLineContent(t.lineNumber),t.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(t,i){this.assertNotDisposed();const s=this.textModel.getLineCount();if(t<1||t>s)throw new Error("Illegal value for startLineNumber");if(i<1||i>s)throw new Error("Illegal value for endLineNumber");const g=this.textModel.getOptions(),c=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,l=!!(c&&c.offSide),a=new Array(i-t+1);let r=-2,u=-1,C=-2,f=-1;for(let h=t;h<=i;h++){const v=h-t,w=this._computeIndentLevel(h-1);if(w>=0){r=h-1,u=w,a[v]=Math.ceil(w/g.indentSize);continue}if(r===-2){r=-1,u=-1;for(let S=h-2;S>=0;S--){const L=this._computeIndentLevel(S);if(L>=0){r=S,u=L;break}}}if(C!==-1&&(C===-2||C=0){C=S,f=L;break}}}a[v]=this._getIndentLevelForWhitespaceLine(l,u,f)}return a}_getIndentLevelForWhitespaceLine(t,i,s){const g=this.textModel.getOptions();return i===-1||s===-1?0:i{this._tokenizationSupports.get(m)===_&&(this._tokenizationSupports.delete(m),this.handleChange([m]))})}get(m){return this._tokenizationSupports.get(m)||null}registerFactory(m,_){this._factories.get(m)?.dispose();const b=new E(this,m,_);return this._factories.set(m,b),(0,k.toDisposable)(()=>{const p=this._factories.get(m);!p||p!==b||(this._factories.delete(m),p.dispose())})}async getOrCreate(m){const _=this.get(m);if(_)return _;const b=this._factories.get(m);return!b||b.isResolved?null:(await b.resolve(),this.get(m))}isResolved(m){if(this.get(m))return!0;const b=this._factories.get(m);return!!(!b||b.isResolved)}setColorMap(m){this._colorMap=m,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}e.TokenizationRegistry=I;class E extends k.Disposable{get isResolved(){return this._isResolved}constructor(m,_,b){super(),this._registry=m,this._languageId=_,this._factory=b,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const m=await this._factory.tokenizationSupport;this._isResolved=!0,m&&!this._isDisposed&&this._register(this._registry.register(this._languageId,m))}}}),define(ne[586],se([1,0]),function(oe,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContiguousMultilineTokens=void 0;class d{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(I,E){this._startLineNumber=I,this._tokens=E}getLineTokens(I){return this._tokens[I-this._startLineNumber]}appendLineTokens(I){this._tokens.push(I)}}e.ContiguousMultilineTokens=d}),define(ne[330],se([1,0,586]),function(oe,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContiguousMultilineTokensBuilder=void 0;class k{constructor(){this._tokens=[]}add(E,y){if(this._tokens.length>0){const m=this._tokens[this._tokens.length-1];if(m.endLineNumber+1===E){m.appendLineTokens(y);return}}this._tokens.push(new d.ContiguousMultilineTokens(E,[y]))}finalize(){return this._tokens}}e.ContiguousMultilineTokensBuilder=k}),define(ne[83],se([1,0,148]),function(oe,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LineTokens=void 0,e.getStandardTokenTypeAtPosition=E;class k{static{this.defaultTokenMetadata=(32768|2<<24)>>>0}static createEmpty(m,_){const b=k.defaultTokenMetadata,p=new Uint32Array(2);return p[0]=m.length,p[1]=b,new k(p,m,_)}static createFromTextAndMetadata(m,_){let b=0,p="";const n=new Array;for(const{text:o,metadata:t}of m)n.push(b+o.length,t),b+=o.length,p+=o;return new k(new Uint32Array(n),p,_)}constructor(m,_,b){this._lineTokensBrand=void 0,this._tokens=m,this._tokensCount=this._tokens.length>>>1,this._text=_,this.languageIdCodec=b}equals(m){return m instanceof k?this.slicedEquals(m,0,this._tokensCount):!1}slicedEquals(m,_,b){if(this._text!==m._text||this._tokensCount!==m._tokensCount)return!1;const p=_<<1,n=p+(b<<1);for(let o=p;o0?this._tokens[m-1<<1]:0}getMetadata(m){return this._tokens[(m<<1)+1]}getLanguageId(m){const _=this._tokens[(m<<1)+1],b=d.TokenMetadata.getLanguageId(_);return this.languageIdCodec.decodeLanguageId(b)}getStandardTokenType(m){const _=this._tokens[(m<<1)+1];return d.TokenMetadata.getTokenType(_)}getForeground(m){const _=this._tokens[(m<<1)+1];return d.TokenMetadata.getForeground(_)}getClassName(m){const _=this._tokens[(m<<1)+1];return d.TokenMetadata.getClassNameFromMetadata(_)}getInlineStyle(m,_){const b=this._tokens[(m<<1)+1];return d.TokenMetadata.getInlineStyleFromMetadata(b,_)}getPresentation(m){const _=this._tokens[(m<<1)+1];return d.TokenMetadata.getPresentationFromMetadata(_)}getEndOffset(m){return this._tokens[m<<1]}findTokenIndexAtOffset(m){return k.findIndexInTokensArray(this._tokens,m)}inflate(){return this}sliceAndInflate(m,_,b){return new I(this,m,_,b)}static convertToEndOffset(m,_){const p=(m.length>>>1)-1;for(let n=0;n>>1)-1;for(;b
_&&(p=n)}return b}withInserted(m){if(m.length===0)return this;let _=0,b=0,p="";const n=new Array;let o=0;for(;;){const t=_o){p+=this._text.substring(o,i.offset);const s=this._tokens[(_<<1)+1];n.push(p.length,s),o=i.offset}p+=i.text,n.push(p.length,i.tokenMetadata),b++}else break}return new k(new Uint32Array(n),p,this.languageIdCodec)}getTokenText(m){const _=this.getStartOffset(m),b=this.getEndOffset(m);return this._text.substring(_,b)}forEach(m){const _=this.getCount();for(let b=0;b<_;b++)m(b)}}e.LineTokens=k;class I{constructor(m,_,b,p){this._source=m,this._startOffset=_,this._endOffset=b,this._deltaOffset=p,this._firstTokenIndex=m.findTokenIndexAtOffset(_),this.languageIdCodec=m.languageIdCodec,this._tokensCount=0;for(let n=this._firstTokenIndex,o=m.getCount();n=b);n++)this._tokensCount++}getMetadata(m){return this._source.getMetadata(this._firstTokenIndex+m)}getLanguageId(m){return this._source.getLanguageId(this._firstTokenIndex+m)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(m){return m instanceof I?this._startOffset===m._startOffset&&this._endOffset===m._endOffset&&this._deltaOffset===m._deltaOffset&&this._source.slicedEquals(m._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(m){return this._source.getStandardTokenType(this._firstTokenIndex+m)}getForeground(m){return this._source.getForeground(this._firstTokenIndex+m)}getEndOffset(m){const _=this._source.getEndOffset(this._firstTokenIndex+m);return Math.min(this._endOffset,_)-this._startOffset+this._deltaOffset}getClassName(m){return this._source.getClassName(this._firstTokenIndex+m)}getInlineStyle(m,_){return this._source.getInlineStyle(this._firstTokenIndex+m,_)}getPresentation(m){return this._source.getPresentation(this._firstTokenIndex+m)}findTokenIndexAtOffset(m){return this._source.findTokenIndexAtOffset(m+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(m){const _=this._firstTokenIndex+m,b=this._source.getStartOffset(_),p=this._source.getEndOffset(_);let n=this._source.getTokenText(_);return bthis._endOffset&&(n=n.substring(0,n.length-(p-this._endOffset))),n}forEach(m){for(let _=0;_{this.model.tokenization.forceTokenization(C);const f=this.model.tokenization.getLineTokens(C),h=this.model.getLineMaxColumn(C)-1;return(0,k.createScopedLineTokens)(f,h)};this.model.tokenization.forceTokenization(p.startLineNumber);const o=this.model.tokenization.getLineTokens(p.startLineNumber),t=(0,k.createScopedLineTokens)(o,p.startColumn-1),i=I.LineTokens.createEmpty("",t.languageIdCodec),s=p.startLineNumber-1;if(s===0||!(t.firstCharOffset===0))return i;const l=n(s);if(!(t.languageId===l.languageId))return i;const r=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(r)}}e.IndentationContextProcessor=y;class m{constructor(p,n){this.model=p,this.languageConfigurationService=n}getProcessedLine(p,n){const o=(s,g)=>{const c=d.getLeadingWhitespace(s);return g+s.substring(c.length)};this.model.tokenization.forceTokenization?.(p);const t=this.model.tokenization.getLineTokens(p);let i=this.getProcessedTokens(t).getLineContent();return n!==void 0&&(i=o(i,n)),i}getProcessedTokens(p){const n=c=>c===2||c===3||c===1,o=p.getLanguageId(0),i=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getBracketRegExp({global:!0}),s=[];return p.forEach(c=>{const l=p.getStandardTokenType(c);let a=p.getTokenText(c);n(l)&&(a=a.replace(i,""));const r=p.getMetadata(c);s.push({text:a,metadata:r})}),I.LineTokens.createFromTextAndMetadata(s,p.languageIdCodec)}}function _(b,p){b.tokenization.forceTokenization(p.lineNumber);const n=b.tokenization.getLineTokens(p.lineNumber),o=(0,k.createScopedLineTokens)(n,p.column-1),t=o.firstCharOffset===0,i=n.getLanguageId(0)===o.languageId;return!t&&!i}}),define(ne[241],se([1,0,11,131,240]),function(oe,e,d,k,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInheritIndentForLine=y,e.getGoodIndentForLine=m,e.getIndentForEnter=_,e.getIndentActionForType=b,e.getIndentMetadata=p;function E(o,t,i){const s=o.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let g,c=-1;for(g=t-1;g>=1;g--){if(o.tokenization.getLanguageIdAtPosition(g,0)!==s)return c;const l=o.getLineContent(g);if(i.shouldIgnore(g)||/^\s+$/.test(l)||l===""){c=g;continue}return g}}return-1}function y(o,t,i,s=!0,g){if(o<4)return null;const c=g.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!c)return null;const l=new I.ProcessedIndentRulesSupport(t,c,g);if(i<=1)return{indentation:"",action:null};for(let r=i-1;r>0&&t.getLineContent(r)==="";r--)if(r===1)return{indentation:"",action:null};const a=E(t,i,l);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(l.shouldIncrease(a)||l.shouldIndentNextLine(a)){const r=t.getLineContent(a);return{indentation:d.getLeadingWhitespace(r),action:k.IndentAction.Indent,line:a}}else if(l.shouldDecrease(a)){const r=t.getLineContent(a);return{indentation:d.getLeadingWhitespace(r),action:null,line:a}}else{if(a===1)return{indentation:d.getLeadingWhitespace(t.getLineContent(a)),action:null,line:a};const r=a-1,u=c.getIndentMetadata(t.getLineContent(r));if(!(u&3)&&u&4){let C=0;for(let f=r-1;f>0;f--)if(!l.shouldIndentNextLine(f)){C=f;break}return{indentation:d.getLeadingWhitespace(t.getLineContent(C+1)),action:null,line:C+1}}if(s)return{indentation:d.getLeadingWhitespace(t.getLineContent(a)),action:null,line:a};for(let C=a;C>0;C--){if(l.shouldIncrease(C))return{indentation:d.getLeadingWhitespace(t.getLineContent(C)),action:k.IndentAction.Indent,line:C};if(l.shouldIndentNextLine(C)){let f=0;for(let h=C-1;h>0;h--)if(!l.shouldIndentNextLine(C)){f=h;break}return{indentation:d.getLeadingWhitespace(t.getLineContent(f+1)),action:null,line:f+1}}else if(l.shouldDecrease(C))return{indentation:d.getLeadingWhitespace(t.getLineContent(C)),action:null,line:C}}return{indentation:d.getLeadingWhitespace(t.getLineContent(1)),action:null,line:1}}}function m(o,t,i,s,g,c){if(o<4)return null;const l=c.getLanguageConfiguration(i);if(!l)return null;const a=c.getLanguageConfiguration(i).indentRulesSupport;if(!a)return null;const r=new I.ProcessedIndentRulesSupport(t,a,c),u=y(o,t,s,void 0,c);if(u){const C=u.line;if(C!==void 0){let f=!0;for(let h=C;h