@guihz/trading-vue-editor-tes 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/{parserTccWorker-Bo1vM4qv.js → parserTccWorker-mM0z-Mci.js} +4 -1
- package/lib/assets/{scriptsRunWorker-BPrQC8D-.js → scriptsRunWorker-C-CbdlH1.js} +18 -18
- package/lib/components/editor/parseScript/buildInFuncNamespace/log.d.ts +3 -3
- package/lib/components/editor/parseScript/constants.d.ts +2 -0
- package/lib/components/editor/utils/initEditor.d.ts +1 -1
- package/lib/trading-vue-editor.js +500 -500
- package/lib/trading-vue-editor.umd.cjs +16 -16
- package/package.json +1 -1
@@ -8,7 +8,7 @@ var X0=Object.defineProperty;var q0=(ho,hi,Or)=>hi in ho?X0(ho,hi,{enumerable:!0
|
|
8
8
|
`+i.toString(S,N))}return A}},{key:"addDFAState",value:function(i,u){if(u===Oi.ERROR)return u;var v=i.states.get(u);return v!==null?(this.trace_atn_sim&&console.log("addDFAState "+u+" exists"),v):(u.stateNumber=i.states.length,u.configs.readOnly||(u.configs.optimizeConfigs(this),u.configs.setReadonly(!0)),this.trace_atn_sim&&console.log("addDFAState new "+u),i.states.add(u),this.debug&&console.log("adding new DFA state: "+u),u)}},{key:"reportAttemptingFullContext",value:function(i,u,v,A,S){if(this.debug||this.retry_debug){var N=new ge(A,S+1);console.log("reportAttemptingFullContext decision="+i.decision+":"+v+", input="+this.parser.getTokenStream().getText(N))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,i,A,S,u,v)}},{key:"reportContextSensitivity",value:function(i,u,v,A,S){if(this.debug||this.retry_debug){var N=new ge(A,S+1);console.log("reportContextSensitivity decision="+i.decision+":"+v+", input="+this.parser.getTokenStream().getText(N))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,i,A,S,u,v)}},{key:"reportAmbiguity",value:function(i,u,v,A,S,N,ee){if(this.debug||this.retry_debug){var ke=new ge(v,A+1);console.log("reportAmbiguity "+N+":"+ee+", input="+this.parser.getTokenStream().getText(ke))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,i,v,A,S,N,ee)}}],d&&m0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(Oi);function Hs(l){return Hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Hs(l)}function _0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Hs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Hs(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Hs(h)==="symbol"?h:String(h)),a)}var h}var km=function(){function l(){(function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")})(this,l),this.cache=new qi}var r,d;return r=l,(d=[{key:"add",value:function(a){if(a===it.EMPTY)return it.EMPTY;var h=this.cache.get(a)||null;return h!==null?h:(this.cache.set(a,a),a)}},{key:"get",value:function(a){return this.cache.get(a)||null}},{key:"length",get:function(){return this.cache.length}}])&&_0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}();const y0={ATN:dn,ATNDeserializer:ch,LexerATNSimulator:ja,ParserATNSimulator:Dm,PredictionMode:Gn,PredictionContextCache:km};function Gs(l){return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Gs(l)}function g0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Gs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Gs(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Gs(h)==="symbol"?h:String(h)),a)}var h}var wh=function(){function l(a,h,c){(function(m,i){if(!(m instanceof i))throw new TypeError("Cannot call a class as a function")})(this,l),this.dfa=a,this.literalNames=h||[],this.symbolicNames=c||[]}var r,d;return r=l,(d=[{key:"toString",value:function(){if(this.dfa.s0===null)return null;for(var a="",h=this.dfa.sortedStates(),c=0;c<h.length;c++){var m=h[c];if(m.edges!==null)for(var i=m.edges.length,u=0;u<i;u++){var v=m.edges[u]||null;v!==null&&v.stateNumber!==2147483647&&(a=(a=(a=(a=(a=(a=a.concat(this.getStateString(m))).concat("-")).concat(this.getEdgeLabel(u))).concat("->")).concat(this.getStateString(v))).concat(`
|
9
9
|
`))}}return a.length===0?null:a}},{key:"getEdgeLabel",value:function(a){return a===0?"EOF":this.literalNames!==null||this.symbolicNames!==null?this.literalNames[a-1]||this.symbolicNames[a-1]:String.fromCharCode(a-1)}},{key:"getStateString",value:function(a){var h=(a.isAcceptState?":":"")+"s"+a.stateNumber+(a.requiresFullContext?"^":"");return a.isAcceptState?a.predicates!==null?h+"=>"+B(a.predicates):h+"=>"+a.prediction.toString():h}}])&&g0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Ha(l){return Ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ha(l)}function b0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Ha(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Ha(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ha(h)==="symbol"?h:String(h)),a)}var h}function Nh(l,r){return Nh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Nh(l,r)}function Mc(l){return Mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mc(l)}var Rm=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Nh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Mc(a);if(h){var v=Mc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Ha(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i){return function(u,v){if(!(u instanceof v))throw new TypeError("Cannot call a class as a function")}(this,m),c.call(this,i,null)}return r=m,(d=[{key:"getEdgeLabel",value:function(i){return"'"+String.fromCharCode(i)+"'"}}])&&b0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(wh);function Ks(l){return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ks(l)}function v0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Ks(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Ks(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ks(h)==="symbol"?h:String(h)),a)}var h}var wm=function(){function l(a,h){if(function(m,i){if(!(m instanceof i))throw new TypeError("Cannot call a class as a function")}(this,l),h===void 0&&(h=0),this.atnStartState=a,this.decision=h,this._states=new g,this.s0=null,this.precedenceDfa=!1,a instanceof Bo&&a.isPrecedenceDecision){this.precedenceDfa=!0;var c=new Vo(null,new Br);c.edges=[],c.isAcceptState=!1,c.requiresFullContext=!1,this.s0=c}}var r,d;return r=l,(d=[{key:"getPrecedenceStartState",value:function(a){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return a<0||a>=this.s0.edges.length?null:this.s0.edges[a]||null}},{key:"setPrecedenceStartState",value:function(a,h){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";a<0||(this.s0.edges[a]=h)}},{key:"setPrecedenceDfa",value:function(a){if(this.precedenceDfa!==a){if(this._states=new g,a){var h=new Vo(null,new Br);h.edges=[],h.isAcceptState=!1,h.requiresFullContext=!1,this.s0=h}else this.s0=null;this.precedenceDfa=a}}},{key:"sortedStates",value:function(){return this._states.values().sort(function(a,h){return a.stateNumber-h.stateNumber})}},{key:"toString",value:function(a,h){return a=a||null,h=h||null,this.s0===null?"":new wh(this,a,h).toString()}},{key:"toLexerString",value:function(){return this.s0===null?"":new Rm(this).toString()}},{key:"states",get:function(){return this._states}}])&&v0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}();const E0={DFA:wm,DFASerializer:wh,LexerDFASerializer:Rm,PredPrediction:Cm},S0={PredictionContext:it},T0={Interval:ge,IntervalSet:ne};function zs(l){return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zs(l)}function A0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(zs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(zs(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),zs(h)==="symbol"?h:String(h)),a)}var h}var Ih=function(){function l(){(function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,d;return r=l,(d=[{key:"visitTerminal",value:function(a){}},{key:"visitErrorNode",value:function(a){}},{key:"enterEveryRule",value:function(a){}},{key:"exitEveryRule",value:function(a){}}])&&A0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Ws(l){return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ws(l)}function x0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Ws(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Ws(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ws(h)==="symbol"?h:String(h)),a)}var h}var Nm=function(){function l(){(function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,d;return r=l,(d=[{key:"visit",value:function(a){return Array.isArray(a)?a.map(function(h){return h.accept(this)},this):a.accept(this)}},{key:"visitChildren",value:function(a){return a.children?this.visit(a.children):null}},{key:"visitTerminal",value:function(a){}},{key:"visitErrorNode",value:function(a){}}])&&x0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Xs(l){return Xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xs(l)}function O0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Xs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Xs(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Xs(h)==="symbol"?h:String(h)),a)}var h}var Bc=function(){function l(){(function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,d;return r=l,(d=[{key:"walk",value:function(a,h){if(h instanceof Wr||h.isErrorNode!==void 0&&h.isErrorNode())a.visitErrorNode(h);else if(h instanceof on)a.visitTerminal(h);else{this.enterRule(a,h);for(var c=0;c<h.getChildCount();c++){var m=h.getChild(c);this.walk(a,m)}this.exitRule(a,h)}}},{key:"enterRule",value:function(a,h){var c=h.ruleContext;a.enterEveryRule(c),c.enterRule(a)}},{key:"exitRule",value:function(a,h){var c=h.ruleContext;c.exitRule(a),a.exitEveryRule(c)}}])&&O0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}();Bc.DEFAULT=new Bc;const C0={Trees:Ku,RuleNode:Fe,ErrorNode:Wr,TerminalNode:on,ParseTreeListener:Ih,ParseTreeVisitor:Nm,ParseTreeWalker:Bc};function Ph(l){return Ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ph(l)}function Fh(l,r){return Fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Fh(l,r)}function Uc(l){return Uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uc(l)}var qs=function(l){(function(m,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(i&&i.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),i&&Fh(m,i)})(c,l);var r,d,a,h=(d=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var m,i=Uc(d);if(a){var u=Uc(this).constructor;m=Reflect.construct(i,arguments,u)}else m=i.apply(this,arguments);return function(v,A){if(A&&(Ph(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}(v)}(this,m)});function c(m){var i;return function(u,v){if(!(u instanceof v))throw new TypeError("Cannot call a class as a function")}(this,c),(i=h.call(this,{message:"",recognizer:m,input:m.getInputStream(),ctx:m._ctx})).offendingToken=m.getCurrentToken(),i}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Uo);function Lh(l){return Lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Lh(l)}function Mh(l,r){return Mh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Mh(l,r)}function Vc(l){return Vc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vc(l)}var Bh=function(l){(function(m,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(i&&i.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),i&&Mh(m,i)})(c,l);var r,d,a,h=(d=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var m,i=Vc(d);if(a){var u=Vc(this).constructor;m=Reflect.construct(i,arguments,u)}else m=i.apply(this,arguments);return function(v,A){if(A&&(Lh(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}(v)}(this,m)});function c(m,i,u){var v;(function(S,N){if(!(S instanceof N))throw new TypeError("Cannot call a class as a function")})(this,c),v=h.call(this,{message:D0(i,u||null),recognizer:m,input:m.getInputStream(),ctx:m._ctx});var A=m._interp.atn.states[m.state].transitions[0];return A instanceof um?(v.ruleIndex=A.ruleIndex,v.predicateIndex=A.predIndex):(v.ruleIndex=0,v.predicateIndex=0),v.predicate=i,v.offendingToken=m.getCurrentToken(),v}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Uo);function D0(l,r){return r!==null?r:"failed predicate: {"+l+"}?"}function Ga(l){return Ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ga(l)}function k0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Ga(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Ga(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ga(h)==="symbol"?h:String(h)),a)}var h}function Uh(l,r){return Uh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Uh(l,r)}function jc(l){return jc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jc(l)}var Im=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Uh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=jc(a);if(h){var v=jc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Ga(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i){var u;return function(v,A){if(!(v instanceof A))throw new TypeError("Cannot call a class as a function")}(this,m),i=i||!0,(u=c.call(this)).exactOnly=i,u}return r=m,d=[{key:"reportAmbiguity",value:function(i,u,v,A,S,N,ee){if(!this.exactOnly||S){var ke="reportAmbiguity d="+this.getDecisionDescription(i,u)+": ambigAlts="+this.getConflictingAlts(N,ee)+", input='"+i.getTokenStream().getText(new ge(v,A))+"'";i.notifyErrorListeners(ke)}}},{key:"reportAttemptingFullContext",value:function(i,u,v,A,S,N){var ee="reportAttemptingFullContext d="+this.getDecisionDescription(i,u)+", input='"+i.getTokenStream().getText(new ge(v,A))+"'";i.notifyErrorListeners(ee)}},{key:"reportContextSensitivity",value:function(i,u,v,A,S,N){var ee="reportContextSensitivity d="+this.getDecisionDescription(i,u)+", input='"+i.getTokenStream().getText(new ge(v,A))+"'";i.notifyErrorListeners(ee)}},{key:"getDecisionDescription",value:function(i,u){var v=u.decision,A=u.atnStartState.ruleIndex,S=i.ruleNames;if(A<0||A>=S.length)return""+v;var N=S[A]||null;return N===null||N.length===0?""+v:"".concat(v," (").concat(N,")")}},{key:"getConflictingAlts",value:function(i,u){if(i!==null)return i;for(var v=new Mr,A=0;A<u.items.length;A++)v.add(u.items[A].alt);return"{".concat(v.values().join(", "),"}")}}],d&&k0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(ws);function Vh(l){return Vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Vh(l)}function Pm(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function jh(l){var r=typeof Map=="function"?new Map:void 0;return jh=function(d){if(d===null||(a=d,Function.toString.call(a).indexOf("[native code]")===-1))return d;var a;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(d))return r.get(d);r.set(d,h)}function h(){return $h(d,arguments,Js(this).constructor)}return h.prototype=Object.create(d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),Ys(h,d)},jh(l)}function $h(l,r,d){return $h=Fm()?Reflect.construct.bind():function(a,h,c){var m=[null];m.push.apply(m,h);var i=new(Function.bind.apply(a,m));return c&&Ys(i,c.prototype),i},$h.apply(null,arguments)}function Fm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ys(l,r){return Ys=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Ys(l,r)}function Js(l){return Js=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Js(l)}var R0=function(l){(function(m,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(i&&i.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),i&&Ys(m,i)})(c,l);var r,d,a,h=(d=c,a=Fm(),function(){var m,i=Js(d);if(a){var u=Js(this).constructor;m=Reflect.construct(i,arguments,u)}else m=i.apply(this,arguments);return function(v,A){if(A&&(Vh(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pm(v)}(this,m)});function c(){var m;return function(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}(this,c),m=h.call(this),Error.captureStackTrace(Pm(m),c),m}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(jh(Error));function Zs(l){return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Zs(l)}function w0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Zs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Zs(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Zs(h)==="symbol"?h:String(h)),a)}var h}function Ka(l){return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ka(l)}function N0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Ka(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Ka(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ka(h)==="symbol"?h:String(h)),a)}var h}function Hh(l,r){return Hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Hh(l,r)}function $c(l){return $c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$c(l)}var Gh=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Hh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=$c(a);if(h){var v=$c(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Ka(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(){var i;return function(u,v){if(!(u instanceof v))throw new TypeError("Cannot call a class as a function")}(this,m),(i=c.call(this)).errorRecoveryMode=!1,i.lastErrorIndex=-1,i.lastErrorStates=null,i.nextTokensContext=null,i.nextTokenState=0,i}return r=m,d=[{key:"reset",value:function(i){this.endErrorCondition(i)}},{key:"beginErrorCondition",value:function(i){this.errorRecoveryMode=!0}},{key:"inErrorRecoveryMode",value:function(i){return this.errorRecoveryMode}},{key:"endErrorCondition",value:function(i){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1}},{key:"reportMatch",value:function(i){this.endErrorCondition(i)}},{key:"reportError",value:function(i,u){this.inErrorRecoveryMode(i)||(this.beginErrorCondition(i),u instanceof Fc?this.reportNoViableAlternative(i,u):u instanceof qs?this.reportInputMismatch(i,u):u instanceof Bh?this.reportFailedPredicate(i,u):(console.log("unknown recognition error type: "+u.constructor.name),console.log(u.stack),i.notifyErrorListeners(u.getOffendingToken(),u.getMessage(),u)))}},{key:"recover",value:function(i,u){this.lastErrorIndex===i.getInputStream().index&&this.lastErrorStates!==null&&this.lastErrorStates.indexOf(i.state)>=0&&i.consume(),this.lastErrorIndex=i._input.index,this.lastErrorStates===null&&(this.lastErrorStates=[]),this.lastErrorStates.push(i.state);var v=this.getErrorRecoverySet(i);this.consumeUntil(i,v)}},{key:"sync",value:function(i){if(!this.inErrorRecoveryMode(i)){var u=i._interp.atn.states[i.state],v=i.getTokenStream().LA(1),A=i.atn.nextTokens(u);if(A.contains(v))return this.nextTokensContext=null,void(this.nextTokenState=ye.INVALID_STATE_NUMBER);if(A.contains(n.EPSILON))this.nextTokensContext===null&&(this.nextTokensContext=i._ctx,this.nextTokensState=i._stateNumber);else switch(u.stateType){case ye.BLOCK_START:case ye.STAR_BLOCK_START:case ye.PLUS_BLOCK_START:case ye.STAR_LOOP_ENTRY:if(this.singleTokenDeletion(i)!==null)return;throw new qs(i);case ye.PLUS_LOOP_BACK:case ye.STAR_LOOP_BACK:this.reportUnwantedToken(i);var S=new ne;S.addSet(i.getExpectedTokens());var N=S.addSet(this.getErrorRecoverySet(i));this.consumeUntil(i,N)}}}},{key:"reportNoViableAlternative",value:function(i,u){var v,A=i.getTokenStream();v=A!==null?u.startToken.type===n.EOF?"<EOF>":A.getText(new ge(u.startToken.tokenIndex,u.offendingToken.tokenIndex)):"<unknown input>";var S="no viable alternative at input "+this.escapeWSAndQuote(v);i.notifyErrorListeners(S,u.offendingToken,u)}},{key:"reportInputMismatch",value:function(i,u){var v="mismatched input "+this.getTokenErrorDisplay(u.offendingToken)+" expecting "+u.getExpectedTokens().toString(i.literalNames,i.symbolicNames);i.notifyErrorListeners(v,u.offendingToken,u)}},{key:"reportFailedPredicate",value:function(i,u){var v="rule "+i.ruleNames[i._ctx.ruleIndex]+" "+u.message;i.notifyErrorListeners(v,u.offendingToken,u)}},{key:"reportUnwantedToken",value:function(i){if(!this.inErrorRecoveryMode(i)){this.beginErrorCondition(i);var u=i.getCurrentToken(),v="extraneous input "+this.getTokenErrorDisplay(u)+" expecting "+this.getExpectedTokens(i).toString(i.literalNames,i.symbolicNames);i.notifyErrorListeners(v,u,null)}}},{key:"reportMissingToken",value:function(i){if(!this.inErrorRecoveryMode(i)){this.beginErrorCondition(i);var u=i.getCurrentToken(),v="missing "+this.getExpectedTokens(i).toString(i.literalNames,i.symbolicNames)+" at "+this.getTokenErrorDisplay(u);i.notifyErrorListeners(v,u,null)}}},{key:"recoverInline",value:function(i){var u=this.singleTokenDeletion(i);if(u!==null)return i.consume(),u;if(this.singleTokenInsertion(i))return this.getMissingSymbol(i);throw new qs(i)}},{key:"singleTokenInsertion",value:function(i){var u=i.getTokenStream().LA(1),v=i._interp.atn,A=v.states[i.state].transitions[0].target;return!!v.nextTokens(A,i._ctx).contains(u)&&(this.reportMissingToken(i),!0)}},{key:"singleTokenDeletion",value:function(i){var u=i.getTokenStream().LA(2);if(this.getExpectedTokens(i).contains(u)){this.reportUnwantedToken(i),i.consume();var v=i.getCurrentToken();return this.reportMatch(i),v}return null}},{key:"getMissingSymbol",value:function(i){var u,v=i.getCurrentToken(),A=this.getExpectedTokens(i).first();u=A===n.EOF?"<missing EOF>":"<missing "+i.literalNames[A]+">";var S=v,N=i.getTokenStream().LT(-1);return S.type===n.EOF&&N!==null&&(S=N),i.getTokenFactory().create(S.source,A,u,n.DEFAULT_CHANNEL,-1,-1,S.line,S.column)}},{key:"getExpectedTokens",value:function(i){return i.getExpectedTokens()}},{key:"getTokenErrorDisplay",value:function(i){if(i===null)return"<no token>";var u=i.text;return u===null&&(u=i.type===n.EOF?"<EOF>":"<"+i.type+">"),this.escapeWSAndQuote(u)}},{key:"escapeWSAndQuote",value:function(i){return"'"+(i=(i=(i=i.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}},{key:"getErrorRecoverySet",value:function(i){for(var u=i._interp.atn,v=i._ctx,A=new ne;v!==null&&v.invokingState>=0;){var S=u.states[v.invokingState].transitions[0],N=u.nextTokens(S.followState);A.addSet(N),v=v.parentCtx}return A.removeOne(n.EPSILON),A}},{key:"consumeUntil",value:function(i,u){for(var v=i.getTokenStream().LA(1);v!==n.EOF&&!u.contains(v);)i.consume(),v=i.getTokenStream().LA(1)}}],d&&N0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(function(){function l(){(function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,d;return r=l,(d=[{key:"reset",value:function(a){}},{key:"recoverInline",value:function(a){}},{key:"recover",value:function(a,h){}},{key:"sync",value:function(a){}},{key:"inErrorRecoveryMode",value:function(a){}},{key:"reportError",value:function(a){}}])&&w0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}());function za(l){return za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},za(l)}function I0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(za(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(za(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),za(h)==="symbol"?h:String(h)),a)}var h}function Kh(l,r){return Kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Kh(l,r)}function Hc(l){return Hc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hc(l)}var Lm=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Kh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Hc(a);if(h){var v=Hc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(za(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(){return function(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}(this,m),c.call(this)}return r=m,d=[{key:"recover",value:function(i,u){for(var v=i._ctx;v!==null;)v.exception=u,v=v.parentCtx;throw new R0(u)}},{key:"recoverInline",value:function(i){this.recover(i,new qs(i))}},{key:"sync",value:function(i){}}],d&&I0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(Gh);const P0={RecognitionException:Uo,NoViableAltException:Fc,LexerNoViableAltException:bh,InputMismatchException:qs,FailedPredicateException:Bh,DiagnosticErrorListener:Im,BailErrorStrategy:Lm,DefaultErrorStrategy:Gh,ErrorListener:ws};function Qs(l){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qs(l)}function F0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Qs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Qs(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Qs(h)==="symbol"?h:String(h)),a)}var h}var eu=function(){function l(a,h){if(function(u,v){if(!(u instanceof v))throw new TypeError("Cannot call a class as a function")}(this,l),this.name="<empty>",this.strdata=a,this.decodeToUnicodeCodePoints=h||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(var c=0;c<this.strdata.length;){var m=this.strdata.codePointAt(c);this.data.push(m),c+=m<=65535?1:2}else{this.data=new Array(this.strdata.length);for(var i=0;i<this.strdata.length;i++)this.data[i]=this.strdata.charCodeAt(i)}this._size=this.data.length}var r,d;return r=l,(d=[{key:"reset",value:function(){this._index=0}},{key:"consume",value:function(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}},{key:"LA",value:function(a){if(a===0)return 0;a<0&&(a+=1);var h=this._index+a-1;return h<0||h>=this._size?n.EOF:this.data[h]}},{key:"LT",value:function(a){return this.LA(a)}},{key:"mark",value:function(){return-1}},{key:"release",value:function(a){}},{key:"seek",value:function(a){a<=this._index?this._index=a:this._index=Math.min(a,this._size)}},{key:"getText",value:function(a,h){if(h>=this._size&&(h=this._size-1),a>=this._size)return"";if(this.decodeToUnicodeCodePoints){for(var c="",m=a;m<=h;m++)c+=String.fromCodePoint(this.data[m]);return c}return this.strdata.slice(a,h+1)}},{key:"toString",value:function(){return this.strdata}},{key:"index",get:function(){return this._index}},{key:"size",get:function(){return this._size}}])&&F0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),l}();function zh(l){return zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zh(l)}function Wh(l,r){return Wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Wh(l,r)}function Gc(l){return Gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gc(l)}var tu=function(l){(function(m,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(i&&i.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),i&&Wh(m,i)})(c,l);var r,d,a,h=(d=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var m,i=Gc(d);if(a){var u=Gc(this).constructor;m=Reflect.construct(i,arguments,u)}else m=i.apply(this,arguments);return function(v,A){if(A&&(zh(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}(v)}(this,m)});function c(m,i){return function(u,v){if(!(u instanceof v))throw new TypeError("Cannot call a class as a function")}(this,c),h.call(this,m,i)}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(eu),Mm=Or(92);function Wa(l){return Wa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Wa(l)}function L0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Wa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Wa(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Wa(h)==="symbol"?h:String(h)),a)}var h}function Xh(l,r){return Xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Xh(l,r)}function Kc(l){return Kc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kc(l)}var Bm=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Um=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Xh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Kc(a);if(h){var v=Kc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Wa(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i,u,v){var A;if(function(N,ee){if(!(N instanceof ee))throw new TypeError("Cannot call a class as a function")}(this,m),!Bm)throw new Error("FileStream is only available when running in Node!");var S=Mm.readFileSync(i,u||"utf-8");return(A=c.call(this,S,v)).fileName=i,A}return r=m,d=[{key:"fromPath",value:function(i,u,v){if(!Bm)throw new Error("FileStream is only available when running in Node!");Mm.readFile(i,u,function(A,S){var N=null;S!==null&&(N=new eu(S,!0)),v(A,N)})}}],d&&L0(r,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(tu);const Vm={fromString:function(l){return new eu(l,!0)},fromBlob:function(l,r,d,a){var h=new window.FileReader;h.onload=function(c){var m=new eu(c.target.result,!0);d(m)},h.onerror=a,h.readAsText(l,r)},fromBuffer:function(l,r){return new eu(l.toString(r),!0)},fromPath:function(l,r,d){Um.fromPath(l,r,d)},fromPathSync:function(l,r){return new Um(l,r)}},M0={arrayToString:B,stringToCharArray:function(l){for(var r=new Uint16Array(l.length),d=0;d<l.length;d++)r[d]=l.charCodeAt(d);return r}};function nu(l){return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},nu(l)}function jm(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(nu(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(nu(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),nu(h)==="symbol"?h:String(h)),a)}var h}function B0(l,r,d){return r&&jm(l.prototype,r),d&&jm(l,d),Object.defineProperty(l,"prototype",{writable:!1}),l}function Xa(l){return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xa(l)}function U0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Xa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Xa(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Xa(h)==="symbol"?h:String(h)),a)}var h}function qh(l,r){return qh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},qh(l,r)}function zc(l){return zc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zc(l)}var $m=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&qh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=zc(a);if(h){var v=zc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Xa(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i){var u;return function(v,A){if(!(v instanceof A))throw new TypeError("Cannot call a class as a function")}(this,m),(u=c.call(this)).tokenSource=i,u.tokens=[],u.index=-1,u.fetchedEOF=!1,u}return r=m,(d=[{key:"mark",value:function(){return 0}},{key:"release",value:function(i){}},{key:"reset",value:function(){this.seek(0)}},{key:"seek",value:function(i){this.lazyInit(),this.index=this.adjustSeekIndex(i)}},{key:"size",get:function(){return this.tokens.length}},{key:"get",value:function(i){return this.lazyInit(),this.tokens[i]}},{key:"consume",value:function(){if(!(this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length))&&this.LA(1)===n.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}},{key:"sync",value:function(i){var u=i-this.tokens.length+1;return!(u>0)||this.fetch(u)>=u}},{key:"fetch",value:function(i){if(this.fetchedEOF)return 0;for(var u=0;u<i;u++){var v=this.tokenSource.nextToken();if(v.tokenIndex=this.tokens.length,this.tokens.push(v),v.type===n.EOF)return this.fetchedEOF=!0,u+1}return i}},{key:"getTokens",value:function(i,u,v){if(v===void 0&&(v=null),i<0||u<0)return null;this.lazyInit();var A=[];u>=this.tokens.length&&(u=this.tokens.length-1);for(var S=i;S<u;S++){var N=this.tokens[S];if(N.type===n.EOF)break;(v===null||v.contains(N.type))&&A.push(N)}return A}},{key:"LA",value:function(i){return this.LT(i).type}},{key:"LB",value:function(i){return this.index-i<0?null:this.tokens[this.index-i]}},{key:"LT",value:function(i){if(this.lazyInit(),i===0)return null;if(i<0)return this.LB(-i);var u=this.index+i-1;return this.sync(u),u>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[u]}},{key:"adjustSeekIndex",value:function(i){return i}},{key:"lazyInit",value:function(){this.index===-1&&this.setup()}},{key:"setup",value:function(){this.sync(0),this.index=this.adjustSeekIndex(0)}},{key:"setTokenSource",value:function(i){this.tokenSource=i,this.tokens=[],this.index=-1,this.fetchedEOF=!1}},{key:"nextTokenOnChannel",value:function(i,u){if(this.sync(i),i>=this.tokens.length)return-1;for(var v=this.tokens[i];v.channel!==this.channel;){if(v.type===n.EOF)return-1;i+=1,this.sync(i),v=this.tokens[i]}return i}},{key:"previousTokenOnChannel",value:function(i,u){for(;i>=0&&this.tokens[i].channel!==u;)i-=1;return i}},{key:"getHiddenTokensToRight",value:function(i,u){if(u===void 0&&(u=-1),this.lazyInit(),i<0||i>=this.tokens.length)throw i+" not in 0.."+this.tokens.length-1;var v=this.nextTokenOnChannel(i+1,or.DEFAULT_TOKEN_CHANNEL),A=i+1,S=v===-1?this.tokens.length-1:v;return this.filterForChannel(A,S,u)}},{key:"getHiddenTokensToLeft",value:function(i,u){if(u===void 0&&(u=-1),this.lazyInit(),i<0||i>=this.tokens.length)throw i+" not in 0.."+this.tokens.length-1;var v=this.previousTokenOnChannel(i-1,or.DEFAULT_TOKEN_CHANNEL);if(v===i-1)return null;var A=v+1,S=i-1;return this.filterForChannel(A,S,u)}},{key:"filterForChannel",value:function(i,u,v){for(var A=[],S=i;S<u+1;S++){var N=this.tokens[S];v===-1?N.channel!==or.DEFAULT_TOKEN_CHANNEL&&A.push(N):N.channel===v&&A.push(N)}return A.length===0?null:A}},{key:"getSourceName",value:function(){return this.tokenSource.getSourceName()}},{key:"getText",value:function(i){this.lazyInit(),this.fill(),i||(i=new ge(0,this.tokens.length-1));var u=i.start;u instanceof n&&(u=u.tokenIndex);var v=i.stop;if(v instanceof n&&(v=v.tokenIndex),u===null||v===null||u<0||v<0)return"";v>=this.tokens.length&&(v=this.tokens.length-1);for(var A="",S=u;S<v+1;S++){var N=this.tokens[S];if(N.type===n.EOF)break;A+=N.text}return A}},{key:"fill",value:function(){for(this.lazyInit();this.fetch(1e3)===1e3;);}}])&&U0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(B0(function l(){(function(r,d){if(!(r instanceof d))throw new TypeError("Cannot call a class as a function")})(this,l)}));function qa(l){return qa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qa(l)}function V0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(qa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(qa(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),qa(h)==="symbol"?h:String(h)),a)}var h}function Yh(l,r){return Yh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Yh(l,r)}function Wc(l){return Wc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wc(l)}Object.defineProperty($m,"size",{get:function(){return this.tokens.length}});var Hm=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Yh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Wc(a);if(h){var v=Wc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(qa(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i,u){var v;return function(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}(this,m),(v=c.call(this,i)).channel=u===void 0?n.DEFAULT_CHANNEL:u,v}return r=m,(d=[{key:"adjustSeekIndex",value:function(i){return this.nextTokenOnChannel(i,this.channel)}},{key:"LB",value:function(i){if(i===0||this.index-i<0)return null;for(var u=this.index,v=1;v<=i;)u=this.previousTokenOnChannel(u-1,this.channel),v+=1;return u<0?null:this.tokens[u]}},{key:"LT",value:function(i){if(this.lazyInit(),i===0)return null;if(i<0)return this.LB(-i);for(var u=this.index,v=1;v<i;)this.sync(u+1)&&(u=this.nextTokenOnChannel(u+1,this.channel)),v+=1;return this.tokens[u]}},{key:"getNumberOfOnChannelTokens",value:function(){var i=0;this.fill();for(var u=0;u<this.tokens.length;u++){var v=this.tokens[u];if(v.channel===this.channel&&(i+=1),v.type===n.EOF)break}return i}}])&&V0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}($m);function Ya(l){return Ya=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ya(l)}function j0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Ya(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Ya(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ya(h)==="symbol"?h:String(h)),a)}var h}function Jh(l,r){return Jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Jh(l,r)}function Xc(l){return Xc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xc(l)}var $0=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Jh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Xc(a);if(h){var v=Xc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Ya(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i){var u;return function(v,A){if(!(v instanceof A))throw new TypeError("Cannot call a class as a function")}(this,m),(u=c.call(this)).parser=i,u}return r=m,(d=[{key:"enterEveryRule",value:function(i){console.log("enter "+this.parser.ruleNames[i.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}},{key:"visitTerminal",value:function(i){console.log("consume "+i.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}},{key:"exitEveryRule",value:function(i){console.log("exit "+this.parser.ruleNames[i.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}])&&j0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(Ih);function Ja(l){return Ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ja(l)}function H0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Ja(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Ja(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ja(h)==="symbol"?h:String(h)),a)}var h}function Zh(l,r){return Zh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},Zh(l,r)}function qc(l){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qc(l)}var Qh=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&Zh(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=qc(a);if(h){var v=qc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Ja(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i){var u;return function(v,A){if(!(v instanceof A))throw new TypeError("Cannot call a class as a function")}(this,m),(u=c.call(this))._input=null,u._errHandler=new Gh,u._precedenceStack=[],u._precedenceStack.push(0),u._ctx=null,u.buildParseTrees=!0,u._tracer=null,u._parseListeners=null,u._syntaxErrors=0,u.setInputStream(i),u}return r=m,d=[{key:"reset",value:function(){this._input!==null&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),this._interp!==null&&this._interp.reset()}},{key:"match",value:function(i){var u=this.getCurrentToken();return u.type===i?(this._errHandler.reportMatch(this),this.consume()):(u=this._errHandler.recoverInline(this),this.buildParseTrees&&u.tokenIndex===-1&&this._ctx.addErrorNode(u)),u}},{key:"matchWildcard",value:function(){var i=this.getCurrentToken();return i.type>0?(this._errHandler.reportMatch(this),this.consume()):(i=this._errHandler.recoverInline(this),this.buildParseTrees&&i.tokenIndex===-1&&this._ctx.addErrorNode(i)),i}},{key:"getParseListeners",value:function(){return this._parseListeners||[]}},{key:"addParseListener",value:function(i){if(i===null)throw"listener";this._parseListeners===null&&(this._parseListeners=[]),this._parseListeners.push(i)}},{key:"removeParseListener",value:function(i){if(this._parseListeners!==null){var u=this._parseListeners.indexOf(i);u>=0&&this._parseListeners.splice(u,1),this._parseListeners.length===0&&(this._parseListeners=null)}}},{key:"removeParseListeners",value:function(){this._parseListeners=null}},{key:"triggerEnterRuleEvent",value:function(){if(this._parseListeners!==null){var i=this._ctx;this._parseListeners.forEach(function(u){u.enterEveryRule(i),i.enterRule(u)})}}},{key:"triggerExitRuleEvent",value:function(){if(this._parseListeners!==null){var i=this._ctx;this._parseListeners.slice(0).reverse().forEach(function(u){i.exitRule(u),u.exitEveryRule(i)})}}},{key:"getTokenFactory",value:function(){return this._input.tokenSource._factory}},{key:"setTokenFactory",value:function(i){this._input.tokenSource._factory=i}},{key:"getATNWithBypassAlts",value:function(){var i=this.getSerializedATN();if(i===null)throw"The current parser does not support an ATN with bypass alternatives.";var u=this.bypassAltsAtnCache[i];if(u===null){var v=new Cs;v.generateRuleBypassTransitions=!0,u=new ch(v).deserialize(i),this.bypassAltsAtnCache[i]=u}return u}},{key:"getInputStream",value:function(){return this.getTokenStream()}},{key:"setInputStream",value:function(i){this.setTokenStream(i)}},{key:"getTokenStream",value:function(){return this._input}},{key:"setTokenStream",value:function(i){this._input=null,this.reset(),this._input=i}},{key:"syntaxErrorsCount",get:function(){return this._syntaxErrors}},{key:"getCurrentToken",value:function(){return this._input.LT(1)}},{key:"notifyErrorListeners",value:function(i,u,v){v=v||null,(u=u||null)===null&&(u=this.getCurrentToken()),this._syntaxErrors+=1;var A=u.line,S=u.column;this.getErrorListenerDispatch().syntaxError(this,u,A,S,i,v)}},{key:"consume",value:function(){var i=this.getCurrentToken();i.type!==n.EOF&&this.getInputStream().consume();var u,v=this._parseListeners!==null&&this._parseListeners.length>0;return(this.buildParseTrees||v)&&((u=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(i):this._ctx.addTokenNode(i)).invokingState=this.state,v&&this._parseListeners.forEach(function(A){u instanceof Wr||u.isErrorNode!==void 0&&u.isErrorNode()?A.visitErrorNode(u):u instanceof on&&A.visitTerminal(u)})),i}},{key:"addContextToParseTree",value:function(){this._ctx.parentCtx!==null&&this._ctx.parentCtx.addChild(this._ctx)}},{key:"enterRule",value:function(i,u,v){this.state=u,this._ctx=i,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}},{key:"exitRule",value:function(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}},{key:"enterOuterAlt",value:function(i,u){i.setAltNumber(u),this.buildParseTrees&&this._ctx!==i&&this._ctx.parentCtx!==null&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(i)),this._ctx=i}},{key:"getPrecedence",value:function(){return this._precedenceStack.length===0?-1:this._precedenceStack[this._precedenceStack.length-1]}},{key:"enterRecursionRule",value:function(i,u,v,A){this.state=u,this._precedenceStack.push(A),this._ctx=i,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}},{key:"pushNewRecursionContext",value:function(i,u,v){var A=this._ctx;A.parentCtx=i,A.invokingState=u,A.stop=this._input.LT(-1),this._ctx=i,this._ctx.start=A.start,this.buildParseTrees&&this._ctx.addChild(A),this.triggerEnterRuleEvent()}},{key:"unrollRecursionContexts",value:function(i){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);var u=this._ctx,v=this.getParseListeners();if(v!==null&&v.length>0)for(;this._ctx!==i;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=i;u.parentCtx=i,this.buildParseTrees&&i!==null&&i.addChild(u)}},{key:"getInvokingContext",value:function(i){for(var u=this._ctx;u!==null;){if(u.ruleIndex===i)return u;u=u.parentCtx}return null}},{key:"precpred",value:function(i,u){return u>=this._precedenceStack[this._precedenceStack.length-1]}},{key:"inContext",value:function(i){return!1}},{key:"isExpectedToken",value:function(i){var u=this._interp.atn,v=this._ctx,A=u.states[this.state],S=u.nextTokens(A);if(S.contains(i))return!0;if(!S.contains(n.EPSILON))return!1;for(;v!==null&&v.invokingState>=0&&S.contains(n.EPSILON);){var N=u.states[v.invokingState].transitions[0];if((S=u.nextTokens(N.followState)).contains(i))return!0;v=v.parentCtx}return!(!S.contains(n.EPSILON)||i!==n.EOF)}},{key:"getExpectedTokens",value:function(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}},{key:"getExpectedTokensWithinCurrentRule",value:function(){var i=this._interp.atn,u=i.states[this.state];return i.nextTokens(u)}},{key:"getRuleIndex",value:function(i){var u=this.getRuleIndexMap()[i];return u!==null?u:-1}},{key:"getRuleInvocationStack",value:function(i){(i=i||null)===null&&(i=this._ctx);for(var u=[];i!==null;){var v=i.ruleIndex;v<0?u.push("n/a"):u.push(this.ruleNames[v]),i=i.parentCtx}return u}},{key:"getDFAStrings",value:function(){return this._interp.decisionToDFA.toString()}},{key:"dumpDFA",value:function(){for(var i=!1,u=0;u<this._interp.decisionToDFA.length;u++){var v=this._interp.decisionToDFA[u];v.states.length>0&&(i&&console.log(),this.printer.println("Decision "+v.decision+":"),this.printer.print(v.toString(this.literalNames,this.symbolicNames)),i=!0)}}},{key:"getSourceName",value:function(){return this._input.sourceName}},{key:"setTrace",value:function(i){i?(this._tracer!==null&&this.removeParseListener(this._tracer),this._tracer=new $0(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}],d&&H0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(Oc);function Za(l){return Za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Za(l)}function G0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Za(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Za(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Za(h)==="symbol"?h:String(h)),a)}var h}function ep(l,r){return ep=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},ep(l,r)}function Yc(l){return Yc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yc(l)}Qh.bypassAltsAtnCache={};var Gm=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&ep(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Yc(a);if(h){var v=Yc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Za(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i){var u;return function(v,A){if(!(v instanceof A))throw new TypeError("Cannot call a class as a function")}(this,m),(u=c.call(this)).parentCtx=null,u.symbol=i,u}return r=m,(d=[{key:"getChild",value:function(i){return null}},{key:"getSymbol",value:function(){return this.symbol}},{key:"getParent",value:function(){return this.parentCtx}},{key:"getPayload",value:function(){return this.symbol}},{key:"getSourceInterval",value:function(){if(this.symbol===null)return ge.INVALID_INTERVAL;var i=this.symbol.tokenIndex;return new ge(i,i)}},{key:"getChildCount",value:function(){return 0}},{key:"accept",value:function(i){return i.visitTerminal(this)}},{key:"getText",value:function(){return this.symbol.text}},{key:"toString",value:function(){return this.symbol.type===n.EOF?"<EOF>":this.symbol.text}}])&&G0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(on);function Qa(l){return Qa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qa(l)}function K0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(Qa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(Qa(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Qa(h)==="symbol"?h:String(h)),a)}var h}function tp(l,r){return tp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},tp(l,r)}function Jc(l){return Jc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Jc(l)}var Km=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&tp(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Jc(a);if(h){var v=Jc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(Qa(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i){return function(u,v){if(!(u instanceof v))throw new TypeError("Cannot call a class as a function")}(this,m),c.call(this,i)}return r=m,(d=[{key:"isErrorNode",value:function(){return!0}},{key:"accept",value:function(i){return i.visitErrorNode(this)}}])&&K0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(Gm);function es(l){return es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},es(l)}function z0(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(h=function(c,m){if(es(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var u=i.call(c,"string");if(es(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),es(h)==="symbol"?h:String(h)),a)}var h}function np(l,r){return np=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},np(l,r)}function Zc(l){return Zc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zc(l)}var rp=function(l){(function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),u&&np(i,u)})(m,l);var r,d,a,h,c=(a=m,h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,u=Zc(a);if(h){var v=Zc(this).constructor;i=Reflect.construct(u,arguments,v)}else i=u.apply(this,arguments);return function(A,S){if(S&&(es(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(A)}(this,i)});function m(i,u){var v;return function(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}(this,m),(v=c.call(this,i,u)).children=null,v.start=null,v.stop=null,v.exception=null,v}return r=m,(d=[{key:"copyFrom",value:function(i){this.parentCtx=i.parentCtx,this.invokingState=i.invokingState,this.children=null,this.start=i.start,this.stop=i.stop,i.children&&(this.children=[],i.children.map(function(u){u instanceof Km&&(this.children.push(u),u.parentCtx=this)},this))}},{key:"enterRule",value:function(i){}},{key:"exitRule",value:function(i){}},{key:"addChild",value:function(i){return this.children===null&&(this.children=[]),this.children.push(i),i}},{key:"removeLastChild",value:function(){this.children!==null&&this.children.pop()}},{key:"addTokenNode",value:function(i){var u=new Gm(i);return this.addChild(u),u.parentCtx=this,u}},{key:"addErrorNode",value:function(i){var u=new Km(i);return this.addChild(u),u.parentCtx=this,u}},{key:"getChild",value:function(i,u){if(u=u||null,this.children===null||i<0||i>=this.children.length)return null;if(u===null)return this.children[i];for(var v=0;v<this.children.length;v++){var A=this.children[v];if(A instanceof u){if(i===0)return A;i-=1}}return null}},{key:"getToken",value:function(i,u){if(this.children===null||u<0||u>=this.children.length)return null;for(var v=0;v<this.children.length;v++){var A=this.children[v];if(A instanceof on&&A.symbol.type===i){if(u===0)return A;u-=1}}return null}},{key:"getTokens",value:function(i){if(this.children===null)return[];for(var u=[],v=0;v<this.children.length;v++){var A=this.children[v];A instanceof on&&A.symbol.type===i&&u.push(A)}return u}},{key:"getTypedRuleContext",value:function(i,u){return this.getChild(u,i)}},{key:"getTypedRuleContexts",value:function(i){if(this.children===null)return[];for(var u=[],v=0;v<this.children.length;v++){var A=this.children[v];A instanceof i&&u.push(A)}return u}},{key:"getChildCount",value:function(){return this.children===null?0:this.children.length}},{key:"getSourceInterval",value:function(){return this.start===null||this.stop===null?ge.INVALID_INTERVAL:new ge(this.start.tokenIndex,this.stop.tokenIndex)}}])&&z0(r.prototype,d),Object.defineProperty(r,"prototype",{writable:!1}),m}(Xi);function ip(l,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(r&&r.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),r&&op(l,r)}function op(l,r){return op=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,a){return d.__proto__=a,d},op(l,r)}function ap(l){var r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var d,a=Qc(l);if(r){var h=Qc(this).constructor;d=Reflect.construct(a,arguments,h)}else d=a.apply(this,arguments);return function(c,m){if(m&&(ts(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}(c)}(this,d)}}function Qc(l){return Qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qc(l)}function ts(l){return ts=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ts(l)}function ns(l,r){var d=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!d){if(Array.isArray(l)||(d=function(u,v){if(u){if(typeof u=="string")return zm(u,v);var A=Object.prototype.toString.call(u).slice(8,-1);return A==="Object"&&u.constructor&&(A=u.constructor.name),A==="Map"||A==="Set"?Array.from(u):A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?zm(u,v):void 0}}(l))||r&&l&&typeof l.length=="number"){d&&(l=d);var a=0,h=function(){};return{s:h,n:function(){return a>=l.length?{done:!0}:{done:!1,value:l[a++]}},e:function(u){throw u},f:h}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
10
10
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,m=!0,i=!1;return{s:function(){d=d.call(l)},n:function(){var u=d.next();return m=u.done,u},e:function(u){i=!0,c=u},f:function(){try{m||d.return==null||d.return()}finally{if(i)throw c}}}}function zm(l,r){(r==null||r>l.length)&&(r=l.length);for(var d=0,a=new Array(r);d<r;d++)a[d]=l[d];return a}function ru(l,r){if(!(l instanceof r))throw new TypeError("Cannot call a class as a function")}function Wm(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,Xm(a.key),a)}}function iu(l,r,d){return r&&Wm(l.prototype,r),d&&Wm(l,d),Object.defineProperty(l,"prototype",{writable:!1}),l}function Xm(l){var r=function(d,a){if(ts(d)!=="object"||d===null)return d;var h=d[Symbol.toPrimitive];if(h!==void 0){var c=h.call(d,"string");if(ts(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(d)}(l);return ts(r)==="symbol"?r:String(r)}Xi.EMPTY=new rp;var el,tl,sp,qm=function(){function l(r){ru(this,l),this.tokens=r,this.programs=new Map}return iu(l,[{key:"getTokenStream",value:function(){return this.tokens}},{key:"insertAfter",value:function(r,d){var a,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(h),m=new Jm(this.tokens,a,c.length,d);c.push(m)}},{key:"insertBefore",value:function(r,d){var a,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(h),m=new rs(this.tokens,a,c.length,d);c.push(m)}},{key:"replaceSingle",value:function(r,d){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;this.replace(r,r,d,a)}},{key:"replace",value:function(r,d,a){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:l.DEFAULT_PROGRAM_NAME;if(typeof r!="number"&&(r=r.tokenIndex),typeof d!="number"&&(d=d.tokenIndex),r>d||r<0||d<0||d>=this.tokens.size)throw new RangeError("replace: range invalid: ".concat(r,"..").concat(d,"(size=").concat(this.tokens.size,")"));var c=this.getProgram(h),m=new nl(this.tokens,r,d,c.length,a);c.push(m)}},{key:"delete",value:function(r,d){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;d===void 0&&(d=r),this.replace(r,d,null,a)}},{key:"getProgram",value:function(r){var d=this.programs.get(r);return d==null&&(d=this.initializeProgram(r)),d}},{key:"initializeProgram",value:function(r){var d=[];return this.programs.set(r,d),d}},{key:"getText",value:function(r){var d,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l.DEFAULT_PROGRAM_NAME;d=r instanceof ge?r:new ge(0,this.tokens.size-1),typeof r=="string"&&(a=r);var h=this.programs.get(a),c=d.start,m=d.stop;if(m>this.tokens.size-1&&(m=this.tokens.size-1),c<0&&(c=0),h==null||h.length===0)return this.tokens.getText(new ge(c,m));for(var i=[],u=this.reduceToSingleOperationPerIndex(h),v=c;v<=m&&v<this.tokens.size;){var A=u.get(v);u.delete(v);var S=this.tokens.get(v);A==null?(S.type!==n.EOF&&i.push(String(S.text)),v++):v=A.execute(i)}if(m===this.tokens.size-1){var N,ee=ns(u.values());try{for(ee.s();!(N=ee.n()).done;){var ke=N.value;ke.index>=this.tokens.size-1&&i.push(ke.text.toString())}}catch(Oe){ee.e(Oe)}finally{ee.f()}}return i.join("")}},{key:"reduceToSingleOperationPerIndex",value:function(r){for(var d=0;d<r.length;d++){var a=r[d];if(a!=null&&a instanceof nl){var h,c=a,m=ns(this.getKindOfOps(r,rs,d));try{for(m.s();!(h=m.n()).done;){var i=h.value;i.index===c.index?(r[i.instructionIndex]=void 0,c.text=i.text.toString()+(c.text!=null?c.text.toString():"")):i.index>c.index&&i.index<=c.lastIndex&&(r[i.instructionIndex]=void 0)}}catch(xr){m.e(xr)}finally{m.f()}var u,v=ns(this.getKindOfOps(r,nl,d));try{for(v.s();!(u=v.n()).done;){var A=u.value;if(A.index>=c.index&&A.lastIndex<=c.lastIndex)r[A.instructionIndex]=void 0;else{var S=A.lastIndex<c.index||A.index>c.lastIndex;if(A.text!=null||c.text!=null||S){if(!S)throw new Error("replace op boundaries of ".concat(c," overlap with previous ").concat(A))}else r[A.instructionIndex]=void 0,c.index=Math.min(A.index,c.index),c.lastIndex=Math.max(A.lastIndex,c.lastIndex)}}}catch(xr){v.e(xr)}finally{v.f()}}}for(var N=0;N<r.length;N++){var ee=r[N];if(ee!=null&&ee instanceof rs){var ke,Oe=ee,He=ns(this.getKindOfOps(r,rs,N));try{for(He.s();!(ke=He.n()).done;){var at=ke.value;at.index===Oe.index&&(at instanceof Jm?(Oe.text=this.catOpText(at.text,Oe.text),r[at.instructionIndex]=void 0):at instanceof rs&&(Oe.text=this.catOpText(Oe.text,at.text),r[at.instructionIndex]=void 0))}}catch(xr){He.e(xr)}finally{He.f()}var ze,mn=ns(this.getKindOfOps(r,nl,N));try{for(mn.s();!(ze=mn.n()).done;){var hn=ze.value;if(Oe.index!==hn.index){if(Oe.index>=hn.index&&Oe.index<=hn.lastIndex)throw new Error("insert op ".concat(Oe," within boundaries of previous ").concat(hn))}else hn.text=this.catOpText(Oe.text,hn.text),r[N]=void 0}}catch(xr){mn.e(xr)}finally{mn.f()}}}var Kn,Ur=new Map,ki=ns(r);try{for(ki.s();!(Kn=ki.n()).done;){var Ri=Kn.value;if(Ri!=null){if(Ur.get(Ri.index)!=null)throw new Error("should only be one op per index");Ur.set(Ri.index,Ri)}}}catch(xr){ki.e(xr)}finally{ki.f()}return Ur}},{key:"catOpText",value:function(r,d){var a="",h="";return r!=null&&(a=r.toString()),d!=null&&(h=d.toString()),a+h}},{key:"getKindOfOps",value:function(r,d,a){return r.slice(0,a).filter(function(h){return h&&h instanceof d})}}]),l}();el=qm,sp="default",(tl=Xm(tl="DEFAULT_PROGRAM_NAME"))in el?Object.defineProperty(el,tl,{value:sp,enumerable:!0,configurable:!0,writable:!0}):el[tl]=sp;var Ym=function(){function l(r,d,a,h){ru(this,l),this.tokens=r,this.instructionIndex=a,this.index=d,this.text=h===void 0?"":h}return iu(l,[{key:"toString",value:function(){var r=this.constructor.name,d=r.indexOf("$");return"<"+(r=r.substring(d+1,r.length))+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}]),l}(),rs=function(l){ip(d,l);var r=ap(d);function d(a,h,c,m){return ru(this,d),r.call(this,a,h,c,m)}return iu(d,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.tokens.get(this.index).type!==n.EOF&&a.push(String(this.tokens.get(this.index).text)),this.index+1}}]),d}(Ym),Jm=function(l){ip(d,l);var r=ap(d);function d(a,h,c,m){return ru(this,d),r.call(this,a,h+1,c,m)}return iu(d)}(rs),nl=function(l){ip(d,l);var r=ap(d);function d(a,h,c,m,i){var u;return ru(this,d),(u=r.call(this,a,h,m,i)).lastIndex=c,u}return iu(d,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.lastIndex+1}},{key:"toString",value:function(){return this.text==null?"<DeleteOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+">":"<ReplaceOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+':"'+this.text+'">'}}]),d}(Ym);const W0={atn:y0,dfa:E0,context:S0,misc:T0,tree:C0,error:P0,Token:n,CommonToken:Is,CharStreams:Vm,CharStream:tu,InputStream:tu,CommonTokenStream:Hm,Lexer:or,Parser:Qh,ParserRuleContext:rp,Interval:ge,IntervalSet:ne,LL1Analyzer:Mo,Utils:M0,TokenStreamRewriter:qm}})();var Cr=kt.dx,up=kt.q2;kt.FO,kt.xf,kt.Gy;var Zm=kt.s4,Qm=kt.c7,cp=kt._7;kt.gp;var e_=kt.cK,t_=kt.zs,n_=kt.AV;kt.Xp,kt.VS,kt.ul;var r_=kt.hW,i_=kt.x1,pi=kt.z5;kt.oN;var o_=kt.TB;kt.u1;var a_=kt._b,s_=kt.$F,Qe=kt._T,lp=kt.db,u_=kt.Zx,et=kt._x;kt.r8,kt.JI,kt.TP;var fp=kt.WU;kt.Nj,kt.ZP;const M=class M extends a_{get grammarFileName(){return"tccScriptParser.g4"}get literalNames(){return M.literalNames}get symbolicNames(){return M.symbolicNames}get ruleNames(){return M.ruleNames}get serializedATN(){return M._serializedATN}createFailedPredicateException(e,n){return new t_(this,e,n)}constructor(e){super(e),this._interp=new s_(this,M._ATN,M.DecisionsToDFA,new lp)}program(){let e=new c_(this,this._ctx,this.state);this.enterRule(e,0,M.RULE_program);let n;try{this.enterOuterAlt(e,1);{for(this.state=102,this._errHandler.sync(this),n=this._input.LA(1);n===4||n===6||!(n-36&-32)&&1<<n-36&19237111;){switch(this.state=100,this._errHandler.sync(this),this._input.LA(1)){case 60:this.state=98,this.match(M.NEWLINE);break;case 4:case 6:case 36:case 37:case 38:case 40:case 41:case 42:case 43:case 47:case 51:case 52:case 54:case 57:this.state=99,this.globalStmt();break;default:throw new pi(this)}this.state=104,this._errHandler.sync(this),n=this._input.LA(1)}this.state=105,this.match(M.EOF)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}globalStmt(){let e=new rl(this,this._ctx,this.state);this.enterRule(e,2,M.RULE_globalStmt);let n;try{switch(this.state=118,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,3,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=107,this.variableDeclarationStmt(),this.state=109,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=108,this.match(M.Comma)),this.state=111,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=113,this.blockStmt();break;case 3:this.enterOuterAlt(e,3),this.state=114,this.importStmt();break;case 4:this.enterOuterAlt(e,4),this.state=115,this.arrowFunction();break;case 5:this.enterOuterAlt(e,5),this.state=116,this.arrowMethod();break;case 6:this.enterOuterAlt(e,6),this.state=117,this.typeStatement();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockStmt(){let e=new hp(this,this._ctx,this.state);this.enterRule(e,4,M.RULE_blockStmt);try{let n;this.enterOuterAlt(e,1);{for(this.state=125,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;)n===1&&(this.state=120,this.variableDeclarationStmt(),this.state=121,this.match(M.Comma)),this.state=127,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);switch(this.state=130,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=128,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=129,this.blockExpression();break;default:throw new pi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}stmt(){let e=new il(this,this._ctx,this.state);this.enterRule(e,6,M.RULE_stmt);let n;try{switch(this.state=139,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,7,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=132,this.simpleStmt(),this.state=134,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=133,this.match(M.Comma)),this.state=136,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=138,this.expressionBlockSequence();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}simpleStmt(){let e=new ol(this,this._ctx,this.state);this.enterRule(e,8,M.RULE_simpleStmt);try{switch(this.state=145,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,8,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=141,this.expressionSequence();break;case 2:this.enterOuterAlt(e,2),this.state=142,this.blockSequence();break;case 3:this.enterOuterAlt(e,3),this.state=143,this.brackethesized();break;case 4:this.enterOuterAlt(e,4),this.state=144,this.flowStmt();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}flowStmt(){let e=new pp(this,this._ctx,this.state);this.enterRule(e,10,M.RULE_flowStmt);let n;try{this.enterOuterAlt(e,1),this.state=147,n=this._input.LA(1),n===34||n===39?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}block(){let e=new is(this,this._ctx,this.state);this.enterRule(e,12,M.RULE_block);let n;try{switch(this.state=156,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 12:case 13:case 31:case 32:case 33:case 34:case 38:case 39:case 40:case 46:case 51:case 54:case 55:case 56:case 57:this.enterOuterAlt(e,1),this.state=149,this.simpleStmt(),this.state=151,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=150,this.match(M.Comma)),this.state=153,this.match(M.NEWLINE);break;case 60:this.enterOuterAlt(e,2),this.state=155,this.blockLine();break;default:throw new pi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockLine(){let e=new po(this,this._ctx,this.state);this.enterRule(e,14,M.RULE_blockLine);let n;try{this.enterOuterAlt(e,1);{this.state=158,this.match(M.NEWLINE),this.state=159,this.match(M.INDENT),this.state=161,this._errHandler.sync(this),n=this._input.LA(1);do this.state=160,this.stmt(),this.state=163,this._errHandler.sync(this),n=this._input.LA(1);while(!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63459303);this.state=165,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}variableDeclarationStmt(){let e=new ou(this,this._ctx,this.state);this.enterRule(e,16,M.RULE_variableDeclarationStmt);try{let n;this.enterOuterAlt(e,1);{switch(this.state=169,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,12,this._ctx)){case 1:this.state=167,this.methodStmt();break;case 2:this.state=168,this.variableDeclarationList();break}for(this.state=178,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=171,this.match(M.Comma),this.state=174,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,13,this._ctx)){case 1:this.state=172,this.methodStmt();break;case 2:this.state=173,this.variableDeclarationList();break}this.state=180,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}variableDeclarationList(){let e=new wi(this,this._ctx,this.state);this.enterRule(e,18,M.RULE_variableDeclarationList);try{switch(this.state=189,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,15,this._ctx)){case 1:e=new f_(this,e),this.enterOuterAlt(e,1),this.state=181,this.varArrayDeclaration(),this.state=182,this.match(M.Assign),this.state=183,this.singleExpression(0);break;case 2:e=new l_(this,e),this.enterOuterAlt(e,2),this.state=185,this.name(),this.state=186,this.assignmentOperator(),this.state=187,this.singleExpression(0);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varModifier(){let e=new al(this,this._ctx,this.state);this.enterRule(e,20,M.RULE_varModifier);let n;try{this.enterOuterAlt(e,1),this.state=191,n=this._input.LA(1),n===38||n===40?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockSequence(){let e=new dp(this,this._ctx,this.state);this.enterRule(e,22,M.RULE_blockSequence);try{let n;this.enterOuterAlt(e,1);{switch(this.state=195,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,16,this._ctx)){case 1:this.state=193,this.singleExpression(0);break;case 2:this.state=194,this.variableDeclarationList();break}for(this.state=204,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=197,this.match(M.Comma),this.state=200,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,17,this._ctx)){case 1:this.state=198,this.singleExpression(0);break;case 2:this.state=199,this.variableDeclarationList();break}this.state=206,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionSequence(){let e=new sl(this,this._ctx,this.state);this.enterRule(e,24,M.RULE_expressionSequence);try{let n;for(this.enterOuterAlt(e,1),this.state=207,this.singleExpression(0),this.state=212,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;)n===1&&(this.state=208,this.match(M.Comma),this.state=209,this.singleExpression(0)),this.state=214,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionBlockSequence(){let e=new mp(this,this._ctx,this.state);this.enterRule(e,26,M.RULE_expressionBlockSequence);try{let n;this.enterOuterAlt(e,1);{for(this.state=223,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=217,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,20,this._ctx)){case 1:this.state=215,this.singleExpression(0);break;case 2:this.state=216,this.variableDeclarationList();break}this.state=219,this.match(M.Comma)}this.state=225,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx)}switch(this.state=228,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=226,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=227,this.blockExpression();break;default:throw new pi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varBlockStmt(){let e=new ul(this,this._ctx,this.state);this.enterRule(e,28,M.RULE_varBlockStmt);try{this.enterOuterAlt(e,1);{switch(this.state=236,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,23,this._ctx)){case 1:this.state=230,this.varArrayDeclaration(),this.state=231,this.match(M.Assign);break;case 2:this.state=233,this.name(),this.state=234,this.assignmentOperator();break}this.state=238,this.blockExpression()}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varArrayDeclaration(){let e=new os(this,this._ctx,this.state);this.enterRule(e,30,M.RULE_varArrayDeclaration);let n;try{switch(this.state=258,this._errHandler.sync(this),this._input.LA(1)){case 38:case 40:case 51:case 54:case 57:e=new p_(this,e),this.enterOuterAlt(e,1);{switch(this.state=241,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=240,this.varModifier()),this.state=244,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,25,this._ctx)){case 1:this.state=243,this.typeGather();break}this.state=246,this.identifier()}break;case 4:e=new h_(this,e),this.enterOuterAlt(e,2);{for(this.state=247,this.match(M.OpenBracket),this.state=248,this.identifier(),this.state=253,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=249,this.match(M.Comma),this.state=250,this.identifier(),this.state=255,this._errHandler.sync(this),n=this._input.LA(1);this.state=256,this.match(M.CloseBracket)}break;default:throw new pi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockExpression(){let e=new au(this,this._ctx,this.state);this.enterRule(e,32,M.RULE_blockExpression);try{switch(this.state=264,this._errHandler.sync(this),this._input.LA(1)){case 43:this.enterOuterAlt(e,1),this.state=260,this.ifStatement();break;case 37:this.enterOuterAlt(e,2),this.state=261,this.forStatement();break;case 42:this.enterOuterAlt(e,3),this.state=262,this.whileStatement();break;case 41:this.enterOuterAlt(e,4),this.state=263,this.switchStatement();break;default:throw new pi(this)}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}singleExpression(e){e===void 0&&(e=0);let n=this._ctx,o=this.state,s=new Ve(this,this._ctx,o),f=s,p=34;this.enterRecursionRule(s,34,M.RULE_singleExpression,e);let y;try{let E;this.enterOuterAlt(s,1);{switch(this.state=278,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,29,this._ctx)){case 1:s=new x_(this,s),this._ctx=s,f=s,this.state=267,this.methodStmt();break;case 2:s=new S_(this,s),this._ctx=s,f=s,this.state=268,y=this._input.LA(1),y===12||y===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=269,this.singleExpression(12);break;case 3:s=new T_(this,s),this._ctx=s,f=s,this.state=270,this.match(M.Not),this.state=271,this.singleExpression(11);break;case 4:s=new b_(this,s),this._ctx=s,f=s,this.state=272,this.name();break;case 5:s=new v_(this,s),this._ctx=s,f=s,this.state=273,this.literal();break;case 6:s=new d_(this,s),this._ctx=s,f=s,this.state=274,this.match(M.OpenParen),this.state=275,this.singleExpression(0),this.state=276,this.match(M.CloseParen);break}for(this._ctx.stop=this._input.LT(-1),this.state=311,this._errHandler.sync(this),E=this._interp.adaptivePredict(this._input,31,this._ctx);E!==2&&E!==Cr.INVALID_ALT_NUMBER;){if(E===1)switch(this._parseListeners!=null&&this.triggerExitRuleEvent(),f=s,this.state=309,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,30,this._ctx)){case 1:{if(s=new C_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=280,!this.precpred(this._ctx,10))throw this.createFailedPredicateException("this.precpred(this._ctx, 10)");this.state=281,y=this._input.LA(1),!(y&-32)&&1<<y&114688?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=282,this.singleExpression(11)}break;case 2:{if(s=new m_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=283,!this.precpred(this._ctx,9))throw this.createFailedPredicateException("this.precpred(this._ctx, 9)");this.state=284,y=this._input.LA(1),y===12||y===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=285,this.singleExpression(10)}break;case 3:{if(s=new __(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=286,!this.precpred(this._ctx,8))throw this.createFailedPredicateException("this.precpred(this._ctx, 8)");this.state=287,y=this._input.LA(1),!(y&-32)&&1<<y&3932160?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=288,this.singleExpression(9)}break;case 4:{if(s=new O_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=289,!this.precpred(this._ctx,7))throw this.createFailedPredicateException("this.precpred(this._ctx, 7)");this.state=290,y=this._input.LA(1),y===22||y===23?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=291,this.singleExpression(8)}break;case 5:{if(s=new g_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=292,!this.precpred(this._ctx,6))throw this.createFailedPredicateException("this.precpred(this._ctx, 6)");this.state=293,this.match(M.And),this.state=294,this.singleExpression(7)}break;case 6:{if(s=new E_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=295,!this.precpred(this._ctx,5))throw this.createFailedPredicateException("this.precpred(this._ctx, 5)");this.state=296,this.match(M.Or),this.state=297,this.singleExpression(6)}break;case 7:{if(s=new y_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=298,!this.precpred(this._ctx,4))throw this.createFailedPredicateException("this.precpred(this._ctx, 4)");this.state=299,this.match(M.QuestionMark),this.state=300,this.singleExpression(0),this.state=301,this.match(M.Colon),this.state=302,this.singleExpression(4)}break;case 8:{if(s=new A_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=304,!this.precpred(this._ctx,13))throw this.createFailedPredicateException("this.precpred(this._ctx, 13)");this.state=305,this.match(M.OpenBracket),this.state=306,this.singleExpression(0),this.state=307,this.match(M.CloseBracket)}break}this.state=313,this._errHandler.sync(this),E=this._interp.adaptivePredict(this._input,31,this._ctx)}}}catch(E){if(E instanceof et)s.exception=E,this._errHandler.reportError(this,E),this._errHandler.recover(this,E);else throw E}finally{this.unrollRecursionContexts(n)}return s}brackethesized(){let e=new cl(this,this._ctx,this.state);this.enterRule(e,36,M.RULE_brackethesized);try{this.enterOuterAlt(e,1),this.state=314,this.match(M.OpenBracket),this.state=315,this.expressionSequence(),this.state=316,this.match(M.CloseBracket)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}arguments(){let e=new _p(this,this._ctx,this.state);this.enterRule(e,38,M.RULE_arguments);let n;try{let o;this.enterOuterAlt(e,1);{if(this.state=318,this.match(M.OpenParen),this.state=330,this._errHandler.sync(this),n=this._input.LA(1),!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63455235){for(this.state=319,this.argument(),this.state=324,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);o!==2&&o!==Cr.INVALID_ALT_NUMBER;)o===1&&(this.state=320,this.match(M.Comma),this.state=321,this.argument()),this.state=326,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);this.state=328,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=327,this.match(M.Comma))}this.state=332,this.match(M.CloseParen)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}argument(){let e=new ll(this,this._ctx,this.state);this.enterRule(e,40,M.RULE_argument);try{this.enterOuterAlt(e,1);{switch(this.state=337,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,35,this._ctx)){case 1:this.state=334,this.identifier(),this.state=335,this.match(M.Assign);break}switch(this.state=341,this._errHandler.sync(this),this._input.LA(1)){case 6:case 12:case 13:case 31:case 32:case 33:case 46:case 51:case 54:case 55:case 56:case 57:this.state=339,this.singleExpression(0);break;case 4:this.state=340,this.brackethesized();break;default:throw new pi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}ifStatement(){let e=new yp(this,this._ctx,this.state);this.enterRule(e,42,M.RULE_ifStatement);let n;try{let o;this.enterOuterAlt(e,1);{for(this.state=343,this.match(M.If),this.state=344,this.singleExpression(0),this.state=345,this.blockLine(),this.state=353,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);o!==2&&o!==Cr.INVALID_ALT_NUMBER;)o===1&&(this.state=346,this.match(M.Else),this.state=347,this.match(M.If),this.state=348,this.singleExpression(0),this.state=349,this.blockLine()),this.state=355,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);this.state=358,this._errHandler.sync(this),n=this._input.LA(1),n===48&&(this.state=356,this.match(M.Else),this.state=357,this.blockLine())}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}forStatement(){let e=new su(this,this._ctx,this.state);this.enterRule(e,44,M.RULE_forStatement);let n;try{switch(this.state=392,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,43,this._ctx)){case 1:e=new D_(this,e),this.enterOuterAlt(e,1);{switch(this.state=360,this.match(M.For),this.state=362,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=361,this.varModifier()),this.state=365,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,40,this._ctx)){case 1:this.state=364,this.typeGather();break}this.state=367,this.identifier(),this.state=368,this.match(M.Assign),this.state=369,this.singleExpression(0),this.state=370,this.match(M.To),this.state=371,this.singleExpression(0),this.state=374,this._errHandler.sync(this),n=this._input.LA(1),n===50&&(this.state=372,this.match(M.By),this.state=373,this.singleExpression(0)),this.state=376,this.blockLine()}break;case 2:e=new k_(this,e),this.enterOuterAlt(e,2);{switch(this.state=378,this.match(M.For),this.state=386,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:this.state=379,this.identifier();break;case 4:this.state=380,this.match(M.OpenBracket),this.state=381,this.identifier(),this.state=382,this.match(M.Comma),this.state=383,this.identifier(),this.state=384,this.match(M.CloseBracket);break;default:throw new pi(this)}this.state=388,this.match(M.In),this.state=389,this.singleExpression(0),this.state=390,this.blockLine()}break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}switchStatement(){let e=new gp(this,this._ctx,this.state);this.enterRule(e,46,M.RULE_switchStatement);let n;try{this.enterOuterAlt(e,1);{this.state=394,this.match(M.Switch),this.state=396,this._errHandler.sync(this),n=this._input.LA(1),(!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235)&&(this.state=395,this.singleExpression(0)),this.state=398,this.match(M.NEWLINE),this.state=399,this.match(M.INDENT);{for(this.state=403,this._errHandler.sync(this),n=this._input.LA(1);!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235;)this.state=400,this.caseClause(),this.state=405,this._errHandler.sync(this),n=this._input.LA(1);this.state=407,this._errHandler.sync(this),n=this._input.LA(1),n===29&&(this.state=406,this.defaultCaluse())}this.state=409,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}caseClause(){let e=new fl(this,this._ctx,this.state);this.enterRule(e,48,M.RULE_caseClause);try{this.enterOuterAlt(e,1),this.state=411,this.singleExpression(0),this.state=412,this.match(M.ARROW),this.state=413,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}defaultCaluse(){let e=new bp(this,this._ctx,this.state);this.enterRule(e,50,M.RULE_defaultCaluse);try{this.enterOuterAlt(e,1),this.state=415,this.match(M.ARROW),this.state=416,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}whileStatement(){let e=new vp(this,this._ctx,this.state);this.enterRule(e,52,M.RULE_whileStatement);try{this.enterOuterAlt(e,1),this.state=418,this.match(M.While),this.state=419,this.singleExpression(0),this.state=420,this.blockLine()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}importStmt(){let e=new Ep(this,this._ctx,this.state);this.enterRule(e,54,M.RULE_importStmt);let n;try{let o;this.enterOuterAlt(e,1);{for(this.state=422,this.importElement(),this.state=427,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,47,this._ctx);o!==2&&o!==Cr.INVALID_ALT_NUMBER;)o===1&&(this.state=423,this.match(M.Comma),this.state=424,this.importElement()),this.state=429,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,47,this._ctx);this.state=431,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=430,this.match(M.Comma)),this.state=433,this.match(M.NEWLINE)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}importElement(){let e=new hl(this,this._ctx,this.state);this.enterRule(e,56,M.RULE_importElement);let n;try{this.enterOuterAlt(e,1),this.state=435,this.match(M.Import),this.state=436,this.identifier(),this.state=437,this.match(M.Divide),this.state=438,this.identifier(),this.state=439,this.match(M.Divide),this.state=440,this.match(M.IntegerLiteral),this.state=443,this._errHandler.sync(this),n=this._input.LA(1),n===53&&(this.state=441,this.match(M.As),this.state=442,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}literal(){let e=new Sp(this,this._ctx,this.state);this.enterRule(e,58,M.RULE_literal);let n;try{this.enterOuterAlt(e,1),this.state=445,n=this._input.LA(1),!(n-31&-32)&&1<<n-31&50331655?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}methodStmt(){let e=new uu(this,this._ctx,this.state);this.enterRule(e,60,M.RULE_methodStmt);try{let n;for(this.enterOuterAlt(e,1),this.state=447,this.methodElement(),this.state=452,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,50,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;)n===1&&(this.state=448,this.match(M.Point),this.state=449,this.methodElement()),this.state=454,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,50,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodElement(){let e=new as(this,this._ctx,this.state);this.enterRule(e,62,M.RULE_methodElement);try{this.enterOuterAlt(e,1),this.state=455,this.methodName(),this.state=456,this.arguments()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodName(){let e=new Tp(this,this._ctx,this.state);this.enterRule(e,64,M.RULE_methodName);let n;try{let o;this.enterOuterAlt(e,1);{switch(this.state=471,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:for(this.state=463,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,51,this._ctx);o!==2&&o!==Cr.INVALID_ALT_NUMBER;)o===1&&(this.state=458,this.identifier(),this.state=459,this.match(M.Point)),this.state=465,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,51,this._ctx);break;case 6:this.state=466,this.match(M.OpenParen),this.state=467,this.singleExpression(0),this.state=468,this.match(M.CloseParen),this.state=469,this.match(M.Point);break;default:throw new pi(this)}this.state=473,this.identifier(),this.state=482,this._errHandler.sync(this),n=this._input.LA(1),n===18&&(this.state=474,this.match(M.LessThan),this.state=475,this.typeName(),this.state=478,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=476,this.match(M.Comma),this.state=477,this.typeName()),this.state=480,this.match(M.MoreThan))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunction(){let e=new Ap(this,this._ctx,this.state);this.enterRule(e,66,M.RULE_arrowFunction);let n;try{this.enterOuterAlt(e,1),this.state=485,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=484,this.match(M.Export)),this.state=487,this.identifier(),this.state=488,this.arrowFunctionParameters(),this.state=489,this.match(M.ARROW),this.state=490,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunctionParameters(){let e=new xp(this,this._ctx,this.state);this.enterRule(e,68,M.RULE_arrowFunctionParameters);let n;try{this.enterOuterAlt(e,1),this.state=492,this.match(M.OpenParen),this.state=494,this._errHandler.sync(this),n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73&&(this.state=493,this.formalParameterList()),this.state=496,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterList(){let e=new pl(this,this._ctx,this.state);this.enterRule(e,70,M.RULE_formalParameterList);let n;try{for(this.enterOuterAlt(e,1),this.state=498,this.formalParameterArg(),this.state=503,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=499,this.match(M.Comma),this.state=500,this.formalParameterArg(),this.state=505,this._errHandler.sync(this),n=this._input.LA(1)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterArg(){let e=new dl(this,this._ctx,this.state);this.enterRule(e,72,M.RULE_formalParameterArg);let n;try{this.enterOuterAlt(e,1);{switch(this.state=507,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,58,this._ctx)){case 1:this.state=506,this.typeGather();break}this.state=509,this.identifier(),this.state=512,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=510,this.match(M.Assign),this.state=511,this.singleExpression(0))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethod(){let e=new Op(this,this._ctx,this.state);this.enterRule(e,74,M.RULE_arrowMethod);let n;try{this.enterOuterAlt(e,1),this.state=515,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=514,this.match(M.Export)),this.state=517,this.match(M.Method),this.state=518,this.identifier(),this.state=519,this.arrowMethodParameters(),this.state=520,this.match(M.ARROW),this.state=521,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethodParameters(){let e=new Cp(this,this._ctx,this.state);this.enterRule(e,76,M.RULE_arrowMethodParameters);let n;try{this.enterOuterAlt(e,1),this.state=523,this.match(M.OpenParen),this.state=524,this.typeGather(),this.state=525,this.identifier(),this.state=528,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=526,this.match(M.Comma),this.state=527,this.formalParameterList()),this.state=530,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeStatement(){let e=new Dp(this,this._ctx,this.state);this.enterRule(e,78,M.RULE_typeStatement);let n;try{this.enterOuterAlt(e,1);{this.state=533,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=532,this.match(M.Export)),this.state=535,this.match(M.Type),this.state=536,this.identifier(),this.state=537,this.match(M.NEWLINE),this.state=538,this.match(M.INDENT),this.state=540,this._errHandler.sync(this),n=this._input.LA(1);do this.state=539,this.typeElement(),this.state=542,this._errHandler.sync(this),n=this._input.LA(1);while(!(n-40&-32)&&1<<n-40&149505);this.state=544,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeElement(){let e=new ml(this,this._ctx,this.state);this.enterRule(e,80,M.RULE_typeElement);let n;try{this.enterOuterAlt(e,1),this.state=547,this._errHandler.sync(this),n=this._input.LA(1),n===40&&(this.state=546,this.match(M.Varip)),this.state=549,this.typeGather(),this.state=550,this.identifier(),this.state=553,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=551,this.match(M.Assign),this.state=552,this.singleExpression(0)),this.state=555,this.match(M.NEWLINE)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}assignmentOperator(){let e=new _l(this,this._ctx,this.state);this.enterRule(e,82,M.RULE_assignmentOperator);let n;try{this.enterOuterAlt(e,1),this.state=557,n=this._input.LA(1),!(n&-32)&&1<<n&1593835520?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeMap(){let e=new yl(this,this._ctx,this.state);this.enterRule(e,84,M.RULE_typeMap);try{this.enterOuterAlt(e,1),this.state=559,this.match(M.Map),this.state=560,this.match(M.LessThan),this.state=561,this.typeName(),this.state=562,this.match(M.Comma),this.state=563,this.typeName(),this.state=564,this.match(M.MoreThan)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeSeries(){let e=new kp(this,this._ctx,this.state);this.enterRule(e,86,M.RULE_typeSeries);try{switch(this.enterOuterAlt(e,1),this.state=566,this.typeName(),this.state=570,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,66,this._ctx)){case 1:this.state=567,this.typeName();break;case 2:this.state=568,this.typeArray();break;case 3:this.state=569,this.typeMap();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeArray(){let e=new gl(this,this._ctx,this.state);this.enterRule(e,88,M.RULE_typeArray);try{switch(this.state=581,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,67,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=572,this.typeName(),this.state=573,this.match(M.LessThan),this.state=574,this.typeName(),this.state=575,this.match(M.MoreThan);break;case 2:this.enterOuterAlt(e,2),this.state=577,this.typeName(),this.state=578,this.match(M.OpenBracket),this.state=579,this.match(M.CloseBracket);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeGather(){let e=new jo(this,this._ctx,this.state);this.enterRule(e,90,M.RULE_typeGather);try{switch(this.state=587,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,68,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=583,this.typeName();break;case 2:this.enterOuterAlt(e,2),this.state=584,this.typeArray();break;case 3:this.enterOuterAlt(e,3),this.state=585,this.typeMap();break;case 4:this.enterOuterAlt(e,4),this.state=586,this.typeSeries();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}identifier(){let e=new xn(this,this._ctx,this.state);this.enterRule(e,92,M.RULE_identifier);let n;try{this.enterOuterAlt(e,1),this.state=589,n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeName(){let e=new di(this,this._ctx,this.state);this.enterRule(e,94,M.RULE_typeName);let n;try{this.enterOuterAlt(e,1),this.state=591,this.identifier(),this.state=594,this._errHandler.sync(this),n=this._input.LA(1),n===3&&(this.state=592,this.match(M.Point),this.state=593,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}name(){let e=new cu(this,this._ctx,this.state);this.enterRule(e,96,M.RULE_name);try{let n;switch(this.state=617,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,73,this._ctx)){case 1:this.enterOuterAlt(e,1);{for(this.state=604,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,71,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=598,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,70,this._ctx)){case 1:this.state=596,this.identifier();break;case 2:this.state=597,this.methodElement();break}this.state=600,this.match(M.Point)}this.state=606,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,71,this._ctx)}this.state=607,this.identifier()}break;case 2:this.enterOuterAlt(e,2);{this.state=608,this.match(M.OpenParen),this.state=609,this.singleExpression(0),this.state=610,this.match(M.CloseParen),this.state=613,this._errHandler.sync(this),n=1;do{switch(n){case 1:this.state=611,this.match(M.Point),this.state=612,this.identifier();break;default:throw new pi(this)}this.state=615,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,72,this._ctx)}while(n!==2&&n!==Cr.INVALID_ALT_NUMBER)}break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}sempred(e,n,o){switch(n){case 17:return this.singleExpression_sempred(e,o)}return!0}singleExpression_sempred(e,n){switch(n){case 0:return this.precpred(this._ctx,10);case 1:return this.precpred(this._ctx,9);case 2:return this.precpred(this._ctx,8);case 3:return this.precpred(this._ctx,7);case 4:return this.precpred(this._ctx,6);case 5:return this.precpred(this._ctx,5);case 6:return this.precpred(this._ctx,4);case 7:return this.precpred(this._ctx,13)}return!0}static get _ATN(){return M.__ATN||(M.__ATN=new up().deserialize(M._serializedATN)),M.__ATN}};k(M,"INDENT",1),k(M,"DEDENT",2),k(M,"Point",3),k(M,"OpenBracket",4),k(M,"CloseBracket",5),k(M,"OpenParen",6),k(M,"CloseParen",7),k(M,"Comma",8),k(M,"Assign",9),k(M,"QuestionMark",10),k(M,"Colon",11),k(M,"Plus",12),k(M,"Minus",13),k(M,"Multiply",14),k(M,"Divide",15),k(M,"Modulus",16),k(M,"Hashtag",17),k(M,"LessThan",18),k(M,"MoreThan",19),k(M,"LessThanEquals",20),k(M,"GreaterThanEquals",21),k(M,"Equals_",22),k(M,"NotEquals",23),k(M,"MultiplyAssign",24),k(M,"DivideAssign",25),k(M,"ModulusAssign",26),k(M,"PlusAssign",27),k(M,"MinusAssign",28),k(M,"ARROW",29),k(M,"ColonEquals",30),k(M,"BooleanLiteral",31),k(M,"IntegerLiteral",32),k(M,"DecimalLiteral",33),k(M,"Break",34),k(M,"And",35),k(M,"Export",36),k(M,"For",37),k(M,"Var",38),k(M,"Continue",39),k(M,"Varip",40),k(M,"Switch",41),k(M,"While",42),k(M,"If",43),k(M,"In",44),k(M,"Or",45),k(M,"Not",46),k(M,"Method",47),k(M,"Else",48),k(M,"To",49),k(M,"By",50),k(M,"Type",51),k(M,"Import",52),k(M,"As",53),k(M,"Map",54),k(M,"ColorLiteral",55),k(M,"StringLiteral",56),k(M,"Identifier",57),k(M,"HIDDEN_",58),k(M,"COMMENT_",59),k(M,"NEWLINE",60),k(M,"EOF",fp.EOF),k(M,"RULE_program",0),k(M,"RULE_globalStmt",1),k(M,"RULE_blockStmt",2),k(M,"RULE_stmt",3),k(M,"RULE_simpleStmt",4),k(M,"RULE_flowStmt",5),k(M,"RULE_block",6),k(M,"RULE_blockLine",7),k(M,"RULE_variableDeclarationStmt",8),k(M,"RULE_variableDeclarationList",9),k(M,"RULE_varModifier",10),k(M,"RULE_blockSequence",11),k(M,"RULE_expressionSequence",12),k(M,"RULE_expressionBlockSequence",13),k(M,"RULE_varBlockStmt",14),k(M,"RULE_varArrayDeclaration",15),k(M,"RULE_blockExpression",16),k(M,"RULE_singleExpression",17),k(M,"RULE_brackethesized",18),k(M,"RULE_arguments",19),k(M,"RULE_argument",20),k(M,"RULE_ifStatement",21),k(M,"RULE_forStatement",22),k(M,"RULE_switchStatement",23),k(M,"RULE_caseClause",24),k(M,"RULE_defaultCaluse",25),k(M,"RULE_whileStatement",26),k(M,"RULE_importStmt",27),k(M,"RULE_importElement",28),k(M,"RULE_literal",29),k(M,"RULE_methodStmt",30),k(M,"RULE_methodElement",31),k(M,"RULE_methodName",32),k(M,"RULE_arrowFunction",33),k(M,"RULE_arrowFunctionParameters",34),k(M,"RULE_formalParameterList",35),k(M,"RULE_formalParameterArg",36),k(M,"RULE_arrowMethod",37),k(M,"RULE_arrowMethodParameters",38),k(M,"RULE_typeStatement",39),k(M,"RULE_typeElement",40),k(M,"RULE_assignmentOperator",41),k(M,"RULE_typeMap",42),k(M,"RULE_typeSeries",43),k(M,"RULE_typeArray",44),k(M,"RULE_typeGather",45),k(M,"RULE_identifier",46),k(M,"RULE_typeName",47),k(M,"RULE_name",48),k(M,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),k(M,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","COMMENT_","NEWLINE"]),k(M,"ruleNames",["program","globalStmt","blockStmt","stmt","simpleStmt","flowStmt","block","blockLine","variableDeclarationStmt","variableDeclarationList","varModifier","blockSequence","expressionSequence","expressionBlockSequence","varBlockStmt","varArrayDeclaration","blockExpression","singleExpression","brackethesized","arguments","argument","ifStatement","forStatement","switchStatement","caseClause","defaultCaluse","whileStatement","importStmt","importElement","literal","methodStmt","methodElement","methodName","arrowFunction","arrowFunctionParameters","formalParameterList","formalParameterArg","arrowMethod","arrowMethodParameters","typeStatement","typeElement","assignmentOperator","typeMap","typeSeries","typeArray","typeGather","identifier","typeName","name"]),k(M,"_serializedATN",[4,1,60,620,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,1,0,1,0,5,0,101,8,0,10,0,12,0,104,9,0,1,0,1,0,1,1,1,1,3,1,110,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,119,8,1,1,2,1,2,1,2,5,2,124,8,2,10,2,12,2,127,9,2,1,2,1,2,3,2,131,8,2,1,3,1,3,3,3,135,8,3,1,3,1,3,1,3,3,3,140,8,3,1,4,1,4,1,4,1,4,3,4,146,8,4,1,5,1,5,1,6,1,6,3,6,152,8,6,1,6,1,6,1,6,3,6,157,8,6,1,7,1,7,1,7,4,7,162,8,7,11,7,12,7,163,1,7,1,7,1,8,1,8,3,8,170,8,8,1,8,1,8,1,8,3,8,175,8,8,5,8,177,8,8,10,8,12,8,180,9,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,190,8,9,1,10,1,10,1,11,1,11,3,11,196,8,11,1,11,1,11,1,11,3,11,201,8,11,5,11,203,8,11,10,11,12,11,206,9,11,1,12,1,12,1,12,5,12,211,8,12,10,12,12,12,214,9,12,1,13,1,13,3,13,218,8,13,1,13,1,13,5,13,222,8,13,10,13,12,13,225,9,13,1,13,1,13,3,13,229,8,13,1,14,1,14,1,14,1,14,1,14,1,14,3,14,237,8,14,1,14,1,14,1,15,3,15,242,8,15,1,15,3,15,245,8,15,1,15,1,15,1,15,1,15,1,15,5,15,252,8,15,10,15,12,15,255,9,15,1,15,1,15,3,15,259,8,15,1,16,1,16,1,16,1,16,3,16,265,8,16,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,279,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,5,17,310,8,17,10,17,12,17,313,9,17,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,5,19,323,8,19,10,19,12,19,326,9,19,1,19,3,19,329,8,19,3,19,331,8,19,1,19,1,19,1,20,1,20,1,20,3,20,338,8,20,1,20,1,20,3,20,342,8,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,5,21,352,8,21,10,21,12,21,355,9,21,1,21,1,21,3,21,359,8,21,1,22,1,22,3,22,363,8,22,1,22,3,22,366,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,375,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,387,8,22,1,22,1,22,1,22,1,22,3,22,393,8,22,1,23,1,23,3,23,397,8,23,1,23,1,23,1,23,5,23,402,8,23,10,23,12,23,405,9,23,1,23,3,23,408,8,23,1,23,1,23,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,27,1,27,1,27,5,27,426,8,27,10,27,12,27,429,9,27,1,27,3,27,432,8,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,444,8,28,1,29,1,29,1,30,1,30,1,30,5,30,451,8,30,10,30,12,30,454,9,30,1,31,1,31,1,31,1,32,1,32,1,32,5,32,462,8,32,10,32,12,32,465,9,32,1,32,1,32,1,32,1,32,1,32,3,32,472,8,32,1,32,1,32,1,32,1,32,1,32,3,32,479,8,32,1,32,1,32,3,32,483,8,32,1,33,3,33,486,8,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,3,34,495,8,34,1,34,1,34,1,35,1,35,1,35,5,35,502,8,35,10,35,12,35,505,9,35,1,36,3,36,508,8,36,1,36,1,36,1,36,3,36,513,8,36,1,37,3,37,516,8,37,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,3,38,529,8,38,1,38,1,38,1,39,3,39,534,8,39,1,39,1,39,1,39,1,39,1,39,4,39,541,8,39,11,39,12,39,542,1,39,1,39,1,40,3,40,548,8,40,1,40,1,40,1,40,1,40,3,40,554,8,40,1,40,1,40,1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,43,1,43,1,43,1,43,3,43,571,8,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,582,8,44,1,45,1,45,1,45,1,45,3,45,588,8,45,1,46,1,46,1,47,1,47,1,47,3,47,595,8,47,1,48,1,48,3,48,599,8,48,1,48,1,48,5,48,603,8,48,10,48,12,48,606,9,48,1,48,1,48,1,48,1,48,1,48,1,48,4,48,614,8,48,11,48,12,48,615,3,48,618,8,48,1,48,0,1,34,49,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,0,9,2,0,34,34,39,39,2,0,38,38,40,40,1,0,12,13,1,0,14,16,1,0,18,21,1,0,22,23,2,0,31,33,55,56,2,0,24,28,30,30,3,0,51,51,54,54,57,57,665,0,102,1,0,0,0,2,118,1,0,0,0,4,125,1,0,0,0,6,139,1,0,0,0,8,145,1,0,0,0,10,147,1,0,0,0,12,156,1,0,0,0,14,158,1,0,0,0,16,169,1,0,0,0,18,189,1,0,0,0,20,191,1,0,0,0,22,195,1,0,0,0,24,207,1,0,0,0,26,223,1,0,0,0,28,236,1,0,0,0,30,258,1,0,0,0,32,264,1,0,0,0,34,278,1,0,0,0,36,314,1,0,0,0,38,318,1,0,0,0,40,337,1,0,0,0,42,343,1,0,0,0,44,392,1,0,0,0,46,394,1,0,0,0,48,411,1,0,0,0,50,415,1,0,0,0,52,418,1,0,0,0,54,422,1,0,0,0,56,435,1,0,0,0,58,445,1,0,0,0,60,447,1,0,0,0,62,455,1,0,0,0,64,471,1,0,0,0,66,485,1,0,0,0,68,492,1,0,0,0,70,498,1,0,0,0,72,507,1,0,0,0,74,515,1,0,0,0,76,523,1,0,0,0,78,533,1,0,0,0,80,547,1,0,0,0,82,557,1,0,0,0,84,559,1,0,0,0,86,566,1,0,0,0,88,581,1,0,0,0,90,587,1,0,0,0,92,589,1,0,0,0,94,591,1,0,0,0,96,617,1,0,0,0,98,101,5,60,0,0,99,101,3,2,1,0,100,98,1,0,0,0,100,99,1,0,0,0,101,104,1,0,0,0,102,100,1,0,0,0,102,103,1,0,0,0,103,105,1,0,0,0,104,102,1,0,0,0,105,106,5,0,0,1,106,1,1,0,0,0,107,109,3,16,8,0,108,110,5,8,0,0,109,108,1,0,0,0,109,110,1,0,0,0,110,111,1,0,0,0,111,112,5,60,0,0,112,119,1,0,0,0,113,119,3,4,2,0,114,119,3,54,27,0,115,119,3,66,33,0,116,119,3,74,37,0,117,119,3,78,39,0,118,107,1,0,0,0,118,113,1,0,0,0,118,114,1,0,0,0,118,115,1,0,0,0,118,116,1,0,0,0,118,117,1,0,0,0,119,3,1,0,0,0,120,121,3,16,8,0,121,122,5,8,0,0,122,124,1,0,0,0,123,120,1,0,0,0,124,127,1,0,0,0,125,123,1,0,0,0,125,126,1,0,0,0,126,130,1,0,0,0,127,125,1,0,0,0,128,131,3,28,14,0,129,131,3,32,16,0,130,128,1,0,0,0,130,129,1,0,0,0,131,5,1,0,0,0,132,134,3,8,4,0,133,135,5,8,0,0,134,133,1,0,0,0,134,135,1,0,0,0,135,136,1,0,0,0,136,137,5,60,0,0,137,140,1,0,0,0,138,140,3,26,13,0,139,132,1,0,0,0,139,138,1,0,0,0,140,7,1,0,0,0,141,146,3,24,12,0,142,146,3,22,11,0,143,146,3,36,18,0,144,146,3,10,5,0,145,141,1,0,0,0,145,142,1,0,0,0,145,143,1,0,0,0,145,144,1,0,0,0,146,9,1,0,0,0,147,148,7,0,0,0,148,11,1,0,0,0,149,151,3,8,4,0,150,152,5,8,0,0,151,150,1,0,0,0,151,152,1,0,0,0,152,153,1,0,0,0,153,154,5,60,0,0,154,157,1,0,0,0,155,157,3,14,7,0,156,149,1,0,0,0,156,155,1,0,0,0,157,13,1,0,0,0,158,159,5,60,0,0,159,161,5,1,0,0,160,162,3,6,3,0,161,160,1,0,0,0,162,163,1,0,0,0,163,161,1,0,0,0,163,164,1,0,0,0,164,165,1,0,0,0,165,166,5,2,0,0,166,15,1,0,0,0,167,170,3,60,30,0,168,170,3,18,9,0,169,167,1,0,0,0,169,168,1,0,0,0,170,178,1,0,0,0,171,174,5,8,0,0,172,175,3,60,30,0,173,175,3,18,9,0,174,172,1,0,0,0,174,173,1,0,0,0,175,177,1,0,0,0,176,171,1,0,0,0,177,180,1,0,0,0,178,176,1,0,0,0,178,179,1,0,0,0,179,17,1,0,0,0,180,178,1,0,0,0,181,182,3,30,15,0,182,183,5,9,0,0,183,184,3,34,17,0,184,190,1,0,0,0,185,186,3,96,48,0,186,187,3,82,41,0,187,188,3,34,17,0,188,190,1,0,0,0,189,181,1,0,0,0,189,185,1,0,0,0,190,19,1,0,0,0,191,192,7,1,0,0,192,21,1,0,0,0,193,196,3,34,17,0,194,196,3,18,9,0,195,193,1,0,0,0,195,194,1,0,0,0,196,204,1,0,0,0,197,200,5,8,0,0,198,201,3,34,17,0,199,201,3,18,9,0,200,198,1,0,0,0,200,199,1,0,0,0,201,203,1,0,0,0,202,197,1,0,0,0,203,206,1,0,0,0,204,202,1,0,0,0,204,205,1,0,0,0,205,23,1,0,0,0,206,204,1,0,0,0,207,212,3,34,17,0,208,209,5,8,0,0,209,211,3,34,17,0,210,208,1,0,0,0,211,214,1,0,0,0,212,210,1,0,0,0,212,213,1,0,0,0,213,25,1,0,0,0,214,212,1,0,0,0,215,218,3,34,17,0,216,218,3,18,9,0,217,215,1,0,0,0,217,216,1,0,0,0,218,219,1,0,0,0,219,220,5,8,0,0,220,222,1,0,0,0,221,217,1,0,0,0,222,225,1,0,0,0,223,221,1,0,0,0,223,224,1,0,0,0,224,228,1,0,0,0,225,223,1,0,0,0,226,229,3,28,14,0,227,229,3,32,16,0,228,226,1,0,0,0,228,227,1,0,0,0,229,27,1,0,0,0,230,231,3,30,15,0,231,232,5,9,0,0,232,237,1,0,0,0,233,234,3,96,48,0,234,235,3,82,41,0,235,237,1,0,0,0,236,230,1,0,0,0,236,233,1,0,0,0,237,238,1,0,0,0,238,239,3,32,16,0,239,29,1,0,0,0,240,242,3,20,10,0,241,240,1,0,0,0,241,242,1,0,0,0,242,244,1,0,0,0,243,245,3,90,45,0,244,243,1,0,0,0,244,245,1,0,0,0,245,246,1,0,0,0,246,259,3,92,46,0,247,248,5,4,0,0,248,253,3,92,46,0,249,250,5,8,0,0,250,252,3,92,46,0,251,249,1,0,0,0,252,255,1,0,0,0,253,251,1,0,0,0,253,254,1,0,0,0,254,256,1,0,0,0,255,253,1,0,0,0,256,257,5,5,0,0,257,259,1,0,0,0,258,241,1,0,0,0,258,247,1,0,0,0,259,31,1,0,0,0,260,265,3,42,21,0,261,265,3,44,22,0,262,265,3,52,26,0,263,265,3,46,23,0,264,260,1,0,0,0,264,261,1,0,0,0,264,262,1,0,0,0,264,263,1,0,0,0,265,33,1,0,0,0,266,267,6,17,-1,0,267,279,3,60,30,0,268,269,7,2,0,0,269,279,3,34,17,12,270,271,5,46,0,0,271,279,3,34,17,11,272,279,3,96,48,0,273,279,3,58,29,0,274,275,5,6,0,0,275,276,3,34,17,0,276,277,5,7,0,0,277,279,1,0,0,0,278,266,1,0,0,0,278,268,1,0,0,0,278,270,1,0,0,0,278,272,1,0,0,0,278,273,1,0,0,0,278,274,1,0,0,0,279,311,1,0,0,0,280,281,10,10,0,0,281,282,7,3,0,0,282,310,3,34,17,11,283,284,10,9,0,0,284,285,7,2,0,0,285,310,3,34,17,10,286,287,10,8,0,0,287,288,7,4,0,0,288,310,3,34,17,9,289,290,10,7,0,0,290,291,7,5,0,0,291,310,3,34,17,8,292,293,10,6,0,0,293,294,5,35,0,0,294,310,3,34,17,7,295,296,10,5,0,0,296,297,5,45,0,0,297,310,3,34,17,6,298,299,10,4,0,0,299,300,5,10,0,0,300,301,3,34,17,0,301,302,5,11,0,0,302,303,3,34,17,4,303,310,1,0,0,0,304,305,10,13,0,0,305,306,5,4,0,0,306,307,3,34,17,0,307,308,5,5,0,0,308,310,1,0,0,0,309,280,1,0,0,0,309,283,1,0,0,0,309,286,1,0,0,0,309,289,1,0,0,0,309,292,1,0,0,0,309,295,1,0,0,0,309,298,1,0,0,0,309,304,1,0,0,0,310,313,1,0,0,0,311,309,1,0,0,0,311,312,1,0,0,0,312,35,1,0,0,0,313,311,1,0,0,0,314,315,5,4,0,0,315,316,3,24,12,0,316,317,5,5,0,0,317,37,1,0,0,0,318,330,5,6,0,0,319,324,3,40,20,0,320,321,5,8,0,0,321,323,3,40,20,0,322,320,1,0,0,0,323,326,1,0,0,0,324,322,1,0,0,0,324,325,1,0,0,0,325,328,1,0,0,0,326,324,1,0,0,0,327,329,5,8,0,0,328,327,1,0,0,0,328,329,1,0,0,0,329,331,1,0,0,0,330,319,1,0,0,0,330,331,1,0,0,0,331,332,1,0,0,0,332,333,5,7,0,0,333,39,1,0,0,0,334,335,3,92,46,0,335,336,5,9,0,0,336,338,1,0,0,0,337,334,1,0,0,0,337,338,1,0,0,0,338,341,1,0,0,0,339,342,3,34,17,0,340,342,3,36,18,0,341,339,1,0,0,0,341,340,1,0,0,0,342,41,1,0,0,0,343,344,5,43,0,0,344,345,3,34,17,0,345,353,3,14,7,0,346,347,5,48,0,0,347,348,5,43,0,0,348,349,3,34,17,0,349,350,3,14,7,0,350,352,1,0,0,0,351,346,1,0,0,0,352,355,1,0,0,0,353,351,1,0,0,0,353,354,1,0,0,0,354,358,1,0,0,0,355,353,1,0,0,0,356,357,5,48,0,0,357,359,3,14,7,0,358,356,1,0,0,0,358,359,1,0,0,0,359,43,1,0,0,0,360,362,5,37,0,0,361,363,3,20,10,0,362,361,1,0,0,0,362,363,1,0,0,0,363,365,1,0,0,0,364,366,3,90,45,0,365,364,1,0,0,0,365,366,1,0,0,0,366,367,1,0,0,0,367,368,3,92,46,0,368,369,5,9,0,0,369,370,3,34,17,0,370,371,5,49,0,0,371,374,3,34,17,0,372,373,5,50,0,0,373,375,3,34,17,0,374,372,1,0,0,0,374,375,1,0,0,0,375,376,1,0,0,0,376,377,3,14,7,0,377,393,1,0,0,0,378,386,5,37,0,0,379,387,3,92,46,0,380,381,5,4,0,0,381,382,3,92,46,0,382,383,5,8,0,0,383,384,3,92,46,0,384,385,5,5,0,0,385,387,1,0,0,0,386,379,1,0,0,0,386,380,1,0,0,0,387,388,1,0,0,0,388,389,5,44,0,0,389,390,3,34,17,0,390,391,3,14,7,0,391,393,1,0,0,0,392,360,1,0,0,0,392,378,1,0,0,0,393,45,1,0,0,0,394,396,5,41,0,0,395,397,3,34,17,0,396,395,1,0,0,0,396,397,1,0,0,0,397,398,1,0,0,0,398,399,5,60,0,0,399,403,5,1,0,0,400,402,3,48,24,0,401,400,1,0,0,0,402,405,1,0,0,0,403,401,1,0,0,0,403,404,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,406,408,3,50,25,0,407,406,1,0,0,0,407,408,1,0,0,0,408,409,1,0,0,0,409,410,5,2,0,0,410,47,1,0,0,0,411,412,3,34,17,0,412,413,5,29,0,0,413,414,3,12,6,0,414,49,1,0,0,0,415,416,5,29,0,0,416,417,3,12,6,0,417,51,1,0,0,0,418,419,5,42,0,0,419,420,3,34,17,0,420,421,3,14,7,0,421,53,1,0,0,0,422,427,3,56,28,0,423,424,5,8,0,0,424,426,3,56,28,0,425,423,1,0,0,0,426,429,1,0,0,0,427,425,1,0,0,0,427,428,1,0,0,0,428,431,1,0,0,0,429,427,1,0,0,0,430,432,5,8,0,0,431,430,1,0,0,0,431,432,1,0,0,0,432,433,1,0,0,0,433,434,5,60,0,0,434,55,1,0,0,0,435,436,5,52,0,0,436,437,3,92,46,0,437,438,5,15,0,0,438,439,3,92,46,0,439,440,5,15,0,0,440,443,5,32,0,0,441,442,5,53,0,0,442,444,3,92,46,0,443,441,1,0,0,0,443,444,1,0,0,0,444,57,1,0,0,0,445,446,7,6,0,0,446,59,1,0,0,0,447,452,3,62,31,0,448,449,5,3,0,0,449,451,3,62,31,0,450,448,1,0,0,0,451,454,1,0,0,0,452,450,1,0,0,0,452,453,1,0,0,0,453,61,1,0,0,0,454,452,1,0,0,0,455,456,3,64,32,0,456,457,3,38,19,0,457,63,1,0,0,0,458,459,3,92,46,0,459,460,5,3,0,0,460,462,1,0,0,0,461,458,1,0,0,0,462,465,1,0,0,0,463,461,1,0,0,0,463,464,1,0,0,0,464,472,1,0,0,0,465,463,1,0,0,0,466,467,5,6,0,0,467,468,3,34,17,0,468,469,5,7,0,0,469,470,5,3,0,0,470,472,1,0,0,0,471,463,1,0,0,0,471,466,1,0,0,0,472,473,1,0,0,0,473,482,3,92,46,0,474,475,5,18,0,0,475,478,3,94,47,0,476,477,5,8,0,0,477,479,3,94,47,0,478,476,1,0,0,0,478,479,1,0,0,0,479,480,1,0,0,0,480,481,5,19,0,0,481,483,1,0,0,0,482,474,1,0,0,0,482,483,1,0,0,0,483,65,1,0,0,0,484,486,5,36,0,0,485,484,1,0,0,0,485,486,1,0,0,0,486,487,1,0,0,0,487,488,3,92,46,0,488,489,3,68,34,0,489,490,5,29,0,0,490,491,3,12,6,0,491,67,1,0,0,0,492,494,5,6,0,0,493,495,3,70,35,0,494,493,1,0,0,0,494,495,1,0,0,0,495,496,1,0,0,0,496,497,5,7,0,0,497,69,1,0,0,0,498,503,3,72,36,0,499,500,5,8,0,0,500,502,3,72,36,0,501,499,1,0,0,0,502,505,1,0,0,0,503,501,1,0,0,0,503,504,1,0,0,0,504,71,1,0,0,0,505,503,1,0,0,0,506,508,3,90,45,0,507,506,1,0,0,0,507,508,1,0,0,0,508,509,1,0,0,0,509,512,3,92,46,0,510,511,5,9,0,0,511,513,3,34,17,0,512,510,1,0,0,0,512,513,1,0,0,0,513,73,1,0,0,0,514,516,5,36,0,0,515,514,1,0,0,0,515,516,1,0,0,0,516,517,1,0,0,0,517,518,5,47,0,0,518,519,3,92,46,0,519,520,3,76,38,0,520,521,5,29,0,0,521,522,3,12,6,0,522,75,1,0,0,0,523,524,5,6,0,0,524,525,3,90,45,0,525,528,3,92,46,0,526,527,5,8,0,0,527,529,3,70,35,0,528,526,1,0,0,0,528,529,1,0,0,0,529,530,1,0,0,0,530,531,5,7,0,0,531,77,1,0,0,0,532,534,5,36,0,0,533,532,1,0,0,0,533,534,1,0,0,0,534,535,1,0,0,0,535,536,5,51,0,0,536,537,3,92,46,0,537,538,5,60,0,0,538,540,5,1,0,0,539,541,3,80,40,0,540,539,1,0,0,0,541,542,1,0,0,0,542,540,1,0,0,0,542,543,1,0,0,0,543,544,1,0,0,0,544,545,5,2,0,0,545,79,1,0,0,0,546,548,5,40,0,0,547,546,1,0,0,0,547,548,1,0,0,0,548,549,1,0,0,0,549,550,3,90,45,0,550,553,3,92,46,0,551,552,5,9,0,0,552,554,3,34,17,0,553,551,1,0,0,0,553,554,1,0,0,0,554,555,1,0,0,0,555,556,5,60,0,0,556,81,1,0,0,0,557,558,7,7,0,0,558,83,1,0,0,0,559,560,5,54,0,0,560,561,5,18,0,0,561,562,3,94,47,0,562,563,5,8,0,0,563,564,3,94,47,0,564,565,5,19,0,0,565,85,1,0,0,0,566,570,3,94,47,0,567,571,3,94,47,0,568,571,3,88,44,0,569,571,3,84,42,0,570,567,1,0,0,0,570,568,1,0,0,0,570,569,1,0,0,0,571,87,1,0,0,0,572,573,3,94,47,0,573,574,5,18,0,0,574,575,3,94,47,0,575,576,5,19,0,0,576,582,1,0,0,0,577,578,3,94,47,0,578,579,5,4,0,0,579,580,5,5,0,0,580,582,1,0,0,0,581,572,1,0,0,0,581,577,1,0,0,0,582,89,1,0,0,0,583,588,3,94,47,0,584,588,3,88,44,0,585,588,3,84,42,0,586,588,3,86,43,0,587,583,1,0,0,0,587,584,1,0,0,0,587,585,1,0,0,0,587,586,1,0,0,0,588,91,1,0,0,0,589,590,7,8,0,0,590,93,1,0,0,0,591,594,3,92,46,0,592,593,5,3,0,0,593,595,3,92,46,0,594,592,1,0,0,0,594,595,1,0,0,0,595,95,1,0,0,0,596,599,3,92,46,0,597,599,3,62,31,0,598,596,1,0,0,0,598,597,1,0,0,0,599,600,1,0,0,0,600,601,5,3,0,0,601,603,1,0,0,0,602,598,1,0,0,0,603,606,1,0,0,0,604,602,1,0,0,0,604,605,1,0,0,0,605,607,1,0,0,0,606,604,1,0,0,0,607,618,3,92,46,0,608,609,5,6,0,0,609,610,3,34,17,0,610,613,5,7,0,0,611,612,5,3,0,0,612,614,3,92,46,0,613,611,1,0,0,0,614,615,1,0,0,0,615,613,1,0,0,0,615,616,1,0,0,0,616,618,1,0,0,0,617,604,1,0,0,0,617,608,1,0,0,0,618,97,1,0,0,0,74,100,102,109,118,125,130,134,139,145,151,156,163,169,174,178,189,195,200,204,212,217,223,228,236,241,244,253,258,264,278,309,311,324,328,330,337,341,353,358,362,365,374,386,392,396,403,407,427,431,443,452,463,471,478,482,485,494,503,507,512,515,528,533,542,547,553,570,581,587,594,598,604,615,617]),k(M,"__ATN"),k(M,"DecisionsToDFA",M._ATN.decisionToState.map((e,n)=>new cp(e,n)));let F=M;class c_ extends Qe{constructor(e,n,o){super(n,o),this.parser=e}EOF(){return this.getToken(F.EOF,0)}NEWLINE_list(){return this.getTokens(F.NEWLINE)}NEWLINE(e){return this.getToken(F.NEWLINE,e)}globalStmt_list(){return this.getTypedRuleContexts(rl)}globalStmt(e){return this.getTypedRuleContext(rl,e)}get ruleIndex(){return F.RULE_program}accept(e){return e.visitProgram?e.visitProgram(this):e.visitChildren(this)}}class rl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}variableDeclarationStmt(){return this.getTypedRuleContext(ou,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma(){return this.getToken(F.Comma,0)}blockStmt(){return this.getTypedRuleContext(hp,0)}importStmt(){return this.getTypedRuleContext(Ep,0)}arrowFunction(){return this.getTypedRuleContext(Ap,0)}arrowMethod(){return this.getTypedRuleContext(Op,0)}typeStatement(){return this.getTypedRuleContext(Dp,0)}get ruleIndex(){return F.RULE_globalStmt}accept(e){return e.visitGlobalStmt?e.visitGlobalStmt(this):e.visitChildren(this)}}class hp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ul,0)}blockExpression(){return this.getTypedRuleContext(au,0)}variableDeclarationStmt_list(){return this.getTypedRuleContexts(ou)}variableDeclarationStmt(e){return this.getTypedRuleContext(ou,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_blockStmt}accept(e){return e.visitBlockStmt?e.visitBlockStmt(this):e.visitChildren(this)}}class il extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(ol,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma(){return this.getToken(F.Comma,0)}expressionBlockSequence(){return this.getTypedRuleContext(mp,0)}get ruleIndex(){return F.RULE_stmt}accept(e){return e.visitStmt?e.visitStmt(this):e.visitChildren(this)}}class ol extends Qe{constructor(e,n,o){super(n,o),this.parser=e}expressionSequence(){return this.getTypedRuleContext(sl,0)}blockSequence(){return this.getTypedRuleContext(dp,0)}brackethesized(){return this.getTypedRuleContext(cl,0)}flowStmt(){return this.getTypedRuleContext(pp,0)}get ruleIndex(){return F.RULE_simpleStmt}accept(e){return e.visitSimpleStmt?e.visitSimpleStmt(this):e.visitChildren(this)}}class pp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Break(){return this.getToken(F.Break,0)}Continue(){return this.getToken(F.Continue,0)}get ruleIndex(){return F.RULE_flowStmt}accept(e){return e.visitFlowStmt?e.visitFlowStmt(this):e.visitChildren(this)}}class is extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(ol,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma(){return this.getToken(F.Comma,0)}blockLine(){return this.getTypedRuleContext(po,0)}get ruleIndex(){return F.RULE_block}accept(e){return e.visitBlock?e.visitBlock(this):e.visitChildren(this)}}class po extends Qe{constructor(e,n,o){super(n,o),this.parser=e}NEWLINE(){return this.getToken(F.NEWLINE,0)}INDENT(){return this.getToken(F.INDENT,0)}DEDENT(){return this.getToken(F.DEDENT,0)}stmt_list(){return this.getTypedRuleContexts(il)}stmt(e){return this.getTypedRuleContext(il,e)}get ruleIndex(){return F.RULE_blockLine}accept(e){return e.visitBlockLine?e.visitBlockLine(this):e.visitChildren(this)}}class ou extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodStmt_list(){return this.getTypedRuleContexts(uu)}methodStmt(e){return this.getTypedRuleContext(uu,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(wi)}variableDeclarationList(e){return this.getTypedRuleContext(wi,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_variableDeclarationStmt}accept(e){return e.visitVariableDeclarationStmt?e.visitVariableDeclarationStmt(this):e.visitChildren(this)}}class wi extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return F.RULE_variableDeclarationList}copyFrom(e){super.copyFrom(e)}}class l_ extends wi{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(cu,0)}assignmentOperator(){return this.getTypedRuleContext(_l,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitAgainAssign?e.visitAgainAssign(this):e.visitChildren(this)}}class f_ extends wi{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}varArrayDeclaration(){return this.getTypedRuleContext(os,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitDeclareAssign?e.visitDeclareAssign(this):e.visitChildren(this)}}class al extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Var(){return this.getToken(F.Var,0)}Varip(){return this.getToken(F.Varip,0)}get ruleIndex(){return F.RULE_varModifier}accept(e){return e.visitVarModifier?e.visitVarModifier(this):e.visitChildren(this)}}class dp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(wi)}variableDeclarationList(e){return this.getTypedRuleContext(wi,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_blockSequence}accept(e){return e.visitBlockSequence?e.visitBlockSequence(this):e.visitChildren(this)}}class sl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_expressionSequence}accept(e){return e.visitExpressionSequence?e.visitExpressionSequence(this):e.visitChildren(this)}}class mp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ul,0)}blockExpression(){return this.getTypedRuleContext(au,0)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(wi)}variableDeclarationList(e){return this.getTypedRuleContext(wi,e)}get ruleIndex(){return F.RULE_expressionBlockSequence}accept(e){return e.visitExpressionBlockSequence?e.visitExpressionBlockSequence(this):e.visitChildren(this)}}class ul extends Qe{constructor(e,n,o){super(n,o),this.parser=e}blockExpression(){return this.getTypedRuleContext(au,0)}varArrayDeclaration(){return this.getTypedRuleContext(os,0)}Assign(){return this.getToken(F.Assign,0)}name(){return this.getTypedRuleContext(cu,0)}assignmentOperator(){return this.getTypedRuleContext(_l,0)}get ruleIndex(){return F.RULE_varBlockStmt}accept(e){return e.visitVarBlockStmt?e.visitVarBlockStmt(this):e.visitChildren(this)}}class os extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return F.RULE_varArrayDeclaration}copyFrom(e){super.copyFrom(e)}}class h_ extends os{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenBracket(){return this.getToken(F.OpenBracket,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}CloseBracket(){return this.getToken(F.CloseBracket,0)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}accept(e){return e.visitVarMultiple?e.visitVarMultiple(this):e.visitChildren(this)}}class p_ extends os{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}identifier(){return this.getTypedRuleContext(xn,0)}varModifier(){return this.getTypedRuleContext(al,0)}typeGather(){return this.getTypedRuleContext(jo,0)}accept(e){return e.visitVarSingle?e.visitVarSingle(this):e.visitChildren(this)}}class au extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ifStatement(){return this.getTypedRuleContext(yp,0)}forStatement(){return this.getTypedRuleContext(su,0)}whileStatement(){return this.getTypedRuleContext(vp,0)}switchStatement(){return this.getTypedRuleContext(gp,0)}get ruleIndex(){return F.RULE_blockExpression}accept(e){return e.visitBlockExpression?e.visitBlockExpression(this):e.visitChildren(this)}}class Ve extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return F.RULE_singleExpression}copyFrom(e){super.copyFrom(e)}}class d_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenParen(){return this.getToken(F.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(F.CloseParen,0)}accept(e){return e.visitParenthesizedExpression?e.visitParenthesizedExpression(this):e.visitChildren(this)}}class m_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Plus(){return this.getToken(F.Plus,0)}Minus(){return this.getToken(F.Minus,0)}accept(e){return e.visitAdditiveExpression?e.visitAdditiveExpression(this):e.visitChildren(this)}}class __ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}LessThan(){return this.getToken(F.LessThan,0)}MoreThan(){return this.getToken(F.MoreThan,0)}LessThanEquals(){return this.getToken(F.LessThanEquals,0)}GreaterThanEquals(){return this.getToken(F.GreaterThanEquals,0)}accept(e){return e.visitRelationalExpression?e.visitRelationalExpression(this):e.visitChildren(this)}}class y_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}QuestionMark(){return this.getToken(F.QuestionMark,0)}Colon(){return this.getToken(F.Colon,0)}accept(e){return e.visitTernaryExpression?e.visitTernaryExpression(this):e.visitChildren(this)}}class g_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}And(){return this.getToken(F.And,0)}accept(e){return e.visitLogicalAndExpression?e.visitLogicalAndExpression(this):e.visitChildren(this)}}class b_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(cu,0)}accept(e){return e.visitNameExpression?e.visitNameExpression(this):e.visitChildren(this)}}class v_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}literal(){return this.getTypedRuleContext(Sp,0)}accept(e){return e.visitLiteralExpression?e.visitLiteralExpression(this):e.visitChildren(this)}}class E_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Or(){return this.getToken(F.Or,0)}accept(e){return e.visitLogicalOrExpression?e.visitLogicalOrExpression(this):e.visitChildren(this)}}class S_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression(){return this.getTypedRuleContext(Ve,0)}Minus(){return this.getToken(F.Minus,0)}Plus(){return this.getToken(F.Plus,0)}accept(e){return e.visitUnaryExpression?e.visitUnaryExpression(this):e.visitChildren(this)}}class T_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}Not(){return this.getToken(F.Not,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitNotExpression?e.visitNotExpression(this):e.visitChildren(this)}}class A_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}OpenBracket(){return this.getToken(F.OpenBracket,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}accept(e){return e.visitMemberIndexExpression?e.visitMemberIndexExpression(this):e.visitChildren(this)}}class x_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}methodStmt(){return this.getTypedRuleContext(uu,0)}accept(e){return e.visitMethodExpression?e.visitMethodExpression(this):e.visitChildren(this)}}class O_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Equals_(){return this.getToken(F.Equals_,0)}NotEquals(){return this.getToken(F.NotEquals,0)}accept(e){return e.visitEqualityExpression?e.visitEqualityExpression(this):e.visitChildren(this)}}class C_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Multiply(){return this.getToken(F.Multiply,0)}Divide(){return this.getToken(F.Divide,0)}Modulus(){return this.getToken(F.Modulus,0)}accept(e){return e.visitMultiplicativeExpression?e.visitMultiplicativeExpression(this):e.visitChildren(this)}}class cl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenBracket(){return this.getToken(F.OpenBracket,0)}expressionSequence(){return this.getTypedRuleContext(sl,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}get ruleIndex(){return F.RULE_brackethesized}accept(e){return e.visitBrackethesized?e.visitBrackethesized(this):e.visitChildren(this)}}class _p extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(F.OpenParen,0)}CloseParen(){return this.getToken(F.CloseParen,0)}argument_list(){return this.getTypedRuleContexts(ll)}argument(e){return this.getTypedRuleContext(ll,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_arguments}accept(e){return e.visitArguments?e.visitArguments(this):e.visitChildren(this)}}class ll extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}brackethesized(){return this.getTypedRuleContext(cl,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(F.Assign,0)}get ruleIndex(){return F.RULE_argument}accept(e){return e.visitArgument?e.visitArgument(this):e.visitChildren(this)}}class yp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}If_list(){return this.getTokens(F.If)}If(e){return this.getToken(F.If,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}blockLine_list(){return this.getTypedRuleContexts(po)}blockLine(e){return this.getTypedRuleContext(po,e)}Else_list(){return this.getTokens(F.Else)}Else(e){return this.getToken(F.Else,e)}get ruleIndex(){return F.RULE_ifStatement}accept(e){return e.visitIfStatement?e.visitIfStatement(this):e.visitChildren(this)}}class su extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return F.RULE_forStatement}copyFrom(e){super.copyFrom(e)}}class D_ extends su{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(F.For,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}To(){return this.getToken(F.To,0)}blockLine(){return this.getTypedRuleContext(po,0)}varModifier(){return this.getTypedRuleContext(al,0)}typeGather(){return this.getTypedRuleContext(jo,0)}By(){return this.getToken(F.By,0)}accept(e){return e.visitForToStatement?e.visitForToStatement(this):e.visitChildren(this)}}class k_ extends su{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(F.For,0)}In(){return this.getToken(F.In,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(po,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenBracket(){return this.getToken(F.OpenBracket,0)}Comma(){return this.getToken(F.Comma,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}accept(e){return e.visitForInStatement?e.visitForInStatement(this):e.visitChildren(this)}}class gp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Switch(){return this.getToken(F.Switch,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}INDENT(){return this.getToken(F.INDENT,0)}DEDENT(){return this.getToken(F.DEDENT,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}caseClause_list(){return this.getTypedRuleContexts(fl)}caseClause(e){return this.getTypedRuleContext(fl,e)}defaultCaluse(){return this.getTypedRuleContext(bp,0)}get ruleIndex(){return F.RULE_switchStatement}accept(e){return e.visitSwitchStatement?e.visitSwitchStatement(this):e.visitChildren(this)}}class fl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}get ruleIndex(){return F.RULE_caseClause}accept(e){return e.visitCaseClause?e.visitCaseClause(this):e.visitChildren(this)}}class bp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}get ruleIndex(){return F.RULE_defaultCaluse}accept(e){return e.visitDefaultCaluse?e.visitDefaultCaluse(this):e.visitChildren(this)}}class vp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}While(){return this.getToken(F.While,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(po,0)}get ruleIndex(){return F.RULE_whileStatement}accept(e){return e.visitWhileStatement?e.visitWhileStatement(this):e.visitChildren(this)}}class Ep extends Qe{constructor(e,n,o){super(n,o),this.parser=e}importElement_list(){return this.getTypedRuleContexts(hl)}importElement(e){return this.getTypedRuleContext(hl,e)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_importStmt}accept(e){return e.visitImportStmt?e.visitImportStmt(this):e.visitChildren(this)}}class hl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Import(){return this.getToken(F.Import,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Divide_list(){return this.getTokens(F.Divide)}Divide(e){return this.getToken(F.Divide,e)}IntegerLiteral(){return this.getToken(F.IntegerLiteral,0)}As(){return this.getToken(F.As,0)}get ruleIndex(){return F.RULE_importElement}accept(e){return e.visitImportElement?e.visitImportElement(this):e.visitChildren(this)}}class Sp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}BooleanLiteral(){return this.getToken(F.BooleanLiteral,0)}ColorLiteral(){return this.getToken(F.ColorLiteral,0)}StringLiteral(){return this.getToken(F.StringLiteral,0)}IntegerLiteral(){return this.getToken(F.IntegerLiteral,0)}DecimalLiteral(){return this.getToken(F.DecimalLiteral,0)}get ruleIndex(){return F.RULE_literal}accept(e){return e.visitLiteral?e.visitLiteral(this):e.visitChildren(this)}}class uu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodElement_list(){return this.getTypedRuleContexts(as)}methodElement(e){return this.getTypedRuleContext(as,e)}Point_list(){return this.getTokens(F.Point)}Point(e){return this.getToken(F.Point,e)}get ruleIndex(){return F.RULE_methodStmt}accept(e){return e.visitMethodStmt?e.visitMethodStmt(this):e.visitChildren(this)}}class as extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodName(){return this.getTypedRuleContext(Tp,0)}arguments(){return this.getTypedRuleContext(_p,0)}get ruleIndex(){return F.RULE_methodElement}accept(e){return e.visitMethodElement?e.visitMethodElement(this):e.visitChildren(this)}}class Tp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenParen(){return this.getToken(F.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(F.CloseParen,0)}Point_list(){return this.getTokens(F.Point)}Point(e){return this.getToken(F.Point,e)}LessThan(){return this.getToken(F.LessThan,0)}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}MoreThan(){return this.getToken(F.MoreThan,0)}Comma(){return this.getToken(F.Comma,0)}get ruleIndex(){return F.RULE_methodName}accept(e){return e.visitMethodName?e.visitMethodName(this):e.visitChildren(this)}}class Ap extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}arrowFunctionParameters(){return this.getTypedRuleContext(xp,0)}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}Export(){return this.getToken(F.Export,0)}get ruleIndex(){return F.RULE_arrowFunction}accept(e){return e.visitArrowFunction?e.visitArrowFunction(this):e.visitChildren(this)}}class xp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(F.OpenParen,0)}CloseParen(){return this.getToken(F.CloseParen,0)}formalParameterList(){return this.getTypedRuleContext(pl,0)}get ruleIndex(){return F.RULE_arrowFunctionParameters}accept(e){return e.visitArrowFunctionParameters?e.visitArrowFunctionParameters(this):e.visitChildren(this)}}class pl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}formalParameterArg_list(){return this.getTypedRuleContexts(dl)}formalParameterArg(e){return this.getTypedRuleContext(dl,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_formalParameterList}accept(e){return e.visitFormalParameterList?e.visitFormalParameterList(this):e.visitChildren(this)}}class dl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}typeGather(){return this.getTypedRuleContext(jo,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return F.RULE_formalParameterArg}accept(e){return e.visitFormalParameterArg?e.visitFormalParameterArg(this):e.visitChildren(this)}}class Op extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Method(){return this.getToken(F.Method,0)}identifier(){return this.getTypedRuleContext(xn,0)}arrowMethodParameters(){return this.getTypedRuleContext(Cp,0)}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}Export(){return this.getToken(F.Export,0)}get ruleIndex(){return F.RULE_arrowMethod}accept(e){return e.visitArrowMethod?e.visitArrowMethod(this):e.visitChildren(this)}}class Cp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(F.OpenParen,0)}typeGather(){return this.getTypedRuleContext(jo,0)}identifier(){return this.getTypedRuleContext(xn,0)}CloseParen(){return this.getToken(F.CloseParen,0)}Comma(){return this.getToken(F.Comma,0)}formalParameterList(){return this.getTypedRuleContext(pl,0)}get ruleIndex(){return F.RULE_arrowMethodParameters}accept(e){return e.visitArrowMethodParameters?e.visitArrowMethodParameters(this):e.visitChildren(this)}}class Dp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Type(){return this.getToken(F.Type,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}INDENT(){return this.getToken(F.INDENT,0)}DEDENT(){return this.getToken(F.DEDENT,0)}Export(){return this.getToken(F.Export,0)}typeElement_list(){return this.getTypedRuleContexts(ml)}typeElement(e){return this.getTypedRuleContext(ml,e)}get ruleIndex(){return F.RULE_typeStatement}accept(e){return e.visitTypeStatement?e.visitTypeStatement(this):e.visitChildren(this)}}class ml extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeGather(){return this.getTypedRuleContext(jo,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Varip(){return this.getToken(F.Varip,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return F.RULE_typeElement}accept(e){return e.visitTypeElement?e.visitTypeElement(this):e.visitChildren(this)}}class _l extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ColonEquals(){return this.getToken(F.ColonEquals,0)}MultiplyAssign(){return this.getToken(F.MultiplyAssign,0)}DivideAssign(){return this.getToken(F.DivideAssign,0)}ModulusAssign(){return this.getToken(F.ModulusAssign,0)}PlusAssign(){return this.getToken(F.PlusAssign,0)}MinusAssign(){return this.getToken(F.MinusAssign,0)}get ruleIndex(){return F.RULE_assignmentOperator}accept(e){return e.visitAssignmentOperator?e.visitAssignmentOperator(this):e.visitChildren(this)}}class yl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Map(){return this.getToken(F.Map,0)}LessThan(){return this.getToken(F.LessThan,0)}Comma(){return this.getToken(F.Comma,0)}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}MoreThan(){return this.getToken(F.MoreThan,0)}get ruleIndex(){return F.RULE_typeMap}accept(e){return e.visitTypeMap?e.visitTypeMap(this):e.visitChildren(this)}}class kp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}typeArray(){return this.getTypedRuleContext(gl,0)}typeMap(){return this.getTypedRuleContext(yl,0)}get ruleIndex(){return F.RULE_typeSeries}accept(e){return e.visitTypeSeries?e.visitTypeSeries(this):e.visitChildren(this)}}class gl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}LessThan(){return this.getToken(F.LessThan,0)}MoreThan(){return this.getToken(F.MoreThan,0)}OpenBracket(){return this.getToken(F.OpenBracket,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}get ruleIndex(){return F.RULE_typeArray}accept(e){return e.visitTypeArray?e.visitTypeArray(this):e.visitChildren(this)}}class jo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName(){return this.getTypedRuleContext(di,0)}typeArray(){return this.getTypedRuleContext(gl,0)}typeMap(){return this.getTypedRuleContext(yl,0)}typeSeries(){return this.getTypedRuleContext(kp,0)}get ruleIndex(){return F.RULE_typeGather}accept(e){return e.visitTypeGather?e.visitTypeGather(this):e.visitChildren(this)}}class xn extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Identifier(){return this.getToken(F.Identifier,0)}Map(){return this.getToken(F.Map,0)}Type(){return this.getToken(F.Type,0)}get ruleIndex(){return F.RULE_identifier}accept(e){return e.visitIdentifier?e.visitIdentifier(this):e.visitChildren(this)}}class di extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point(){return this.getToken(F.Point,0)}get ruleIndex(){return F.RULE_typeName}accept(e){return e.visitTypeName?e.visitTypeName(this):e.visitChildren(this)}}class cu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point_list(){return this.getTokens(F.Point)}Point(e){return this.getToken(F.Point,e)}methodElement_list(){return this.getTypedRuleContexts(as)}methodElement(e){return this.getTypedRuleContext(as,e)}OpenParen(){return this.getToken(F.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(F.CloseParen,0)}get ruleIndex(){return F.RULE_name}accept(e){return e.visitName?e.visitName(this):e.visitChildren(this)}}class R_ extends r_{constructor(n){super(n);k(this,"tokens");k(this,"indents");k(this,"opened");this.tokens=[],this.indents=[],this.opened=0}reset(){this.tokens=[],this.indents=[],this.opened=0,super.reset()}emitToken(n){super.emitToken(n),this.tokens.push(n)}nextToken(){if(this._input.LA(1)===F.EOF&&this.indents.length){for(this.tokens=this.tokens.filter(function(o){return o.type!==F.EOF}),this.emitToken(this.commonToken(F.NEWLINE,`
|
11
|
-
`));this.indents.length;)this.emitToken(this.createDedent()),this.indents.pop();this.emitToken(this.commonToken(F.EOF,"<EOF>"))}const n=super.nextToken();return this.tokens.length?this.tokens.shift():n}createDedent(){return this.commonToken(F.DEDENT,"")}getCharIndex(){return this._input.index}commonToken(n,o){const s=this.getCharIndex()-1,f=o.length?s-o.length+1:s;return new Zm([this,this._input],n,0,f,s)}getIndentationCount(n){let o=0;for(let s=0;s<n.length;s++)n[s]===" "?o+=4-o%4:o++;return o}atStartOfInput(){return this.getCharIndex()===0}openBrace(){this.opened++}closeBrace(){this.opened--}onNewLine(){const n=this.text.replace(/[^\r\n]+/g,""),o=this.text.replace(/[\r\n]+/g,""),s=this._input.LA(1),f=this._input.LA(2),p=this.getIndentationCount(o);if(this.opened>0||f!=-1&&(s===13||s===10||s===47&&f===47||p%4))this.skip();else{this.emitToken(this.commonToken(F.NEWLINE,n));const y=this.indents.length?this.indents[this.indents.length-1]:0;if(p===y)this.skip();else if(p>y)this.indents.push(p),this.emitToken(this.commonToken(F.INDENT,o));else for(;this.indents.length&&this.indents[this.indents.length-1]>p;)this.emitToken(this.createDedent()),this.indents.pop()}}}const we=class we extends R_{constructor(e){super(e),this._interp=new i_(this,we._ATN,we.DecisionsToDFA,new lp)}get grammarFileName(){return"tccScriptLexer.g4"}get literalNames(){return we.literalNames}get symbolicNames(){return we.symbolicNames}get ruleNames(){return we.ruleNames}get serializedATN(){return we._serializedATN}get channelNames(){return we.channelNames}get modeNames(){return we.modeNames}action(e,n,o){switch(n){case 1:this.OpenBracket_action(e,o);break;case 2:this.CloseBracket_action(e,o);break;case 3:this.OpenParen_action(e,o);break;case 4:this.CloseParen_action(e,o);break;case 57:this.NEWLINE_action(e,o);break}}OpenBracket_action(e,n){switch(n){case 0:this.openBrace();break}}CloseBracket_action(e,n){switch(n){case 1:this.closeBrace();break}}OpenParen_action(e,n){switch(n){case 2:this.openBrace();break}}CloseParen_action(e,n){switch(n){case 3:this.closeBrace();break}}NEWLINE_action(e,n){switch(n){case 4:this.onNewLine();break}}sempred(e,n,o){switch(n){case 57:return this.NEWLINE_sempred(e,o)}return!0}NEWLINE_sempred(e,n){switch(n){case 0:return this.atStartOfInput()}return!0}static get _ATN(){return we.__ATN||(we.__ATN=new up().deserialize(we._serializedATN)),we.__ATN}};k(we,"INDENT",1),k(we,"DEDENT",2),k(we,"Point",3),k(we,"OpenBracket",4),k(we,"CloseBracket",5),k(we,"OpenParen",6),k(we,"CloseParen",7),k(we,"Comma",8),k(we,"Assign",9),k(we,"QuestionMark",10),k(we,"Colon",11),k(we,"Plus",12),k(we,"Minus",13),k(we,"Multiply",14),k(we,"Divide",15),k(we,"Modulus",16),k(we,"Hashtag",17),k(we,"LessThan",18),k(we,"MoreThan",19),k(we,"LessThanEquals",20),k(we,"GreaterThanEquals",21),k(we,"Equals_",22),k(we,"NotEquals",23),k(we,"MultiplyAssign",24),k(we,"DivideAssign",25),k(we,"ModulusAssign",26),k(we,"PlusAssign",27),k(we,"MinusAssign",28),k(we,"ARROW",29),k(we,"ColonEquals",30),k(we,"BooleanLiteral",31),k(we,"IntegerLiteral",32),k(we,"DecimalLiteral",33),k(we,"Break",34),k(we,"And",35),k(we,"Export",36),k(we,"For",37),k(we,"Var",38),k(we,"Continue",39),k(we,"Varip",40),k(we,"Switch",41),k(we,"While",42),k(we,"If",43),k(we,"In",44),k(we,"Or",45),k(we,"Not",46),k(we,"Method",47),k(we,"Else",48),k(we,"To",49),k(we,"By",50),k(we,"Type",51),k(we,"Import",52),k(we,"As",53),k(we,"Map",54),k(we,"ColorLiteral",55),k(we,"StringLiteral",56),k(we,"Identifier",57),k(we,"HIDDEN_",58),k(we,"COMMENT_",59),k(we,"NEWLINE",60),k(we,"EOF",fp.EOF),k(we,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),k(we,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),k(we,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","COMMENT_","NEWLINE"]),k(we,"modeNames",["DEFAULT_MODE"]),k(we,"ruleNames",["Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","COMMENT_","NEWLINE","SHORT_STRING","DIGIT","DIGITS","HEX_DIGIT","SPACES","COMMENT","EXP"]),k(we,"_serializedATN",[4,0,60,440,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,1,0,1,0,1,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,212,8,28,1,29,1,29,1,30,1,30,1,30,3,30,219,8,30,1,30,1,30,1,30,1,30,3,30,225,8,30,3,30,227,8,30,1,30,3,30,230,8,30,3,30,232,8,30,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,1,50,1,50,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,52,355,8,52,1,53,1,53,1,54,1,54,5,54,361,8,54,10,54,12,54,364,9,54,1,55,1,55,1,55,1,55,1,56,1,56,1,56,1,56,1,57,1,57,1,57,3,57,377,8,57,1,57,1,57,3,57,381,8,57,1,57,3,57,384,8,57,3,57,386,8,57,1,57,1,57,1,58,1,58,1,58,1,58,5,58,394,8,58,10,58,12,58,397,9,58,1,58,1,58,1,58,1,58,1,58,5,58,404,8,58,10,58,12,58,407,9,58,1,58,3,58,410,8,58,1,59,1,59,1,60,4,60,415,8,60,11,60,12,60,416,1,61,1,61,1,62,4,62,422,8,62,11,62,12,62,423,1,63,1,63,1,63,1,63,5,63,430,8,63,10,63,12,63,433,9,63,1,64,1,64,3,64,437,8,64,1,64,1,64,0,0,65,1,3,3,4,5,5,7,6,9,7,11,8,13,9,15,10,17,11,19,12,21,13,23,14,25,15,27,16,29,17,31,18,33,19,35,20,37,21,39,22,41,23,43,24,45,25,47,26,49,27,51,28,53,29,55,30,57,31,59,32,61,33,63,34,65,35,67,36,69,37,71,38,73,39,75,40,77,41,79,42,81,43,83,44,85,45,87,46,89,47,91,48,93,49,95,50,97,51,99,52,101,53,103,54,105,55,107,56,109,57,111,58,113,59,115,60,117,0,119,0,121,0,123,0,125,0,127,0,129,0,1,0,10,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,39,39,1,0,34,34,1,0,48,57,3,0,48,57,65,70,97,102,2,0,9,9,32,32,2,0,10,10,12,13,2,0,69,69,101,101,2,0,43,43,45,45,453,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,1,131,1,0,0,0,3,133,1,0,0,0,5,136,1,0,0,0,7,139,1,0,0,0,9,142,1,0,0,0,11,145,1,0,0,0,13,147,1,0,0,0,15,149,1,0,0,0,17,151,1,0,0,0,19,153,1,0,0,0,21,155,1,0,0,0,23,157,1,0,0,0,25,159,1,0,0,0,27,161,1,0,0,0,29,163,1,0,0,0,31,165,1,0,0,0,33,167,1,0,0,0,35,169,1,0,0,0,37,172,1,0,0,0,39,175,1,0,0,0,41,178,1,0,0,0,43,181,1,0,0,0,45,184,1,0,0,0,47,187,1,0,0,0,49,190,1,0,0,0,51,193,1,0,0,0,53,196,1,0,0,0,55,199,1,0,0,0,57,211,1,0,0,0,59,213,1,0,0,0,61,231,1,0,0,0,63,233,1,0,0,0,65,239,1,0,0,0,67,243,1,0,0,0,69,250,1,0,0,0,71,254,1,0,0,0,73,258,1,0,0,0,75,267,1,0,0,0,77,273,1,0,0,0,79,280,1,0,0,0,81,286,1,0,0,0,83,289,1,0,0,0,85,292,1,0,0,0,87,295,1,0,0,0,89,299,1,0,0,0,91,306,1,0,0,0,93,311,1,0,0,0,95,314,1,0,0,0,97,317,1,0,0,0,99,322,1,0,0,0,101,329,1,0,0,0,103,332,1,0,0,0,105,354,1,0,0,0,107,356,1,0,0,0,109,358,1,0,0,0,111,365,1,0,0,0,113,369,1,0,0,0,115,385,1,0,0,0,117,409,1,0,0,0,119,411,1,0,0,0,121,414,1,0,0,0,123,418,1,0,0,0,125,421,1,0,0,0,127,425,1,0,0,0,129,434,1,0,0,0,131,132,5,46,0,0,132,2,1,0,0,0,133,134,5,91,0,0,134,135,6,1,0,0,135,4,1,0,0,0,136,137,5,93,0,0,137,138,6,2,1,0,138,6,1,0,0,0,139,140,5,40,0,0,140,141,6,3,2,0,141,8,1,0,0,0,142,143,5,41,0,0,143,144,6,4,3,0,144,10,1,0,0,0,145,146,5,44,0,0,146,12,1,0,0,0,147,148,5,61,0,0,148,14,1,0,0,0,149,150,5,63,0,0,150,16,1,0,0,0,151,152,5,58,0,0,152,18,1,0,0,0,153,154,5,43,0,0,154,20,1,0,0,0,155,156,5,45,0,0,156,22,1,0,0,0,157,158,5,42,0,0,158,24,1,0,0,0,159,160,5,47,0,0,160,26,1,0,0,0,161,162,5,37,0,0,162,28,1,0,0,0,163,164,5,35,0,0,164,30,1,0,0,0,165,166,5,60,0,0,166,32,1,0,0,0,167,168,5,62,0,0,168,34,1,0,0,0,169,170,5,60,0,0,170,171,5,61,0,0,171,36,1,0,0,0,172,173,5,62,0,0,173,174,5,61,0,0,174,38,1,0,0,0,175,176,5,61,0,0,176,177,5,61,0,0,177,40,1,0,0,0,178,179,5,33,0,0,179,180,5,61,0,0,180,42,1,0,0,0,181,182,5,42,0,0,182,183,5,61,0,0,183,44,1,0,0,0,184,185,5,47,0,0,185,186,5,61,0,0,186,46,1,0,0,0,187,188,5,37,0,0,188,189,5,61,0,0,189,48,1,0,0,0,190,191,5,43,0,0,191,192,5,61,0,0,192,50,1,0,0,0,193,194,5,45,0,0,194,195,5,61,0,0,195,52,1,0,0,0,196,197,5,61,0,0,197,198,5,62,0,0,198,54,1,0,0,0,199,200,5,58,0,0,200,201,5,61,0,0,201,56,1,0,0,0,202,203,5,116,0,0,203,204,5,114,0,0,204,205,5,117,0,0,205,212,5,101,0,0,206,207,5,102,0,0,207,208,5,97,0,0,208,209,5,108,0,0,209,210,5,115,0,0,210,212,5,101,0,0,211,202,1,0,0,0,211,206,1,0,0,0,212,58,1,0,0,0,213,214,3,121,60,0,214,60,1,0,0,0,215,216,5,46,0,0,216,218,3,121,60,0,217,219,3,129,64,0,218,217,1,0,0,0,218,219,1,0,0,0,219,232,1,0,0,0,220,229,3,121,60,0,221,226,5,46,0,0,222,224,3,121,60,0,223,225,3,129,64,0,224,223,1,0,0,0,224,225,1,0,0,0,225,227,1,0,0,0,226,222,1,0,0,0,226,227,1,0,0,0,227,230,1,0,0,0,228,230,3,129,64,0,229,221,1,0,0,0,229,228,1,0,0,0,230,232,1,0,0,0,231,215,1,0,0,0,231,220,1,0,0,0,232,62,1,0,0,0,233,234,5,98,0,0,234,235,5,114,0,0,235,236,5,101,0,0,236,237,5,97,0,0,237,238,5,107,0,0,238,64,1,0,0,0,239,240,5,97,0,0,240,241,5,110,0,0,241,242,5,100,0,0,242,66,1,0,0,0,243,244,5,101,0,0,244,245,5,120,0,0,245,246,5,112,0,0,246,247,5,111,0,0,247,248,5,114,0,0,248,249,5,116,0,0,249,68,1,0,0,0,250,251,5,102,0,0,251,252,5,111,0,0,252,253,5,114,0,0,253,70,1,0,0,0,254,255,5,118,0,0,255,256,5,97,0,0,256,257,5,114,0,0,257,72,1,0,0,0,258,259,5,99,0,0,259,260,5,111,0,0,260,261,5,110,0,0,261,262,5,116,0,0,262,263,5,105,0,0,263,264,5,110,0,0,264,265,5,117,0,0,265,266,5,101,0,0,266,74,1,0,0,0,267,268,5,118,0,0,268,269,5,97,0,0,269,270,5,114,0,0,270,271,5,105,0,0,271,272,5,112,0,0,272,76,1,0,0,0,273,274,5,115,0,0,274,275,5,119,0,0,275,276,5,105,0,0,276,277,5,116,0,0,277,278,5,99,0,0,278,279,5,104,0,0,279,78,1,0,0,0,280,281,5,119,0,0,281,282,5,104,0,0,282,283,5,105,0,0,283,284,5,108,0,0,284,285,5,101,0,0,285,80,1,0,0,0,286,287,5,105,0,0,287,288,5,102,0,0,288,82,1,0,0,0,289,290,5,105,0,0,290,291,5,110,0,0,291,84,1,0,0,0,292,293,5,111,0,0,293,294,5,114,0,0,294,86,1,0,0,0,295,296,5,110,0,0,296,297,5,111,0,0,297,298,5,116,0,0,298,88,1,0,0,0,299,300,5,109,0,0,300,301,5,101,0,0,301,302,5,116,0,0,302,303,5,104,0,0,303,304,5,111,0,0,304,305,5,100,0,0,305,90,1,0,0,0,306,307,5,101,0,0,307,308,5,108,0,0,308,309,5,115,0,0,309,310,5,101,0,0,310,92,1,0,0,0,311,312,5,116,0,0,312,313,5,111,0,0,313,94,1,0,0,0,314,315,5,98,0,0,315,316,5,121,0,0,316,96,1,0,0,0,317,318,5,116,0,0,318,319,5,121,0,0,319,320,5,112,0,0,320,321,5,101,0,0,321,98,1,0,0,0,322,323,5,105,0,0,323,324,5,109,0,0,324,325,5,112,0,0,325,326,5,111,0,0,326,327,5,114,0,0,327,328,5,116,0,0,328,100,1,0,0,0,329,330,5,97,0,0,330,331,5,115,0,0,331,102,1,0,0,0,332,333,5,109,0,0,333,334,5,97,0,0,334,335,5,112,0,0,335,104,1,0,0,0,336,337,5,35,0,0,337,338,3,123,61,0,338,339,3,123,61,0,339,340,3,123,61,0,340,341,3,123,61,0,341,342,3,123,61,0,342,343,3,123,61,0,343,355,1,0,0,0,344,345,5,35,0,0,345,346,3,123,61,0,346,347,3,123,61,0,347,348,3,123,61,0,348,349,3,123,61,0,349,350,3,123,61,0,350,351,3,123,61,0,351,352,3,123,61,0,352,353,3,123,61,0,353,355,1,0,0,0,354,336,1,0,0,0,354,344,1,0,0,0,355,106,1,0,0,0,356,357,3,117,58,0,357,108,1,0,0,0,358,362,7,0,0,0,359,361,7,1,0,0,360,359,1,0,0,0,361,364,1,0,0,0,362,360,1,0,0,0,362,363,1,0,0,0,363,110,1,0,0,0,364,362,1,0,0,0,365,366,3,125,62,0,366,367,1,0,0,0,367,368,6,55,4,0,368,112,1,0,0,0,369,370,3,127,63,0,370,371,1,0,0,0,371,372,6,56,5,0,372,114,1,0,0,0,373,374,4,57,0,0,374,386,3,125,62,0,375,377,5,13,0,0,376,375,1,0,0,0,376,377,1,0,0,0,377,378,1,0,0,0,378,381,5,10,0,0,379,381,2,12,13,0,380,376,1,0,0,0,380,379,1,0,0,0,381,383,1,0,0,0,382,384,3,125,62,0,383,382,1,0,0,0,383,384,1,0,0,0,384,386,1,0,0,0,385,373,1,0,0,0,385,380,1,0,0,0,386,387,1,0,0,0,387,388,6,57,6,0,388,116,1,0,0,0,389,395,5,39,0,0,390,394,8,2,0,0,391,392,5,92,0,0,392,394,5,39,0,0,393,390,1,0,0,0,393,391,1,0,0,0,394,397,1,0,0,0,395,393,1,0,0,0,395,396,1,0,0,0,396,398,1,0,0,0,397,395,1,0,0,0,398,410,5,39,0,0,399,405,5,34,0,0,400,404,8,3,0,0,401,402,5,92,0,0,402,404,5,34,0,0,403,400,1,0,0,0,403,401,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0,0,406,408,1,0,0,0,407,405,1,0,0,0,408,410,5,34,0,0,409,389,1,0,0,0,409,399,1,0,0,0,410,118,1,0,0,0,411,412,7,4,0,0,412,120,1,0,0,0,413,415,3,119,59,0,414,413,1,0,0,0,415,416,1,0,0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,122,1,0,0,0,418,419,7,5,0,0,419,124,1,0,0,0,420,422,7,6,0,0,421,420,1,0,0,0,422,423,1,0,0,0,423,421,1,0,0,0,423,424,1,0,0,0,424,126,1,0,0,0,425,426,5,47,0,0,426,427,5,47,0,0,427,431,1,0,0,0,428,430,8,7,0,0,429,428,1,0,0,0,430,433,1,0,0,0,431,429,1,0,0,0,431,432,1,0,0,0,432,128,1,0,0,0,433,431,1,0,0,0,434,436,7,8,0,0,435,437,7,9,0,0,436,435,1,0,0,0,436,437,1,0,0,0,437,438,1,0,0,0,438,439,3,121,60,0,439,130,1,0,0,0,22,0,211,218,224,226,229,231,354,362,376,380,383,385,393,395,403,405,409,416,423,431,436,7,1,1,0,1,2,1,1,3,2,1,4,3,0,1,0,0,2,0,1,57,4]),k(we,"__ATN"),k(we,"DecisionsToDFA",we._ATN.decisionToState.map((e,n)=>new cp(e,n)));let bl=we;var z=(t=>(t.BOOL="bool",t.INT="int",t.FLOAT="float",t.ARRAY="array",t.BOX="box",t.CHART_POINT="chart.point",t.COLOR="color",t.CONST="const",t.LABEL="label",t.LINE="line",t.LINEFILL="linefill",t.MAP="map",t.MATRIX="matrix",t.POLYLINE="polyline",t.SERIES="series",t.SIMPLE="simple",t.STRING="string",t.TABLE="table",t.UNDETERMINED="undetermined type",t.INPUT="input",t.NA="na",t.VOID="void",t))(z||{}),pe=(t=>(t.FlowStmt="FlowStmt",t.DeclareAssign="DeclareAssign",t.VarBlockStmt="VarBlockStmt",t.VarSingle="VarSingle",t.VarMultiple="VarMultiple",t.ParenthesizedExpression="ParenthesizedExpression",t.AdditiveExpression="AdditiveExpression",t.RelationalExpression="RelationalExpression",t.EqualityExpression="EqualityExpression",t.TernaryExpression="TernaryExpression",t.UnaryExpression="UnaryExpression",t.NotExpression="NotExpression",t.MemberIndexExpression="MemberIndexExpression",t.MethodExpression="MethodExpression",t.LogicalAndExpression="LogicalAndExpression",t.LogicalOrExpression="LogicalOrExpression",t.MultiplicativeExpression="MultiplicativeExpression",t.Brackethesized="Brackethesized",t.IfStatement="IfStatement",t.ForToStatement="ForToStatement",t.ForInStatement="ForInStatement",t.SwitchStatement="SwitchStatement",t.CaseClause="CaseClause",t.DefaultCaluse="DefaultCaluse",t.WhileStatement="WhileStatement",t.ImportElement="ImportElement",t.Literal="Literal",t.ArrowFunction="ArrowFunction",t.ArrowMethod="ArrowMethod",t.TypeStatement="TypeStatement",t.Name="Name",t.AgainAssign="AgainAssign",t))(pe||{}),On=(t=>(t.description="description",t.field="field",t.function="function",t.param="param",t.returns="returns",t.type="type",t.variable="variable",t))(On||{}),$o=(t=>(t.library="library",t.indicator="indicator",t.strategy="strategy",t))($o||{});const Ce={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeRepeatErr:"type '$name' is already defined.",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an na object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in.",useNaErr:"Cannot use an `na` value of an unspecified type in the `$name` function.",libraryTitleErr:"Invalid argument 'title' in 'library' call. It cannot contain spaces, special characters or begin with a digit.",exportFuncArgErr:"All exported functions args should be typified",indiRunErr:"An indicator must contain at least one of the following: any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, `alertcondition()`, or any drawing (line, label, box, table, polyline).",libraryExportErr:"A library must contain at least one exported function, method, or type.",strategyRunErr:"A strategy must contain at least one of the following: any `strategy.*()` function that creates orders, any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, or any drawing (line, label, box, table, polyline).",exportUseErr:"Only libraries can contain exported $type.",funcRepeatErr:"The '$name' function has overloads with the same parameters. The type of parameters must be different in overloaded versions of functions.",importMultipleErr:"Cannot import a library more than once",importNotExitErr:"The user '$username' does not have a published library titled '$libraryName'",importNameRepeatErr:"More than one import uses the same alias: $name. Previous usage at line: $line"},Qi={repeatVar:"Shadowing variable '$name' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ?",typeMismatch:"The `$index` parameter of the `$operator` function accepts a '$type' argument. To avoid potential unexpected results, pass a '$type' value or expression to this parameter.",moreSameArg:"More than one '$arg' arguments are supplied. Only the first one will be used.",localScopeGetHistory:"The variable '$name' is declared in local scope, which may not be executed at every update. So, obtaining its historical values may lead to unexpected results",localScopeWarning:"The function '$name' should be called on each calculation for consistency. It is recommended to extract the call from this scope"},Ni=[z.SERIES,z.SIMPLE,z.INPUT,z.CONST],Rp=[z.INT,z.FLOAT,z.BOOL,z.COLOR,z.STRING],vl=["indicator","strategy","library"],El=["plot","plotbar","plotchar","plotarrow","plotshape","plotcandle","hline","alertcondition","barcolor","bgcolor","fill"],w_=[...El,"indicator","library","strategy","strategy.risk.max_drawdown","strategy.risk.allow_entry_in","strategy.risk.max_cons_loss_days","max_intraday_filled_orders","strategy.risk.max_intraday_loss","strategy.risk.max_position_size"],N_=[...El,"table.new","label.new","line.new","box.new","polyline.new","linefill.new"],I_=["strategy.entry","strategy.order","strategy.exit","strategy.close","strategy.cancel","strategy.close_all","strategy.cancel_all"],wp=["strategy","input","table","color","line","linefill","label","box"],Sl=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"],P_=/^\/\/\s*@(description|field|function|param|returns|type|variable)/,Bn=["case","catch","default","delete","do","finally","function","instanceof","new","return","this","throw","try","typeof","void","with"];var Np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F_={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Np,function(){var n=1e3,o=6e4,s=36e5,f="millisecond",p="second",y="minute",E="hour",x="day",D="week",T="month",I="quarter",B="year",L="date",b="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_e){var te=["th","st","nd","rd"],he=_e%100;return"["+_e+(te[(he-20)%10]||te[he]||te[0])+"]"}},R=function(_e,te,he){var le=String(_e);return!le||le.length>=te?_e:""+Array(te+1-le.length).join(he)+_e},C={s:R,z:function(_e){var te=-_e.utcOffset(),he=Math.abs(te),le=Math.floor(he/60),xe=he%60;return(te<=0?"+":"-")+R(le,2,"0")+":"+R(xe,2,"0")},m:function _e(te,he){if(te.date()<he.date())return-_e(he,te);var le=12*(he.year()-te.year())+(he.month()-te.month()),xe=te.clone().add(le,T),Ie=he-xe<0,ge=te.clone().add(le+(Ie?-1:1),T);return+(-(le+(he-xe)/(Ie?xe-ge:ge-xe))||0)},a:function(_e){return _e<0?Math.ceil(_e)||0:Math.floor(_e)},p:function(_e){return{M:T,y:B,w:D,d:x,D:L,h:E,m:y,s:p,ms:f,Q:I}[_e]||String(_e||"").toLowerCase().replace(/s$/,"")},u:function(_e){return _e===void 0}},j="en",X={};X[j]=O;var re="$isDayjsObject",K=function(_e){return _e instanceof Q||!(!_e||!_e[re])},Y=function _e(te,he,le){var xe;if(!te)return j;if(typeof te=="string"){var Ie=te.toLowerCase();X[Ie]&&(xe=Ie),he&&(X[Ie]=he,xe=Ie);var ge=te.split("-");if(!xe&&ge.length>1)return _e(ge[0])}else{var Ue=te.name;X[Ue]=te,xe=Ue}return!le&&xe&&(j=xe),xe||!le&&j},G=function(_e,te){if(K(_e))return _e.clone();var he=typeof te=="object"?te:{};return he.date=_e,he.args=arguments,new Q(he)},ce=C;ce.l=Y,ce.i=K,ce.w=function(_e,te){return G(_e,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Q=function(){function _e(he){this.$L=Y(he.locale,null,!0),this.parse(he),this.$x=this.$x||he.x||{},this[re]=!0}var te=_e.prototype;return te.parse=function(he){this.$d=function(le){var xe=le.date,Ie=le.utc;if(xe===null)return new Date(NaN);if(ce.u(xe))return new Date;if(xe instanceof Date)return new Date(xe);if(typeof xe=="string"&&!/Z$/i.test(xe)){var ge=xe.match(_);if(ge){var Ue=ge[2]-1||0,J=(ge[7]||"0").substring(0,3);return Ie?new Date(Date.UTC(ge[1],Ue,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,J)):new Date(ge[1],Ue,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,J)}}return new Date(xe)}(he),this.init()},te.init=function(){var he=this.$d;this.$y=he.getFullYear(),this.$M=he.getMonth(),this.$D=he.getDate(),this.$W=he.getDay(),this.$H=he.getHours(),this.$m=he.getMinutes(),this.$s=he.getSeconds(),this.$ms=he.getMilliseconds()},te.$utils=function(){return ce},te.isValid=function(){return this.$d.toString()!==b},te.isSame=function(he,le){var xe=G(he);return this.startOf(le)<=xe&&xe<=this.endOf(le)},te.isAfter=function(he,le){return G(he)<this.startOf(le)},te.isBefore=function(he,le){return this.endOf(le)<G(he)},te.$g=function(he,le,xe){return ce.u(he)?this[le]:this.set(xe,he)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(he,le){var xe=this,Ie=!!ce.u(le)||le,ge=ce.p(he),Ue=function(Et,Mt){var gt=ce.w(xe.$u?Date.UTC(xe.$y,Mt,Et):new Date(xe.$y,Mt,Et),xe);return Ie?gt:gt.endOf(x)},J=function(Et,Mt){return ce.w(xe.toDate()[Et].apply(xe.toDate("s"),(Ie?[0,0,0,0]:[23,59,59,999]).slice(Mt)),xe)},ne=this.$W,se=this.$M,Se=this.$D,ye="set"+(this.$u?"UTC":"");switch(ge){case B:return Ie?Ue(1,0):Ue(31,11);case T:return Ie?Ue(1,se):Ue(0,se+1);case D:var At=this.$locale().weekStart||0,jt=(ne<At?ne+7:ne)-At;return Ue(Ie?Se-jt:Se+(6-jt),se);case x:case L:return J(ye+"Hours",0);case E:return J(ye+"Minutes",1);case y:return J(ye+"Seconds",2);case p:return J(ye+"Milliseconds",3);default:return this.clone()}},te.endOf=function(he){return this.startOf(he,!1)},te.$set=function(he,le){var xe,Ie=ce.p(he),ge="set"+(this.$u?"UTC":""),Ue=(xe={},xe[x]=ge+"Date",xe[L]=ge+"Date",xe[T]=ge+"Month",xe[B]=ge+"FullYear",xe[E]=ge+"Hours",xe[y]=ge+"Minutes",xe[p]=ge+"Seconds",xe[f]=ge+"Milliseconds",xe)[Ie],J=Ie===x?this.$D+(le-this.$W):le;if(Ie===T||Ie===B){var ne=this.clone().set(L,1);ne.$d[Ue](J),ne.init(),this.$d=ne.set(L,Math.min(this.$D,ne.daysInMonth())).$d}else Ue&&this.$d[Ue](J);return this.init(),this},te.set=function(he,le){return this.clone().$set(he,le)},te.get=function(he){return this[ce.p(he)]()},te.add=function(he,le){var xe,Ie=this;he=Number(he);var ge=ce.p(le),Ue=function(se){var Se=G(Ie);return ce.w(Se.date(Se.date()+Math.round(se*he)),Ie)};if(ge===T)return this.set(T,this.$M+he);if(ge===B)return this.set(B,this.$y+he);if(ge===x)return Ue(1);if(ge===D)return Ue(7);var J=(xe={},xe[y]=o,xe[E]=s,xe[p]=n,xe)[ge]||1,ne=this.$d.getTime()+he*J;return ce.w(ne,this)},te.subtract=function(he,le){return this.add(-1*he,le)},te.format=function(he){var le=this,xe=this.$locale();if(!this.isValid())return xe.invalidDate||b;var Ie=he||"YYYY-MM-DDTHH:mm:ssZ",ge=ce.z(this),Ue=this.$H,J=this.$m,ne=this.$M,se=xe.weekdays,Se=xe.months,ye=xe.meridiem,At=function(Mt,gt,Ct,Jt){return Mt&&(Mt[gt]||Mt(le,Ie))||Ct[gt].slice(0,Jt)},jt=function(Mt){return ce.s(Ue%12||12,Mt,"0")},Et=ye||function(Mt,gt,Ct){var Jt=Mt<12?"AM":"PM";return Ct?Jt.toLowerCase():Jt};return Ie.replace(g,function(Mt,gt){return gt||function(Ct){switch(Ct){case"YY":return String(le.$y).slice(-2);case"YYYY":return ce.s(le.$y,4,"0");case"M":return ne+1;case"MM":return ce.s(ne+1,2,"0");case"MMM":return At(xe.monthsShort,ne,Se,3);case"MMMM":return At(Se,ne);case"D":return le.$D;case"DD":return ce.s(le.$D,2,"0");case"d":return String(le.$W);case"dd":return At(xe.weekdaysMin,le.$W,se,2);case"ddd":return At(xe.weekdaysShort,le.$W,se,3);case"dddd":return se[le.$W];case"H":return String(Ue);case"HH":return ce.s(Ue,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Et(Ue,J,!0);case"A":return Et(Ue,J,!1);case"m":return String(J);case"mm":return ce.s(J,2,"0");case"s":return String(le.$s);case"ss":return ce.s(le.$s,2,"0");case"SSS":return ce.s(le.$ms,3,"0");case"Z":return ge}return null}(Mt)||ge.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(he,le,xe){var Ie,ge=this,Ue=ce.p(le),J=G(he),ne=(J.utcOffset()-this.utcOffset())*o,se=this-J,Se=function(){return ce.m(ge,J)};switch(Ue){case B:Ie=Se()/12;break;case T:Ie=Se();break;case I:Ie=Se()/3;break;case D:Ie=(se-ne)/6048e5;break;case x:Ie=(se-ne)/864e5;break;case E:Ie=se/s;break;case y:Ie=se/o;break;case p:Ie=se/n;break;default:Ie=se}return xe?Ie:ce.a(Ie)},te.daysInMonth=function(){return this.endOf(T).$D},te.$locale=function(){return X[this.$L]},te.locale=function(he,le){if(!he)return this.$L;var xe=this.clone(),Ie=Y(he,le,!0);return Ie&&(xe.$L=Ie),xe},te.clone=function(){return ce.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},_e}(),me=Q.prototype;return G.prototype=me,[["$ms",f],["$s",p],["$m",y],["$H",E],["$W",x],["$M",T],["$y",B],["$D",L]].forEach(function(_e){me[_e[1]]=function(te){return this.$g(te,_e[0],_e[1])}}),G.extend=function(_e,te){return _e.$i||(_e(te,Q,G),_e.$i=!0),G},G.locale=Y,G.isDayjs=K,G.unix=function(_e){return G(1e3*_e)},G.en=X[j],G.Ls=X,G.p={},G})})(F_);function Ne(t,e){return t.replace(/\$(\w+)/g,(n,o)=>String(e[o])||n)}class L_ extends o_{constructor(){super(...arguments);k(this,"visitProgram");k(this,"visitGlobalStmt");k(this,"visitBlockStmt");k(this,"visitStmt");k(this,"visitSimpleStmt");k(this,"visitFlowStmt");k(this,"visitBlock");k(this,"visitBlockLine");k(this,"visitVariableDeclarationStmt");k(this,"visitDeclareAssign");k(this,"visitAgainAssign");k(this,"visitVarModifier");k(this,"visitBlockSequence");k(this,"visitExpressionSequence");k(this,"visitExpressionBlockSequence");k(this,"visitVarBlockStmt");k(this,"visitVarSingle");k(this,"visitVarMultiple");k(this,"visitBlockExpression");k(this,"visitParenthesizedExpression");k(this,"visitAdditiveExpression");k(this,"visitRelationalExpression");k(this,"visitTernaryExpression");k(this,"visitLogicalAndExpression");k(this,"visitNameExpression");k(this,"visitLiteralExpression");k(this,"visitLogicalOrExpression");k(this,"visitUnaryExpression");k(this,"visitNotExpression");k(this,"visitMemberIndexExpression");k(this,"visitMethodExpression");k(this,"visitEqualityExpression");k(this,"visitMultiplicativeExpression");k(this,"visitBrackethesized");k(this,"visitArguments");k(this,"visitArgument");k(this,"visitIfStatement");k(this,"visitForToStatement");k(this,"visitForInStatement");k(this,"visitSwitchStatement");k(this,"visitCaseClause");k(this,"visitDefaultCaluse");k(this,"visitWhileStatement");k(this,"visitImportStmt");k(this,"visitImportElement");k(this,"visitLiteral");k(this,"visitMethodStmt");k(this,"visitMethodElement");k(this,"visitMethodName");k(this,"visitArrowFunction");k(this,"visitArrowFunctionParameters");k(this,"visitFormalParameterList");k(this,"visitFormalParameterArg");k(this,"visitArrowMethod");k(this,"visitArrowMethodParameters");k(this,"visitTypeStatement");k(this,"visitTypeElement");k(this,"visitAssignmentOperator");k(this,"visitTypeMap");k(this,"visitTypeSeries");k(this,"visitTypeArray");k(this,"visitTypeGather");k(this,"visitIdentifier");k(this,"visitTypeName");k(this,"visitName")}}class M_ extends L_{constructor(n){super();k(this,"_buildinVariables");k(this,"_buildinTypes");k(this,"_buildinConstants");k(this,"_buildinMethods");k(this,"_buildinFunctions");this._buildinVariables=new Map,this._buildinConstants=new Map,this._buildinFunctions=new Map,this._buildinTypes=new Map,this._buildinMethods=new Map,this._buildinHandle(n)}_buildinHandle(n){for(const o in n){const s=new Map(Object.entries(n[o]));switch(o){case"constants":this._buildinConstants=s;break;case"functions":this._buildinFunctions=s;break;case"methods":this._buildinMethods=s;break;case"types":this._buildinTypes=s;break;case"variables":this._buildinVariables=s;break}}}_typeHandle(n=[],o){if(!n.length)return z.UNDETERMINED;if(n=n.filter(p=>!p.endsWith(z.NA)),!n.length)return`${z.SIMPLE} ${z.NA}`;let s=100,f="";for(const p of n){if(p===z.UNDETERMINED)return z.UNDETERMINED;p.startsWith(z.SERIES)?s=0:p.startsWith(z.SIMPLE)&&s>0?s=1:p.startsWith(z.INPUT)&&s>1?s=2:p.startsWith(z.CONST)&&s>2&&(s=3);const y=this._removePrefix(p);(y!==z.INT||!f)&&(f=y)}return s===100?f:`${Ni[s]} ${o||f}`}_returnTypesOtherHandle(n,o,s,f){if(!s.length||s[0].includes("<>")){const p=n.type;let y=p;if(!p||p===z.UNDETERMINED)return[z.UNDETERMINED];switch(o){case"series <type>":y=this._getArrayType(p),y||(y=this._removePrefix(p)),s=[this._typeAddSeries(y)];break;case"array<type>":case"matrix<type>":case"type[]":if(this._isMapType(p)){const E=this._getMapType(p)||[];f.includes("keys")?y=E[0]:y=E[1]}else y=this._getArrayType(p),y||(y=this._removePrefix(p));s=[this._typeReplace(o,y)];break;case"<matrix_type>":y=this._getArrayType(p),s=[this._typeAddSeries(y)];break;case"map<keyType, valueType>":s=[y];break;case"<value_type>":y=this._getMapType(p),s=[y[1]];break}}return s}_checkMethodThisType(n,o){if(!n||!n.length||n[0].includes("<>"))return!0;const s=o.replace("int","float");return n.some(f=>f===o||s===f||f.endsWith(o))}_priorityComparison(n,o){if(!n)return!1;if(this._isArrayType(n)||this._isMatrixType(n))return this._getArrayType(o)!==z.INT;{const s=this._getPrefix(n),f=this._getPrefix(o);return s===f?!!n.endsWith(z.INT):!(Ni.indexOf(s)<Ni.indexOf(f))}}_compareType(n,o){if(n===z.UNDETERMINED||o===z.UNDETERMINED)return!0;const s=[z.FLOAT,z.INT];if(this._isArrayType(n)||this._isMatrixType(n)){const f=this._getArrayType(n)||"",p=this._getArrayType(o)||"";return f===p||s.includes(f)&&s.includes(p)}else if(this._isMapType(n)){const f=this._getMapType(n)||[],p=this._getMapType(o)||[];return(f[0]===p[0]||s.includes(f[0])&&s.includes(p[0]))&&(f[1]===p[1]||s.includes(f[1])&&s.includes(p[1]))}else{const f=this._removePrefix(n),p=this._removePrefix(o);return f===z.NA||p===z.NA||f===p||s.includes(f)&&s.includes(p)}}_typeAddSeries(n){return this._buildinTypes.get(n)&&n!==z.CHART_POINT?`${z.SERIES} ${n}`:n}_typeAddConst(n){return Rp.includes(n)?`${z.CONST} ${n}`:this._typeAddSeries(n)}_getOriginMethodName(n,o){let s="";return this._isArrayType(n)?s=`${z.ARRAY}.${o}`:this._isMatrixType(n)?s=`${z.MATRIX}.${o}`:this._isMapType(n)?s=`${z.MAP}.${o}`:s=`${this._removePrefix(n)}.${o}`,s}_returnedTypesParse(n){if(!n||!n.length)return[];const o=n[0];return/^\[.+\]$/.test(o)?o.replace(/[[\]]/g,"").split(",").map(s=>s.trim()):n}_removePrefix(n=""){return n.replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}_getPrefix(n){if(!n)return"";const o=n.replace(/(series|simple|const|input).+/,"$1");return Ni.includes(o)?o:""}_getArrayType(n){let o=/\w+<([\w\d.]+)>/.exec(n);return o||(o=/([\w\d.]+)\[\]/.exec(n)),o==null?void 0:o[1]}_getMapType(n){const o=/\w+<(\w+),\s*([\w\d.]+)>/.exec(n);return(o==null?void 0:o[1])&&(o==null?void 0:o[2])&&[o==null?void 0:o[1],o==null?void 0:o[2]]}_isMatrixType(n){return/^matrix<[\w\d.]+>$/.test(n)}_isArrayType(n){return/^array<[\w\d.]+>$/.test(n)||/^[\w\d.]+\[\]$/.test(n)}_isMapType(n){return/^map<\w+,\s*[\w\d.]+>$/.test(n)}_arrayTypeConvert(n){return!this._isArrayType(n)||!n.includes("<")?n:`${this._getArrayType(n)}[]`}_getMethodTypeName(n){return this._isArrayType(n)?z.ARRAY:this._isMapType(n)?z.MAP:this._isMatrixType(n)?z.MATRIX:this._removePrefix(n)}_typeReplace(n,o){return o=this._removePrefix(o),this._arrayTypeConvert(n.startsWith(z.SERIES)?n.replace("<type>",o):n.replace("type",o))}}var ar=(t=>(t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error",t))(ar||{});class Ip extends M_{constructor(n,o,s){super(n);k(this,"_loopCount");k(this,"_errors");k(this,"_variables");k(this,"_functions");k(this,"_methods");k(this,"_types");k(this,"_currentBlockVars");k(this,"_currentFuncParams");k(this,"_isNeedCalc");k(this,"_blockCount");k(this,"_isInFunc");k(this,"_onlyStatementsCount");k(this,"_blockRanges");k(this,"_overloadsFuncs");k(this,"_hasMemberIndex");k(this,"_isInLocalScop");k(this,"_comments");k(this,"_currentLine",0);k(this,"_hasDrawFunc",!1);k(this,"_hasCreateOrderFunc",!1);k(this,"_scriptType");k(this,"_exportFunctions");k(this,"_exportMethods");k(this,"_exportTypes");k(this,"_exportPositions");k(this,"_description","");k(this,"_endExport");k(this,"_importLibs");k(this,"_getImportLibraryFunc");k(this,"_isEndExpr");k(this,"_inputVarName");k(this,"visitProgram",async n=>{const{children:o}=n;let s=0;const f=[];for(this._pushBlockRanges(n);s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_globalStmt&&f.push(await this.visit(p))}return this._onlyStatementsCount<=0&&this._errors.push({startColumn:0,endColumn:0,startLineNumber:0,endLineNumber:0,type:ar.Error,message:Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount})}),f});k(this,"visitGlobalStmt",async n=>{const{children:o}=n;if(o&&o.length){const s=o[0],f=await this.visit(s);return s.ruleIndex===F.RULE_methodStmt&&vl.includes(f.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1?this._errorHandle(Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount}),s):this._scriptType=f.exprs[0].name),f}return null});k(this,"visitBlockStmt",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationStmt:f.push(...this.visit(p));break;case F.RULE_varBlockStmt:f.push(this.visit(p));break;case F.RULE_blockExpression:f.push(this.visit(p));break}}return f});k(this,"visitStmt",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitSimpleStmt",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitFlowStmt",n=>{const{children:o}=n,{column:s,line:f,text:p}=o[0].symbol;if(this._currentLine=f,this._loopCount<=0){const y=s+1;this._errors.push({startColumn:y,endColumn:parseInt(y+p.length),startLineNumber:f,endLineNumber:f,message:Ne(Ce.onlyInLoop,{text:p})})}return{ruleType:pe.FlowStmt,value:p}});k(this,"visitBlock",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return s.ruleIndex===F.RULE_simpleStmt?this._inBlock(s):this.visit(s)}return null});k(this,"visitBlockLine",n=>{const{children:o}=n;if(!o)return null;let s=0;const f=[];this._blockCount++,this._pushBlockRanges(n);const p=this._isEndExpr;for(;s<o.length;s++){const y=o[s];y.ruleIndex===F.RULE_stmt&&(this._isInFunc&&(this._isEndExpr=o.length-2===s&&p),f.push(this.visit(y)))}return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),f});k(this,"visitDeclareAssign",n=>{var p;const{children:o}=n;let s=0;const f={ruleType:pe.DeclareAssign};for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_varArrayDeclaration:f.nameList=this.visit(y),this._inputVarName=(p=f.nameList)==null?void 0:p.name;break;case F.RULE_singleExpression:f.value=this.visit(y),this._inputVarName=void 0;break}}return this._variablesHandle(f,n),f});k(this,"visitAgainAssign",n=>{const{children:o,start:s}=n;if(this._currentLine=s.line,o.length>=3){const f=this.visit(o[0]);this._verifyGloablVar(f,o[0]);const p=this.visit(o[2]),y=this.visit(o[1]);return f.type?this._againAssignHandle([f,p],[o[0],o[2]],y):null}return null});k(this,"visitVarModifier",n=>{const{children:o}=n;return o[0].symbol.text});k(this,"visitExpressionSequence",n=>{const{children:o,start:s}=n;let f=0;const p=[];for(this._currentLine=s.line;f<o.length;f++){const y=o[f];if(y.ruleIndex===F.RULE_singleExpression){const E=this.visit(y);E&&(E.ctx=y,p.push(E))}}return p});k(this,"visitExpressionBlockSequence",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_singleExpression:f.push(this.visit(p));break;case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_blockExpression:f.push(this.visit(p));break;case F.RULE_varBlockStmt:f.push(this.visit(p));break}}return f});k(this,"visitBlockSequence",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_singleExpression:f.push(this.visit(p));break}}return f});k(this,"visitVariableDeclarationStmt",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_methodStmt:const y=this.visit(p);vl.includes(y.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1?this._errorHandle(Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount}),p):this._scriptType=y.exprs[0].name),f.push(y);break}}return f});k(this,"visitVarBlockStmt",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.VarBlockStmt,ctx:n},p=[];for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_varArrayDeclaration:f.nameList=this.visit(y);break;case F.RULE_assignmentOperator:f.operator=this.visit(y);break;case F.RULE_name:p.push(y),f.name=this.visit(y);break;case F.RULE_blockExpression:this._isNeedCalc=!0,f.value=this.visit(y),p.push(y);const E=this._getBlockReturnTypes(f.value);E.length===1?f.value.type=E[0]:f.value.types=E,this._isNeedCalc=!1;break}}return f.name?this._againAssignHandle([f.name,f.value],p,f.operator):(this._variablesHandle(f,n),f)});k(this,"visitVarSingle",n=>{const{children:o,start:s}=n,f={ruleType:pe.VarSingle};let p=0;const y=this._commentsParser(s.line,[On.variable]);f.desc=y==null?void 0:y[On.variable],this._currentLine=s.line;let E={lineNumber:0,column:0};for(;p<o.length;p++){const x=o[p];switch(x.ruleIndex){case F.RULE_varModifier:f.declare=this.visit(x);break;case F.RULE_typeGather:const D=this.visit(x);f.prefix=this._getPrefix(D),f.type=D&&this._typeAddConst(D);break;case F.RULE_identifier:const T=this.visit(x);this._repeatVarJudge(T,x),E={lineNumber:x.start.line,column:x.start.column},f.name=T,f.pos=E;break}}return f});k(this,"_commentsParser",(n,o,s=!1)=>{var x;const f=this._comments.filter(D=>D.line<n&&D.line>=this._currentLine),p={},y={line:0,key:"",secKey:""},E=[On.field,On.param];for(const D of f){const[T,I]=P_.exec(D.text)||[];if(I&&o.includes(I)){const B=D.text.replace(T,"").trim();if(Object.assign(y,{line:D.line,key:I}),E.includes(I)){const[L,...b]=B.split(" ");L&&(Object.assign(y,{secKey:L}),p[I]=Object.assign(p[I]||{},{[L]:b.join(" ").trim()}))}else p[I]=[B]}else if(s&&y.key){const B=D.text.replace("//","").trim();E.includes(y.key)?p[y.key][y.secKey]+=` ${B}`:(x=p[y.key])==null||x.push(B)}}return p});k(this,"visitVarMultiple",n=>{const{children:o,start:s}=n;let f=0;const p=[],y=[];for(this._currentLine=s.line;f<o.length;f++){const E=o[f];if(E.ruleIndex===F.RULE_identifier){const x=this.visit(E);this._repeatVarJudge(x,E),p.push(x),y.push({lineNumber:E.start.line,column:E.start.column})}}return{ruleType:pe.VarMultiple,names:p,posList:y}});k(this,"visitBlockExpression",n=>{const{children:o,start:s}=n;if(this._currentLine=s.line,o&&o.length){const f=o[0];return this.visit(f)}return null});k(this,"visitParenthesizedExpression",n=>{const{children:o}=n,s=o[1],f=this.visit(s);return{ruleType:pe.ParenthesizedExpression,type:f.type,ctx:n,exprs:f}});k(this,"visitAdditiveExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression?p.push(this.visit(E)):f=E.symbol.text}const y={ruleType:pe.AdditiveExpression,operator:f,ctx:n,exprs:p};if(["+","-"].includes(f)){const E=[z.UNDETERMINED,z.INT,z.FLOAT];f==="+"&&E.push(z.STRING);const x=this._sameTypeJudge(p,[o[0],o[2]],f,E);y.type=this._typeHandle(x)}else{const E=this._calcTypeJudge(p[0],o[0],f),x=this._calcTypeJudge(p[1],o[2],f,1);y.type=this._typeHandle([E,x])}return y});k(this,"visitRelationalExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._calcTypeJudge(p[0],o[0],f),E=this._calcTypeJudge(p[1],o[2],f,1);return{ruleType:pe.RelationalExpression,operator:f,ctx:n,type:this._typeHandle([y,E],z.BOOL),exprs:p}});k(this,"visitEqualityExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression?p.push(this.visit(E)):f=E.symbol.text}const y=this._sameTypeJudge(p,[o[0],o[2]],f,[z.UNDETERMINED,z.COLOR,z.STRING,z.BOOL,z.INT,z.FLOAT]);return{ruleType:pe.EqualityExpression,operator:f,ctx:n,type:this._typeHandle(y,z.BOOL),exprs:p}});k(this,"visitTernaryExpression",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const y=o[s];if(y.ruleIndex===F.RULE_singleExpression){const E=this._isInLocalScop;s!==0&&(this._isInLocalScop=!0),f.push(this.visit(y)),this._isInLocalScop=E}}let p=z.UNDETERMINED;if(f.length>=3){this._boolTypeJudge(f[0],o[0],"?:");const y=this._sameTypeJudge(f.slice(1),[o[2],o[4]],"?:",[]),E=this._getPrefix(f[0].type);p=this._typeHandle(y),E&&this._getPrefix(p)&&(p=this._typeHandle([p,`${E} ${this._removePrefix(p)}`]))}return{ruleType:pe.TernaryExpression,type:p,ctx:n,exprs:f}});k(this,"visitNameExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitLiteralExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitUnaryExpression",n=>{var x;const{children:o}=n,[s,f]=o,p=[this.visit(f)],y=s.symbol.text,E=this._calcTypeJudge(p[0],f,y);return((x=p[0])==null?void 0:x.ruleType)===pe.UnaryExpression&&this._errors.push({message:Ne(Ce.unaryErr,{sign:y}),startColumn:s.symbol.column+1,startLineNumber:s.symbol.line,endColumn:s.symbol.column+2,endLineNumber:s.symbol.line}),{ruleType:pe.UnaryExpression,operator:y,type:E,ctx:n,exprs:p}});k(this,"visitNotExpression",n=>{const{children:o}=n,s=o[1],f=[this.visit(s)],p=this._boolTypeJudge(f[0],s,"not");return{ruleType:pe.NotExpression,ctx:n,type:this._typeHandle([p],z.BOOL),exprs:f}});k(this,"visitMemberIndexExpression",n=>{var p,y;const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression&&f.push(this.visit(E))}if(this._memberIndexVerify(f[0],n),this._hasMemberIndex=!0,((p=f[0])==null?void 0:p.ruleType)===pe.MemberIndexExpression){const E=o[1];this._errors.push({message:Ne(Ce.unaryErr,{sign:"["}),startColumn:E.symbol.column+1,startLineNumber:E.symbol.line,endColumn:E.symbol.column+2,endLineNumber:E.symbol.line}),this._hasMemberIndex=!1}return{ruleType:pe.MemberIndexExpression,type:(y=f[0])==null?void 0:y.type,ctx:n,isInFunc:this._isInFunc,exprs:f}});k(this,"visitMethodStmt",n=>{var D;const{children:o,start:s}=n;let f=0;const p=[],y=[],E=this._commentsParser(s.line,[On.description],!0);this._currentLine=s.line;let x;for(;f<o.length;f++){const T=o[f];T.ruleIndex===F.RULE_methodElement&&(p.push(this.visit(T)),y.push(T))}return((D=p[0])==null?void 0:D.name)===$o.library&&E.description&&(this._description=E.description.join(`
|
11
|
+
`));this.indents.length;)this.emitToken(this.createDedent()),this.indents.pop();this.emitToken(this.commonToken(F.EOF,"<EOF>"))}const n=super.nextToken();return this.tokens.length?this.tokens.shift():n}createDedent(){return this.commonToken(F.DEDENT,"")}getCharIndex(){return this._input.index}commonToken(n,o){const s=this.getCharIndex()-1,f=o.length?s-o.length+1:s;return new Zm([this,this._input],n,0,f,s)}getIndentationCount(n){let o=0;for(let s=0;s<n.length;s++)n[s]===" "?o+=4-o%4:o++;return o}atStartOfInput(){return this.getCharIndex()===0}openBrace(){this.opened++}closeBrace(){this.opened--}onNewLine(){const n=this.text.replace(/[^\r\n]+/g,""),o=this.text.replace(/[\r\n]+/g,""),s=this._input.LA(1),f=this._input.LA(2),p=this.getIndentationCount(o);if(this.opened>0||f!=-1&&(s===13||s===10||s===47&&f===47||p%4))this.skip();else{this.emitToken(this.commonToken(F.NEWLINE,n));const y=this.indents.length?this.indents[this.indents.length-1]:0;if(p===y)this.skip();else if(p>y)this.indents.push(p),this.emitToken(this.commonToken(F.INDENT,o));else for(;this.indents.length&&this.indents[this.indents.length-1]>p;)this.emitToken(this.createDedent()),this.indents.pop()}}}const we=class we extends R_{constructor(e){super(e),this._interp=new i_(this,we._ATN,we.DecisionsToDFA,new lp)}get grammarFileName(){return"tccScriptLexer.g4"}get literalNames(){return we.literalNames}get symbolicNames(){return we.symbolicNames}get ruleNames(){return we.ruleNames}get serializedATN(){return we._serializedATN}get channelNames(){return we.channelNames}get modeNames(){return we.modeNames}action(e,n,o){switch(n){case 1:this.OpenBracket_action(e,o);break;case 2:this.CloseBracket_action(e,o);break;case 3:this.OpenParen_action(e,o);break;case 4:this.CloseParen_action(e,o);break;case 57:this.NEWLINE_action(e,o);break}}OpenBracket_action(e,n){switch(n){case 0:this.openBrace();break}}CloseBracket_action(e,n){switch(n){case 1:this.closeBrace();break}}OpenParen_action(e,n){switch(n){case 2:this.openBrace();break}}CloseParen_action(e,n){switch(n){case 3:this.closeBrace();break}}NEWLINE_action(e,n){switch(n){case 4:this.onNewLine();break}}sempred(e,n,o){switch(n){case 57:return this.NEWLINE_sempred(e,o)}return!0}NEWLINE_sempred(e,n){switch(n){case 0:return this.atStartOfInput()}return!0}static get _ATN(){return we.__ATN||(we.__ATN=new up().deserialize(we._serializedATN)),we.__ATN}};k(we,"INDENT",1),k(we,"DEDENT",2),k(we,"Point",3),k(we,"OpenBracket",4),k(we,"CloseBracket",5),k(we,"OpenParen",6),k(we,"CloseParen",7),k(we,"Comma",8),k(we,"Assign",9),k(we,"QuestionMark",10),k(we,"Colon",11),k(we,"Plus",12),k(we,"Minus",13),k(we,"Multiply",14),k(we,"Divide",15),k(we,"Modulus",16),k(we,"Hashtag",17),k(we,"LessThan",18),k(we,"MoreThan",19),k(we,"LessThanEquals",20),k(we,"GreaterThanEquals",21),k(we,"Equals_",22),k(we,"NotEquals",23),k(we,"MultiplyAssign",24),k(we,"DivideAssign",25),k(we,"ModulusAssign",26),k(we,"PlusAssign",27),k(we,"MinusAssign",28),k(we,"ARROW",29),k(we,"ColonEquals",30),k(we,"BooleanLiteral",31),k(we,"IntegerLiteral",32),k(we,"DecimalLiteral",33),k(we,"Break",34),k(we,"And",35),k(we,"Export",36),k(we,"For",37),k(we,"Var",38),k(we,"Continue",39),k(we,"Varip",40),k(we,"Switch",41),k(we,"While",42),k(we,"If",43),k(we,"In",44),k(we,"Or",45),k(we,"Not",46),k(we,"Method",47),k(we,"Else",48),k(we,"To",49),k(we,"By",50),k(we,"Type",51),k(we,"Import",52),k(we,"As",53),k(we,"Map",54),k(we,"ColorLiteral",55),k(we,"StringLiteral",56),k(we,"Identifier",57),k(we,"HIDDEN_",58),k(we,"COMMENT_",59),k(we,"NEWLINE",60),k(we,"EOF",fp.EOF),k(we,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),k(we,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),k(we,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","COMMENT_","NEWLINE"]),k(we,"modeNames",["DEFAULT_MODE"]),k(we,"ruleNames",["Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","COMMENT_","NEWLINE","SHORT_STRING","DIGIT","DIGITS","HEX_DIGIT","SPACES","COMMENT","EXP"]),k(we,"_serializedATN",[4,0,60,440,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,1,0,1,0,1,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,212,8,28,1,29,1,29,1,30,1,30,1,30,3,30,219,8,30,1,30,1,30,1,30,1,30,3,30,225,8,30,3,30,227,8,30,1,30,3,30,230,8,30,3,30,232,8,30,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,1,50,1,50,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,52,355,8,52,1,53,1,53,1,54,1,54,5,54,361,8,54,10,54,12,54,364,9,54,1,55,1,55,1,55,1,55,1,56,1,56,1,56,1,56,1,57,1,57,1,57,3,57,377,8,57,1,57,1,57,3,57,381,8,57,1,57,3,57,384,8,57,3,57,386,8,57,1,57,1,57,1,58,1,58,1,58,1,58,5,58,394,8,58,10,58,12,58,397,9,58,1,58,1,58,1,58,1,58,1,58,5,58,404,8,58,10,58,12,58,407,9,58,1,58,3,58,410,8,58,1,59,1,59,1,60,4,60,415,8,60,11,60,12,60,416,1,61,1,61,1,62,4,62,422,8,62,11,62,12,62,423,1,63,1,63,1,63,1,63,5,63,430,8,63,10,63,12,63,433,9,63,1,64,1,64,3,64,437,8,64,1,64,1,64,0,0,65,1,3,3,4,5,5,7,6,9,7,11,8,13,9,15,10,17,11,19,12,21,13,23,14,25,15,27,16,29,17,31,18,33,19,35,20,37,21,39,22,41,23,43,24,45,25,47,26,49,27,51,28,53,29,55,30,57,31,59,32,61,33,63,34,65,35,67,36,69,37,71,38,73,39,75,40,77,41,79,42,81,43,83,44,85,45,87,46,89,47,91,48,93,49,95,50,97,51,99,52,101,53,103,54,105,55,107,56,109,57,111,58,113,59,115,60,117,0,119,0,121,0,123,0,125,0,127,0,129,0,1,0,10,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,39,39,1,0,34,34,1,0,48,57,3,0,48,57,65,70,97,102,2,0,9,9,32,32,2,0,10,10,12,13,2,0,69,69,101,101,2,0,43,43,45,45,453,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,1,131,1,0,0,0,3,133,1,0,0,0,5,136,1,0,0,0,7,139,1,0,0,0,9,142,1,0,0,0,11,145,1,0,0,0,13,147,1,0,0,0,15,149,1,0,0,0,17,151,1,0,0,0,19,153,1,0,0,0,21,155,1,0,0,0,23,157,1,0,0,0,25,159,1,0,0,0,27,161,1,0,0,0,29,163,1,0,0,0,31,165,1,0,0,0,33,167,1,0,0,0,35,169,1,0,0,0,37,172,1,0,0,0,39,175,1,0,0,0,41,178,1,0,0,0,43,181,1,0,0,0,45,184,1,0,0,0,47,187,1,0,0,0,49,190,1,0,0,0,51,193,1,0,0,0,53,196,1,0,0,0,55,199,1,0,0,0,57,211,1,0,0,0,59,213,1,0,0,0,61,231,1,0,0,0,63,233,1,0,0,0,65,239,1,0,0,0,67,243,1,0,0,0,69,250,1,0,0,0,71,254,1,0,0,0,73,258,1,0,0,0,75,267,1,0,0,0,77,273,1,0,0,0,79,280,1,0,0,0,81,286,1,0,0,0,83,289,1,0,0,0,85,292,1,0,0,0,87,295,1,0,0,0,89,299,1,0,0,0,91,306,1,0,0,0,93,311,1,0,0,0,95,314,1,0,0,0,97,317,1,0,0,0,99,322,1,0,0,0,101,329,1,0,0,0,103,332,1,0,0,0,105,354,1,0,0,0,107,356,1,0,0,0,109,358,1,0,0,0,111,365,1,0,0,0,113,369,1,0,0,0,115,385,1,0,0,0,117,409,1,0,0,0,119,411,1,0,0,0,121,414,1,0,0,0,123,418,1,0,0,0,125,421,1,0,0,0,127,425,1,0,0,0,129,434,1,0,0,0,131,132,5,46,0,0,132,2,1,0,0,0,133,134,5,91,0,0,134,135,6,1,0,0,135,4,1,0,0,0,136,137,5,93,0,0,137,138,6,2,1,0,138,6,1,0,0,0,139,140,5,40,0,0,140,141,6,3,2,0,141,8,1,0,0,0,142,143,5,41,0,0,143,144,6,4,3,0,144,10,1,0,0,0,145,146,5,44,0,0,146,12,1,0,0,0,147,148,5,61,0,0,148,14,1,0,0,0,149,150,5,63,0,0,150,16,1,0,0,0,151,152,5,58,0,0,152,18,1,0,0,0,153,154,5,43,0,0,154,20,1,0,0,0,155,156,5,45,0,0,156,22,1,0,0,0,157,158,5,42,0,0,158,24,1,0,0,0,159,160,5,47,0,0,160,26,1,0,0,0,161,162,5,37,0,0,162,28,1,0,0,0,163,164,5,35,0,0,164,30,1,0,0,0,165,166,5,60,0,0,166,32,1,0,0,0,167,168,5,62,0,0,168,34,1,0,0,0,169,170,5,60,0,0,170,171,5,61,0,0,171,36,1,0,0,0,172,173,5,62,0,0,173,174,5,61,0,0,174,38,1,0,0,0,175,176,5,61,0,0,176,177,5,61,0,0,177,40,1,0,0,0,178,179,5,33,0,0,179,180,5,61,0,0,180,42,1,0,0,0,181,182,5,42,0,0,182,183,5,61,0,0,183,44,1,0,0,0,184,185,5,47,0,0,185,186,5,61,0,0,186,46,1,0,0,0,187,188,5,37,0,0,188,189,5,61,0,0,189,48,1,0,0,0,190,191,5,43,0,0,191,192,5,61,0,0,192,50,1,0,0,0,193,194,5,45,0,0,194,195,5,61,0,0,195,52,1,0,0,0,196,197,5,61,0,0,197,198,5,62,0,0,198,54,1,0,0,0,199,200,5,58,0,0,200,201,5,61,0,0,201,56,1,0,0,0,202,203,5,116,0,0,203,204,5,114,0,0,204,205,5,117,0,0,205,212,5,101,0,0,206,207,5,102,0,0,207,208,5,97,0,0,208,209,5,108,0,0,209,210,5,115,0,0,210,212,5,101,0,0,211,202,1,0,0,0,211,206,1,0,0,0,212,58,1,0,0,0,213,214,3,121,60,0,214,60,1,0,0,0,215,216,5,46,0,0,216,218,3,121,60,0,217,219,3,129,64,0,218,217,1,0,0,0,218,219,1,0,0,0,219,232,1,0,0,0,220,229,3,121,60,0,221,226,5,46,0,0,222,224,3,121,60,0,223,225,3,129,64,0,224,223,1,0,0,0,224,225,1,0,0,0,225,227,1,0,0,0,226,222,1,0,0,0,226,227,1,0,0,0,227,230,1,0,0,0,228,230,3,129,64,0,229,221,1,0,0,0,229,228,1,0,0,0,230,232,1,0,0,0,231,215,1,0,0,0,231,220,1,0,0,0,232,62,1,0,0,0,233,234,5,98,0,0,234,235,5,114,0,0,235,236,5,101,0,0,236,237,5,97,0,0,237,238,5,107,0,0,238,64,1,0,0,0,239,240,5,97,0,0,240,241,5,110,0,0,241,242,5,100,0,0,242,66,1,0,0,0,243,244,5,101,0,0,244,245,5,120,0,0,245,246,5,112,0,0,246,247,5,111,0,0,247,248,5,114,0,0,248,249,5,116,0,0,249,68,1,0,0,0,250,251,5,102,0,0,251,252,5,111,0,0,252,253,5,114,0,0,253,70,1,0,0,0,254,255,5,118,0,0,255,256,5,97,0,0,256,257,5,114,0,0,257,72,1,0,0,0,258,259,5,99,0,0,259,260,5,111,0,0,260,261,5,110,0,0,261,262,5,116,0,0,262,263,5,105,0,0,263,264,5,110,0,0,264,265,5,117,0,0,265,266,5,101,0,0,266,74,1,0,0,0,267,268,5,118,0,0,268,269,5,97,0,0,269,270,5,114,0,0,270,271,5,105,0,0,271,272,5,112,0,0,272,76,1,0,0,0,273,274,5,115,0,0,274,275,5,119,0,0,275,276,5,105,0,0,276,277,5,116,0,0,277,278,5,99,0,0,278,279,5,104,0,0,279,78,1,0,0,0,280,281,5,119,0,0,281,282,5,104,0,0,282,283,5,105,0,0,283,284,5,108,0,0,284,285,5,101,0,0,285,80,1,0,0,0,286,287,5,105,0,0,287,288,5,102,0,0,288,82,1,0,0,0,289,290,5,105,0,0,290,291,5,110,0,0,291,84,1,0,0,0,292,293,5,111,0,0,293,294,5,114,0,0,294,86,1,0,0,0,295,296,5,110,0,0,296,297,5,111,0,0,297,298,5,116,0,0,298,88,1,0,0,0,299,300,5,109,0,0,300,301,5,101,0,0,301,302,5,116,0,0,302,303,5,104,0,0,303,304,5,111,0,0,304,305,5,100,0,0,305,90,1,0,0,0,306,307,5,101,0,0,307,308,5,108,0,0,308,309,5,115,0,0,309,310,5,101,0,0,310,92,1,0,0,0,311,312,5,116,0,0,312,313,5,111,0,0,313,94,1,0,0,0,314,315,5,98,0,0,315,316,5,121,0,0,316,96,1,0,0,0,317,318,5,116,0,0,318,319,5,121,0,0,319,320,5,112,0,0,320,321,5,101,0,0,321,98,1,0,0,0,322,323,5,105,0,0,323,324,5,109,0,0,324,325,5,112,0,0,325,326,5,111,0,0,326,327,5,114,0,0,327,328,5,116,0,0,328,100,1,0,0,0,329,330,5,97,0,0,330,331,5,115,0,0,331,102,1,0,0,0,332,333,5,109,0,0,333,334,5,97,0,0,334,335,5,112,0,0,335,104,1,0,0,0,336,337,5,35,0,0,337,338,3,123,61,0,338,339,3,123,61,0,339,340,3,123,61,0,340,341,3,123,61,0,341,342,3,123,61,0,342,343,3,123,61,0,343,355,1,0,0,0,344,345,5,35,0,0,345,346,3,123,61,0,346,347,3,123,61,0,347,348,3,123,61,0,348,349,3,123,61,0,349,350,3,123,61,0,350,351,3,123,61,0,351,352,3,123,61,0,352,353,3,123,61,0,353,355,1,0,0,0,354,336,1,0,0,0,354,344,1,0,0,0,355,106,1,0,0,0,356,357,3,117,58,0,357,108,1,0,0,0,358,362,7,0,0,0,359,361,7,1,0,0,360,359,1,0,0,0,361,364,1,0,0,0,362,360,1,0,0,0,362,363,1,0,0,0,363,110,1,0,0,0,364,362,1,0,0,0,365,366,3,125,62,0,366,367,1,0,0,0,367,368,6,55,4,0,368,112,1,0,0,0,369,370,3,127,63,0,370,371,1,0,0,0,371,372,6,56,5,0,372,114,1,0,0,0,373,374,4,57,0,0,374,386,3,125,62,0,375,377,5,13,0,0,376,375,1,0,0,0,376,377,1,0,0,0,377,378,1,0,0,0,378,381,5,10,0,0,379,381,2,12,13,0,380,376,1,0,0,0,380,379,1,0,0,0,381,383,1,0,0,0,382,384,3,125,62,0,383,382,1,0,0,0,383,384,1,0,0,0,384,386,1,0,0,0,385,373,1,0,0,0,385,380,1,0,0,0,386,387,1,0,0,0,387,388,6,57,6,0,388,116,1,0,0,0,389,395,5,39,0,0,390,394,8,2,0,0,391,392,5,92,0,0,392,394,5,39,0,0,393,390,1,0,0,0,393,391,1,0,0,0,394,397,1,0,0,0,395,393,1,0,0,0,395,396,1,0,0,0,396,398,1,0,0,0,397,395,1,0,0,0,398,410,5,39,0,0,399,405,5,34,0,0,400,404,8,3,0,0,401,402,5,92,0,0,402,404,5,34,0,0,403,400,1,0,0,0,403,401,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0,0,406,408,1,0,0,0,407,405,1,0,0,0,408,410,5,34,0,0,409,389,1,0,0,0,409,399,1,0,0,0,410,118,1,0,0,0,411,412,7,4,0,0,412,120,1,0,0,0,413,415,3,119,59,0,414,413,1,0,0,0,415,416,1,0,0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,122,1,0,0,0,418,419,7,5,0,0,419,124,1,0,0,0,420,422,7,6,0,0,421,420,1,0,0,0,422,423,1,0,0,0,423,421,1,0,0,0,423,424,1,0,0,0,424,126,1,0,0,0,425,426,5,47,0,0,426,427,5,47,0,0,427,431,1,0,0,0,428,430,8,7,0,0,429,428,1,0,0,0,430,433,1,0,0,0,431,429,1,0,0,0,431,432,1,0,0,0,432,128,1,0,0,0,433,431,1,0,0,0,434,436,7,8,0,0,435,437,7,9,0,0,436,435,1,0,0,0,436,437,1,0,0,0,437,438,1,0,0,0,438,439,3,121,60,0,439,130,1,0,0,0,22,0,211,218,224,226,229,231,354,362,376,380,383,385,393,395,403,405,409,416,423,431,436,7,1,1,0,1,2,1,1,3,2,1,4,3,0,1,0,0,2,0,1,57,4]),k(we,"__ATN"),k(we,"DecisionsToDFA",we._ATN.decisionToState.map((e,n)=>new cp(e,n)));let bl=we;var z=(t=>(t.BOOL="bool",t.INT="int",t.FLOAT="float",t.ARRAY="array",t.BOX="box",t.CHART_POINT="chart.point",t.COLOR="color",t.CONST="const",t.LABEL="label",t.LINE="line",t.LINEFILL="linefill",t.MAP="map",t.MATRIX="matrix",t.POLYLINE="polyline",t.SERIES="series",t.SIMPLE="simple",t.STRING="string",t.TABLE="table",t.UNDETERMINED="undetermined type",t.INPUT="input",t.NA="na",t.VOID="void",t))(z||{}),pe=(t=>(t.FlowStmt="FlowStmt",t.DeclareAssign="DeclareAssign",t.VarBlockStmt="VarBlockStmt",t.VarSingle="VarSingle",t.VarMultiple="VarMultiple",t.ParenthesizedExpression="ParenthesizedExpression",t.AdditiveExpression="AdditiveExpression",t.RelationalExpression="RelationalExpression",t.EqualityExpression="EqualityExpression",t.TernaryExpression="TernaryExpression",t.UnaryExpression="UnaryExpression",t.NotExpression="NotExpression",t.MemberIndexExpression="MemberIndexExpression",t.MethodExpression="MethodExpression",t.LogicalAndExpression="LogicalAndExpression",t.LogicalOrExpression="LogicalOrExpression",t.MultiplicativeExpression="MultiplicativeExpression",t.Brackethesized="Brackethesized",t.IfStatement="IfStatement",t.ForToStatement="ForToStatement",t.ForInStatement="ForInStatement",t.SwitchStatement="SwitchStatement",t.CaseClause="CaseClause",t.DefaultCaluse="DefaultCaluse",t.WhileStatement="WhileStatement",t.ImportElement="ImportElement",t.Literal="Literal",t.ArrowFunction="ArrowFunction",t.ArrowMethod="ArrowMethod",t.TypeStatement="TypeStatement",t.Name="Name",t.AgainAssign="AgainAssign",t))(pe||{}),On=(t=>(t.description="description",t.field="field",t.function="function",t.param="param",t.returns="returns",t.type="type",t.variable="variable",t))(On||{}),$o=(t=>(t.library="library",t.indicator="indicator",t.strategy="strategy",t))($o||{});const Ce={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeRepeatErr:"type '$name' is already defined.",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an na object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in.",useNaErr:"Cannot use an `na` value of an unspecified type in the `$name` function.",libraryTitleErr:"Invalid argument 'title' in 'library' call. It cannot contain spaces, special characters or begin with a digit.",exportFuncArgErr:"All exported functions args should be typified",indiRunErr:"An indicator must contain at least one of the following: any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, `alertcondition()`, or any drawing (line, label, box, table, polyline).",libraryExportErr:"A library must contain at least one exported function, method, or type.",strategyRunErr:"A strategy must contain at least one of the following: any `strategy.*()` function that creates orders, any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, or any drawing (line, label, box, table, polyline).",exportUseErr:"Only libraries can contain exported $type.",funcRepeatErr:"The '$name' function has overloads with the same parameters. The type of parameters must be different in overloaded versions of functions.",importMultipleErr:"Cannot import a library more than once",importNotExitErr:"The user '$username' does not have a published library titled '$libraryName'",importNameRepeatErr:"More than one import uses the same alias: $name. Previous usage at line: $line",exportFuncHasInputErr:"The exported function '$func' depends on the '$name' input variable, which is not allowed.",libraryTitleIsKeywordErr:"Invalid argument 'title' in 'library' call. Token: '$name' can't be used as library title."},Qi={repeatVar:"Shadowing variable '$name' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ?",typeMismatch:"The `$index` parameter of the `$operator` function accepts a '$type' argument. To avoid potential unexpected results, pass a '$type' value or expression to this parameter.",moreSameArg:"More than one '$arg' arguments are supplied. Only the first one will be used.",localScopeGetHistory:"The variable '$name' is declared in local scope, which may not be executed at every update. So, obtaining its historical values may lead to unexpected results",localScopeWarning:"The function '$name' should be called on each calculation for consistency. It is recommended to extract the call from this scope"},Ni=[z.SERIES,z.SIMPLE,z.INPUT,z.CONST],Rp=[z.INT,z.FLOAT,z.BOOL,z.COLOR,z.STRING],vl=["indicator","strategy","library"],El=["plot","plotbar","plotchar","plotarrow","plotshape","plotcandle","hline","alertcondition","barcolor","bgcolor","fill"],w_=[...El,"indicator","library","strategy","strategy.risk.max_drawdown","strategy.risk.allow_entry_in","strategy.risk.max_cons_loss_days","max_intraday_filled_orders","strategy.risk.max_intraday_loss","strategy.risk.max_position_size"],N_=[...El,"table.new","label.new","line.new","box.new","polyline.new","linefill.new"],I_=["strategy.entry","strategy.order","strategy.exit","strategy.close","strategy.cancel","strategy.close_all","strategy.cancel_all"],wp=["strategy","input","table","color","line","linefill","label","box"],Sl=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"],P_=/^\/\/\s*@(description|field|function|param|returns|type|variable)/,Bn=["case","catch","default","delete","do","finally","function","instanceof","new","return","this","throw","try","typeof","void","with"];var Np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F_={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Np,function(){var n=1e3,o=6e4,s=36e5,f="millisecond",p="second",y="minute",E="hour",x="day",D="week",T="month",I="quarter",B="year",L="date",b="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_e){var te=["th","st","nd","rd"],he=_e%100;return"["+_e+(te[(he-20)%10]||te[he]||te[0])+"]"}},R=function(_e,te,he){var le=String(_e);return!le||le.length>=te?_e:""+Array(te+1-le.length).join(he)+_e},C={s:R,z:function(_e){var te=-_e.utcOffset(),he=Math.abs(te),le=Math.floor(he/60),xe=he%60;return(te<=0?"+":"-")+R(le,2,"0")+":"+R(xe,2,"0")},m:function _e(te,he){if(te.date()<he.date())return-_e(he,te);var le=12*(he.year()-te.year())+(he.month()-te.month()),xe=te.clone().add(le,T),Ie=he-xe<0,ge=te.clone().add(le+(Ie?-1:1),T);return+(-(le+(he-xe)/(Ie?xe-ge:ge-xe))||0)},a:function(_e){return _e<0?Math.ceil(_e)||0:Math.floor(_e)},p:function(_e){return{M:T,y:B,w:D,d:x,D:L,h:E,m:y,s:p,ms:f,Q:I}[_e]||String(_e||"").toLowerCase().replace(/s$/,"")},u:function(_e){return _e===void 0}},j="en",X={};X[j]=O;var re="$isDayjsObject",K=function(_e){return _e instanceof Q||!(!_e||!_e[re])},Y=function _e(te,he,le){var xe;if(!te)return j;if(typeof te=="string"){var Ie=te.toLowerCase();X[Ie]&&(xe=Ie),he&&(X[Ie]=he,xe=Ie);var ge=te.split("-");if(!xe&&ge.length>1)return _e(ge[0])}else{var Ue=te.name;X[Ue]=te,xe=Ue}return!le&&xe&&(j=xe),xe||!le&&j},G=function(_e,te){if(K(_e))return _e.clone();var he=typeof te=="object"?te:{};return he.date=_e,he.args=arguments,new Q(he)},ce=C;ce.l=Y,ce.i=K,ce.w=function(_e,te){return G(_e,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Q=function(){function _e(he){this.$L=Y(he.locale,null,!0),this.parse(he),this.$x=this.$x||he.x||{},this[re]=!0}var te=_e.prototype;return te.parse=function(he){this.$d=function(le){var xe=le.date,Ie=le.utc;if(xe===null)return new Date(NaN);if(ce.u(xe))return new Date;if(xe instanceof Date)return new Date(xe);if(typeof xe=="string"&&!/Z$/i.test(xe)){var ge=xe.match(_);if(ge){var Ue=ge[2]-1||0,J=(ge[7]||"0").substring(0,3);return Ie?new Date(Date.UTC(ge[1],Ue,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,J)):new Date(ge[1],Ue,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,J)}}return new Date(xe)}(he),this.init()},te.init=function(){var he=this.$d;this.$y=he.getFullYear(),this.$M=he.getMonth(),this.$D=he.getDate(),this.$W=he.getDay(),this.$H=he.getHours(),this.$m=he.getMinutes(),this.$s=he.getSeconds(),this.$ms=he.getMilliseconds()},te.$utils=function(){return ce},te.isValid=function(){return this.$d.toString()!==b},te.isSame=function(he,le){var xe=G(he);return this.startOf(le)<=xe&&xe<=this.endOf(le)},te.isAfter=function(he,le){return G(he)<this.startOf(le)},te.isBefore=function(he,le){return this.endOf(le)<G(he)},te.$g=function(he,le,xe){return ce.u(he)?this[le]:this.set(xe,he)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(he,le){var xe=this,Ie=!!ce.u(le)||le,ge=ce.p(he),Ue=function(Et,Mt){var gt=ce.w(xe.$u?Date.UTC(xe.$y,Mt,Et):new Date(xe.$y,Mt,Et),xe);return Ie?gt:gt.endOf(x)},J=function(Et,Mt){return ce.w(xe.toDate()[Et].apply(xe.toDate("s"),(Ie?[0,0,0,0]:[23,59,59,999]).slice(Mt)),xe)},ne=this.$W,se=this.$M,Se=this.$D,ye="set"+(this.$u?"UTC":"");switch(ge){case B:return Ie?Ue(1,0):Ue(31,11);case T:return Ie?Ue(1,se):Ue(0,se+1);case D:var At=this.$locale().weekStart||0,jt=(ne<At?ne+7:ne)-At;return Ue(Ie?Se-jt:Se+(6-jt),se);case x:case L:return J(ye+"Hours",0);case E:return J(ye+"Minutes",1);case y:return J(ye+"Seconds",2);case p:return J(ye+"Milliseconds",3);default:return this.clone()}},te.endOf=function(he){return this.startOf(he,!1)},te.$set=function(he,le){var xe,Ie=ce.p(he),ge="set"+(this.$u?"UTC":""),Ue=(xe={},xe[x]=ge+"Date",xe[L]=ge+"Date",xe[T]=ge+"Month",xe[B]=ge+"FullYear",xe[E]=ge+"Hours",xe[y]=ge+"Minutes",xe[p]=ge+"Seconds",xe[f]=ge+"Milliseconds",xe)[Ie],J=Ie===x?this.$D+(le-this.$W):le;if(Ie===T||Ie===B){var ne=this.clone().set(L,1);ne.$d[Ue](J),ne.init(),this.$d=ne.set(L,Math.min(this.$D,ne.daysInMonth())).$d}else Ue&&this.$d[Ue](J);return this.init(),this},te.set=function(he,le){return this.clone().$set(he,le)},te.get=function(he){return this[ce.p(he)]()},te.add=function(he,le){var xe,Ie=this;he=Number(he);var ge=ce.p(le),Ue=function(se){var Se=G(Ie);return ce.w(Se.date(Se.date()+Math.round(se*he)),Ie)};if(ge===T)return this.set(T,this.$M+he);if(ge===B)return this.set(B,this.$y+he);if(ge===x)return Ue(1);if(ge===D)return Ue(7);var J=(xe={},xe[y]=o,xe[E]=s,xe[p]=n,xe)[ge]||1,ne=this.$d.getTime()+he*J;return ce.w(ne,this)},te.subtract=function(he,le){return this.add(-1*he,le)},te.format=function(he){var le=this,xe=this.$locale();if(!this.isValid())return xe.invalidDate||b;var Ie=he||"YYYY-MM-DDTHH:mm:ssZ",ge=ce.z(this),Ue=this.$H,J=this.$m,ne=this.$M,se=xe.weekdays,Se=xe.months,ye=xe.meridiem,At=function(Mt,gt,Ct,Jt){return Mt&&(Mt[gt]||Mt(le,Ie))||Ct[gt].slice(0,Jt)},jt=function(Mt){return ce.s(Ue%12||12,Mt,"0")},Et=ye||function(Mt,gt,Ct){var Jt=Mt<12?"AM":"PM";return Ct?Jt.toLowerCase():Jt};return Ie.replace(g,function(Mt,gt){return gt||function(Ct){switch(Ct){case"YY":return String(le.$y).slice(-2);case"YYYY":return ce.s(le.$y,4,"0");case"M":return ne+1;case"MM":return ce.s(ne+1,2,"0");case"MMM":return At(xe.monthsShort,ne,Se,3);case"MMMM":return At(Se,ne);case"D":return le.$D;case"DD":return ce.s(le.$D,2,"0");case"d":return String(le.$W);case"dd":return At(xe.weekdaysMin,le.$W,se,2);case"ddd":return At(xe.weekdaysShort,le.$W,se,3);case"dddd":return se[le.$W];case"H":return String(Ue);case"HH":return ce.s(Ue,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Et(Ue,J,!0);case"A":return Et(Ue,J,!1);case"m":return String(J);case"mm":return ce.s(J,2,"0");case"s":return String(le.$s);case"ss":return ce.s(le.$s,2,"0");case"SSS":return ce.s(le.$ms,3,"0");case"Z":return ge}return null}(Mt)||ge.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(he,le,xe){var Ie,ge=this,Ue=ce.p(le),J=G(he),ne=(J.utcOffset()-this.utcOffset())*o,se=this-J,Se=function(){return ce.m(ge,J)};switch(Ue){case B:Ie=Se()/12;break;case T:Ie=Se();break;case I:Ie=Se()/3;break;case D:Ie=(se-ne)/6048e5;break;case x:Ie=(se-ne)/864e5;break;case E:Ie=se/s;break;case y:Ie=se/o;break;case p:Ie=se/n;break;default:Ie=se}return xe?Ie:ce.a(Ie)},te.daysInMonth=function(){return this.endOf(T).$D},te.$locale=function(){return X[this.$L]},te.locale=function(he,le){if(!he)return this.$L;var xe=this.clone(),Ie=Y(he,le,!0);return Ie&&(xe.$L=Ie),xe},te.clone=function(){return ce.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},_e}(),me=Q.prototype;return G.prototype=me,[["$ms",f],["$s",p],["$m",y],["$H",E],["$W",x],["$M",T],["$y",B],["$D",L]].forEach(function(_e){me[_e[1]]=function(te){return this.$g(te,_e[0],_e[1])}}),G.extend=function(_e,te){return _e.$i||(_e(te,Q,G),_e.$i=!0),G},G.locale=Y,G.isDayjs=K,G.unix=function(_e){return G(1e3*_e)},G.en=X[j],G.Ls=X,G.p={},G})})(F_);function Ne(t,e){return t.replace(/\$(\w+)/g,(n,o)=>String(e[o])||n)}class L_ extends o_{constructor(){super(...arguments);k(this,"visitProgram");k(this,"visitGlobalStmt");k(this,"visitBlockStmt");k(this,"visitStmt");k(this,"visitSimpleStmt");k(this,"visitFlowStmt");k(this,"visitBlock");k(this,"visitBlockLine");k(this,"visitVariableDeclarationStmt");k(this,"visitDeclareAssign");k(this,"visitAgainAssign");k(this,"visitVarModifier");k(this,"visitBlockSequence");k(this,"visitExpressionSequence");k(this,"visitExpressionBlockSequence");k(this,"visitVarBlockStmt");k(this,"visitVarSingle");k(this,"visitVarMultiple");k(this,"visitBlockExpression");k(this,"visitParenthesizedExpression");k(this,"visitAdditiveExpression");k(this,"visitRelationalExpression");k(this,"visitTernaryExpression");k(this,"visitLogicalAndExpression");k(this,"visitNameExpression");k(this,"visitLiteralExpression");k(this,"visitLogicalOrExpression");k(this,"visitUnaryExpression");k(this,"visitNotExpression");k(this,"visitMemberIndexExpression");k(this,"visitMethodExpression");k(this,"visitEqualityExpression");k(this,"visitMultiplicativeExpression");k(this,"visitBrackethesized");k(this,"visitArguments");k(this,"visitArgument");k(this,"visitIfStatement");k(this,"visitForToStatement");k(this,"visitForInStatement");k(this,"visitSwitchStatement");k(this,"visitCaseClause");k(this,"visitDefaultCaluse");k(this,"visitWhileStatement");k(this,"visitImportStmt");k(this,"visitImportElement");k(this,"visitLiteral");k(this,"visitMethodStmt");k(this,"visitMethodElement");k(this,"visitMethodName");k(this,"visitArrowFunction");k(this,"visitArrowFunctionParameters");k(this,"visitFormalParameterList");k(this,"visitFormalParameterArg");k(this,"visitArrowMethod");k(this,"visitArrowMethodParameters");k(this,"visitTypeStatement");k(this,"visitTypeElement");k(this,"visitAssignmentOperator");k(this,"visitTypeMap");k(this,"visitTypeSeries");k(this,"visitTypeArray");k(this,"visitTypeGather");k(this,"visitIdentifier");k(this,"visitTypeName");k(this,"visitName")}}class M_ extends L_{constructor(n){super();k(this,"_buildinVariables");k(this,"_buildinTypes");k(this,"_buildinConstants");k(this,"_buildinMethods");k(this,"_buildinFunctions");this._buildinVariables=new Map,this._buildinConstants=new Map,this._buildinFunctions=new Map,this._buildinTypes=new Map,this._buildinMethods=new Map,this._buildinHandle(n)}_buildinHandle(n){for(const o in n){const s=new Map(Object.entries(n[o]));switch(o){case"constants":this._buildinConstants=s;break;case"functions":this._buildinFunctions=s;break;case"methods":this._buildinMethods=s;break;case"types":this._buildinTypes=s;break;case"variables":this._buildinVariables=s;break}}}_typeHandle(n=[],o){if(!n.length)return z.UNDETERMINED;if(n=n.filter(p=>!p.endsWith(z.NA)),!n.length)return`${z.SIMPLE} ${z.NA}`;let s=100,f="";for(const p of n){if(p===z.UNDETERMINED)return z.UNDETERMINED;p.startsWith(z.SERIES)?s=0:p.startsWith(z.SIMPLE)&&s>0?s=1:p.startsWith(z.INPUT)&&s>1?s=2:p.startsWith(z.CONST)&&s>2&&(s=3);const y=this._removePrefix(p);(y!==z.INT||!f)&&(f=y)}return s===100?f:`${Ni[s]} ${o||f}`}_returnTypesOtherHandle(n,o,s,f){if(!s.length||s[0].includes("<>")){const p=n.type;let y=p;if(!p||p===z.UNDETERMINED)return[z.UNDETERMINED];switch(o){case"series <type>":y=this._getArrayType(p),y||(y=this._removePrefix(p)),s=[this._typeAddSeries(y)];break;case"array<type>":case"matrix<type>":case"type[]":if(this._isMapType(p)){const E=this._getMapType(p)||[];f.includes("keys")?y=E[0]:y=E[1]}else y=this._getArrayType(p),y||(y=this._removePrefix(p));s=[this._typeReplace(o,y)];break;case"<matrix_type>":y=this._getArrayType(p),s=[this._typeAddSeries(y)];break;case"map<keyType, valueType>":s=[y];break;case"<value_type>":y=this._getMapType(p),s=[y[1]];break}}return s}_checkMethodThisType(n,o){if(!n||!n.length||n[0].includes("<>"))return!0;const s=o.replace("int","float");return n.some(f=>f===o||s===f||f.endsWith(o))}_priorityComparison(n,o){if(!n)return!1;if(this._isArrayType(n)||this._isMatrixType(n))return this._getArrayType(o)!==z.INT;{const s=this._getPrefix(n),f=this._getPrefix(o);return s===f?!!n.endsWith(z.INT):!(Ni.indexOf(s)<Ni.indexOf(f))}}_compareType(n,o){if(n===z.UNDETERMINED||o===z.UNDETERMINED)return!0;const s=[z.FLOAT,z.INT];if(this._isArrayType(n)||this._isMatrixType(n)){const f=this._getArrayType(n)||"",p=this._getArrayType(o)||"";return f===p||s.includes(f)&&s.includes(p)}else if(this._isMapType(n)){const f=this._getMapType(n)||[],p=this._getMapType(o)||[];return(f[0]===p[0]||s.includes(f[0])&&s.includes(p[0]))&&(f[1]===p[1]||s.includes(f[1])&&s.includes(p[1]))}else{const f=this._removePrefix(n),p=this._removePrefix(o);return f===z.NA||p===z.NA||f===p||s.includes(f)&&s.includes(p)}}_typeAddSeries(n){return this._buildinTypes.get(n)&&n!==z.CHART_POINT?`${z.SERIES} ${n}`:n}_typeAddConst(n){return Rp.includes(n)?`${z.CONST} ${n}`:this._typeAddSeries(n)}_getOriginMethodName(n,o){let s="";return this._isArrayType(n)?s=`${z.ARRAY}.${o}`:this._isMatrixType(n)?s=`${z.MATRIX}.${o}`:this._isMapType(n)?s=`${z.MAP}.${o}`:s=`${this._removePrefix(n)}.${o}`,s}_returnedTypesParse(n){if(!n||!n.length)return[];const o=n[0];return/^\[.+\]$/.test(o)?o.replace(/[[\]]/g,"").split(",").map(s=>s.trim()):n}_removePrefix(n=""){return n.replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}_getPrefix(n){if(!n)return"";const o=n.replace(/(series|simple|const|input).+/,"$1");return Ni.includes(o)?o:""}_getArrayType(n){let o=/\w+<([\w\d.]+)>/.exec(n);return o||(o=/([\w\d.]+)\[\]/.exec(n)),o==null?void 0:o[1]}_getMapType(n){const o=/\w+<(\w+),\s*([\w\d.]+)>/.exec(n);return(o==null?void 0:o[1])&&(o==null?void 0:o[2])&&[o==null?void 0:o[1],o==null?void 0:o[2]]}_isMatrixType(n){return/^matrix<[\w\d.]+>$/.test(n)}_isArrayType(n){return/^array<[\w\d.]+>$/.test(n)||/^[\w\d.]+\[\]$/.test(n)}_isMapType(n){return/^map<\w+,\s*[\w\d.]+>$/.test(n)}_arrayTypeConvert(n){return!this._isArrayType(n)||!n.includes("<")?n:`${this._getArrayType(n)}[]`}_getMethodTypeName(n){return this._isArrayType(n)?z.ARRAY:this._isMapType(n)?z.MAP:this._isMatrixType(n)?z.MATRIX:this._removePrefix(n)}_typeReplace(n,o){return o=this._removePrefix(o),this._arrayTypeConvert(n.startsWith(z.SERIES)?n.replace("<type>",o):n.replace("type",o))}}var ar=(t=>(t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error",t))(ar||{});class Ip extends M_{constructor(n,o,s){super(n);k(this,"_loopCount");k(this,"_errors");k(this,"_variables");k(this,"_functions");k(this,"_methods");k(this,"_types");k(this,"_currentBlockVars");k(this,"_currentFuncParams");k(this,"_isNeedCalc");k(this,"_blockCount");k(this,"_isInFunc");k(this,"_onlyStatementsCount");k(this,"_blockRanges");k(this,"_overloadsFuncs");k(this,"_hasMemberIndex");k(this,"_isInLocalScop");k(this,"_comments");k(this,"_currentLine",0);k(this,"_hasDrawFunc",!1);k(this,"_hasCreateOrderFunc",!1);k(this,"_scriptType");k(this,"_exportFunctions");k(this,"_exportMethods");k(this,"_exportTypes");k(this,"_exportPositions");k(this,"_description","");k(this,"_endExport");k(this,"_importLibs");k(this,"_getImportLibraryFunc");k(this,"_isEndExpr");k(this,"_inputVarName");k(this,"visitProgram",async n=>{const{children:o}=n;let s=0;const f=[];for(this._pushBlockRanges(n);s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_globalStmt&&f.push(await this.visit(p))}return this._onlyStatementsCount<=0&&this._errors.push({startColumn:0,endColumn:0,startLineNumber:0,endLineNumber:0,type:ar.Error,message:Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount})}),f});k(this,"visitGlobalStmt",async n=>{const{children:o}=n;if(o&&o.length){const s=o[0],f=await this.visit(s);return s.ruleIndex===F.RULE_methodStmt&&vl.includes(f.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1?this._errorHandle(Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount}),s):this._scriptType=f.exprs[0].name),f}return null});k(this,"visitBlockStmt",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationStmt:f.push(...this.visit(p));break;case F.RULE_varBlockStmt:f.push(this.visit(p));break;case F.RULE_blockExpression:f.push(this.visit(p));break}}return f});k(this,"visitStmt",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitSimpleStmt",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitFlowStmt",n=>{const{children:o}=n,{column:s,line:f,text:p}=o[0].symbol;if(this._currentLine=f,this._loopCount<=0){const y=s+1;this._errors.push({startColumn:y,endColumn:parseInt(y+p.length),startLineNumber:f,endLineNumber:f,message:Ne(Ce.onlyInLoop,{text:p})})}return{ruleType:pe.FlowStmt,value:p}});k(this,"visitBlock",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return s.ruleIndex===F.RULE_simpleStmt?this._inBlock(s):this.visit(s)}return null});k(this,"visitBlockLine",n=>{const{children:o}=n;if(!o)return null;let s=0;const f=[];this._blockCount++,this._pushBlockRanges(n);const p=this._isEndExpr;for(;s<o.length;s++){const y=o[s];y.ruleIndex===F.RULE_stmt&&(this._isInFunc&&(this._isEndExpr=o.length-2===s&&p),f.push(this.visit(y)))}return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),f});k(this,"visitDeclareAssign",n=>{var p;const{children:o}=n;let s=0;const f={ruleType:pe.DeclareAssign};for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_varArrayDeclaration:f.nameList=this.visit(y),this._inputVarName=(p=f.nameList)==null?void 0:p.name;break;case F.RULE_singleExpression:f.value=this.visit(y),this._inputVarName=void 0;break}}return this._variablesHandle(f,n),f});k(this,"visitAgainAssign",n=>{const{children:o,start:s}=n;if(this._currentLine=s.line,o.length>=3){const f=this.visit(o[0]);this._verifyGloablVar(f,o[0]);const p=this.visit(o[2]),y=this.visit(o[1]);return f.type?this._againAssignHandle([f,p],[o[0],o[2]],y):null}return null});k(this,"visitVarModifier",n=>{const{children:o}=n;return o[0].symbol.text});k(this,"visitExpressionSequence",n=>{const{children:o,start:s}=n;let f=0;const p=[];for(this._currentLine=s.line;f<o.length;f++){const y=o[f];if(y.ruleIndex===F.RULE_singleExpression){const E=this.visit(y);E&&(E.ctx=y,p.push(E))}}return p});k(this,"visitExpressionBlockSequence",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_singleExpression:f.push(this.visit(p));break;case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_blockExpression:f.push(this.visit(p));break;case F.RULE_varBlockStmt:f.push(this.visit(p));break}}return f});k(this,"visitBlockSequence",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_singleExpression:f.push(this.visit(p));break}}return f});k(this,"visitVariableDeclarationStmt",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_methodStmt:const y=this.visit(p);vl.includes(y.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1?this._errorHandle(Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount}),p):this._scriptType=y.exprs[0].name),f.push(y);break}}return f});k(this,"visitVarBlockStmt",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.VarBlockStmt,ctx:n},p=[];for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_varArrayDeclaration:f.nameList=this.visit(y);break;case F.RULE_assignmentOperator:f.operator=this.visit(y);break;case F.RULE_name:p.push(y),f.name=this.visit(y);break;case F.RULE_blockExpression:this._isNeedCalc=!0,f.value=this.visit(y),p.push(y);const E=this._getBlockReturnTypes(f.value);E.length===1?f.value.type=E[0]:f.value.types=E,this._isNeedCalc=!1;break}}return f.name?this._againAssignHandle([f.name,f.value],p,f.operator):(this._variablesHandle(f,n),f)});k(this,"visitVarSingle",n=>{const{children:o,start:s}=n,f={ruleType:pe.VarSingle};let p=0;const y=this._commentsParser(s.line,[On.variable]);f.desc=y==null?void 0:y[On.variable],this._currentLine=s.line;let E={lineNumber:0,column:0};for(;p<o.length;p++){const x=o[p];switch(x.ruleIndex){case F.RULE_varModifier:f.declare=this.visit(x);break;case F.RULE_typeGather:const D=this.visit(x);f.prefix=this._getPrefix(D),f.type=D&&this._typeAddConst(D);break;case F.RULE_identifier:const T=this.visit(x);this._repeatVarJudge(T,x),E={lineNumber:x.start.line,column:x.start.column},f.name=T,f.pos=E;break}}return f});k(this,"_commentsParser",(n,o,s=!1)=>{var x;const f=this._comments.filter(D=>D.line<n&&D.line>=this._currentLine),p={},y={line:0,key:"",secKey:""},E=[On.field,On.param];for(const D of f){const[T,I]=P_.exec(D.text)||[];if(I&&o.includes(I)){const B=D.text.replace(T,"").trim();if(Object.assign(y,{line:D.line,key:I}),E.includes(I)){const[L,...b]=B.split(" ");L&&(Object.assign(y,{secKey:L}),p[I]=Object.assign(p[I]||{},{[L]:b.join(" ").trim()}))}else p[I]=[B]}else if(s&&y.key){const B=D.text.replace("//","").trim();E.includes(y.key)?p[y.key][y.secKey]+=` ${B}`:(x=p[y.key])==null||x.push(B)}}return p});k(this,"visitVarMultiple",n=>{const{children:o,start:s}=n;let f=0;const p=[],y=[];for(this._currentLine=s.line;f<o.length;f++){const E=o[f];if(E.ruleIndex===F.RULE_identifier){const x=this.visit(E);this._repeatVarJudge(x,E),p.push(x),y.push({lineNumber:E.start.line,column:E.start.column})}}return{ruleType:pe.VarMultiple,names:p,posList:y}});k(this,"visitBlockExpression",n=>{const{children:o,start:s}=n;if(this._currentLine=s.line,o&&o.length){const f=o[0];return this.visit(f)}return null});k(this,"visitParenthesizedExpression",n=>{const{children:o}=n,s=o[1],f=this.visit(s);return{ruleType:pe.ParenthesizedExpression,type:f.type,ctx:n,exprs:f}});k(this,"visitAdditiveExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression?p.push(this.visit(E)):f=E.symbol.text}const y={ruleType:pe.AdditiveExpression,operator:f,ctx:n,exprs:p};if(["+","-"].includes(f)){const E=[z.UNDETERMINED,z.INT,z.FLOAT];f==="+"&&E.push(z.STRING);const x=this._sameTypeJudge(p,[o[0],o[2]],f,E);y.type=this._typeHandle(x)}else{const E=this._calcTypeJudge(p[0],o[0],f),x=this._calcTypeJudge(p[1],o[2],f,1);y.type=this._typeHandle([E,x])}return y});k(this,"visitRelationalExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._calcTypeJudge(p[0],o[0],f),E=this._calcTypeJudge(p[1],o[2],f,1);return{ruleType:pe.RelationalExpression,operator:f,ctx:n,type:this._typeHandle([y,E],z.BOOL),exprs:p}});k(this,"visitEqualityExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression?p.push(this.visit(E)):f=E.symbol.text}const y=this._sameTypeJudge(p,[o[0],o[2]],f,[z.UNDETERMINED,z.COLOR,z.STRING,z.BOOL,z.INT,z.FLOAT]);return{ruleType:pe.EqualityExpression,operator:f,ctx:n,type:this._typeHandle(y,z.BOOL),exprs:p}});k(this,"visitTernaryExpression",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const y=o[s];if(y.ruleIndex===F.RULE_singleExpression){const E=this._isInLocalScop;s!==0&&(this._isInLocalScop=!0),f.push(this.visit(y)),this._isInLocalScop=E}}let p=z.UNDETERMINED;if(f.length>=3){this._boolTypeJudge(f[0],o[0],"?:");const y=this._sameTypeJudge(f.slice(1),[o[2],o[4]],"?:",[]),E=this._getPrefix(f[0].type);p=this._typeHandle(y),E&&this._getPrefix(p)&&(p=this._typeHandle([p,`${E} ${this._removePrefix(p)}`]))}return{ruleType:pe.TernaryExpression,type:p,ctx:n,exprs:f}});k(this,"visitNameExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitLiteralExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitUnaryExpression",n=>{var x;const{children:o}=n,[s,f]=o,p=[this.visit(f)],y=s.symbol.text,E=this._calcTypeJudge(p[0],f,y);return((x=p[0])==null?void 0:x.ruleType)===pe.UnaryExpression&&this._errors.push({message:Ne(Ce.unaryErr,{sign:y}),startColumn:s.symbol.column+1,startLineNumber:s.symbol.line,endColumn:s.symbol.column+2,endLineNumber:s.symbol.line}),{ruleType:pe.UnaryExpression,operator:y,type:E,ctx:n,exprs:p}});k(this,"visitNotExpression",n=>{const{children:o}=n,s=o[1],f=[this.visit(s)],p=this._boolTypeJudge(f[0],s,"not");return{ruleType:pe.NotExpression,ctx:n,type:this._typeHandle([p],z.BOOL),exprs:f}});k(this,"visitMemberIndexExpression",n=>{var p,y;const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression&&f.push(this.visit(E))}if(this._memberIndexVerify(f[0],n),this._hasMemberIndex=!0,((p=f[0])==null?void 0:p.ruleType)===pe.MemberIndexExpression){const E=o[1];this._errors.push({message:Ne(Ce.unaryErr,{sign:"["}),startColumn:E.symbol.column+1,startLineNumber:E.symbol.line,endColumn:E.symbol.column+2,endLineNumber:E.symbol.line}),this._hasMemberIndex=!1}return{ruleType:pe.MemberIndexExpression,type:(y=f[0])==null?void 0:y.type,ctx:n,isInFunc:this._isInFunc,exprs:f}});k(this,"visitMethodStmt",n=>{var D;const{children:o,start:s}=n;let f=0;const p=[],y=[],E=this._commentsParser(s.line,[On.description],!0);this._currentLine=s.line;let x;for(;f<o.length;f++){const T=o[f];T.ruleIndex===F.RULE_methodElement&&(p.push(this.visit(T)),y.push(T))}return((D=p[0])==null?void 0:D.name)===$o.library&&E.description&&(this._description=E.description.join(`
|
12
12
|
`)),x=this._getMethodTypes(p,y)||[],this._inputFuncTitleVerify(p),{ruleType:pe.MethodExpression,types:x.length>1||x.isBrackethesized||x.isUnknown?x:void 0,ctx:n,type:x.length===1?x[0]:void 0,exprs:p}});k(this,"visitMethodExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitLogicalAndExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._boolTypeJudge(p[0],o[0],f),E=this._boolTypeJudge(p[1],o[2],f,1);return{ruleType:pe.LogicalAndExpression,type:this._typeHandle([y,E],z.BOOL),operator:f,ctx:n,exprs:p}});k(this,"visitLogicalOrExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._boolTypeJudge(p[0],o[0],f),E=this._boolTypeJudge(p[1],o[2],f,1);return{ruleType:pe.LogicalOrExpression,operator:f,ctx:n,type:this._typeHandle([y,E],z.BOOL),exprs:p}});k(this,"visitMultiplicativeExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._calcTypeJudge(p[0],o[0],f),E=this._calcTypeJudge(p[1],o[2],f,1);return{ruleType:pe.MultiplicativeExpression,operator:f,ctx:n,type:this._typeHandle([y,E]),exprs:p}});k(this,"visitBrackethesized",n=>{const{children:o,start:s}=n,f=o[1];return this._currentLine=s.line,{ruleType:pe.Brackethesized,ctx:n,exprs:this.visit(f)}});k(this,"visitArguments",n=>{const{children:o}=n;let s=0;const f={params:[]};let p="";for(;s<o.length;s++){const y=o[s];if(y.ruleIndex===F.RULE_argument){const E=this.visit(y),x=E.paramKey;x?(p=x,f[x]?this._errorHandle(Ne(Qi.moreSameArg,{arg:x}),n.parentCtx,ar.Warning):(f[x]=E.param,f[x].ctx=y)):p?this._errorHandle(Ne(Ce.argsSyntaxErr,{argName:p}),y):(E.ctx=y,f.params.push(E))}}return f});k(this,"visitArgument",n=>{const{children:o}=n;return o.length===1?this.visit(o[0]):{paramKey:this.visit(o[0]),param:this.visit(o[2])}});k(this,"visitIfStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.IfStatement,condition:[],block:[],ctx:n,typeList:[]};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_singleExpression:f.condition.push(this.visit(p));break;case F.RULE_blockLine:const y=this._isInLocalScop;this._isInLocalScop=!0;const E=this.visit(p);f.typeList.push(this._getBlockReturnTypes(E)),f.block.push(E),this._isInLocalScop=y;break}}return f});k(this,"visitForToStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.ForToStatement,numerical:[],ctx:n,block:[]};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_varModifier:f.declare=this.visit(p);break;case F.RULE_typeGather:const y=this.visit(p);f.type=y&&this._typeAddSeries(y);break;case F.RULE_identifier:f.name=this.visit(p),this._repeatVarJudge(f.name,p);break;case F.RULE_singleExpression:f.numerical.push(this.visit(p));break;case F.RULE_blockLine:this._blockCount++,this._pushBlockRanges(n),f.name&&this._variablesHandle({nameList:{name:f.name,isForVar:!0,type:f.type},value:{type:f.type||`${z.SERIES} ${z.INT}`}},n),this._blockCount--,this._blockRanges.pop(),this._loopCount++;const E=this._isInLocalScop;this._isInLocalScop=!0,f.block=this.visit(p),this._loopCount--,this._isInLocalScop=E,f.returnedTypes=this._getBlockReturnTypes(f.block);break}}return f});k(this,"visitForInStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.ForInStatement,ctx:n,names:[]};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_identifier:const y=this.visit(p);this._repeatVarJudge(y,p),f.names.push(y);break;case F.RULE_singleExpression:f.array=this.visit(p);const E=f.array.type;this._isArrayType(E)||this._isMatrixType(E)||E===z.UNDETERMINED||this._errorHandle(Ne(Ce.typeMismatch,{operator:"foreach",index:"id",typeE:E,typeR:"array<fun_arg>"}),p);break;case F.RULE_blockLine:if(this._blockCount++,this._pushBlockRanges(n),f.names.length){let[D,T]=f.names;const I=f.array.type;T?this._variablesHandle({nameList:{name:D,isForVar:!0,type:`${z.SERIES} ${z.INT}`},value:{type:`${z.SERIES} ${z.INT}`}},n):T=D;const B=I===z.UNDETERMINED?I:this._isMatrixType(I)?`${this._getArrayType(I)}[]`:this._typeAddSeries(this._getArrayType(I));this._variablesHandle({nameList:{name:T,isForVar:!0,type:B},value:{type:B}},n)}this._blockCount--,this._blockRanges.pop(),this._loopCount++;const x=this._isInLocalScop;this._isInLocalScop=!0,f.block=this.visit(p),this._isInLocalScop=x,this._loopCount--,f.returnedTypes=this._getBlockReturnTypes(f.block);break}}return f});k(this,"visitSwitchStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.SwitchStatement,condition:!0,ctx:n,cases:[],defaultCase:void 0};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_singleExpression:f.condition=this.visit(p);break;case F.RULE_caseClause:f.cases.push(this.visit(p));break;case F.RULE_defaultCaluse:f.defaultCase=this.visit(p);break}}return f});k(this,"visitCaseClause",n=>{const{children:o}=n,s={ruleType:pe.CaseClause},f=this._isInLocalScop;return this._isInLocalScop=!0,s.condition=this.visit(o[0]),s.block=this.visit(o[2]),this._isInLocalScop=f,s.returnedTypes=this._getBlockReturnTypes(s.block),s});k(this,"visitDefaultCaluse",n=>{const{children:o}=n,s={ruleType:pe.DefaultCaluse},f=this._isInLocalScop;return this._isInLocalScop=!0,s.block=this.visit(o[1]),this._isInLocalScop=f,s.returnedTypes=this._getBlockReturnTypes(s.block),s});k(this,"visitWhileStatement",n=>{const{children:o}=n,s={ruleType:pe.WhileStatement,ctx:n};s.condition=this.visit(o[1]),this._loopCount++;const f=this._isInLocalScop;return this._isInLocalScop=!0,s.block=this.visit(o[2]),this._isInLocalScop=f,this._loopCount--,s.returnedTypes=this._getBlockReturnTypes(s.block),s});k(this,"visitImportStmt",async n=>{const{children:o,start:s}=n;let f=0;const p=[];for(this._currentLine=s.line;f<o.length;f++){const y=o[f];if(y.ruleIndex===F.RULE_importElement){const E=await this.visit(y);E&&p.push(E)}}return p});k(this,"visitImportElement",async n=>{const{children:o}=n;if(!o||!o.length)return;let s=0;const f=[],p={ruleType:pe.ImportElement,ctx:n};for(;s<o.length;s++){const y=o[s];y.ruleIndex===F.RULE_identifier?f.push(this.visit(y)):y.symbol&&y.symbol.type===F.IntegerLiteral&&(p.libraryVersion=y.symbol.text)}return p.username=f[0],p.libraryName=f[1],p.name=f[2],await this._importHandle(p,n),p});k(this,"visitLiteral",n=>{const{children:o}=n,s=o[0],{type:f,text:p}=s.symbol,y={ruleType:pe.Literal,ctx:n,type:"",value:p};switch(f){case F.ColorLiteral:y.type=z.COLOR;break;case F.BooleanLiteral:y.type=z.BOOL;break;case F.StringLiteral:if(y.type=z.STRING,p.includes(`
|
13
13
|
`)){const E=p.replace(/\s*(\n|\r)\s*/g," ");y.value=`\`${E.substring(1,E.length-1)}\``}break;case F.IntegerLiteral:y.type=z.INT;break;case F.DecimalLiteral:y.type=z.FLOAT;break}return y.type&&(y.type=`${z.CONST} ${y.type}`),y});k(this,"visitMethodElement",n=>{const{children:o}=n,[s,f]=o,[p,y,E]=this.visit(s),x=this.visit(f);return{name:p,type:y,args:x,expr:E}});k(this,"visitMethodName",n=>{const{children:o}=n,s=[],f=[];let p=0,y=null;for(;p<o.length;p++){const x=o[p],D=x.ruleIndex,T=x.symbol;switch(D){case F.RULE_identifier:s.push(this.visit(x));break;case F.RULE_singleExpression:y=this.visit(x);break;case F.RULE_typeName:const I=this.visit(x);f.push(I),this._typeCheck(I,F.RULE_typeName,x);break;default:T&&T.text==="."&&s.push(".")}}const E=s.join("");return N_.includes(E)?this._hasDrawFunc=!0:I_.includes(E)&&(this._hasCreateOrderFunc=!0),[E,f,y]});k(this,"visitArrowFunction",n=>{const{children:o,start:s,stop:f}=n,p={ruleType:pe.ArrowFunction,returnedTypes:[]};let y=0,E={lineNumber:0,column:0};const x=this._commentsParser(s.line,[On.function,On.param,On.returns],!0);Object.assign(p,{desc:x[On.function],paramsDesc:x[On.param],returnsDesc:x[On.returns]}),this._currentLine=s.line;let D=null;for(;y<o.length;y++){const T=o[y],I=T.ruleIndex,B=T.symbol;switch(I){case F.RULE_identifier:E={lineNumber:T.start.line,column:T.start.column},p.name=this.visit(T);break;case F.RULE_arrowFunctionParameters:p.params=this.visit(T),p.isExport&&this._exportArgsTypeVerify(p.params),this._setFuncParams(p,{endColumn:f.column,endLineNumber:f.line-1,startColumn:s.column,startLineNumber:s.line}),D=T;break;case F.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,p.block=this.visit(T),p.hasMemberIndex=this._hasMemberIndex,p.returnedTypes=this._getBlockReturnTypes(p.block),this._isInFunc=!1;break;default:B&&B.type===F.Export&&(p.isExport=!0,this._addExportPos(B,"functions"))}}return this._setFunc(p,E,D,f.line-1),this._currentFuncParams.clear(),p});k(this,"visitArrowFunctionParameters",n=>{const{children:o}=n;let s=0,f=[];for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_formalParameterList&&(f=this.visit(p))}return f});k(this,"visitFormalParameterList",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_formalParameterArg&&f.push(this.visit(p))}return f});k(this,"visitFormalParameterArg",n=>{const{children:o}=n;let s=0;const f={};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_typeGather:const y=this.visit(p);f.type=y&&this._typeAddSeries(y);break;case F.RULE_identifier:f.name=this.visit(p);break;case F.RULE_singleExpression:f.defaultValue=this.visit(p),delete f.defaultValue.ctx}}return f.ctx=n,f.type=f.type||z.UNDETERMINED,f});k(this,"visitArrowMethod",n=>{const{children:o,start:s,stop:f}=n;let p=0;const y={ruleType:pe.ArrowMethod,returnedTypes:[]};let E={lineNumber:0,column:0};const x=this._commentsParser(s.line,[On.function,On.param,On.returns],!0);Object.assign(y,{desc:x[On.function],paramsDesc:x[On.param],returnsDesc:x[On.returns]}),this._currentLine=s.line;let D=null;for(;p<o.length;p++){const T=o[p];switch(T.ruleIndex){case F.RULE_identifier:E={lineNumber:T.start.line,column:T.start.column},y.name=this.visit(T);break;case F.RULE_arrowMethodParameters:y.params=this.visit(T),y.isExport&&this._exportArgsTypeVerify(y.params),this._setFuncParams(y,{endColumn:f.column,endLineNumber:f.line-1,startColumn:s.column,startLineNumber:s.line}),D=T;break;case F.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,y.block=this.visit(T),y.hasMemberIndex=this._hasMemberIndex,y.returnedTypes=this._getBlockReturnTypes(y.block),this._isInFunc=!1;break;default:T.symbol&&T.symbol.type===F.Export&&(y.isExport=!0,this._addExportPos(T.symbol,"methods"));break}}return this._setFunc(y,E,D,f.line-1),this._setMethod(y,E),this._currentFuncParams.clear(),y});k(this,"visitArrowMethodParameters",n=>{const{children:o}=n;let s=0;const f={};let p=[];for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_typeGather:const E=this.visit(y);f.type=E&&this._typeAddSeries(E);break;case F.RULE_identifier:f.ctx=y,f.name=this.visit(y);break;case F.RULE_formalParameterList:p=this.visit(y);break}}return[f,...p]});k(this,"visitTypeStatement",n=>{const{children:o,start:s,stop:f}=n;let p=0;const y={ruleType:pe.TypeStatement,fields:[]},E=this._commentsParser(s.line,[On.type,On.field]);Object.assign(y,{desc:E[On.type],fieldsDesc:E[On.field]}),this._currentLine=s.line;let x={lineNumber:0,column:0},D=null;for(;p<o.length;p++){const T=o[p];switch(T.ruleIndex){case F.RULE_identifier:x={lineNumber:T.start.line,column:T.start.column},D=T,y.name=this.visit(T);break;case F.RULE_typeElement:y.fields.push(this.visit(T));break;default:T.symbol&&T.symbol.type===F.Export&&(y.isExport=!0,this._addExportPos(T.symbol,"types"));break}}if(y.isExport){const T=f.line-1,{line:I=0}=this._endExport;T>I&&(this._endExport={line:T,name:y.name})}return this._setUserType(y,x,D),this._setNewFunc(y,x),this._setCopyFunc(y,x),this._setCopyMethod(y,x),y});k(this,"visitTypeElement",n=>{const{children:o,start:s}=n;let f=0;const p={};let y=null;for(this._currentLine=s.line;f<o.length;f++){const E=o[f];switch(E.ruleIndex){case F.RULE_typeGather:const x=this.visit(E);if(E.children[0].ruleIndex===F.RULE_typeSeries){const{column:D,line:T,text:I}=E.start,B=D+1;this._errors.push({startColumn:B,endColumn:parseInt(B+I.length),startLineNumber:T,endLineNumber:T,message:Ne(this._buildinTypes.has(I)?Ce.typeUseError:Ce.notTypeKeyword,{text:I})}),p.type=z.UNDETERMINED}else p.type=x&&this._typeAddSeries(x);break;case F.RULE_identifier:p.name=this.visit(E);break;case F.RULE_singleExpression:y=E,p.value=this.visit(E);break;default:E.symbol&&E.symbol.type===F.Varip&&(p.isVarip=!0);break}}return this._typeElementVerify(p,y),p});k(this,"visitAssignmentOperator",n=>{const{children:o}=n;return o&&o[0].symbol.text});k(this,"visitTypeMap",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];if(p.ruleIndex===F.RULE_typeName){const y=this.visit(p);f.push(y),this._typeCheck(y,F.RULE_typeName,p)}}return`map<${f[0]},${f[1]}>`});k(this,"visitTypeSeries",n=>{const{children:o}=n,[s,f]=o,p=this.visit(s),y=this.visit(f);return this._typeCheck(p,F.RULE_typeSeries,s),this._typeCheck(y,F.RULE_typeName,f),`${p} ${y}`});k(this,"visitTypeArray",n=>{const{children:o}=n,s=o[0];let f=this.visit(s),p=f;if(o.length===3)f=z.ARRAY;else{this._typeCheck(f,F.RULE_typeArray,s);let y=1;for(;y<o.length;y++){const E=o[y];E.ruleIndex===F.RULE_typeName&&(p=this.visit(E),this._typeCheck(p,F.RULE_typeName,E))}}return this._arrayTypeConvert(`${f}<${p}>`)});k(this,"visitTypeGather",n=>{const{children:o}=n;if(o&&o.length){const s=o[0],f=this.visit(s);return s.ruleIndex===F.RULE_typeName&&this._typeCheck(f,F.RULE_typeName,s),f}return null});k(this,"visitIdentifier",n=>n.children&&n.children[0].symbol.text);k(this,"visitTypeName",n=>{const{children:o}=n;let s=0,f="";for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_identifier?f=`${f}${this.visit(p)}`:f=`${f}.`}return f});k(this,"visitName",n=>{var x,D;const{children:o}=n;let s=0,f=!1;const p=[];let y=null;for(;s<o.length;s++){const T=o[s];switch(T.ruleIndex){case F.RULE_identifier:p.push(this.visit(T));break;case F.RULE_singleExpression:y=this.visit(T);break;case F.RULE_methodElement:f=!0,p.push(this.visit(T));break}}const E={ruleType:pe.Name,hasMethod:f,exprs:p,expr:y};if(f){let T="";const I=[];for(const L of p)typeof L=="string"?T=T?`${T}.${L}`:L:(T&&(L.name=`${T}.${L.name}`),I.push(L),T="");E.exprs=[...I,T];const B=this._getMethodTypes(I,Array.from(I,()=>n));if(B&&B.length){const L=Ne(Ce.noFiledErr,{name:T});B.length>1&&this._errorHandle(L,n),E.type=((D=this._nameCheck(this._getOriginMethodName(B[0],T),n,L))==null?void 0:D.type)||z.UNDETERMINED}}else{let T=p.join(".");if(y&&y.type&&y.type===z.UNDETERMINED)E.type=z.UNDETERMINED,T=`expr0.${T}`;else{y&&y.type&&(T=`${this._getMethodTypeName(y.type)}.${T}`);const I=this._nameCheck(T,n)||{};(x=I.title)!=null&&x.startsWith("built-in")&&(E.isBuiltIn=!0,E.isConst=I.isConst),E.varPos=I.pos,E.declare=I.declare,E.type=(I==null?void 0:I.type)||z.UNDETERMINED,I!=null&&I.isArg&&(E.arg=I),E.scope=this._blockCount}E.name=T}return E});this._loopCount=0,this._errors=[],this._variables=new Map,this._functions=new Map,this._methods=new Map,this._currentFuncParams=new Map,this._types=new Map,this._currentBlockVars=[new Map],this._blockCount=0,this._isInFunc=!1,this._isNeedCalc=!1,this._blockRanges=[],this._overloadsFuncs=[],this._hasMemberIndex=!1,this._isInLocalScop=!1,this._onlyStatementsCount=0,this._comments=o,this._exportFunctions=[],this._exportMethods=[],this._exportTypes=[],this._exportPositions=[],this._endExport={},this._importLibs=new Map,this._getImportLibraryFunc=s}get overloadsFuncs(){return this._overloadsFuncs}get errors(){return this._errors}get userTypes(){return this._types}get userFunctions(){return this._functions}get userVariables(){return this._variables}get userMethods(){return this._methods}get hasUseDrawFunc(){return this._hasDrawFunc}get hasUseCreateOrderFunc(){return this._hasCreateOrderFunc}get scriptType(){return this._scriptType}get exportLibs(){return{functions:[...this._exportFunctions],methods:[...this._exportMethods],types:[...this._exportTypes]}}get description(){return this._description}get exportPositions(){return this._exportPositions}get endExport(){return this._endExport}get imports(){return this._importLibs}_verifyGloablVar(n,o){const{name:s,varPos:f,isBuiltIn:p}=n;if(p&&this._errorHandle(Ne(Ce.buidinAssignErr,{name:s}),o),!f)return;const y=this._currentBlockVars[0].get(s);if(!y)return;const{column:E,lineNumber:x}=y.pos||{};this._isInFunc&&E===f.column&&x===f.lineNumber&&this._errorHandle(Ne(Ce.modifyGlobalVarErr,{name:s}),o)}_inputFuncTitleVerify(n){if(!(n!=null&&n.length)||n.length>1)return;const{name:o,args:s}=n[0];o===z.INPUT&&this._inputVarName&&!(s.params.some(f=>f.originName==="title")||s.title)&&(s.title={value:`"${this._inputVarName}"`,ruleType:pe.Literal,type:`${z.CONST} ${z.STRING}`})}async _importHandle(n,o){const{stop:s,start:f}=o,{username:p,libraryName:y,libraryVersion:E,name:x}=n,D=`${p}/${y}/${E}`;if(this._importLibs.has(D))return this._errorHandle(Ce.importMultipleErr,o),n;for(const[B,L]of this._importLibs)if(L.name&&L.name===x||!L.name&&!x&&L.libraryName===y)return this._errorHandle(Ne(Ce.importNameRepeatErr,{name:x,line:L.startLine}),o),n;let T=x||y;const I=await this._getImportLibraryFunc({...n,libraryId:D,ctx:void 0,startLine:f.line,endLine:s.line,startColumn:f.column,endColumn:s.column+s.text.length+1});if(I){const{codeStr:B,description:L}=I;this._importLibs.set(D,{...n,libraryId:D,startLine:f.line,endLine:s.line,ctx:void 0,desc:L}),this._importDataHandle(I,T),Bn.includes(T)&&(T=`$${T}`),n.code=B.replace("$name",T)}else this._errorHandle(Ne(Ce.importNotExitErr,{username:p,libraryName:y}),o)}_importDataHandle(n,o){const{functions:s,methods:f,types:p}=n;for(const y of s){const{name:E}=y,x=`${o}.${E}`,D=this._functions.get(x)||[];D.push({...this._importTypeUpdate(y,p,o),name:x,isUser:void 0,isImport:!0}),this._functions.set(x,D)}for(const y of f){const E=this._importTypeUpdate(y,p,o),x=E.originalName||E.name,D=this._methods.get(x)||[];D.push({...E,isImport:!0,isUser:void 0}),this._methods.set(x,D)}for(const y of p){const E=`${o}.${y.name}`,x=this._types.get(E)||[];x.push({...this._importTypeUpdate(y,p,o),name:E,isImport:!0}),this._types.set(E,x)}}_importTypeUpdate(n,o,s){var B;let{args:f,returnedTypes:p,thisType:y,fields:E,name:x,originalName:D}=n,T="";if(f&&f.length&&(f=f.map(L=>{const{allowedTypeIDs:b,displayType:_,name:g}=L,O=_&&this._replaceTypeName(_,o,s);return T=T?`${T}, ${O} ${g}`:`${O} ${g}`,{...L,allowedTypeIDs:b==null?void 0:b.map(R=>this._replaceTypeName(R,o,s)),displayType:O}})),p!=null&&p.length&&(p=[this._replaceTypeName(p[0],o,s)]),y!=null&&y.length){const L=this._replaceTypeName(y[0],o,s);L!==y[0]&&(D=`${s}.${D||x}`),y=[L]}E!=null&&E.length&&(E=E.map(L=>{const{type:b}=L;return{...L,type:b&&this._replaceTypeName(b,o,s)}}));const I={...n,args:f,returnedTypes:p,thisType:y,fields:E,originalName:D};return(B=I.syntax)!=null&&B.length&&(I.syntax=[`${D||`${s}.${x}`}(${T}) → ${(p==null?void 0:p[0])||"void"}`]),I}_replaceTypeName(n,o,s){const f=o.find(p=>n.includes(p.name));return f?n.replace(f.name,`${s}.${f.name}`):n}_exportArgsTypeVerify(n){for(const o of n)(o.type===z.UNDETERMINED||!o.type)&&this._errorHandle(Ce.exportFuncArgErr,o.ctx)}_addExportPos(n,o){const{line:s,column:f,text:p}=n;this._exportPositions.push({startLineNumber:s,startColumn:f,endLineNumber:s,endColumn:f+p.length+1,type:o})}_typeElementVerify(n,o){var y,E;const{type:s,value:f}=n;if(!f)return;if(![pe.Literal,pe.UnaryExpression].includes(f.ruleType)&&!f.isBuiltIn){this._errorHandle(Ce.defaultValueErr,o);return}else if(f.ruleType===pe.UnaryExpression){const{exprs:x}=f;if(![pe.Literal,pe.UnaryExpression].includes((y=x[0])==null?void 0:y.ruleType)&&!((E=x[0])!=null&&E.isBuiltIn)){this._errorHandle(Ce.defaultValueErr,o);return}}(!this._compareType(s,f.type)||s.endsWith(z.INT)&&f.type.endsWith(z.FLOAT))&&this._errorHandle(Ne(Ce.defaultValueTypeErr,{typeE:f.type,typeR:s}),o)}_memberIndexVerify(n,o){if(n.ruleType===pe.Name&&!n.hasMethod&&this._blockCount){const f=this._currentBlockVars[this._blockCount],p=f&&f.get(n.name);p&&(p.isForVar?this._errorHandle(Ne(Ce.notHistoryErr,{name:n.name}),o):!(this._blockCount===1&&this._isInFunc)&&this._errorHandle(Ne(Qi.localScopeGetHistory,{name:n.name}),o,ar.Warning))}const s=n&&n.type;if(s){const f=this._removePrefix(s);!this._types.has(f)&&!this._buildinTypes.has(f)&&!this._isArrayType(f)&&!this._isMatrixType(f)&&!this._isMapType(f)&&f!==z.UNDETERMINED&&this._errorHandle(Ne(Ce.invalidType,{index:0}),o)}}_setFuncParams(n,o){var s;for(const f of n.params){const p=(s=this._types.get(f.type))==null?void 0:s[0];if(p&&p.fields)for(const y of p.fields){const E=`${f.name}.${y.name}`;this._currentFuncParams.set(E,{...y,originName:E})}delete f.ctx,f.range=o,f.scope=this._blockCount+1,this._setVariablesMap(f,!0),this._currentFuncParams.set(f.name,f)}}_pushBlockRanges(n){!n||!n.start||!n.stop||this._blockRanges.push({startColumn:n.start.column,endColumn:n.stop.column,startLineNumber:n.start.line,endLineNumber:n.stop.line})}_setUserType(n,o,s){const{fields:f,name:p,desc:y,fieldsDesc:E}=n,x={fields:f.map(D=>({name:D.name,desc:E==null?void 0:E[D.name],type:D.type})),name:p,desc:y,pos:o};if(this._types.has(p)){this._errorHandle(Ne(Ce.typeRepeatErr,{name:p}),s);return}n.isExport&&this._exportTypes.push(x),this._types.set(p,[{...x}]),this._addVarToMap(p,p,o,!1,!1)}_againAssignHandle(n,o,s){const f=s!==":="?s.replace("=",""):s,p=s!==":="?[z.UNDETERMINED,z.INT,z.FLOAT]:[];f==="+"&&p.push(z.STRING);const[y,E]=n;y.arg&&!y.name.includes(".")&&this._errorHandle(Ne(Ce.funcArgAssignErr,{name:y.name}),o[0]);const x=this._sameTypeJudge(n,o,f,p),D=this._typeHandle(x);return this._updateUserVar(y.name,D,E.type),y.type=D,{ruleType:pe.AgainAssign,name:y,operator:s,type:D,value:E}}_typeCheck(n,o,s){const f=[z.SERIES,z.SIMPLE,z.CONST];switch(o){case F.RULE_typeName:const p=this._buildinTypes.get(n);p&&![...f,z.ARRAY,z.MATRIX,z.MAP].includes(p[0].name)||this._types.get(n)||this._errorHandle(Ne(Ce.notTypeKeyword,{text:n}),s);break;case F.RULE_typeArray:[z.ARRAY,z.MATRIX].includes(n)||this._errorHandle(Ce.tempateTypeErr,s);break;case F.RULE_typeSeries:f.includes(n)||this._errorHandle(Ne(Ce.qualifierErr,{name:n}),s);break}}_getBuildVar(n){const o=this._buildinVariables.get(n);if(o&&o[0])return o[0];const s=this._buildinConstants.get(n);return s&&s[0]?Object.assign(s[0],{isConst:!0}):this._specialTreatmentChartPoint(n)}_specialTreatmentChartPoint(n){var o,s;if(n.startsWith("chart.point")){const f=n.split("."),p=f.pop(),y=f.join(".");return(((s=(o=this._buildinTypes.get(y))==null?void 0:o[0])==null?void 0:s.fields)||[]).find(x=>x.name===p)}}_verifyName(n,o){var f,p;const s=this._getBuildVar(n);if(s)return s;if(n.includes(".")){const y=n.split("."),E=y.pop(),x=y.join(".");let D=this._blockCount;for(;D>=0;){if(!this._currentBlockVars[D]){D--;continue}const I=this._currentBlockVars[D].get(x);if(o&&this._judgeGatherValue(E||"",o,I==null?void 0:I.valueType,!0),(I==null?void 0:I.type)==="chart.point"){const L=(((p=(f=this._buildinTypes.get(I.type))==null?void 0:f[0])==null?void 0:p.fields)||[]).find(b=>b.name===E);if(L)return Object.assign(L,{pos:I.pos})}D--}const T=this._specialTreatmentChartPoint(n);if(T)return T}return this._getUserVar(n)}_judgeGatherValue(n,o,s,f){return s!==`${z.SIMPLE} ${z.NA}`?!0:(f&&this._errorHandle(Ne(Ce.objectIsNaErr,{name:n,type:"field"}),o),!1)}_nameCheck(n,o,s=Ne(Ce.undeclared,{name:n})){const f=this._verifyName(n,o);return f||this._errorHandle(s,o),f}_inBlock(n){this._blockCount++,this._pushBlockRanges(n);const o=this.visit(n);return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),o}_errorHandle(n,o,s=ar.Error){this._errors.push({message:n,startColumn:o.start.column+1,startLineNumber:o.start.line,endColumn:o.start.column+2+o.stop.stop-o.start.start,endLineNumber:o.stop.line,type:s})}_boolTypeJudge(n,o,s,f=0){return this._typeJudge(n,o,s,z.BOOL,[z.UNDETERMINED,z.INT,z.FLOAT,z.BOOL],f)}_calcTypeJudge(n,o,s,f=0){return this._typeJudge(n,o,s,"int/float",[z.UNDETERMINED,z.INT,z.FLOAT],f)}_typeJudge(n,o,s,f,p,y=0){const E=n&&n.type;if(E){const x=this._removePrefix(E);if(!p.includes(x)&&x!==z.NA)return this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${y}`,typeE:x,typeR:f}),o),z.UNDETERMINED;f===z.BOOL&&[z.INT,z.FLOAT].includes(x)&&this._errorHandle(Ne(Qi.typeMismatch,{operator:`operator ${s}`,index:`expr${y}`,type:z.BOOL}),o,ar.Warning)}return E||z.UNDETERMINED}_sameTypeJudge(n,o,s,f){let p="";const y=[],E=["plot_display","plot_simple_display"];["+","-","+=","-="].includes(s)&&(f=f.concat(E));for(const[x,D]of n.entries()){let T=D&&D.type||z.UNDETERMINED;const I=this._removePrefix(T);if(p||(p=I),!f.includes(I)&&f.length&&I!==z.NA){this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,typeE:T,typeR:f.slice(1).join("/")}),o[x]),p=z.UNDETERMINED,y.push(p);continue}if(p===z.UNDETERMINED||I===z.UNDETERMINED)T=p=z.UNDETERMINED;else if(p!==I&&p!==z.NA&&I!==z.NA&&(![z.INT,z.FLOAT].includes(p)||![z.INT,z.FLOAT].includes(I)))if(s===":=")this._errorHandle(Ne(Ce.assignTypeMismatch,{typeE:I,name:n[0].name,typeR:p}),o[0]),T=p=z.UNDETERMINED;else if(["==","!=","?:"].includes(s)&&[z.INT,z.FLOAT,z.BOOL].includes(p)&&[z.INT,z.FLOAT,z.BOOL].includes(I))this._errorHandle(Ne(Qi.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,type:p}),o[x],ar.Warning),T=p=z.UNDETERMINED;else if(E.includes(p)&&E.includes(I)){if(p!==I){const B=this._getPrefix(T);y[x-1]=`${this._getPrefix(y[x-1])} ${E[0]}`,T=p=`${B} ${E[0]}`}}else this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,typeE:I,typeR:p}),o[x]),T=p=z.UNDETERMINED;y.push(T)}return y}_getUserVar(n,o=!1){for(let s=this._blockCount;s>=0;s--){const f=this._currentBlockVars[s];if(s<=0){const p=this._currentFuncParams.get(n);if(p)return p.isArg=!0,p}if(f){const p=f.get(n);if(p)return p}}if(n.includes(".")&&!o){let s=!1,f=null;if(n.split(".").reduce((p,y)=>{let E=p?`${p}.${y}`:y;const x=this._getUserVar(E,!0);return x!=null&&x.type?x.type===z.UNDETERMINED?s=!0:(E=x.type,f=x):f=null,E},""),s)return{name:n,type:z.UNDETERMINED};if(f)return f}return null}_repeatVarJudge(n,o){this._getBuildVar(n)&&this._errorHandle(Ne(Ce.buidinVarErr,{name:n}),o);for(let f=0;f<=this._blockCount;f++){const p=this._currentBlockVars[f];if(p&&p.get(n)){if(this._blockCount===f)return this._errorHandle(Ne(Ce.repeatVar,{name:n}),o),!0;this._errorHandle(Ne(Qi.repeatVar,{name:n}),o,ar.Warning)}}}_judgeVarBuildIn(n){for(let o=0;o<=this._blockCount;o++){const s=this._currentBlockVars[o];if(s&&s.get(n))return!0}return!1}_updateUserVar(n,o,s){for(let f=0;f<=this._blockCount;f++){const p=this._currentBlockVars[f];if(p){const y=p.get(n);if(y){y.type=o,y.valueType=s;return}}}}_variablesHandle(n,o){var p,y,E,x;if(!(n&&n.nameList))return;const s=n.nameList;if(s.name==="_")return;const f=n.value;if(s.ruleType===pe.VarMultiple){s.types=[],this._checkVarMultiple(s.names,f,o);for(const[D,T]of s.names.entries()){const I=this._varTypeJudge("",((p=f==null?void 0:f.types)==null?void 0:p[D])||z.UNDETERMINED,o);s.types.push(I),this._addVarToMap(T,I,s.posList[D],!0)}}else{const D=(f==null?void 0:f.type)||((y=f==null?void 0:f.returnedTypes)==null?void 0:y[0]);((E=f==null?void 0:f.types)!=null&&E.isBrackethesized||(x=f==null?void 0:f.returnedTypes)!=null&&x.isBrackethesized)&&this._errorHandle(Ne(Ce.tupleLeftVarErr,{name:s.name}),o),!s.type&&D===`${z.SIMPLE} ${z.NA}`&&this._errorHandle(Ce.naVarErr,o),s.prefix&&Ni.indexOf(s.prefix)>Ni.indexOf(this._getPrefix(D))&&this._errorHandle(Ne(Ce.declaredErr,{prefix:s.prefix,type:D}),o);const T=this._varTypeJudge(s.type,D||z.UNDETERMINED,o);s.type=T,this._addVarToMap(s.name,T,s.pos,!0,s.isForVar,s.declare,f.type,s.desc)}}_checkVarMultiple(n,o,s){var x,D,T,I;const f=n.length,p=(o.types||o.returnedTypes||[]).length,y=((x=o.types)==null?void 0:x.isBrackethesized)||((D=o.returnedTypes)==null?void 0:D.isBrackethesized);(T=o.types)!=null&&T.isUnknown||(I=o.returnedTypes)!=null&&I.isUnknown||(p===1&&!y||!p?this._errorHandle(Ce.tupleRightVarErr,s):f!==p&&this._errorHandle(Ne(Ce.tupleVarErr,{indexA:p,indexB:f}),s))}_addVarToMap(n,o,s,f=!0,p=!1,y,E,x){var B;const D=this._currentBlockVars[this._blockCount]||new Map,T=(B=this._types.get(o))==null?void 0:B[0];if(T&&T.fields)for(const L of T.fields)D.set(`${n}.${L.name}`,L);const I={name:n,type:o,pos:s,valueType:E,desc:x};f&&this._setVariablesMap(I),D.set(n,Object.assign(I,{isForVar:p,declare:y})),this._currentBlockVars[this._blockCount]=D}_setVariablesMap(n,o=!1){const s=this._blockRanges[this._blockCount];o||(n.range=s,n.scope=this._blockCount);const f=this._variables.get(n.name)||[];f.push(n),this._variables.set(n.name,f)}_varTypeJudge(n,o,s){if(o===z.VOID)return this._errorHandle(Ce.voidNotVar,s),z.UNDETERMINED;if(n&&o!==z.UNDETERMINED){const f=this._removePrefix(n),p=this._removePrefix(o);return p!==f&&p!==z.NA&&!(f===z.FLOAT&&p===z.INT)?(this._errorHandle(Ne(Ce.declareTypeErr,{type:n,valueType:o}),s),z.UNDETERMINED):this._typeHandle([n,o])}else if(o===z.UNDETERMINED)return z.UNDETERMINED;return n||o||z.UNDETERMINED}_getAllowTypes(n){const o=[];if(n===z.UNDETERMINED)return o;const s=this._getPrefix(n);if(s){const f=this._removePrefix(n);let p=-1;for(const[y,E]of Ni.entries())E===s&&(p=y),p>=0&&p<=y&&(f===z.FLOAT&&o.push(`${E} ${z.INT}`),o.push(`${E} ${f}`))}else n=this._arrayTypeConvert(n)||"",o.push(n),n.includes(z.FLOAT)&&o.push(n.replace(/float/,z.INT));return o}_setNewFunc(n,o){const s=`${n.name}.new`,f=[],p=[];for(const E of n.fields)f.push({name:E.name,required:!1,allowedTypeIDs:this._getAllowTypes(E.type),displayType:E.type}),p.push(`${E.type} ${E.name}`);const y={name:s,args:f,returnedTypes:[n.name],pos:o,syntax:[`${s}(${p.join(", ")}) → ${n.name}`]};n.isExport&&this._exportFunctions.push(y),this._functions.set(s,[{...y,isUser:!0}])}_setCopyFunc(n,o){const s=n.name,f=`${s}.copy`,p={name:f,args:[{name:"object",required:!0,allowedTypeIDs:[s],displayType:s}],returnedTypes:[s],pos:o,info:"The identifier of the object to be copied.",syntax:[`${f}(${s} object) → ${s}`]};n.isExport&&this._exportFunctions.push(p),this._functions.set(f,[{...p,isUser:!0}])}_setCopyMethod(n,o){const s=n.name,f=`${s}.copy`,p={name:f,originalName:f,args:[],returnedTypes:[s],thisType:[s],pos:o,syntax:[`${f}() → ${s}`]};n.isExport&&this._exportMethods.push(p),this._methods.set(f,[{...p,isUser:!0}])}_setFunc(n,o,s,f){const p=[],y=[],{desc:E,paramsDesc:x,returnsDesc:D,params:T,hasMemberIndex:I}=n;for(const O of T){const{type:R,name:C,defaultValue:j}=O;p.push({name:C,desc:x==null?void 0:x[C],required:!j,allowedTypeIDs:this._getAllowTypes(R),displayType:R}),y.push(`${R===z.UNDETERMINED?"":`${R} `}${C}`)}const{returnedTypes:B=[]}=n,L=n.name,b=B.length>1?`[${B.join(", ")}]`:B.toString(),_={name:L,desc:E,args:p,syntax:[`${L}(${y.join(", ")}) → ${b||"void"}`],hasMemberIndex:I,pos:o,isUser:!0,returnedTypes:B,returns:D};let g=this._functions.get(L);if(g){const O=g.length;_.index=O,n.index=O,this._verifyFuncRepeat(g,_,s),g.push(_),this._overloadsFuncs.push({name:L,index:O,line:o.lineNumber,startColumn:o.column+1,endColumn:o.column+L.length})}else g=[_];if(n.isExport){const{line:O=0}=this._endExport;f>O&&(this._endExport={line:f,name:L,index:_.index}),this._exportFunctions.push(_)}this._functions.set(L,g)}_setMethod(n,o){const{name:s,returnedTypes:f,params:p,desc:y,paramsDesc:E,returnsDesc:x}=n,D=p[0].type,T=[],I=[];for(const O of p.slice(1)){const{type:R,name:C,defaultValue:j}=O;T.push({name:C,desc:E==null?void 0:E[C],required:!j,allowedTypeIDs:this._getAllowTypes(R),displayType:R}),I.push(`${R} ${C}`)}const B=f.length>1?`[${f.join(", ")}]`:f.toString(),L=this._getMethodTypeName(D),b=`${L}.${s}`;n.typeName=L;const _={name:s,args:T,desc:y,originalName:b,syntax:[`${s}(${I.join(", ")}) → ${B||"void"}`],returnedTypes:f,hasMemberIndex:n.hasMemberIndex,pos:o,thisType:[D],returns:x};let g=this._methods.get(b);if(g){const O=g.filter(R=>!R.isImport);_.index=O.length,n.index=O.length,g.push(_)}else g=[_];n.isExport&&this._exportMethods.push(_),this._methods.set(b,g)}_verifyFuncRepeat(n,o,s){const{args:f}=o;n.some(y=>{const{args:E}=y;return(E==null?void 0:E.length)!=(f==null?void 0:f.length)?!1:!(E!=null&&E.length)&&!(f!=null&&f.length)?!0:E==null?void 0:E.every((x,D)=>{var T;return x.displayType===((T=f==null?void 0:f[D])==null?void 0:T.displayType)})})&&this._errorHandle(Ne(Ce.funcRepeatErr,{name:o.name}),s)}_getMethodTypes(n,o){let s;for(const[f,p]of n.entries()){const{type:y,expr:E,args:x}=p;let{name:D}=p;const T=o[f];if(E){if(E.type===z.UNDETERMINED)return[z.UNDETERMINED];D=`${this._getMethodTypeName(E.type)}${D}`,x.params.unshift(E)}if(s&&s.length>=1)if(s.length===1){const I=s[0];if(I===z.UNDETERMINED)return[z.UNDETERMINED];const B=this._getOriginMethodName(I,D);D.includes(".")?s=this._getOtherNamesMethodType(B,s,T,x,p):s=this._expandMethodHandle(B,T,x,{type:I},I,p)}else this._errorHandle(Ne(Ce.noFiledErr,{name:D}),T);else{const[I,B]=this._tempFuncNameHandle(D,T,y);D=B;const L=this._buildinFunctions.get(I);if(L)this._globalFuncVerify(L[0],T),this._hasMemberIndexVerify(L[0],T,p),p.isBuiltIn=!0,s=this._getBuildInReturnTypes(L,x,D,T,void 0,y);else{const b=this._functions.get(D);if(b)if(b.length<=1){this._hasMemberIndexVerify(b[0],T,p),s=b[0].returnedTypes;const{hasErr:_}=this._checkArgs(x,b[0].args||[],D,T,s[0]);if(_)return[z.UNDETERMINED]}else{const _=this._overloadsFuncGetTypes(b,x,T,void 0,p);s=this._returnedTypesParse([_])}else s=this._getOtherNamesMethodType(D,s,T,x,p)}}p.returnTypes=s}return s===void 0&&this._errorHandle(Ne(Ce.notFindFuncErr,{name:n[0].name}),o[0]),s}_globalFuncVerify(n,o){this._blockCount!==0&&w_.includes(n.name)&&this._errorHandle(Ne(Ce.globalFuncErr,{name:n.name}),o)}_hasMemberIndexVerify(n,o,s){(n.hasMemberIndex||n.name.startsWith("ta.")||n.name==="math.sum")&&(this._hasMemberIndex=this._isInFunc,s.hasMemberIndex=!0,s.position=o.start.tokenIndex)}_tempFuncNameHandle(n,o,s){let f=n;if(s&&s.length>=1){const p=["array.new","matrix.new"].includes(n),y=n==="map.new";if(s.length===1)if(p)f=`${n}<type>`,n=`${n}<${s[0]}>`;else return y?this._errorHandle(Ne(Ce.templateErr,{countA:2,countB:1}),o):this._errorHandle(Ne(Ce.templateNoSupportErr,{name:n}),o),[z.UNDETERMINED];else{if(!y)return p?this._errorHandle(Ne(Ce.templateErr,{countA:1,countB:2}),o):this._errorHandle(Ne(Ce.templateNoSupportErr,{name:n}),o),[z.UNDETERMINED];if(!Rp.includes(s[0]))return this._errorHandle(Ne(Ce.mapKeyErr,{type:this._typeAddSeries(s[0])}),o),[z.UNDETERMINED];f=`${n}<type,type>`,n=`${n}<${s[0]},${s[1]}>`}}return[f,n]}_getOtherNamesMethodType(n,o,s,f,p){const y=n.split("."),E=y.length-1,x=y.slice(0,E).join("."),D=this._getUserVar(x);this._judgeGatherValue(y[E],s,D==null?void 0:D.valueType)||(p.name=`${x}?.${y[E]}`);const I=D==null?void 0:D.type;if(I){if(I===z.UNDETERMINED)return o=[z.UNDETERMINED],o.isUnknown=!0,o;const B=this._getOriginMethodName(I,y[E]);o=this._expandMethodHandle(B,s,f,D,x,p)}else{let B="",L="",b="";for(const _ of y.slice(0,E)){B?L=this._getOriginMethodName(B,_):L=L?`${L}.${_}`:_;const g=this._verifyName(L);g!=null&&g.type?(B=g.type,b=""):this._buildinTypes.get(L)?b=Ne(Ce.methodNotExistErr,{name:L,methodName:y[E]}):b=Ne(Ce.noFiledErr,{name:_})}b&&this._errorHandle(b,s)}return o}_expandMethodHandle(n,o,s,f,p,y){var D,T;let E;const x=this._buildinMethods.get(n);if(x)E=this._getBuildInReturnTypes(x,s,n,o,f);else{const I=this._methods.get(n);if(I&&I.length)if(I.length<=1){const B=I[0],L=this._getMethodTypeName(((D=B.thisType)==null?void 0:D[0])||"");if(!this._types.get(L)){const g=this._functions.get(B.name);g&&(y.selfArg=(T=g[0].args)==null?void 0:T[0])}this._hasMemberIndexVerify(B,o,y),E=B.returnedTypes;const{hasErr:_}=this._checkArgs(s,B.args||[],n,o,(E==null?void 0:E[0])||"");if(_)return[z.UNDETERMINED]}else{const B=this._overloadsFuncGetTypes(I,s,o,f,y);E=this._returnedTypesParse([B])}else this._errorHandle(Ne(Ce.methodNotExistErr,{methodName:n.split(".").slice(-1)[0],name:p}),o)}return E}_getBuildInReturnTypes(n,o,s,f,p,y){var x;let E;if(n.length===1){const{returnedTypes:D,syntax:T,args:I=[],thisType:B}=n[0],L=T[0].split("→")[1].trim(),b=p||o.params[0]||((x=I[0])==null?void 0:x.name)&&o[I[0].name];b&&!this._checkMethodThisType(B,b.type)&&this._errorHandle(Ne(Ce.typeMismatch,{operator:s,index:b.name||"id",typeE:b.type,typeR:B[0]}),f);const{hasErr:_,types:g}=this._checkArgs(o,I,s,f,L,b);if(_)return[z.UNDETERMINED];if(E=g.length&&g||this._returnedTypesParse(D),E.length>1)return E;(y==null?void 0:y.length)===1?E=[this._typeReplace(L,y[0])]:(y==null?void 0:y.length)===2&&(E=[`${z.MAP}<${y[0]},${y[1]}>`]),E=this._returnTypesOtherHandle(b,L,E,s)}else{const D=this._overloadsFuncGetTypes(n,o,f,p);E=this._returnedTypesParse([D])}return E}_overloadsFuncGetTypes(n,o,s,f,p){var B,L,b;let y="",E=[],x=[],D=0;for(const[_,g]of n.entries()){const{args:O,returnedTypes:R,name:C,thisType:j}=g,X=f||o.params[0]||o[O[0].name],{errMsg:re,warnMsg:K}=this._overloadsCheckArgs(o,O,C,s,X);X&&!this._checkMethodThisType(j,X.type)&&re.unshift({msg:Ne(Ce.typeMismatch,{operator:C,index:X.name||"id",typeE:X.type,typeR:j[0]}),ctx:s}),_===0?(E=re,x=K,!re.length&&(y=R[0])):re.length?((B=E[0])!=null&&B.isLenErr&&!((L=re[0])!=null&&L.isLenErr)||E.length>re.length)&&(E=re,x=K,D=_):this._priorityComparison(y,R[0])||(R[0]===`${z.ARRAY}<>`?y=`${X.type}[]`:y=R[0],E=re,x=K,D=_)}for(const _ of E)this._errorHandle(_.msg,_.ctx);for(const _ of x)this._errorHandle(_.msg,_.ctx,ar.Warning);const T=s.children[0],I=n[0].name;if(T&&this._overloadsFuncs.push({name:I,index:D,line:T.start.line,startColumn:T.start.column+1,endColumn:T.start.column+I.length}),p){const _=n[D],{thisType:g,name:O,index:R}=_;if(this._hasMemberIndexVerify(_,s,p),p.index=R||D,g){const C=this._getMethodTypeName((g==null?void 0:g[0])||"");if(!this._types.get(C)){const X=this._functions.get(O);X&&(p.selfArg=(b=X[0].args)==null?void 0:b[0])}}}return this._funcArgsAddOriginName(o,n[D].args,I),y||z.UNDETERMINED}_funcArgsAddOriginName(n,o,s){const f=n.params||[];for(const[p,y]of o.entries())p<f.length&&(f[p].originName=y.name);if(s==="input"){const p=f[0]||n.defval;Object.assign(n,{inputType:{name:`'${p!=null&&p.isSourceType?"source":this._removePrefix(p==null?void 0:p.type)}'`}})}}_overloadsCheckArgs(n,o,s,f,p){const y={...n},E=y.params;delete y.params;const x=Object.keys(y).length+E.length,D=o.length,T=[],I=[];if(x>D&&!o.some(L=>["arg0, arg1, ...","number0, number1, ..."].includes(L.name)))return T.push({msg:Ne(Ce.argsLenErr,{name:s,lenA:x,lenB:D}),isLenErr:!0,ctx:f}),{errMsg:T,warnMsg:I};for(const[B,L]of o.entries()){let b=y[L.name];if(B<E.length&&(b&&I.push({msg:Ne(Qi.moreSameArg,{arg:L.name}),ctx:f}),b=E[B]),!b)L.required&&T.push({msg:Ne(Ce.requiredParamErr,{name:s,argName:L.name}),ctx:f});else{const _=b.type!==`${z.SIMPLE} na`?this._checkArg(b,L,s,p,b.ctx,!0):"";_&&T.push({msg:_,ctx:b.ctx}),delete y[L.name]}if(["arg0, arg1, ...","number0, number1, ..."].includes(L.name)&&E.length>B+1){const _=E.slice(B+1);let g=E[B];for(const O of _){g.type===`${z.SIMPLE} ${z.NA}`&&(g=O);const R=O.type!==`${z.SIMPLE} ${z.NA}`?this._checkArg(O,L,s,g,O.ctx,!0):"";R&&T.push({msg:R,ctx:O.ctx})}}}if(Object.keys(y).length)for(const B of Object.keys(y))T.push({msg:Ne(Ce.argsNameErr,{name:s,argName:B}),ctx:y[B].ctx});return{errMsg:T,warnMsg:I}}_checkArgs(n,o,s,f,p,y){var L;const E={...n},x=E.params;delete E.params;const D=Object.keys(E).length+x.length,T=o.length;let I=!1,B=[];if(D>T&&!o.some(_=>["arg0, arg1, ...","number0, number1, ..."].includes(_.name)))return this._errorHandle(Ne(Ce.argsLenErr,{name:s,lenA:D,lenB:T}),f),I=!0,{hasErr:I,types:B};for(const[b,_]of o.entries()){let g=E[_.name];if(b<x.length&&(g&&this._errorHandle(Ne(Qi.moreSameArg,{arg:_.name}),f,ar.Warning),g=x[b],g.originName=_.name),!g)_.required&&(this._errorHandle(Ne(Ce.requiredParamErr,{name:s,argName:_.name}),f),I=!0);else{const O=g.type!==`${z.SIMPLE} ${z.NA}`?this._checkArg(g,_,s,y,g.ctx):"";if(O)this._errorHandle(O,g.ctx),I=!0;else if(O===!1)I=!0;else if(s.startsWith("request.")&&_.name==="expression")if(g.ruleType===pe.Brackethesized)B=g.exprs.map(R=>this._typeReplace(p,R.type));else if((L=g.types||g.returnedTypes)!=null&&L.isBrackethesized)B=(g.types||g.returnedTypes).map(R=>this._typeReplace(p,R));else{const R=this._typeReplace(p,g.type);B.push(R)}delete E[_.name]}}if(Object.keys(E).length)for(const b of Object.keys(E))this._errorHandle(Ne(Ce.argsNameErr,{name:s,argName:b}),E[b].ctx),I=!0;return{hasErr:I,types:B}}_checkArg(n,o,s,f,p,y){const{ruleType:E,exprs:x,name:D}=n;let T=n.type;E===pe.Brackethesized&&(T=`[${x.map(b=>b.type).join(", ")}]`);const{allowedTypeIDs:I=[],displayType:B,name:L}=o;if(!(!T||T===z.UNDETERMINED||B===z.UNDETERMINED)){if(s==="input"&&L==="defval"&&!T.startsWith(z.CONST))if(Sl.includes(D))n.isSourceType=!0;else return Ce.inputDefvalErr;if(!(this._checkMethodThisType(I,this._arrayTypeConvert(T))&&!(s==="input.source"&&L==="defval"))){if(L==="condition"&&(B!=null&&B.endsWith(z.BOOL))&&(T.endsWith(z.INT)||T.endsWith(z.FLOAT))){p&&this._errorHandle(Ne(Qi.typeMismatch,{index:L,operator:s,type:z.BOOL}),p,ar.Warning);return}switch(B){case"tuple of const string values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.STRING}`],s,T);case"tuple of const int/float values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.FLOAT}`,`${z.CONST} ${z.INT}`],s,T);case"tuple of const int values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.INT}`],s,T);case"open/high/low/close/hl2/hlc3/ohlc4/hlcc4":if(!D||!Sl.includes(D))return Ne(Ce.inputSourceErr,{name:L,funcName:s});if(this._judgeVarBuildIn(D))return Ne(Ce.buildInUseErr,{name:D});n.isSourceType=!0;break;case"<matrix_type>":case"<array_type>":const b=this._getArrayType(s)||"";if(!T.endsWith(b)&&!(T.endsWith(z.INT)&&b===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(b)});break;case"any matrix type":if(this._isMatrixType(T)){if(L==="id2"){const C=this._getArrayType(f==null?void 0:f.type);if(!C)return;const j=this._getArrayType(T)||"";if(C!==j)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:j,typeR:C})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"matrix<fun_arg>"});break;case"any array type":if(this._isArrayType(T)){if(L==="id2"){const C=this._getArrayType(f==null?void 0:f.type);if(!C)return;const j=this._getArrayType(T)||"";if(C!==j)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:j,typeR:C})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"array<fun_arg>"});break;case"series <type of the matrix's elements>":case"series <type of the array's elements>":const _=this._getArrayType(f==null?void 0:f.type)||"";if(!T.endsWith(_)&&!(T.endsWith(z.INT)&&_===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(_)});break;case"any map type":if(this._isMapType(T)){if(L==="id2"){const C=this._getMapType(f==null?void 0:f.type);if(!C)return;const j=this._getMapType(T)||[];if(C[0]!==j[0]||C[1]!==j[1])return Ne(Ce.mapKeyValErr,{typeA:this._typeAddSeries(j[0]),typeB:this._typeAddSeries(j[1]),typeC:this._typeAddSeries(C[0]),typeD:this._typeAddSeries(C[1]),name:s})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"map<type, type>"});break;case"series <type of the map's elements>":const g=this._getMapType(f==null?void 0:f.type);if(!g)return;const O=L==="key"?0:1;if(!T.endsWith(g[O])&&!(T.endsWith(z.INT)&&g[O]===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(g[O])});break;case"<arg_expr_type>":if(E===pe.Brackethesized)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:B||""});break;case"<arg_type>":case"variable, function, object, array or matrix of series int/float/bool/string/color, or a tuple of these":break;case"variable, object or function of series int/float/bool/string/color, or a tuple of these":if(E===pe.Brackethesized){for(const C of x)if(!I.includes(C.type))return this._errorHandle(Ne(Ce.requestArgsErr,{name:s,argName:L,type:C.type}),C.ctx),!1}break;case"const int/float/bool/string/color or source-type built-ins":if(Sl.includes(n.name)&&I[0].endsWith(this._removePrefix(T)))n.isSourceType=!0;else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"const int/float/bool/string/color"});break;case"<arg..._type>":if(E===pe.Brackethesized||this._isArrayType(T)||this._isMapType(T)||this._isMatrixType(T))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:`${z.SERIES} ${z.INT}`});if(T!==(f==null?void 0:f.type))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:f==null?void 0:f.type});break;default:const R=this._removePrefix(n.type);if(n.arg&&n.arg.isArg&&!y){const C=I.find(j=>j.endsWith(R));if(C){n.type=C,n.arg.type=C;return}}if(I.length===1&&I[0].endsWith(R)){const C=this._getPrefix(n.type),j=this._getPrefix(I[0]);if(Ni.indexOf(C)>=Ni.indexOf(j))return}return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:B||""})}}}}_tupleToCheck(n,o,s,f,p){var y,E;if(s.push(`${z.SIMPLE} ${z.NA}`),n.ruleType===pe.Brackethesized){const x=[];let D=!1;for(const T of n.exprs)x.push(T.type),s.includes(T.type)||(D=!0);if(D)return Ne(Ce.typeMismatch,{operator:f,index:o.name,typeE:`[${x.join(", ")}]`,typeR:((y=o.allowedTypeIDs)==null?void 0:y[0])||""})}else return Ne(Ce.typeMismatch,{operator:f,index:o.name,typeE:p,typeR:((E=o.allowedTypeIDs)==null?void 0:E[0])||""})}_getBlockReturnTypes(n){var I,B;let o=n;if(Array.isArray(n)&&(o=n.slice(-1)[0],Array.isArray(o)&&(o=o.slice(-1)[0])),!o)return[z.UNDETERMINED];const{ruleType:s,type:f,types:p,returnedTypes:y,exprs:E,nameList:x,typeList:D,block:T}=o;if(p&&p.length)return p;if(y&&y.length)return y;if(f)return[f];switch(s){case pe.Brackethesized:const L=E.map(re=>re.type);return L.isBrackethesized=!0,L;case pe.VarBlockStmt:case pe.DeclareAssign:return x?x.ruleType===pe.VarMultiple?x.types:[x.type]:[((I=o.name)==null?void 0:I.type)||z.UNDETERMINED];case pe.SwitchStatement:if(!this._isNeedCalc&&this._isInFunc&&this._isEndExpr===!1)return[z.UNDETERMINED];const b=[...o.cases];o.defaultCase&&b.push(o.defaultCase);let _=((B=b[0])==null?void 0:B.returnedTypes)||[],g=_.length<=1?_[0]:`[${_.join(", ")}]`,O=null;for(const re of b.slice(1)){const K=re.returnedTypes||[z.UNDETERMINED];g+=K.length<=1?`; ${K[0]}`:`; [${K.join(", ")}]`;const Y=Array.isArray(re.block)?re.block.slice(-1)[0]:re.block;if(K.length!==_.length)O=Y.ctx;else for(const[G,ce]of _.entries())if(this._compareType(K[G],ce))(K[G].includes(z.FLOAT)&&!ce.includes(z.FLOAT)||_[G]===`${z.SIMPLE} ${z.NA}`||_[G]===z.UNDETERMINED)&&(_[G]=K[G]);else{O=Y.ctx;break}}return O&&(this._errorHandle(Ne(Ce.ifOrSwitchTypeErr,{keyword:"switch",types:g}),O),_=_.map(()=>z.UNDETERMINED)),o.returnedTypes=_,_;case pe.IfStatement:if(!this._isNeedCalc&&!this._isInFunc)return[z.UNDETERMINED];if(!D.filter(re=>re&&re.length).length)return[z.UNDETERMINED];let R=D[0]||[],C=R.length<=1?R[0]:`[${R.join(", ")}]`,j=0,X=0;for(const re of D.slice(1))if(re)if(j++,C+=re.length<=1?`; ${re[0]}`:`; [${re.join(", ")}]`,re.length!==R.length)X=j;else for(const[K,Y]of R.entries())if(this._compareType(re[K],Y))(re[K].includes(z.FLOAT)&&!Y.includes(z.FLOAT)||R[K]===`${z.SIMPLE} ${z.NA}`)&&(R[K]=re[K]);else{X=j;break}if(X){const re=T[X].slice(-1)[0],K=Array.isArray(re)?re.slice(-1)[0]:re;this._errorHandle(Ne(Ce.ifOrSwitchTypeErr,{keyword:"if",types:C}),K.ctx),R=R.map(()=>z.UNDETERMINED)}return o.returnedTypes=R,R}return[z.UNDETERMINED]}}class B_{constructor(e){k(this,"_nameMap");k(this,"_prefixNameVar");k(this,"_prefixNameFunc");k(this,"_prefixNameConst");k(this,"_userTypes");k(this,"_isInFunc");k(this,"_varlist");k(this,"_memberIndexList");k(this,"_blockCount");k(this,"_inputCount");this._nameMap=new Map,this._prefixNameVar=`${e}_var`,this._prefixNameFunc=`${e}_func`,this._prefixNameConst=`${e}_const`,this._userTypes=[],this._isInFunc=!1,this._varlist=[{}],this._memberIndexList=[{}],this._blockCount=0,this._inputCount=0}preParser(e){var o,s;const n=[];for(const f of e){if(!f)return;if(Array.isArray(f)){for(const p of f)if(n.push(this._parserStmt(p)),vl.includes((s=(o=p.exprs)==null?void 0:o[0])==null?void 0:s.name))return n.join(`;
|
14
14
|
`).replace(/;+/g,";")}else n.push(this._parserStmt(f))}return""}parser(e){const n=[];for(const s of e){if(!s)return;if(Array.isArray(s))for(const f of s)n.push(this._parserStmt(f));else n.push(this._parserStmt(s))}const o=this._memberIndexList[this._blockCount]||{};return n.push(...Object.values(o)),n.join(`;
|
@@ -114,13 +114,16 @@ ${this._prefixNameVar}.againAssignParse(${y}, ${T});
|
|
114
114
|
|
115
115
|
$_result = ${o}`}_getMembersCode(){const e=this._memberIndexList[this._blockCount]||{};return Object.values(e).join(`;
|
116
116
|
`)}_parserArrowMethod(e){let n=`$_${e.name}`;this._nameMap.set(e.name,n);const o=e.index?`$${e.index}`:"";n=`${n}${o}`,e.isExport&&this._exportEles.push({key:`${e.name}${o}`,name:n});const s=[...e.params];e.hasMemberIndex&&s.push({name:`${this._prefixNameVar}_position`});let f=`const ${n} = (${this._parserParameters(s)}posStr) => {
|
117
|
+
if (posStr.startsWith('export')) return;
|
117
118
|
${this._parserBlock(e.block,!0,!0)}
|
118
119
|
}`;if(this._userTypes.includes(e.typeName)){let p=e.typeName;Bn.includes(p)&&(p=`$${p}`),f=`${f}
|
119
120
|
${p}.addNewMethod("${e.name}${o}", function (${this._parserParameters(s.slice(1))}posStr) {
|
121
|
+
if (posStr.startsWith('export')) return;
|
120
122
|
const ${s[0].name} = this;
|
121
123
|
${this._parserBlock(e.block,!0,!0)}
|
122
124
|
})
|
123
125
|
`}return this._isInFunc=!1,f}_parserArrowFunction(e){let n=`$_${e.name}`;this._nameMap.set(e.name,n);const o=e.index?`$${e.index}`:"";n=`${n}${o}`,e.isExport&&this._exportEles.push({key:`${e.name}${o}`,name:n});const s=[...e.params];e.hasMemberIndex&&s.push({name:`${this._prefixNameVar}_position`});const f=`const ${n} = (${this._parserParameters(s)}posStr) => {
|
126
|
+
if (posStr.startsWith('export')) return;
|
124
127
|
${this._parserBlock(e.block,!0,!0)}
|
125
128
|
}`;return this._isInFunc=!1,f}_parserParameters(e){return e.length?`{${e.map(n=>{const{name:o,defaultValue:s}=n;let f=o;if(s){const p=this._parserSingleExpression(s);f=`${f} = ${p}`}return f}).join(", ")}},`:""}_parserBlock(e,n=!1,o=!1){return o&&(this._isInFunc=!0),this._parserBlockLine(Array.isArray(e)?e:[e],n,o)}_parserDeclareAssign(e){const{nameList:n,value:o}=e,s=this._parserDeclareAssignNames(n),f=this._varlist[this._blockCount]||{};if(n.name==="_")return"";if(n.names)for(const[y,E]of n.names.entries())f[E]=n.posList[y];else f[n.name]=n.pos;this._varlist[this._blockCount]=f;const p=this._parserSingleExpression(o);if(n.declare){const y=`${n.pos.column}_${n.pos.lineNumber}`,E=this._isInFunc?`posStr + '_' + '${y}'`:`"export_${this._libTitle}_${y}"`;return`let ${s} = ${this._prefixNameVar}.getVarValue("${s}", ${E}, "${n.declare}") || ${this._prefixNameVar}.setVarValue("${s}", ${E}, ${p}, "${n.declare}")`}return`let ${s} = ${p}`}_parserDeclareAssignNames(e){switch(e==null?void 0:e.ruleType){case"VarMultiple":return`[${e.names.map(n=>Bn.includes(n)?`$${n}`:n).join(", ")}]`;case"VarSingle":return Bn.includes(e.name)?`$${e.name}`:e.name}return""}_parserSingleExpression(e){if(!e)return"";const{exprs:n,operator:o}=e;switch(e.ruleType){case pe.MemberIndexExpression:return this._parserMemberIndexExpression(e);case pe.MethodExpression:return this._parserMethodExpression(e);case pe.UnaryExpression:return`${o}${this._parserSingleExpression(n[0])}`;case pe.NotExpression:return`!${this._parserSingleExpression(n[0])}`;case pe.AdditiveExpression:return this._parserAdditiveExpression(e);case pe.MultiplicativeExpression:case pe.RelationalExpression:case pe.EqualityExpression:return`${this._parserSingleExpression(n[0])} ${o} ${this._parserSingleExpression(n[1])}`;case pe.LogicalAndExpression:return`${this._parserSingleExpression(n[0])} && ${this._parserSingleExpression(n[1])}`;case pe.LogicalOrExpression:return`${this._parserSingleExpression(n[0])} || ${this._parserSingleExpression(n[1])}`;case pe.TernaryExpression:return`${this._parserSingleExpression(n[0])} ? ${this._parserSingleExpression(n[1])} : ${this._parserSingleExpression(n[2])}`;case pe.Name:return this._parserName(e);case pe.Literal:return this._parseLiteral(e);case pe.ParenthesizedExpression:return`(${this._parserSingleExpression(e.exprs)})`;default:return e.name||""}}_parserAdditiveExpression(e){const{exprs:n,operator:o}=e,s=this._parserSingleExpression(n[0]),f=this._parserSingleExpression(n[1]);return o==="-"?`${this._prefixNameVar}.sub(${s}, ${f})`:`${this._prefixNameVar}.add(${s}, ${f})`}_parserMemberIndexExpression(e){const{exprs:n,isInFunc:o,ctx:s}=e,f=n[0],p=this._parserSingleExpression(n[1]);if(f.ruleType===pe.Name&&!f.hasMethod){let D=this._blockCount;const T=f.name;for(;D>=0;){const I=this._varlist[D]||{},B=I[T];if(B)return this._getUserVarMemberIndexs(B,T,D,p,o);if(f.isBuiltIn){const L=this._parserSingleExpression(f),b=this._memberIndexList[0]||{};return b[T]=`${this._prefixNameVar}.setCacheData('${T}', ${L})`,`${this._prefixNameVar}.getCacheData('${T}', ${p}, ${L})`}else if(T.includes(".")){const L=T.split(".")[0],b=I[L];if(b)return this._getUserVarMemberIndexs(b,T,D,p,o)}D--}}const y=s.start.tokenIndex,E=this._parserSingleExpression(f),x=o?`${this._prefixNameVar}_position`:y;return`${this._prefixNameVar}.getCacheData('m${y}_' + ${x}, ${p}, ${E})`}_getUserVarMemberIndexs(e,n,o,s,f){const p=this._memberIndexList[o]||{};let y=`${n}_${e.lineNumber}_${e.column}`;return y=f&&o!==0?`'${y}' + '_' + posStr`:`'${y}'`,p[y]=`${this._prefixNameVar}.setCacheData(${y}, ${n})`,this._memberIndexList[o]=p,`${this._prefixNameVar}.getCacheData(${y}, ${s}, ${n})`}_parseLiteral(e){return e.type.endsWith(z.COLOR)?`"${this._colorToRgba(e.value)}"`:e.value}_colorToRgba(e){if(e.startsWith("#")){let n;const o=parseInt(e.substring(1,3),16),s=parseInt(e.substring(3,5),16),f=parseInt(e.substring(5,7),16),p=e.substring(7);return p?n=(255-parseInt(p,16))/255:n=1,`rgba(${Math.round(o)}, ${Math.round(s)}, ${Math.round(f)}, ${n.toFixed(2)})`}return e}_parserName(e){const{exprs:n,ctx:o}=e,{column:s,line:f}=(o==null?void 0:o.start)||{},p=this._isInFunc?`${f}_${s}`:`export_${this._libTitle}_${f}_${s}`,y=n.map(E=>typeof E=="string"?E:this._parserMethodElement(E,p));return e.expr&&y.unshift(`(${this._parserSingleExpression(e.expr)})`),e.isBuiltIn?(y.join(".")==="strategy.opentrades"&&y.push("opentrades"),y.unshift(e.isConst?this._prefixNameConst:this._prefixNameVar)):Bn.includes(y[0])&&(y[0]=`$${y[0]}`),y.join(".")}_parserMethodExpression(e){const{exprs:n,ctx:o}=e,{column:s,line:f}=o.start,p=`${f}_${s}`,y=this._isInFunc?`posStr + "_${p}"`:`"export_${this._libTitle}_${p}"`,E=n.map(x=>this._parserMethodElement(x,y));return E.length===1&&[...El,$o.library].some(x=>E[0].startsWith(`${this._prefixNameFunc}.${x}`))?"":E.join(".")}_parserMethodElement(e,n){let o="",s="";const f={...e.args};if(e.hasMemberIndex&&(s=`${this._prefixNameVar}_position: ${e.position}`),e.expr&&(o=`(${this._parserSingleExpression(e.expr)})`),o=o?`${o}.${e.name}`:this._nameMap.get(e.name)||e.name,e.isBuiltIn){if(wp.includes(o))o=`${o}.${o}`;else if(o==="max_bars_back"){const{name:y,varPos:E}=f.var||f.params[0];s=`var_name: '${E?`${y}_${E.lineNumber}_${E.column}`:y}'`}o.startsWith(z.INPUT)&&(s=`index: ${this._inputCount}`,this._inputCount++),o=`${this._prefixNameFunc}.${o}`}else{const y=o.split(".");Bn.includes(y[0])&&(y[0]=`$${y[0]}`,o=y.join("."))}if(e.selfArg){const y=o.split("."),E=y.length;Object.assign(f,{[e.selfArg.name]:{name:y.slice(0,E-1).join(".")}}),o=y[E-1],o=this._nameMap.get(o)||o}o=`${o}${e.index?`$${e.index}`:""}`;const p=this._parserArguments(f,s,n);return o+p}_parserArguments(e,n,o){const s=e.params||[];delete e.params;const f=[],p=[],y=[];for(const E of s){const x=E.ruleType===pe.Brackethesized?this._parserBrackethesized(E):this._parserSingleExpression(E);E.originName&&!["arg0, arg1, ...","number0, number1, ..."].includes(E.originName)?(f.push(`${E.originName}: ${x}`),E.isSourceType?f.push(`sourceTypeName: '${E.name}'`):E.type===`${z.SERIES} ${z.COLOR}`&&y.push(`'${E.originName}'`)):p.push(x)}for(const E of Object.keys(e)){const x=e[E],D=x.ruleType===pe.Brackethesized?this._parserBrackethesized(x):this._parserSingleExpression(x);f.push(`${E}: ${D}`),x.type===`${z.SERIES} ${z.COLOR}`&&y.push(`'${E}'`)}return y.length&&f.push(`seriesColors: [${y.join(",")}]`),n&&f.push(n),p.length?`({${f.join(", ")}}, [${p.join(", ")}], ${o})`:f.length?`({${f.join(", ")}}, ${o})`:`(${o})`}_parserBrackethesized(e){return`[${e.exprs.map(o=>this._parserSingleExpression(o)).join(", ")}]`}_functionalProcess(e){return`(function () {
|
126
129
|
let $_result=undefined;
|