!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vscodetextmate=t():e.vscodetextmate=t()}(this,(function(){return(()=>{"use strict";var e={350:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UseOnigurumaFindOptions=t.DebugFlags=void 0,t.DebugFlags={InDebugMode:"undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG},t.UseOnigurumaFindOptions=!1},527:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BalancedBracketSelectors=t.LocalStackElement=t.StackElement=t.ScopeListElement=t.StackElementMetadata=t.Grammar=t.ScopeMetadata=t.ScopeDependencyProcessor=t.ScopeDependencyCollector=t.PartialScopeDependency=t.FullScopeDependency=t.createGrammar=void 0;var r=n(878),o=n(792),i=n(736),s=n(350),a="undefined"==typeof performance?function(){return Date.now()}:function(){return performance.now()};t.createGrammar=function(e,t,n,r,o,i,s,a){return new C(e,t,n,r,o,i,s,a)};var c=function(e){this.scopeName=e};t.FullScopeDependency=c;var u=function(){function e(e,t){this.scopeName=e,this.include=t}return e.prototype.toKey=function(){return this.scopeName+"#"+this.include},e}();t.PartialScopeDependency=u;var l=function(){function e(){this.full=[],this.partial=[],this.visitedRule=new Set,this._seenFull=new Set,this._seenPartial=new Set}return e.prototype.add=function(e){e instanceof c?this._seenFull.has(e.scopeName)||(this._seenFull.add(e.scopeName),this.full.push(e)):this._seenPartial.has(e.toKey())||(this._seenPartial.add(e.toKey()),this.partial.push(e))},e}();function h(e,t,n,o,i){for(var s=0,a=o;s=0){var _=d.substring(0,m),y=d.substring(m+1);_===t.scopeName?f(e,t,t,y,p):_===n.scopeName?f(e,t,n,y,p):e.add(new u(_,d.substring(m+1)))}else e.add(new c(d))}}}}t.ScopeDependencyCollector=l;var p=function(){function e(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new c(this.initialScopeName)]}return e.prototype.processQueue=function(){var e=this.Q;this.Q=[];for(var t=new l,n=0,r=e;n")}function f(e,t,n,r,o){void 0===o&&(o=n.repository),o&&o[r]&&h(e,t,n,[o[r]],o)}function g(e,t,n){if(n.patterns&&Array.isArray(n.patterns)&&h(e,t,n,n.patterns,n.repository),n.injections){var r=[];for(var o in n.injections)r.push(n.injections[o]);h(e,t,n,r,n.repository)}}function m(e,t){if(!e)return!1;if(e===t)return!0;var n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}function _(e,t){if(t.length>")}var u=Object.keys(this._embeddedLanguages).map((function(t){return e._escapeRegExpCharacters(t)}));0===u.length?this._embeddedLanguagesRegex=null:(u.sort(),u.reverse(),this._embeddedLanguagesRegex=new RegExp("^(("+u.join(")|(")+"))($|\\.)",""))}return e.prototype.onDidChangeTheme=function(){this._cache=new Map,this._defaultMetaData=new v("",this._initialLanguage,8,[this._themeProvider.getDefaults()])},e.prototype.getDefaultMetadata=function(){return this._defaultMetaData},e._escapeRegExpCharacters=function(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")},e.prototype.getMetadataForScope=function(t){if(null===t)return e._NULL_SCOPE_METADATA;var n=this._cache.get(t);return n||(n=this._doGetMetadataForScope(t),this._cache.set(t,n),n)},e.prototype._doGetMetadataForScope=function(e){var t=this._scopeToLanguage(e),n=this._toStandardTokenType(e),r=this._themeProvider.themeMatch(e);return new v(e,t,n,r)},e.prototype._scopeToLanguage=function(e){if(!e)return 0;if(!this._embeddedLanguagesRegex)return 0;var t=e.match(this._embeddedLanguagesRegex);return t&&(this._embeddedLanguages[t[1]]||0)||0},e.prototype._toStandardTokenType=function(t){var n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")},e._NULL_SCOPE_METADATA=new v("",0,0,null),e.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/,e}(),C=function(){function e(e,t,n,r,o,s,a,c){if(this.balancedBracketSelectors=s,this._scopeName=e,this._scopeMetadataProvider=new b(n,a,r),this._onigLib=c,this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=k(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(var u=0,l=Object.keys(o);u0)){console.log("Grammar "+this._scopeName+" contains the following injections:");for(var e=0,t=this._injections;el)break;for(;u.length>0&&u[u.length-1].endPos<=d.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,d.start):o.produce(r,d.start),p.retokenizeCapturedWithRuleId){var f=p.getName(a,s),g=r.contentNameScopesList.push(e,f),m=p.getContentName(a,s),_=g.push(e,m),y=r.push(p.retokenizeCapturedWithRuleId,d.start,-1,!1,null,g,_),v=e.createOnigString(a.substring(0,d.end));T(e,v,n&&0===d.start,d.start,y,o,!1,0),S(v)}else{var b=p.getName(a,s);if(null!==b){var C=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).push(e,b);u.push(new N(C,d.end))}}}}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}}function w(e){for(var t=[],n=0,r=e.rules.length;nr&&(r=m.captureIndices[0].end,n=!1))}return{stack:i,linePos:r,anchorPosition:c,isFirstLine:n}}(e,t,n,r,i,c);i=f.stack,r=f.linePos,n=f.isFirstLine,d=f.anchorPosition}for(var g=Date.now();!p;){if(0!==l&&Date.now()-g>l)return new x(i,!0);m()}return new x(i,!1);function m(){s.DebugFlags.InDebugMode&&(console.log(""),console.log("@@scanNext "+r+": |"+t.content.substr(r).replace(/\n$/,"\\n")+"|"));var u=function(e,t,n,r,o,i){var c=function(e,t,n,r,o,i){var c=o.getRule(e),u=A(c,e,o.endRule,n,r===i),l=u.ruleScanner,h=u.findOptions,p=0;s.DebugFlags.InDebugMode&&(p=a());var d=l.scanner.findNextMatchSync(t,r,h);if(s.DebugFlags.InDebugMode){var f=a()-p;f>5&&console.warn("Rule "+c.debugName+" ("+c.id+") matching took "+f+" against '"+t+"'"),console.log(" scanning for (linePos: "+r+", anchorPosition: "+i+")"),console.log(w(l)),d&&console.log("matched rule id: "+l.rules[d.index]+" from "+d.captureIndices[0].start+" to "+d.captureIndices[0].end)}return d?{captureIndices:d.captureIndices,matchedRuleId:l.rules[d.index]}:null}(e,t,n,r,o,i),u=e.getInjections();if(0===u.length)return c;var l=function(e,t,n,r,o,i,a){for(var c,u=Number.MAX_VALUE,l=null,h=0,p=i.contentNameScopesList.generateScopes(),d=0,f=e.length;d=u)&&(u=b,l=v.captureIndices,c=_.rules[v.index],h=g.priority,u===o))break}}}return l?{priorityMatch:-1===h,captureIndices:l,matchedRuleId:c}:null}(u,e,t,n,r,o,i);if(!l)return c;if(!c)return l;var h=c.captureIndices[0].start,p=l.captureIndices[0].start;return p0)&&l[0].end>r;if(-1===f){var m=i.getRule(e);s.DebugFlags.InDebugMode&&console.log(" popping "+m.debugName+" - "+m.debugEndRegExp),c.produce(i,l[0].start),i=i.setContentNameScopesList(i.nameScopesList),R(e,t,n,i,c,m.endCaptures,l),c.produce(i,l[0].end);var _=i;if(i=i.pop(),d=_.getAnchorPos(),!g&&_.getEnterPos()===r)return s.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),i=_,c.produce(i,h),void(p=!0)}else{var y=e.getRule(f);c.produce(i,l[0].start);var v=i,b=y.getName(t.content,l),C=i.contentNameScopesList.push(e,b);if(i=i.push(f,r,d,l[0].end===h,null,C,C),y instanceof o.BeginEndRule){var S=y;s.DebugFlags.InDebugMode&&console.log(" pushing "+S.debugName+" - "+S.debugBeginRegExp),R(e,t,n,i,c,S.beginCaptures,l),c.produce(i,l[0].end),d=l[0].end;var k=S.getContentName(t.content,l),P=C.push(e,k);if(i=i.setContentNameScopesList(P),S.endHasBackReferences&&(i=i.setEndRule(S.getEndWithResolvedBackReferences(t.content,l))),!g&&v.hasSameRuleAs(i))return s.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),i=i.pop(),c.produce(i,h),void(p=!0)}else if(y instanceof o.BeginWhileRule){if(S=y,s.DebugFlags.InDebugMode&&console.log(" pushing "+S.debugName),R(e,t,n,i,c,S.beginCaptures,l),c.produce(i,l[0].end),d=l[0].end,k=S.getContentName(t.content,l),P=C.push(e,k),i=i.setContentNameScopesList(P),S.whileHasBackReferences&&(i=i.setEndRule(S.getWhileWithResolvedBackReferences(t.content,l))),!g&&v.hasSameRuleAs(i))return s.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),i=i.pop(),c.produce(i,h),void(p=!0)}else{var I=y;if(s.DebugFlags.InDebugMode&&console.log(" matched "+I.debugName+" - "+I.debugMatchRegExp),R(e,t,n,i,c,I.captures,l),c.produce(i,l[0].end),i=i.pop(),!g)return s.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),i=i.safePop(),c.produce(i,h),void(p=!0)}}l[0].end>r&&(r=l[0].end,n=!1)}}var G=function(){function e(){}return e.toBinaryStr=function(e){for(var t=e.toString(2);t.length<32;)t="0"+t;return t},e.printMetadata=function(t){var n=e.getLanguageId(t),r=e.getTokenType(t),o=e.getFontStyle(t),i=e.getForeground(t),s=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:i,background:s})},e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(768&e)>>>8},e.containsBalancedBrackets=function(e){return 0!=(1024&e)},e.getFontStyle=function(e){return(30720&e)>>>11},e.getForeground=function(e){return(16744448&e)>>>15},e.getBackground=function(e){return(4278190080&e)>>>24},e.set=function(t,n,r,o,i,s,a){var c=e.getLanguageId(t),u=e.getTokenType(t),l=e.containsBalancedBrackets(t)?1:0,h=e.getFontStyle(t),p=e.getForeground(t),d=e.getBackground(t);return 0!==n&&(c=n),8!==r&&(u=r),null!==o&&(l=o?1:0),-1!==i&&(h=i),0!==s&&(p=s),0!==a&&(d=a),(c<<0|u<<8|l<<10|h<<11|p<<15|d<<24)>>>0},e}();t.StackElementMetadata=G;var E=function(){function e(e,t,n){this.parent=e,this.scope=t,this.metadata=n}return e._equals=function(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scope!==t.scope||e.metadata!==t.metadata)return!1;e=e.parent,t=t.parent}},e.prototype.equals=function(t){return e._equals(this,t)},e._matchesScope=function(e,t,n){return t===e||e.substring(0,n.length)===n},e._matches=function(e,t){if(null===t)return!0;for(var n=t.length,r=0,o=t[r],i=o+".";e;){if(this._matchesScope(e.scope,o,i)){if(++r===n)return!0;i=(o=t[r])+"."}e=e.parent}return!1},e.mergeMetadata=function(e,t,n){if(null===n)return e;var r=-1,o=0,i=0;if(null!==n.themeData)for(var s=0,a=n.themeData.length;s=0?e._push(this,t,n.split(/ /g)):e._push(this,t,[n])},e._generateScopes=function(e){for(var t=[],n=0;e;)t[n++]=e.scope,e=e.parent;return t.reverse(),t},e.prototype.generateScopes=function(){return e._generateScopes(this)},e}();t.ScopeListElement=E;var M=function(){function e(e,t,n,r,o,i,s,a){this._stackElementBrand=void 0,this.parent=e,this.depth=this.parent?this.parent.depth+1:1,this.ruleId=t,this._enterPos=n,this._anchorPos=r,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=s,this.contentNameScopesList=a}return e._structuralEquals=function(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}},e._equals=function(e,t){return e===t||!!this._structuralEquals(e,t)&&e.contentNameScopesList.equals(t.contentNameScopesList)},e.prototype.clone=function(){return this},e.prototype.equals=function(t){return null!==t&&e._equals(this,t)},e._reset=function(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent},e.prototype.reset=function(){e._reset(this)},e.prototype.pop=function(){return this.parent},e.prototype.safePop=function(){return this.parent?this.parent:this},e.prototype.push=function(t,n,r,o,i,s,a){return new e(this,t,n,r,o,i,s,a)},e.prototype.getEnterPos=function(){return this._enterPos},e.prototype.getAnchorPos=function(){return this._anchorPos},e.prototype.getRule=function(e){return e.getRule(this.ruleId)},e.prototype._writeString=function(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]="("+this.ruleId+", TODO-"+this.nameScopesList+", TODO-"+this.contentNameScopesList+")",t},e.prototype.toString=function(){var e=[];return this._writeString(e,0),"["+e.join(",")+"]"},e.prototype.setContentNameScopesList=function(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)},e.prototype.setEndRule=function(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)},e.prototype.hasSameRuleAs=function(e){for(var t=this;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1},e.NULL=new e(null,0,0,0,!1,null,null,null),e}();t.StackElement=M;var N=function(e,t){this.scopes=e,this.endPos=t};t.LocalStackElement=N;var L=function(){function e(e,t){var n=this;this.allowAny=!1,this.balancedBracketScopes=e.flatMap((function(e){return"*"===e?(n.allowAny=!0,[]):i.createMatchers(e,_).map((function(e){return e.matcher}))})),this.unbalancedBracketScopes=t.flatMap((function(e){return i.createMatchers(e,_).map((function(e){return e.matcher}))}))}return Object.defineProperty(e.prototype,"matchesAlways",{get:function(){return this.allowAny&&0===this.unbalancedBracketScopes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"matchesNever",{get:function(){return 0===this.balancedBracketScopes.length&&!this.allowAny},enumerable:!1,configurable:!0}),e.prototype.match=function(e){for(var t=0,n=this.unbalancedBracketScopes;t=t)){if(this._emitBinaryTokens){var r=e.metadata,o=!1;if((null===(n=this.balancedBracketSelectors)||void 0===n?void 0:n.matchesAlways)&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){for(var i=e.generateScopes(),a=0,c=this._tokenTypeOverrides;a0&&this._binaryTokens[this._binaryTokens.length-1]===r)return void(this._lastTokenEndIndex=t);if(s.DebugFlags.InDebugMode){var l=e.generateScopes();console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(var h=0;h0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens},e.prototype.getBinaryResult=function(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);for(var n=new Uint32Array(this._binaryTokens.length),r=0,o=this._binaryTokens.length;r{Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=void 0;var r=n(69),o=n(350),i=n(974);t.parseRawGrammar=function(e,t){return void 0===t&&(t=null),null!==t&&/\.json$/.test(t)?(n=e,s=t,o.DebugFlags.InDebugMode?i.parse(n,s,!0):JSON.parse(n)):function(e,t){return o.DebugFlags.InDebugMode?r.parseWithLocation(e,t,"$vscodeTextmateLocation"):r.parse(e)}(e,t);var n,s}},974:(e,t)=>{function n(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0,t.parse=function(e,t,s){var a=new r(e),c=new o,u=0,l=null,h=[],p=[];function d(){h.push(u),p.push(l)}function f(){u=h.pop(),l=p.pop()}function g(e){n(a,e)}for(;i(a,c);){if(0===u){if(null!==l&&g("too many constructs in root"),3===c.type){l={},s&&(l.$vscodeTextmateLocation=c.toLocation(t)),d(),u=1;continue}if(2===c.type){l=[],d(),u=4;continue}g("unexpected token in root")}if(2===u){if(5===c.type){f();continue}if(7===c.type){u=3;continue}g("expected , or }")}if(1===u||3===u){if(1===u&&5===c.type){f();continue}if(1===c.type){var m=c.value;if(i(a,c)&&6===c.type||g("expected colon"),i(a,c)||g("expected value"),u=2,1===c.type){l[m]=c.value;continue}if(8===c.type){l[m]=null;continue}if(9===c.type){l[m]=!0;continue}if(10===c.type){l[m]=!1;continue}if(11===c.type){l[m]=parseFloat(c.value);continue}if(2===c.type){var _=[];l[m]=_,d(),u=4,l=_;continue}if(3===c.type){var y={};s&&(y.$vscodeTextmateLocation=c.toLocation(t)),l[m]=y,d(),u=1,l=y;continue}}g("unexpected token in dict")}if(5===u){if(4===c.type){f();continue}if(7===c.type){u=6;continue}g("expected , or ]")}if(4===u||6===u){if(4===u&&4===c.type){f();continue}if(u=5,1===c.type){l.push(c.value);continue}if(8===c.type){l.push(null);continue}if(9===c.type){l.push(!0);continue}if(10===c.type){l.push(!1);continue}if(11===c.type){l.push(parseFloat(c.value));continue}if(2===c.type){_=[],l.push(_),d(),u=4,l=_;continue}if(3===c.type){y={},s&&(y.$vscodeTextmateLocation=c.toLocation(t)),l.push(y),d(),u=1,l=y;continue}g("unexpected token in array")}g("unknown state")}return 0!==p.length&&g("unclosed constructs"),l};var r=function(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0},o=function(){function e(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}return e.prototype.toLocation=function(e){return{filename:e,line:this.line,char:this.char}},e}();function i(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;for(var r,o=e.source,i=e.pos,s=e.len,a=e.line,c=e.char;;){if(i>=s)return!1;if(32!==(r=o.charCodeAt(i))&&9!==r&&13!==r){if(10!==r)break;i++,a++,c=0}else i++,c++}if(t.offset=i,t.line=a,t.char=c,34===r){for(t.type=1,i++,c++;;){if(i>=s)return!1;if(r=o.charCodeAt(i),i++,c++,92!==r){if(34===r)break}else i++,c++}t.value=o.substring(t.offset+1,i-1).replace(/\\u([0-9A-Fa-f]{4})/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/\\(.)/g,(function(t,r){switch(r){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:n(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===r)t.type=2,i++,c++;else if(123===r)t.type=3,i++,c++;else if(93===r)t.type=4,i++,c++;else if(125===r)t.type=5,i++,c++;else if(58===r)t.type=6,i++,c++;else if(44===r)t.type=7,i++,c++;else if(110===r){if(t.type=8,i++,c++,117!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;i++,c++}else if(116===r){if(t.type=9,i++,c++,114!==(r=o.charCodeAt(i)))return!1;if(i++,c++,117!==(r=o.charCodeAt(i)))return!1;if(i++,c++,101!==(r=o.charCodeAt(i)))return!1;i++,c++}else if(102===r){if(t.type=10,i++,c++,97!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;if(i++,c++,115!==(r=o.charCodeAt(i)))return!1;if(i++,c++,101!==(r=o.charCodeAt(i)))return!1;i++,c++}else for(t.type=11;;){if(i>=s)return!1;if(!(46===(r=o.charCodeAt(i))||r>=48&&r<=57||101===r||69===r||45===r||43===r))break;i++,c++}return t.len=i-t.offset,null===t.value&&(t.value=o.substr(t.offset,t.len)),e.pos=i,e.line=a,e.char=c,!0}},787:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[4,Promise.all(i.Q.map((function(e){return a._loadSingleGrammar(e.scopeName)})))]:[3,3];case 2:return s.sent(),i.processQueue(),[3,1];case 3:return[2,this._grammarForScopeName(e,t,n,r,o)]}}))}))},e.prototype.addGrammar=function(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r=null),i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return this._syncRegistry.addGrammar(e,t),[4,this._grammarForScopeName(e.scopeName,n,r)];case 1:return[2,o.sent()]}}))}))},e.prototype._grammarForScopeName=function(e,t,n,r,o){return void 0===t&&(t=0),void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),this._syncRegistry.grammarForScopeName(e,t,n,r,o)},e}();t.Registry=h,t.INITIAL=l.StackElement.NULL,t.parseRawGrammar=c.parseRawGrammar},736:(e,t)=>{function n(e){return!!e&&!!e.match(/[\w\.:]+/)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMatchers=void 0,t.createMatchers=function(e,t){for(var r,o,i,s=[],a=(i=(o=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(r=e),{next:function(){if(!i)return null;var e=i[0];return i=o.exec(r),e}}),c=a.next();null!==c;){var u=0;if(2===c.length&&":"===c.charAt(1)){switch(c.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log("Unknown priority "+c+" in scope selector")}c=a.next()}var l=p();if(s.push({matcher:l,priority:u}),","!==c)break;c=a.next()}return s;function h(){if("-"===c){c=a.next();var e=h();return function(t){return!!e&&!e(t)}}if("("===c){c=a.next();var r=function(){for(var e=[],t=p();t&&(e.push(t),"|"===c||","===c);){do{c=a.next()}while("|"===c||","===c);t=p()}return function(t){return e.some((function(e){return e(t)}))}}();return")"===c&&(c=a.next()),r}if(n(c)){var o=[];do{o.push(c),c=a.next()}while(n(c));return function(e){return t(o,e)}}return null}function p(){for(var e=[],t=h();t;)e.push(t),t=h();return function(t){return e.every((function(e){return e(t)}))}}}},69:(e,t)=>{function n(e,t,n){var r=e.length,o=0,i=1,s=0;function a(t){if(null===n)o+=t;else for(;t>0;)10===e.charCodeAt(o)?(o++,i++,s=0):(o++,s++),t--}function c(e){null===n?o=e:a(e-o)}function u(){for(;o0&&65279===e.charCodeAt(0)&&(o=1);var d=0,f=null,g=[],m=[],_=null;function y(e,t){g.push(d),m.push(f),d=e,f=t}function v(){if(0===g.length)return b("illegal state stack");d=g.pop(),f=m.pop()}function b(t){throw new Error("Near offset "+o+": "+t+" ~~~"+e.substr(o,50)+"~~~")}var C,S,k,R,w,P=function(){if(null===_)return b("missing ");var e={};null!==n&&(e[n]={filename:t,line:i,char:s}),f[_]=e,_=null,y(1,e)},A=function(){if(null===_)return b("missing ");var e=[];f[_]=e,_=null,y(2,e)};function I(){if(1!==d)return b("unexpected ");v()}function x(){return 1===d||2!==d?b("unexpected "):void v()}function T(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function G(e){if(isNaN(e))return b("cannot parse float");if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function E(e){if(isNaN(e))return b("cannot parse integer");if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function M(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function N(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function L(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function O(e){if(e.isClosed)return"";var t=p(""),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return e}))}for(;o=r));){var D=e.charCodeAt(o);if(a(1),60!==D)return b("expected <");if(o>=r)return b("unexpected end of input");var F=e.charCodeAt(o);if(63!==F)if(33!==F){if(47===F){if(a(1),u(),l("plist")){h(">");continue}if(l("dict")){h(">"),I();continue}if(l("array")){h(">"),x();continue}return b("unexpected closed tag")}var j=(S=void 0,k=void 0,k=!1,47===(S=p(">")).charCodeAt(S.length-1)&&(k=!0,S=S.substring(0,S.length-1)),{name:S.trim(),isClosed:k});switch(j.name){case"dict":1===d?P():2===d?(w=void 0,w={},null!==n&&(w[n]={filename:t,line:i,char:s}),f.push(w),y(1,w)):(f={},null!==n&&(f[n]={filename:t,line:i,char:s}),y(1,f)),j.isClosed&&I();continue;case"array":1===d?A():2===d?(R=void 0,R=[],f.push(R),y(2,R)):y(2,f=[]),j.isClosed&&x();continue;case"key":C=O(j),1!==d?b("unexpected "):null!==_?b("too many "):_=C;continue;case"string":T(O(j));continue;case"real":G(parseFloat(O(j)));continue;case"integer":E(parseInt(O(j),10));continue;case"date":M(new Date(O(j)));continue;case"data":N(O(j));continue;case"true":O(j),L(!0);continue;case"false":O(j),L(!1);continue}if(!/^plist/.test(j.name))return b("unexpected opened tag "+j.name)}else{if(a(1),l("--")){h("--\x3e");continue}h(">")}else a(1),h("?>")}return f}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.parseWithLocation=void 0,t.parseWithLocation=function(e,t,r){return n(e,t,r)},t.parse=function(e){return n(e,null,null)}},652:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]i&&(i=c);for(var a=0;a<=i;a++)o[a]=null;for(var s in t)if("$vscodeTextmateLocation"!==s){var c=parseInt(s,10),u=0;t[s].patterns&&(u=e.getCompiledRuleId(t[s],n,r)),o[c]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,u)}}return o},e._compilePatterns=function(t,n,r){var o=[];if(t)for(var i=0,s=t.length;i=0?(l=a.include.substring(0,p),h=a.include.substring(p+1)):l=a.include;var d=n.getExternalGrammar(l,r);if(d)if(h){var _=d.repository[h];_&&(c=e.getCompiledRuleId(_,n,d.repository))}else c=e.getCompiledRuleId(d.repository.$self,n,d.repository)}else c=e.getCompiledRuleId(a,n,r);if(-1!==c){var y=n.getRule(c),v=!1;if((y instanceof f||y instanceof g||y instanceof m)&&y.hasMissingPatterns&&0===y.patterns.length&&(v=!0),v)continue;o.push(c)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}},e}();t.RuleFactory=_},583:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeTrieElement=t.ThemeTrieElementRule=t.strArrCmp=t.strcmp=t.Theme=t.ColorMap=t.parseTheme=t.ParsedThemeRule=void 0;var n=function(e,t,n,r,o,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=i};function r(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function o(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];for(var t=e.settings,o=[],i=0,s=0,a=t.length;s1&&(_=g.slice(0,g.length-1)).reverse(),o[i++]=new n(m,_,s,l,d,f)}}}return o}function i(e,t){e.sort((function(e,t){var n=c(e.scope,t.scope);return 0!==n||0!==(n=u(e.parentScopes,t.parentScopes))?n:e.index-t.index}));for(var n=0,r="#000000",o="#ffffff";e.length>=1&&""===e[0].scope;){var i=e.shift();-1!==i.fontStyle&&(n=i.fontStyle),null!==i.foreground&&(r=i.foreground),null!==i.background&&(o=i.background)}for(var p=new s(t),d=new l(0,null,n,p.getId(r),p.getId(o)),f=new h(new l(0,null,-1,0,0),[]),g=0,m=e.length;gt?1:0}function u(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;var n=e.length,r=t.length;if(n===r){for(var o=0;oe?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)},e}();t.ThemeTrieElementRule=l;var h=function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={}),this._mainRule=e,this._rulesWithParentScopes=t,this._children=n}return e._sortBySpecificity=function(e){return 1===e.length||e.sort(this._cmpBySpecificity),e},e._cmpBySpecificity=function(e,t){if(e.scopeDepth===t.scopeDepth){var n=e.parentScopes,r=t.parentScopes,o=null===n?0:n.length,i=null===r?0:r.length;if(o===i)for(var s=0;s{Object.defineProperty(t,"__esModule",{value:!0})},878:(e,t)=>{function n(e){return Array.isArray(e)?function(e){for(var t=[],r=0,o=e.length;r