e==="Character";if(k){if(v.value=this.input.length)throw Error("Unexpected end of input");this.idx++},r.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,m){p.length!==void 0?p.forEach(function(y){m.push(y)}):m.push(p)}function o(p,m){if(p[m]===!0)throw"duplicate flag "+m;p[m]=!0}function a(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var f=[n(" "),n("\f"),n(` `),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function h(){}return h.prototype.visitChildren=function(p){for(var m in p){var y=p[m];p.hasOwnProperty(m)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(b){this.visit(b)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:r,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var UI=w(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});Cg.clearRegExpParserCache=Cg.getRegExpAst=void 0;var _me=OI(),MI={},Vme=new _me.RegExpParser;function Xme(r){var e=r.toString();if(MI.hasOwnProperty(e))return MI[e];var t=Vme.pattern(e);return MI[e]=t,t}Cg.getRegExpAst=Xme;function Zme(){MI={}}Cg.clearRegExpParserCache=Zme});var LH=w(Bn=>{"use strict";var $me=Bn&&Bn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.canMatchCharCode=Bn.firstCharOptimizedIndices=Bn.getOptimizedStartCodesIndices=Bn.failedOptimizationPrefixMsg=void 0;var DH=OI(),vs=Yt(),RH=UI(),Ga=wS(),FH="Complement Sets are not supported for first char optimization";Bn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations: `;function eEe(r,e){e===void 0&&(e=!1);try{var t=(0,RH.getRegExpAst)(r),i=KI(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===FH)e&&(0,vs.PRINT_WARNING)(""+Bn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+` > `)+` Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var n="";e&&(n=` This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,vs.PRINT_ERROR)(Bn.failedOptimizationPrefixMsg+` `+(" Failed parsing: < "+r.toString()+` > `)+(" Using the regexp-to-ast library version: "+DH.VERSION+` `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}Bn.getOptimizedStartCodesIndices=eEe;function KI(r,e,t){switch(r.type){case"Disjunction":for(var i=0;i=Ga.minOptimizationVal)for(var f=u.from>=Ga.minOptimizationVal?u.from:Ga.minOptimizationVal,h=u.to,p=(0,Ga.charCodeToOptimizedIndex)(f),m=(0,Ga.charCodeToOptimizedIndex)(h),y=p;y<=m;y++)e[y]=y}}});break;case"Group":KI(o.value,e,t);break;default:throw Error("Non Exhaustive Match")}var a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&BS(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return(0,vs.values)(e)}Bn.firstCharOptimizedIndices=KI;function HI(r,e,t){var i=(0,Ga.charCodeToOptimizedIndex)(r);e[i]=i,t===!0&&tEe(r,e)}function tEe(r,e){var t=String.fromCharCode(r),i=t.toUpperCase();if(i!==t){var n=(0,Ga.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=t.toLowerCase();if(s!==t){var n=(0,Ga.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function NH(r,e){return(0,vs.find)(r.value,function(t){if(typeof t=="number")return(0,vs.contains)(e,t);var i=t;return(0,vs.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function BS(r){return r.quantifier&&r.quantifier.atLeast===0?!0:r.value?(0,vs.isArray)(r.value)?(0,vs.every)(r.value,BS):BS(r.value):!1}var rEe=function(r){$me(e,r);function e(t){var i=r.call(this)||this;return i.targetCharCodes=t,i.found=!1,i}return e.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}r.prototype.visitChildren.call(this,t)}},e.prototype.visitCharacter=function(t){(0,vs.contains)(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?NH(t,this.targetCharCodes)===void 0&&(this.found=!0):NH(t,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(DH.BaseRegExpVisitor);function iEe(r,e){if(e instanceof RegExp){var t=(0,RH.getRegExpAst)(e),i=new rEe(r);return i.visit(t),i.found}else return(0,vs.find)(e,function(n){return(0,vs.contains)(r,n.charCodeAt(0))})!==void 0}Bn.canMatchCharCode=iEe});var wS=w(Ze=>{"use strict";var TH=Ze&&Ze.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.charCodeToOptimizedIndex=Ze.minOptimizationVal=Ze.buildLineBreakIssueMessage=Ze.LineTerminatorOptimizedTester=Ze.isShortPattern=Ze.isCustomPattern=Ze.cloneEmptyGroups=Ze.performWarningRuntimeChecks=Ze.performRuntimeChecks=Ze.addStickyFlag=Ze.addStartOfInput=Ze.findUnreachablePatterns=Ze.findModesThatDoNotExist=Ze.findInvalidGroupType=Ze.findDuplicatePatterns=Ze.findUnsupportedFlags=Ze.findStartOfInputAnchor=Ze.findEmptyMatchRegExps=Ze.findEndOfInputAnchor=Ze.findInvalidPatterns=Ze.findMissingPatterns=Ze.validatePatterns=Ze.analyzeTokenTypes=Ze.enableSticky=Ze.disableSticky=Ze.SUPPORT_STICKY=Ze.MODES=Ze.DEFAULT_MODE=void 0;var OH=OI(),Ar=Rp(),Ne=Yt(),mg=LH(),MH=UI(),Ko="PATTERN";Ze.DEFAULT_MODE="defaultMode";Ze.MODES="modes";Ze.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function nEe(){Ze.SUPPORT_STICKY=!1}Ze.disableSticky=nEe;function sEe(){Ze.SUPPORT_STICKY=!0}Ze.enableSticky=sEe;function aEe(r,e){e=(0,Ne.defaults)(e,{useSticky:Ze.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` `],tracer:function(v,k){return k()}});var t=e.tracer;t("initCharCodeToOptimizedIndexMap",function(){oEe()});var i;t("Reject Lexer.NA",function(){i=(0,Ne.reject)(r,function(v){return v[Ko]===Ar.Lexer.NA})});var n=!1,s;t("Transform Patterns",function(){n=!1,s=(0,Ne.map)(i,function(v){var k=v[Ko];if((0,Ne.isRegExp)(k)){var T=k.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!k.ignoreCase?T:T.length===2&&T[0]==="\\"&&!(0,Ne.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:e.useSticky?QS(k):bS(k)}else{if((0,Ne.isFunction)(k))return n=!0,{exec:k};if((0,Ne.has)(k,"exec"))return n=!0,k;if(typeof k=="string"){if(k.length===1)return k;var Y=k.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),q=new RegExp(Y);return e.useSticky?QS(q):bS(q)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;t("misc mapping",function(){o=(0,Ne.map)(i,function(v){return v.tokenTypeIdx}),a=(0,Ne.map)(i,function(v){var k=v.GROUP;if(k!==Ar.Lexer.SKIPPED){if((0,Ne.isString)(k))return k;if((0,Ne.isUndefined)(k))return!1;throw Error("non exhaustive match")}}),l=(0,Ne.map)(i,function(v){var k=v.LONGER_ALT;if(k){var T=(0,Ne.isArray)(k)?(0,Ne.map)(k,function(Y){return(0,Ne.indexOf)(i,Y)}):[(0,Ne.indexOf)(i,k)];return T}}),c=(0,Ne.map)(i,function(v){return v.PUSH_MODE}),u=(0,Ne.map)(i,function(v){return(0,Ne.has)(v,"POP_MODE")})});var g;t("Line Terminator Handling",function(){var v=HH(e.lineTerminatorCharacters);g=(0,Ne.map)(i,function(k){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,Ne.map)(i,function(k){if((0,Ne.has)(k,"LINE_BREAKS"))return k.LINE_BREAKS;if(KH(k,v)===!1)return(0,mg.canMatchCharCode)(v,k.PATTERN)}))});var f,h,p,m;t("Misc Mapping #2",function(){f=(0,Ne.map)(i,SS),h=(0,Ne.map)(s,UH),p=(0,Ne.reduce)(i,function(v,k){var T=k.GROUP;return(0,Ne.isString)(T)&&T!==Ar.Lexer.SKIPPED&&(v[T]=[]),v},{}),m=(0,Ne.map)(s,function(v,k){return{pattern:s[k],longerAlt:l[k],canLineTerminator:g[k],isCustom:f[k],short:h[k],group:a[k],push:c[k],pop:u[k],tokenTypeIdx:o[k],tokenType:i[k]}})});var y=!0,b=[];return e.safeMode||t("First Char Optimization",function(){b=(0,Ne.reduce)(i,function(v,k,T){if(typeof k.PATTERN=="string"){var Y=k.PATTERN.charCodeAt(0),q=kS(Y);vS(v,q,m[T])}else if((0,Ne.isArray)(k.START_CHARS_HINT)){var $;(0,Ne.forEach)(k.START_CHARS_HINT,function(ne){var ee=typeof ne=="string"?ne.charCodeAt(0):ne,A=kS(ee);$!==A&&($=A,vS(v,A,m[T]))})}else if((0,Ne.isRegExp)(k.PATTERN))if(k.PATTERN.unicode)y=!1,e.ensureOptimizations&&(0,Ne.PRINT_ERROR)(""+mg.failedOptimizationPrefixMsg+(" Unable to analyze < "+k.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://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var z=(0,mg.getOptimizedStartCodesIndices)(k.PATTERN,e.ensureOptimizations);(0,Ne.isEmpty)(z)&&(y=!1),(0,Ne.forEach)(z,function(ne){vS(v,ne,m[T])})}else e.ensureOptimizations&&(0,Ne.PRINT_ERROR)(""+mg.failedOptimizationPrefixMsg+(" TokenType: <"+k.name+`> is using a custom token pattern without providing parameter. `)+` This will disable the lexer's first char optimizations. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return v},[])}),t("ArrayPacking",function(){b=(0,Ne.packArray)(b)}),{emptyGroups:p,patternIdxToConfig:m,charCodeToPatternIdxToConfig:b,hasCustom:n,canBeOptimized:y}}Ze.analyzeTokenTypes=aEe;function lEe(r,e){var t=[],i=jH(r);t=t.concat(i.errors);var n=GH(i.valid),s=n.valid;return t=t.concat(n.errors),t=t.concat(AEe(s)),t=t.concat(YH(s)),t=t.concat(qH(s,e)),t=t.concat(JH(s)),t}Ze.validatePatterns=lEe;function AEe(r){var e=[],t=(0,Ne.filter)(r,function(i){return(0,Ne.isRegExp)(i[Ko])});return e=e.concat(WH(t)),e=e.concat(_H(t)),e=e.concat(VH(t)),e=e.concat(XH(t)),e=e.concat(zH(t)),e}function jH(r){var e=(0,Ne.filter)(r,function(n){return!(0,Ne.has)(n,Ko)}),t=(0,Ne.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:Ar.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,Ne.difference)(r,e);return{errors:t,valid:i}}Ze.findMissingPatterns=jH;function GH(r){var e=(0,Ne.filter)(r,function(n){var s=n[Ko];return!(0,Ne.isRegExp)(s)&&!(0,Ne.isFunction)(s)&&!(0,Ne.has)(s,"exec")&&!(0,Ne.isString)(s)}),t=(0,Ne.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ar.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,Ne.difference)(r,e);return{errors:t,valid:i}}Ze.findInvalidPatterns=GH;var cEe=/[^\\][\$]/;function WH(r){var e=function(n){TH(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitEndAnchor=function(o){this.found=!0},s}(OH.BaseRegExpVisitor),t=(0,Ne.filter)(r,function(n){var s=n[Ko];try{var o=(0,MH.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return cEe.test(s.source)}}),i=(0,Ne.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$' See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findEndOfInputAnchor=WH;function zH(r){var e=(0,Ne.filter)(r,function(i){var n=i[Ko];return n.test("")}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:Ar.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return t}Ze.findEmptyMatchRegExps=zH;var uEe=/[^\\[][\^]|^\^/;function _H(r){var e=function(n){TH(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitStartAnchor=function(o){this.found=!0},s}(OH.BaseRegExpVisitor),t=(0,Ne.filter)(r,function(n){var s=n[Ko];try{var o=(0,MH.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return uEe.test(s.source)}}),i=(0,Ne.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^' See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findStartOfInputAnchor=_H;function VH(r){var e=(0,Ne.filter)(r,function(i){var n=i[Ko];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ar.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}Ze.findUnsupportedFlags=VH;function XH(r){var e=[],t=(0,Ne.map)(r,function(s){return(0,Ne.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Ne.contains)(e,a)&&a.PATTERN!==Ar.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,Ne.compact)(t);var i=(0,Ne.filter)(t,function(s){return s.length>1}),n=(0,Ne.map)(i,function(s){var o=(0,Ne.map)(s,function(l){return l.name}),a=(0,Ne.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:Ar.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Ze.findDuplicatePatterns=XH;function YH(r){var e=(0,Ne.filter)(r,function(i){if(!(0,Ne.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==Ar.Lexer.SKIPPED&&n!==Ar.Lexer.NA&&!(0,Ne.isString)(n)}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ar.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}Ze.findInvalidGroupType=YH;function qH(r,e){var t=(0,Ne.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,Ne.contains)(e,n.PUSH_MODE)}),i=(0,Ne.map)(t,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:Ar.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Ze.findModesThatDoNotExist=qH;function JH(r){var e=[],t=(0,Ne.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===Ar.Lexer.NA||((0,Ne.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Ne.isRegExp)(o)&&fEe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Ne.forEach)(r,function(i,n){(0,Ne.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n"+i.name+"<-")+`in the lexer's definition. See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Ar.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}Ze.findUnreachablePatterns=JH;function gEe(r,e){if((0,Ne.isRegExp)(e)){var t=e.exec(r);return t!==null&&t.index===0}else{if((0,Ne.isFunction)(e))return e(r,0,[],{});if((0,Ne.has)(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}function fEe(r){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Ne.find)(e,function(t){return r.source.indexOf(t)!==-1})===void 0}function bS(r){var e=r.ignoreCase?"i":"";return new RegExp("^(?:"+r.source+")",e)}Ze.addStartOfInput=bS;function QS(r){var e=r.ignoreCase?"iy":"y";return new RegExp(""+r.source,e)}Ze.addStickyFlag=QS;function hEe(r,e,t){var i=[];return(0,Ne.has)(r,Ze.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.DEFAULT_MODE+`> property in its definition `,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Ne.has)(r,Ze.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.MODES+`> property in its definition `,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Ne.has)(r,Ze.MODES)&&(0,Ne.has)(r,Ze.DEFAULT_MODE)&&!(0,Ne.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Ze.DEFAULT_MODE+": <"+r.defaultMode+`>which does not exist `,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Ne.has)(r,Ze.MODES)&&(0,Ne.forEach)(r.modes,function(n,s){(0,Ne.forEach)(n,function(o,a){(0,Ne.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`> `),type:Ar.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Ze.performRuntimeChecks=hEe;function pEe(r,e,t){var i=[],n=!1,s=(0,Ne.compact)((0,Ne.flatten)((0,Ne.mapValues)(r.modes,function(l){return l}))),o=(0,Ne.reject)(s,function(l){return l[Ko]===Ar.Lexer.NA}),a=HH(t);return e&&(0,Ne.forEach)(o,function(l){var c=KH(l,a);if(c!==!1){var u=ZH(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Ne.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,mg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.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://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:Ar.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Ze.performWarningRuntimeChecks=pEe;function dEe(r){var e={},t=(0,Ne.keys)(r);return(0,Ne.forEach)(t,function(i){var n=r[i];if((0,Ne.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Ze.cloneEmptyGroups=dEe;function SS(r){var e=r.PATTERN;if((0,Ne.isRegExp)(e))return!1;if((0,Ne.isFunction)(e))return!0;if((0,Ne.has)(e,"exec"))return!0;if((0,Ne.isString)(e))return!1;throw Error("non exhaustive match")}Ze.isCustomPattern=SS;function UH(r){return(0,Ne.isString)(r)&&r.length===1?r.charCodeAt(0):!1}Ze.isShortPattern=UH;Ze.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type `)+(" Root cause: "+e.errMsg+`. `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===Ar.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. `+(" The problem is in the <"+r.name+`> Token Type `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Ze.buildLineBreakIssueMessage=ZH;function HH(r){var e=(0,Ne.map)(r,function(t){return(0,Ne.isString)(t)&&t.length>0?t.charCodeAt(0):t});return e}function vS(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}Ze.minOptimizationVal=256;var jI=[];function kS(r){return r255?255+~~(r/255):r}}});var Eg=w(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.isTokenType=Ft.hasExtendingTokensTypesMapProperty=Ft.hasExtendingTokensTypesProperty=Ft.hasCategoriesProperty=Ft.hasShortKeyProperty=Ft.singleAssignCategoriesToksMap=Ft.assignCategoriesMapProp=Ft.assignCategoriesTokensProp=Ft.assignTokenDefaultProps=Ft.expandCategories=Ft.augmentTokenTypes=Ft.tokenIdxToClass=Ft.tokenShortNameIdx=Ft.tokenStructuredMatcherNoCategories=Ft.tokenStructuredMatcher=void 0;var ii=Yt();function CEe(r,e){var t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}Ft.tokenStructuredMatcher=CEe;function mEe(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}Ft.tokenStructuredMatcherNoCategories=mEe;Ft.tokenShortNameIdx=1;Ft.tokenIdxToClass={};function EEe(r){var e=$H(r);ej(e),rj(e),tj(e),(0,ii.forEach)(e,function(t){t.isParent=t.categoryMatches.length>0})}Ft.augmentTokenTypes=EEe;function $H(r){for(var e=(0,ii.cloneArr)(r),t=r,i=!0;i;){t=(0,ii.compact)((0,ii.flatten)((0,ii.map)(t,function(s){return s.CATEGORIES})));var n=(0,ii.difference)(t,e);e=e.concat(n),(0,ii.isEmpty)(n)?i=!1:t=n}return e}Ft.expandCategories=$H;function ej(r){(0,ii.forEach)(r,function(e){ij(e)||(Ft.tokenIdxToClass[Ft.tokenShortNameIdx]=e,e.tokenTypeIdx=Ft.tokenShortNameIdx++),xS(e)&&!(0,ii.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),xS(e)||(e.CATEGORIES=[]),nj(e)||(e.categoryMatches=[]),sj(e)||(e.categoryMatchesMap={})})}Ft.assignTokenDefaultProps=ej;function tj(r){(0,ii.forEach)(r,function(e){e.categoryMatches=[],(0,ii.forEach)(e.categoryMatchesMap,function(t,i){e.categoryMatches.push(Ft.tokenIdxToClass[i].tokenTypeIdx)})})}Ft.assignCategoriesTokensProp=tj;function rj(r){(0,ii.forEach)(r,function(e){PS([],e)})}Ft.assignCategoriesMapProp=rj;function PS(r,e){(0,ii.forEach)(r,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),(0,ii.forEach)(e.CATEGORIES,function(t){var i=r.concat(e);(0,ii.contains)(i,t)||PS(i,t)})}Ft.singleAssignCategoriesToksMap=PS;function ij(r){return(0,ii.has)(r,"tokenTypeIdx")}Ft.hasShortKeyProperty=ij;function xS(r){return(0,ii.has)(r,"CATEGORIES")}Ft.hasCategoriesProperty=xS;function nj(r){return(0,ii.has)(r,"categoryMatches")}Ft.hasExtendingTokensTypesProperty=nj;function sj(r){return(0,ii.has)(r,"categoryMatchesMap")}Ft.hasExtendingTokensTypesMapProperty=sj;function IEe(r){return(0,ii.has)(r,"tokenTypeIdx")}Ft.isTokenType=IEe});var DS=w(GI=>{"use strict";Object.defineProperty(GI,"__esModule",{value:!0});GI.defaultLexerErrorProvider=void 0;GI.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(r){return"Unable to pop Lexer Mode after encountering Token ->"+r.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(r,e,t,i,n){return"unexpected character: ->"+r.charAt(e)+"<- at offset: "+e+","+(" skipped "+t+" characters.")}}});var Rp=w(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.Lexer=Pc.LexerDefinitionErrorType=void 0;var lo=wS(),lr=Yt(),yEe=Eg(),wEe=DS(),BEe=UI(),bEe;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",r[r.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",r[r.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",r[r.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",r[r.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",r[r.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",r[r.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",r[r.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",r[r.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(bEe=Pc.LexerDefinitionErrorType||(Pc.LexerDefinitionErrorType={}));var Fp={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:wEe.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(Fp);var QEe=function(){function r(e,t){var i=this;if(t===void 0&&(t=Fp),this.lexerDefinition=e,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 t=="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=(0,lr.merge)(Fp,t);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=Infinity,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var s,o=!0;i.TRACE_INIT("Lexer Config handling",function(){if(i.config.lineTerminatorsPattern===Fp.lineTerminatorsPattern)i.config.lineTerminatorsPattern=lo.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===Fp.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');i.trackStartLines=/full|onlyStart/i.test(i.config.positionTracking),i.trackEndLines=/full/i.test(i.config.positionTracking),(0,lr.isArray)(e)?(s={modes:{}},s.modes[lo.DEFAULT_MODE]=(0,lr.cloneArr)(e),s[lo.DEFAULT_MODE]=lo.DEFAULT_MODE):(o=!1,s=(0,lr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,lo.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,lo.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,lr.forEach)(s.modes,function(u,g){s.modes[g]=(0,lr.reject)(u,function(f){return(0,lr.isUndefined)(f)})});var a=(0,lr.keys)(s.modes);if((0,lr.forEach)(s.modes,function(u,g){i.TRACE_INIT("Mode: <"+g+"> processing",function(){if(i.modes.push(g),i.config.skipValidations===!1&&i.TRACE_INIT("validatePatterns",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,lo.validatePatterns)(u,a))}),(0,lr.isEmpty)(i.lexerDefinitionErrors)){(0,yEe.augmentTokenTypes)(u);var f;i.TRACE_INIT("analyzeTokenTypes",function(){f=(0,lo.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=f.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=f.charCodeToPatternIdxToConfig,i.emptyGroups=(0,lr.merge)(i.emptyGroups,f.emptyGroups),i.hasCustom=f.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=f.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,lr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,lr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: `+c)}(0,lr.forEach)(i.lexerDefinitionWarning,function(u){(0,lr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(lo.SUPPORT_STICKY?(i.chopInput=lr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=lr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=lr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=lr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=lr.NOOP),/full/i.test(i.config.positionTracking))i.createTokenInstance=i.createFullToken;else if(/onlyStart/i.test(i.config.positionTracking))i.createTokenInstance=i.createStartOnlyToken;else if(/onlyOffset/i.test(i.config.positionTracking))i.createTokenInstance=i.createOffsetOnlyToken;else throw Error('Invalid config option: "'+i.config.positionTracking+'"');i.hasCustom?(i.addToken=i.addTokenUsingPush,i.handlePayload=i.handlePayloadWithCustom):(i.addToken=i.addTokenUsingMemberAccess,i.handlePayload=i.handlePayloadNoCustom)}),i.TRACE_INIT("Failed Optimization Warnings",function(){var u=(0,lr.reduce)(i.canModeBeOptimized,function(g,f,h){return f===!1&&g.push(h),g},[]);if(t.ensureOptimizations&&!(0,lr.isEmpty)(u))throw Error("Lexer Modes: < "+u.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.`)}),i.TRACE_INIT("clearRegExpParserCache",function(){(0,BEe.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,lr.toFastProperties)(i)})})}return r.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!(0,lr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,lr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: `+n)}var s=this.tokenizeInternal(e,t);return s},r.prototype.tokenizeInternal=function(e,t){var i=this,n,s,o,a,l,c,u,g,f,h,p,m,y,b,v,k,T=e,Y=T.length,q=0,$=0,z=this.hasCustom?0:Math.floor(e.length/10),ne=new Array(z),ee=[],A=this.trackStartLines?1:void 0,oe=this.trackStartLines?1:void 0,ce=(0,lo.cloneEmptyGroups)(this.emptyGroups),Z=this.trackStartLines,O=this.config.lineTerminatorsPattern,L=0,de=[],Be=[],Ge=[],re=[];Object.freeze(re);var se=void 0;function be(){return de}function he(Sr){var Gn=(0,lo.charCodeToOptimizedIndex)(Sr),fs=Be[Gn];return fs===void 0?re:fs}var Fe=function(Sr){if(Ge.length===1&&Sr.tokenType.PUSH_MODE===void 0){var Gn=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Sr);ee.push({offset:Sr.startOffset,line:Sr.startLine!==void 0?Sr.startLine:void 0,column:Sr.startColumn!==void 0?Sr.startColumn:void 0,length:Sr.image.length,message:Gn})}else{Ge.pop();var fs=(0,lr.last)(Ge);de=i.patternIdxToConfig[fs],Be=i.charCodeToPatternIdxToConfig[fs],L=de.length;var Qa=i.canModeBeOptimized[fs]&&i.config.safeMode===!1;Be&&Qa?se=he:se=be}};function Ue(Sr){Ge.push(Sr),Be=this.charCodeToPatternIdxToConfig[Sr],de=this.patternIdxToConfig[Sr],L=de.length,L=de.length;var Gn=this.canModeBeOptimized[Sr]&&this.config.safeMode===!1;Be&&Gn?se=he:se=be}Ue.call(this,t);for(var xe;qc.length){c=a,u=g,xe=gt;break}}}break}}if(c!==null){if(f=c.length,h=xe.group,h!==void 0&&(p=xe.tokenTypeIdx,m=this.createTokenInstance(c,q,p,xe.tokenType,A,oe,f),this.handlePayload(m,u),h===!1?$=this.addToken(ne,$,m):ce[h].push(m)),e=this.chopInput(e,f),q=q+f,oe=this.computeNewColumn(oe,f),Z===!0&&xe.canLineTerminator===!0){var Mt=0,Ei=void 0,jt=void 0;O.lastIndex=0;do Ei=O.test(c),Ei===!0&&(jt=O.lastIndex-1,Mt++);while(Ei===!0);Mt!==0&&(A=A+Mt,oe=f-jt,this.updateTokenEndLineColumnLocation(m,h,jt,Mt,A,oe,f))}this.handleModes(xe,Fe,Ue,m)}else{for(var Qr=q,Oi=A,$s=oe,Hn=!1;!Hn&&q <"+e+">");var n=(0,lr.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r.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.",r.NA=/NOT_APPLICABLE/,r}();Pc.Lexer=QEe});var ZA=w(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.tokenMatcher=Pi.createTokenInstance=Pi.EOF=Pi.createToken=Pi.hasTokenLabel=Pi.tokenName=Pi.tokenLabel=void 0;var co=Yt(),SEe=Rp(),RS=Eg();function vEe(r){return oj(r)?r.LABEL:r.name}Pi.tokenLabel=vEe;function kEe(r){return r.name}Pi.tokenName=kEe;function oj(r){return(0,co.isString)(r.LABEL)&&r.LABEL!==""}Pi.hasTokenLabel=oj;var xEe="parent",aj="categories",Aj="label",lj="group",cj="push_mode",uj="pop_mode",gj="longer_alt",fj="line_breaks",hj="start_chars_hint";function pj(r){return PEe(r)}Pi.createToken=pj;function PEe(r){var e=r.pattern,t={};if(t.name=r.name,(0,co.isUndefined)(e)||(t.PATTERN=e),(0,co.has)(r,xEe))throw`The parent property is no longer supported. See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,co.has)(r,aj)&&(t.CATEGORIES=r[aj]),(0,RS.augmentTokenTypes)([t]),(0,co.has)(r,Aj)&&(t.LABEL=r[Aj]),(0,co.has)(r,lj)&&(t.GROUP=r[lj]),(0,co.has)(r,uj)&&(t.POP_MODE=r[uj]),(0,co.has)(r,cj)&&(t.PUSH_MODE=r[cj]),(0,co.has)(r,gj)&&(t.LONGER_ALT=r[gj]),(0,co.has)(r,fj)&&(t.LINE_BREAKS=r[fj]),(0,co.has)(r,hj)&&(t.START_CHARS_HINT=r[hj]),t}Pi.EOF=pj({name:"EOF",pattern:SEe.Lexer.NA});(0,RS.augmentTokenTypes)([Pi.EOF]);function DEe(r,e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}Pi.createTokenInstance=DEe;function REe(r,e){return(0,RS.tokenStructuredMatcher)(r,e)}Pi.tokenMatcher=REe});var bn=w(Vt=>{"use strict";var Ya=Vt&&Vt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.serializeProduction=Vt.serializeGrammar=Vt.Terminal=Vt.Alternation=Vt.RepetitionWithSeparator=Vt.Repetition=Vt.RepetitionMandatoryWithSeparator=Vt.RepetitionMandatory=Vt.Option=Vt.Alternative=Vt.Rule=Vt.NonTerminal=Vt.AbstractProduction=void 0;var fr=Yt(),FEe=ZA(),Ho=function(){function r(e){this._definition=e}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this),(0,fr.forEach)(this.definition,function(t){t.accept(e)})},r}();Vt.AbstractProduction=Ho;var dj=function(r){Ya(e,r);function e(t){var i=r.call(this,[])||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(Ho);Vt.NonTerminal=dj;var Cj=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.orgText="",(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ho);Vt.Rule=Cj;var mj=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.ignoreAmbiguities=!1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ho);Vt.Alternative=mj;var Ej=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ho);Vt.Option=Ej;var Ij=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ho);Vt.RepetitionMandatory=Ij;var yj=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ho);Vt.RepetitionMandatoryWithSeparator=yj;var wj=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ho);Vt.Repetition=wj;var Bj=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ho);Vt.RepetitionWithSeparator=Bj;var bj=function(r){Ya(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition=t},enumerable:!1,configurable:!0}),e}(Ho);Vt.Alternation=bj;var YI=function(){function r(e){this.idx=1,(0,fr.assign)(this,(0,fr.pick)(e,function(t){return t!==void 0}))}return r.prototype.accept=function(e){e.visit(this)},r}();Vt.Terminal=YI;function NEe(r){return(0,fr.map)(r,Np)}Vt.serializeGrammar=NEe;function Np(r){function e(s){return(0,fr.map)(s,Np)}if(r instanceof dj){var t={type:"NonTerminal",name:r.nonTerminalName,idx:r.idx};return(0,fr.isString)(r.label)&&(t.label=r.label),t}else{if(r instanceof mj)return{type:"Alternative",definition:e(r.definition)};if(r instanceof Ej)return{type:"Option",idx:r.idx,definition:e(r.definition)};if(r instanceof Ij)return{type:"RepetitionMandatory",idx:r.idx,definition:e(r.definition)};if(r instanceof yj)return{type:"RepetitionMandatoryWithSeparator",idx:r.idx,separator:Np(new YI({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof Bj)return{type:"RepetitionWithSeparator",idx:r.idx,separator:Np(new YI({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof wj)return{type:"Repetition",idx:r.idx,definition:e(r.definition)};if(r instanceof bj)return{type:"Alternation",idx:r.idx,definition:e(r.definition)};if(r instanceof YI){var i={type:"Terminal",name:r.terminalType.name,label:(0,FEe.tokenLabel)(r.terminalType),idx:r.idx};(0,fr.isString)(r.label)&&(i.terminalLabel=r.label);var n=r.terminalType.PATTERN;return r.terminalType.PATTERN&&(i.pattern=(0,fr.isRegExp)(n)?n.source:n),i}else{if(r instanceof Cj)return{type:"Rule",name:r.name,orgText:r.orgText,definition:e(r.definition)};throw Error("non exhaustive match")}}}Vt.serializeProduction=Np});var JI=w(qI=>{"use strict";Object.defineProperty(qI,"__esModule",{value:!0});qI.RestWalker=void 0;var FS=Yt(),Qn=bn(),LEe=function(){function r(){}return r.prototype.walk=function(e,t){var i=this;t===void 0&&(t=[]),(0,FS.forEach)(e.definition,function(n,s){var o=(0,FS.drop)(e.definition,s+1);if(n instanceof Qn.NonTerminal)i.walkProdRef(n,o,t);else if(n instanceof Qn.Terminal)i.walkTerminal(n,o,t);else if(n instanceof Qn.Alternative)i.walkFlat(n,o,t);else if(n instanceof Qn.Option)i.walkOption(n,o,t);else if(n instanceof Qn.RepetitionMandatory)i.walkAtLeastOne(n,o,t);else if(n instanceof Qn.RepetitionMandatoryWithSeparator)i.walkAtLeastOneSep(n,o,t);else if(n instanceof Qn.RepetitionWithSeparator)i.walkManySep(n,o,t);else if(n instanceof Qn.Repetition)i.walkMany(n,o,t);else if(n instanceof Qn.Alternation)i.walkOr(n,o,t);else throw Error("non exhaustive match")})},r.prototype.walkTerminal=function(e,t,i){},r.prototype.walkProdRef=function(e,t,i){},r.prototype.walkFlat=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkOption=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkAtLeastOne=function(e,t,i){var n=[new Qn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkAtLeastOneSep=function(e,t,i){var n=Qj(e,t,i);this.walk(e,n)},r.prototype.walkMany=function(e,t,i){var n=[new Qn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkManySep=function(e,t,i){var n=Qj(e,t,i);this.walk(e,n)},r.prototype.walkOr=function(e,t,i){var n=this,s=t.concat(i);(0,FS.forEach)(e.definition,function(o){var a=new Qn.Alternative({definition:[o]});n.walk(a,s)})},r}();qI.RestWalker=LEe;function Qj(r,e,t){var i=[new Qn.Option({definition:[new Qn.Terminal({terminalType:r.separator})].concat(r.definition)})],n=i.concat(e,t);return n}});var Ig=w(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.GAstVisitor=void 0;var jo=bn(),TEe=function(){function r(){}return r.prototype.visit=function(e){var t=e;switch(t.constructor){case jo.NonTerminal:return this.visitNonTerminal(t);case jo.Alternative:return this.visitAlternative(t);case jo.Option:return this.visitOption(t);case jo.RepetitionMandatory:return this.visitRepetitionMandatory(t);case jo.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case jo.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case jo.Repetition:return this.visitRepetition(t);case jo.Alternation:return this.visitAlternation(t);case jo.Terminal:return this.visitTerminal(t);case jo.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},r.prototype.visitNonTerminal=function(e){},r.prototype.visitAlternative=function(e){},r.prototype.visitOption=function(e){},r.prototype.visitRepetition=function(e){},r.prototype.visitRepetitionMandatory=function(e){},r.prototype.visitRepetitionMandatoryWithSeparator=function(e){},r.prototype.visitRepetitionWithSeparator=function(e){},r.prototype.visitAlternation=function(e){},r.prototype.visitTerminal=function(e){},r.prototype.visitRule=function(e){},r}();WI.GAstVisitor=TEe});var Tp=w(Gi=>{"use strict";var OEe=Gi&&Gi.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Gi,"__esModule",{value:!0});Gi.collectMethods=Gi.DslMethodsCollectorVisitor=Gi.getProductionDslName=Gi.isBranchingProd=Gi.isOptionalProd=Gi.isSequenceProd=void 0;var Lp=Yt(),kr=bn(),MEe=Ig();function UEe(r){return r instanceof kr.Alternative||r instanceof kr.Option||r instanceof kr.Repetition||r instanceof kr.RepetitionMandatory||r instanceof kr.RepetitionMandatoryWithSeparator||r instanceof kr.RepetitionWithSeparator||r instanceof kr.Terminal||r instanceof kr.Rule}Gi.isSequenceProd=UEe;function NS(r,e){e===void 0&&(e=[]);var t=r instanceof kr.Option||r instanceof kr.Repetition||r instanceof kr.RepetitionWithSeparator;return t?!0:r instanceof kr.Alternation?(0,Lp.some)(r.definition,function(i){return NS(i,e)}):r instanceof kr.NonTerminal&&(0,Lp.contains)(e,r)?!1:r instanceof kr.AbstractProduction?(r instanceof kr.NonTerminal&&e.push(r),(0,Lp.every)(r.definition,function(i){return NS(i,e)})):!1}Gi.isOptionalProd=NS;function KEe(r){return r instanceof kr.Alternation}Gi.isBranchingProd=KEe;function HEe(r){if(r instanceof kr.NonTerminal)return"SUBRULE";if(r instanceof kr.Option)return"OPTION";if(r instanceof kr.Alternation)return"OR";if(r instanceof kr.RepetitionMandatory)return"AT_LEAST_ONE";if(r instanceof kr.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(r instanceof kr.RepetitionWithSeparator)return"MANY_SEP";if(r instanceof kr.Repetition)return"MANY";if(r instanceof kr.Terminal)return"CONSUME";throw Error("non exhaustive match")}Gi.getProductionDslName=HEe;var Sj=function(r){OEe(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(t){var i=t.terminalType.name+this.separator+"Terminal";(0,Lp.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitNonTerminal=function(t){var i=t.nonTerminalName+this.separator+"Terminal";(0,Lp.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(MEe.GAstVisitor);Gi.DslMethodsCollectorVisitor=Sj;var zI=new Sj;function jEe(r){zI.reset(),r.accept(zI);var e=zI.dslMethods;return zI.reset(),e}Gi.collectMethods=jEe});var TS=w(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.firstForTerminal=Go.firstForBranching=Go.firstForSequence=Go.first=void 0;var _I=Yt(),vj=bn(),LS=Tp();function VI(r){if(r instanceof vj.NonTerminal)return VI(r.referencedRule);if(r instanceof vj.Terminal)return Pj(r);if((0,LS.isSequenceProd)(r))return kj(r);if((0,LS.isBranchingProd)(r))return xj(r);throw Error("non exhaustive match")}Go.first=VI;function kj(r){for(var e=[],t=r.definition,i=0,n=t.length>i,s,o=!0;n&&o;)s=t[i],o=(0,LS.isOptionalProd)(s),e=e.concat(VI(s)),i=i+1,n=t.length>i;return(0,_I.uniq)(e)}Go.firstForSequence=kj;function xj(r){var e=(0,_I.map)(r.definition,function(t){return VI(t)});return(0,_I.uniq)((0,_I.flatten)(e))}Go.firstForBranching=xj;function Pj(r){return[r.terminalType]}Go.firstForTerminal=Pj});var OS=w(XI=>{"use strict";Object.defineProperty(XI,"__esModule",{value:!0});XI.IN=void 0;XI.IN="_~IN~_"});var Lj=w(ks=>{"use strict";var GEe=ks&&ks.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(ks,"__esModule",{value:!0});ks.buildInProdFollowPrefix=ks.buildBetweenProdsFollowPrefix=ks.computeAllProdsFollows=ks.ResyncFollowsWalker=void 0;var YEe=JI(),qEe=TS(),Dj=Yt(),Rj=OS(),JEe=bn(),Nj=function(r){GEe(e,r);function e(t){var i=r.call(this)||this;return i.topProd=t,i.follows={},i}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(t,i,n){},e.prototype.walkProdRef=function(t,i,n){var s=Fj(t.referencedRule,t.idx)+this.topProd.name,o=i.concat(n),a=new JEe.Alternative({definition:o}),l=(0,qEe.first)(a);this.follows[s]=l},e}(YEe.RestWalker);ks.ResyncFollowsWalker=Nj;function WEe(r){var e={};return(0,Dj.forEach)(r,function(t){var i=new Nj(t).startWalking();(0,Dj.assign)(e,i)}),e}ks.computeAllProdsFollows=WEe;function Fj(r,e){return r.name+e+Rj.IN}ks.buildBetweenProdsFollowPrefix=Fj;function zEe(r){var e=r.terminalType.name;return e+r.idx+Rj.IN}ks.buildInProdFollowPrefix=zEe});var Op=w(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.defaultGrammarValidatorErrorProvider=qa.defaultGrammarResolverErrorProvider=qa.defaultParserErrorProvider=void 0;var yg=ZA(),_Ee=Yt(),uo=Yt(),MS=bn(),Tj=Tp();qa.defaultParserErrorProvider={buildMismatchTokenMessage:function(r){var e=r.expected,t=r.actual,i=r.previous,n=r.ruleName,s=(0,yg.hasTokenLabel)(e),o=s?"--> "+(0,yg.tokenLabel)(e)+" <--":"token of type --> "+e.name+" <--",a="Expecting "+o+" but found --> '"+t.image+"' <--";return a},buildNotAllInputParsedMessage:function(r){var e=r.firstRedundant,t=r.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(r){var e=r.expectedPathsPerAlt,t=r.actual,i=r.previous,n=r.customUserDescription,s=r.ruleName,o="Expecting: ",a=(0,uo.first)(t).image,l=` but found: '`+a+"'";if(n)return o+n+l;var c=(0,uo.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,uo.map)(c,function(h){return"["+(0,uo.map)(h,function(p){return(0,yg.tokenLabel)(p)}).join(", ")+"]"}),g=(0,uo.map)(u,function(h,p){return" "+(p+1)+". "+h}),f=`one of these possible Token sequences: `+g.join(` `);return o+f+l},buildEarlyExitMessage:function(r){var e=r.expectedIterationPaths,t=r.actual,i=r.customUserDescription,n=r.ruleName,s="Expecting: ",o=(0,uo.first)(t).image,a=` but found: '`+o+"'";if(i)return s+i+a;var l=(0,uo.map)(e,function(u){return"["+(0,uo.map)(u,function(g){return(0,yg.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(qa.defaultParserErrorProvider);qa.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+r.name+"<-";return t}};qa.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof MS.Terminal?u.terminalType.name:u instanceof MS.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,uo.first)(e),s=n.idx,o=(0,Tj.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` `),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. `+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. `)+`To resolve this make sure each Terminal and Non-Terminal names are unique This is easy to accomplish by using the convention that Terminal names start with an uppercase letter and Non-Terminal names start with a lower case letter.`;return e},buildAlternationPrefixAmbiguityError:function(r){var e=(0,uo.map)(r.prefixPath,function(n){return(0,yg.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous alternatives: <"+r.ambiguityIndices.join(" ,")+`> due to common lookahead prefix `+("in inside <"+r.topLevelRule.name+`> Rule, `)+("<"+e+`> may appears as a prefix path in all these alternatives. `)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX For Further details.`;return i},buildAlternationAmbiguityError:function(r){var e=(0,uo.map)(r.prefixPath,function(n){return(0,yg.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous Alternatives Detected: <"+r.ambiguityIndices.join(" ,")+"> in "+(" inside <"+r.topLevelRule.name+`> Rule, `)+("<"+e+`> may appears as a prefix path in all these alternatives. `);return i=i+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES For Further details.`,i},buildEmptyRepetitionError:function(r){var e=(0,Tj.getProductionDslName)(r.repetition);r.repetition.idx!==0&&(e+=r.repetition.idx);var t="The repetition <"+e+"> within Rule <"+r.topLevelRule.name+`> can never consume any tokens. This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in inside <"+r.topLevelRule.name+`> Rule. `)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`An Alternation cannot have more than 256 alternatives: `+(" inside <"+r.topLevelRule.name+`> Rule. has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=_Ee.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. `+("rule: <"+e+`> can be invoked from itself (directly or indirectly) `)+(`without consuming any Tokens. The grammar path that causes this is: `+i+` `)+` To fix this refactor your grammar to remove the left recursion. see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof MS.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var Uj=w($A=>{"use strict";var VEe=$A&&$A.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty($A,"__esModule",{value:!0});$A.GastRefResolverVisitor=$A.resolveGrammar=void 0;var XEe=es(),Oj=Yt(),ZEe=Ig();function $Ee(r,e){var t=new Mj(r,e);return t.resolveRefs(),t.errors}$A.resolveGrammar=$Ee;var Mj=function(r){VEe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,Oj.forEach)((0,Oj.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:XEe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(ZEe.GAstVisitor);$A.GastRefResolverVisitor=Mj});var Up=w(Ur=>{"use strict";var Dc=Ur&&Ur.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ur,"__esModule",{value:!0});Ur.nextPossibleTokensAfter=Ur.possiblePathsFrom=Ur.NextTerminalAfterAtLeastOneSepWalker=Ur.NextTerminalAfterAtLeastOneWalker=Ur.NextTerminalAfterManySepWalker=Ur.NextTerminalAfterManyWalker=Ur.AbstractNextTerminalAfterProductionWalker=Ur.NextAfterTokenWalker=Ur.AbstractNextPossibleTokensWalker=void 0;var Kj=JI(),Ut=Yt(),eIe=TS(),Dt=bn(),Hj=function(r){Dc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Ut.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Ut.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Ut.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(Kj.RestWalker);Ur.AbstractNextPossibleTokensWalker=Hj;var tIe=function(r){Dc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new Dt.Alternative({definition:s});this.possibleTokTypes=(0,eIe.first)(o),this.found=!0}},e}(Hj);Ur.NextAfterTokenWalker=tIe;var Mp=function(r){Dc(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(Kj.RestWalker);Ur.AbstractNextTerminalAfterProductionWalker=Mp;var rIe=function(r){Dc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(Mp);Ur.NextTerminalAfterManyWalker=rIe;var iIe=function(r){Dc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(Mp);Ur.NextTerminalAfterManySepWalker=iIe;var nIe=function(r){Dc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(Mp);Ur.NextTerminalAfterAtLeastOneWalker=nIe;var sIe=function(r){Dc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(Mp);Ur.NextTerminalAfterAtLeastOneSepWalker=sIe;function jj(r,e,t){t===void 0&&(t=[]),t=(0,Ut.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Ut.drop)(r,n+1))}function o(c){var u=jj(s(c),e,t);return i.concat(u)}for(;t.length=0;ce--){var Z=b.definition[ce],O={idx:p,def:Z.definition.concat((0,Ut.drop)(h)),ruleStack:m,occurrenceStack:y};g.push(O),g.push(o)}else if(b instanceof Dt.Alternative)g.push({idx:p,def:b.definition.concat((0,Ut.drop)(h)),ruleStack:m,occurrenceStack:y});else if(b instanceof Dt.Rule)g.push(oIe(b,p,m,y));else throw Error("non exhaustive match")}}return u}Ur.nextPossibleTokensAfter=aIe;function oIe(r,e,t,i){var n=(0,Ut.cloneArr)(t);n.push(r.name);var s=(0,Ut.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var Kp=w(tr=>{"use strict";var Gj=tr&&tr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(tr,"__esModule",{value:!0});tr.areTokenCategoriesNotUsed=tr.isStrictPrefixOfPath=tr.containsPath=tr.getLookaheadPathsForOptionalProd=tr.getLookaheadPathsForOr=tr.lookAheadSequenceFromAlternatives=tr.buildSingleAlternativeLookaheadFunction=tr.buildAlternativesLookAheadFunc=tr.buildLookaheadFuncForOptionalProd=tr.buildLookaheadFuncForOr=tr.getProdType=tr.PROD_TYPE=void 0;var cr=Yt(),Yj=Up(),AIe=JI(),ZI=Eg(),el=bn(),lIe=Ig(),ui;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(ui=tr.PROD_TYPE||(tr.PROD_TYPE={}));function cIe(r){if(r instanceof el.Option)return ui.OPTION;if(r instanceof el.Repetition)return ui.REPETITION;if(r instanceof el.RepetitionMandatory)return ui.REPETITION_MANDATORY;if(r instanceof el.RepetitionMandatoryWithSeparator)return ui.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof el.RepetitionWithSeparator)return ui.REPETITION_WITH_SEPARATOR;if(r instanceof el.Alternation)return ui.ALTERNATION;throw Error("non exhaustive match")}tr.getProdType=cIe;function uIe(r,e,t,i,n,s){var o=qj(r,e,t),a=US(o)?ZI.tokenStructuredMatcherNoCategories:ZI.tokenStructuredMatcher;return s(o,i,a,n)}tr.buildLookaheadFuncForOr=uIe;function gIe(r,e,t,i,n,s){var o=Jj(r,e,n,t),a=US(o)?ZI.tokenStructuredMatcherNoCategories:ZI.tokenStructuredMatcher;return s(o[0],a,i)}tr.buildLookaheadFuncForOptionalProd=gIe;function fIe(r,e,t,i){var n=r.length,s=(0,cr.every)(r,function(l){return(0,cr.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,cr.map)(l,function(k){return k.GATE}),u=0;u{"use strict";var jS=Xt&&Xt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Xt,"__esModule",{value:!0});Xt.checkPrefixAlternativesAmbiguities=Xt.validateSomeNonEmptyLookaheadPath=Xt.validateTooManyAlts=Xt.RepetionCollector=Xt.validateAmbiguousAlternationAlternatives=Xt.validateEmptyOrAlternative=Xt.getFirstNoneTerminal=Xt.validateNoLeftRecursion=Xt.validateRuleIsOverridden=Xt.validateRuleDoesNotAlreadyExist=Xt.OccurrenceValidationCollector=Xt.identifyProductionForDuplicates=Xt.validateGrammar=void 0;var nr=Yt(),xr=Yt(),Yo=es(),GS=Tp(),wg=Kp(),mIe=Up(),go=bn(),YS=Ig();function yIe(r,e,t,i,n){var s=nr.map(r,function(h){return EIe(h,i)}),o=nr.map(r,function(h){return qS(h,h,i)}),a=[],l=[],c=[];(0,xr.every)(o,xr.isEmpty)&&(a=(0,xr.map)(r,function(h){return Xj(h,i)}),l=(0,xr.map)(r,function(h){return Zj(h,e,i)}),c=eG(r,e,i));var u=IIe(r,t,i),g=(0,xr.map)(r,function(h){return $j(h,i)}),f=(0,xr.map)(r,function(h){return Vj(h,r,n,i)});return nr.flatten(s.concat(c,o,a,l,u,g,f))}Xt.validateGrammar=yIe;function EIe(r,e){var t=new iG;r.accept(t);var i=t.allProductions,n=nr.groupBy(i,tG),s=nr.pick(n,function(a){return a.length>1}),o=nr.map(nr.values(s),function(a){var l=nr.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,GS.getProductionDslName)(l),g={message:c,type:Yo.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},f=rG(l);return f&&(g.parameter=f),g});return o}function tG(r){return(0,GS.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+rG(r)}Xt.identifyProductionForDuplicates=tG;function rG(r){return r instanceof go.Terminal?r.terminalType.name:r instanceof go.NonTerminal?r.nonTerminalName:""}var iG=function(r){jS(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(YS.GAstVisitor);Xt.OccurrenceValidationCollector=iG;function Vj(r,e,t,i){var n=[],s=(0,xr.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:Yo.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}Xt.validateRuleDoesNotAlreadyExist=Vj;function wIe(r,e,t){var i=[],n;return nr.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:Yo.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}Xt.validateRuleIsOverridden=wIe;function qS(r,e,t,i){i===void 0&&(i=[]);var n=[],s=Hp(e.definition);if(nr.isEmpty(s))return[];var o=r.name,a=nr.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:Yo.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=nr.difference(s,i.concat([r])),c=nr.map(l,function(u){var g=nr.cloneArr(i);return g.push(u),qS(r,u,t,g)});return n.concat(nr.flatten(c))}Xt.validateNoLeftRecursion=qS;function Hp(r){var e=[];if(nr.isEmpty(r))return e;var t=nr.first(r);if(t instanceof go.NonTerminal)e.push(t.referencedRule);else if(t instanceof go.Alternative||t instanceof go.Option||t instanceof go.RepetitionMandatory||t instanceof go.RepetitionMandatoryWithSeparator||t instanceof go.RepetitionWithSeparator||t instanceof go.Repetition)e=e.concat(Hp(t.definition));else if(t instanceof go.Alternation)e=nr.flatten(nr.map(t.definition,function(o){return Hp(o.definition)}));else if(!(t instanceof go.Terminal))throw Error("non exhaustive match");var i=(0,GS.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=nr.drop(r);return e.concat(Hp(s))}else return e}Xt.getFirstNoneTerminal=Hp;var JS=function(r){jS(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(YS.GAstVisitor);function Xj(r,e){var t=new JS;r.accept(t);var i=t.alternations,n=nr.reduce(i,function(s,o){var a=nr.dropRight(o.definition),l=nr.map(a,function(c,u){var g=(0,mIe.nextPossibleTokensAfter)([c],[],null,1);return nr.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:Yo.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(nr.compact(l))},[]);return n}Xt.validateEmptyOrAlternative=Xj;function Zj(r,e,t){var i=new JS;r.accept(i);var n=i.alternations;n=(0,xr.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=nr.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,wg.getLookaheadPathsForOr)(l,r,c,a),g=BIe(u,a,r,t),f=nG(u,a,r,t);return o.concat(g,f)},[]);return s}Xt.validateAmbiguousAlternationAlternatives=Zj;var sG=function(r){jS(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(YS.GAstVisitor);Xt.RepetionCollector=sG;function $j(r,e){var t=new JS;r.accept(t);var i=t.alternations,n=nr.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:Yo.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}Xt.validateTooManyAlts=$j;function eG(r,e,t){var i=[];return(0,xr.forEach)(r,function(n){var s=new sG;n.accept(s);var o=s.allProductions;(0,xr.forEach)(o,function(a){var l=(0,wg.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,wg.getLookaheadPathsForOptionalProd)(u,n,l,c),f=g[0];if((0,xr.isEmpty)((0,xr.flatten)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:h,type:Yo.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}Xt.validateSomeNonEmptyLookaheadPath=eG;function BIe(r,e,t,i){var n=[],s=(0,xr.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,xr.forEach)(l,function(u){var g=[c];(0,xr.forEach)(r,function(f,h){c!==h&&(0,wg.containsPath)(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&g.push(h)}),g.length>1&&!(0,wg.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=nr.map(s,function(a){var l=(0,xr.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:Yo.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function nG(r,e,t,i){var n=[],s=(0,xr.reduce)(r,function(o,a,l){var c=(0,xr.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,xr.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,xr.findAll)(s,function(f){return e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.validateGrammar=Bg.resolveGrammar=void 0;var zS=Yt(),bIe=Uj(),QIe=WS(),oG=Op();function SIe(r){r=(0,zS.defaults)(r,{errMsgProvider:oG.defaultGrammarResolverErrorProvider});var e={};return(0,zS.forEach)(r.rules,function(t){e[t.name]=t}),(0,bIe.resolveGrammar)(e,r.errMsgProvider)}Bg.resolveGrammar=SIe;function vIe(r){return r=(0,zS.defaults)(r,{errMsgProvider:oG.defaultGrammarValidatorErrorProvider}),(0,QIe.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}Bg.validateGrammar=vIe});var bg=w(Sn=>{"use strict";var jp=Sn&&Sn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Sn,"__esModule",{value:!0});Sn.EarlyExitException=Sn.NotAllInputParsedException=Sn.NoViableAltException=Sn.MismatchedTokenException=Sn.isRecognitionException=void 0;var kIe=Yt(),AG="MismatchedTokenException",lG="NoViableAltException",cG="EarlyExitException",uG="NotAllInputParsedException",gG=[AG,lG,cG,uG];Object.freeze(gG);function xIe(r){return(0,kIe.contains)(gG,r.name)}Sn.isRecognitionException=xIe;var $I=function(r){jp(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),PIe=function(r){jp(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=AG,s}return e}($I);Sn.MismatchedTokenException=PIe;var DIe=function(r){jp(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=lG,s}return e}($I);Sn.NoViableAltException=DIe;var RIe=function(r){jp(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=uG,n}return e}($I);Sn.NotAllInputParsedException=RIe;var FIe=function(r){jp(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=cG,s}return e}($I);Sn.EarlyExitException=FIe});var VS=w(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.attemptInRepetitionRecovery=Yi.Recoverable=Yi.InRuleRecoveryException=Yi.IN_RULE_RECOVERY_EXCEPTION=Yi.EOF_FOLLOW_KEY=void 0;var ey=ZA(),xs=Yt(),NIe=bg(),LIe=OS(),TIe=es();Yi.EOF_FOLLOW_KEY={};Yi.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function _S(r){this.name=Yi.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Yi.InRuleRecoveryException=_S;_S.prototype=Error.prototype;var OIe=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,xs.has)(e,"recoveryEnabled")?e.recoveryEnabled:TIe.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=fG)},r.prototype.getTokenToInsert=function(e){var t=(0,ey.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),f=function(){var h=s.LA(0),p=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:h,ruleName:s.getCurrRuleFullName()}),m=new NIe.MismatchedTokenException(p,u,s.LA(0));m.resyncedTokens=(0,xs.dropRight)(l),s.SAVE_ERROR(m)};!c;)if(this.tokenMatcher(g,n)){f();return}else if(i.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new _S("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,xs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,xs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,xs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,xs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Yi.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,xs.map)(t,function(n,s){return s===0?Yi.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,xs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,xs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Yi.EOF_FOLLOW_KEY)return[ey.EOF];var t=e.ruleName+e.idxInCallingRule+LIe.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,ey.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,xs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,xs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,xs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Yi.Recoverable=OIe;function fG(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var f=l.token,h=l.occurrence,p=l.isEndOfRule;this.RULE_STACK.length===1&&p&&f===void 0&&(f=ey.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(f,h,o)&&this.tryInRepetitionRecovery(r,e,t,f)}Yi.attemptInRepetitionRecovery=fG});var ty=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.getKeyForAutomaticLookahead=Jt.AT_LEAST_ONE_SEP_IDX=Jt.MANY_SEP_IDX=Jt.AT_LEAST_ONE_IDX=Jt.MANY_IDX=Jt.OPTION_IDX=Jt.OR_IDX=Jt.BITS_FOR_ALT_IDX=Jt.BITS_FOR_RULE_IDX=Jt.BITS_FOR_OCCURRENCE_IDX=Jt.BITS_FOR_METHOD_TYPE=void 0;Jt.BITS_FOR_METHOD_TYPE=4;Jt.BITS_FOR_OCCURRENCE_IDX=8;Jt.BITS_FOR_RULE_IDX=12;Jt.BITS_FOR_ALT_IDX=8;Jt.OR_IDX=1<{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.LooksAhead=void 0;var Ja=Kp(),fo=Yt(),hG=es(),Wa=ty(),Rc=Tp(),UIe=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,fo.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:hG.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,fo.has)(e,"maxLookahead")?e.maxLookahead:hG.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,fo.isES2015MapSupported)()?new Map:[],(0,fo.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,fo.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,Rc.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,fo.forEach)(s,function(g){var f=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,Rc.getProductionDslName)(g)+f,function(){var h=(0,Ja.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),p=(0,Wa.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],Wa.OR_IDX,g.idx);t.setLaFuncCache(p,h)})}),(0,fo.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,Wa.MANY_IDX,Ja.PROD_TYPE.REPETITION,g.maxLookahead,(0,Rc.getProductionDslName)(g))}),(0,fo.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,Wa.OPTION_IDX,Ja.PROD_TYPE.OPTION,g.maxLookahead,(0,Rc.getProductionDslName)(g))}),(0,fo.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,Wa.AT_LEAST_ONE_IDX,Ja.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,Rc.getProductionDslName)(g))}),(0,fo.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,Wa.AT_LEAST_ONE_SEP_IDX,Ja.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,Rc.getProductionDslName)(g))}),(0,fo.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,Wa.MANY_SEP_IDX,Ja.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,Rc.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,Ja.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,Wa.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,Ja.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,Ja.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,Wa.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();ry.LooksAhead=UIe});var dG=w(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.addNoneTerminalToCst=qo.addTerminalToCst=qo.setNodeLocationFull=qo.setNodeLocationOnlyOffset=void 0;function KIe(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.defineNameProp=tl.functionName=tl.classNameFromInstance=void 0;var YIe=Yt();function qIe(r){return CG(r.constructor)}tl.classNameFromInstance=qIe;var mG="name";function CG(r){var e=r.name;return e||"anonymous"}tl.functionName=CG;function JIe(r,e){var t=Object.getOwnPropertyDescriptor(r,mG);return(0,YIe.isUndefined)(t)||t.configurable?(Object.defineProperty(r,mG,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}tl.defineNameProp=JIe});var BG=w(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.validateRedundantMethods=Di.validateMissingCstMethods=Di.validateVisitor=Di.CstVisitorDefinitionError=Di.createBaseVisitorConstructorWithDefaults=Di.createBaseSemanticVisitorConstructor=Di.defaultVisit=void 0;var Ps=Yt(),Gp=XS();function EG(r,e){for(var t=(0,Ps.keys)(r),i=t.length,n=0;n: `+(""+s.join(` `).replace(/\n/g,` `)))}}};return t.prototype=i,t.prototype.constructor=t,t._RULE_NAMES=e,t}Di.createBaseSemanticVisitorConstructor=WIe;function zIe(r,e,t){var i=function(){};(0,Gp.defineNameProp)(i,r+"BaseSemanticsWithDefaults");var n=Object.create(t.prototype);return(0,Ps.forEach)(e,function(s){n[s]=EG}),i.prototype=n,i.prototype.constructor=i,i}Di.createBaseVisitorConstructorWithDefaults=zIe;var ZS;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(ZS=Di.CstVisitorDefinitionError||(Di.CstVisitorDefinitionError={}));function IG(r,e){var t=yG(r,e),i=wG(r,e);return t.concat(i)}Di.validateVisitor=IG;function yG(r,e){var t=(0,Ps.map)(e,function(i){if(!(0,Ps.isFunction)(r[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,Gp.functionName)(r.constructor)+" CST Visitor.",type:ZS.MISSING_METHOD,methodName:i}});return(0,Ps.compact)(t)}Di.validateMissingCstMethods=yG;var _Ie=["constructor","visit","validateVisitor"];function wG(r,e){var t=[];for(var i in r)(0,Ps.isFunction)(r[i])&&!(0,Ps.contains)(_Ie,i)&&!(0,Ps.contains)(e,i)&&t.push({msg:"Redundant visitor method: <"+i+"> on "+(0,Gp.functionName)(r.constructor)+` CST Visitor There is no Grammar Rule corresponding to this method's name. `,type:ZS.REDUNDANT_METHOD,methodName:i});return t}Di.validateRedundantMethods=wG});var QG=w(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.TreeBuilder=void 0;var Qg=dG(),ni=Yt(),bG=BG(),VIe=es(),XIe=function(){function r(){}return r.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,ni.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:VIe.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ni.NOOP,this.cstFinallyStateUpdate=ni.NOOP,this.cstPostTerminal=ni.NOOP,this.cstPostNonTerminal=ni.NOOP,this.cstPostRule=ni.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Qg.setNodeLocationFull,this.setNodeLocationFromNode=Qg.setNodeLocationFull,this.cstPostRule=ni.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ni.NOOP,this.setNodeLocationFromNode=ni.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Qg.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=Qg.setNodeLocationOnlyOffset,this.cstPostRule=ni.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ni.NOOP,this.setNodeLocationFromNode=ni.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ni.NOOP,this.setNodeLocationFromNode=ni.NOOP,this.cstPostRule=ni.NOOP,this.setInitialNodeLocation=ni.NOOP;else throw Error('Invalid config option: "'+e.nodeLocationTracking+'"')},r.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},r.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},r.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.cstInvocationStateUpdate=function(e,t){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},r.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},r.prototype.cstPostRuleFull=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?(i.endOffset=t.endOffset,i.endLine=t.endLine,i.endColumn=t.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},r.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?i.endOffset=t.endOffset:i.startOffset=NaN},r.prototype.cstPostTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,Qg.addTerminalToCst)(i,t,e),this.setNodeLocationFromToken(i.location,t)},r.prototype.cstPostNonTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,Qg.addNoneTerminalToCst)(i,t,e),this.setNodeLocationFromNode(i.location,e.location)},r.prototype.getBaseCstVisitorConstructor=function(){if((0,ni.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,bG.createBaseSemanticVisitorConstructor)(this.className,(0,ni.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},r.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,ni.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,bG.createBaseVisitorConstructorWithDefaults)(this.className,(0,ni.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},r.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},r.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},r.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},r}();iy.TreeBuilder=XIe});var vG=w(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.LexerAdapter=void 0;var SG=es(),ZIe=function(){function r(){}return r.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(r.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),r.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):SG.END_OF_FILE},r.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?SG.END_OF_FILE:this.tokVector[t]},r.prototype.consumeToken=function(){this.currIdx++},r.prototype.exportLexerState=function(){return this.currIdx},r.prototype.importLexerState=function(e){this.currIdx=e},r.prototype.resetLexerState=function(){this.currIdx=-1},r.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},r.prototype.getLexerPosition=function(){return this.exportLexerState()},r}();ny.LexerAdapter=ZIe});var xG=w(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.RecognizerApi=void 0;var kG=Yt(),$Ie=bg(),$S=es(),eye=Op(),tye=WS(),rye=bn(),iye=function(){function r(){}return r.prototype.ACTION=function(e){return e.call(this)},r.prototype.consume=function(e,t,i){return this.consumeInternal(t,e,i)},r.prototype.subrule=function(e,t,i){return this.subruleInternal(t,e,i)},r.prototype.option=function(e,t){return this.optionInternal(t,e)},r.prototype.or=function(e,t){return this.orInternal(t,e)},r.prototype.many=function(e,t){return this.manyInternal(e,t)},r.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},r.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},r.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},r.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},r.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},r.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},r.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},r.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},r.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},r.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},r.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},r.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},r.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},r.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},r.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},r.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},r.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},r.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},r.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},r.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},r.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},r.prototype.OPTION=function(e){return this.optionInternal(e,0)},r.prototype.OPTION1=function(e){return this.optionInternal(e,1)},r.prototype.OPTION2=function(e){return this.optionInternal(e,2)},r.prototype.OPTION3=function(e){return this.optionInternal(e,3)},r.prototype.OPTION4=function(e){return this.optionInternal(e,4)},r.prototype.OPTION5=function(e){return this.optionInternal(e,5)},r.prototype.OPTION6=function(e){return this.optionInternal(e,6)},r.prototype.OPTION7=function(e){return this.optionInternal(e,7)},r.prototype.OPTION8=function(e){return this.optionInternal(e,8)},r.prototype.OPTION9=function(e){return this.optionInternal(e,9)},r.prototype.OR=function(e){return this.orInternal(e,0)},r.prototype.OR1=function(e){return this.orInternal(e,1)},r.prototype.OR2=function(e){return this.orInternal(e,2)},r.prototype.OR3=function(e){return this.orInternal(e,3)},r.prototype.OR4=function(e){return this.orInternal(e,4)},r.prototype.OR5=function(e){return this.orInternal(e,5)},r.prototype.OR6=function(e){return this.orInternal(e,6)},r.prototype.OR7=function(e){return this.orInternal(e,7)},r.prototype.OR8=function(e){return this.orInternal(e,8)},r.prototype.OR9=function(e){return this.orInternal(e,9)},r.prototype.MANY=function(e){this.manyInternal(0,e)},r.prototype.MANY1=function(e){this.manyInternal(1,e)},r.prototype.MANY2=function(e){this.manyInternal(2,e)},r.prototype.MANY3=function(e){this.manyInternal(3,e)},r.prototype.MANY4=function(e){this.manyInternal(4,e)},r.prototype.MANY5=function(e){this.manyInternal(5,e)},r.prototype.MANY6=function(e){this.manyInternal(6,e)},r.prototype.MANY7=function(e){this.manyInternal(7,e)},r.prototype.MANY8=function(e){this.manyInternal(8,e)},r.prototype.MANY9=function(e){this.manyInternal(9,e)},r.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},r.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},r.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},r.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},r.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},r.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},r.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},r.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},r.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},r.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},r.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},r.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},r.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},r.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},r.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},r.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},r.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},r.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},r.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},r.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},r.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},r.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},r.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},r.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},r.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},r.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},r.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},r.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},r.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},r.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},r.prototype.RULE=function(e,t,i){if(i===void 0&&(i=$S.DEFAULT_RULE_CONFIG),(0,kG.contains)(this.definedRulesNames,e)){var n=eye.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),s={message:n,type:$S.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,i);return this[e]=o,o},r.prototype.OVERRIDE_RULE=function(e,t,i){i===void 0&&(i=$S.DEFAULT_RULE_CONFIG);var n=[];n=n.concat((0,tye.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(n);var s=this.defineRule(e,t,i);return this[e]=s,s},r.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var i=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if((0,$Ie.isRecognitionException)(n))return!1;throw n}finally{this.reloadRecogState(i),this.isBackTrackingStack.pop()}}},r.prototype.getGAstProductions=function(){return this.gastProductionsCache},r.prototype.getSerializedGastProductions=function(){return(0,rye.serializeGrammar)((0,kG.values)(this.gastProductionsCache))},r}();sy.RecognizerApi=iye});var FG=w(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.RecognizerEngine=void 0;var Fr=Yt(),ts=ty(),ay=bg(),PG=Kp(),Sg=Up(),DG=es(),nye=VS(),RG=ZA(),Yp=Eg(),sye=XS(),oye=function(){function r(){}return r.prototype.initRecognizerEngine=function(e,t){if(this.className=(0,sye.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Yp.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,Fr.has)(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 For Further details.`);if((0,Fr.isArray)(e)){if((0,Fr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty. Note that the first argument for the parser constructor is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 For Further details.`)}if((0,Fr.isArray)(e))this.tokensMap=(0,Fr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Fr.has)(e,"modes")&&(0,Fr.every)((0,Fr.flatten)((0,Fr.values)(e.modes)),Yp.isTokenType)){var i=(0,Fr.flatten)((0,Fr.values)(e.modes)),n=(0,Fr.uniq)(i);this.tokensMap=(0,Fr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Fr.isObject)(e))this.tokensMap=(0,Fr.cloneObj)(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=RG.EOF;var s=(0,Fr.every)((0,Fr.values)(e),function(o){return(0,Fr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Yp.tokenStructuredMatcherNoCategories:Yp.tokenStructuredMatcher,(0,Yp.augmentTokenTypes)((0,Fr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called' Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var n=(0,Fr.has)(i,"resyncEnabled")?i.resyncEnabled:DG.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,Fr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:DG.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<t},r.prototype.orInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(ts.OR_IDX,t),n=(0,Fr.isArray)(e)?e:e.DEF,s=this.getLaFuncFromCache(i),o=s.call(this,n);if(o!==void 0){var a=n[o];return a.ALT.call(this)}this.raiseNoAltException(t,e.ERR_MSG)},r.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new ay.NotAllInputParsedException(t,e))}},r.prototype.subruleInternal=function(e,t,i){var n;try{var s=i!==void 0?i.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,i!==void 0&&i.LABEL!==void 0?i.LABEL:e.ruleName),n}catch(o){this.subruleInternalError(o,i,e.ruleName)}},r.prototype.subruleInternalError=function(e,t,i){throw(0,ay.isRecognitionException)(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:i),delete e.partialCstResult),e},r.prototype.consumeInternal=function(e,t,i){var n;try{var s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),n=s):this.consumeInternalError(e,s,i)}catch(o){n=this.consumeInternalRecovery(e,t,o)}return this.cstPostTerminal(i!==void 0&&i.LABEL!==void 0?i.LABEL:e.name,n),n},r.prototype.consumeInternalError=function(e,t,i){var n,s=this.LA(0);throw i!==void 0&&i.ERR_MSG?n=i.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ay.MismatchedTokenException(n,t,s))},r.prototype.consumeInternalRecovery=function(e,t,i){if(this.recoveryEnabled&&i.name==="MismatchedTokenException"&&!this.isBackTracking()){var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(s){throw s.name===nye.IN_RULE_RECOVERY_EXCEPTION?i:s}}else throw i},r.prototype.saveRecogState=function(){var e=this.errors,t=(0,Fr.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},r.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},r.prototype.ruleInvocationStateUpdate=function(e,t,i){this.RULE_OCCURRENCE_STACK.push(i),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},r.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},r.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},r.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},r.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),RG.EOF)},r.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},r}();oy.RecognizerEngine=oye});var LG=w(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.ErrorHandler=void 0;var ev=bg(),tv=Yt(),NG=Kp(),aye=es(),Aye=function(){function r(){}return r.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,tv.has)(e,"errorMessageProvider")?e.errorMessageProvider:aye.DEFAULT_PARSER_CONFIG.errorMessageProvider},r.prototype.SAVE_ERROR=function(e){if((0,ev.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,tv.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(r.prototype,"errors",{get:function(){return(0,tv.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),r.prototype.raiseEarlyExitException=function(e,t,i){for(var n=this.getCurrRuleFullName(),s=this.getGAstProductions()[n],o=(0,NG.getLookaheadPathsForOptionalProd)(e,s,t,this.maxLookahead),a=o[0],l=[],c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:i,ruleName:n});throw this.SAVE_ERROR(new ev.EarlyExitException(u,this.LA(1),this.LA(0)))},r.prototype.raiseNoAltException=function(e,t){for(var i=this.getCurrRuleFullName(),n=this.getGAstProductions()[i],s=(0,NG.getLookaheadPathsForOr)(e,n,this.maxLookahead),o=[],a=1;a<=this.maxLookahead;a++)o.push(this.LA(a));var l=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:l,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ev.NoViableAltException(c,this.LA(1),l))},r}();Ay.ErrorHandler=Aye});var MG=w(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.ContentAssist=void 0;var TG=Up(),OG=Yt(),lye=function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(e,t){var i=this.gastProductionsCache[e];if((0,OG.isUndefined)(i))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,TG.nextPossibleTokensAfter)([i],t,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(e){var t=(0,OG.first)(e.ruleStack),i=this.getGAstProductions(),n=i[t],s=new TG.NextAfterTokenWalker(n,e).startWalking();return s},r}();ly.ContentAssist=lye});var JG=w(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.GastRecorder=void 0;var vn=Yt(),Jo=bn(),cye=Rp(),UG=Eg(),KG=ZA(),uye=es(),gye=ty(),uy={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(uy);var HG=!0,jG=Math.pow(2,gye.BITS_FOR_OCCURRENCE_IDX)-1,GG=(0,KG.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:cye.Lexer.NA});(0,UG.augmentTokenTypes)([GG]);var YG=(0,KG.createTokenInstance)(GG,`This IToken indicates the Parser is in Recording Phase See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(YG);var fye={name:`This CSTNode indicates the Parser is in Recording Phase See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},pye=function(){function r(){}return r.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},r.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(n){var s=n>0?n:"";e["CONSUME"+s]=function(o,a){return this.consumeInternalRecord(o,n,a)},e["SUBRULE"+s]=function(o,a){return this.subruleInternalRecord(o,n,a)},e["OPTION"+s]=function(o){return this.optionInternalRecord(o,n)},e["OR"+s]=function(o){return this.orInternalRecord(o,n)},e["MANY"+s]=function(o){this.manyInternalRecord(n,o)},e["MANY_SEP"+s]=function(o){this.manySepFirstInternalRecord(n,o)},e["AT_LEAST_ONE"+s]=function(o){this.atLeastOneInternalRecord(n,o)},e["AT_LEAST_ONE_SEP"+s]=function(o){this.atLeastOneSepFirstInternalRecord(n,o)}},i=0;i<10;i++)t(i);e.consume=function(n,s,o){return this.consumeInternalRecord(s,n,o)},e.subrule=function(n,s,o){return this.subruleInternalRecord(s,n,o)},e.option=function(n,s){return this.optionInternalRecord(s,n)},e.or=function(n,s){return this.orInternalRecord(s,n)},e.many=function(n,s){this.manyInternalRecord(n,s)},e.atLeastOne=function(n,s){this.atLeastOneInternalRecord(n,s)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},r.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var i=t>0?t:"";delete e["CONSUME"+i],delete e["SUBRULE"+i],delete e["OPTION"+i],delete e["OR"+i],delete e["MANY"+i],delete e["MANY_SEP"+i],delete e["AT_LEAST_ONE"+i],delete e["AT_LEAST_ONE_SEP"+i]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},r.prototype.ACTION_RECORD=function(e){},r.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},r.prototype.LA_RECORD=function(e){return uye.END_OF_FILE},r.prototype.topLevelRuleRecord=function(e,t){try{var i=new Jo.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),t.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` This error was thrown during the "grammar recording phase" For more info see: https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(s){throw n}throw n}},r.prototype.optionInternalRecord=function(e,t){return qp.call(this,Jo.Option,e,t)},r.prototype.atLeastOneInternalRecord=function(e,t){qp.call(this,Jo.RepetitionMandatory,t,e)},r.prototype.atLeastOneSepFirstInternalRecord=function(e,t){qp.call(this,Jo.RepetitionMandatoryWithSeparator,t,e,HG)},r.prototype.manyInternalRecord=function(e,t){qp.call(this,Jo.Repetition,t,e)},r.prototype.manySepFirstInternalRecord=function(e,t){qp.call(this,Jo.RepetitionWithSeparator,t,e,HG)},r.prototype.orInternalRecord=function(e,t){return hye.call(this,e,t)},r.prototype.subruleInternalRecord=function(e,t,i){if(gy(t),!e||(0,vn.has)(e,"ruleName")===!1){var n=new Error(" argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(` inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,vn.peek)(this.recordingProdStack),o=e.ruleName,a=new Jo.NonTerminal({idx:t,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?fye:uy},r.prototype.consumeInternalRecord=function(e,t,i){if(gy(t),!(0,UG.hasShortKeyProperty)(e)){var n=new Error(" argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(` inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,vn.peek)(this.recordingProdStack),o=new Jo.Terminal({idx:t,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),YG},r}();cy.GastRecorder=pye;function qp(r,e,t,i){i===void 0&&(i=!1),gy(t);var n=(0,vn.peek)(this.recordingProdStack),s=(0,vn.isFunction)(e)?e:e.DEF,o=new r({definition:[],idx:t});return i&&(o.separator=e.SEP),(0,vn.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),uy}function hye(r,e){var t=this;gy(e);var i=(0,vn.peek)(this.recordingProdStack),n=(0,vn.isArray)(r)===!1,s=n===!1?r:r.DEF,o=new Jo.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});(0,vn.has)(r,"MAX_LOOKAHEAD")&&(o.maxLookahead=r.MAX_LOOKAHEAD);var a=(0,vn.some)(s,function(l){return(0,vn.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,vn.forEach)(s,function(l){var c=new Jo.Alternative({definition:[]});o.definition.push(c),(0,vn.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,vn.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),t.recordingProdStack.push(c),l.ALT.call(t),t.recordingProdStack.pop()}),uy}function qG(r){return r===0?"":""+r}function gy(r){if(r<0||r>jG){var e=new Error("Invalid DSL Method idx value: <"+r+`> `+("Idx value must be a none negative value smaller than "+(jG+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var zG=w(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.PerformanceTracer=void 0;var WG=Yt(),dye=es(),Cye=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,WG.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:Infinity,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=dye.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <"+e+">");var n=(0,WG.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r}();fy.PerformanceTracer=Cye});var _G=w(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.applyMixins=void 0;function mye(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}hy.applyMixins=mye});var es=w(Er=>{"use strict";var VG=Er&&Er.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Er,"__esModule",{value:!0});Er.EmbeddedActionsParser=Er.CstParser=Er.Parser=Er.EMPTY_ALT=Er.ParserDefinitionErrorType=Er.DEFAULT_RULE_CONFIG=Er.DEFAULT_PARSER_CONFIG=Er.END_OF_FILE=void 0;var an=Yt(),Eye=Lj(),XG=ZA(),ZG=Op(),$G=aG(),Iye=VS(),yye=pG(),wye=QG(),Bye=vG(),bye=xG(),Qye=FG(),Sye=LG(),vye=MG(),kye=JG(),xye=zG(),Pye=_G();Er.END_OF_FILE=(0,XG.createTokenInstance)(XG.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Er.END_OF_FILE);Er.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ZG.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});Er.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var Dye;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(Dye=Er.ParserDefinitionErrorType||(Er.ParserDefinitionErrorType={}));function Rye(r){return r===void 0&&(r=void 0),function(){return r}}Er.EMPTY_ALT=Rye;var py=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,an.has)(t,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES For further details.`);this.skipValidations=(0,an.has)(t,"skipValidations")?t.skipValidations:Er.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,an.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,an.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,$G.resolveGrammar)({rules:(0,an.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,an.isEmpty)(n)&&e.skipValidations===!1){var s=(0,$G.validateGrammar)({rules:(0,an.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,an.values)(e.tokensMap),errMsgProvider:ZG.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,an.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,Eye.computeAllProdsFollows)((0,an.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,an.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,an.isEmpty)(e.definitionErrors))throw t=(0,an.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected: `+t.join(` ------------------------------- `))})},r.DEFER_DEFINITION_ERRORS_HANDLING=!1,r}();Er.Parser=py;(0,Pye.applyMixins)(py,[Iye.Recoverable,yye.LooksAhead,wye.TreeBuilder,Bye.LexerAdapter,Qye.RecognizerEngine,bye.RecognizerApi,Sye.ErrorHandler,vye.ContentAssist,kye.GastRecorder,xye.PerformanceTracer]);var Fye=function(r){VG(e,r);function e(t,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!0,n=r.call(this,t,s)||this,n}return e}(py);Er.CstParser=Fye;var Nye=function(r){VG(e,r);function e(t,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!1,n=r.call(this,t,s)||this,n}return e}(py);Er.EmbeddedActionsParser=Nye});var tY=w(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.createSyntaxDiagramsCode=void 0;var eY=yS();function Lye(r,e){var t=e===void 0?{}:e,i=t.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+eY.VERSION+"/diagrams/":i,s=t.css,o=s===void 0?"https://unpkg.com/chevrotain@"+eY.VERSION+"/diagrams/diagrams.css":s,a=` `,l=` `,c=` `,u=`
`,g=` `,f=` `;return a+l+c+u+g+f}dy.createSyntaxDiagramsCode=Lye});var nY=w(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Parser=Ve.createSyntaxDiagramsCode=Ve.clearCache=Ve.GAstVisitor=Ve.serializeProduction=Ve.serializeGrammar=Ve.Terminal=Ve.Rule=Ve.RepetitionWithSeparator=Ve.RepetitionMandatoryWithSeparator=Ve.RepetitionMandatory=Ve.Repetition=Ve.Option=Ve.NonTerminal=Ve.Alternative=Ve.Alternation=Ve.defaultLexerErrorProvider=Ve.NoViableAltException=Ve.NotAllInputParsedException=Ve.MismatchedTokenException=Ve.isRecognitionException=Ve.EarlyExitException=Ve.defaultParserErrorProvider=Ve.tokenName=Ve.tokenMatcher=Ve.tokenLabel=Ve.EOF=Ve.createTokenInstance=Ve.createToken=Ve.LexerDefinitionErrorType=Ve.Lexer=Ve.EMPTY_ALT=Ve.ParserDefinitionErrorType=Ve.EmbeddedActionsParser=Ve.CstParser=Ve.VERSION=void 0;var Tye=yS();Object.defineProperty(Ve,"VERSION",{enumerable:!0,get:function(){return Tye.VERSION}});var Cy=es();Object.defineProperty(Ve,"CstParser",{enumerable:!0,get:function(){return Cy.CstParser}});Object.defineProperty(Ve,"EmbeddedActionsParser",{enumerable:!0,get:function(){return Cy.EmbeddedActionsParser}});Object.defineProperty(Ve,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return Cy.ParserDefinitionErrorType}});Object.defineProperty(Ve,"EMPTY_ALT",{enumerable:!0,get:function(){return Cy.EMPTY_ALT}});var rY=Rp();Object.defineProperty(Ve,"Lexer",{enumerable:!0,get:function(){return rY.Lexer}});Object.defineProperty(Ve,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return rY.LexerDefinitionErrorType}});var vg=ZA();Object.defineProperty(Ve,"createToken",{enumerable:!0,get:function(){return vg.createToken}});Object.defineProperty(Ve,"createTokenInstance",{enumerable:!0,get:function(){return vg.createTokenInstance}});Object.defineProperty(Ve,"EOF",{enumerable:!0,get:function(){return vg.EOF}});Object.defineProperty(Ve,"tokenLabel",{enumerable:!0,get:function(){return vg.tokenLabel}});Object.defineProperty(Ve,"tokenMatcher",{enumerable:!0,get:function(){return vg.tokenMatcher}});Object.defineProperty(Ve,"tokenName",{enumerable:!0,get:function(){return vg.tokenName}});var Oye=Op();Object.defineProperty(Ve,"defaultParserErrorProvider",{enumerable:!0,get:function(){return Oye.defaultParserErrorProvider}});var Jp=bg();Object.defineProperty(Ve,"EarlyExitException",{enumerable:!0,get:function(){return Jp.EarlyExitException}});Object.defineProperty(Ve,"isRecognitionException",{enumerable:!0,get:function(){return Jp.isRecognitionException}});Object.defineProperty(Ve,"MismatchedTokenException",{enumerable:!0,get:function(){return Jp.MismatchedTokenException}});Object.defineProperty(Ve,"NotAllInputParsedException",{enumerable:!0,get:function(){return Jp.NotAllInputParsedException}});Object.defineProperty(Ve,"NoViableAltException",{enumerable:!0,get:function(){return Jp.NoViableAltException}});var Mye=DS();Object.defineProperty(Ve,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return Mye.defaultLexerErrorProvider}});var Wo=bn();Object.defineProperty(Ve,"Alternation",{enumerable:!0,get:function(){return Wo.Alternation}});Object.defineProperty(Ve,"Alternative",{enumerable:!0,get:function(){return Wo.Alternative}});Object.defineProperty(Ve,"NonTerminal",{enumerable:!0,get:function(){return Wo.NonTerminal}});Object.defineProperty(Ve,"Option",{enumerable:!0,get:function(){return Wo.Option}});Object.defineProperty(Ve,"Repetition",{enumerable:!0,get:function(){return Wo.Repetition}});Object.defineProperty(Ve,"RepetitionMandatory",{enumerable:!0,get:function(){return Wo.RepetitionMandatory}});Object.defineProperty(Ve,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return Wo.RepetitionMandatoryWithSeparator}});Object.defineProperty(Ve,"RepetitionWithSeparator",{enumerable:!0,get:function(){return Wo.RepetitionWithSeparator}});Object.defineProperty(Ve,"Rule",{enumerable:!0,get:function(){return Wo.Rule}});Object.defineProperty(Ve,"Terminal",{enumerable:!0,get:function(){return Wo.Terminal}});var iY=bn();Object.defineProperty(Ve,"serializeGrammar",{enumerable:!0,get:function(){return iY.serializeGrammar}});Object.defineProperty(Ve,"serializeProduction",{enumerable:!0,get:function(){return iY.serializeProduction}});var Uye=Ig();Object.defineProperty(Ve,"GAstVisitor",{enumerable:!0,get:function(){return Uye.GAstVisitor}});function Kye(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API. It performs no action other than printing this message. Please avoid using it as it will be completely removed in the future`)}Ve.clearCache=Kye;var Hye=tY();Object.defineProperty(Ve,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return Hye.createSyntaxDiagramsCode}});var jye=function(){function r(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return r}();Ve.Parser=jye});var aY=w((eet,sY)=>{var my=nY(),za=my.createToken,oY=my.tokenMatcher,rv=my.Lexer,Gye=my.EmbeddedActionsParser;sY.exports=r=>{let e=za({name:"LogicalOperator",pattern:rv.NA}),t=za({name:"Or",pattern:/\|/,categories:e}),i=za({name:"Xor",pattern:/\^/,categories:e}),n=za({name:"And",pattern:/&/,categories:e}),s=za({name:"Not",pattern:/!/}),o=za({name:"LParen",pattern:/\(/}),a=za({name:"RParen",pattern:/\)/}),l=za({name:"Query",pattern:r}),u=[za({name:"WhiteSpace",pattern:/\s+/,group:rv.SKIPPED}),t,i,n,o,a,s,e,l],g=new rv(u);class f extends Gye{constructor(p){super(u);this.RULE("expression",()=>this.SUBRULE(this.logicalExpression)),this.RULE("logicalExpression",()=>{let y=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{let b=y,v=this.CONSUME(e),k=this.SUBRULE2(this.atomicExpression);oY(v,t)?y=T=>b(T)||k(T):oY(v,i)?y=T=>!!(b(T)^k(T)):y=T=>b(T)&&k(T)}),y}),this.RULE("atomicExpression",()=>this.OR([{ALT:()=>this.SUBRULE(this.parenthesisExpression)},{ALT:()=>{let{image:m}=this.CONSUME(l);return y=>y(m)}},{ALT:()=>{this.CONSUME(s);let m=this.SUBRULE(this.atomicExpression);return y=>!m(y)}}])),this.RULE("parenthesisExpression",()=>{let m;return this.CONSUME(o),m=this.SUBRULE(this.expression),this.CONSUME(a),m}),this.performSelfAnalysis()}}return{TinylogicLexer:g,TinylogicParser:f}}});var AY=w(Ey=>{var Yye=aY();Ey.makeParser=(r=/[a-z]+/)=>{let{TinylogicLexer:e,TinylogicParser:t}=Yye(r),i=new t;return(n,s)=>{let o=e.tokenize(n);return i.input=o.tokens,i.expression()(s)}};Ey.parse=Ey.makeParser()});var cY=w((ret,lY)=>{"use strict";lY.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var iv=w((iet,uY)=>{var Wp=cY(),gY={};for(let r of Object.keys(Wp))gY[Wp[r]]=r;var at={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};uY.exports=at;for(let r of Object.keys(at)){if(!("channels"in at[r]))throw new Error("missing channels property: "+r);if(!("labels"in at[r]))throw new Error("missing channel labels property: "+r);if(at[r].labels.length!==at[r].channels)throw new Error("channel and label counts mismatch: "+r);let{channels:e,labels:t}=at[r];delete at[r].channels,delete at[r].labels,Object.defineProperty(at[r],"channels",{value:e}),Object.defineProperty(at[r],"labels",{value:t})}at.rgb.hsl=function(r){let e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),s=Math.max(e,t,i),o=s-n,a,l;s===n?a=0:e===s?a=(t-i)/o:t===s?a=2+(i-e)/o:i===s&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(n+s)/2;return s===n?l=0:c<=.5?l=o/(s+n):l=o/(2-s-n),[a,l*100,c*100]};at.rgb.hsv=function(r){let e,t,i,n,s,o=r[0]/255,a=r[1]/255,l=r[2]/255,c=Math.max(o,a,l),u=c-Math.min(o,a,l),g=function(f){return(c-f)/6/u+1/2};return u===0?(n=0,s=0):(s=u/c,e=g(o),t=g(a),i=g(l),o===c?n=i-t:a===c?n=1/3+e-i:l===c&&(n=2/3+t-e),n<0?n+=1:n>1&&(n-=1)),[n*360,s*100,c*100]};at.rgb.hwb=function(r){let e=r[0],t=r[1],i=r[2],n=at.rgb.hsl(r)[0],s=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[n,s*100,i*100]};at.rgb.cmyk=function(r){let e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(1-e,1-t,1-i),s=(1-e-n)/(1-n)||0,o=(1-t-n)/(1-n)||0,a=(1-i-n)/(1-n)||0;return[s*100,o*100,a*100,n*100]};function qye(r,e){return(r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2}at.rgb.keyword=function(r){let e=gY[r];if(e)return e;let t=Infinity,i;for(let n of Object.keys(Wp)){let s=Wp[n],o=qye(r,s);o.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let n=e*.4124+t*.3576+i*.1805,s=e*.2126+t*.7152+i*.0722,o=e*.0193+t*.1192+i*.9505;return[n*100,s*100,o*100]};at.rgb.lab=function(r){let e=at.rgb.xyz(r),t=e[0],i=e[1],n=e[2];t/=95.047,i/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let s=116*i-16,o=500*(t-i),a=200*(i-n);return[s,o,a]};at.hsl.rgb=function(r){let e=r[0]/360,t=r[1]/100,i=r[2]/100,n,s,o;if(t===0)return o=i*255,[o,o,o];i<.5?n=i*(1+t):n=i+t-i*t;let a=2*i-n,l=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(n-a)*6*s:2*s<1?o=n:3*s<2?o=a+(n-a)*(2/3-s)*6:o=a,l[c]=o*255;return l};at.hsl.hsv=function(r){let e=r[0],t=r[1]/100,i=r[2]/100,n=t,s=Math.max(i,.01);i*=2,t*=i<=1?i:2-i,n*=s<=1?s:2-s;let o=(i+t)/2,a=i===0?2*n/(s+n):2*t/(i+t);return[e,a*100,o*100]};at.hsv.rgb=function(r){let e=r[0]/60,t=r[1]/100,i=r[2]/100,n=Math.floor(e)%6,s=e-Math.floor(e),o=255*i*(1-t),a=255*i*(1-t*s),l=255*i*(1-t*(1-s));switch(i*=255,n){case 0:return[i,l,o];case 1:return[a,i,o];case 2:return[o,i,l];case 3:return[o,a,i];case 4:return[l,o,i];case 5:return[i,o,a]}};at.hsv.hsl=function(r){let e=r[0],t=r[1]/100,i=r[2]/100,n=Math.max(i,.01),s,o;o=(2-t)*i;let a=(2-t)*n;return s=t*n,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};at.hwb.rgb=function(r){let e=r[0]/360,t=r[1]/100,i=r[2]/100,n=t+i,s;n>1&&(t/=n,i/=n);let o=Math.floor(6*e),a=1-i;s=6*e-o,(o&1)!=0&&(s=1-s);let l=t+s*(a-t),c,u,g;switch(o){default:case 6:case 0:c=a,u=l,g=t;break;case 1:c=l,u=a,g=t;break;case 2:c=t,u=a,g=l;break;case 3:c=t,u=l,g=a;break;case 4:c=l,u=t,g=a;break;case 5:c=a,u=t,g=l;break}return[c*255,u*255,g*255]};at.cmyk.rgb=function(r){let e=r[0]/100,t=r[1]/100,i=r[2]/100,n=r[3]/100,s=1-Math.min(1,e*(1-n)+n),o=1-Math.min(1,t*(1-n)+n),a=1-Math.min(1,i*(1-n)+n);return[s*255,o*255,a*255]};at.xyz.rgb=function(r){let e=r[0]/100,t=r[1]/100,i=r[2]/100,n,s,o;return n=e*3.2406+t*-1.5372+i*-.4986,s=e*-.9689+t*1.8758+i*.0415,o=e*.0557+t*-.204+i*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,n=Math.min(Math.max(0,n),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[n*255,s*255,o*255]};at.xyz.lab=function(r){let e=r[0],t=r[1],i=r[2];e/=95.047,t/=100,i/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*t-16,s=500*(e-t),o=200*(t-i);return[n,s,o]};at.lab.xyz=function(r){let e=r[0],t=r[1],i=r[2],n,s,o;s=(e+16)/116,n=t/500+s,o=s-i/200;let a=s**3,l=n**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,n*=95.047,s*=100,o*=108.883,[n,s,o]};at.lab.lch=function(r){let e=r[0],t=r[1],i=r[2],n;n=Math.atan2(i,t)*360/2/Math.PI,n<0&&(n+=360);let o=Math.sqrt(t*t+i*i);return[e,o,n]};at.lch.lab=function(r){let e=r[0],t=r[1],n=r[2]/360*2*Math.PI,s=t*Math.cos(n),o=t*Math.sin(n);return[e,s,o]};at.rgb.ansi16=function(r,e=null){let[t,i,n]=r,s=e===null?at.rgb.hsv(r)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(t/255));return s===2&&(o+=60),o};at.hsv.ansi16=function(r){return at.rgb.ansi16(at.hsv.rgb(r),r[2])};at.rgb.ansi256=function(r){let e=r[0],t=r[1],i=r[2];return e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5)};at.ansi16.rgb=function(r){let e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(r>50)+1)*.5,i=(e&1)*t*255,n=(e>>1&1)*t*255,s=(e>>2&1)*t*255;return[i,n,s]};at.ansi256.rgb=function(r){if(r>=232){let s=(r-232)*10+8;return[s,s,s]}r-=16;let e,t=Math.floor(r/36)/5*255,i=Math.floor((e=r%36)/6)/5*255,n=e%6/5*255;return[t,i,n]};at.rgb.hex=function(r){let t=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};at.hex.rgb=function(r){let e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let i=parseInt(t,16),n=i>>16&255,s=i>>8&255,o=i&255;return[n,s,o]};at.rgb.hcg=function(r){let e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.max(Math.max(e,t),i),s=Math.min(Math.min(e,t),i),o=n-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:n===e?l=(t-i)/o%6:n===t?l=2+(i-e)/o:l=4+(e-t)/o,l/=6,l%=1,[l*360,o*100,a*100]};at.hsl.hcg=function(r){let e=r[1]/100,t=r[2]/100,i=t<.5?2*e*t:2*e*(1-t),n=0;return i<1&&(n=(t-.5*i)/(1-i)),[r[0],i*100,n*100]};at.hsv.hcg=function(r){let e=r[1]/100,t=r[2]/100,i=e*t,n=0;return i<1&&(n=(t-i)/(1-i)),[r[0],i*100,n*100]};at.hcg.rgb=function(r){let e=r[0]/360,t=r[1]/100,i=r[2]/100;if(t===0)return[i*255,i*255,i*255];let n=[0,0,0],s=e%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=o,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=o;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=o,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return l=(1-t)*i,[(t*n[0]+l)*255,(t*n[1]+l)*255,(t*n[2]+l)*255]};at.hcg.hsv=function(r){let e=r[1]/100,t=r[2]/100,i=e+t*(1-e),n=0;return i>0&&(n=e/i),[r[0],n*100,i*100]};at.hcg.hsl=function(r){let e=r[1]/100,i=r[2]/100*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[r[0],n*100,i*100]};at.hcg.hwb=function(r){let e=r[1]/100,t=r[2]/100,i=e+t*(1-e);return[r[0],(i-e)*100,(1-i)*100]};at.hwb.hcg=function(r){let e=r[1]/100,t=r[2]/100,i=1-t,n=i-e,s=0;return n<1&&(s=(i-n)/(1-n)),[r[0],n*100,s*100]};at.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};at.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};at.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};at.gray.hsl=function(r){return[0,0,r[0]]};at.gray.hsv=at.gray.hsl;at.gray.hwb=function(r){return[0,100,r[0]]};at.gray.cmyk=function(r){return[0,0,0,r[0]]};at.gray.lab=function(r){return[r[0],0,0]};at.gray.hex=function(r){let e=Math.round(r[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i};at.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});var hY=w((net,fY)=>{var Iy=iv();function Jye(){let r={},e=Object.keys(Iy);for(let t=e.length,i=0;i{var nv=iv(),Vye=hY(),kg={},Xye=Object.keys(nv);function Zye(r){let e=function(...t){let i=t[0];return i==null?i:(i.length>1&&(t=i),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function $ye(r){let e=function(...t){let i=t[0];if(i==null)return i;i.length>1&&(t=i);let n=r(t);if(typeof n=="object")for(let s=n.length,o=0;o{kg[r]={},Object.defineProperty(kg[r],"channels",{value:nv[r].channels}),Object.defineProperty(kg[r],"labels",{value:nv[r].labels});let e=Vye(r);Object.keys(e).forEach(i=>{let n=e[i];kg[r][i]=$ye(n),kg[r][i].raw=Zye(n)})});pY.exports=kg});var wY=w((oet,CY)=>{"use strict";var mY=(r,e)=>(...t)=>`