UNPKG

pkg-cdn

Version:

某些库没有提供 cdn 或者只提供单个格式, 此库通过用 vite 构建提供

53 lines 362 kB
(function(yn,G){typeof exports=="object"&&typeof module<"u"?module.exports=G(require("prettier")):typeof define=="function"&&define.amd?define(["prettier"],G):(yn=typeof globalThis<"u"?globalThis:yn||self,yn.PrettierPluginJava=G(yn.prettier))})(this,function(yn){"use strict";var G=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var a=Function.bind.apply(t,i);return new a}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ui="6.5.0";function le(e){return e&&e.length===0}function Kt(e){return e==null?[]:Object.keys(e)}function qe(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++)t.push(e[n[r]]);return t}function uc(e,t){for(var n=[],r=Kt(e),i=0;i<r.length;i++){var a=r[i];n.push(t.call(null,e[a],a))}return n}function P(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t.call(null,e[r],r));return n}function rt(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Array.isArray(r)?t=t.concat(rt(r)):t.push(r)}return t}function dt(e){return le(e)?void 0:e[0]}function Ba(e){var t=e&&e.length;return t?e[t-1]:void 0}function V(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)t.call(null,e[n],n);else if(Ni(e))for(var r=Kt(e),n=0;n<r.length;n++){var i=r[n],a=e[i];t.call(null,a,i)}else throw Error("non exhaustive match")}function Ft(e){return typeof e=="string"}function ht(e){return e===void 0}function $t(e){return e instanceof Function}function Ge(e,t){return t===void 0&&(t=1),e.slice(t,e.length)}function qn(e,t){return t===void 0&&(t=1),e.slice(0,e.length-t)}function Tt(e,t){var n=[];if(Array.isArray(e))for(var r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}function un(e,t){return Tt(e,function(n){return!t(n)})}function mt(e,t){for(var n=Object.keys(e),r={},i=0;i<n.length;i++){var a=n[i],o=e[a];t(o)&&(r[a]=o)}return r}function K(e,t){return Ni(e)?e.hasOwnProperty(t):!1}function Fe(e,t){return Cn(e,function(n){return n===t})!==void 0}function it(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}function Hn(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Cn(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t.call(null,r))return r}}function cc(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}function Ke(e,t,n){for(var r=Array.isArray(e),i=r?e:qe(e),a=r?[]:Kt(e),o=n,s=0;s<i.length;s++)o=t.call(null,o,i[s],r?s:a[s]);return o}function Yn(e){return un(e,function(t){return t==null})}function Oi(e,t){t===void 0&&(t=function(r){return r});var n=[];return Ke(e,function(r,i){var a=t(i);return Fe(n,a)?r:(n.push(a),r.concat(i))},[])}function gt(e){return Array.isArray(e)}function Wt(e){return e instanceof RegExp}function Ni(e){return e instanceof Object}function vt(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function mr(e,t){return un(e,function(n){return Fe(t,n)})}function Fa(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}function lc(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function Lt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)for(var i=t[r],a=Kt(i),o=0;o<a.length;o++){var s=a[o];e[s]=i[s]}return e}function fc(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var i=t[r];if(!ht(i))for(var a=Kt(i),o=0;o<a.length;o++){var s=a[o];K(e,s)||(e[s]=i[s])}}return e}function vr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fc.apply(null,[{}].concat(e))}function Ma(e,t){var n={};return V(e,function(r){var i=t(r),a=n[i];a?a.push(r):n[i]=[r]}),n}function ba(e,t){for(var n=Hn(e),r=Kt(t),i=0;i<r.length;i++){var a=r[i],o=t[a];n[a]=o}return n}function we(){}function Pa(e){return e}function pc(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r!==void 0?r:void 0)}return t}function _i(e){console&&console.error&&console.error("Error: "+e)}function Ii(e){console&&console.warn&&console.warn("Warning: "+e)}function ka(){return typeof Map=="function"}function dc(e,t){t.forEach(function(n){var r=n.prototype;Object.getOwnPropertyNames(r).forEach(function(i){if(i!=="constructor"){var a=Object.getOwnPropertyDescriptor(r,i);a&&(a.get||a.set)?Object.defineProperty(e.prototype,i,a):e.prototype[i]=n.prototype[i]}})})}function xa(e){function t(){}t.prototype=e;var n=new t;function r(){return typeof n.bar}return r(),r(),e}function Dr(e){return e[e.length-1]}function wa(e){var t=new Date().getTime(),n=e(),r=new Date().getTime(),i=r-t;return{time:i,value:n}}var cn={},hc={get exports(){return cn},set exports(e){cn=e}};(function(e){(function(t,n){e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:G,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(l){this.idx=l.idx,this.input=l.input,this.groupIdx=l.groupIdx},t.prototype.pattern=function(l){this.idx=0,this.input=l,this.groupIdx=0,this.consumeChar("/");var T=this.disjunction();this.consumeChar("/");for(var E={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(E,"global");break;case"i":s(E,"ignoreCase");break;case"m":s(E,"multiLine");break;case"u":s(E,"unicode");break;case"y":s(E,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:E,value:T}},t.prototype.disjunction=function(){var l=[];for(l.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),l.push(this.alternative());return{type:"Disjunction",value:l}},t.prototype.alternative=function(){for(var l=[];this.isTerm();)l.push(this.term());return{type:"Alternative",value:l}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){switch(this.popChar()){case"^":return{type:"StartAnchor"};case"$":return{type:"EndAnchor"};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary"};case"B":return{type:"NonWordBoundary"}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var l;switch(this.popChar()){case"=":l="Lookahead";break;case"!":l="NegativeLookahead";break}u(l);var T=this.disjunction();return this.consumeChar(")"),{type:l,value:T}}c()},t.prototype.quantifier=function(l){var T;switch(this.popChar()){case"*":T={atLeast:0,atMost:1/0};break;case"+":T={atLeast:1,atMost:1/0};break;case"?":T={atLeast:0,atMost:1};break;case"{":var E=this.integerIncludingZero();switch(this.popChar()){case"}":T={atLeast:E,atMost:E};break;case",":var R;this.isDigit()?(R=this.integerIncludingZero(),T={atLeast:E,atMost:R}):T={atLeast:E,atMost:1/0},this.consumeChar("}");break}if(l===!0&&T===void 0)return;u(T);break}if(!(l===!0&&T===void 0))return u(T),this.peekChar(0)==="?"?(this.consumeChar("?"),T.greedy=!1):T.greedy=!0,T.type="Quantifier",T},t.prototype.atom=function(){var l;switch(this.peekChar()){case".":l=this.dotAll();break;case"\\":l=this.atomEscape();break;case"[":l=this.characterClass();break;case"(":l=this.group();break}return l===void 0&&this.isPatternCharacter()&&(l=this.patternCharacter()),u(l),this.isQuantifier()&&(l.quantifier=this.quantifier()),l},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[a(` `),a("\r"),a("\u2028"),a("\u2029")]}},t.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.decimalEscapeAtom=function(){var l=this.positiveInteger();return{type:"GroupBackReference",value:l}},t.prototype.characterClassEscape=function(){var l,T=!1;switch(this.popChar()){case"d":l=f;break;case"D":l=f,T=!0;break;case"s":l=C;break;case"S":l=C,T=!0;break;case"w":l=m;break;case"W":l=m,T=!0;break}return u(l),{type:"Set",value:l,complement:T}},t.prototype.controlEscapeAtom=function(){var l;switch(this.popChar()){case"f":l=a("\f");break;case"n":l=a(` `);break;case"r":l=a("\r");break;case"t":l=a(" ");break;case"v":l=a("\v");break}return u(l),{type:"Character",value:l}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var l=this.popChar();if(/[a-zA-Z]/.test(l)===!1)throw Error("Invalid ");var T=l.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:T}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:a("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var l=this.popChar();return{type:"Character",value:a(l)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case` `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:a(l)}}},t.prototype.characterClass=function(){var l=[],T=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),T=!0);this.isClassAtom();){var E=this.classAtom(),R=E.type==="Character";if(R&&this.isRangeDash()){this.consumeChar("-");var U=this.classAtom(),j=U.type==="Character";if(j){if(U.value<E.value)throw Error("Range out of order in character class");l.push({from:E.value,to:U.value})}else o(E.value,l),l.push(a("-")),o(U.value,l)}else o(E.value,l)}return this.consumeChar("]"),{type:"Set",complement:T,value:l}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case` `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},t.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:a("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.group=function(){var l=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),l=!1;break;default:this.groupIdx++;break}var T=this.disjunction();this.consumeChar(")");var E={type:"Group",capturing:l,value:T};return l&&(E.idx=this.groupIdx),E},t.prototype.positiveInteger=function(){var l=this.popChar();if(i.test(l)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.integerIncludingZero=function(){var l=this.popChar();if(r.test(l)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.patternCharacter=function(){var l=this.popChar();switch(l){case` `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:a(l)}}},t.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},t.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},t.prototype.isDigit=function(){return r.test(this.peekChar(0))},t.prototype.isClassAtom=function(l){switch(l===void 0&&(l=0),this.peekChar(l)){case"]":case` `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},t.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},t.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}},t.prototype.isQuantifier=function(){var l=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(l)}},t.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case` `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var T="",E=0;E<l;E++){var R=this.popChar();if(n.test(R)===!1)throw Error("Expecting a HexDecimal digits");T+=R}var U=parseInt(T,16);return{type:"Character",value:U}},t.prototype.peekChar=function(l){return l===void 0&&(l=0),this.input[this.idx+l]},t.prototype.popChar=function(){var l=this.peekChar(0);return this.consumeChar(),l},t.prototype.consumeChar=function(l){if(l!==void 0&&this.input[this.idx]!==l)throw Error("Expected: '"+l+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++};var n=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function a(l){return l.charCodeAt(0)}function o(l,T){l.length!==void 0?l.forEach(function(E){T.push(E)}):T.push(l)}function s(l,T){if(l[T]===!0)throw"duplicate flag "+T;l[T]=!0}function u(l){if(l===void 0)throw Error("Internal Error - Should never get here!")}function c(){throw Error("Internal Error - Should never get here!")}var p,f=[];for(p=a("0");p<=a("9");p++)f.push(p);var m=[a("_")].concat(f);for(p=a("a");p<=a("z");p++)m.push(p);for(p=a("A");p<=a("Z");p++)m.push(p);var C=[a(" "),a("\f"),a(` `),a("\r"),a(" "),a("\v"),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a(" "),a("\u2028"),a("\u2029"),a(" "),a(" "),a(" "),a("\uFEFF")];function A(){}return A.prototype.visitChildren=function(l){for(var T in l){var E=l[T];l.hasOwnProperty(T)&&(E.type!==void 0?this.visit(E):Array.isArray(E)&&E.forEach(function(R){this.visit(R)},this))}},A.prototype.visit=function(l){switch(l.type){case"Pattern":this.visitPattern(l);break;case"Flags":this.visitFlags(l);break;case"Disjunction":this.visitDisjunction(l);break;case"Alternative":this.visitAlternative(l);break;case"StartAnchor":this.visitStartAnchor(l);break;case"EndAnchor":this.visitEndAnchor(l);break;case"WordBoundary":this.visitWordBoundary(l);break;case"NonWordBoundary":this.visitNonWordBoundary(l);break;case"Lookahead":this.visitLookahead(l);break;case"NegativeLookahead":this.visitNegativeLookahead(l);break;case"Character":this.visitCharacter(l);break;case"Set":this.visitSet(l);break;case"Group":this.visitGroup(l);break;case"GroupBackReference":this.visitGroupBackReference(l);break;case"Quantifier":this.visitQuantifier(l);break}this.visitChildren(l)},A.prototype.visitPattern=function(l){},A.prototype.visitFlags=function(l){},A.prototype.visitDisjunction=function(l){},A.prototype.visitAlternative=function(l){},A.prototype.visitStartAnchor=function(l){},A.prototype.visitEndAnchor=function(l){},A.prototype.visitWordBoundary=function(l){},A.prototype.visitNonWordBoundary=function(l){},A.prototype.visitLookahead=function(l){},A.prototype.visitNegativeLookahead=function(l){},A.prototype.visitCharacter=function(l){},A.prototype.visitSet=function(l){},A.prototype.visitGroup=function(l){},A.prototype.visitGroupBackReference=function(l){},A.prototype.visitQuantifier=function(l){},{RegExpParser:t,BaseRegExpVisitor:A,VERSION:"0.4.0"}})})(hc);var Er={},mc=new cn.RegExpParser;function yr(e){var t=e.toString();if(Er.hasOwnProperty(t))return Er[t];var n=mc.pattern(t);return Er[t]=n,n}function vc(){Er={}}var Dc=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)i.hasOwnProperty(a)&&(r[a]=i[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ja="Complement Sets are not supported for first char optimization",Cr=`Unable to use "first char" lexer optimizations: `;function Ec(e,t){t===void 0&&(t=!1);try{var n=yr(e),r=Bi(n.value,{},n.flags.ignoreCase);return r}catch(a){if(a.message===ja)t&&Ii(""+Cr+(" Unable to optimize: < "+e.toString()+` > `)+` Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var i="";t&&(i=` This will disable the lexer's first char optimizations. See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),_i(Cr+` `+(" Failed parsing: < "+e.toString()+` > `)+(" Using the regexp-to-ast library version: "+cn.VERSION+` `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}function Bi(e,t,n){switch(e.type){case"Disjunction":for(var r=0;r<e.value.length;r++)Bi(e.value[r],t,n);break;case"Alternative":for(var i=e.value,r=0;r<i.length;r++){var a=i[r];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var o=a;switch(o.type){case"Character":Ar(o.value,t,n);break;case"Set":if(o.complement===!0)throw Error(ja);V(o.value,function(c){if(typeof c=="number")Ar(c,t,n);else{var p=c;if(n===!0)for(var f=p.from;f<=p.to;f++)Ar(f,t,n);else{for(var f=p.from;f<=p.to&&f<zn;f++)Ar(f,t,n);if(p.to>=zn)for(var m=p.from>=zn?p.from:zn,C=p.to,A=en(m),l=en(C),T=A;T<=l;T++)t[T]=T}}});break;case"Group":Bi(o.value,t,n);break;default:throw Error("Non Exhaustive Match")}var s=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Fi(o)===!1||o.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return qe(t)}function Ar(e,t,n){var r=en(e);t[r]=r,n===!0&&yc(e,t)}function yc(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){var i=en(r.charCodeAt(0));t[i]=i}else{var a=n.toLowerCase();if(a!==n){var i=en(a.charCodeAt(0));t[i]=i}}}function Va(e,t){return Cn(e.value,function(n){if(typeof n=="number")return Fe(t,n);var r=n;return Cn(t,function(i){return r.from<=i&&i<=r.to})!==void 0})}function Fi(e){return e.quantifier&&e.quantifier.atLeast===0?!0:e.value?gt(e.value)?vt(e.value,Fi):Fi(e.value):!1}var Cc=function(e){Dc(t,e);function t(n){var r=e.call(this)||this;return r.targetCharCodes=n,r.found=!1,r}return t.prototype.visitChildren=function(n){if(this.found!==!0){switch(n.type){case"Lookahead":this.visitLookahead(n);return;case"NegativeLookahead":this.visitNegativeLookahead(n);return}e.prototype.visitChildren.call(this,n)}},t.prototype.visitCharacter=function(n){Fe(this.targetCharCodes,n.value)&&(this.found=!0)},t.prototype.visitSet=function(n){n.complement?Va(n,this.targetCharCodes)===void 0&&(this.found=!0):Va(n,this.targetCharCodes)!==void 0&&(this.found=!0)},t}(cn.BaseRegExpVisitor);function Mi(e,t){if(t instanceof RegExp){var n=yr(t),r=new Cc(e);return r.visit(n),r.found}else return Cn(t,function(i){return Fe(e,i.charCodeAt(0))})!==void 0}var Ga=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)i.hasOwnProperty(a)&&(r[a]=i[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mt="PATTERN",ln="defaultMode",Sr="modes",Ka=typeof new RegExp("(?:)").sticky=="boolean";function Ac(e,t){t=vr(t,{useSticky:Ka,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` `],tracer:function(R,U){return U()}});var n=t.tracer;n("initCharCodeToOptimizedIndexMap",function(){Wc()});var r;n("Reject Lexer.NA",function(){r=un(e,function(R){return R[Mt]===Rt.NA})});var i=!1,a;n("Transform Patterns",function(){i=!1,a=P(r,function(R){var U=R[Mt];if(Wt(U)){var j=U.source;return j.length===1&&j!=="^"&&j!=="$"&&j!=="."?j:j.length===2&&j[0]==="\\"&&!Fe(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],j[1])?j[1]:t.useSticky?Ja(U):Wa(U)}else{if($t(U))return i=!0,{exec:U};if(K(U,"exec"))return i=!0,U;if(typeof U=="string"){if(U.length===1)return U;var Ne=U.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),Je=new RegExp(Ne);return t.useSticky?Ja(Je):Wa(Je)}else throw Error("non exhaustive match")}})});var o,s,u,c,p;n("misc mapping",function(){o=P(r,function(R){return R.tokenTypeIdx}),s=P(r,function(R){var U=R.GROUP;if(U!==Rt.SKIPPED){if(Ft(U))return U;if(ht(U))return!1;throw Error("non exhaustive match")}}),u=P(r,function(R){var U=R.LONGER_ALT;if(U){var j=lc(r,U);return j}}),c=P(r,function(R){return R.PUSH_MODE}),p=P(r,function(R){return K(R,"POP_MODE")})});var f;n("Line Terminator Handling",function(){var R=Ya(t.lineTerminatorCharacters);f=P(r,function(U){return!1}),t.positionTracking!=="onlyOffset"&&(f=P(r,function(U){if(K(U,"LINE_BREAKS"))return U.LINE_BREAKS;if(Ha(U,R)===!1)return Mi(R,U.PATTERN)}))});var m,C,A,l;n("Misc Mapping #2",function(){m=P(r,qa),C=P(a,Vc),A=Ke(r,function(R,U){var j=U.GROUP;return Ft(j)&&j!==Rt.SKIPPED&&(R[j]=[]),R},{}),l=P(a,function(R,U){return{pattern:a[U],longerAlt:u[U],canLineTerminator:f[U],isCustom:m[U],short:C[U],group:s[U],push:c[U],pop:p[U],tokenTypeIdx:o[U],tokenType:r[U]}})});var T=!0,E=[];return t.safeMode||n("First Char Optimization",function(){E=Ke(r,function(R,U,j){if(typeof U.PATTERN=="string"){var Ne=U.PATTERN.charCodeAt(0),Je=en(Ne);bi(R,Je,l[j])}else if(gt(U.START_CHARS_HINT)){var Te;V(U.START_CHARS_HINT,function(ke){var Be=typeof ke=="string"?ke.charCodeAt(0):ke,Ve=en(Be);Te!==Ve&&(Te=Ve,bi(R,Ve,l[j]))})}else if(Wt(U.PATTERN))if(U.PATTERN.unicode)T=!1,t.ensureOptimizations&&_i(""+Cr+(" Unable to analyze < "+U.PATTERN.toString()+` > pattern. `)+` The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var Ye=Ec(U.PATTERN,t.ensureOptimizations);le(Ye)&&(T=!1),V(Ye,function(ke){bi(R,ke,l[j])})}else t.ensureOptimizations&&_i(""+Cr+(" TokenType: <"+U.name+`> is using a custom token pattern without providing <start_chars_hint> parameter. `)+` This will disable the lexer's first char optimizations. For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),T=!1;return R},[])}),n("ArrayPacking",function(){E=pc(E)}),{emptyGroups:A,patternIdxToConfig:l,charCodeToPatternIdxToConfig:E,hasCustom:i,canBeOptimized:T}}function Sc(e,t){var n=[],r=gc(e);n=n.concat(r.errors);var i=Lc(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(Tc(a)),n=n.concat(Fc(a)),n=n.concat(Mc(a,t)),n=n.concat(bc(a)),n}function Tc(e){var t=[],n=Tt(e,function(r){return Wt(r[Mt])});return t=t.concat(Uc(n)),t=t.concat(_c(n)),t=t.concat(Ic(n)),t=t.concat(Bc(n)),t=t.concat(Oc(n)),t}function gc(e){var t=Tt(e,function(i){return!K(i,Mt)}),n=P(t,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:ge.MISSING_PATTERN,tokenTypes:[i]}}),r=mr(e,t);return{errors:n,valid:r}}function Lc(e){var t=Tt(e,function(i){var a=i[Mt];return!Wt(a)&&!$t(a)&&!K(a,"exec")&&!Ft(a)}),n=P(t,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ge.INVALID_PATTERN,tokenTypes:[i]}}),r=mr(e,t);return{errors:n,valid:r}}var Rc=/[^\\][\$]/;function Uc(e){var t=function(i){Ga(a,i);function a(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return a.prototype.visitEndAnchor=function(o){this.found=!0},a}(cn.BaseRegExpVisitor),n=Tt(e,function(i){var a=i[Mt];try{var o=yr(a),s=new t;return s.visit(o),s.found}catch{return Rc.test(a.source)}}),r=P(n,function(i){return{message:`Unexpected RegExp Anchor Error: Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$' See sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ge.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function Oc(e){var t=Tt(e,function(r){var i=r[Mt];return i.test("")}),n=P(t,function(r){return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:ge.EMPTY_MATCH_PATTERN,tokenTypes:[r]}});return n}var Nc=/[^\\[][\^]|^\^/;function _c(e){var t=function(i){Ga(a,i);function a(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return a.prototype.visitStartAnchor=function(o){this.found=!0},a}(cn.BaseRegExpVisitor),n=Tt(e,function(i){var a=i[Mt];try{var o=yr(a),s=new t;return s.visit(o),s.found}catch{return Nc.test(a.source)}}),r=P(n,function(i){return{message:`Unexpected RegExp Anchor Error: Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^' See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ge.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function Ic(e){var t=Tt(e,function(r){var i=r[Mt];return i instanceof RegExp&&(i.multiline||i.global)}),n=P(t,function(r){return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ge.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}});return n}function Bc(e){var t=[],n=P(e,function(a){return Ke(e,function(o,s){return a.PATTERN.source===s.PATTERN.source&&!Fe(t,s)&&s.PATTERN!==Rt.NA&&(t.push(s),o.push(s)),o},[])});n=Yn(n);var r=Tt(n,function(a){return a.length>1}),i=P(r,function(a){var o=P(a,function(u){return u.name}),s=dt(a).PATTERN;return{message:"The same RegExp pattern ->"+s+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:ge.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}});return i}function Fc(e){var t=Tt(e,function(r){if(!K(r,"GROUP"))return!1;var i=r.GROUP;return i!==Rt.SKIPPED&&i!==Rt.NA&&!Ft(i)}),n=P(t,function(r){return{message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ge.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}});return n}function Mc(e,t){var n=Tt(e,function(i){return i.PUSH_MODE!==void 0&&!Fe(t,i.PUSH_MODE)}),r=P(n,function(i){var a="Token Type: ->"+i.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+i.PUSH_MODE+"<-which does not exist";return{message:a,type:ge.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return r}function bc(e){var t=[],n=Ke(e,function(r,i,a){var o=i.PATTERN;return o===Rt.NA||(Ft(o)?r.push({str:o,idx:a,tokenType:i}):Wt(o)&&kc(o)&&r.push({str:o.source,idx:a,tokenType:i})),r},[]);return V(e,function(r,i){V(n,function(a){var o=a.str,s=a.idx,u=a.tokenType;if(i<s&&Pc(o,r.PATTERN)){var c="Token: ->"+u.name+`<- can never be matched. `+("Because it appears AFTER the Token Type ->"+r.name+"<-")+`in the lexer's definition. See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:c,type:ge.UNREACHABLE_PATTERN,tokenTypes:[r,u]})}})}),t}function Pc(e,t){if(Wt(t)){var n=t.exec(e);return n!==null&&n.index===0}else{if($t(t))return t(e,0,[],{});if(K(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function kc(e){var t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return Cn(t,function(n){return e.source.indexOf(n)!==-1})===void 0}function Wa(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function Ja(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function xc(e,t,n){var r=[];return K(e,ln)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+ln+`> property in its definition `,type:ge.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),K(e,Sr)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Sr+`> property in its definition `,type:ge.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),K(e,Sr)&&K(e,ln)&&!K(e.modes,e.defaultMode)&&r.push({message:"A MultiMode Lexer cannot be initialized with a "+ln+": <"+e.defaultMode+`>which does not exist `,type:ge.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),K(e,Sr)&&V(e.modes,function(i,a){V(i,function(o,s){ht(o)&&r.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+a+"> at index: <"+s+`> `),type:ge.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),r}function wc(e,t,n){var r=[],i=!1,a=Yn(rt(uc(e.modes,function(u){return u}))),o=un(a,function(u){return u[Mt]===Rt.NA}),s=Ya(n);return t&&V(o,function(u){var c=Ha(u,s);if(c!==!1){var p=Kc(u,c),f={message:p,type:c.issue,tokenType:u};r.push(f)}else K(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):Mi(s,u.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:ge.NO_LINE_BREAKS_FLAGS}),r}function jc(e){var t={},n=Kt(e);return V(n,function(r){var i=e[r];if(gt(i))t[r]=[];else throw Error("non exhaustive match")}),t}function qa(e){var t=e.PATTERN;if(Wt(t))return!1;if($t(t))return!0;if(K(t,"exec"))return!0;if(Ft(t))return!1;throw Error("non exhaustive match")}function Vc(e){return Ft(e)&&e.length===1?e.charCodeAt(0):!1}var Gc={test:function(e){for(var t=e.length,n=this.lastIndex;n<t;n++){var r=e.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return e.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function Ha(e,t){if(K(e,"LINE_BREAKS"))return!1;if(Wt(e.PATTERN)){try{Mi(t,e.PATTERN)}catch(n){return{issue:ge.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(Ft(e.PATTERN))return!1;if(qa(e))return{issue:ge.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Kc(e,t){if(t.issue===ge.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern. `+(" The problem is in the <"+e.name+`> Token Type `)+(" Root cause: "+t.errMsg+`. `)+" For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===ge.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option. `+(" The problem is in the <"+e.name+`> Token Type `)+" For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function Ya(e){var t=P(e,function(n){return Ft(n)&&n.length>0?n.charCodeAt(0):n});return t}function bi(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}var zn=256;function en(e){return e<zn?e:Tr[e]}var Tr=[];function Wc(){if(le(Tr)){Tr=new Array(65536);for(var e=0;e<65536;e++)Tr[e]=e>255?255+~~(e/255):e}}function gr(e,t){var n=e.tokenTypeIdx;return n===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[n]===!0}function Lr(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var za=1,Xa={};function Xn(e){var t=Jc(e);qc(t),Yc(t),Hc(t),V(t,function(n){n.isParent=n.categoryMatches.length>0})}function Jc(e){for(var t=it(e),n=e,r=!0;r;){n=Yn(rt(P(n,function(a){return a.CATEGORIES})));var i=mr(n,t);t=t.concat(i),le(i)?r=!1:n=i}return t}function qc(e){V(e,function(t){Qa(t)||(Xa[za]=t,t.tokenTypeIdx=za++),$a(t)&&!gt(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),$a(t)||(t.CATEGORIES=[]),zc(t)||(t.categoryMatches=[]),Xc(t)||(t.categoryMatchesMap={})})}function Hc(e){V(e,function(t){t.categoryMatches=[],V(t.categoryMatchesMap,function(n,r){t.categoryMatches.push(Xa[r].tokenTypeIdx)})})}function Yc(e){V(e,function(t){Za([],t)})}function Za(e,t){V(e,function(n){t.categoryMatchesMap[n.tokenTypeIdx]=!0}),V(t.CATEGORIES,function(n){var r=e.concat(t);Fe(r,n)||Za(r,n)})}function Qa(e){return K(e,"tokenTypeIdx")}function $a(e){return K(e,"CATEGORIES")}function zc(e){return K(e,"categoryMatches")}function Xc(e){return K(e,"categoryMatchesMap")}function Zc(e){return K(e,"tokenTypeIdx")}var eo={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,i){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}},ge;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(ge||(ge={}));var Zn={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:eo,traceInitPerf:!1,skipValidations:!1};Object.freeze(Zn);var Rt=function(){function e(t,n){var r=this;if(n===void 0&&(n=Zn),this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. a boolean 2nd argument is no longer supported`);this.config=ba(Zn,n);var i=this.config.traceInitPerf;i===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof i=="number"&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var a,o=!0;r.TRACE_INIT("Lexer Config handling",function(){if(r.config.lineTerminatorsPattern===Zn.lineTerminatorsPattern)r.config.lineTerminatorsPattern=Gc;else if(r.config.lineTerminatorCharacters===Zn.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config. For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');r.trackStartLines=/full|onlyStart/i.test(r.config.positionTracking),r.trackEndLines=/full/i.test(r.config.positionTracking),gt(t)?(a={modes:{}},a.modes[ln]=it(t),a[ln]=ln):(o=!1,a=Hn(t))}),r.config.skipValidations===!1&&(r.TRACE_INIT("performRuntimeChecks",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(xc(a,r.trackStartLines,r.config.lineTerminatorCharacters))}),r.TRACE_INIT("performWarningRuntimeChecks",function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat(wc(a,r.trackStartLines,r.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},V(a.modes,function(p,f){a.modes[f]=un(p,function(m){return ht(m)})});var s=Kt(a.modes);if(V(a.modes,function(p,f){r.TRACE_INIT("Mode: <"+f+"> processing",function(){if(r.modes.push(f),r.config.skipValidations===!1&&r.TRACE_INIT("validatePatterns",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(Sc(p,s))}),le(r.lexerDefinitionErrors)){Xn(p);var m;r.TRACE_INIT("analyzeTokenTypes",function(){m=Ac(p,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:r.TRACE_INIT.bind(r)})}),r.patternIdxToConfig[f]=m.patternIdxToConfig,r.charCodeToPatternIdxToConfig[f]=m.charCodeToPatternIdxToConfig,r.emptyGroups=ba(r.emptyGroups,m.emptyGroups),r.hasCustom=m.hasCustom||r.hasCustom,r.canModeBeOptimized[f]=m.canBeOptimized}})}),r.defaultMode=a.defaultMode,!le(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var u=P(r.lexerDefinitionErrors,function(p){return p.message}),c=u.join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: `+c)}V(r.lexerDefinitionWarning,function(p){Ii(p.message)}),r.TRACE_INIT("Choosing sub-methods implementations",function(){if(Ka?(r.chopInput=Pa,r.match=r.matchWithTest):(r.updateLastIndex=we,r.match=r.matchWithExec),o&&(r.handleModes=we),r.trackStartLines===!1&&(r.computeNewColumn=Pa),r.trackEndLines===!1&&(r.updateTokenEndLineColumnLocation=we),/full/i.test(r.config.positionTracking))r.createTokenInstance=r.createFullToken;else if(/onlyStart/i.test(r.config.positionTracking))r.createTokenInstance=r.createStartOnlyToken;else if(/onlyOffset/i.test(r.config.positionTracking))r.createTokenInstance=r.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+r.config.positionTracking+'"');r.hasCustom?(r.addToken=r.addTokenUsingPush,r.handlePayload=r.handlePayloadWithCustom):(r.addToken=r.addTokenUsingMemberAccess,r.handlePayload=r.handlePayloadNoCustom)}),r.TRACE_INIT("Failed Optimization Warnings",function(){var p=Ke(r.canModeBeOptimized,function(f,m,C){return m===!1&&f.push(C),f},[]);if(n.ensureOptimizations&&!le(p))throw Error("Lexer Modes: < "+p.join(", ")+` > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. Or inspect the console log for details on how to resolve these issues.`)}),r.TRACE_INIT("clearRegExpParserCache",function(){vc()}),r.TRACE_INIT("toFastProperties",function(){xa(r)})})}return e.prototype.tokenize=function(t,n){if(n===void 0&&(n=this.defaultMode),!le(this.lexerDefinitionErrors)){var r=P(this.lexerDefinitionErrors,function(o){return o.message}),i=r.join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: `+i)}var a=this.tokenizeInternal(t,n);return a},e.prototype.tokenizeInternal=function(t,n){var r=this,i,a,o,s,u,c,p,f,m,C,A,l,T,E,R=t,U=R.length,j=0,Ne=0,Je=this.hasCustom?0:Math.floor(t.length/10),Te=new Array(Je),Ye=[],ke=this.trackStartLines?1:void 0,Be=this.trackStartLines?1:void 0,Ve=jc(this.emptyGroups),Zt=this.trackStartLines,Bt=this.config.lineTerminatorsPattern,pt=0,ut=[],jt=[],Qt=[],Gn=[];Object.freeze(Gn);var St=void 0;function Kn(){return ut}function Wn(S){var F=en(S),L=jt[F];return L===void 0?Gn:L}var N=function(S){if(Qt.length===1&&S.tokenType.PUSH_MODE===void 0){var F=r.config.errorMessageProvider.buildUnableToPopLexerModeMessage(S);Ye.push({offset:S.startOffset,line:S.startLine!==void 0?S.startLine:void 0,column:S.startColumn!==void 0?S.startColumn:void 0,length:S.image.length,message:F})}else{Qt.pop();var L=Ba(Qt);ut=r.patternIdxToConfig[L],jt=r.charCodeToPatternIdxToConfig[L],pt=ut.length;var w=r.canModeBeOptimized[L]&&r.config.safeMode===!1;jt&&w?St=Wn:St=Kn}};function X(S){Qt.push(S),jt=this.charCodeToPatternIdxToConfig[S],ut=this.patternIdxToConfig[S],pt=ut.length,pt=ut.length;var F=this.canModeBeOptimized[S]&&this.config.safeMode===!1;jt&&F?St=Wn:St=Kn}X.call(this,n);for(var q;j<U;){u=null;var ee=R.charCodeAt(j),re=St(ee),Ce=re.length;for(i=0;i<Ce;i++){q=re[i];var J=q.pattern;c=null;var ce=q.short;if(ce!==!1?ee===ce&&(u=J):q.isCustom===!0?(E=J.exec(R,j,Te,Ve),E!==null?(u=E[0],E.payload!==void 0&&(c=E.payload)):u=null):(this.updateLastIndex(J,j),u=this.match(J,t,j)),u!==null){if(s=q.longerAlt,s!==void 0){var de=ut[s],ne=de.pattern;p=null,de.isCustom===!0?(E=ne.exec(R,j,Te,Ve),E!==null?(o=E[0],E.payload!==void 0&&(p=E.payload)):o=null):(this.updateLastIndex(ne,j),o=this.match(ne,t,j)),o&&o.length>u.length&&(u=o,c=p,q=de)}break}}if(u!==null){if(f=u.length,m=q.group,m!==void 0&&(C=q.tokenTypeIdx,A=this.createTokenInstance(u,j,C,q.tokenType,ke,Be,f),this.handlePayload(A,c),m===!1?Ne=this.addToken(Te,Ne,A):Ve[m].push(A)),t=this.chopInput(t,f),j=j+f,Be=this.computeNewColumn(Be,f),Zt===!0&&q.canLineTerminator===!0){var _e=0,_=void 0,fe=void 0;Bt.lastIndex=0;do _=Bt.test(u),_===!0&&(fe=Bt.lastIndex-1,_e++);while(_===!0);_e!==0&&(ke=ke+_e,Be=f-fe,this.updateTokenEndLineColumnLocation(A,m,fe,_e,ke,Be,f))}this.handleModes(q,N,X,A)}else{for(var De=j,ie=ke,d=Be,v=!1;!v&&j<U;)for(R.charCodeAt(j),t=this.chopInput(t,1),j++,a=0;a<pt;a++){var g=ut[a],J=g.pattern,ce=g.short;if(ce!==!1?R.charCodeAt(j)===ce&&(v=!0):g.isCustom===!0?v=J.exec(R,j,Te,Ve)!==null:(this.updateLastIndex(J,j),v=J.exec(t)!==null),v===!0)break}l=j-De,T=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(R,De,l,ie,d),Ye.push({offset:De,line:ie,column:d,length:l,message:T})}}return this.hasCustom||(Te.length=Ne),{tokens:Te,groups:Ve,errors:Ye}},e.prototype.handleModes=function(t,n,r,i){if(t.pop===!0){var a=t.push;n(i),a!==void 0&&r.call(this,a)}else t.push!==void 0&&r.call(this,t.push)},e.prototype.chopInput=function(t,n){return t.substring(n)},e.prototype.updateLastIndex=function(t,n){t.lastIndex=n},e.prototype.updateTokenEndLineColumnLocation=function(t,n,r,i,a,o,s){var u,c;n!==void 0&&(u=r===s-1,c=u?-1:0,i===1&&u===!0||(t.endLine=a+c,t.endColumn=o-1+-c))},e.prototype.computeNewColumn=function(t,n){return t+n},e.prototype.createTokenInstance=function(){return null},e.prototype.createOffsetOnlyToken=function(t,n,r,i){return{image:t,startOffset:n,tokenTypeIdx:r,tokenType:i}},e.prototype.createStartOnlyToken=function(t,n,r,i,a,o){return{image:t,startOffset:n,startLine:a,startColumn:o,tokenTypeIdx:r,tokenType:i}},e.prototype.createFullToken=function(t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:n+s-1,startLine:a,endLine:a,startColumn:o,endColumn:o+s-1,tokenTypeIdx:r,tokenType:i}},e.prototype.addToken=function(t,n,r){return 666},e.prototype.addTokenUsingPush=function(t,n,r){return t.push(r),n},e.prototype.addTokenUsingMemberAccess=function(t,n,r){return t[n]=r,n++,n},e.prototype.handlePayload=function(t,n){},e.prototype.handlePayloadNoCustom=function(t,n){},e.prototype.handlePayloadWithCustom=function(t,n){n!==null&&(t.payload=n)},e.prototype.match=function(t,n,r){return null},e.prototype.matchWithTest=function(t,n,r){var i=t.test(n);return i===!0?n.substring(r,t.lastIndex):null},e.prototype.matchWithExec=function(t,n){var r=t.exec(n);return r!==null?r[0]:r},e.prototype.TRACE_INIT=function(t,n){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--> <"+t+">");var i=wa(n),a=i.time,o=i.value,s=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+"<-- <"+t+"> time: "+a+"ms"),this.traceInitIndent--,o}else return n()},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();function fn(e){return to(e)?e.LABEL:e.name}function Qc(e){return e.name}function to(e){return Ft(e.LABEL)&&e.LABEL!==""}var $c="parent",no="categories",ro="label",io="group",ao="push_mode",oo="pop_mode",so="longer_alt",uo="line_breaks",co="start_chars_hint";function Pi(e){return el(e)}function el(e){var t=e.pattern,n={};if(n.name=e.name,ht(t)||(n.PATTERN=t),K(e,$c))throw`The parent property is no longer supported. See: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.`;return K(e,no)&&(n.CATEGORIES=e[no]),Xn([n]),K(e,ro)&&(n.LABEL=e[ro]),K(e,io)&&(n.GROUP=e[io]),K(e,oo)&&(n.POP_MODE=e[oo]),K(e,ao)&&(n.PUSH_MODE=e[ao]),K(e,so)&&(n.LONGER_ALT=e[so]),K(e,uo)&&(n.LINE_BREAKS=e[uo]),K(e,co)&&(n.START_CHARS_HINT=e[co]),n}var tn=Pi({name:"EOF",pattern:Rt.NA});Xn([tn]);function Rr(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function tl(e,t){return gr(e,t)}var Jt=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)i.hasOwnProperty(a)&&(r[a]=i[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bt=function(){function e(t){this.definition=t}return e.prototype.accept=function(t){t.visit(this),V(this.definition,function(n){n.accept(t)})},e}(),ze=function(e){Jt(t,e);function t(n){var r=e.call(this,[])||this;return r.idx=1,Lt(r,mt(n,function(i){return i!==void 0})),r}return Object.defineProperty(t.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(n){},enumerable:!0,configurable:!0}),t.prototype.accept=function(n){n.visit(this)},t}(bt),pn=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.orgText="",Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),He=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.ignoreAmbiguities=!1,Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),Me=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),at=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),ot=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),Ae=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),Xe=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),Ze=function(e){Jt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,Lt(r,mt(n,function(i){return i!==void 0})),r}return t}(bt),he=function(){function e(t){this.idx=1,Lt(this,mt(t,function(n){return n!==void 0}))}return e.prototype.accept=function(t){t.visit(this)},e}();function lo(e){return P(e,Qn)}function Qn(e){function t(i){return P(i,Qn)}if(e instanceof ze)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof He)return{type:"Flat",definition:t(e.definition)};if(e instanceof Me)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof at)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof ot)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:Qn(new he({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Xe)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:Qn(new he({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Ae)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Ze)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof he){var n={type:"Terminal",name:e.terminalType.name,label:fn(e.terminalType),idx:e.idx},r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=Wt(r)?r.source:r),n}else{if(e instanceof pn)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}var Ur=function(){function e(){}return e.prototype.walk=function(t,n){var r=this;n===void 0&&(n=[]),V(t.definition,function(i,a){var o=Ge(t.definition,a+1);if(i instanceof ze)r.walkProdRef(i,o,n);else if(i instanceof he)r.walkTerminal(i,o,n);else if(i instanceof He)r.walkFlat(i,o,n);else if(i instanceof Me)r.walkOption(i,o,n);else if(i instanceof at)r.walkAtLeastOne(i,o,n);else if(i instanceof ot)r.walkAtLeastOneSep(i,o,n);else if(i instanceof Xe)r.walkManySep(i,o,n);else if(i instanceof Ae)r.walkMany(i,o,n);else if(i instanceof Ze)r.walkOr(i,o,n);else throw Error("non exhaustive match")})},e.prototype.walkTerminal=function(t,n,r){},e.prototype.walkProdRef=function(t,n,r){},e.prototype.walkFlat=function(t,n,r){var i=n.concat(r);this.walk(t,i)},e.prototype.walkOption=function(t,n,r){var i=n.concat(r);this.walk(t,i)},e.prototype.walkAtLeastOne=function(t,n,r){var i=[new Me({definition:t.definition})].concat(n,r);this.walk(t,i)},e.prototype.walkAtLeastOneSep=function(t,n,r){var i=fo(t,n,r);this.walk(t,i)},e.prototype.walkMany=function(t,n,r){var i=[new Me({definition:t.definition})].concat(n,r);this.walk(t,i)},e.prototype.walkManySep=function(t,n,r){var i=fo(t,n,r);this.walk(t,i)},e.prototype.walkOr=function(t,n,r){var i=this,a=n.concat(r);V(t.definition,function(o){va