=f&&(m=m-l%f),m}e.lengthAdd=i;function n(l,p){return l.reduce((m,v)=>i(m,p(v)),e.lengthZero)}e.sumLengths=n;function t(l,p){return l===p}e.lengthEquals=t;function a(l,p){const m=l,v=p;if(v-m<=0)return e.lengthZero;const w=Math.floor(m/f),E=Math.floor(v/f),I=v-E*f;if(w===E){const M=m-w*f;return _(0,I-M)}else return _(E-w,I)}e.lengthDiffNonNegative=a;function u(l,p){return l=p}e.lengthGreaterThanEqual=r;function c(l){return _(l.lineNumber-1,l.column-1)}e.positionToLength=c;function o(l,p){const m=l,v=Math.floor(m/f),b=m-v*f,w=p,E=Math.floor(w/f),I=w-E*f;return new k.Range(v+1,b+1,E+1,I+1)}e.lengthsToRange=o;function d(l){const p=(0,L.splitLines)(l);return _(p.length-1,p[p.length-1].length)}e.lengthOfString=d}),define(ne[179],se([1,0,5,91]),function(Q,e,L,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BeforeEditPositionMapper=e.TextEditInfo=void 0;class y{static fromModelContentChanges(_){return _.map(C=>{const s=L.Range.lift(C.range);return new y((0,k.positionToLength)(s.getStartPosition()),(0,k.positionToLength)(s.getEndPosition()),(0,k.lengthOfString)(C.text))}).reverse()}constructor(_,g,C){this.startOffset=_,this.endOffset=g,this.newLength=C}toString(){return`[${(0,k.lengthToObj)(this.startOffset)}...${(0,k.lengthToObj)(this.endOffset)}) -> ${(0,k.lengthToObj)(this.newLength)}`}}e.TextEditInfo=y;class D{constructor(_){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=_.map(g=>S.from(g))}getOffsetBeforeChange(_){return this.adjustNextEdit(_),this.translateCurToOld(_)}getDistanceToNextChange(_){this.adjustNextEdit(_);const g=this.edits[this.nextEditIdx],C=g?this.translateOldToCur(g.offsetObj):null;return C===null?null:(0,k.lengthDiffNonNegative)(_,C)}translateOldToCur(_){return _.lineCount===this.deltaLineIdxInOld?(0,k.toLength)(_.lineCount+this.deltaOldToNewLineCount,_.columnCount+this.deltaOldToNewColumnCount):(0,k.toLength)(_.lineCount+this.deltaOldToNewLineCount,_.columnCount)}translateCurToOld(_){const g=(0,k.lengthToObj)(_);return g.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?(0,k.toLength)(g.lineCount-this.deltaOldToNewLineCount,g.columnCount-this.deltaOldToNewColumnCount):(0,k.toLength)(g.lineCount-this.deltaOldToNewLineCount,g.columnCount)}adjustNextEdit(_){for(;this.nextEditIdx!0)||[];return i&&c.unshift(i),c}const r=[];for(;i&&!(0,y.lengthIsZero)(h);){const[c,o]=i.splitAt(h);r.push(c),h=(0,y.lengthDiffNonNegative)(c.lengthAfter,h),i=o??C.dequeue()}return(0,y.lengthIsZero)(h)||r.push(new S(!1,h,h)),r}const t=[];function a(h,r,c){if(t.length>0&&(0,y.lengthEquals)(t[t.length-1].endOffset,h)){const o=t[t.length-1];t[t.length-1]=new k.TextEditInfo(o.startOffset,r,(0,y.lengthAdd)(o.newLength,c))}else t.push({startOffset:h,endOffset:r,newLength:c})}let u=y.lengthZero;for(const h of s){const r=n(h.lengthBefore);if(h.modified){const c=(0,y.sumLengths)(r,d=>d.lengthBefore),o=(0,y.lengthAdd)(u,c);a(u,o,h.lengthAfter),u=o}else for(const c of r){const o=u;u=(0,y.lengthAdd)(u,c.lengthBefore),c.modified&&a(o,u,c.lengthAfter)}}return t}e.combineTextEditInfos=D;class S{constructor(g,C,s){this.modified=g,this.lengthBefore=C,this.lengthAfter=s}splitAt(g){const C=(0,y.lengthDiffNonNegative)(g,this.lengthAfter);return(0,y.lengthEquals)(C,y.lengthZero)?[this,void 0]:this.modified?[new S(this.modified,this.lengthBefore,g),new S(this.modified,y.lengthZero,C)]:[new S(this.modified,g,g),new S(this.modified,C,C)]}toString(){return`${this.modified?"M":"U"}:${(0,y.lengthToObj)(this.lengthBefore)} -> ${(0,y.lengthToObj)(this.lengthAfter)}`}}function f(_){const g=[];let C=y.lengthZero;for(const s of _){const i=(0,y.lengthDiffNonNegative)(C,s.startOffset);(0,y.lengthIsZero)(i)||g.push(new S(!1,i,i));const n=(0,y.lengthDiffNonNegative)(s.startOffset,s.endOffset);g.push(new S(!0,n,s.newLength)),C=s.endOffset}return g}}),define(ne[505],se([1,0,91]),function(Q,e,L){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeReader=void 0;class k{constructor(f){this.lastOffset=L.lengthZero,this.nextNodes=[f],this.offsets=[L.lengthZero],this.idxs=[]}readLongestNodeAt(f,_){if((0,L.lengthLessThan)(f,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=f;;){const g=D(this.nextNodes);if(!g)return;const C=D(this.offsets);if((0,L.lengthLessThan)(f,C))return;if((0,L.lengthLessThan)(C,f))if((0,L.lengthAdd)(C,g.length)<=f)this.nextNodeAfterCurrent();else{const s=y(g);s!==-1?(this.nextNodes.push(g.getChild(s)),this.offsets.push(C),this.idxs.push(s)):this.nextNodeAfterCurrent()}else{if(_(g))return this.nextNodeAfterCurrent(),g;{const s=y(g);if(s===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(g.getChild(s)),this.offsets.push(C),this.idxs.push(s)}}}}nextNodeAfterCurrent(){for(;;){const f=D(this.offsets),_=D(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const g=D(this.nextNodes),C=y(g,this.idxs[this.idxs.length-1]);if(C!==-1){this.nextNodes.push(g.getChild(C)),this.offsets.push((0,L.lengthAdd)(f,_.length)),this.idxs[this.idxs.length-1]=C;break}else this.idxs.pop()}}}e.NodeReader=k;function y(S,f=-1){for(;;){if(f++,f>=S.childrenLength)return-1;if(S.getChild(f))return f}}function D(S){return S.length>0?S[S.length-1]:void 0}}),define(ne[126],se([1,0]),function(Q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DenseKeyProvider=e.identityKeyProvider=e.SmallImmutableSet=void 0;const L=[];class k{static create(S,f){if(S<=128&&f.length===0){let _=k.cache[S];return _||(_=new k(S,f),k.cache[S]=_),_}return new k(S,f)}static getEmpty(){return this.empty}constructor(S,f){this.items=S,this.additionalItems=f}add(S,f){const _=f.getKey(S);let g=_>>5;if(g===0){const s=1<<_|this.items;return s===this.items?this:k.create(s,this.additionalItems)}g--;const C=this.additionalItems.slice(0);for(;C.length=g.length)return null;const a=C,u=g[a].listHeight;for(C++;C=2?y(a===0&&C===g.length?g:g.slice(a,C),!1):g[a]}let i=s(),n=s();if(!n)return i;for(let a=s();a;a=s())D(i,n)<=D(n,a)?(i=S(i,n),n=a):n=S(n,a);return S(i,n)}e.concat23Trees=k;function y(g,C=!1){if(g.length===0)return null;if(g.length===1)return g[0];let s=g.length;for(;s>3;){const i=s>>1;for(let n=0;n=3?g[2]:null,C)}e.concat23TreesOfSameHeight=y;function D(g,C){return Math.abs(g.listHeight-C.listHeight)}function S(g,C){return g.listHeight===C.listHeight?L.ListAstNode.create23(g,C,null,!1):g.listHeight>C.listHeight?f(g,C):_(C,g)}function f(g,C){g=g.toMutable();let s=g;const i=[];let n;for(;;){if(C.listHeight===s.listHeight){n=C;break}if(s.kind!==4)throw new Error("unexpected");i.push(s),s=s.makeLastElementMutable()}for(let t=i.length-1;t>=0;t--){const a=i[t];n?a.childrenLength>=3?n=L.ListAstNode.create23(a.unappendChild(),n,null,!1):(a.appendChildOfSameHeight(n),n=void 0):a.handleChildrenChanged()}return n?L.ListAstNode.create23(g,n,null,!1):g}function _(g,C){g=g.toMutable();let s=g;const i=[];for(;C.listHeight!==s.listHeight;){if(s.kind!==4)throw new Error("unexpected");i.push(s),s=s.makeFirstElementMutable()}let n=C;for(let t=i.length-1;t>=0;t--){const a=i[t];n?a.childrenLength>=3?n=L.ListAstNode.create23(n,a.unprependChild(),null,!1):(a.prependChildOfSameHeight(n),n=void 0):a.handleChildrenChanged()}return n?L.ListAstNode.create23(n,g,null,!1):g}}),define(ne[279],se([1,0,180,179,126,91,506,505]),function(Q,e,L,k,y,D,S,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseDocument=void 0;function _(C,s,i,n){return new g(C,s,i,n).parseDocument()}e.parseDocument=_;class g{constructor(s,i,n,t){if(this.tokenizer=s,this.createImmutableLists=t,this._itemsConstructed=0,this._itemsFromCache=0,n&&t)throw new Error("Not supported");this.oldNodeReader=n?new f.NodeReader(n):void 0,this.positionMapper=new k.BeforeEditPositionMapper(i)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let s=this.parseList(y.SmallImmutableSet.getEmpty(),0);return s||(s=L.ListAstNode.getEmpty()),s}parseList(s,i){const n=[];for(;;){let a=this.tryReadChildFromCache(s);if(!a){const u=this.tokenizer.peek();if(!u||u.kind===2&&u.bracketIds.intersects(s))break;a=this.parseChild(s,i+1)}a.kind===4&&a.childrenLength===0||n.push(a)}return this.oldNodeReader?(0,S.concat23Trees)(n):(0,S.concat23TreesOfSameHeight)(n,this.createImmutableLists)}tryReadChildFromCache(s){if(this.oldNodeReader){const i=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(i===null||!(0,D.lengthIsZero)(i)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),t=>i!==null&&!(0,D.lengthLessThan)(t.length,i)?!1:t.canBeReused(s));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(s,i){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new L.InvalidBracketAstNode(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(i>300)return new L.TextAstNode(n.length);const t=s.merge(n.bracketIds),a=this.parseList(t,i+1),u=this.tokenizer.peek();return u&&u.kind===2&&(u.bracketId===n.bracketId||u.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),L.PairAstNode.create(n.astNode,a,u.astNode)):L.PairAstNode.create(n.astNode,a,null)}default:throw new Error("unexpected")}}}}),define(ne[206],se([1,0,9,124,180,91,126]),function(Q,e,L,k,y,D,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FastTokenizer=e.TextBufferTokenizer=e.Token=void 0;class f{constructor(i,n,t,a,u){this.length=i,this.kind=n,this.bracketId=t,this.bracketIds=a,this.astNode=u}}e.Token=f;class _{constructor(i,n){this.textModel=i,this.bracketTokens=n,this.reader=new g(this.textModel,this.bracketTokens),this._offset=D.lengthZero,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=i.getLineCount(),this.textBufferLastLineLength=i.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return(0,D.toLength)(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(i){this.didPeek=!1,this._offset=(0,D.lengthAdd)(this._offset,i);const n=(0,D.lengthToObj)(this._offset);this.reader.setPosition(n.lineCount,n.columnCount)}read(){let i;return this.peeked?(this.didPeek=!1,i=this.peeked):i=this.reader.read(),i&&(this._offset=(0,D.lengthAdd)(this._offset,i.length)),i}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}e.TextBufferTokenizer=_;class g{constructor(i,n){this.textModel=i,this.bracketTokens=n,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=i.getLineCount(),this.textBufferLastLineLength=i.getLineLength(this.textBufferLineCount)}setPosition(i,n){i===this.lineIdx?(this.lineCharOffset=n,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=i,this.lineCharOffset=n,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const u=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=(0,D.lengthGetColumnCountIfZeroLineCount)(u.length),u}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 i=this.lineIdx,n=this.lineCharOffset;let t=0;for(;;){const u=this.lineTokens,h=u.getCount();let r=null;if(this.lineTokenOffset1e3))break;if(t>1500)break}const a=(0,D.lengthDiff)(i,n,this.lineIdx,this.lineCharOffset);return new f(a,0,-1,S.SmallImmutableSet.getEmpty(),new y.TextAstNode(a))}}class C{constructor(i,n){this.text=i,this._offset=D.lengthZero,this.idx=0;const t=n.getRegExpStr(),a=t?new RegExp(t+`|
-`,"gi"):null,u=[];let h,r=0,c=0,o=0,d=0;const l=[];for(let v=0;v<60;v++)l.push(new f((0,D.toLength)(0,v),0,-1,S.SmallImmutableSet.getEmpty(),new y.TextAstNode((0,D.toLength)(0,v))));const p=[];for(let v=0;v<60;v++)p.push(new f((0,D.toLength)(1,v),0,-1,S.SmallImmutableSet.getEmpty(),new y.TextAstNode((0,D.toLength)(1,v))));if(a)for(a.lastIndex=0;(h=a.exec(i))!==null;){const v=h.index,b=h[0];if(b===`
-`)r++,c=v+1;else{if(o!==v){let w;if(d===r){const E=v-o;if(E_(i)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const s=this.getRegExpStr();this._regExpGlobal=s?new RegExp(s,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(s){return this.map.get(s.toLowerCase())}findClosingTokenText(s){for(const[i,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(s))return i}get isEmpty(){return this.map.size===0}}e.BracketTokens=f;function _(C){let s=(0,L.escapeRegExpCharacters)(C);return/^[\w ]+/.test(C)&&(s=`\\b${s}`),/[\w ]+$/.test(C)&&(s=`${s}\\b`),s}class g{constructor(s,i){this.denseKeyProvider=s,this.getLanguageConfiguration=i,this.languageIdToBracketTokens=new Map}didLanguageChange(s){return this.languageIdToBracketTokens.has(s)}getSingleLanguageBracketTokens(s){let i=this.languageIdToBracketTokens.get(s);return i||(i=f.createFromLanguage(this.getLanguageConfiguration(s),this.denseKeyProvider),this.languageIdToBracketTokens.set(s,i)),i}}e.LanguageAgnosticBracketTokens=g}),define(ne[507],se([1,0,280,91,279,126,206]),function(Q,e,L,k,y,D,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fixBracketsInLine=void 0;function f(g,C){const s=new D.DenseKeyProvider,i=new L.LanguageAgnosticBracketTokens(s,r=>C.getLanguageConfiguration(r)),n=new S.TextBufferTokenizer(new _([g]),i),t=(0,y.parseDocument)(n,[],void 0,!0);let a="";const u=g.getLineContent();function h(r,c){if(r.kind===2)if(h(r.openingBracket,c),c=(0,k.lengthAdd)(c,r.openingBracket.length),r.child&&(h(r.child,c),c=(0,k.lengthAdd)(c,r.child.length)),r.closingBracket)h(r.closingBracket,c),c=(0,k.lengthAdd)(c,r.closingBracket.length);else{const d=i.getSingleLanguageBracketTokens(r.openingBracket.languageId).findClosingTokenText(r.openingBracket.bracketIds);a+=d}else if(r.kind!==3){if(r.kind===0||r.kind===1)a+=u.substring((0,k.lengthGetColumnCountIfZeroLineCount)(c),(0,k.lengthGetColumnCountIfZeroLineCount)((0,k.lengthAdd)(c,r.length)));else if(r.kind===4)for(const o of r.children)h(o,c),c=(0,k.lengthAdd)(c,o.length)}}return h(t,k.lengthZero),a}e.fixBracketsInLine=f;class _{constructor(C){this.lines=C,this.tokenization={getLineTokens:s=>this.lines[s-1]}}getLineCount(){return this.lines.length}getLineLength(C){return this.lines[C-1].getLineContent().length}}}),define(ne[508],se([1,0,14]),function(Q,e,L){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FixedArray=void 0;class k{constructor(S){this._default=S,this._store=[]}get(S){return S=this._store.length;)this._store[this._store.length]=this._default;this._store[S]=f}replace(S,f,_){if(S>=this._store.length)return;if(f===0){this.insert(S,_);return}else if(_===0){this.delete(S,f);return}const g=this._store.slice(0,S),C=this._store.slice(S+f),s=y(_,this._default);this._store=g.concat(s,C)}delete(S,f){f===0||S>=this._store.length||this._store.splice(S,f)}insert(S,f){if(f===0||S>=this._store.length)return;const _=[];for(let g=0;g0&&i>0||n>0&&t>0)return;const a=Math.abs(i-t),u=Math.abs(s-n);if(a===0){g.spacesDiff=u,u>0&&0<=n-1&&n-10?g++:v>1&&C++,k(s,i,d,m,u),u.looksLikeAlignment&&!(f&&S===u.spacesDiff)))continue;const w=u.spacesDiff;w<=t&&a[w]++,s=d,i=m}let h=f;g!==C&&(h=g{const d=a[o];d>c&&(c=d,r=o)}),r===4&&a[4]>0&&a[2]>0&&a[2]>=a[4]/2&&(r=2)}return{insertSpaces:h,tabSize:r}}e.guessIndentation=y}),define(ne[510],se([1,0]),function(Q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.intervalCompare=e.recomputeMaxEnd=e.nodeAcceptEdit=e.IntervalTree=e.SENTINEL=e.IntervalNode=e.getNodeColor=void 0;function L(F){return(F.metadata&1)>>>0}e.getNodeColor=L;function k(F,O){F.metadata=F.metadata&254|O<<0}function y(F){return(F.metadata&2)>>>1===1}function D(F,O){F.metadata=F.metadata&253|(O?1:0)<<1}function S(F){return(F.metadata&4)>>>2===1}function f(F,O){F.metadata=F.metadata&251|(O?1:0)<<2}function _(F){return(F.metadata&64)>>>6===1}function g(F,O){F.metadata=F.metadata&191|(O?1:0)<<6}function C(F){return(F.metadata&24)>>>3}function s(F,O){F.metadata=F.metadata&231|O<<3}function i(F){return(F.metadata&32)>>>5===1}function n(F,O){F.metadata=F.metadata&223|(O?1:0)<<5}class t{constructor(O,W,U){this.metadata=0,this.parent=this,this.left=this,this.right=this,k(this,1),this.start=W,this.end=U,this.delta=0,this.maxEnd=U,this.id=O,this.ownerId=0,this.options=null,f(this,!1),g(this,!1),s(this,1),n(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=W,this.cachedAbsoluteEnd=U,this.range=null,D(this,!1)}reset(O,W,U,j){this.start=W,this.end=U,this.maxEnd=U,this.cachedVersionId=O,this.cachedAbsoluteStart=W,this.cachedAbsoluteEnd=U,this.range=j}setOptions(O){this.options=O;const W=this.options.className;f(this,W==="squiggly-error"||W==="squiggly-warning"||W==="squiggly-info"),g(this,this.options.glyphMarginClassName!==null),s(this,this.options.stickiness),n(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(O,W,U){this.cachedVersionId!==U&&(this.range=null),this.cachedVersionId=U,this.cachedAbsoluteStart=O,this.cachedAbsoluteEnd=W}detach(){this.parent=null,this.left=null,this.right=null}}e.IntervalNode=t,e.SENTINEL=new t(null,0,0),e.SENTINEL.parent=e.SENTINEL,e.SENTINEL.left=e.SENTINEL,e.SENTINEL.right=e.SENTINEL,k(e.SENTINEL,0);class a{constructor(){this.root=e.SENTINEL,this.requestNormalizeDelta=!1}intervalSearch(O,W,U,j,R,K){return this.root===e.SENTINEL?[]:m(this,O,W,U,j,R,K)}search(O,W,U,j){return this.root===e.SENTINEL?[]:p(this,O,W,U,j)}collectNodesFromOwner(O){return d(this,O)}collectNodesPostOrder(){return l(this)}insert(O){v(this,O),this._normalizeDeltaIfNecessary()}delete(O){w(this,O),this._normalizeDeltaIfNecessary()}resolveNode(O,W){const U=O;let j=0;for(;O!==this.root;)O===O.parent.right&&(j+=O.parent.delta),O=O.parent;const R=U.start+j,K=U.end+j;U.setCachedOffsets(R,K,W)}acceptReplace(O,W,U,j){const R=c(this,O,O+W);for(let K=0,G=R.length;KW||U===1?!1:U===2?!0:O}function r(F,O,W,U,j){const R=C(F),K=R===0||R===2,G=R===1||R===2,Z=W-O,J=U,X=Math.min(Z,J),H=F.start;let B=!1;const V=F.end;let Y=!1;O<=H&&V<=W&&i(F)&&(F.start=O,B=!0,F.end=O,Y=!0);{const ae=j?1:Z>0?2:0;!B&&h(H,K,O,ae)&&(B=!0),!Y&&h(V,G,O,ae)&&(Y=!0)}if(X>0&&!j){const ae=Z>J?2:0;!B&&h(H,K,O+X,ae)&&(B=!0),!Y&&h(V,G,O+X,ae)&&(Y=!0)}{const ae=j?1:0;!B&&h(H,K,W,ae)&&(F.start=O+J,B=!0),!Y&&h(V,G,W,ae)&&(F.end=O+J,Y=!0)}const ie=J-Z;B||(F.start=Math.max(0,H+ie)),Y||(F.end=Math.max(0,V+ie)),F.start>F.end&&(F.end=F.start)}e.nodeAcceptEdit=r;function c(F,O,W){let U=F.root,j=0,R=0,K=0,G=0;const Z=[];let J=0;for(;U!==e.SENTINEL;){if(y(U)){D(U.left,!1),D(U.right,!1),U===U.parent.right&&(j-=U.parent.delta),U=U.parent;continue}if(!y(U.left)){if(R=j+U.maxEnd,RW){D(U,!0);continue}if(G=j+U.end,G>=O&&(U.setCachedOffsets(K,G,0),Z[J++]=U),D(U,!0),U.right!==e.SENTINEL&&!y(U.right)){j+=U.delta,U=U.right;continue}}return D(F.root,!1),Z}function o(F,O,W,U){let j=F.root,R=0,K=0,G=0;const Z=U-(W-O);for(;j!==e.SENTINEL;){if(y(j)){D(j.left,!1),D(j.right,!1),j===j.parent.right&&(R-=j.parent.delta),T(j),j=j.parent;continue}if(!y(j.left)){if(K=R+j.maxEnd,KW){j.start+=Z,j.end+=Z,j.delta+=Z,(j.delta<-1073741824||j.delta>1073741824)&&(F.requestNormalizeDelta=!0),D(j,!0);continue}if(D(j,!0),j.right!==e.SENTINEL&&!y(j.right)){R+=j.delta,j=j.right;continue}}D(F.root,!1)}function d(F,O){let W=F.root;const U=[];let j=0;for(;W!==e.SENTINEL;){if(y(W)){D(W.left,!1),D(W.right,!1),W=W.parent;continue}if(W.left!==e.SENTINEL&&!y(W.left)){W=W.left;continue}if(W.ownerId===O&&(U[j++]=W),D(W,!0),W.right!==e.SENTINEL&&!y(W.right)){W=W.right;continue}}return D(F.root,!1),U}function l(F){let O=F.root;const W=[];let U=0;for(;O!==e.SENTINEL;){if(y(O)){D(O.left,!1),D(O.right,!1),O=O.parent;continue}if(O.left!==e.SENTINEL&&!y(O.left)){O=O.left;continue}if(O.right!==e.SENTINEL&&!y(O.right)){O=O.right;continue}W[U++]=O,D(O,!0)}return D(F.root,!1),W}function p(F,O,W,U,j){let R=F.root,K=0,G=0,Z=0;const J=[];let X=0;for(;R!==e.SENTINEL;){if(y(R)){D(R.left,!1),D(R.right,!1),R===R.parent.right&&(K-=R.parent.delta),R=R.parent;continue}if(R.left!==e.SENTINEL&&!y(R.left)){R=R.left;continue}G=K+R.start,Z=K+R.end,R.setCachedOffsets(G,Z,U);let H=!0;if(O&&R.ownerId&&R.ownerId!==O&&(H=!1),W&&S(R)&&(H=!1),j&&!_(R)&&(H=!1),H&&(J[X++]=R),D(R,!0),R.right!==e.SENTINEL&&!y(R.right)){K+=R.delta,R=R.right;continue}}return D(F.root,!1),J}function m(F,O,W,U,j,R,K){let G=F.root,Z=0,J=0,X=0,H=0;const B=[];let V=0;for(;G!==e.SENTINEL;){if(y(G)){D(G.left,!1),D(G.right,!1),G===G.parent.right&&(Z-=G.parent.delta),G=G.parent;continue}if(!y(G.left)){if(J=Z+G.maxEnd,JW){D(G,!0);continue}if(H=Z+G.end,H>=O){G.setCachedOffsets(X,H,R);let Y=!0;U&&G.ownerId&&G.ownerId!==U&&(Y=!1),j&&S(G)&&(Y=!1),K&&!_(G)&&(Y=!1),Y&&(B[V++]=G)}if(D(G,!0),G.right!==e.SENTINEL&&!y(G.right)){Z+=G.delta,G=G.right;continue}}return D(F.root,!1),B}function v(F,O){if(F.root===e.SENTINEL)return O.parent=e.SENTINEL,O.left=e.SENTINEL,O.right=e.SENTINEL,k(O,0),F.root=O,F.root;b(F,O),A(O.parent);let W=O;for(;W!==F.root&&L(W.parent)===1;)if(W.parent===W.parent.parent.left){const U=W.parent.parent.right;L(U)===1?(k(W.parent,0),k(U,0),k(W.parent.parent,1),W=W.parent.parent):(W===W.parent.right&&(W=W.parent,M(F,W)),k(W.parent,0),k(W.parent.parent,1),P(F,W.parent.parent))}else{const U=W.parent.parent.left;L(U)===1?(k(W.parent,0),k(U,0),k(W.parent.parent,1),W=W.parent.parent):(W===W.parent.left&&(W=W.parent,P(F,W)),k(W.parent,0),k(W.parent.parent,1),M(F,W.parent.parent))}return k(F.root,0),O}function b(F,O){let W=0,U=F.root;const j=O.start,R=O.end;for(;;)if(N(j,R,U.start+W,U.end+W)<0)if(U.left===e.SENTINEL){O.start-=W,O.end-=W,O.maxEnd-=W,U.left=O;break}else U=U.left;else if(U.right===e.SENTINEL){O.start-=W+U.delta,O.end-=W+U.delta,O.maxEnd-=W+U.delta,U.right=O;break}else W+=U.delta,U=U.right;O.parent=U,O.left=e.SENTINEL,O.right=e.SENTINEL,k(O,1)}function w(F,O){let W,U;if(O.left===e.SENTINEL?(W=O.right,U=O,W.delta+=O.delta,(W.delta<-1073741824||W.delta>1073741824)&&(F.requestNormalizeDelta=!0),W.start+=O.delta,W.end+=O.delta):O.right===e.SENTINEL?(W=O.left,U=O):(U=E(O.right),W=U.right,W.start+=U.delta,W.end+=U.delta,W.delta+=U.delta,(W.delta<-1073741824||W.delta>1073741824)&&(F.requestNormalizeDelta=!0),U.start+=O.delta,U.end+=O.delta,U.delta=O.delta,(U.delta<-1073741824||U.delta>1073741824)&&(F.requestNormalizeDelta=!0)),U===F.root){F.root=W,k(W,0),O.detach(),I(),T(W),F.root.parent=e.SENTINEL;return}const j=L(U)===1;if(U===U.parent.left?U.parent.left=W:U.parent.right=W,U===O?W.parent=U.parent:(U.parent===O?W.parent=U:W.parent=U.parent,U.left=O.left,U.right=O.right,U.parent=O.parent,k(U,L(O)),O===F.root?F.root=U:O===O.parent.left?O.parent.left=U:O.parent.right=U,U.left!==e.SENTINEL&&(U.left.parent=U),U.right!==e.SENTINEL&&(U.right.parent=U)),O.detach(),j){A(W.parent),U!==O&&(A(U),A(U.parent)),I();return}A(W),A(W.parent),U!==O&&(A(U),A(U.parent));let R;for(;W!==F.root&&L(W)===0;)W===W.parent.left?(R=W.parent.right,L(R)===1&&(k(R,0),k(W.parent,1),M(F,W.parent),R=W.parent.right),L(R.left)===0&&L(R.right)===0?(k(R,1),W=W.parent):(L(R.right)===0&&(k(R.left,0),k(R,1),P(F,R),R=W.parent.right),k(R,L(W.parent)),k(W.parent,0),k(R.right,0),M(F,W.parent),W=F.root)):(R=W.parent.left,L(R)===1&&(k(R,0),k(W.parent,1),P(F,W.parent),R=W.parent.left),L(R.left)===0&&L(R.right)===0?(k(R,1),W=W.parent):(L(R.left)===0&&(k(R.right,0),k(R,1),M(F,R),R=W.parent.left),k(R,L(W.parent)),k(W.parent,0),k(R.left,0),P(F,W.parent),W=F.root));k(W,0),I()}function E(F){for(;F.left!==e.SENTINEL;)F=F.left;return F}function I(){e.SENTINEL.parent=e.SENTINEL,e.SENTINEL.delta=0,e.SENTINEL.start=0,e.SENTINEL.end=0}function M(F,O){const W=O.right;W.delta+=O.delta,(W.delta<-1073741824||W.delta>1073741824)&&(F.requestNormalizeDelta=!0),W.start+=O.delta,W.end+=O.delta,O.right=W.left,W.left!==e.SENTINEL&&(W.left.parent=O),W.parent=O.parent,O.parent===e.SENTINEL?F.root=W:O===O.parent.left?O.parent.left=W:O.parent.right=W,W.left=O,O.parent=W,T(O),T(W)}function P(F,O){const W=O.left;O.delta-=W.delta,(O.delta<-1073741824||O.delta>1073741824)&&(F.requestNormalizeDelta=!0),O.start-=W.delta,O.end-=W.delta,O.left=W.right,W.right!==e.SENTINEL&&(W.right.parent=O),W.parent=O.parent,O.parent===e.SENTINEL?F.root=W:O===O.parent.right?O.parent.right=W:O.parent.left=W,W.right=O,O.parent=W,T(O),T(W)}function x(F){let O=F.end;if(F.left!==e.SENTINEL){const W=F.left.maxEnd;W>O&&(O=W)}if(F.right!==e.SENTINEL){const W=F.right.maxEnd+F.delta;W>O&&(O=W)}return O}function T(F){F.maxEnd=x(F)}e.recomputeMaxEnd=T;function A(F){for(;F!==e.SENTINEL;){const O=x(F);if(F.maxEnd===O)return;F.maxEnd=O,F=F.parent}}function N(F,O,W,U){return F===W?O-U:F-W}e.intervalCompare=N}),define(ne[511],se([1,0]),function(Q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.recomputeTreeMetadata=e.updateTreeMetadata=e.fixInsert=e.rbDelete=e.rightRotate=e.leftRotate=e.righttest=e.leftest=e.SENTINEL=e.TreeNode=void 0;class L{constructor(a,u){this.piece=a,this.color=u,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 a=this;for(;a.parent!==e.SENTINEL&&a.parent.left!==a;)a=a.parent;return a.parent===e.SENTINEL?e.SENTINEL:a.parent}prev(){if(this.left!==e.SENTINEL)return y(this.left);let a=this;for(;a.parent!==e.SENTINEL&&a.parent.right!==a;)a=a.parent;return a.parent===e.SENTINEL?e.SENTINEL:a.parent}detach(){this.parent=null,this.left=null,this.right=null}}e.TreeNode=L,e.SENTINEL=new L(null,0),e.SENTINEL.parent=e.SENTINEL,e.SENTINEL.left=e.SENTINEL,e.SENTINEL.right=e.SENTINEL,e.SENTINEL.color=0;function k(t){for(;t.left!==e.SENTINEL;)t=t.left;return t}e.leftest=k;function y(t){for(;t.right!==e.SENTINEL;)t=t.right;return t}e.righttest=y;function D(t){return t===e.SENTINEL?0:t.size_left+t.piece.length+D(t.right)}function S(t){return t===e.SENTINEL?0:t.lf_left+t.piece.lineFeedCnt+S(t.right)}function f(){e.SENTINEL.parent=e.SENTINEL}function _(t,a){const u=a.right;u.size_left+=a.size_left+(a.piece?a.piece.length:0),u.lf_left+=a.lf_left+(a.piece?a.piece.lineFeedCnt:0),a.right=u.left,u.left!==e.SENTINEL&&(u.left.parent=a),u.parent=a.parent,a.parent===e.SENTINEL?t.root=u:a.parent.left===a?a.parent.left=u:a.parent.right=u,u.left=a,a.parent=u}e.leftRotate=_;function g(t,a){const u=a.left;a.left=u.right,u.right!==e.SENTINEL&&(u.right.parent=a),u.parent=a.parent,a.size_left-=u.size_left+(u.piece?u.piece.length:0),a.lf_left-=u.lf_left+(u.piece?u.piece.lineFeedCnt:0),a.parent===e.SENTINEL?t.root=u:a===a.parent.right?a.parent.right=u:a.parent.left=u,u.right=a,a.parent=u}e.rightRotate=g;function C(t,a){let u,h;if(a.left===e.SENTINEL?(h=a,u=h.right):a.right===e.SENTINEL?(h=a,u=h.left):(h=k(a.right),u=h.right),h===t.root){t.root=u,u.color=0,a.detach(),f(),t.root.parent=e.SENTINEL;return}const r=h.color===1;if(h===h.parent.left?h.parent.left=u:h.parent.right=u,h===a?(u.parent=h.parent,n(t,u)):(h.parent===a?u.parent=h:u.parent=h.parent,n(t,u),h.left=a.left,h.right=a.right,h.parent=a.parent,h.color=a.color,a===t.root?t.root=h:a===a.parent.left?a.parent.left=h:a.parent.right=h,h.left!==e.SENTINEL&&(h.left.parent=h),h.right!==e.SENTINEL&&(h.right.parent=h),h.size_left=a.size_left,h.lf_left=a.lf_left,n(t,h)),a.detach(),u.parent.left===u){const o=D(u),d=S(u);if(o!==u.parent.size_left||d!==u.parent.lf_left){const l=o-u.parent.size_left,p=d-u.parent.lf_left;u.parent.size_left=o,u.parent.lf_left=d,i(t,u.parent,l,p)}}if(n(t,u.parent),r){f();return}let c;for(;u!==t.root&&u.color===0;)u===u.parent.left?(c=u.parent.right,c.color===1&&(c.color=0,u.parent.color=1,_(t,u.parent),c=u.parent.right),c.left.color===0&&c.right.color===0?(c.color=1,u=u.parent):(c.right.color===0&&(c.left.color=0,c.color=1,g(t,c),c=u.parent.right),c.color=u.parent.color,u.parent.color=0,c.right.color=0,_(t,u.parent),u=t.root)):(c=u.parent.left,c.color===1&&(c.color=0,u.parent.color=1,g(t,u.parent),c=u.parent.left),c.left.color===0&&c.right.color===0?(c.color=1,u=u.parent):(c.left.color===0&&(c.right.color=0,c.color=1,_(t,c),c=u.parent.left),c.color=u.parent.color,u.parent.color=0,c.left.color=0,g(t,u.parent),u=t.root));u.color=0,f()}e.rbDelete=C;function s(t,a){for(n(t,a);a!==t.root&&a.parent.color===1;)if(a.parent===a.parent.parent.left){const u=a.parent.parent.right;u.color===1?(a.parent.color=0,u.color=0,a.parent.parent.color=1,a=a.parent.parent):(a===a.parent.right&&(a=a.parent,_(t,a)),a.parent.color=0,a.parent.parent.color=1,g(t,a.parent.parent))}else{const u=a.parent.parent.left;u.color===1?(a.parent.color=0,u.color=0,a.parent.parent.color=1,a=a.parent.parent):(a===a.parent.left&&(a=a.parent,g(t,a)),a.parent.color=0,a.parent.parent.color=1,_(t,a.parent.parent))}t.root.color=0}e.fixInsert=s;function i(t,a,u,h){for(;a!==t.root&&a!==e.SENTINEL;)a.parent.left===a&&(a.parent.size_left+=u,a.parent.lf_left+=h),a=a.parent}e.updateTreeMetadata=i;function n(t,a){let u=0,h=0;if(a!==t.root){for(;a!==t.root&&a===a.parent.right;)a=a.parent;if(a!==t.root)for(a=a.parent,u=D(a.left)-a.size_left,h=S(a.left)-a.lf_left,a.size_left+=u,a.lf_left+=h;a!==t.root&&(u!==0||h!==0);)a.parent.left===a&&(a.parent.size_left+=u,a.parent.lf_left+=h),a=a.parent}}e.recomputeTreeMetadata=n}),define(ne[281],se([1,0,14,169]),function(Q,e,L,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrefixSumIndexOfResult=e.ConstantTimePrefixSumComputer=e.PrefixSumComputer=void 0;class y{constructor(_){this.values=_,this.prefixSum=new Uint32Array(_.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(_,g){_=(0,k.toUint32)(_);const C=this.values,s=this.prefixSum,i=g.length;return i===0?!1:(this.values=new Uint32Array(C.length+i),this.values.set(C.subarray(0,_),0),this.values.set(C.subarray(_),_+i),this.values.set(g,_),_-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(_,g){return _=(0,k.toUint32)(_),g=(0,k.toUint32)(g),this.values[_]===g?!1:(this.values[_]=g,_-1=C.length)return!1;const i=C.length-_;return g>=i&&(g=i),g===0?!1:(this.values=new Uint32Array(C.length-g),this.values.set(C.subarray(0,_),0),this.values.set(C.subarray(_+g),_),this.prefixSum=new Uint32Array(this.values.length),_-1=0&&this.prefixSum.set(s.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 g=this.prefixSumValidIndex[0]+1;g===0&&(this.prefixSum[0]=this.values[0],g++),_>=this.values.length&&(_=this.values.length-1);for(let C=g;C<=_;C++)this.prefixSum[C]=this.prefixSum[C-1]+this.values[C];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],_),this.prefixSum[_]}getIndexOf(_){_=Math.floor(_),this.getTotalSum();let g=0,C=this.values.length-1,s=0,i=0,n=0;for(;g<=C;)if(s=g+(C-g)/2|0,i=this.prefixSum[s],n=i-this.values[s],_=i)g=s+1;else break;return new S(s,_-n)}}e.PrefixSumComputer=y;class D{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 g=this._indexBySum[_],C=g>0?this._prefixSum[g-1]:0;return new S(g,_-C)}removeValues(_,g){this._values.splice(_,g),this._invalidate(_)}insertValues(_,g){this._values=(0,L.arrayInsert)(this._values,_,g),this._invalidate(_)}_invalidate(_){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,_-1)}_ensureValid(){if(!this._isValid){for(let _=this._validEndIndex+1,g=this._values.length;_0?this._prefixSum[_-1]:0;this._prefixSum[_]=s+C;for(let i=0;i=0;let c=null;try{c=L.createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:r,global:!0,unicode:!0})}catch{return null}if(!c)return null;let o=!this.isRegex&&!r;return o&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(o=this.matchCase),new S.SearchData(c,this.wordSeparators?(0,k.getMapForWordSeparators)(this.wordSeparators):null,o?this.searchString:null)}}e.SearchParams=_;function g(h){if(!h||h.length===0)return!1;for(let r=0,c=h.length;r=c)break;const d=h.charCodeAt(r);if(d===110||d===114||d===87)return!0}}return!1}e.isMultilineRegexSource=g;function C(h,r,c){if(!c)return new S.FindMatch(h,null);const o=[];for(let d=0,l=r.length;d>0);c[l]>=r?d=l-1:c[l+1]>=r?(o=l,d=l):o=l+1}return o+1}}class i{static findMatches(r,c,o,d,l){const p=c.parseSearchRequest();return p?p.regex.multiline?this._doFindMatchesMultiline(r,o,new u(p.wordSeparators,p.regex),d,l):this._doFindMatchesLineByLine(r,o,p,d,l):[]}static _getMultilineMatchRange(r,c,o,d,l,p){let m,v=0;d?(v=d.findLineFeedCountBeforeOffset(l),m=c+l+v):m=c+l;let b;if(d){const M=d.findLineFeedCountBeforeOffset(l+p.length)-v;b=m+p.length+M}else b=m+p.length;const w=r.getPositionAt(m),E=r.getPositionAt(b);return new D.Range(w.lineNumber,w.column,E.lineNumber,E.column)}static _doFindMatchesMultiline(r,c,o,d,l){const p=r.getOffsetAt(c.getStartPosition()),m=r.getValueInRange(c,1),v=r.getEOL()===`\r
-`?new s(m):null,b=[];let w=0,E;for(o.reset(0);E=o.next(m);)if(b[w++]=C(this._getMultilineMatchRange(r,p,m,v,E.index,E[0]),E,d),w>=l)return b;return b}static _doFindMatchesLineByLine(r,c,o,d,l){const p=[];let m=0;if(c.startLineNumber===c.endLineNumber){const b=r.getLineContent(c.startLineNumber).substring(c.startColumn-1,c.endColumn-1);return m=this._findMatchesInLine(o,b,c.startLineNumber,c.startColumn-1,m,p,d,l),p}const v=r.getLineContent(c.startLineNumber).substring(c.startColumn-1);m=this._findMatchesInLine(o,v,c.startLineNumber,c.startColumn-1,m,p,d,l);for(let b=c.startLineNumber+1;b=v))return l;return l}const w=new u(r.wordSeparators,r.regex);let E;w.reset(0);do if(E=w.next(c),E&&(p[l++]=C(new D.Range(o,E.index+1+d,o,E.index+1+E[0].length+d),E,m),l>=v))return l;while(E);return l}static findNextMatch(r,c,o,d){const l=c.parseSearchRequest();if(!l)return null;const p=new u(l.wordSeparators,l.regex);return l.regex.multiline?this._doFindNextMatchMultiline(r,o,p,d):this._doFindNextMatchLineByLine(r,o,p,d)}static _doFindNextMatchMultiline(r,c,o,d){const l=new y.Position(c.lineNumber,1),p=r.getOffsetAt(l),m=r.getLineCount(),v=r.getValueInRange(new D.Range(l.lineNumber,l.column,m,r.getLineMaxColumn(m)),1),b=r.getEOL()===`\r
-`?new s(v):null;o.reset(c.column-1);const w=o.next(v);return w?C(this._getMultilineMatchRange(r,p,v,b,w.index,w[0]),w,d):c.lineNumber!==1||c.column!==1?this._doFindNextMatchMultiline(r,new y.Position(1,1),o,d):null}static _doFindNextMatchLineByLine(r,c,o,d){const l=r.getLineCount(),p=c.lineNumber,m=r.getLineContent(p),v=this._findFirstMatchInLine(o,m,p,c.column,d);if(v)return v;for(let b=1;b<=l;b++){const w=(p+b-1)%l,E=r.getLineContent(w+1),I=this._findFirstMatchInLine(o,E,w+1,1,d);if(I)return I}return null}static _findFirstMatchInLine(r,c,o,d,l){r.reset(d-1);const p=r.next(c);return p?C(new D.Range(o,p.index+1,o,p.index+1+p[0].length),p,l):null}static findPreviousMatch(r,c,o,d){const l=c.parseSearchRequest();if(!l)return null;const p=new u(l.wordSeparators,l.regex);return l.regex.multiline?this._doFindPreviousMatchMultiline(r,o,p,d):this._doFindPreviousMatchLineByLine(r,o,p,d)}static _doFindPreviousMatchMultiline(r,c,o,d){const l=this._doFindMatchesMultiline(r,new D.Range(1,1,c.lineNumber,c.column),o,d,10*f);if(l.length>0)return l[l.length-1];const p=r.getLineCount();return c.lineNumber!==p||c.column!==r.getLineMaxColumn(p)?this._doFindPreviousMatchMultiline(r,new y.Position(p,r.getLineMaxColumn(p)),o,d):null}static _doFindPreviousMatchLineByLine(r,c,o,d){const l=r.getLineCount(),p=c.lineNumber,m=r.getLineContent(p).substring(0,c.column-1),v=this._findLastMatchInLine(o,m,p,d);if(v)return v;for(let b=1;b<=l;b++){const w=(l+p-b-1)%l,E=r.getLineContent(w+1),I=this._findLastMatchInLine(o,E,w+1,d);if(I)return I}return null}static _findLastMatchInLine(r,c,o,d){let l=null,p;for(r.reset(0);p=r.next(c);)l=C(new D.Range(o,p.index+1,o,p.index+1+p[0].length),p,d);return l}}e.TextModelSearch=i;function n(h,r,c,o,d){if(o===0)return!0;const l=r.charCodeAt(o-1);if(h.get(l)!==0||l===13||l===10)return!0;if(d>0){const p=r.charCodeAt(o);if(h.get(p)!==0)return!0}return!1}function t(h,r,c,o,d){if(o+d===c)return!0;const l=r.charCodeAt(o+d);if(h.get(l)!==0||l===13||l===10)return!0;if(d>0){const p=r.charCodeAt(o+d-1);if(h.get(p)!==0)return!0}return!1}function a(h,r,c,o,d){return n(h,r,c,o,d)&&t(h,r,c,o,d)}e.isValidMatch=a;class u{constructor(r,c){this._wordSeparators=r,this._searchRegex=c,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(r){this._searchRegex.lastIndex=r,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(r){const c=r.length;let o;do{if(this._prevMatchStartIndex+this._prevMatchLength===c||(o=this._searchRegex.exec(r),!o))return null;const d=o.index,l=o[0].length;if(d===this._prevMatchStartIndex&&l===this._prevMatchLength){if(l===0){L.getNextCodePoint(r,c,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=d,this._prevMatchLength=l,!this._wordSeparators||a(this._wordSeparators,r,c,d,l))return o}while(o);return null}}e.Searcher=u}),define(ne[283],se([1,0,12,5,48,511,181]),function(Q,e,L,k,y,D,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PieceTreeBase=e.StringBuffer=e.Piece=e.createLineStarts=e.createLineStartsFast=void 0;const f=65535;function _(h){let r;return h[h.length-1]<65536?r=new Uint16Array(h.length):r=new Uint32Array(h.length),r.set(h,0),r}class g{constructor(r,c,o,d,l){this.lineStarts=r,this.cr=c,this.lf=o,this.crlf=d,this.isBasicASCII=l}}function C(h,r=!0){const c=[0];let o=1;for(let d=0,l=h.length;d126)&&(p=!1)}const m=new g(_(h),o,d,l,p);return h.length=0,m}e.createLineStarts=s;class i{constructor(r,c,o,d,l){this.bufferIndex=r,this.start=c,this.end=o,this.lineFeedCnt=d,this.length=l}}e.Piece=i;class n{constructor(r,c){this.buffer=r,this.lineStarts=c}}e.StringBuffer=n;class t{constructor(r,c){this._pieces=[],this._tree=r,this._BOM=c,this._index=0,r.root!==D.SENTINEL&&r.iterate(r.root,o=>(o!==D.SENTINEL&&this._pieces.push(o.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 a{constructor(r){this._limit=r,this._cache=[]}get(r){for(let c=this._cache.length-1;c>=0;c--){const o=this._cache[c];if(o.nodeStartOffset<=r&&o.nodeStartOffset+o.node.piece.length>=r)return o}return null}get2(r){for(let c=this._cache.length-1;c>=0;c--){const o=this._cache[c];if(o.nodeStartLineNumber&&o.nodeStartLineNumber=r)return o}return null}set(r){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(r)}validate(r){let c=!1;const o=this._cache;for(let d=0;d=r){o[d]=null,c=!0;continue}}if(c){const d=[];for(const l of o)l!==null&&d.push(l);this._cache=d}}}class u{constructor(r,c,o){this.create(r,c,o)}create(r,c,o){this._buffers=[new n("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=D.SENTINEL,this._lineCnt=1,this._length=0,this._EOL=c,this._EOLLength=c.length,this._EOLNormalized=o;let d=null;for(let l=0,p=r.length;l0){r[l].lineStarts||(r[l].lineStarts=C(r[l].buffer));const m=new i(l+1,{line:0,column:0},{line:r[l].lineStarts.length-1,column:r[l].buffer.length-r[l].lineStarts[r[l].lineStarts.length-1]},r[l].lineStarts.length-1,r[l].buffer.length);this._buffers.push(r[l]),d=this.rbInsertRight(d,m)}this._searchCache=new a(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(r){const c=f,o=c-Math.floor(c/3),d=o*2;let l="",p=0;const m=[];if(this.iterate(this.root,v=>{const b=this.getNodeContent(v),w=b.length;if(p<=o||p+w0){const v=l.replace(/\r\n|\r|\n/g,r);m.push(new n(v,C(v)))}this.create(m,r,!0)}getEOL(){return this._EOL}setEOL(r){this._EOL=r,this._EOLLength=this._EOL.length,this.normalizeEOL(r)}createSnapshot(r){return new t(this,r)}getOffsetAt(r,c){let o=0,d=this.root;for(;d!==D.SENTINEL;)if(d.left!==D.SENTINEL&&d.lf_left+1>=r)d=d.left;else if(d.lf_left+d.piece.lineFeedCnt+1>=r){o+=d.size_left;const l=this.getAccumulatedValue(d,r-d.lf_left-2);return o+=l+c-1}else r-=d.lf_left+d.piece.lineFeedCnt,o+=d.size_left+d.piece.length,d=d.right;return o}getPositionAt(r){r=Math.floor(r),r=Math.max(0,r);let c=this.root,o=0;const d=r;for(;c!==D.SENTINEL;)if(c.size_left!==0&&c.size_left>=r)c=c.left;else if(c.size_left+c.piece.length>=r){const l=this.getIndexOf(c,r-c.size_left);if(o+=c.lf_left+l.index,l.index===0){const p=this.getOffsetAt(o+1,1),m=d-p;return new L.Position(o+1,m+1)}return new L.Position(o+1,l.remainder+1)}else if(r-=c.size_left+c.piece.length,o+=c.lf_left+c.piece.lineFeedCnt,c.right===D.SENTINEL){const l=this.getOffsetAt(o+1,1),p=d-r-l;return new L.Position(o+1,p+1)}else c=c.right;return new L.Position(1,1)}getValueInRange(r,c){if(r.startLineNumber===r.endLineNumber&&r.startColumn===r.endColumn)return"";const o=this.nodeAt2(r.startLineNumber,r.startColumn),d=this.nodeAt2(r.endLineNumber,r.endColumn),l=this.getValueInRange2(o,d);return c?c!==this._EOL||!this._EOLNormalized?l.replace(/\r\n|\r|\n/g,c):c===this.getEOL()&&this._EOLNormalized?l:l.replace(/\r\n|\r|\n/g,c):l}getValueInRange2(r,c){if(r.node===c.node){const m=r.node,v=this._buffers[m.piece.bufferIndex].buffer,b=this.offsetInBuffer(m.piece.bufferIndex,m.piece.start);return v.substring(b+r.remainder,b+c.remainder)}let o=r.node;const d=this._buffers[o.piece.bufferIndex].buffer,l=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);let p=d.substring(l+r.remainder,l+o.piece.length);for(o=o.next();o!==D.SENTINEL;){const m=this._buffers[o.piece.bufferIndex].buffer,v=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);if(o===c.node){p+=m.substring(v,v+c.remainder);break}else p+=m.substr(v,o.piece.length);o=o.next()}return p}getLinesContent(){const r=[];let c=0,o="",d=!1;return this.iterate(this.root,l=>{if(l===D.SENTINEL)return!0;const p=l.piece;let m=p.length;if(m===0)return!0;const v=this._buffers[p.bufferIndex].buffer,b=this._buffers[p.bufferIndex].lineStarts,w=p.start.line,E=p.end.line;let I=b[w]+p.start.column;if(d&&(v.charCodeAt(I)===10&&(I++,m--),r[c++]=o,o="",d=!1,m===0))return!0;if(w===E)return!this._EOLNormalized&&v.charCodeAt(I+m-1)===13?(d=!0,o+=v.substr(I,m-1)):o+=v.substr(I,m),!0;o+=this._EOLNormalized?v.substring(I,Math.max(I,b[w+1]-this._EOLLength)):v.substring(I,b[w+1]).replace(/(\r\n|\r|\n)$/,""),r[c++]=o;for(let M=w+1;MO+P,c.reset(0)):(N=I.buffer,F=O=>O,c.reset(P));do if(T=c.next(N),T){if(F(T.index)>=x)return w;this.positionInBuffer(r,F(T.index)-M,A);const O=this.getLineFeedCnt(r.piece.bufferIndex,l,A),W=A.line===l.line?A.column-l.column+d:A.column+1,U=W+T[0].length;if(E[w++]=(0,S.createFindMatch)(new k.Range(o+O,W,o+O,U),T,v),F(T.index)+T[0].length>=x||w>=b)return w}while(T);return w}findMatchesLineByLine(r,c,o,d){const l=[];let p=0;const m=new S.Searcher(c.wordSeparators,c.regex);let v=this.nodeAt2(r.startLineNumber,r.startColumn);if(v===null)return[];const b=this.nodeAt2(r.endLineNumber,r.endColumn);if(b===null)return[];let w=this.positionInBuffer(v.node,v.remainder);const E=this.positionInBuffer(b.node,b.remainder);if(v.node===b.node)return this.findMatchesInNode(v.node,m,r.startLineNumber,r.startColumn,w,E,c,o,d,p,l),l;let I=r.startLineNumber,M=v.node;for(;M!==b.node;){const x=this.getLineFeedCnt(M.piece.bufferIndex,w,M.piece.end);if(x>=1){const A=this._buffers[M.piece.bufferIndex].lineStarts,N=this.offsetInBuffer(M.piece.bufferIndex,M.piece.start),F=A[w.line+x],O=I===r.startLineNumber?r.startColumn:1;if(p=this.findMatchesInNode(M,m,I,O,w,this.positionInBuffer(M,F-N),c,o,d,p,l),p>=d)return l;I+=x}const T=I===r.startLineNumber?r.startColumn-1:0;if(I===r.endLineNumber){const A=this.getLineContent(I).substring(T,r.endColumn-1);return p=this._findMatchesInLine(c,m,A,r.endLineNumber,T,p,l,o,d),l}if(p=this._findMatchesInLine(c,m,this.getLineContent(I).substr(T),I,T,p,l,o,d),p>=d)return l;I++,v=this.nodeAt2(I,1),M=v.node,w=this.positionInBuffer(v.node,v.remainder)}if(I===r.endLineNumber){const x=I===r.startLineNumber?r.startColumn-1:0,T=this.getLineContent(I).substring(x,r.endColumn-1);return p=this._findMatchesInLine(c,m,T,r.endLineNumber,x,p,l,o,d),l}const P=I===r.startLineNumber?r.startColumn:1;return p=this.findMatchesInNode(b.node,m,I,P,w,E,c,o,d,p,l),l}_findMatchesInLine(r,c,o,d,l,p,m,v,b){const w=r.wordSeparators;if(!v&&r.simpleSearch){const I=r.simpleSearch,M=I.length,P=o.length;let x=-M;for(;(x=o.indexOf(I,x+M))!==-1;)if((!w||(0,S.isValidMatch)(w,o,P,x,M))&&(m[p++]=new y.FindMatch(new k.Range(d,x+1+l,d,x+1+M+l),null),p>=b))return p;return p}let E;c.reset(0);do if(E=c.next(o),E&&(m[p++]=(0,S.createFindMatch)(new k.Range(d,E.index+1+l,d,E.index+1+E[0].length+l),E,v),p>=b))return p;while(E);return p}insert(r,c,o=!1){if(this._EOLNormalized=this._EOLNormalized&&o,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==D.SENTINEL){const{node:d,remainder:l,nodeStartOffset:p}=this.nodeAt(r),m=d.piece,v=m.bufferIndex,b=this.positionInBuffer(d,l);if(d.piece.bufferIndex===0&&m.end.line===this._lastChangeBufferPos.line&&m.end.column===this._lastChangeBufferPos.column&&p+m.length===r&&c.lengthr){const w=[];let E=new i(m.bufferIndex,b,m.end,this.getLineFeedCnt(m.bufferIndex,b,m.end),this.offsetInBuffer(v,m.end)-this.offsetInBuffer(v,b));if(this.shouldCheckCRLF()&&this.endWithCR(c)&&this.nodeCharCodeAt(d,l)===10){const x={line:E.start.line+1,column:0};E=new i(E.bufferIndex,x,E.end,this.getLineFeedCnt(E.bufferIndex,x,E.end),E.length-1),c+=`
-`}if(this.shouldCheckCRLF()&&this.startWithLF(c))if(this.nodeCharCodeAt(d,l-1)===13){const x=this.positionInBuffer(d,l-1);this.deleteNodeTail(d,x),c="\r"+c,d.piece.length===0&&w.push(d)}else this.deleteNodeTail(d,b);else this.deleteNodeTail(d,b);const I=this.createNewPieces(c);E.length>0&&this.rbInsertRight(d,E);let M=d;for(let P=0;P=0;p--)l=this.rbInsertLeft(l,d[p]);this.validateCRLFWithPrevNode(l),this.deleteNodes(o)}insertContentToNodeRight(r,c){this.adjustCarriageReturnFromNext(r,c)&&(r+=`
-`);const o=this.createNewPieces(r),d=this.rbInsertRight(c,o[0]);let l=d;for(let p=1;p=I)b=E+1;else break;return o?(o.line=E,o.column=v-M,null):{line:E,column:v-M}}getLineFeedCnt(r,c,o){if(o.column===0)return o.line-c.line;const d=this._buffers[r].lineStarts;if(o.line===d.length-1)return o.line-c.line;const l=d[o.line+1],p=d[o.line]+o.column;if(l>p+1)return o.line-c.line;const m=p-1;return this._buffers[r].buffer.charCodeAt(m)===13?o.line-c.line+1:o.line-c.line}offsetInBuffer(r,c){return this._buffers[r].lineStarts[c.line]+c.column}deleteNodes(r){for(let c=0;cf){const w=[];for(;r.length>f;){const I=r.charCodeAt(f-1);let M;I===13||I>=55296&&I<=56319?(M=r.substring(0,f-1),r=r.substring(f-1)):(M=r.substring(0,f),r=r.substring(f));const P=C(M);w.push(new i(this._buffers.length,{line:0,column:0},{line:P.length-1,column:M.length-P[P.length-1]},P.length-1,M.length)),this._buffers.push(new n(M,P))}const E=C(r);return w.push(new i(this._buffers.length,{line:0,column:0},{line:E.length-1,column:r.length-E[E.length-1]},E.length-1,r.length)),this._buffers.push(new n(r,E)),w}let c=this._buffers[0].buffer.length;const o=C(r,!1);let d=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===c&&c!==0&&this.startWithLF(r)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},d=this._lastChangeBufferPos;for(let w=0;w=r-1)o=o.left;else if(o.lf_left+o.piece.lineFeedCnt>r-1){const v=this.getAccumulatedValue(o,r-o.lf_left-2),b=this.getAccumulatedValue(o,r-o.lf_left-1),w=this._buffers[o.piece.bufferIndex].buffer,E=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);return p+=o.size_left,this._searchCache.set({node:o,nodeStartOffset:p,nodeStartLineNumber:m-(r-1-o.lf_left)}),w.substring(E+v,E+b-c)}else if(o.lf_left+o.piece.lineFeedCnt===r-1){const v=this.getAccumulatedValue(o,r-o.lf_left-2),b=this._buffers[o.piece.bufferIndex].buffer,w=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);d=b.substring(w+v,w+o.piece.length);break}else r-=o.lf_left+o.piece.lineFeedCnt,p+=o.size_left+o.piece.length,o=o.right}for(o=o.next();o!==D.SENTINEL;){const p=this._buffers[o.piece.bufferIndex].buffer;if(o.piece.lineFeedCnt>0){const m=this.getAccumulatedValue(o,0),v=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);return d+=p.substring(v,v+m-c),d}else{const m=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);d+=p.substr(m,o.piece.length)}o=o.next()}return d}computeBufferMetadata(){let r=this.root,c=1,o=0;for(;r!==D.SENTINEL;)c+=r.lf_left+r.piece.lineFeedCnt,o+=r.size_left+r.piece.length,r=r.right;this._lineCnt=c,this._length=o,this._searchCache.validate(this._length)}getIndexOf(r,c){const o=r.piece,d=this.positionInBuffer(r,c),l=d.line-o.start.line;if(this.offsetInBuffer(o.bufferIndex,o.end)-this.offsetInBuffer(o.bufferIndex,o.start)===c){const p=this.getLineFeedCnt(r.piece.bufferIndex,o.start,d);if(p!==l)return{index:p,remainder:0}}return{index:l,remainder:d.column}}getAccumulatedValue(r,c){if(c<0)return 0;const o=r.piece,d=this._buffers[o.bufferIndex].lineStarts,l=o.start.line+c+1;return l>o.end.line?d[o.end.line]+o.end.column-d[o.start.line]-o.start.column:d[l]-d[o.start.line]-o.start.column}deleteNodeTail(r,c){const o=r.piece,d=o.lineFeedCnt,l=this.offsetInBuffer(o.bufferIndex,o.end),p=c,m=this.offsetInBuffer(o.bufferIndex,p),v=this.getLineFeedCnt(o.bufferIndex,o.start,p),b=v-d,w=m-l,E=o.length+w;r.piece=new i(o.bufferIndex,o.start,p,v,E),(0,D.updateTreeMetadata)(this,r,w,b)}deleteNodeHead(r,c){const o=r.piece,d=o.lineFeedCnt,l=this.offsetInBuffer(o.bufferIndex,o.start),p=c,m=this.getLineFeedCnt(o.bufferIndex,p,o.end),v=this.offsetInBuffer(o.bufferIndex,p),b=m-d,w=l-v,E=o.length+w;r.piece=new i(o.bufferIndex,p,o.end,m,E),(0,D.updateTreeMetadata)(this,r,w,b)}shrinkNode(r,c,o){const d=r.piece,l=d.start,p=d.end,m=d.length,v=d.lineFeedCnt,b=c,w=this.getLineFeedCnt(d.bufferIndex,d.start,b),E=this.offsetInBuffer(d.bufferIndex,c)-this.offsetInBuffer(d.bufferIndex,l);r.piece=new i(d.bufferIndex,d.start,b,w,E),(0,D.updateTreeMetadata)(this,r,E-m,w-v);const I=new i(d.bufferIndex,o,p,this.getLineFeedCnt(d.bufferIndex,o,p),this.offsetInBuffer(d.bufferIndex,p)-this.offsetInBuffer(d.bufferIndex,o)),M=this.rbInsertRight(r,I);this.validateCRLFWithPrevNode(M)}appendToNode(r,c){this.adjustCarriageReturnFromNext(c,r)&&(c+=`
-`);const o=this.shouldCheckCRLF()&&this.startWithLF(c)&&this.endWithCR(r),d=this._buffers[0].buffer.length;this._buffers[0].buffer+=c;const l=C(c,!1);for(let M=0;Mr)c=c.left;else if(c.size_left+c.piece.length>=r){d+=c.size_left;const l={node:c,remainder:r-c.size_left,nodeStartOffset:d};return this._searchCache.set(l),l}else r-=c.size_left+c.piece.length,d+=c.size_left+c.piece.length,c=c.right;return null}nodeAt2(r,c){let o=this.root,d=0;for(;o!==D.SENTINEL;)if(o.left!==D.SENTINEL&&o.lf_left>=r-1)o=o.left;else if(o.lf_left+o.piece.lineFeedCnt>r-1){const l=this.getAccumulatedValue(o,r-o.lf_left-2),p=this.getAccumulatedValue(o,r-o.lf_left-1);return d+=o.size_left,{node:o,remainder:Math.min(l+c-1,p),nodeStartOffset:d}}else if(o.lf_left+o.piece.lineFeedCnt===r-1){const l=this.getAccumulatedValue(o,r-o.lf_left-2);if(l+c-1<=o.piece.length)return{node:o,remainder:l+c-1,nodeStartOffset:d};c-=o.piece.length-l;break}else r-=o.lf_left+o.piece.lineFeedCnt,d+=o.size_left+o.piece.length,o=o.right;for(o=o.next();o!==D.SENTINEL;){if(o.piece.lineFeedCnt>0){const l=this.getAccumulatedValue(o,0),p=this.offsetOfNode(o);return{node:o,remainder:Math.min(c-1,l),nodeStartOffset:p}}else if(o.piece.length>=c-1){const l=this.offsetOfNode(o);return{node:o,remainder:c-1,nodeStartOffset:l}}else c-=o.piece.length;o=o.next()}return null}nodeCharCodeAt(r,c){if(r.piece.lineFeedCnt<1)return-1;const o=this._buffers[r.piece.bufferIndex],d=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start)+c;return o.buffer.charCodeAt(d)}offsetOfNode(r){if(!r)return 0;let c=r.size_left;for(;r!==this.root;)r.parent.right===r&&(c+=r.parent.size_left+r.parent.piece.length),r=r.parent;return c}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
-`)}startWithLF(r){if(typeof r=="string")return r.charCodeAt(0)===10;if(r===D.SENTINEL||r.piece.lineFeedCnt===0)return!1;const c=r.piece,o=this._buffers[c.bufferIndex].lineStarts,d=c.start.line,l=o[d]+c.start.column;return d===o.length-1||o[d+1]>l+1?!1:this._buffers[c.bufferIndex].buffer.charCodeAt(l)===10}endWithCR(r){return typeof r=="string"?r.charCodeAt(r.length-1)===13:r===D.SENTINEL||r.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(r,r.piece.length-1)===13}validateCRLFWithPrevNode(r){if(this.shouldCheckCRLF()&&this.startWithLF(r)){const c=r.prev();this.endWithCR(c)&&this.fixCRLF(c,r)}}validateCRLFWithNextNode(r){if(this.shouldCheckCRLF()&&this.endWithCR(r)){const c=r.next();this.startWithLF(c)&&this.fixCRLF(r,c)}}fixCRLF(r,c){const o=[],d=this._buffers[r.piece.bufferIndex].lineStarts;let l;r.piece.end.column===0?l={line:r.piece.end.line-1,column:d[r.piece.end.line]-d[r.piece.end.line-1]-1}:l={line:r.piece.end.line,column:r.piece.end.column-1};const p=r.piece.length-1,m=r.piece.lineFeedCnt-1;r.piece=new i(r.piece.bufferIndex,r.piece.start,l,m,p),(0,D.updateTreeMetadata)(this,r,-1,-1),r.piece.length===0&&o.push(r);const v={line:c.piece.start.line+1,column:0},b=c.piece.length-1,w=this.getLineFeedCnt(c.piece.bufferIndex,v,c.piece.end);c.piece=new i(c.piece.bufferIndex,v,c.piece.end,w,b),(0,D.updateTreeMetadata)(this,c,-1,-1),c.piece.length===0&&o.push(c);const E=this.createNewPieces(`\r
-`);this.rbInsertRight(r,E[0]);for(let I=0;I0?this.wrappedTextIndentLength:0}getLineLength(s){const i=s>0?this.breakOffsets[s-1]:0;let t=this.breakOffsets[s]-i;return s>0&&(t+=this.wrappedTextIndentLength),t}getMaxOutputOffset(s){return this.getLineLength(s)}translateToInputOffset(s,i){s>0&&(i=Math.max(0,i-this.wrappedTextIndentLength));let t=s===0?i:this.breakOffsets[s-1]+i;if(this.injectionOffsets!==null)for(let a=0;athis.injectionOffsets[a];a++)t0?this.breakOffsets[a-1]:0,i===0)if(s<=u)t=a-1;else if(s>r)n=a+1;else break;else if(s=r)n=a+1;else break}let h=s-u;return a>0&&(h+=this.wrappedTextIndentLength),new g(a,h)}normalizeOutputPosition(s,i,n){if(this.injectionOffsets!==null){const t=this.outputPositionToOffsetInInputWithInjections(s,i),a=this.normalizeOffsetInInputWithInjectionsAroundInjections(t,n);if(a!==t)return this.offsetInInputWithInjectionsToOutputPosition(a,n)}if(n===0){if(s>0&&i===this.getMinOutputOffset(s))return new g(s-1,this.getMaxOutputOffset(s-1))}else if(n===1){const t=this.getOutputLineCount()-1;if(s0&&(i=Math.max(0,i-this.wrappedTextIndentLength)),(s>0?this.breakOffsets[s-1]:0)+i}normalizeOffsetInInputWithInjectionsAroundInjections(s,i){const n=this.getInjectedTextAtOffset(s);if(!n)return s;if(i===2){if(s===n.offsetInInputWithInjections+n.length&&S(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let t=n.offsetInInputWithInjections;if(f(this.injectionOptions[n.injectedTextIndex].cursorStops))return t;let a=n.injectedTextIndex-1;for(;a>=0&&this.injectionOffsets[a]===this.injectionOffsets[n.injectedTextIndex]&&!(S(this.injectionOptions[a].cursorStops)||(t-=this.injectionOptions[a].content.length,f(this.injectionOptions[a].cursorStops)));)a--;return t}}else if(i===1||i===4){let t=n.offsetInInputWithInjections+n.length,a=n.injectedTextIndex;for(;a+1=0&&this.injectionOffsets[a-1]===this.injectionOffsets[a];)t-=this.injectionOptions[a-1].content.length,a--;return t}(0,L.assertNever)(i)}getInjectedText(s,i){const n=this.outputPositionToOffsetInInputWithInjections(s,i),t=this.getInjectedTextAtOffset(n);return t?{options:this.injectionOptions[t.injectedTextIndex]}:null}getInjectedTextAtOffset(s){const i=this.injectionOffsets,n=this.injectionOptions;if(i!==null){let t=0;for(let a=0;as)break;if(s<=r)return{injectedTextIndex:a,offsetInInputWithInjections:h,length:u};t+=u}}}}e.ModelLineProjectionData=D;function S(C){return C==null?!0:C===y.InjectedTextCursorStops.Right||C===y.InjectedTextCursorStops.Both}function f(C){return C==null?!0:C===y.InjectedTextCursorStops.Left||C===y.InjectedTextCursorStops.Both}class _{constructor(s){this.options=s}}e.InjectedText=_;class g{constructor(s,i){this.outputLineIndex=s,this.outputOffset=i}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(s){return new k.Position(s+this.outputLineIndex,this.outputOffset+1)}}e.OutputPosition=g}),define(ne[285],se([1,0]),function(Q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DraggedTreeItemsIdentifier=e.TreeViewsDnDService=void 0;class L{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(D){if(D&&this._dragOperations.has(D)){const S=this._dragOperations.get(D);return this._dragOperations.delete(D),S}}}e.TreeViewsDnDService=L;class k{constructor(D){this.identifier=D}}e.DraggedTreeItemsIdentifier=k}),define(ne[286],se([1,0,5,181,11,85,147]),function(Q,e,L,k,y,D,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeTextModelHighlighter=void 0;class f{static computeUnicodeHighlights(i,n,t){const a=t?t.startLineNumber:1,u=t?t.endLineNumber:i.getLineCount(),h=new g(n),r=h.getCandidateCodePoints();let c;r==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${_(Array.from(r))}`,"g");const o=new k.Searcher(null,c),d=[];let l=!1,p,m=0,v=0,b=0;e:for(let w=a,E=u;w<=E;w++){const I=i.getLineContent(w),M=I.length;o.reset(0);do if(p=o.next(I),p){let P=p.index,x=p.index+p[0].length;if(P>0){const F=I.charCodeAt(P-1);y.isHighSurrogate(F)&&P--}if(x+1=F){l=!0;break e}d.push(new L.Range(w,P+1,w,x+1))}}while(p)}return{ranges:d,hasMore:l,ambiguousCharacterCount:m,invisibleCharacterCount:v,nonBasicAsciiCharacterCount:b}}static computeUnicodeHighlightReason(i,n){const t=new g(n);switch(t.shouldHighlightNonBasicASCII(i,null)){case 0:return null;case 2:return{kind:1};case 3:{const u=i.codePointAt(0),h=t.ambiguousCharacters.getPrimaryConfusable(u),r=y.AmbiguousCharacters.getLocales().filter(c=>!y.AmbiguousCharacters.getInstance(new Set([...n.allowedLocales,c])).isAmbiguous(u));return{kind:0,confusableWith:String.fromCodePoint(h),notAmbiguousInLocales:r}}case 1:return{kind:2}}}}e.UnicodeTextModelHighlighter=f;function _(s,i){return`[${y.escapeRegExpCharacters(s.map(t=>String.fromCodePoint(t)).join(""))}]`}class g{constructor(i){this.options=i,this.allowedCodePoints=new Set(i.allowedCodePoints),this.ambiguousCharacters=y.AmbiguousCharacters.getInstance(new Set(i.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const i=new Set;if(this.options.invisibleCharacters)for(const n of y.InvisibleCharacters.codePoints)C(String.fromCodePoint(n))||i.add(n);if(this.options.ambiguousCharacters)for(const n of this.ambiguousCharacters.getConfusableCodePoints())i.add(n);for(const n of this.allowedCodePoints)i.delete(n);return i}shouldHighlightNonBasicASCII(i,n){const t=i.codePointAt(0);if(this.allowedCodePoints.has(t))return 0;if(this.options.nonBasicASCII)return 1;let a=!1,u=!1;if(n)for(const h of n){const r=h.codePointAt(0),c=y.isBasicASCII(h);a=a||c,!c&&!this.ambiguousCharacters.isAmbiguous(r)&&!y.InvisibleCharacters.isInvisibleCharacter(r)&&(u=!0)}return!a&&u?0:this.options.invisibleCharacters&&!C(i)&&y.InvisibleCharacters.isInvisibleCharacter(t)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(t)?3:0}}function C(s){return s===" "||s===`
-`||s===" "}}),define(ne[208],se([1,0]),function(Q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WrappingIndent=e.TrackedRangeStickiness=e.TextEditorCursorStyle=e.TextEditorCursorBlinkingStyle=e.SymbolTag=e.SymbolKind=e.SignatureHelpTriggerKind=e.SelectionDirection=e.ScrollbarVisibility=e.ScrollType=e.RenderMinimap=e.RenderLineNumbersType=e.PositionAffinity=e.OverviewRulerLane=e.OverlayWidgetPositionPreference=e.MouseTargetType=e.MinimapPosition=e.MarkerTag=e.MarkerSeverity=e.KeyCode=e.InlineCompletionTriggerKind=e.InlayHintKind=e.InjectedTextCursorStops=e.IndentAction=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 L;(function(R){R[R.Unknown=0]="Unknown",R[R.Disabled=1]="Disabled",R[R.Enabled=2]="Enabled"})(L||(e.AccessibilitySupport=L={}));var k;(function(R){R[R.Invoke=1]="Invoke",R[R.Auto=2]="Auto"})(k||(e.CodeActionTriggerType=k={}));var y;(function(R){R[R.None=0]="None",R[R.KeepWhitespace=1]="KeepWhitespace",R[R.InsertAsSnippet=4]="InsertAsSnippet"})(y||(e.CompletionItemInsertTextRule=y={}));var D;(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"})(D||(e.CompletionItemKind=D={}));var S;(function(R){R[R.Deprecated=1]="Deprecated"})(S||(e.CompletionItemTag=S={}));var f;(function(R){R[R.Invoke=0]="Invoke",R[R.TriggerCharacter=1]="TriggerCharacter",R[R.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(f||(e.CompletionTriggerKind=f={}));var _;(function(R){R[R.EXACT=0]="EXACT",R[R.ABOVE=1]="ABOVE",R[R.BELOW=2]="BELOW"})(_||(e.ContentWidgetPositionPreference=_={}));var g;(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"})(g||(e.CursorChangeReason=g={}));var C;(function(R){R[R.LF=1]="LF",R[R.CRLF=2]="CRLF"})(C||(e.DefaultEndOfLine=C={}));var s;(function(R){R[R.Text=0]="Text",R[R.Read=1]="Read",R[R.Write=2]="Write"})(s||(e.DocumentHighlightKind=s={}));var i;(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"})(i||(e.EditorAutoIndentStrategy=i={}));var n;(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.screenReaderAnnounceInlineSuggestion=7]="screenReaderAnnounceInlineSuggestion",R[R.autoClosingDelete=8]="autoClosingDelete",R[R.autoClosingOvertype=9]="autoClosingOvertype",R[R.autoClosingQuotes=10]="autoClosingQuotes",R[R.autoIndent=11]="autoIndent",R[R.automaticLayout=12]="automaticLayout",R[R.autoSurround=13]="autoSurround",R[R.bracketPairColorization=14]="bracketPairColorization",R[R.guides=15]="guides",R[R.codeLens=16]="codeLens",R[R.codeLensFontFamily=17]="codeLensFontFamily",R[R.codeLensFontSize=18]="codeLensFontSize",R[R.colorDecorators=19]="colorDecorators",R[R.colorDecoratorsLimit=20]="colorDecoratorsLimit",R[R.columnSelection=21]="columnSelection",R[R.comments=22]="comments",R[R.contextmenu=23]="contextmenu",R[R.copyWithSyntaxHighlighting=24]="copyWithSyntaxHighlighting",R[R.cursorBlinking=25]="cursorBlinking",R[R.cursorSmoothCaretAnimation=26]="cursorSmoothCaretAnimation",R[R.cursorStyle=27]="cursorStyle",R[R.cursorSurroundingLines=28]="cursorSurroundingLines",R[R.cursorSurroundingLinesStyle=29]="cursorSurroundingLinesStyle",R[R.cursorWidth=30]="cursorWidth",R[R.disableLayerHinting=31]="disableLayerHinting",R[R.disableMonospaceOptimizations=32]="disableMonospaceOptimizations",R[R.domReadOnly=33]="domReadOnly",R[R.dragAndDrop=34]="dragAndDrop",R[R.dropIntoEditor=35]="dropIntoEditor",R[R.emptySelectionClipboard=36]="emptySelectionClipboard",R[R.experimentalWhitespaceRendering=37]="experimentalWhitespaceRendering",R[R.extraEditorClassName=38]="extraEditorClassName",R[R.fastScrollSensitivity=39]="fastScrollSensitivity",R[R.find=40]="find",R[R.fixedOverflowWidgets=41]="fixedOverflowWidgets",R[R.folding=42]="folding",R[R.foldingStrategy=43]="foldingStrategy",R[R.foldingHighlight=44]="foldingHighlight",R[R.foldingImportsByDefault=45]="foldingImportsByDefault",R[R.foldingMaximumRegions=46]="foldingMaximumRegions",R[R.unfoldOnClickAfterEndOfLine=47]="unfoldOnClickAfterEndOfLine",R[R.fontFamily=48]="fontFamily",R[R.fontInfo=49]="fontInfo",R[R.fontLigatures=50]="fontLigatures",R[R.fontSize=51]="fontSize",R[R.fontWeight=52]="fontWeight",R[R.fontVariations=53]="fontVariations",R[R.formatOnPaste=54]="formatOnPaste",R[R.formatOnType=55]="formatOnType",R[R.glyphMargin=56]="glyphMargin",R[R.gotoLocation=57]="gotoLocation",R[R.hideCursorInOverviewRuler=58]="hideCursorInOverviewRuler",R[R.hover=59]="hover",R[R.inDiffEditor=60]="inDiffEditor",R[R.inlineSuggest=61]="inlineSuggest",R[R.letterSpacing=62]="letterSpacing",R[R.lightbulb=63]="lightbulb",R[R.lineDecorationsWidth=64]="lineDecorationsWidth",R[R.lineHeight=65]="lineHeight",R[R.lineNumbers=66]="lineNumbers",R[R.lineNumbersMinChars=67]="lineNumbersMinChars",R[R.linkedEditing=68]="linkedEditing",R[R.links=69]="links",R[R.matchBrackets=70]="matchBrackets",R[R.minimap=71]="minimap",R[R.mouseStyle=72]="mouseStyle",R[R.mouseWheelScrollSensitivity=73]="mouseWheelScrollSensitivity",R[R.mouseWheelZoom=74]="mouseWheelZoom",R[R.multiCursorMergeOverlapping=75]="multiCursorMergeOverlapping",R[R.multiCursorModifier=76]="multiCursorModifier",R[R.multiCursorPaste=77]="multiCursorPaste",R[R.multiCursorLimit=78]="multiCursorLimit",R[R.occurrencesHighlight=79]="occurrencesHighlight",R[R.overviewRulerBorder=80]="overviewRulerBorder",R[R.overviewRulerLanes=81]="overviewRulerLanes",R[R.padding=82]="padding",R[R.pasteAs=83]="pasteAs",R[R.parameterHints=84]="parameterHints",R[R.peekWidgetDefaultFocus=85]="peekWidgetDefaultFocus",R[R.definitionLinkOpensInPeek=86]="definitionLinkOpensInPeek",R[R.quickSuggestions=87]="quickSuggestions",R[R.quickSuggestionsDelay=88]="quickSuggestionsDelay",R[R.readOnly=89]="readOnly",R[R.readOnlyMessage=90]="readOnlyMessage",R[R.renameOnType=91]="renameOnType",R[R.renderControlCharacters=92]="renderControlCharacters",R[R.renderFinalNewline=93]="renderFinalNewline",R[R.renderLineHighlight=94]="renderLineHighlight",R[R.renderLineHighlightOnlyWhenFocus=95]="renderLineHighlightOnlyWhenFocus",R[R.renderValidationDecorations=96]="renderValidationDecorations",R[R.renderWhitespace=97]="renderWhitespace",R[R.revealHorizontalRightPadding=98]="revealHorizontalRightPadding",R[R.roundedSelection=99]="roundedSelection",R[R.rulers=100]="rulers",R[R.scrollbar=101]="scrollbar",R[R.scrollBeyondLastColumn=102]="scrollBeyondLastColumn",R[R.scrollBeyondLastLine=103]="scrollBeyondLastLine",R[R.scrollPredominantAxis=104]="scrollPredominantAxis",R[R.selectionClipboard=105]="selectionClipboard",R[R.selectionHighlight=106]="selectionHighlight",R[R.selectOnLineNumbers=107]="selectOnLineNumbers",R[R.showFoldingControls=108]="showFoldingControls",R[R.showUnused=109]="showUnused",R[R.snippetSuggestions=110]="snippetSuggestions",R[R.smartSelect=111]="smartSelect",R[R.smoothScrolling=112]="smoothScrolling",R[R.stickyScroll=113]="stickyScroll",R[R.stickyTabStops=114]="stickyTabStops",R[R.stopRenderingLineAfter=115]="stopRenderingLineAfter",R[R.suggest=116]="suggest",R[R.suggestFontSize=117]="suggestFontSize",R[R.suggestLineHeight=118]="suggestLineHeight",R[R.suggestOnTriggerCharacters=119]="suggestOnTriggerCharacters",R[R.suggestSelection=120]="suggestSelection",R[R.tabCompletion=121]="tabCompletion",R[R.tabIndex=122]="tabIndex",R[R.unicodeHighlighting=123]="unicodeHighlighting",R[R.unusualLineTerminators=124]="unusualLineTerminators",R[R.useShadowDOM=125]="useShadowDOM",R[R.useTabStops=126]="useTabStops",R[R.wordBreak=127]="wordBreak",R[R.wordSeparators=128]="wordSeparators",R[R.wordWrap=129]="wordWrap",R[R.wordWrapBreakAfterCharacters=130]="wordWrapBreakAfterCharacters",R[R.wordWrapBreakBeforeCharacters=131]="wordWrapBreakBeforeCharacters",R[R.wordWrapColumn=132]="wordWrapColumn",R[R.wordWrapOverride1=133]="wordWrapOverride1",R[R.wordWrapOverride2=134]="wordWrapOverride2",R[R.wrappingIndent=135]="wrappingIndent",R[R.wrappingStrategy=136]="wrappingStrategy",R[R.showDeprecated=137]="showDeprecated",R[R.inlayHints=138]="inlayHints",R[R.editorClassName=139]="editorClassName",R[R.pixelRatio=140]="pixelRatio",R[R.tabFocusMode=141]="tabFocusMode",R[R.layoutInfo=142]="layoutInfo",R[R.wrappingInfo=143]="wrappingInfo",R[R.defaultColorDecorators=144]="defaultColorDecorators",R[R.colorDecoratorsActivatedOn=145]="colorDecoratorsActivatedOn",R[R.inlineCompletionsAccessibilityVerbose=146]="inlineCompletionsAccessibilityVerbose"})(n||(e.EditorOption=n={}));var t;(function(R){R[R.TextDefined=0]="TextDefined",R[R.LF=1]="LF",R[R.CRLF=2]="CRLF"})(t||(e.EndOfLinePreference=t={}));var a;(function(R){R[R.LF=0]="LF",R[R.CRLF=1]="CRLF"})(a||(e.EndOfLineSequence=a={}));var u;(function(R){R[R.Left=1]="Left",R[R.Right=2]="Right"})(u||(e.GlyphMarginLane=u={}));var h;(function(R){R[R.None=0]="None",R[R.Indent=1]="Indent",R[R.IndentOutdent=2]="IndentOutdent",R[R.Outdent=3]="Outdent"})(h||(e.IndentAction=h={}));var r;(function(R){R[R.Both=0]="Both",R[R.Right=1]="Right",R[R.Left=2]="Left",R[R.None=3]="None"})(r||(e.InjectedTextCursorStops=r={}));var c;(function(R){R[R.Type=1]="Type",R[R.Parameter=2]="Parameter"})(c||(e.InlayHintKind=c={}));var o;(function(R){R[R.Automatic=0]="Automatic",R[R.Explicit=1]="Explicit"})(o||(e.InlineCompletionTriggerKind=o={}));var d;(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"})(d||(e.KeyCode=d={}));var l;(function(R){R[R.Hint=1]="Hint",R[R.Info=2]="Info",R[R.Warning=4]="Warning",R[R.Error=8]="Error"})(l||(e.MarkerSeverity=l={}));var p;(function(R){R[R.Unnecessary=1]="Unnecessary",R[R.Deprecated=2]="Deprecated"})(p||(e.MarkerTag=p={}));var m;(function(R){R[R.Inline=1]="Inline",R[R.Gutter=2]="Gutter"})(m||(e.MinimapPosition=m={}));var v;(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"})(v||(e.MouseTargetType=v={}));var b;(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"})(b||(e.OverlayWidgetPositionPreference=b={}));var w;(function(R){R[R.Left=1]="Left",R[R.Center=2]="Center",R[R.Right=4]="Right",R[R.Full=7]="Full"})(w||(e.OverviewRulerLane=w={}));var E;(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"})(E||(e.PositionAffinity=E={}));var I;(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"})(I||(e.RenderLineNumbersType=I={}));var M;(function(R){R[R.None=0]="None",R[R.Text=1]="Text",R[R.Blocks=2]="Blocks"})(M||(e.RenderMinimap=M={}));var P;(function(R){R[R.Smooth=0]="Smooth",R[R.Immediate=1]="Immediate"})(P||(e.ScrollType=P={}));var x;(function(R){R[R.Auto=1]="Auto",R[R.Hidden=2]="Hidden",R[R.Visible=3]="Visible"})(x||(e.ScrollbarVisibility=x={}));var T;(function(R){R[R.LTR=0]="LTR",R[R.RTL=1]="RTL"})(T||(e.SelectionDirection=T={}));var A;(function(R){R[R.Invoke=1]="Invoke",R[R.TriggerCharacter=2]="TriggerCharacter",R[R.ContentChange=3]="ContentChange"})(A||(e.SignatureHelpTriggerKind=A={}));var N;(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"})(N||(e.SymbolKind=N={}));var F;(function(R){R[R.Deprecated=1]="Deprecated"})(F||(e.SymbolTag=F={}));var O;(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"})(O||(e.TextEditorCursorBlinkingStyle=O={}));var W;(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"})(W||(e.TextEditorCursorStyle=W={}));var U;(function(R){R[R.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",R[R.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",R[R.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",R[R.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(U||(e.TrackedRangeStickiness=U={}));var j;(function(R){R[R.None=0]="None",R[R.Same=1]="Same",R[R.Indent=2]="Indent",R[R.DeepIndent=3]="DeepIndent"})(j||(e.WrappingIndent=j={}))}),define(ne[513],se([1,0]),function(Q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BracketPairWithMinIndentationInfo=e.BracketPairInfo=e.BracketInfo=void 0;class L{constructor(S,f,_,g){this.range=S,this.nestingLevel=f,this.nestingLevelOfEqualBracketType=_,this.isInvalid=g}}e.BracketInfo=L;class k{constructor(S,f,_,g,C,s){this.range=S,this.openingBracketRange=f,this.closingBracketRange=_,this.nestingLevel=g,this.nestingLevelOfEqualBracketType=C,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}e.BracketPairInfo=k;class y extends k{constructor(S,f,_,g,C,s,i){super(S,f,_,g,C,s),this.minVisibleColumnIndentation=i}}e.BracketPairWithMinIndentationInfo=y}),define(ne[514],se([1,0,6,2,513,179,280,91,279,126,206,14,278]),function(Q,e,L,k,y,D,S,f,_,g,C,s,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BracketPairsTree=void 0;class n extends k.Disposable{didLanguageChange(o){return this.brackets.didLanguageChange(o)}constructor(o,d){if(super(),this.textModel=o,this.getLanguageConfiguration=d,this.didChangeEmitter=new L.Emitter,this.denseKeyProvider=new g.DenseKeyProvider,this.brackets=new S.LanguageAgnosticBracketTokens(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],o.tokenization.hasTokens)o.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 l=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),p=new C.FastTokenizer(this.textModel.getValue(),l);this.initialAstWithoutTokens=(0,_.parseDocument)(p,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const o=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,o||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:o}){const d=o.map(l=>new D.TextEditInfo((0,f.toLength)(l.fromLineNumber-1,0),(0,f.toLength)(l.toLineNumber,0),(0,f.toLength)(l.toLineNumber-l.fromLineNumber+1,0)));this.handleEdits(d,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(o){const d=D.TextEditInfo.fromModelContentChanges(o.changes);this.handleEdits(d,!1)}handleEdits(o,d){const l=(0,i.combineTextEditInfos)(this.queuedTextEdits,o);this.queuedTextEdits=l,this.initialAstWithoutTokens&&!d&&(this.queuedTextEditsForInitialAstWithoutTokens=(0,i.combineTextEditInfos)(this.queuedTextEditsForInitialAstWithoutTokens,o))}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(o,d,l){const m=d,v=new C.TextBufferTokenizer(this.textModel,this.brackets);return(0,_.parseDocument)(v,o,m,l)}getBracketsInRange(o,d){this.flushQueue();const l=(0,f.toLength)(o.startLineNumber-1,o.startColumn-1),p=(0,f.toLength)(o.endLineNumber-1,o.endColumn-1);return new s.CallbackIterable(m=>{const v=this.initialAstWithoutTokens||this.astWithTokens;u(v,f.lengthZero,v.length,l,p,m,0,0,new Map,d)})}getBracketPairsInRange(o,d){this.flushQueue();const l=(0,f.positionToLength)(o.getStartPosition()),p=(0,f.positionToLength)(o.getEndPosition());return new s.CallbackIterable(m=>{const v=this.initialAstWithoutTokens||this.astWithTokens,b=new h(m,d,this.textModel);r(v,f.lengthZero,v.length,l,p,b,0,new Map)})}getFirstBracketAfter(o){this.flushQueue();const d=this.initialAstWithoutTokens||this.astWithTokens;return a(d,f.lengthZero,d.length,(0,f.positionToLength)(o))}getFirstBracketBefore(o){this.flushQueue();const d=this.initialAstWithoutTokens||this.astWithTokens;return t(d,f.lengthZero,d.length,(0,f.positionToLength)(o))}}e.BracketPairsTree=n;function t(c,o,d,l){if(c.kind===4||c.kind===2){const p=[];for(const m of c.children)d=(0,f.lengthAdd)(o,m.length),p.push({nodeOffsetStart:o,nodeOffsetEnd:d}),o=d;for(let m=p.length-1;m>=0;m--){const{nodeOffsetStart:v,nodeOffsetEnd:b}=p[m];if((0,f.lengthLessThan)(v,l)){const w=t(c.children[m],v,b,l);if(w)return w}}return null}else{if(c.kind===3)return null;if(c.kind===1){const p=(0,f.lengthsToRange)(o,d);return{bracketInfo:c.bracketInfo,range:p}}}return null}function a(c,o,d,l){if(c.kind===4||c.kind===2){for(const p of c.children){if(d=(0,f.lengthAdd)(o,p.length),(0,f.lengthLessThan)(l,d)){const m=a(p,o,d,l);if(m)return m}o=d}return null}else{if(c.kind===3)return null;if(c.kind===1){const p=(0,f.lengthsToRange)(o,d);return{bracketInfo:c.bracketInfo,range:p}}}return null}function u(c,o,d,l,p,m,v,b,w,E,I=!1){if(v>200)return!0;e:for(;;)switch(c.kind){case 4:{const M=c.childrenLength;for(let P=0;P200)return!0;let E=!0;if(c.kind===2){let I=0;if(b){let x=b.get(c.openingBracket.text);x===void 0&&(x=0),I=x,x++,b.set(c.openingBracket.text,x)}const M=(0,f.lengthAdd)(o,c.openingBracket.length);let P=-1;if(m.includeMinIndentation&&(P=c.computeMinIndentation(o,m.textModel)),E=m.push(new y.BracketPairWithMinIndentationInfo((0,f.lengthsToRange)(o,d),(0,f.lengthsToRange)(o,M),c.closingBracket?(0,f.lengthsToRange)((0,f.lengthAdd)(M,((w=c.child)===null||w===void 0?void 0:w.length)||f.lengthZero),d):void 0,v,I,c,P)),o=M,E&&c.child){const x=c.child;if(d=(0,f.lengthAdd)(o,x.length),(0,f.lengthLessThanEqual)(o,p)&&(0,f.lengthGreaterThanEqual)(d,l)&&(E=r(x,o,d,l,p,m,v+1,b),!E))return!1}b?.set(c.openingBracket.text,I)}else{let I=o;for(const M of c.children){const P=I;if(I=(0,f.lengthAdd)(I,M.length),(0,f.lengthLessThanEqual)(P,p)&&(0,f.lengthLessThanEqual)(l,I)&&(E=r(M,P,I,l,p,m,v,b),!E))return!1}}return E}}),define(ne[111],se([1,0]),function(Q,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 L{constructor(){this.changeType=1}}e.ModelRawFlush=L;class k{static applyInjectedText(i,n){if(!n||n.length===0)return i;let t="",a=0;for(const u of n)t+=i.substring(a,u.column-1),a=u.column-1,t+=u.options.content;return t+=i.substring(a),t}static fromDecorations(i){const n=[];for(const t of i)t.options.before&&t.options.before.content.length>0&&n.push(new k(t.ownerId,t.range.startLineNumber,t.range.startColumn,t.options.before,0)),t.options.after&&t.options.after.content.length>0&&n.push(new k(t.ownerId,t.range.endLineNumber,t.range.endColumn,t.options.after,1));return n.sort((t,a)=>t.lineNumber===a.lineNumber?t.column===a.column?t.order-a.order:t.column-a.column:t.lineNumber-a.lineNumber),n}constructor(i,n,t,a,u){this.ownerId=i,this.lineNumber=n,this.column=t,this.options=a,this.order=u}}e.LineInjectedText=k;class y{constructor(i,n,t){this.changeType=2,this.lineNumber=i,this.detail=n,this.injectedText=t}}e.ModelRawLineChanged=y;class D{constructor(i,n){this.changeType=3,this.fromLineNumber=i,this.toLineNumber=n}}e.ModelRawLinesDeleted=D;class S{constructor(i,n,t,a){this.changeType=4,this.injectedTexts=a,this.fromLineNumber=i,this.toLineNumber=n,this.detail=t}}e.ModelRawLinesInserted=S;class f{constructor(){this.changeType=5}}e.ModelRawEOLChanged=f;class _{constructor(i,n,t,a){this.changes=i,this.versionId=n,this.isUndoing=t,this.isRedoing=a,this.resultingSelection=null}containsEvent(i){for(let n=0,t=this.changes.length;nu)throw new g.BugIndicatingError("Illegal value for lineNumber");const h=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(h&&h.offSide);let c=-2,o=-1,d=-2,l=-1;const p=N=>{if(c!==-1&&(c===-2||c>N-1)){c=-1,o=-1;for(let F=N-2;F>=0;F--){const O=this._computeIndentLevel(F);if(O>=0){c=F,o=O;break}}}if(d===-2){d=-1,l=-1;for(let F=N;F=0){d=F,l=O;break}}}};let m=-2,v=-1,b=-2,w=-1;const E=N=>{if(m===-2){m=-1,v=-1;for(let F=N-2;F>=0;F--){const O=this._computeIndentLevel(F);if(O>=0){m=F,v=O;break}}}if(b!==-1&&(b===-2||b=0){b=F,w=O;break}}}};let I=0,M=!0,P=0,x=!0,T=0,A=0;for(let N=0;M||x;N++){const F=n-N,O=n+N;N>1&&(F<1||F1&&(O>u||O>a)&&(x=!1),N>5e4&&(M=!1,x=!1);let W=-1;if(M&&F>=1){const j=this._computeIndentLevel(F-1);j>=0?(d=F-1,l=j,W=Math.ceil(j/this.textModel.getOptions().indentSize)):(p(F),W=this._getIndentLevelForWhitespaceLine(r,o,l))}let U=-1;if(x&&O<=u){const j=this._computeIndentLevel(O-1);j>=0?(m=O-1,v=j,U=Math.ceil(j/this.textModel.getOptions().indentSize)):(E(O),U=this._getIndentLevelForWhitespaceLine(r,v,w))}if(N===0){A=W;continue}if(N===1){if(O<=u&&U>=0&&A+1===U){M=!1,I=O,P=O,T=U;continue}if(F>=1&&W>=0&&W-1===A){x=!1,I=F,P=F,T=W;continue}if(I=n,P=n,T=A,T===0)return{startLineNumber:I,endLineNumber:P,indent:T}}M&&(W>=T?I=F:M=!1),x&&(U>=T?P=O:x=!1)}return{startLineNumber:I,endLineNumber:P,indent:T}}getLinesBracketGuides(n,t,a,u){var h;const r=[];for(let m=n;m<=t;m++)r.push([]);const c=!0,o=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new D.Range(n,1,t,this.textModel.getLineMaxColumn(t))).toArray();let d;if(a&&o.length>0){const m=(n<=a.lineNumber&&a.lineNumber<=t?o:this.textModel.bracketPairs.getBracketPairsInRange(D.Range.fromPositions(a)).toArray()).filter(v=>D.Range.strictContainsPosition(v.range,a));d=(h=(0,L.findLast)(m,v=>c||v.range.startLineNumber!==v.range.endLineNumber))===null||h===void 0?void 0:h.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,p=new s;for(const m of o){if(!m.closingBracketRange)continue;const v=d&&m.range.equalsRange(d);if(!v&&!u.includeInactive)continue;const b=p.getInlineClassName(m.nestingLevel,m.nestingLevelOfEqualBracketType,l)+(u.highlightActive&&v?" "+p.activeClassName:""),w=m.openingBracketRange.getStartPosition(),E=m.closingBracketRange.getStartPosition(),I=u.horizontalGuides===_.HorizontalGuidesState.Enabled||u.horizontalGuides===_.HorizontalGuidesState.EnabledForActive&&v;if(m.range.startLineNumber===m.range.endLineNumber){c&&I&&r[m.range.startLineNumber-n].push(new _.IndentGuide(-1,m.openingBracketRange.getEndPosition().column,b,new _.IndentGuideHorizontalLine(!1,E.column),-1,-1));continue}const M=this.getVisibleColumnFromPosition(E),P=this.getVisibleColumnFromPosition(m.openingBracketRange.getStartPosition()),x=Math.min(P,M,m.minVisibleColumnIndentation+1);let T=!1;k.firstNonWhitespaceIndex(this.textModel.getLineContent(m.closingBracketRange.startLineNumber))=n&&P>x&&r[w.lineNumber-n].push(new _.IndentGuide(x,-1,b,new _.IndentGuideHorizontalLine(!1,w.column),-1,-1)),E.lineNumber<=t&&M>x&&r[E.lineNumber-n].push(new _.IndentGuide(x,-1,b,new _.IndentGuideHorizontalLine(!T,E.column),-1,-1)))}for(const m of r)m.sort((v,b)=>v.visibleColumn-b.visibleColumn);return r}getVisibleColumnFromPosition(n){return y.CursorColumns.visibleColumnFromColumn(this.textModel.getLineContent(n.lineNumber),n.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(n,t){this.assertNotDisposed();const a=this.textModel.getLineCount();if(n<1||n>a)throw new Error("Illegal value for startLineNumber");if(t<1||t>a)throw new Error("Illegal value for endLineNumber");const u=this.textModel.getOptions(),h=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(h&&h.offSide),c=new Array(t-n+1);let o=-2,d=-1,l=-2,p=-1;for(let m=n;m<=t;m++){const v=m-n,b=this._computeIndentLevel(m-1);if(b>=0){o=m-1,d=b,c[v]=Math.ceil(b/u.indentSize);continue}if(o===-2){o=-1,d=-1;for(let w=m-2;w>=0;w--){const E=this._computeIndentLevel(w);if(E>=0){o=w,d=E;break}}}if(l!==-1&&(l===-2||l=0){l=w,p=E;break}}}c[v]=this._getIndentLevelForWhitespaceLine(r,d,p)}return c}_getIndentLevelForWhitespaceLine(n,t,a){const u=this.textModel.getOptions();return t===-1||a===-1?0:t{this._tokenizationSupports.get(f)===_&&(this._tokenizationSupports.delete(f),this.handleChange([f]))})}get(f){return this._tokenizationSupports.get(f)||null}registerFactory(f,_){var g;(g=this._factories.get(f))===null||g===void 0||g.dispose();const C=new D(this,f,_);return this._factories.set(f,C),(0,k.toDisposable)(()=>{const s=this._factories.get(f);!s||s!==C||(this._factories.delete(f),s.dispose())})}getOrCreate(f){return we(this,void 0,void 0,function*(){const _=this.get(f);if(_)return _;const g=this._factories.get(f);return!g||g.isResolved?null:(yield g.resolve(),this.get(f))})}isResolved(f){if(this.get(f))return!0;const g=this._factories.get(f);return!!(!g||g.isResolved)}setColorMap(f){this._colorMap=f,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=y;class D extends k.Disposable{get isResolved(){return this._isResolved}constructor(f,_,g){super(),this._registry=f,this._languageId=_,this._factory=g,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return we(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return we(this,void 0,void 0,function*(){const f=yield this._factory.tokenizationSupport;this._isResolved=!0,f&&!this._isDisposed&&this._register(this._registry.register(this._languageId,f))})}}}),define(ne[516],se([1,0]),function(Q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContiguousMultilineTokens=void 0;class L{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(y,D){this._startLineNumber=y,this._tokens=D}getLineTokens(y){return this._tokens[y-this._startLineNumber]}appendLineTokens(y){this._tokens.push(y)}}e.ContiguousMultilineTokens=L}),define(ne[288],se([1,0,516]),function(Q,e,L){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContiguousMultilineTokensBuilder=void 0;class k{constructor(){this._tokens=[]}add(D,S){if(this._tokens.length>0){const f=this._tokens[this._tokens.length-1];if(f.endLineNumber+1===D){f.appendLineTokens(S);return}}this._tokens.push(new L.ContiguousMultilineTokens(D,[S]))}finalize(){return this._tokens}}e.ContiguousMultilineTokensBuilder=k}),define(ne[86],se([1,0,124]),function(Q,e,L){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LineTokens=void 0;class k{static createEmpty(S,f){const _=k.defaultTokenMetadata,g=new Uint32Array(2);return g[0]=S.length,g[1]=_,new k(g,S,f)}constructor(S,f,_){this._lineTokensBrand=void 0,this._tokens=S,this._tokensCount=this._tokens.length>>>1,this._text=f,this._languageIdCodec=_}equals(S){return S instanceof k?this.slicedEquals(S,0,this._tokensCount):!1}slicedEquals(S,f,_){if(this._text!==S._text||this._tokensCount!==S._tokensCount)return!1;const g=f<<1,C=g+(_<<1);for(let s=g;s0?this._tokens[S-1<<1]:0}getMetadata(S){return this._tokens[(S<<1)+1]}getLanguageId(S){const f=this._tokens[(S<<1)+1],_=L.TokenMetadata.getLanguageId(f);return this._languageIdCodec.decodeLanguageId(_)}getStandardTokenType(S){const f=this._tokens[(S<<1)+1];return L.TokenMetadata.getTokenType(f)}getForeground(S){const f=this._tokens[(S<<1)+1];return L.TokenMetadata.getForeground(f)}getClassName(S){const f=this._tokens[(S<<1)+1];return L.TokenMetadata.getClassNameFromMetadata(f)}getInlineStyle(S,f){const _=this._tokens[(S<<1)+1];return L.TokenMetadata.getInlineStyleFromMetadata(_,f)}getPresentation(S){const f=this._tokens[(S<<1)+1];return L.TokenMetadata.getPresentationFromMetadata(f)}getEndOffset(S){return this._tokens[S<<1]}findTokenIndexAtOffset(S){return k.findIndexInTokensArray(this._tokens,S)}inflate(){return this}sliceAndInflate(S,f,_){return new y(this,S,f,_)}static convertToEndOffset(S,f){const g=(S.length>>>1)-1;for(let C=0;C>>1)-1;for(;_f&&(g=C)}return _}withInserted(S){if(S.length===0)return this;let f=0,_=0,g="";const C=new Array;let s=0;for(;;){const i=fs){g+=this._text.substring(s,n.offset);const t=this._tokens[(f<<1)+1];C.push(g.length,t),s=n.offset}g+=n.text,C.push(g.length,n.tokenMetadata),_++}else break}return new k(new Uint32Array(C),g,this._languageIdCodec)}}e.LineTokens=k,k.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class y{constructor(S,f,_,g){this._source=S,this._startOffset=f,this._endOffset=_,this._deltaOffset=g,this._firstTokenIndex=S.findTokenIndexAtOffset(f),this._tokensCount=0;for(let C=this._firstTokenIndex,s=S.getCount();C=_);C++)this._tokensCount++}getMetadata(S){return this._source.getMetadata(this._firstTokenIndex+S)}getLanguageId(S){return this._source.getLanguageId(this._firstTokenIndex+S)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(S){return S instanceof y?this._startOffset===S._startOffset&&this._endOffset===S._endOffset&&this._deltaOffset===S._deltaOffset&&this._source.slicedEquals(S._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(S){return this._source.getForeground(this._firstTokenIndex+S)}getEndOffset(S){const f=this._source.getEndOffset(this._firstTokenIndex+S);return Math.min(this._endOffset,f)-this._startOffset+this._deltaOffset}getClassName(S){return this._source.getClassName(this._firstTokenIndex+S)}getInlineStyle(S,f){return this._source.getInlineStyle(this._firstTokenIndex+S,f)}getPresentation(S){return this._source.getPresentation(this._firstTokenIndex+S)}findTokenIndexAtOffset(S){return this._source.findTokenIndexAtOffset(S+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}}),define(ne[517],se([1,0,86]),function(Q,e,L){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toUint32Array=e.ContiguousTokensEditing=e.EMPTY_LINE_TOKENS=void 0,e.EMPTY_LINE_TOKENS=new Uint32Array(0).buffer;class k{static deleteBeginning(S,f){return S===null||S===e.EMPTY_LINE_TOKENS?S:k.delete(S,0,f)}static deleteEnding(S,f){if(S===null||S===e.EMPTY_LINE_TOKENS)return S;const _=y(S),g=_[_.length-2];return k.delete(S,f,g)}static delete(S,f,_){if(S===null||S===e.EMPTY_LINE_TOKENS||f===_)return S;const g=y(S),C=g.length>>>1;if(f===0&&g[g.length-2]===_)return e.EMPTY_LINE_TOKENS;const s=L.LineTokens.findIndexInTokensArray(g,f),i=s>0?g[s-1<<1]:0,n=g[s<<1];if(_a&&(g[t++]=c,g[t++]=g[(r<<1)+1],a=c)}if(t===g.length)return S;const h=new Uint32Array(t);return h.set(g.subarray(0,t),0),h.buffer}static append(S,f){if(f===e.EMPTY_LINE_TOKENS)return S;if(S===e.EMPTY_LINE_TOKENS)return f;if(S===null)return S;if(f===null)return null;const _=y(S),g=y(f),C=g.length>>>1,s=new Uint32Array(_.length+g.length);s.set(_,0);let i=_.length;const n=_[_.length-2];for(let t=0;t>>1;let s=L.LineTokens.findIndexInTokensArray(g,f);s>0&&g[s-1<<1]===f&&s--;for(let i=s;i0}getTokens(C,s,i){let n=null;if(s1&&(t=S.TokenMetadata.getLanguageId(n[1])!==C),!t)return y.EMPTY_LINE_TOKENS}if(!n||n.length===0){const t=new Uint32Array(2);return t[0]=s,t[1]=_(C),t.buffer}return n[n.length-2]=s,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(C){for(;C>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(C,s){s!==0&&(C+s>this._len&&(s=this._len-C),this._lineTokens.splice(C,s),this._len-=s)}_insertLines(C,s){if(s===0)return;const i=[];for(let n=0;n=this._len)return;if(C.startLineNumber===C.endLineNumber){if(C.startColumn===C.endColumn)return;this._lineTokens[s]=y.ContiguousTokensEditing.delete(this._lineTokens[s],C.startColumn-1,C.endColumn-1);return}this._lineTokens[s]=y.ContiguousTokensEditing.deleteEnding(this._lineTokens[s],C.startColumn-1);const i=C.endLineNumber-1;let n=null;i=this._len)){if(s===0){this._lineTokens[n]=y.ContiguousTokensEditing.insert(this._lineTokens[n],C.column-1,i);return}this._lineTokens[n]=y.ContiguousTokensEditing.deleteEnding(this._lineTokens[n],C.column-1),this._lineTokens[n]=y.ContiguousTokensEditing.insert(this._lineTokens[n],C.column-1,i),this._insertLines(C.lineNumber,s)}}setMultilineTokens(C,s){if(C.length===0)return{changes:[]};const i=[];for(let n=0,t=C.length;n>>0}}),define(ne[519],se([1,0,12,5,122]),function(Q,e,L,k,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SparseLineTokens=e.SparseMultilineTokens=void 0;class D{static create(g,C){return new D(g,new S(C))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(g,C){this._startLineNumber=g,this._tokens=C,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(g){return this._startLineNumber<=g&&g<=this._endLineNumber?this._tokens.getLineTokens(g-this._startLineNumber):null}getRange(){const g=this._tokens.getRange();return g&&new k.Range(this._startLineNumber+g.startLineNumber,g.startColumn,this._startLineNumber+g.endLineNumber,g.endColumn)}removeTokens(g){const C=g.startLineNumber-this._startLineNumber,s=g.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(C,g.startColumn-1,s,g.endColumn-1),this._updateEndLineNumber()}split(g){const C=g.startLineNumber-this._startLineNumber,s=g.endLineNumber-this._startLineNumber,[i,n,t]=this._tokens.split(C,g.startColumn-1,s,g.endColumn-1);return[new D(this._startLineNumber,i),new D(this._startLineNumber+t,n)]}applyEdit(g,C){const[s,i,n]=(0,y.countEOL)(C);this.acceptEdit(g,s,i,n,C.length>0?C.charCodeAt(0):0)}acceptEdit(g,C,s,i,n){this._acceptDeleteRange(g),this._acceptInsertText(new L.Position(g.startLineNumber,g.startColumn),C,s,i,n),this._updateEndLineNumber()}_acceptDeleteRange(g){if(g.startLineNumber===g.endLineNumber&&g.startColumn===g.endColumn)return;const C=g.startLineNumber-this._startLineNumber,s=g.endLineNumber-this._startLineNumber;if(s<0){const n=s-C;this._startLineNumber-=n;return}const i=this._tokens.getMaxDeltaLine();if(!(C>=i+1)){if(C<0&&s>=i+1){this._startLineNumber=0,this._tokens.clear();return}if(C<0){const n=-C;this._startLineNumber-=n,this._tokens.acceptDeleteRange(g.startColumn-1,0,0,s,g.endColumn-1)}else this._tokens.acceptDeleteRange(0,C,g.startColumn-1,s,g.endColumn-1)}}_acceptInsertText(g,C,s,i,n){if(C===0&&s===0)return;const t=g.lineNumber-this._startLineNumber;if(t<0){this._startLineNumber+=C;return}const a=this._tokens.getMaxDeltaLine();t>=a+1||this._tokens.acceptInsertText(t,g.column-1,C,s,i,n)}}e.SparseMultilineTokens=D;class S{constructor(g){this._tokens=g,this._tokenCount=g.length/4}toString(g){const C=[];for(let s=0;sg)s=i-1;else{let t=i;for(;t>C&&this._getDeltaLine(t-1)===g;)t--;let a=i;for(;ag||o===g&&l>=C)&&(o