diff --git a/assets/portugol-worker/worker.js b/assets/portugol-worker/worker.js index cde71f5e..6e982407 100644 --- a/assets/portugol-worker/worker.js +++ b/assets/portugol-worker/worker.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{checarFunçãoInício:()=>checarFunçãoInício,checarFunçõesComRetorno:()=>checarFunçõesComRetorno});var r={};t.r(r),t.d(r,{checarUsoEscopo:()=>checarUsoEscopo});class PortugolCodeError extends Error{constructor(t,e,r,s,i,n){super(t),this.message=t,this.context=e,this.startLine=r,this.startCol=s,this.endLine=i,this.endCol=n}static fromContext(t,e){let r=t;if(t.hasOwnProperty("start")||t.hasOwnProperty("stop")||!t.parent||(r=t.parent),r.hasOwnProperty("start")&&r.hasOwnProperty("stop")&&"object"==typeof r.start&&"object"==typeof r.stop&&null!==r.start&&null!==r.stop){const{start:s,stop:i}=r,{line:n,column:o}=s;let{line:a,column:c}=i;return n===a&&o===c&&(c+=t.getText().length-1),new PortugolCodeError(e,t,n,o,a,c)}const s=t.getPayload();if(s&&s.hasOwnProperty("column")&&s.hasOwnProperty("line")){const{line:r,column:i}=s;return new PortugolCodeError(e,t,r,i,r,i+t.getText().length)}return new PortugolCodeError(e,t,1,1,1,2+t.getText().length)}}class PortugolErrorListener{constructor(){this.errors=[]}syntaxError(t,e,r,s,i,n){const o=e&&e.text?s+e.text.length:s;this.errors.push(new PortugolCodeError(i,n?.ctx||e||null,r,s,r,o))}getErrors(){return this.errors}reset(){this.errors=[]}reportAmbiguity(t,e,r,s,i,n,o){}reportAttemptingFullContext(t,e,r,s,i,n){}reportContextSensitivity(t,e,r,s,i,n){}}var s,i,n,o,a=Object.defineProperty,__name=(t,e)=>a(t,"name",{value:e,configurable:!0});(i=s||(s={})).EOF=-1,i.UNKNOWN_SOURCE_NAME="",(o=n||(n={})).INVALID_TYPE=0,o.EPSILON=-2,o.MIN_USER_TOKEN_TYPE=1,o.EOF=s.EOF,o.DEFAULT_CHANNEL=0,o.HIDDEN_CHANNEL=1,o.MIN_USER_CHANNEL_VALUE=2;var c=__name((t=>{const e=t;return void 0!==e.tokenSource&&void 0!==e.channel}),"isToken"),h=class _Interval{static{__name(this,"Interval")}static INVALID_INTERVAL=new _Interval(-1,-2);static INTERVAL_POOL_MAX_VALUE=1e3;start;stop;static#t=[];#e;constructor(t,e){this.start=t,this.stop=e,this.#e=Math.imul(651+t,31)+e}static of(t,e){return t!==e||t<0||t>_Interval.INTERVAL_POOL_MAX_VALUE?new _Interval(t,e):(_Interval.#t[t]||(_Interval.#t[t]=new _Interval(t,t)),_Interval.#t[t])}equals(t){return this.start===t.start&&this.stop===t.stop}hashCode(){return this.#e}startsBeforeDisjoint(t){return this.start=t.start}startsAfter(t){return this.start>t.start}startsAfterDisjoint(t){return this.start>t.stop}startsAfterNonDisjoint(t){return this.start>t.start&&this.start<=t.stop}disjoint(t){return this.startsBeforeDisjoint(t)||this.startsAfterDisjoint(t)}adjacent(t){return this.start===t.stop+1||this.stop===t.start-1}properlyContains(t){return t.start>=this.start&&t.stop<=this.stop}union(t){return _Interval.of(Math.min(this.start,t.start),Math.max(this.stop,t.stop))}intersection(t){return _Interval.of(Math.max(this.start,t.start),Math.min(this.stop,t.stop))}differenceNotProperlyContained(t){let e=null;return t.startsBeforeNonDisjoint(this)?e=_Interval.of(Math.max(this.start,t.stop+1),this.stop):t.startsAfterNonDisjoint(this)&&(e=_Interval.of(this.start,t.start-1)),e}toString(){return this.start===this.stop?this.start.toString():this.start.toString()+".."+this.stop.toString()}get length(){return this.stop0){const t=i.charAt(0);if("'"===t){r[s]=null;continue}if(t.toUpperCase()===t){e[s]=null;continue}}e[s]=null,r[s]=null}}return new _Vocabulary(e,r,t)}getMaxTokenType(){return this.maxTokenType}getLiteralName(t){return t>=0&&t=0&&t=0&&t>>17,t=(t^=e=Math.imul(e,461845907))<<13|t>>>19,t=Math.imul(t,5)+3864292196}static finish=(t,e)=>(t^=4*e,t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16);static hashCode=(t,e)=>_MurmurHash.finish(_MurmurHash.update(e??_MurmurHash.#r,t),1)},p=class _IntervalSet{static{__name(this,"IntervalSet")}#s=[];#e;constructor(t){t&&this.addSet(t)}static of(t,e){const r=new _IntervalSet;return r.addRange(t,e),r}[Symbol.iterator](){return this.#s[Symbol.iterator]()}get(t){return this.#s[t]}get minElement(){return 0===this.#s.length?n.INVALID_TYPE:this.#s[0].start}get maxElement(){return 0===this.#s.length?n.INVALID_TYPE:this.#s[this.#s.length-1].stop}clear(){this.#e=void 0,this.#s=[]}addOne(t){this.addInterval(new h(t,t))}addRange(t,e){this.addInterval(new h(t,e))}addInterval(t){if(this.#e=void 0,0===this.#s.length)this.#s.push(t);else{for(let e=0;ethis.addInterval(t)),this),this}complementWithVocabulary(t){const e=new _IntervalSet;return t?0===t.length?e:(e.addSet(t),e.subtract(this)):e}complement(t,e){const r=new _IntervalSet;return r.addInterval(new h(t,e)),r.subtract(this)}or(t){const e=new _IntervalSet;return e.addSet(this),t.forEach((t=>e.addSet(t))),e}and(t){if(0===t.length)return new _IntervalSet;const e=this.#s,r=t.#s;let s;const i=e.length,n=r.length;let o=0,a=0;for(;oi.stop){r++;continue}let o,a;n.start>i.start&&(o=new h(i.start,n.start-1)),n.stopt))return!0;r=s-1}}return!1}removeRange(t){if(this.#e=void 0,t.start===t.stop)this.removeOne(t.start);else if(null!==this.#s){let e=0;for(const r of this.#s){if(t.stop<=r.start)return;if(t.start>r.start&&t.stop=r.stop?(this.#s.splice(e,1),e-=1):t.start1&&(e+="{");for(let r=0;r":e+=t?"'"+String.fromCodePoint(i)+"'":i:e+=t?"'"+String.fromCodePoint(i)+"'..'"+String.fromCodePoint(o)+"'":i+".."+o,r1&&(e+="}"),e}toStringWithVocabulary(t){if(0===this.#s.length)return"{}";let e="";this.length>1&&(e+="{");for(let r=0;r":e+=this.elementName(t,i);else for(let r=i;r<=o;++r)r>i&&(e+=", "),e+=this.elementName(t,r);r1&&(e+="}"),e}toStringWithRuleNames(t){if(0===this.#s.length)return"{}";let e="";this.length>1&&(e+="{");const r=l.fromTokenNames(t);for(let t=0;t":e+=this.elementName(r,i);else for(let t=i;t<=o;++t)t>i&&(e+=", "),e+=this.elementName(r,t);t1&&(e+="}"),e}toArray(){const t=[];for(const e of this.#s)for(let r=e.start;r<=e.stop;r++)t.push(r);return t}get length(){let t=0;if(1===this.#s.length){const t=this.#s[0];return t.stop-t.start+1}for(const e of this.#s)t+=e.length;return t}elementName(t,e){return e===n.EOF?"":e===n.EPSILON?"":t.getDisplayName(e)}},d=class{static{__name(this,"Transition")}static INVALID=0;static EPSILON=1;static RANGE=2;static RULE=3;static PREDICATE=4;static ATOM=5;static ACTION=6;static SET=7;static NOT_SET=8;static WILDCARD=9;static PRECEDENCE=10;target;constructor(t){this.target=t}get isEpsilon(){return!1}get label(){return null}},x=class extends d{static{__name(this,"SetTransition")}set;constructor(t,e){super(t),this.set=e||p.of(n.INVALID_TYPE,n.INVALID_TYPE)}get transitionType(){return d.SET}get label(){return this.set}matches(t,e,r){return this.set.contains(t)}toString(){return this.set.toString()}},E=class extends x{static{__name(this,"NotSetTransition")}get transitionType(){return d.NOT_SET}matches(t,e,r){return t>=e&&t<=r&&!super.matches(t,e,r)}toString(){return"~"+super.toString()}},C=class _PredictionContext{static{__name(this,"PredictionContext")}static EMPTY_RETURN_STATE=2147483647;static EMPTY;static traceATNSimulator=!1;#e;constructor(t){this.#e=t}static calculateEmptyHashCode(){let t=u.initialize(31);return t=u.finish(t,0),t}static calculateHashCodeSingle(t,e){let r=u.initialize(31);return r=u.updateFromComparable(r,t),r=u.update(r,e),r=u.finish(r,2),r}static calculateHashCodeList(t,e){let r=u.initialize(31);for(const e of t)r=u.updateFromComparable(r,e);for(const t of e)r=u.update(r,t);return r=u.finish(r,2*t.length),r}isEmpty(){return!1}hasEmptyPath(){return this.getReturnState(this.length-1)===_PredictionContext.EMPTY_RETURN_STATE}hashCode(){return this.#e}toString(t){return""}},g=__name((t=>null===t?"null":t),"valueToString"),A=__name((t=>Array.isArray(t)?"["+t.map(g).join(", ")+"]":"null"),"arrayToString"),P=__name(((t,e)=>{if(t===e)return!0;if(t.length!==e.length)return!1;for(let r=0;r{if(t===e)return!0;if(t.length!==e.length)return!1;for(let r=0;r(t=t.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),e&&(t=t.replace(/ /g,"·")),t)),"escapeWhitespace"),O=class _ArrayPredictionContext extends C{static{__name(this,"ArrayPredictionContext")}parents=[];returnStates=[];constructor(t,e){return super(C.calculateHashCodeList(t,e)),this.parents=t,this.returnStates=e,this}isEmpty(){return this.returnStates[0]===C.EMPTY_RETURN_STATE}get length(){return this.returnStates.length}getParent(t){return this.parents[t]}getReturnState(t){return this.returnStates[t]}equals(t){return this===t||t instanceof _ArrayPredictionContext&&this.hashCode()===t.hashCode()&&(m(this.returnStates,t.returnStates)&&P(this.parents,t.parents))}toString(){if(this.isEmpty())return"[]";const t=[];for(let e=0;e":this.symbol?.text??""}toStringTree(){return this.toString()}},R=class extends S{static{__name(this,"ErrorNode")}accept(t){return t.visitErrorNode(this)}},L=class _CommonToken{static{__name(this,"CommonToken")}static EMPTY_SOURCE=[null,null];source;tokenIndex;start;stop;type;line;column;channel;#i;constructor(t){this.type=t.type,this.source=t.source,this.tokenIndex=t.tokenIndex??-1,this.line=t.line??0,this.column=t.column??-1,this.channel=t.channel??n.DEFAULT_CHANNEL,this.start=t.start??0,this.stop=t.stop??0,this.#i=t.text,null!==t.source[0]&&(this.line=t.source[0].line,this.column=t.source[0].column)}static fromToken(t){const e=[t.tokenSource,t.inputStream];return new _CommonToken({type:t.type,line:t.line,tokenIndex:t.tokenIndex,column:t.column,channel:t.channel,start:t.start,stop:t.stop,text:t.text,source:e})}static fromType(t,e){return new _CommonToken({type:t,text:e,source:_CommonToken.EMPTY_SOURCE})}static fromSource(t,e,r,s,i){return new _CommonToken({type:e,channel:r,start:s,stop:i,source:t})}get tokenSource(){return this.source[0]}get inputStream(){return this.source[1]}set inputStream(t){this.source[1]=t}clone(){return new _CommonToken({source:this.source,type:this.type,channel:this.channel,start:this.start,stop:this.stop,tokenIndex:this.tokenIndex,line:this.line,column:this.column,text:this.#i})}toString(t){let e="";this.channel>0&&(e=",channel="+this.channel);let r=this.text;r?(r=r.replace(/\n/g,"\\n"),r=r.replace(/\r/g,"\\r"),r=r.replace(/\t/g,"\\t")):r="";let s=String(this.type);return t&&(s=t.vocabulary.getDisplayName(this.type)??""),"[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+r+"',<"+s+">"+e+","+this.line+":"+this.column+"]"}get text(){if(void 0!==this.#i)return this.#i;const t=this.inputStream;if(!t)return;const e=t.size;return this.start"}set text(t){this.#i=t}setText(t){this.#i=t}setType(t){this.type=t}setLine(t){this.line=t}setCharPositionInLine(t){this.column=t}setChannel(t){this.channel=t}setTokenIndex(t){this.tokenIndex=t}},N=class _Trees{static{__name(this,"Trees")}static toStringTree(t,e,r){e=e??null,null!==(r=r??null)&&(e=r.ruleNames);let s=_Trees.getNodeText(t,e);s=T(s,!1);const i=t.getChildCount();if(0===i)return s;let n="("+s+" ";i>0&&(s=_Trees.toStringTree(t.getChild(0),e),n=n.concat(s));for(let r=1;r=t.start.tokenIndex&&(null===t.stop||r<=t.stop.tokenIndex)?t:null}static stripChildrenOutOfRange(t,e,r,s){if(null!==t)for(let i=0;is)&&this.isAncestorOf(o,e)){const e=L.fromType(n.INVALID_TYPE,"...");t.children[i]=new S(e)}}}static doFindAllNodes(t,e,r,s){r&&t instanceof S?t.symbol?.type===e&&s.push(t):!r&&t instanceof _&&t.ruleIndex===e&&s.push(t);for(let i=0;i{t instanceof R&&(this.children.push(t),t.parent=this)}))}enterRule(t){}exitRule(t){}addChild(t){return this.children.push(t),t}removeLastChild(){this.children.pop()}addTokenNode(t){const e=new S(t);return this.children.push(e),e.parent=this,e}addErrorNode(t){return t.parent=this,this.children.push(t),t}getChild(t,e){if(t<0||t>=this.children.length)return null;if(!e)return this.children[t];for(const r of this.children)if(r instanceof e){if(0===t)return r;t-=1}return null}getToken(t,e){if(e<0||e>=this.children.length)return null;for(const r of this.children)if("symbol"in r&&r.symbol?.type===t){if(0===e)return r;e-=1}return null}getTokens(t){const e=[];for(const r of this.children)"symbol"in r&&r.symbol?.type===t&&e.push(r);return e}getRuleContext(t,e){return this.getChild(t,e)}getRuleContexts(t){const e=[];for(const r of this.children)r instanceof t&&e.push(r);return e}getChildCount(){return this.children.length}getSourceInterval(){return null===this.start||null===this.stop?h.INVALID_INTERVAL:new h(this.start.tokenIndex,this.stop.tokenIndex)}get parent(){return this.#n}set parent(t){this.#n=t}depth(){let t=0,e=this;for(;null!==e;)e=e.parent,t+=1;return t}isEmpty(){return-1===this.invokingState}get ruleContext(){return this}get ruleIndex(){return-1}getPayload(){return this}getText(){return 0===this.children.length?"":this.children.map((t=>t.getText())).join("")}getAltNumber(){return Z.INVALID_ALT_NUMBER}setAltNumber(t){}accept(t){return t.visitChildren(this)}toStringTree(...t){return 1===t.length?N.toStringTree(this,null,t[0]):N.toStringTree(this,t[0],t[1])}toString(t,e){t=t??null,e=e??null;let r=this,s="[";for(;null!==r&&r!==e;){if(null===t)r.isEmpty()||(s+=r.invokingState);else{const e=r.ruleIndex;s+=e>=0&&ethis.#u&&this.expand();const e=this.getBucket(t);let r=this.#h[e];if(!r)return r=[t],this.#h[e]=r,++this.#l,t;for(const e of r)if(this.#c.equals(e,t))return e;return r.push(t),++this.#l,t}get(t){if(null==t)return t;const e=this.getBucket(t),r=this.#h[e];if(r)for(const e of r)if(this.#c.equals(e,t))return e}hashCode(){let t=u.initialize();for(const e of this.#h)if(null!=e)for(const r of e){if(null==r)break;t=u.update(t,this.#c.hashCode(r))}return t=u.finish(t,this.size),t}equals(t){return t===this||t instanceof _HashSet&&(t.size===this.size&&this.containsAll(t))}add(t){return this.getOrAdd(t)===t}contains(t){return this.containsFast(t)}containsFast(t){return null!=t&&void 0!==this.get(t)}*[Symbol.iterator](){yield*this.toArray()}toArray(){const t=new Array(this.size);let e=0;for(const r of this.#h)if(null!=r)for(const s of r){if(null==s)break;t[e++]=s}return t}containsAll(t){if(t instanceof _HashSet){for(const e of t.#h)if(null!=e)for(const t of e){if(null==t)break;if(!this.containsFast(t))return!1}}else for(const e of t)if(!this.containsFast(e))return!1;return!0}addAll(t){let e=!1;for(const r of t){this.getOrAdd(r)!==r&&(e=!0)}return e}clear(){this.#h=this.createBuckets(_HashSet.#a),this.#l=0,this.#u=Math.floor(_HashSet.#a*_HashSet.#o)}toString(){if(0===this.size)return"{}";let t="{",e=!0;for(const r of this.#h)if(null!=r)for(const s of r){if(null==s)break;e?e=!1:t+=", ",t+=s.toString()}return t+="}",t}toTableString(){let t="";for(const e of this.#h){if(null==e){t+="null\n";continue}t+="[";let r=!0;for(const s of e)r?r=!1:t+=" ",t+=null==s?"_":s.toString();t+="]\n"}return t}getBucket(t){return this.#c.hashCode(t)&this.#h.length-1}expand(){const t=this.#h,e=2*this.#h.length,r=this.createBuckets(e);this.#h=r,this.#u=Math.floor(e*_HashSet.#o);for(const e of t)if(e)for(const t of e){const e=this.getBucket(t);let r=this.#h[e];r||(r=[],this.#h[e]=r),r.push(t)}}get size(){return this.#l}get isEmpty(){return 0===this.#l}createBuckets(t){return new Array(t)}},M=class{static{__name(this,"MapKeyEqualityComparator")}keyComparator;constructor(t){this.keyComparator=t}hashCode(t){return this.keyComparator.hashCode(t.key)}equals(t,e){return this.keyComparator.equals(t.key,e.key)}},k=class _HashMap{static{__name(this,"HashMap")}backingStore;constructor(t){this.backingStore=new D(t instanceof _HashMap?t.backingStore:new M(t))}clear(){this.backingStore.clear()}containsKey(t){return this.backingStore.contains({key:t})}get(t){const e=this.backingStore.get({key:t});if(e)return e.value}get isEmpty(){return this.backingStore.isEmpty}set(t,e){const r=this.backingStore.get({key:t,value:e});let s;return r?(s=r.value,r.value=e):this.backingStore.add({key:t,value:e}),s}setIfAbsent(t,e){const r=this.backingStore.get({key:t,value:e});let s;return r?s=r.value:this.backingStore.add({key:t,value:e}),s}values(){return this.backingStore.toArray().map((t=>t.value))}get size(){return this.backingStore.size}hashCode(){return this.backingStore.hashCode()}equals(t){return this.backingStore.equals(t.backingStore)}},w=__name(((t,e)=>{if(e||(e=_.empty),!e.parent||e===_.empty)return C.EMPTY;const r=w(t,e.parent),s=t.states[e.invokingState].transitions[0];return f.create(r,s.followState.stateNumber)}),"predictionContextFromRuleContext"),b=__name(((t,e,r)=>{if(t.isEmpty())return t;let s=r.get(t);if(s)return s;if(s=e.get(t),s)return r.set(t,s),s;let i,n=!1,o=[];for(let s=0;s{if(t===e)return t;if(t instanceof f&&e instanceof f)return B(t,e,r,s);if(r){if(t instanceof I)return t;if(e instanceof I)return e}return t instanceof f&&(t=new O([t.parent],[t.returnState])),e instanceof f&&(e=new O([e.parent],[e.returnState])),U(t,e,r,s)}),"merge"),U=__name(((t,e,r,s)=>{if(s){let r=s.get(t,e);if(r)return r;if(r=s.get(e,t),r)return r}let i=0,n=0,o=0,a=new Array(t.returnStates.length+e.returnStates.length).fill(0),c=new Array(t.returnStates.length+e.returnStates.length).fill(null);for(;i a"),t):h.equals(e)?(null!==s&&s.set(t,e,e),e):(F(c),null!==s&&s.set(t,e,h),C.traceATNSimulator&&console.log("mergeArrays a="+t+",b="+e+" -> "+h),h)}),"mergeArrays"),F=__name((t=>{const e=new k(v.instance);for(const r of t)r&&(e.containsKey(r)||e.set(r,r));for(let r=0;r{if(null!==s){let r=s.get(t,e);if(null!==r)return r;if(r=s.get(e,t),null!==r)return r}const i=H(t,e,r);if(null!==i)return null!==s&&s.set(t,e,i),i;if(t.returnState===e.returnState){const i=V(t.parent,e.parent,r,s);if(i===t.parent)return t;if(i===e.parent)return e;const n=f.create(i,t.returnState);return null!==s&&s.set(t,e,n),n}{let r=null;if((t===e||null!==t.parent&&t.parent===e.parent)&&(r=t.parent),null!==r){const i=[t.returnState,e.returnState];t.returnState>e.returnState&&(i[0]=e.returnState,i[1]=t.returnState);const n=new O([r,r],i);return null!==s&&s.set(t,e,n),n}const i=[t.returnState,e.returnState];let n=[t.parent,e.parent];t.returnState>e.returnState&&(i[0]=e.returnState,i[1]=t.returnState,n=[e.parent,t.parent]);const o=new O(n,i);return null!==s&&s.set(t,e,o),o}}),"mergeSingletons"),H=__name(((t,e,r)=>{if(r){if(t===C.EMPTY||e===C.EMPTY)return C.EMPTY}else{if(t===C.EMPTY&&e===C.EMPTY)return C.EMPTY;if(t===C.EMPTY){const t=[e.returnState,C.EMPTY_RETURN_STATE],r=[e.parent,null];return new O(r,t)}if(e===C.EMPTY){const e=[t.returnState,C.EMPTY_RETURN_STATE],r=[t.parent,null];return new O(r,e)}}return null}),"mergeRoot"),z=class{static{__name(this,"BitSet")}data;constructor(t){this.data=t?new Uint32Array(t.map((t=>t>>>0))):new Uint32Array(1)}[Symbol.iterator](){const t=this.data.length;let e=0,r=this.data[e];const s=this.data;return{[Symbol.iterator](){return this},next:()=>{for(;e>>5]&=~(1<>>5;return!(e>=this.data.length)&&!!(this.data[e]&1<t)return e}set(t){if(t<0)throw new RangeError("index cannot be negative");this.resize(t),this.data[t>>>5]|=1<>>5;if(e<=this.data.length)return;const r=new Uint32Array(e);r.set(this.data),r.fill(0,this.data.length),this.data=r}bitCount(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,63&(t+=t>>16)}},G=class _ATNState{static{__name(this,"ATNState")}static INVALID_STATE_NUMBER=-1;static INVALID_TYPE=0;static BASIC=1;static RULE_START=2;static BLOCK_START=3;static PLUS_BLOCK_START=4;static STAR_BLOCK_START=5;static TOKEN_START=6;static RULE_STOP=7;static BLOCK_END=8;static STAR_LOOP_BACK=9;static STAR_LOOP_ENTRY=10;static PLUS_LOOP_BACK=11;static LOOP_END=12;static stateType=_ATNState.INVALID_STATE_NUMBER;stateNumber=0;ruleIndex=0;epsilonOnlyTransitions=!1;nextTokenWithinRule;transitions=[];hashCode(){return this.stateNumber}equals(t){return this.stateNumber===t.stateNumber}toString(){return`${this.stateNumber}`}addTransitionAtIndex(t,e){0===this.transitions.length?this.epsilonOnlyTransitions=e.isEpsilon:this.epsilonOnlyTransitions!==e.isEpsilon&&(this.epsilonOnlyTransitions=!1),this.transitions.splice(t,1,e)}addTransition(t){0===this.transitions.length?this.epsilonOnlyTransitions=t.isEpsilon:this.epsilonOnlyTransitions!==t.isEpsilon&&(this.epsilonOnlyTransitions=!1),this.transitions.push(t)}setTransition(t,e){this.transitions.splice(t,1,e)}removeTransition(t){return this.transitions.splice(t,1)[0]}},q=class _SemanticContext{static{__name(this,"SemanticContext")}cachedHashCode;static andContext(t,e){if(null===t||t===_SemanticContext.NONE)return e;if(null===e||e===_SemanticContext.NONE)return t;const r=new $(t,e);return 1===r.operands.length?r.operands[0]:r}static orContext(t,e){if(null===t)return e;if(null===e)return t;if(t===_SemanticContext.NONE||e===_SemanticContext.NONE)return _SemanticContext.NONE;const r=new W(t,e);return 1===r.operands.length?r.operands[0]:r}static filterPrecedencePredicates(t){const e=[];for(const r of t)r instanceof _SemanticContext.PrecedencePredicate&&e.push(r);return e}evalPrecedence(t,e){return this}},$=class _AND extends q{static{__name(this,"AND")}operands;constructor(t,e){super();const r=new D;t instanceof _AND?t.operands.forEach((t=>{r.add(t)})):r.add(t),e instanceof _AND?e.operands.forEach((t=>{r.add(t)})):r.add(e);const s=q.filterPrecedencePredicates(r);if(s.length>0){let t=null;s.forEach((e=>{(null===t||e.precedence{i=null===i?t:q.andContext(i,t)})),i}toString(){const t=this.operands.map((t=>t.toString()));return(t.length>3?t.slice(3):t).join("&&")}},W=class _OR extends q{static{__name(this,"OR")}operands;constructor(t,e){super();const r=new D;t instanceof _OR?t.operands.forEach((t=>{r.add(t)})):r.add(t),e instanceof _OR?e.operands.forEach((t=>{r.add(t)})):r.add(e);const s=q.filterPrecedencePredicates(r);if(s.length>0){const t=s.sort(((t,e)=>t.compareTo(e))),e=t[t.length-1];r.add(e)}this.operands=r.toArray()}equals(t){return this===t||t instanceof _OR&&P(this.operands,t.operands)}hashCode(){if(void 0===this.cachedHashCode){let t=u.initialize();for(const e of this.operands)t=u.updateFromComparable(t,e);t=u.update(t,3383313031),this.cachedHashCode=u.finish(t,this.operands.length+1)}return this.cachedHashCode}evaluate(t,e){for(const r of this.operands)if(r.evaluate(t,e))return!0;return!1}evalPrecedence(t,e){let r=!1;const s=[];for(const i of this.operands){const n=i.evalPrecedence(t,e);if(r||=n!==i,n===q.NONE)return q.NONE;null!==n&&s.push(n)}if(!r)return this;if(0===s.length)return null;let i=null;return s.forEach((t=>{i=null===i?t:q.orContext(i,t)})),i}toString(){const t=this.operands.map((t=>t.toString()));return(t.length>3?t.slice(3):t).join("||")}};(t=>{class Predicate extends t{static{__name(this,"Predicate")}ruleIndex;predIndex;isCtxDependent;constructor(t,e,r){super(),this.ruleIndex=t??-1,this.predIndex=e??-1,this.isCtxDependent=r??!1}evaluate(t,e){const r=this.isCtxDependent?e:null;return t.sempred(r,this.ruleIndex,this.predIndex)}hashCode(){if(void 0===this.cachedHashCode){let t=u.initialize();t=u.update(t,this.ruleIndex),t=u.update(t,this.predIndex),t=u.update(t,this.isCtxDependent?1:0),t=u.finish(t,3),this.cachedHashCode=t}return this.cachedHashCode}equals(t){return this===t||this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}t.Predicate=Predicate;class PrecedencePredicate extends t{static{__name(this,"PrecedencePredicate")}precedence;constructor(t){super(),this.precedence=t??0}evaluate(t,e){return t.precpred(e,this.precedence)}evalPrecedence(e,r){return e.precpred(r??null,this.precedence)?t.NONE:null}compareTo(t){return this.precedence-t.precedence}hashCode(){return 31+this.precedence}equals(t){return this===t||this.precedence===t.precedence}toString(){return"{"+this.precedence+">=prec}?"}}t.PrecedencePredicate=PrecedencePredicate,t.NONE=new Predicate})(q||(q={}));var X,Y=class _ATNConfig{static{__name(this,"ATNConfig")}state;alt;reachesIntoOuterContext=!1;precedenceFilterSuppressed=!1;get semanticContext(){return this.#p}cachedHashCode;#d=null;#p;constructor(t,e,r,s){this.state=e,this.alt=t.alt,this.context=r,this.#p=s??q.NONE,this.reachesIntoOuterContext=t.reachesIntoOuterContext,void 0!==t.precedenceFilterSuppressed&&(this.precedenceFilterSuppressed=t.precedenceFilterSuppressed)}static duplicate(t,e){return new _ATNConfig(t,t.state,t.context,e??t.semanticContext)}static createWithContext(t,e,r,s){return new _ATNConfig({alt:e},t,r,s)}static createWithConfig(t,e,r){return new _ATNConfig(e,t,r??e.context,e.semanticContext)}static createWithSemanticContext(t,e,r){return new _ATNConfig(e,t??e.state,e.context,r)}hashCode(){if(void 0===this.cachedHashCode){let t=u.initialize(7);t=u.update(t,this.state.stateNumber),t=u.update(t,this.alt),t=u.updateFromComparable(t,this.#d),t=u.updateFromComparable(t,this.semanticContext),t=u.finish(t,4),this.cachedHashCode=t}return this.cachedHashCode}get context(){return this.#d}set context(t){this.#d=t,this.cachedHashCode=void 0}equals(t){return this===t||this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&(null===this.context?null===t.context:this.context.equals(t.context))&&this.semanticContext.equals(t.semanticContext)&&this.precedenceFilterSuppressed===t.precedenceFilterSuppressed}toString(t,e=!0){let r="";return e&&(r=","+this.alt),"("+this.state+r+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==q.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext?",up="+this.reachesIntoOuterContext:"")+")"}},j=class _LL1Analyzer{static{__name(this,"LL1Analyzer")}static hitPredicate=n.INVALID_TYPE;#x;getDecisionLookahead(t){if(!t)return;const e=t.transitions.length,r=new Array(e);for(let s=0;s0&&!e.contains(_LL1Analyzer.hitPredicate)&&(r[s]=e)}return r}look(t,e,r,s){this.#x=t;const i=new p,n=s?w(t,s):null;return this.doLook(e,r,n,i,new D,new z,!0,!0),i}doLook(t,e,r,s,i,o,a,c){const h=Y.createWithContext(t,0,r);if(!i.get(h)){if(i.add(h),t===e){if(!r)return void s.addOne(n.EPSILON);if(r.isEmpty()&&c)return void s.addOne(n.EOF)}if(t.constructor.stateType===G.RULE_STOP){if(!r)return void s.addOne(n.EPSILON);if(r.isEmpty()&&c)return void s.addOne(n.EOF);if(r!==C.EMPTY){const n=o.get(t.ruleIndex);try{o.clear(t.ruleIndex);for(let t=0;t=this.states.length)throw new Error("Invalid state number.");const r=this.states[t];let s=this.nextTokens(r);if(!s.contains(n.EPSILON))return s;let i=e;const o=new p;for(o.addSet(s),o.removeOne(n.EPSILON);null!==i&&i.invokingState>=0&&s.contains(n.EPSILON);){const t=this.states[i.invokingState].transitions[0];s=this.nextTokens(t.followState),o.addSet(s),o.removeOne(n.EPSILON),i=i.parent}return s.contains(n.EPSILON)&&o.addOne(n.EOF),o}},K=class _KeyTypeEqualityComparer{static{__name(this,"KeyTypeEqualityComparer")}static instance=new _KeyTypeEqualityComparer;hashCode(t){let e=7;return e=31*e+t.state.stateNumber,e=31*e+t.alt,e=31*e+t.semanticContext.hashCode(),e}equals(t,e){return t===e||t.state.stateNumber===e.state.stateNumber&&t.alt===e.alt&&t.semanticContext.equals(e.semanticContext)}},Q=class{static{__name(this,"ATNConfigSet")}configLookup=new D(K.instance);configs=[];uniqueAlt=0;hasSemanticContext=!1;dipsIntoOuterContext=!1;fullCtx=!1;readOnly=!1;conflictingAlts=null;firstStopState;#e=-1;constructor(t){if(void 0!==t)if("boolean"==typeof t)this.fullCtx=t??!0;else{const e=t;this.addAll(e.configs),this.uniqueAlt=e.uniqueAlt,this.conflictingAlts=e.conflictingAlts,this.hasSemanticContext=e.hasSemanticContext,this.dipsIntoOuterContext=e.dipsIntoOuterContext}}[Symbol.iterator](){return this.configs[Symbol.iterator]()}add(t,e=null){if(this.readOnly)throw new Error("This set is readonly");this.firstStopState||t.state.constructor.stateType!==G.RULE_STOP||(this.firstStopState=t),this.hasSemanticContext||=t.semanticContext!==q.NONE,this.dipsIntoOuterContext||=t.reachesIntoOuterContext;const r=this.configLookup.getOrAdd(t);if(r===t)return this.#e=-1,void this.configs.push(t);const s=!this.fullCtx,i=V(r.context,t.context,s,e);r.reachesIntoOuterContext||=t.reachesIntoOuterContext,r.precedenceFilterSuppressed||=t.precedenceFilterSuppressed,r.context=i}get elements(){return this.configs}getAlts(){const t=new z;for(const e of this.configs)t.set(e.alt);return t}getPredicates(){const t=[];for(const e of this.configs)e.semanticContext!==q.NONE&&t.push(e.semanticContext);return t}getStates(){const t=new D;for(const e of this.configs)t.add(e.state);return t}optimizeConfigs(t){if(this.readOnly)throw new Error("This set is readonly");if(0!==this.configLookup.size)for(const e of this.configs)e.context=t.getCachedContext(e.context)}addAll(t){for(const e of t)this.add(e);return!1}equals(t){return this===t||!(this.fullCtx!==t.fullCtx||this.uniqueAlt!==t.uniqueAlt||this.conflictingAlts!==t.conflictingAlts||this.hasSemanticContext!==t.hasSemanticContext||this.dipsIntoOuterContext!==t.dipsIntoOuterContext||!P(this.configs,t.configs))}hashCode(){return-1===this.#e&&(this.#e=this.computeHashCode()),this.#e}get length(){return this.configs.length}isEmpty(){return 0===this.configs.length}contains(t){if(null===this.configLookup)throw new Error("This method is not implemented for readonly sets.");return this.configLookup.contains(t)}containsFast(t){if(null===this.configLookup)throw new Error("This method is not implemented for readonly sets.");return this.configLookup.contains(t)}clear(){if(this.readOnly)throw new Error("This set is readonly");this.configs=[],this.#e=-1,this.configLookup=new D(K.instance)}setReadonly(t){this.readOnly=t,t&&(this.configLookup=null)}toString(){return A(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==Z.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")}computeHashCode(){let t=u.initialize();return this.configs.forEach((e=>{t=u.update(t,e.hashCode())})),t=u.finish(t,this.configs.length),t}},J=class extends G{static{__name(this,"BasicState")}static stateType=G.BASIC},tt=class extends G{static{__name(this,"DecisionState")}decision=-1;nonGreedy=!1},et=class extends tt{static{__name(this,"BlockStartState")}endState},rt=class extends G{static{__name(this,"BlockEndState")}static stateType=G.BLOCK_END;startState},st=class extends G{static{__name(this,"LoopEndState")}static stateType=G.LOOP_END;loopBackState},it=class extends G{static{__name(this,"RuleStartState")}static stateType=G.RULE_START;stopState;isLeftRecursiveRule=!1;isPrecedenceRule=!1},nt=class extends G{static{__name(this,"RuleStopState")}static stateType=G.RULE_STOP},ot=class extends tt{static{__name(this,"TokensStartState")}static stateType=G.TOKEN_START},at=class extends tt{static{__name(this,"PlusLoopbackState")}static stateType=G.PLUS_LOOP_BACK},ct=class extends G{static{__name(this,"StarLoopbackState")}static stateType=G.STAR_LOOP_BACK},ht=class extends tt{static{__name(this,"StarLoopEntryState")}static stateType=G.STAR_LOOP_ENTRY;loopBackState;precedenceRuleDecision=!1},lt=class extends et{static{__name(this,"PlusBlockStartState")}static stateType=G.PLUS_BLOCK_START;loopBackState},ut=class extends et{static{__name(this,"StarBlockStartState")}static stateType=G.STAR_BLOCK_START},pt=class extends et{static{__name(this,"BasicBlockStartState")}static stateType=G.BLOCK_START},dt=class extends d{static{__name(this,"AtomTransition")}labelValue;#C;constructor(t,e){super(t),this.labelValue=e,this.#C=p.of(e,e)}get label(){return this.#C}get transitionType(){return d.ATOM}matches(t){return this.labelValue===t}toString(){return this.labelValue.toString()}},xt=class extends d{static{__name(this,"RuleTransition")}ruleIndex;precedence;followState;constructor(t,e,r,s){super(t),this.ruleIndex=e,this.precedence=r,this.followState=s}get isEpsilon(){return!0}get transitionType(){return d.RULE}matches(t,e,r){return!1}},Et=class extends d{static{__name(this,"RangeTransition")}start;stop;#C=new p;constructor(t,e,r){super(t),this.start=e,this.stop=r,this.#C.addRange(e,r)}get label(){return this.#C}get transitionType(){return d.RANGE}matches(t,e,r){return t>=this.start&&t<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}},Ct=class extends d{static{__name(this,"ActionTransition")}ruleIndex;actionIndex;isCtxDependent;constructor(t,e,r,s){super(t),this.ruleIndex=e,this.actionIndex=void 0===r?-1:r,this.isCtxDependent=void 0!==s&&s}get isEpsilon(){return!0}get transitionType(){return d.ACTION}matches(t,e,r){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}},gt=class extends d{static{__name(this,"EpsilonTransition")}#g;constructor(t,e=-1){super(t),this.#g=e}get outermostPrecedenceReturn(){return this.#g}get isEpsilon(){return!0}get transitionType(){return d.EPSILON}matches(){return!1}toString(){return"epsilon"}},At=class extends d{static{__name(this,"WildcardTransition")}get transitionType(){return d.WILDCARD}matches(t,e,r){return t>=e&&t<=r}toString(){return"."}},Pt=class extends d{static{__name(this,"AbstractPredicateTransition")}constructor(t){super(t)}},mt=class extends Pt{static{__name(this,"PredicateTransition")}ruleIndex;predIndex;isCtxDependent;constructor(t,e,r,s){super(t),this.ruleIndex=e,this.predIndex=r,this.isCtxDependent=s}get isEpsilon(){return!0}matches(t,e,r){return!1}get transitionType(){return d.PREDICATE}getPredicate(){return new q.Predicate(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}},Tt=class extends Pt{static{__name(this,"PrecedencePredicateTransition")}precedence;constructor(t,e){super(t),this.precedence=e}get isEpsilon(){return!0}matches(t,e,r){return!1}getPredicate(){return new q.PrecedencePredicate(this.precedence)}get transitionType(){return d.PRECEDENCE}toString(){return this.precedence+" >= _p"}},Ot=0,ft=1,It=2,St=3,Rt=4,Lt=5,Nt=6,_t=7,vt=class _LexerSkipAction{static{__name(this,"LexerSkipAction")}static instance=new _LexerSkipAction;actionType;isPositionDependent=!1;constructor(){this.actionType=Nt}equals(t){return t===this}hashCode(){return Nt}execute(t){t.skip()}toString(){return"skip"}},yt=class _LexerChannelAction{static{__name(this,"LexerChannelAction")}channel;actionType;isPositionDependent=!1;#e;constructor(t){this.actionType=Ot,this.channel=t}execute(t){t.channel=this.channel}hashCode(){if(void 0===this.#e){let t=u.initialize();t=u.update(t,this.actionType),t=u.update(t,this.channel),this.#e=u.finish(t,2)}return this.#e}equals(t){return this===t||t instanceof _LexerChannelAction&&this.channel===t.channel}toString(){return"channel("+this.channel+")"}},Dt=class _LexerCustomAction{static{__name(this,"LexerCustomAction")}ruleIndex;actionIndex;actionType;isPositionDependent=!0;#e;constructor(t,e){this.actionType=ft,this.ruleIndex=t,this.actionIndex=e}execute(t){t.action(null,this.ruleIndex,this.actionIndex)}hashCode(){if(void 0===this.#e){let t=u.initialize();t=u.update(t,this.actionType),t=u.update(t,this.ruleIndex),t=u.update(t,this.actionIndex),this.#e=u.finish(t,3)}return this.#e}equals(t){return this===t||t instanceof _LexerCustomAction&&(this.ruleIndex===t.ruleIndex&&this.actionIndex===t.actionIndex)}},Mt=class _LexerMoreAction{static{__name(this,"LexerMoreAction")}static instance=new _LexerMoreAction;actionType;isPositionDependent=!1;constructor(){this.actionType=St}equals(t){return t===this}hashCode(){return St}execute(t){t.more()}toString(){return"more"}},kt=class _LexerTypeAction{static{__name(this,"LexerTypeAction")}type;actionType;isPositionDependent=!1;#e;constructor(t){this.actionType=_t,this.type=t}execute(t){t.type=this.type}hashCode(){if(void 0===this.#e){let t=u.initialize();t=u.update(t,this.actionType),t=u.update(t,this.type),this.#e=u.finish(t,2)}return this.#e}equals(t){return this===t||t instanceof _LexerTypeAction&&this.type===t.type}toString(){return"type("+this.type+")"}},wt=class _LexerPushModeAction{static{__name(this,"LexerPushModeAction")}mode;actionType;isPositionDependent=!1;#e;constructor(t){this.actionType=Lt,this.mode=t}execute(t){t.pushMode(this.mode)}hashCode(){if(void 0===this.#e){let t=u.initialize();t=u.update(t,this.actionType),t=u.update(t,this.mode),this.#e=u.finish(t,2)}return this.#e}equals(t){return this===t||t instanceof _LexerPushModeAction&&this.mode===t.mode}toString(){return"pushMode("+this.mode+")"}},bt=class _LexerPopModeAction{static{__name(this,"LexerPopModeAction")}static instance=new _LexerPopModeAction;actionType;isPositionDependent=!1;constructor(){this.actionType=Rt}equals(t){return t===this}hashCode(){return Rt}execute(t){t.popMode()}toString(){return"popMode"}},Vt=class _LexerModeAction{static{__name(this,"LexerModeAction")}mode;actionType;isPositionDependent=!1;#e;constructor(t){this.actionType=It,this.mode=t}execute(t){t.mode=this.mode}hashCode(){if(void 0===this.#e){let t=u.initialize();t=u.update(t,this.actionType),t=u.update(t,this.mode),this.#e=u.finish(t,2)}return this.#e}equals(t){return this===t||t instanceof _LexerModeAction&&this.mode===t.mode}toString(){return"mode("+this.mode+")"}},Ut=class _ATNDeserializer{static{__name(this,"ATNDeserializer")}static SERIALIZED_VERSION=4;static stateTypeMapper=new Map([[G.INVALID_TYPE,void 0],[G.BASIC,J],[G.RULE_START,it],[G.BLOCK_START,pt],[G.PLUS_BLOCK_START,lt],[G.STAR_BLOCK_START,ut],[G.TOKEN_START,ot],[G.RULE_STOP,nt],[G.BLOCK_END,rt],[G.STAR_LOOP_BACK,ct],[G.STAR_LOOP_ENTRY,ht],[G.PLUS_LOOP_BACK,at],[G.LOOP_END,st]]);static lexerActionFactoryMapper=new Map([[Ot,t=>new yt(t)],[ft,(t,e)=>new Dt(t,e)],[It,t=>new Vt(t)],[St,()=>Mt.instance],[Rt,()=>bt.instance],[Lt,t=>new wt(t)],[Nt,()=>vt.instance],[_t,t=>new kt(t)]]);data=[];pos=0;deserializationOptions;actionFactories;constructor(t){t||(t={readOnly:!1,verifyATN:!0,generateRuleBypassTransitions:!1}),this.deserializationOptions=t}deserialize(t){this.data=t,this.checkVersion();const e=this.readATN();this.readStates(e),this.readRules(e),this.readModes(e);const r=[];return this.readSets(e,r),this.readEdges(e,r),this.readDecisions(e),this.readLexerActions(e),this.markPrecedenceDecisions(e),this.verifyATN(e),this.deserializationOptions.generateRuleBypassTransitions&&e.grammarType===Z.PARSER&&(this.generateRuleBypassTransitions(e),this.verifyATN(e)),e}checkVersion(){const t=this.data[this.pos++];if(t!==_ATNDeserializer.SERIALIZED_VERSION)throw new Error("Could not deserialize ATN with version "+t+" (expected "+_ATNDeserializer.SERIALIZED_VERSION+").")}readATN(){const t=this.data[this.pos++],e=this.data[this.pos++];return new Z(t,e)}readStates(t){let e,r;const s=[],i=[],n=this.data[this.pos++];for(let e=0;e0;)i.addTransition(c.transitions[h-1]),c.transitions=c.transitions.slice(-1);t.ruleToStartState[e].addTransition(new gt(i)),a&&n.addTransition(new gt(a));const l=new J;t.addState(l),l.addTransition(new dt(n,t.ruleToTokenType[e])),i.addTransition(new gt(l))}stateIsEndStateFor(t,e){if(t.ruleIndex!==e)return null;if(!(t instanceof ht))return null;const r=t.transitions[t.transitions.length-1].target;return r instanceof st&&r.epsilonOnlyTransitions&&r.transitions[0].target instanceof nt?t:null}markPrecedenceDecisions(t){for(const e of t.states)if(e instanceof ht&&t.ruleToStartState[e.ruleIndex].isPrecedenceRule){const t=e.transitions[e.transitions.length-1].target;t instanceof st&&t.epsilonOnlyTransitions&&t.transitions[0].target instanceof nt&&(e.precedenceRuleDecision=!0)}}verifyATN(t){if(this.deserializationOptions.verifyATN)for(const e of t.states)if(null!==e)if(this.checkCondition(e.epsilonOnlyTransitions||e.transitions.length<=1),e instanceof lt)this.checkCondition(null!==e.loopBackState);else if(e instanceof ht)if(this.checkCondition(null!==e.loopBackState),this.checkCondition(2===e.transitions.length),e.transitions[0].target instanceof ut)this.checkCondition(e.transitions[1].target instanceof st),this.checkCondition(!e.nonGreedy);else{if(!(e.transitions[0].target instanceof st))throw new Error("IllegalState");this.checkCondition(e.transitions[1].target instanceof ut),this.checkCondition(e.nonGreedy)}else e instanceof ct?(this.checkCondition(1===e.transitions.length),this.checkCondition(e.transitions[0].target instanceof ht)):e instanceof st?this.checkCondition(null!==e.loopBackState):e instanceof it?this.checkCondition(null!==e.stopState):e instanceof et?this.checkCondition(null!==e.endState):e instanceof rt?this.checkCondition(null!==e.startState):e instanceof tt?this.checkCondition(e.transitions.length<=1||e.decision>=0):this.checkCondition(e.transitions.length<=1||e instanceof nt)}checkCondition(t,e){if(!t)throw null==e&&(e="IllegalState"),e}edgeFactory(t,e,r,s,i,o,a){const c=t.states[r];switch(e){case d.EPSILON:return new gt(c);case d.RANGE:return new Et(c,0!==o?n.EOF:s,i);case d.RULE:return new xt(t.states[s],i,o,c);case d.PREDICATE:return new mt(c,s,i,0!==o);case d.PRECEDENCE:return new Tt(c,s);case d.ATOM:return new dt(c,0!==o?n.EOF:s);case d.ACTION:return new Ct(c,s,i,0!==o);case d.SET:return new x(c,a[s]);case d.NOT_SET:return new E(c,a[s]);case d.WILDCARD:return new At(c);default:throw new Error("The specified transition type: "+e+" is not valid.")}}stateFactory(t,e){const r=_ATNDeserializer.stateTypeMapper.get(t);if(!r)throw new Error("The specified state type "+t+" is not valid.");const s=new r;return s.ruleIndex=e,s}lexerActionFactory(t,e,r){const s=_ATNDeserializer.lexerActionFactoryMapper.get(t);if(!s)throw new Error("The specified lexer action type "+t+" is not valid.");return s(e,r)}},Ft=class _OrderedHashMap extends k{static{__name(this,"OrderedHashMap")}#A=[];clear(){super.clear(),this.#A=[]}get(t){return super.get(t)}set(t,e){const r=super.set(t,e);return void 0===r&&this.#A.push(t),r}setIfAbsent(t,e){const r=super.setIfAbsent(t,e);return void 0===r&&this.#A.push(t),r}values(){return{[Symbol.iterator]:()=>{let t=0;return{next:()=>t0)for(const t of this.atn.modeToStartState)this.data.push(t.stateNumber)}addRuleStatesAndLexerTokenTypes(){const t=this.atn.ruleToStartState.length;this.data.push(t);for(let e=0;e",this.predicates?t+=A(this.predicates):t+=this.prediction),t.toString()}}),Ht=class{static{__name(this,"ATNSimulator")}static ERROR=Bt.fromState(2147483647);atn;sharedContextCache;constructor(t,e){return this.atn=t,this.sharedContextCache=e,this}getCachedContext(t){if(!this.sharedContextCache)return t;const e=new k(v.instance);return b(t,this.sharedContextCache,e)}},zt=(class _CodePointTransitions{static{__name(this,"CodePointTransitions")}static createWithCodePoint(t,e){return _CodePointTransitions.createWithCodePointRange(t,e,e)}static createWithCodePointRange(t,e,r){return e===r?new dt(t,e):new Et(t,e,r)}},class{static{__name(this,"DecisionInfo")}decision=0;invocations=0;timeInPrediction=0;sllTotalLook=0;sllMinLook=0;sllMaxLook=0;sllMaxLookEvent;llTotalLook=0;llMinLook=0;llMaxLook=0;llMaxLookEvent;contextSensitivities;errors;ambiguities;predicateEvals;sllATNTransitions=0;sllDFATransitions=0;llFallback=0;llATNTransitions=0;llDFATransitions=0;constructor(t){this.decision=t,this.contextSensitivities=[],this.errors=[],this.ambiguities=[],this.predicateEvals=[]}toString1(){return"{decision="+this.decision+", contextSensitivities="+this.contextSensitivities.length+", errors="+this.errors.length+", ambiguities="+this.ambiguities.length+", sllLookahead="+this.sllTotalLook+", sllATNTransitions="+this.sllATNTransitions+", sllDFATransitions="+this.sllDFATransitions+", llFallback="+this.llFallback+", llLookahead="+this.llTotalLook+", llATNTransitions="+this.llATNTransitions+"}"}}),Gt=class _LexerATNConfig extends Y{static{__name(this,"LexerATNConfig")}lexerActionExecutor;passedThroughNonGreedyDecision;constructor(t,e,r,s){return super(t,e,r??t.context,r?q.NONE:t.semanticContext),this.lexerActionExecutor=r?s:t.lexerActionExecutor??null,this.passedThroughNonGreedyDecision=_LexerATNConfig.checkNonGreedyDecision(t,this.state),this}static createWithExecutor(t,e,r){return new _LexerATNConfig(t,e,t.context,r)}static createWithConfig(t,e,r){return new _LexerATNConfig(e,t,r??null,e.lexerActionExecutor)}static createWithContext(t,e,r){return new _LexerATNConfig({alt:e},t,r,null)}static checkNonGreedyDecision(t,e){return t.passedThroughNonGreedyDecision||"nonGreedy"in e&&e.nonGreedy}hashCode(){if(void 0===this.cachedHashCode){let t=u.initialize(7);t=u.update(t,this.state.stateNumber),t=u.update(t,this.alt),t=u.updateFromComparable(t,this.context),t=u.updateFromComparable(t,this.semanticContext),t=u.update(t,this.passedThroughNonGreedyDecision?1:0),t=u.updateFromComparable(t,this.lexerActionExecutor),t=u.finish(t,6),this.cachedHashCode=t}return this.cachedHashCode}equals(t){return this===t||this.passedThroughNonGreedyDecision===t.passedThroughNonGreedyDecision&&(this.lexerActionExecutor&&t.lexerActionExecutor?this.lexerActionExecutor.equals(t.lexerActionExecutor):!t.lexerActionExecutor)&&super.equals(t)}},qt=class{static{__name(this,"BaseErrorListener")}syntaxError(t,e,r,s,i,n){}reportAmbiguity(t,e,r,s,i,n,o){}reportAttemptingFullContext(t,e,r,s,i,n){}reportContextSensitivity(t,e,r,s,i,n){}},$t=class _ConsoleErrorListener extends qt{static{__name(this,"ConsoleErrorListener")}static instance=new _ConsoleErrorListener;syntaxError(t,e,r,s,i,n){console.error("line "+r+":"+s+" "+i)}},Wt=class extends qt{constructor(t){return super(),this.delegates=t,this}static{__name(this,"ProxyErrorListener")}syntaxError(t,e,r,s,i,n){this.delegates.forEach((o=>{o.syntaxError(t,e,r,s,i,n)}))}reportAmbiguity(t,e,r,s,i,n,o){this.delegates.forEach((a=>{a.reportAmbiguity(t,e,r,s,i,n,o)}))}reportAttemptingFullContext(t,e,r,s,i,n){this.delegates.forEach((o=>{o.reportAttemptingFullContext(t,e,r,s,i,n)}))}reportContextSensitivity(t,e,r,s,i,n){this.delegates.forEach((o=>{o.reportContextSensitivity(t,e,r,s,i,n)}))}},Xt=class _Recognizer{static{__name(this,"Recognizer")}static EOF=-1;static tokenTypeMapCache=new Map;static ruleIndexMapCache=new Map;interpreter;#P=[$t.instance];#m=-1;checkVersion(t){const e="4.13.1";e!==t&&console.error("ANTLR runtime and generated code versions disagree: "+e+"!="+t)}addErrorListener(t){this.#P.push(t)}removeErrorListeners(){this.#P=[]}removeErrorListener(t){for(let e=0;ee.set(t,r))),_Recognizer.ruleIndexMapCache.set(t,e)),e}getTokenType(t){const e=this.getTokenTypeMap().get(t);return e||n.INVALID_TYPE}getErrorHeader(t){const e=t.offendingToken?.line,r=t.offendingToken?.column;return"line "+e+":"+r}get errorListenerDispatch(){return new Wt(this.#P)}sempred(t,e,r){return!0}precpred(t,e){return!0}action(t,e,r){}get atn(){return this.interpreter.atn}get state(){return this.#m}set state(t){this.#m=t}getSerializedATN(){throw new Error("there is no serialized ATN")}getParseInfo(){return null}},Yt=class _CommonTokenFactory{static{__name(this,"CommonTokenFactory")}static DEFAULT=new _CommonTokenFactory;copyText=!1;constructor(t){this.copyText=t??!1}create(t,e,r,s,i,n,o,a){const c=L.fromSource(t,e,s,i,n);return c.line=o,c.column=a,r?c.text=r:this.copyText&&null!==t[1]&&(c.text=t[1].getTextFromRange(i,n)),c}},jt=class _RecognitionException extends Error{static{__name(this,"RecognitionException")}ctx;offendingToken=null;offendingState=-1;recognizer;input;constructor(t){super(t.message),Error.captureStackTrace&&Error.captureStackTrace(this,_RecognitionException),this.message=t.message,this.recognizer=t.recognizer,this.input=t.input,this.ctx=t.ctx,null!==this.recognizer&&(this.offendingState=this.recognizer.state)}getExpectedTokens(){return null!==this.recognizer&&null!==this.ctx?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null}toString(){return this.message}},Zt=class extends jt{static{__name(this,"LexerNoViableAltException")}startIndex;deadEndConfigs;constructor(t,e,r,s){super({message:"",recognizer:t,input:e,ctx:null}),this.startIndex=r,this.deadEndConfigs=s}toString(){let t="";return this.input&&this.startIndex>=0&&this.startIndex