pkg-cdn
Version:
某些库没有提供 cdn 或者只提供单个格式, 此库通过用 vite 构建提供
53 lines • 388 kB
JavaScript
(function(xn,mi){typeof exports=="object"&&typeof module<"u"?module.exports=mi(require("prettier")):typeof define=="function"&&define.amd?define(["prettier"],mi):(xn=typeof globalThis<"u"?globalThis:xn||self,xn.PrettierPluginJava=mi(xn.prettier))})(this,function(xn){"use strict";const lp=(e=>e&&typeof e=="object"&&"default"in e?e:{default:e})(xn);var j=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fp(e){var t=e.default;if(typeof t=="function"){var n=function(){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 Va="6.5.0";function Q(e){return e&&e.length===0}function Mt(e){return e==null?[]:Object.keys(e)}function Ue(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++)t.push(e[n[r]]);return t}function pp(e,t){for(var n=[],r=Mt(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 xe(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Array.isArray(r)?t=t.concat(xe(r)):t.push(r)}return t}function $e(e){return Q(e)?void 0:e[0]}function Ds(e){var t=e&&e.length;return t?e[t-1]:void 0}function k(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)t.call(null,e[n],n);else if(Wa(e))for(var r=Mt(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 Lt(e){return typeof e=="string"}function et(e){return e===void 0}function $t(e){return e instanceof Function}function Se(e,t){return t===void 0&&(t=1),e.slice(t,e.length)}function gr(e,t){return t===void 0&&(t=1),e.slice(0,e.length-t)}function ut(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 En(e,t){return ut(e,function(n){return!t(n)})}function tt(e,t){for(var n=Object.keys(e),r={},i=0;i<n.length;i++){var a=n[i],s=e[a];t(s)&&(r[a]=s)}return r}function G(e,t){return Wa(e)?e.hasOwnProperty(t):!1}function fe(e,t){return jn(e,function(n){return n===t})!==void 0}function je(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}function Tr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function jn(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t.call(null,r))return r}}function dp(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 ge(e,t,n){for(var r=Array.isArray(e),i=r?e:Ue(e),a=r?[]:Mt(e),s=n,c=0;c<i.length;c++)s=t.call(null,s,i[c],r?c:a[c]);return s}function Lr(e){return En(e,function(t){return t==null})}function Ka(e,t){t===void 0&&(t=function(r){return r});var n=[];return ge(e,function(r,i){var a=t(i);return fe(n,a)?r:(n.push(a),r.concat(i))},[])}function ct(e){return Array.isArray(e)}function Bt(e){return e instanceof RegExp}function Wa(e){return e instanceof Object}function nt(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function Ei(e,t){return En(e,function(n){return fe(t,n)})}function As(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}function hp(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=Mt(i),s=0;s<a.length;s++){var c=a[s];e[c]=i[c]}return e}function vp(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(!et(i))for(var a=Mt(i),s=0;s<a.length;s++){var c=a[s];G(e,c)||(e[c]=i[c])}}return e}function yi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vp.apply(null,[{}].concat(e))}function Cs(e,t){var n={};return k(e,function(r){var i=t(r),a=n[i];a?a.push(r):n[i]=[r]}),n}function Ss(e,t){for(var n=Tr(e),r=Mt(t),i=0;i<r.length;i++){var a=r[i],s=t[a];n[a]=s}return n}function ye(){}function gs(e){return e}function mp(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 Ja(e){console&&console.error&&console.error("Error: "+e)}function Ha(e){console&&console.warn&&console.warn("Warning: "+e)}function Ts(){return typeof Map=="function"}function Ep(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 Ls(e){function t(){}t.prototype=e;var n=new t;function r(){return typeof n.bar}return r(),r(),e}function Di(e){return e[e.length-1]}function Rs(e){var t=new Date().getTime(),n=e(),r=new Date().getTime(),i=r-t;return{time:i,value:n}}var Gn={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:j,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(m){this.idx=m.idx,this.input=m.input,this.groupIdx=m.groupIdx},t.prototype.pattern=function(m){this.idx=0,this.input=m,this.groupIdx=0,this.consumeChar("/");var R=this.disjunction();this.consumeChar("/");for(var g={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":c(g,"global");break;case"i":c(g,"ignoreCase");break;case"m":c(g,"multiLine");break;case"u":c(g,"unicode");break;case"y":c(g,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:g,value:R}},t.prototype.disjunction=function(){var m=[];for(m.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),m.push(this.alternative());return{type:"Disjunction",value:m}},t.prototype.alternative=function(){for(var m=[];this.isTerm();)m.push(this.term());return{type:"Alternative",value:m}},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 m;switch(this.popChar()){case"=":m="Lookahead";break;case"!":m="NegativeLookahead";break}f(m);var R=this.disjunction();return this.consumeChar(")"),{type:m,value:R}}v()},t.prototype.quantifier=function(m){var R;switch(this.popChar()){case"*":R={atLeast:0,atMost:1/0};break;case"+":R={atLeast:1,atMost:1/0};break;case"?":R={atLeast:0,atMost:1};break;case"{":var g=this.integerIncludingZero();switch(this.popChar()){case"}":R={atLeast:g,atMost:g};break;case",":var U;this.isDigit()?(U=this.integerIncludingZero(),R={atLeast:g,atMost:U}):R={atLeast:g,atMost:1/0},this.consumeChar("}");break}if(m===!0&&R===void 0)return;f(R);break}if(!(m===!0&&R===void 0))return f(R),this.peekChar(0)==="?"?(this.consumeChar("?"),R.greedy=!1):R.greedy=!0,R.type="Quantifier",R},t.prototype.atom=function(){var m;switch(this.peekChar()){case".":m=this.dotAll();break;case"\\":m=this.atomEscape();break;case"[":m=this.characterClass();break;case"(":m=this.group();break}return m===void 0&&this.isPatternCharacter()&&(m=this.patternCharacter()),f(m),this.isQuantifier()&&(m.quantifier=this.quantifier()),m},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 m=this.positiveInteger();return{type:"GroupBackReference",value:m}},t.prototype.characterClassEscape=function(){var m,R=!1;switch(this.popChar()){case"d":m=E;break;case"D":m=E,R=!0;break;case"s":m=O;break;case"S":m=O,R=!0;break;case"w":m=A;break;case"W":m=A,R=!0;break}return f(m),{type:"Set",value:m,complement:R}},t.prototype.controlEscapeAtom=function(){var m;switch(this.popChar()){case"f":m=a("\f");break;case"n":m=a(`
`);break;case"r":m=a("\r");break;case"t":m=a(" ");break;case"v":m=a("\v");break}return f(m),{type:"Character",value:m}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var m=this.popChar();if(/[a-zA-Z]/.test(m)===!1)throw Error("Invalid ");var R=m.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:R}},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 m=this.popChar();return{type:"Character",value:a(m)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var m=this.popChar();return{type:"Character",value:a(m)}}},t.prototype.characterClass=function(){var m=[],R=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),R=!0);this.isClassAtom();){var g=this.classAtom(),U=g.type==="Character";if(U&&this.isRangeDash()){this.consumeChar("-");var B=this.classAtom(),V=B.type==="Character";if(V){if(B.value<g.value)throw Error("Range out of order in character class");m.push({from:g.value,to:B.value})}else s(g.value,m),m.push(a("-")),s(B.value,m)}else s(g.value,m)}return this.consumeChar("]"),{type:"Set",complement:R,value:m}},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 m=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),m=!1;break;default:this.groupIdx++;break}var R=this.disjunction();this.consumeChar(")");var g={type:"Group",capturing:m,value:R};return m&&(g.idx=this.groupIdx),g},t.prototype.positiveInteger=function(){var m=this.popChar();if(i.test(m)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)m+=this.popChar();return parseInt(m,10)},t.prototype.integerIncludingZero=function(){var m=this.popChar();if(r.test(m)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)m+=this.popChar();return parseInt(m,10)},t.prototype.patternCharacter=function(){var m=this.popChar();switch(m){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(m)}}},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(m){switch(m===void 0&&(m=0),this.peekChar(m)){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 m=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(m)}},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(m){for(var R="",g=0;g<m;g++){var U=this.popChar();if(n.test(U)===!1)throw Error("Expecting a HexDecimal digits");R+=U}var B=parseInt(R,16);return{type:"Character",value:B}},t.prototype.peekChar=function(m){return m===void 0&&(m=0),this.input[this.idx+m]},t.prototype.popChar=function(){var m=this.peekChar(0);return this.consumeChar(),m},t.prototype.consumeChar=function(m){if(m!==void 0&&this.input[this.idx]!==m)throw Error("Expected: '"+m+"' 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(m){return m.charCodeAt(0)}function s(m,R){m.length!==void 0?m.forEach(function(g){R.push(g)}):R.push(m)}function c(m,R){if(m[R]===!0)throw"duplicate flag "+R;m[R]=!0}function f(m){if(m===void 0)throw Error("Internal Error - Should never get here!")}function v(){throw Error("Internal Error - Should never get here!")}var y,E=[];for(y=a("0");y<=a("9");y++)E.push(y);var A=[a("_")].concat(E);for(y=a("a");y<=a("z");y++)A.push(y);for(y=a("A");y<=a("Z");y++)A.push(y);var O=[a(" "),a("\f"),a(`
`),a("\r"),a(" "),a("\v"),a(" "),a("\xA0"),a("\u1680"),a("\u2000"),a("\u2001"),a("\u2002"),a("\u2003"),a("\u2004"),a("\u2005"),a("\u2006"),a("\u2007"),a("\u2008"),a("\u2009"),a("\u200A"),a("\u2028"),a("\u2029"),a("\u202F"),a("\u205F"),a("\u3000"),a("\uFEFF")];function L(){}return L.prototype.visitChildren=function(m){for(var R in m){var g=m[R];m.hasOwnProperty(R)&&(g.type!==void 0?this.visit(g):Array.isArray(g)&&g.forEach(function(U){this.visit(U)},this))}},L.prototype.visit=function(m){switch(m.type){case"Pattern":this.visitPattern(m);break;case"Flags":this.visitFlags(m);break;case"Disjunction":this.visitDisjunction(m);break;case"Alternative":this.visitAlternative(m);break;case"StartAnchor":this.visitStartAnchor(m);break;case"EndAnchor":this.visitEndAnchor(m);break;case"WordBoundary":this.visitWordBoundary(m);break;case"NonWordBoundary":this.visitNonWordBoundary(m);break;case"Lookahead":this.visitLookahead(m);break;case"NegativeLookahead":this.visitNegativeLookahead(m);break;case"Character":this.visitCharacter(m);break;case"Set":this.visitSet(m);break;case"Group":this.visitGroup(m);break;case"GroupBackReference":this.visitGroupBackReference(m);break;case"Quantifier":this.visitQuantifier(m);break}this.visitChildren(m)},L.prototype.visitPattern=function(m){},L.prototype.visitFlags=function(m){},L.prototype.visitDisjunction=function(m){},L.prototype.visitAlternative=function(m){},L.prototype.visitStartAnchor=function(m){},L.prototype.visitEndAnchor=function(m){},L.prototype.visitWordBoundary=function(m){},L.prototype.visitNonWordBoundary=function(m){},L.prototype.visitLookahead=function(m){},L.prototype.visitNegativeLookahead=function(m){},L.prototype.visitCharacter=function(m){},L.prototype.visitSet=function(m){},L.prototype.visitGroup=function(m){},L.prototype.visitGroupBackReference=function(m){},L.prototype.visitQuantifier=function(m){},{RegExpParser:t,BaseRegExpVisitor:L,VERSION:"0.4.0"}})})(Gn);var Ai={},yp=new Gn.exports.RegExpParser;function Ci(e){var t=e.toString();if(Ai.hasOwnProperty(t))return Ai[t];var n=yp.pattern(t);return Ai[t]=n,n}function Dp(){Ai={}}var Ap=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)}}(),Os="Complement Sets are not supported for first char optimization",Si=`Unable to use "first char" lexer optimizations:
`;function Cp(e,t){t===void 0&&(t=!1);try{var n=Ci(e),r=Ya(n.value,{},n.flags.ignoreCase);return r}catch(a){if(a.message===Os)t&&Ha(""+Si+(" 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.`),Ja(Si+`
`+(" Failed parsing: < "+e.toString()+` >
`)+(" Using the regexp-to-ast library version: "+Gn.exports.VERSION+`
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}function Ya(e,t,n){switch(e.type){case"Disjunction":for(var r=0;r<e.value.length;r++)Ya(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 s=a;switch(s.type){case"Character":gi(s.value,t,n);break;case"Set":if(s.complement===!0)throw Error(Os);k(s.value,function(v){if(typeof v=="number")gi(v,t,n);else{var y=v;if(n===!0)for(var E=y.from;E<=y.to;E++)gi(E,t,n);else{for(var E=y.from;E<=y.to&&E<Rr;E++)gi(E,t,n);if(y.to>=Rr)for(var A=y.from>=Rr?y.from:Rr,O=y.to,L=en(A),m=en(O),R=L;R<=m;R++)t[R]=R}}});break;case"Group":Ya(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}var c=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&qa(s)===!1||s.type!=="Group"&&c===!1)break}break;default:throw Error("non exhaustive match!")}return Ue(t)}function gi(e,t,n){var r=en(e);t[r]=r,n===!0&&Sp(e,t)}function Sp(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 Us(e,t){return jn(e.value,function(n){if(typeof n=="number")return fe(t,n);var r=n;return jn(t,function(i){return r.from<=i&&i<=r.to})!==void 0})}function qa(e){return e.quantifier&&e.quantifier.atLeast===0?!0:e.value?ct(e.value)?nt(e.value,qa):qa(e.value):!1}var gp=function(e){Ap(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?Us(n,this.targetCharCodes)===void 0&&(this.found=!0):Us(n,this.targetCharCodes)!==void 0&&(this.found=!0)},t}(Gn.exports.BaseRegExpVisitor);function za(e,t){if(t instanceof RegExp){var n=Ci(t),r=new gp(e);return r.visit(n),r.found}else return jn(t,function(i){return fe(e,i.charCodeAt(0))})!==void 0}var Ns=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)}}(),Rt="PATTERN",yn="defaultMode",Ti="modes",Is=typeof new RegExp("(?:)").sticky=="boolean";function Tp(e,t){t=yi(t,{useSticky:Is,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:function(U,B){return B()}});var n=t.tracer;n("initCharCodeToOptimizedIndexMap",function(){Yp()});var r;n("Reject Lexer.NA",function(){r=En(e,function(U){return U[Rt]===ft.NA})});var i=!1,a;n("Transform Patterns",function(){i=!1,a=P(r,function(U){var B=U[Rt];if(Bt(B)){var V=B.source;return V.length===1&&V!=="^"&&V!=="$"&&V!=="."?V:V.length===2&&V[0]==="\\"&&!fe(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],V[1])?V[1]:t.useSticky?bs(B):_s(B)}else{if($t(B))return i=!0,{exec:B};if(G(B,"exec"))return i=!0,B;if(typeof B=="string"){if(B.length===1)return B;var me=B.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),ze=new RegExp(me);return t.useSticky?bs(ze):_s(ze)}else throw Error("non exhaustive match")}})});var s,c,f,v,y;n("misc mapping",function(){s=P(r,function(U){return U.tokenTypeIdx}),c=P(r,function(U){var B=U.GROUP;if(B!==ft.SKIPPED){if(Lt(B))return B;if(et(B))return!1;throw Error("non exhaustive match")}}),f=P(r,function(U){var B=U.LONGER_ALT;if(B){var V=hp(r,B);return V}}),v=P(r,function(U){return U.PUSH_MODE}),y=P(r,function(U){return G(U,"POP_MODE")})});var E;n("Line Terminator Handling",function(){var U=Ps(t.lineTerminatorCharacters);E=P(r,function(B){return!1}),t.positionTracking!=="onlyOffset"&&(E=P(r,function(B){if(G(B,"LINE_BREAKS"))return B.LINE_BREAKS;if(Bs(B,U)===!1)return za(U,B.PATTERN)}))});var A,O,L,m;n("Misc Mapping #2",function(){A=P(r,Ms),O=P(a,Wp),L=ge(r,function(U,B){var V=B.GROUP;return Lt(V)&&V!==ft.SKIPPED&&(U[V]=[]),U},{}),m=P(a,function(U,B){return{pattern:a[B],longerAlt:f[B],canLineTerminator:E[B],isCustom:A[B],short:O[B],group:c[B],push:v[B],pop:y[B],tokenTypeIdx:s[B],tokenType:r[B]}})});var R=!0,g=[];return t.safeMode||n("First Char Optimization",function(){g=ge(r,function(U,B,V){if(typeof B.PATTERN=="string"){var me=B.PATTERN.charCodeAt(0),ze=en(me);Xa(U,ze,m[V])}else if(ct(B.START_CHARS_HINT)){var Ee;k(B.START_CHARS_HINT,function(Le){var Ae=typeof Le=="string"?Le.charCodeAt(0):Le,Re=en(Ae);Ee!==Re&&(Ee=Re,Xa(U,Re,m[V]))})}else if(Bt(B.PATTERN))if(B.PATTERN.unicode)R=!1,t.ensureOptimizations&&Ja(""+Si+(" Unable to analyze < "+B.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 We=Cp(B.PATTERN,t.ensureOptimizations);Q(We)&&(R=!1),k(We,function(Le){Xa(U,Le,m[V])})}else t.ensureOptimizations&&Ja(""+Si+(" TokenType: <"+B.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`),R=!1;return U},[])}),n("ArrayPacking",function(){g=mp(g)}),{emptyGroups:L,patternIdxToConfig:m,charCodeToPatternIdxToConfig:g,hasCustom:i,canBeOptimized:R}}function Lp(e,t){var n=[],r=Op(e);n=n.concat(r.errors);var i=Up(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(Rp(a)),n=n.concat(Fp(a)),n=n.concat(kp(a,t)),n=n.concat(wp(a)),n}function Rp(e){var t=[],n=ut(e,function(r){return Bt(r[Rt])});return t=t.concat(Ip(n)),t=t.concat(Mp(n)),t=t.concat(Bp(n)),t=t.concat(Pp(n)),t=t.concat(_p(n)),t}function Op(e){var t=ut(e,function(i){return!G(i,Rt)}),n=P(t,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:ae.MISSING_PATTERN,tokenTypes:[i]}}),r=Ei(e,t);return{errors:n,valid:r}}function Up(e){var t=ut(e,function(i){var a=i[Rt];return!Bt(a)&&!$t(a)&&!G(a,"exec")&&!Lt(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:ae.INVALID_PATTERN,tokenTypes:[i]}}),r=Ei(e,t);return{errors:n,valid:r}}var Np=/[^\\][\$]/;function Ip(e){var t=function(i){Ns(a,i);function a(){var s=i!==null&&i.apply(this,arguments)||this;return s.found=!1,s}return a.prototype.visitEndAnchor=function(s){this.found=!0},a}(Gn.exports.BaseRegExpVisitor),n=ut(e,function(i){var a=i[Rt];try{var s=Ci(a),c=new t;return c.visit(s),c.found}catch{return Np.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:ae.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function _p(e){var t=ut(e,function(r){var i=r[Rt];return i.test("")}),n=P(t,function(r){return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:ae.EMPTY_MATCH_PATTERN,tokenTypes:[r]}});return n}var bp=/[^\\[][\^]|^\^/;function Mp(e){var t=function(i){Ns(a,i);function a(){var s=i!==null&&i.apply(this,arguments)||this;return s.found=!1,s}return a.prototype.visitStartAnchor=function(s){this.found=!0},a}(Gn.exports.BaseRegExpVisitor),n=ut(e,function(i){var a=i[Rt];try{var s=Ci(a),c=new t;return c.visit(s),c.found}catch{return bp.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:ae.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function Bp(e){var t=ut(e,function(r){var i=r[Rt];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:ae.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}});return n}function Pp(e){var t=[],n=P(e,function(a){return ge(e,function(s,c){return a.PATTERN.source===c.PATTERN.source&&!fe(t,c)&&c.PATTERN!==ft.NA&&(t.push(c),s.push(c)),s},[])});n=Lr(n);var r=ut(n,function(a){return a.length>1}),i=P(r,function(a){var s=P(a,function(f){return f.name}),c=$e(a).PATTERN;return{message:"The same RegExp pattern ->"+c+"<-"+("has been used in all of the following Token Types: "+s.join(", ")+" <-"),type:ae.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}});return i}function Fp(e){var t=ut(e,function(r){if(!G(r,"GROUP"))return!1;var i=r.GROUP;return i!==ft.SKIPPED&&i!==ft.NA&&!Lt(i)}),n=P(t,function(r){return{message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ae.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}});return n}function kp(e,t){var n=ut(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:ae.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return r}function wp(e){var t=[],n=ge(e,function(r,i,a){var s=i.PATTERN;return s===ft.NA||(Lt(s)?r.push({str:s,idx:a,tokenType:i}):Bt(s)&&jp(s)&&r.push({str:s.source,idx:a,tokenType:i})),r},[]);return k(e,function(r,i){k(n,function(a){var s=a.str,c=a.idx,f=a.tokenType;if(i<c&&xp(s,r.PATTERN)){var v="Token: ->"+f.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:v,type:ae.UNREACHABLE_PATTERN,tokenTypes:[r,f]})}})}),t}function xp(e,t){if(Bt(t)){var n=t.exec(e);return n!==null&&n.index===0}else{if($t(t))return t(e,0,[],{});if(G(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function jp(e){var t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return jn(t,function(n){return e.source.indexOf(n)!==-1})===void 0}function _s(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function bs(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function Gp(e,t,n){var r=[];return G(e,yn)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+yn+`> property in its definition
`,type:ae.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),G(e,Ti)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ti+`> property in its definition
`,type:ae.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),G(e,Ti)&&G(e,yn)&&!G(e.modes,e.defaultMode)&&r.push({message:"A MultiMode Lexer cannot be initialized with a "+yn+": <"+e.defaultMode+`>which does not exist
`,type:ae.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),G(e,Ti)&&k(e.modes,function(i,a){k(i,function(s,c){et(s)&&r.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+a+"> at index: <"+c+`>
`),type:ae.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),r}function Vp(e,t,n){var r=[],i=!1,a=Lr(xe(pp(e.modes,function(f){return f}))),s=En(a,function(f){return f[Rt]===ft.NA}),c=Ps(n);return t&&k(s,function(f){var v=Bs(f,c);if(v!==!1){var y=Hp(f,v),E={message:y,type:v.issue,tokenType:f};r.push(E)}else G(f,"LINE_BREAKS")?f.LINE_BREAKS===!0&&(i=!0):za(c,f.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:ae.NO_LINE_BREAKS_FLAGS}),r}function Kp(e){var t={},n=Mt(e);return k(n,function(r){var i=e[r];if(ct(i))t[r]=[];else throw Error("non exhaustive match")}),t}function Ms(e){var t=e.PATTERN;if(Bt(t))return!1;if($t(t))return!0;if(G(t,"exec"))return!0;if(Lt(t))return!1;throw Error("non exhaustive match")}function Wp(e){return Lt(e)&&e.length===1?e.charCodeAt(0):!1}var Jp={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 Bs(e,t){if(G(e,"LINE_BREAKS"))return!1;if(Bt(e.PATTERN)){try{za(t,e.PATTERN)}catch(n){return{issue:ae.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(Lt(e.PATTERN))return!1;if(Ms(e))return{issue:ae.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Hp(e,t){if(t.issue===ae.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===ae.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 Ps(e){var t=P(e,function(n){return Lt(n)&&n.length>0?n.charCodeAt(0):n});return t}function Xa(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}var Rr=256;function en(e){return e<Rr?e:Li[e]}var Li=[];function Yp(){if(Q(Li)){Li=new Array(65536);for(var e=0;e<65536;e++)Li[e]=e>255?255+~~(e/255):e}}function Ri(e,t){var n=e.tokenTypeIdx;return n===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[n]===!0}function Oi(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var Fs=1,ks={};function Or(e){var t=qp(e);zp(t),Zp(t),Xp(t),k(t,function(n){n.isParent=n.categoryMatches.length>0})}function qp(e){for(var t=je(e),n=e,r=!0;r;){n=Lr(xe(P(n,function(a){return a.CATEGORIES})));var i=Ei(n,t);t=t.concat(i),Q(i)?r=!1:n=i}return t}function zp(e){k(e,function(t){xs(t)||(ks[Fs]=t,t.tokenTypeIdx=Fs++),js(t)&&!ct(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),js(t)||(t.CATEGORIES=[]),Qp(t)||(t.categoryMatches=[]),$p(t)||(t.categoryMatchesMap={})})}function Xp(e){k(e,function(t){t.categoryMatches=[],k(t.categoryMatchesMap,function(n,r){t.categoryMatches.push(ks[r].tokenTypeIdx)})})}function Zp(e){k(e,function(t){ws([],t)})}function ws(e,t){k(e,function(n){t.categoryMatchesMap[n.tokenTypeIdx]=!0}),k(t.CATEGORIES,function(n){var r=e.concat(t);fe(r,n)||ws(r,n)})}function xs(e){return G(e,"tokenTypeIdx")}function js(e){return G(e,"CATEGORIES")}function Qp(e){return G(e,"categoryMatches")}function $p(e){return G(e,"categoryMatchesMap")}function ed(e){return G(e,"tokenTypeIdx")}var Gs={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.")}},ae;(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"})(ae||(ae={}));var Ur={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Gs,traceInitPerf:!1,skipValidations:!1};Object.freeze(Ur);var ft=function(){function e(t,n){var r=this;if(n===void 0&&(n=Ur),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=Ss(Ur,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,s=!0;r.TRACE_INIT("Lexer Config handling",function(){if(r.config.lineTerminatorsPattern===Ur.lineTerminatorsPattern)r.config.lineTerminatorsPattern=Jp;else if(r.config.lineTerminatorCharacters===Ur.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),ct(t)?(a={modes:{}},a.modes[yn]=je(t),a[yn]=yn):(s=!1,a=Tr(t))}),r.config.skipValidations===!1&&(r.TRACE_INIT("performRuntimeChecks",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(Gp(a,r.trackStartLines,r.config.lineTerminatorCharacters))}),r.TRACE_INIT("performWarningRuntimeChecks",function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat(Vp(a,r.trackStartLines,r.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},k(a.modes,function(y,E){a.modes[E]=En(y,function(A){return et(A)})});var c=Mt(a.modes);if(k(a.modes,function(y,E){r.TRACE_INIT("Mode: <"+E+"> processing",function(){if(r.modes.push(E),r.config.skipValidations===!1&&r.TRACE_INIT("validatePatterns",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(Lp(y,c))}),Q(r.lexerDefinitionErrors)){Or(y);var A;r.TRACE_INIT("analyzeTokenTypes",function(){A=Tp(y,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:r.TRACE_INIT.bind(r)})}),r.patternIdxToConfig[E]=A.patternIdxToConfig,r.charCodeToPatternIdxToConfig[E]=A.charCodeToPatternIdxToConfig,r.emptyGroups=Ss(r.emptyGroups,A.emptyGroups),r.hasCustom=A.hasCustom||r.hasCustom,r.canModeBeOptimized[E]=A.canBeOptimized}})}),r.defaultMode=a.defaultMode,!Q(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var f=P(r.lexerDefinitionErrors,function(y){return y.message}),v=f.join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+v)}k(r.lexerDefinitionWarning,function(y){Ha(y.message)}),r.TRACE_INIT("Choosing sub-methods implementations",function(){if(Is?(r.chopInput=gs,r.match=r.matchWithTest):(r.updateLastIndex=ye,r.match=r.matchWithExec),s&&(r.handleModes=ye),r.trackStartLines===!1&&(r.computeNewColumn=gs),r.trackEndLines===!1&&(r.updateTokenEndLineColumnLocation=ye),/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 y=ge(r.canModeBeOptimized,function(E,A,O){return A===!1&&E.push(O),E},[]);if(n.ensureOptimizations&&!Q(y))throw Error("Lexer Modes: < "+y.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(){Dp()}),r.TRACE_INIT("toFastProperties",function(){Ls(r)})})}return e.prototype.tokenize=function(t,n){if(n===void 0&&(n=this.defaultMode),!Q(this.lexerDefinitionErrors)){var r=P(this.lexerDefinitionErrors,function(s){return s.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,s,c,f,v,y,E,A,O,L,m,R,g,U=t,B=U.length,V=0,me=0,ze=this.hasCustom?0:Math.floor(t.length/10),Ee=new Array(ze),We=[],Le=this.trackStartLines?1:void 0,Ae=this.trackStartLines?1:void 0,Re=Kp(this.emptyGroups),On=this.trackStartLines,Vt=this.config.lineTerminatorsPattern,Kt=0,Xe=[],Un=[],pr=[],qr=[];Object.freeze(qr);var cn=void 0;function Oa(){return Xe}function zr(Oe){var _n=en(Oe),Jt=Un[_n];return Jt===void 0?qr:Jt}var Ql=function(Oe){if(pr.length===1&&Oe.tokenType.PUSH_MODE===void 0){var _n=r.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Oe);We.push({offset:Oe.startOffset,line:Oe.startLine!==void 0?Oe.startLine:void 0,column:Oe.startColumn!==void 0?Oe.startColumn:void 0,length:Oe.image.length,message:_n})}else{pr.pop();var Jt=Ds(pr);Xe=r.patternIdxToConfig[Jt],Un=r.charCodeToPatternIdxToConfig[Jt],Kt=Xe.length;var $r=r.canModeBeOptimized[Jt]&&r.config.safeMode===!1;Un&&$r?cn=zr:cn=Oa}};function ln(Oe){pr.push(Oe),Un=this.charCodeToPatternIdxToConfig[Oe],Xe=this.patternIdxToConfig[Oe],Kt=Xe.length,Kt=Xe.length;var _n=this.canModeBeOptimized[Oe]&&this.config.safeMode===!1;Un&&_n?cn=zr:cn=Oa}ln.call(this,n);for(var Ze;V<B;){f=null;var Ua=U.charCodeAt(V),Xr=cn(Ua),dr=Xr.length;for(i=0;i<dr;i++){Ze=Xr[i];var Qe=Ze.pattern;v=null;var ue=Ze.short;if(ue!==!1?Ua===ue&&(f=Qe):Ze.isCustom===!0?(g=Qe.exec(U,V,Ee,Re),g!==null?(f=g[0],g.payload!==void 0&&(v=g.payload)):f=null):(this.updateLastIndex(Qe,V),f=this.match(Qe,t,V)),f!==null){if(c=Ze.longerAlt,c!==void 0){var Wt=Xe[c],fn=Wt.pattern;y=null,Wt.isCustom===!0?(g=fn.exec(U,V,Ee,Re),g!==null?(s=g[0],g.payload!==void 0&&(y=g.payload)):s=null):(this.updateLastIndex(fn,V),s=this.match(fn,t,V)),s&&s.length>f.length&&(f=s,v=y,Ze=Wt)}break}}if(f!==null){if(E=f.length,A=Ze.group,A!==void 0&&(O=Ze.tokenTypeIdx,L=this.createTokenInstance(f,V,O,Ze.tokenType,Le,Ae,E),this.handlePayload(L,v),A===!1?me=this.addToken(Ee,me,L):Re[A].push(L)),t=this.chopInput(t,E),V=V+E,Ae=this.computeNewColumn(Ae,E),On===!0&&Ze.canLineTerminator===!0){var Nn=0,hr=void 0,Zr=void 0;Vt.lastIndex=0;do hr=Vt.test(f),hr===!0&&(Zr=Vt.lastIndex-1,Nn++);while(hr===!0);Nn!==0&&(Le=Le+Nn,Ae=E-Zr,this.updateTokenEndLineColumnLocation(L,A,Zr,Nn,Le,Ae,E))}this.handleModes(Ze,Ql,ln,L)}else{for(var Qr=V,Na=Le,vr=Ae,In=!1;!In&&V<B;)for(U.charCodeAt(V),t=this.chopInput(t,1),V++,a=0;a<Kt;a++){var _t=Xe[a],Qe=_t.pattern,ue=_t.short;if(ue!==!1?U.charCodeAt(V)===ue&&(In=!0):_t.isCustom===!0?In=Qe.exec(U,V,Ee,Re)!==null:(this.updateLastIndex(Qe,V),In=Qe.exec(t)!==null),In===!0)break}m=V-Qr,R=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(U,Qr,m,Na,vr),We.push({offset:Qr,line:Na,column:vr,length:m,message:R})}}return this.hasCustom||(Ee.length=me),{tokens:Ee,groups:Re,errors:We}},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,s,c){var f,v;n!==void 0&&(f=r===c-1,v=f?-1:0,i===1&&f===!0||(t.endLine=a+v,t.endColumn=s-1+-v))},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,s){return{image:t,startOffset:n,startLine:a,startColumn:s,tokenTypeIdx:r,tokenType:i}},e.prototype.createFullToken=function(t,n,r,i,a,s,c){return{image:t,startOffset:n,endOffset:n+c-1,startLine:a,endLine:a,startColumn:s,endColumn:s+c-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=Rs(n),a=i.time,s=i.value,c=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(r+"<-- <"+t+"> time: "+a+"ms"),this.traceInitIndent--,s}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 Dn(e){return Vs(e)?e.LABEL:e.name}function td(e){return e.name}function Vs(e){return Lt(e.LABEL)&&e.LABEL!==""}var nd="parent",Ks="categories",Ws="label",Js="group",Hs="push_mode",Ys="pop_mode",qs="longer_alt",zs="line_breaks",Xs="start_chars_hint";function Za(e){return rd(e)}function rd(e){var t=e.pattern,n={};if(n.name=e.name,et(t)||(n.PATTERN=t),G(e,nd))throw`The parent property is no longer supported.
See: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.`;return G(e,Ks)&&(n.CATEGORIES=e[Ks]),Or([n]),G(e,Ws)&&(n.LABEL=e[Ws]),G(e,Js)&&(n.GROUP=e[Js]),G(e,Ys)&&(n.POP_MODE=e[Ys]),G(e,Hs)&&(n.PUSH_MODE=e[Hs]),G(e,qs)&&(n.LONGER_ALT=e[qs]),G(e,zs)&&(n.LINE_BREAKS=e[zs]),G(e,Xs)&&(n.START_CHARS_HINT=e[Xs]),n}var tn=Za({name:"EOF",pattern:ft.NA});Or([tn]);function Ui(e,t,n,r,i,a,s,c){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:s,endColumn:c,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function id(e,t){return Ri(e,t)}var Pt=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)}}(),Ot=function(){function e(t){this.definition=t}return e.prototype.accept=function(t){t.visit(this),k(this.definition,function(n){n.accept(t)})},e}(),_e=function(e){Pt(t,e);function t(n){var r=e.call(this,[])||this;return r.idx=1,lt(r,tt(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}(Ot),An=function(e){Pt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.orgText="",lt(r,tt(n,function(i){return i!==void 0})),r}return t}(Ot),Ne=function(e){Pt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.ignoreAmbiguities=!1,lt(r,tt(n,function(i){return i!==void 0})),r}return t}(Ot),pe=function(e){Pt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,lt(r,tt(n,function(i){return i!==void 0})),r}return t}(Ot),Ge=function(e){Pt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,lt(r,tt(n,function(i){return i!==void 0})),r}return t}(Ot),Ve=function(e){Pt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,lt(r,tt(n,function(i){return i!==void 0})),r}return t}(Ot),ie=function(e){Pt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,lt(r,tt(n,function(i){return i!==void 0})),r}return t}(Ot),be=function(e){Pt(t,e);function t(n){var r=e.call(this,n.definition)||this;return r.idx=1,lt(r,tt(n,function(i){return i!==void 0})),r}return t}(Ot),Me=function(e){Pt(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,tt(n,function(i){return i!==void 0})),r}return t}(Ot),te=function(){function e(t){this.idx=1,lt(this,tt(t,function(n){return n!==void 0}))}return e.prototype.accept=function(t){t.visit(this)},e}();function Zs(e){return P(e,Nr)}function Nr(e){function t(i){return P(i,Nr)}if(e instanceof _e)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof Ne)return{type:"Flat",definition:t(e.definition)};if(e instanceof pe)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Ge)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Ve)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:Nr(new te({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof be)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:Nr(new te({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ie)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Me)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof te){var n={type:"Terminal",name:e.terminalType.name,label:Dn(e.terminalType),idx:e.idx},r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=Bt(r)?r.source:r),n}else{if(e instanceof An)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}var Ni=function(){function e(){}return e.prototype.walk=function(t,n){var r=this;n===void 0&&(n=[]),k(t.definition,function(i,a){var s=Se(t.definition,a+1);if(i instanceof _e)r.walkProdRef(i,s,n);else if(i instanceof te)r.walkTerminal(i,s,n);else if(i instanceof Ne)r.walkFlat(i,s,n);else if(i instanceof pe)r.walkOption(i,s,n);else if(i instanceof Ge)r.walkAtLeastOne(i,s,n);else if(i instanceof Ve)r.walkAtLeastOneSep(i,s,n);else if(i instanceof be)r.walkManySep(i,s,n);else if(i instanceof ie)r.walkMany(i,s,n);else if(i instanceof Me)r.walkOr(i,s,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 pe({definition:t.definition})].concat(n,r);this.walk(t,i)},e.prototype.walkAtLeastOneSep=function(t,n,r){var i=Qs(t,n,r);this.walk(t,i)},e.prototype.walkMany=function(t,n,r){var i=[new pe({definition:t.definition})].concat(n,r);this.walk(t,i)},e.prototype.walkManySep=function(t,n,r){var i=Qs(t,n,r);this.walk(t,i)},e.prot