!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 function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(5),o=n(6),s=n(2),a="undefined"==typeof performance?function(){return Date.now()}:function(){return performance.now()};t.createGrammar=function(e,t,n,r,i,o){return new v(e,t,n,r,i,o)};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,i,o){for(var s=0,a=i;s=0){var _=g.substring(0,m),y=g.substring(m+1);_===t.scopeName?p(e,t,t,y,d):_===n.scopeName?p(e,t,n,y,d):e.add(new u(_,g.substring(m+1)))}else e.add(new c(g))}}}}function p(e,t,n,r,i){(void 0===i&&(i=n.repository),i&&i[r])&&h(e,t,n,[i[r]],i)}function f(e,t,n){if(n.patterns&&Array.isArray(n.patterns)&&h(e,t,n,n.patterns,n.repository),n.injections){var r=[];for(var i in n.injections)r.push(n.injections[i]);h(e,t,n,r,n.repository)}}function d(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 g(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 _("",this._initialLanguage,0,[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 _(e,t,n,r)},e.prototype._scopeToLanguage=function(e){if(!e)return 0;if(!this._embeddedLanguagesRegex)return 0;var t=e.match(this._embeddedLanguagesRegex);if(!t)return 0;var n=this._embeddedLanguages[t[1]]||0;return n||0},e.prototype._toStandardTokenType=function(t){var n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 0;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"meta.embedded":return 8}throw new Error("Unexpected match for standard token type!")},e._NULL_SCOPE_METADATA=new _("",0,0,null),e.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/,e}(),v=function(){function e(e,t,n,r,i,s){if(this._scopeMetadataProvider=new y(t,i,n),this._onigLib=s,this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=C(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(var a=0,c=Object.keys(r);al)break;for(;u.length>0&&u[u.length-1].endPos<=f.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,f.start):i.produce(r,f.start),p.retokenizeCapturedWithRuleId){var d=p.getName(a,s),g=r.contentNameScopesList.push(e,d),m=p.getContentName(a,s),_=g.push(e,m),y=r.push(p.retokenizeCapturedWithRuleId,f.start,-1,!1,null,g,_),v=e.createOnigString(a.substring(0,f.end));S(e,v,n&&0===f.start,f.start,y,i,!1),b(v)}else{var C=p.getName(a,s);if(null!==C){var w=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).push(e,C);u.push(new A(w,f.end))}}}}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}}function k(e){for(var t=[],n=0,r=e.rules.length;n5&&console.warn("Rule "+c.debugName+" ("+c.id+") matching took "+p+" against '"+t+"'"),h&&console.log("matched rule id: "+u.rules[h.index]+" from "+h.captureIndices[0].start+" to "+h.captureIndices[0].end)}return h?{captureIndices:h.captureIndices,matchedRuleId:u.rules[h.index]}:null}(e,t,n,r,i,o),u=e.getInjections();if(0===u.length)return c;var l=function(e,t,n,r,i,o,a){for(var c,u=Number.MAX_VALUE,l=null,h=0,p=o.contentNameScopesList.generateScopes(),f=0,d=e.length;f=u)&&(u=y,l=_.captureIndices,c=m.rules[_.index],h=g.priority,u===i))break}}}return l?{priorityMatch:-1===h,captureIndices:l,matchedRuleId:c}:null}(u,e,t,n,r,i,o);if(!l)return c;if(!c)return l;var h=c.captureIndices[0].start,p=l.captureIndices[0].start;return pr&&(r=d.captureIndices[0].end,n=!1))}return{stack:o,linePos:r,anchorPosition:c,isFirstLine:n}}(e,t,n,r,o,a);o=p.stack,r=p.linePos,n=p.isFirstLine,h=p.anchorPosition}for(;!l;)f();function f(){s.DebugFlags.InDebugMode&&(console.log(""),console.log("@@scanNext "+r+": |"+t.content.substr(r).replace(/\n$/,"\\n")+"|"));var c=R(e,t,n,r,o,h);if(!c)return s.DebugFlags.InDebugMode&&console.log(" no more matches."),a.produce(o,u),void(l=!0);var p=c.captureIndices,f=c.matchedRuleId,d=!!(p&&p.length>0)&&p[0].end>r;if(-1===f){var g=o.getRule(e);s.DebugFlags.InDebugMode&&console.log(" popping "+g.debugName+" - "+g.debugEndRegExp),a.produce(o,p[0].start),o=o.setContentNameScopesList(o.nameScopesList),w(e,t,n,o,a,g.endCaptures,p),a.produce(o,p[0].end);var m=o;if(o=o.pop(),h=m.getAnchorPos(),!d&&m.getEnterPos()===r)return s.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),o=m,a.produce(o,u),void(l=!0)}else{var _=e.getRule(f);a.produce(o,p[0].start);var y=o,v=_.getName(t.content,p),b=o.contentNameScopesList.push(e,v);if(o=o.push(f,r,h,p[0].end===u,null,b,b),_ instanceof i.BeginEndRule){var C=_;s.DebugFlags.InDebugMode&&console.log(" pushing "+C.debugName+" - "+C.debugBeginRegExp),w(e,t,n,o,a,C.beginCaptures,p),a.produce(o,p[0].end),h=p[0].end;var k=C.getContentName(t.content,p),S=b.push(e,k);if(o=o.setContentNameScopesList(S),C.endHasBackReferences&&(o=o.setEndRule(C.getEndWithResolvedBackReferences(t.content,p))),!d&&y.hasSameRuleAs(o))return s.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),a.produce(o,u),void(l=!0)}else if(_ instanceof i.BeginWhileRule){C=_;s.DebugFlags.InDebugMode&&console.log(" pushing "+C.debugName),w(e,t,n,o,a,C.beginCaptures,p),a.produce(o,p[0].end),h=p[0].end;k=C.getContentName(t.content,p),S=b.push(e,k);if(o=o.setContentNameScopesList(S),C.whileHasBackReferences&&(o=o.setEndRule(C.getWhileWithResolvedBackReferences(t.content,p))),!d&&y.hasSameRuleAs(o))return s.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),a.produce(o,u),void(l=!0)}else{var P=_;if(s.DebugFlags.InDebugMode&&console.log(" matched "+P.debugName+" - "+P.debugMatchRegExp),w(e,t,n,o,a,P.captures,p),a.produce(o,p[0].end),o=o.pop(),!d)return s.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),o=o.safePop(),a.produce(o,u),void(l=!0)}}p[0].end>r&&(r=p[0].end,n=!1)}return o}t.Grammar=v;var P=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),i=e.getFontStyle(t),o=e.getForeground(t),s=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:s})},e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(1792&e)>>>8},e.getFontStyle=function(e){return(14336&e)>>>11},e.getForeground=function(e){return(8372224&e)>>>14},e.getBackground=function(e){return(4286578688&e)>>>23},e.set=function(t,n,r,i,o,s){var a=e.getLanguageId(t),c=e.getTokenType(t),u=e.getFontStyle(t),l=e.getForeground(t),h=e.getBackground(t);return 0!==n&&(a=n),0!==r&&(c=8===r?0:r),-1!==i&&(u=i),0!==o&&(l=o),0!==s&&(h=s),(a<<0|c<<8|u<<11|l<<14|h<<23)>>>0},e}();t.StackElementMetadata=P;var x=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,i=t[r],o=i+".";e;){if(this._matchesScope(e.scope,i,o)){if(++r===n)return!0;o=(i=t[r])+"."}e=e.parent}return!1},e.mergeMetadata=function(e,t,n){if(null===n)return e;var r=-1,i=0,o=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=x;var I=function(){function e(e,t,n,r,i,o,s,a){this.parent=e,this.depth=this.parent?this.parent.depth+1:1,this.ruleId=t,this._enterPos=n,this._anchorPos=r,this.beginRuleCapturedEOL=i,this.endRule=o,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,i,o,s,a){return new e(this,t,n,r,i,o,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){return this.ruleId===e.ruleId},e.NULL=new e(null,0,0,0,!1,null,null,null),e}();t.StackElement=I;var A=function(e,t){this.scopes=e,this.endPos=t};t.LocalStackElement=A;var T=function(){function e(e,t,n){this._emitBinaryTokens=e,this._tokenTypeOverrides=n,s.DebugFlags.InDebugMode?this._lineText=t:this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}return e.prototype.produce=function(e,t){this.produceFromScopes(e.contentNameScopesList,t)},e.prototype.produceFromScopes=function(e,t){if(!(this._lastTokenEndIndex>=t)){if(this._emitBinaryTokens){for(var n=e.metadata,r=0,i=this._tokenTypeOverrides;r0&&this._binaryTokens[this._binaryTokens.length-1]===n||(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n)),void(this._lastTokenEndIndex=t)}var a=e.generateScopes();if(s.DebugFlags.InDebugMode){console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(var c=0;c0&&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,i=this._binaryTokens.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]")},e.prototype._loadGrammar=function(e,t,n,o){return r(this,void 0,void 0,(function(){var r,s,a,u,l,h,p,f,d,g,m,_,y=this;return i(this,(function(i){switch(i.label){case 0:r=new Set,s=new Set,r.add(e),a=[new c.FullScopeDependency(e)],i.label=1;case 1:return a.length>0?(u=a,a=[],[4,Promise.all(u.map((function(e){return y._loadSingleGrammar(e.scopeName)})))]):[3,3];case 2:for(i.sent(),l=new c.ScopeDependencyCollector,h=0,p=u;h0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]o&&(o=c)}for(var a=0;a<=o;a++)i[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)),i[c]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,u)}}return i},e._compilePatterns=function(t,n,r){var i=[];if(t)for(var o=0,s=t.length;o=0?(l=a.include.substring(0,p),h=a.include.substring(p+1)):l=a.include;var f=n.getExternalGrammar(l,r);if(f)if(h){var _=f.repository[h];_&&(c=e.getCompiledRuleId(_,n,f.repository))}else c=e.getCompiledRuleId(f.repository.$self,n,f.repository)}else c=e.getCompiledRuleId(a,n,r);if(-1!==c){var y=n.getRule(c),v=!1;if((y instanceof d||y instanceof g||y instanceof m)&&y.hasMissingPatterns&&0===y.patterns.length&&(v=!0),v)continue;i.push(c)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}},e}();t.RuleFactory=_},function(e,t,n){"use strict";function r(e){return!!e&&!!e.match(/[\w\.:]+/)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMatchers=function(e,t){for(var n,i,o,s=[],a=(o=(i=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(n=e),{next:function(){if(!o)return null;var e=o[0];return o=i.exec(n),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 n=function(){var e=[],t=p();for(;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()),n}if(r(c)){var i=[];do{i.push(c),c=a.next()}while(r(c));return function(e){return t(i,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)}))}}}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],l=!1,h=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&f())}function f(){if(!l){var e=a(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++h1)for(var n=1;n0;){10===e.charCodeAt(i)?(i++,o++,s=0):(i++,s++),t--}}function c(e){null===n?i=e:a(e-i)}function u(){for(;i0&&65279===e.charCodeAt(0)&&(i=1);var f=0,d=null,g=[],m=[],_=null;function y(e,t){g.push(f),m.push(d),f=e,d=t}function v(){if(0===g.length)return b("illegal state stack");f=g.pop(),d=m.pop()}function b(t){throw new Error("Near offset "+i+": "+t+" ~~~"+e.substr(i,50)+"~~~")}var C,w,k,R=function(){if(null===_)return b("missing ");var e={};null!==n&&(e[n]={filename:t,line:o,char:s}),d[_]=e,_=null,y(1,e)},S=function(){if(null===_)return b("missing ");var e=[];d[_]=e,_=null,y(2,e)},P=function(){var e={};null!==n&&(e[n]={filename:t,line:o,char:s}),d.push(e),y(1,e)},x=function(){var e=[];d.push(e),y(2,e)};function I(){if(1!==f)return b("unexpected ");v()}function A(){return 1===f||2!==f?b("unexpected "):void v()}function T(e){if(1===f){if(null===_)return b("missing ");d[_]=e,_=null}else 2===f?d.push(e):d=e}function L(e){if(isNaN(e))return b("cannot parse float");if(1===f){if(null===_)return b("missing ");d[_]=e,_=null}else 2===f?d.push(e):d=e}function M(e){if(isNaN(e))return b("cannot parse integer");if(1===f){if(null===_)return b("missing ");d[_]=e,_=null}else 2===f?d.push(e):d=e}function G(e){if(1===f){if(null===_)return b("missing ");d[_]=e,_=null}else 2===f?d.push(e):d=e}function D(e){if(1===f){if(null===_)return b("missing ");d[_]=e,_=null}else 2===f?d.push(e):d=e}function N(e){if(1===f){if(null===_)return b("missing ");d[_]=e,_=null}else 2===f?d.push(e):d=e}function E(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(;i=r));){var O=e.charCodeAt(i);if(a(1),60!==O)return b("expected <");if(i>=r)return b("unexpected end of input");var j=e.charCodeAt(i);if(63!==j)if(33!==j){if(47===j){if(a(1),u(),l("plist")){h(">");continue}if(l("dict")){h(">"),I();continue}if(l("array")){h(">"),A();continue}return b("unexpected closed tag")}var F=(w=void 0,k=void 0,w=p(">"),k=!1,47===w.charCodeAt(w.length-1)&&(k=!0,w=w.substring(0,w.length-1)),{name:w.trim(),isClosed:k});switch(F.name){case"dict":1===f?R():2===f?P():(d={},null!==n&&(d[n]={filename:t,line:o,char:s}),y(1,d)),F.isClosed&&I();continue;case"array":1===f?S():2===f?x():y(2,d=[]),F.isClosed&&A();continue;case"key":C=E(F),1!==f?b("unexpected "):null!==_?b("too many "):_=C;continue;case"string":T(E(F));continue;case"real":L(parseFloat(E(F)));continue;case"integer":M(parseInt(E(F),10));continue;case"date":G(new Date(E(F)));continue;case"data":D(E(F));continue;case"true":E(F),N(!0);continue;case"false":E(F),N(!1);continue}if(!/^plist/.test(F.name))return b("unexpected opened tag "+F.name)}else{if(a(1),l("--")){h("--\x3e");continue}h(">")}else a(1),h("?>")}return d}Object.defineProperty(t,"__esModule",{value:!0}),t.parseWithLocation=function(e,t,n){return r(e,t,n)},t.parse=function(e){return r(e,null,null)}},function(e,t,n){"use strict";function r(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e,t,n){var a=new i(e),c=new o,u=0,l=null,h=[],p=[];function f(){h.push(u),p.push(l)}function d(){u=h.pop(),l=p.pop()}function g(e){r(a,e)}for(;s(a,c);){if(0===u){if(null!==l&&g("too many constructs in root"),3===c.type){l={},n&&(l.$vscodeTextmateLocation=c.toLocation(t)),f(),u=1;continue}if(2===c.type){l=[],f(),u=4;continue}g("unexpected token in root")}if(2===u){if(5===c.type){d();continue}if(7===c.type){u=3;continue}g("expected , or }")}if(1===u||3===u){if(1===u&&5===c.type){d();continue}if(1===c.type){var m=c.value;if(s(a,c)&&6===c.type||g("expected colon"),s(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]=_,f(),u=4,l=_;continue}if(3===c.type){var y={};n&&(y.$vscodeTextmateLocation=c.toLocation(t)),l[m]=y,f(),u=1,l=y;continue}}g("unexpected token in dict")}if(5===u){if(4===c.type){d();continue}if(7===c.type){u=6;continue}g("expected , or ]")}if(4===u||6===u){if(4===u&&4===c.type){d();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(_),f(),u=4,l=_;continue}if(3===c.type){y={};n&&(y.$vscodeTextmateLocation=c.toLocation(t)),l.push(y),f(),u=1,l=y;continue}g("unexpected token in array")}g("unknown state")}return 0!==p.length&&g("unclosed constructs"),l};var i=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 s(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;for(var n,i=e.source,o=e.pos,s=e.len,a=e.line,c=e.char;;){if(o>=s)return!1;if(32!==(n=i.charCodeAt(o))&&9!==n&&13!==n){if(10!==n)break;o++,a++,c=0}else o++,c++}if(t.offset=o,t.line=a,t.char=c,34===n){for(t.type=1,o++,c++;;){if(o>=s)return!1;if(n=i.charCodeAt(o),o++,c++,92!==n){if(34===n)break}else o++,c++}t.value=i.substring(t.offset+1,o-1).replace(/\\u([0-9A-Fa-f]{4})/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/\\(.)/g,(function(t,n){switch(n){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:r(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===n)t.type=2,o++,c++;else if(123===n)t.type=3,o++,c++;else if(93===n)t.type=4,o++,c++;else if(125===n)t.type=5,o++,c++;else if(58===n)t.type=6,o++,c++;else if(44===n)t.type=7,o++,c++;else if(110===n){if(t.type=8,o++,c++,117!==(n=i.charCodeAt(o)))return!1;if(o++,c++,108!==(n=i.charCodeAt(o)))return!1;if(o++,c++,108!==(n=i.charCodeAt(o)))return!1;o++,c++}else if(116===n){if(t.type=9,o++,c++,114!==(n=i.charCodeAt(o)))return!1;if(o++,c++,117!==(n=i.charCodeAt(o)))return!1;if(o++,c++,101!==(n=i.charCodeAt(o)))return!1;o++,c++}else if(102===n){if(t.type=10,o++,c++,97!==(n=i.charCodeAt(o)))return!1;if(o++,c++,108!==(n=i.charCodeAt(o)))return!1;if(o++,c++,115!==(n=i.charCodeAt(o)))return!1;if(o++,c++,101!==(n=i.charCodeAt(o)))return!1;o++,c++}else for(t.type=11;;){if(o>=s)return!1;if(!(46===(n=i.charCodeAt(o))||n>=48&&n<=57||101===n||69===n||45===n||43===n))break;o++,c++}return t.len=o-t.offset,null===t.value&&(t.value=i.substr(t.offset,t.len)),e.pos=o,e.line=a,e.char=c,!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o};function i(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,n=[],o=0,s=0,a=t.length;s1&&(_=g.slice(0,g.length-1)).reverse(),n[o++]=new r(m,_,s,l,f,d)}}}return n}function s(e,t){e.sort((function(e,t){var n=u(e.scope,t.scope);return 0!==n||0!==(n=l(e.parentScopes,t.parentScopes))?n:e.index-t.index}));for(var n=0,r="#000000",i="#ffffff";e.length>=1&&""===e[0].scope;){var o=e.shift();-1!==o.fontStyle&&(n=o.fontStyle),null!==o.foreground&&(r=o.foreground),null!==o.background&&(i=o.background)}for(var s=new a(t),f=new h(0,null,n,s.getId(r),s.getId(i)),d=new p(new h(0,null,-1,0,0),[]),g=0,m=e.length;gt?1:0}function l(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 i=0;ie?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=h;var p=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,i=null===n?0:n.length,o=null===r?0:r.length;if(i===o)for(var s=0;s