1 line
46 KiB
JavaScript
1 line
46 KiB
JavaScript
(function () {var Da={};function Hb(r,e){var o={destCol:1,srcCol:1,srcLine:1};r.forEach(function(r){r.destCol>e||(o=r)});var $=e-o.destCol;return{column:o.srcCol+$,line:o.srcLine}}Object.defineProperty(Da,"__esModule",{value:!0});var Ea=Hb;function Ib(r){for(var e=[],o=1,$="",s=0,t=!1,c=!1,n=!1,p=0;p<r.length;p++){var a=r[p];if(n){var j=$.length+1,l=p-s+1;e.push({destCol:j,srcCol:l,srcLine:o}),n=!1}"\n"===a?(t=!1,o++,s=p+1,n=!0):"\r"===a&&"\n"===r[p+1]?(t=!1,o++,s=++p+1,n=!0):c&&"*"===a&&"/"===r[p+1]?(c=!1,p++,n=!0):"\\"===a&&"\\"===r[p+1]||"/"===a&&"/"===r[p+1]?(t=!0,p++):"/"===a&&"*"===r[p+1]?(c=!0,p++):t||c||($+=a)}return[$,e]}Da.getLoc=Ea;var Za=Ib;Da.preProcess=Za;var ma,na,Jb={},Q=Jb={};function Fa(){throw new Error("setTimeout has not been defined")}function Ga(){throw new Error("clearTimeout has not been defined")}function $a($){if(ma===setTimeout)return setTimeout($,0);if((ma===Fa||!ma)&&setTimeout)return ma=setTimeout,setTimeout($,0);try{return ma($,0)}catch(e){try{return ma.call(null,$,0)}catch(e){return ma.call(this,$,0)}}}function Kb($){if(na===clearTimeout)return clearTimeout($);if((na===Ga||!na)&&clearTimeout)return na=clearTimeout,clearTimeout($);try{return na($)}catch(e){try{return na.call(null,$)}catch(e){return na.call(this,$)}}}!function(){try{ma="function"==typeof setTimeout?setTimeout:Fa}catch($){ma=Fa}try{na="function"==typeof clearTimeout?clearTimeout:Ga}catch($){na=Ga}}();var sa,ka=[],Ha=!1,_a=-1;function Lb(){Ha&&sa&&(Ha=!1,sa.length?ka=sa.concat(ka):_a=-1,ka.length&&ab())}function ab(){if(!Ha){var $=$a(Lb);Ha=!0;for(var e=ka.length;e;){for(sa=ka,ka=[];++_a<e;)sa&&sa[_a].run();_a=-1,e=ka.length}sa=null,Ha=!1,Kb($)}}function bb($,e){this.fun=$,this.array=e}function da(){}Q.nextTick=function($){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];ka.push(new bb($,e)),1!==ka.length||Ha||$a(ab)},bb.prototype.run=function(){this.fun.apply(null,this.array)},Q.title="browser",Q.env={},Q.argv=[],Q.version="",Q.versions={},Q.on=da,Q.addListener=da,Q.once=da,Q.off=da,Q.removeListener=da,Q.removeAllListeners=da,Q.emit=da,Q.prependListener=da,Q.prependOnceListener=da,Q.listeners=function($){return[]},Q.binding=function($){throw new Error("process.binding is not supported")},Q.cwd=function(){return"/"},Q.chdir=function($){throw new Error("process.chdir is not supported")},Q.umask=function(){return 0};var Mb=function(){var t={exports:this},i=function(){var t=function(t,e,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=e);return i},e=[1,18],i=[1,7],s=[1,19],n=[1,20],r=[1,14],h=[1,15],o=[1,16],a=[1,33],c=[1,31],l=[1,23],y=[1,22],u=[1,24],p=[1,25],_=[1,26],f=[1,27],g=[1,28],m=[1,29],E=[1,30],k=[5,8,15,18,20,28,29,32,33,34,35,36,37,38],I=[5,15,18],b=[5,12,15,17,18,24,25,28,29,30],S=[1,57],d=[5,8,12,15,17,18,24,25,28,29,30],N=[15,18],O=[5,8,15,18,28,29,38],$=[5,8,15,18,28,29,32,33,38],x=[5,8,15,18,28,29,32,33,34,37,38],A=[5,8,15,18,28,29,32,33,34,35,36,37,38],R=[5,8,15,18],v=[5,8,15,18,20,22,28,29,32,33,34,35,36,37,38],T={trace:function(){},yy:{},symbols_:{error:2,SCRIPT:3,expression:4,EOF:5,expressionsOptionalTrailingSemi:6,separator:7,";":8,expressions:9,EXPRESSION_BLOCK:10,IDENTIFIER:11,IDENTIFIER_TOKEN:12,argument:13,arguments:14,",":15,FUNCTION_CALL:16,"(":17,")":18,LOGICAL_EXPRESSION:19,LOGICAL_OPERATOR_TOKEN:20,ASSIGNMENT:21,ASSIGNMENT_OPERATOR_TOKEN:22,number:23,DIGITS_TOKEN:24,".":25,NUMBER_LITERAL:26,UNARY_EXPRESSION:27,"-":28,"+":29,"!":30,BINARY_EXPRESSION:31,"*":32,"/":33,"%":34,"&":35,"|":36,"^":37,COMPARISON_TOKEN:38,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:";",12:"IDENTIFIER_TOKEN",15:",",17:"(",18:")",20:"LOGICAL_OPERATOR_TOKEN",22:"ASSIGNMENT_OPERATOR_TOKEN",24:"DIGITS_TOKEN",25:".",28:"-",29:"+",30:"!",32:"*",33:"/",34:"%",35:"&",36:"|",37:"^",38:"COMPARISON_TOKEN"},productions_:[0,[3,2],[3,2],[3,1],[7,1],[7,2],[9,2],[9,3],[6,1],[6,2],[10,1],[11,1],[13,1],[13,1],[14,1],[14,3],[16,3],[16,4],[19,3],[21,3],[21,3],[23,1],[23,2],[23,3],[23,2],[23,1],[26,1],[27,2],[27,2],[27,2],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[4,1],[4,1],[4,3],[4,1],[4,1],[4,1],[4,1],[4,1],[4,3]],performAction:function(t,e,i,s,n,r,h){var o=r.length-1;switch(n){case 1:return{type:"SCRIPT",body:[r[o-1]],loc:this._$};case 2:return{type:"SCRIPT",body:r[o-1],loc:this._$};case 3:return{type:"SCRIPT",body:[],loc:this._$};case 6:this.$=[r[o-1]];break;case 7:this.$=r[o-2].concat([r[o-1]]);break;case 8:this.$=r[o];break;case 9:this.$=r[o-1].concat([r[o]]);break;case 10:this.$={type:"EXPRESSION_BLOCK",body:r[o],loc:this._$};break;case 11:this.$={type:"IDENTIFIER",value:r[o].toLowerCase(),loc:this._$};break;case 14:this.$=[r[o]];break;case 15:this.$=r[o-2].concat([r[o]]);break;case 16:this.$={type:"CALL_EXPRESSION",callee:r[o-2],arguments:[],loc:this._$};break;case 17:this.$={type:"CALL_EXPRESSION",callee:r[o-3],arguments:r[o-1],loc:this._$};break;case 18:this.$={type:"LOGICAL_EXPRESSION",left:r[o-2],right:r[o],operator:r[o-1],loc:this._$};break;case 19:case 20:this.$={type:"ASSIGNMENT_EXPRESSION",left:r[o-2],operator:r[o-1],right:r[o],loc:this._$};break;case 21:this.$=Number(r[o]);break;case 22:this.$=Number(r[o-1]);break;case 23:this.$=Number(r[o-2]+r[o-1]+r[o]);break;case 24:this.$=Number("0"+r[o-1]+r[o]);break;case 25:this.$=0;break;case 26:this.$={type:"NUMBER_LITERAL",value:r[o],loc:this._$};break;case 27:case 28:case 29:this.$={type:"UNARY_EXPRESSION",value:r[o],operator:r[o-1],loc:this._$};break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:this.$={type:"BINARY_EXPRESSION",left:r[o-2],right:r[o],operator:r[o-1],loc:this._$};break;case 41:case 47:this.$=r[o-1];}},table:[{3:1,4:2,5:[1,4],6:3,9:13,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{1:[3]},{5:[1,21],7:32,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E},{5:[1,34]},{1:[2,3]},t(k,[2,39]),t(k,[2,40]),{4:35,6:37,9:13,10:36,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(k,[2,42]),t(k,[2,43]),t(k,[2,44],{22:[1,38]}),t(k,[2,45],{17:[1,40],22:[1,39]}),t(k,[2,46]),t(I,[2,8],{31:5,27:6,26:8,21:9,16:10,11:11,19:12,23:17,4:41,12:e,17:i,24:s,25:n,28:r,29:h,30:o}),{4:42,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:43,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:44,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(k,[2,26]),t([5,8,15,17,18,20,22,28,29,32,33,34,35,36,37,38],[2,11]),t(k,[2,21],{25:[1,45]}),t(k,[2,25],{24:[1,46]}),{1:[2,1]},{4:47,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:48,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:49,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:50,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:51,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:52,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:53,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:54,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:55,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:56,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(b,[2,6],{8:S}),t(d,[2,4]),{1:[2,2]},{7:32,8:a,18:[1,58],20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E},{18:[1,59]},t(N,[2,10]),{4:60,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:61,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:65,6:37,9:13,10:66,11:11,12:e,13:64,14:63,16:10,17:i,18:[1,62],19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(I,[2,9],{7:67,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(O,[2,27],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,28],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,29],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(k,[2,22],{24:[1,68]}),t(k,[2,24]),t(O,[2,30],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,31],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t($,[2,32],{20:c,34:_,35:f,36:g,37:m}),t($,[2,33],{20:c,34:_,35:f,36:g,37:m}),t(x,[2,34],{20:c,35:f,36:g}),t(A,[2,35],{20:c}),t(A,[2,36],{20:c}),t(x,[2,37],{20:c,35:f,36:g}),t(R,[2,38],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(k,[2,18]),t(d,[2,5]),t(k,[2,41]),t(k,[2,47]),t(R,[2,20],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(R,[2,19],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(v,[2,16]),{15:[1,70],18:[1,69]},t(N,[2,14]),t(N,[2,12],{7:32,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(N,[2,13]),t(b,[2,7],{8:S}),t(k,[2,23]),t(v,[2,17]),{4:65,6:37,9:13,10:66,11:11,12:e,13:71,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(N,[2,15])],defaultActions:{4:[2,3],21:[2,1],34:[2,2]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],s=[null],n=[],r=this.table,h="",o=0,a=0,c=0,l=n.slice.call(arguments,1),y=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);y.setInput(t,u.yy),u.yy.lexer=y,u.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var _=y.yylloc;n.push(_);var f=y.options&&y.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,m,E,k,I,b,S,d,N,O=function(){var t;return"number"!=typeof(t=y.lex()||1)&&(t=e.symbols_[t]||t),t},$={};;){if(E=i[i.length-1],this.defaultActions[E]?k=this.defaultActions[E]:(null==g&&(g=O()),k=r[E]&&r[E][g]),void 0===k||!k.length||!k[0]){var x="";for(b in N=[],r[E])this.terminals_[b]&&b>2&&N.push("'"+this.terminals_[b]+"'");x=y.showPosition?"Parse error on line "+(o+1)+":\n"+y.showPosition()+"\nExpecting "+N.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(x,{text:y.match,token:this.terminals_[g]||g,line:y.yylineno,loc:_,expected:N})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+g);switch(k[0]){case 1:i.push(g),s.push(y.yytext),n.push(y.yylloc),i.push(k[1]),g=null,m?(g=m,m=null):(a=y.yyleng,h=y.yytext,o=y.yylineno,_=y.yylloc,c>0&&c--);break;case 2:if(S=this.productions_[k[1]][1],$.$=s[s.length-S],$._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},f&&($._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(I=this.performAction.apply($,[h,a,o,u.yy,k[1],s,n].concat(l))))return I;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[k[1]][0]),s.push($.$),n.push($._$),d=r[i[i.length-2]][i[i.length-1]],i.push(d);break;case 3:return!0;}}return!0}},P={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,s,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,s){switch(i){case 0:break;case 1:return 24;case 2:return 38;case 3:return 22;case 4:return 20;case 5:return 12;case 6:return 5;case 7:return e.yytext[0];}},rules:[/^(?:\s+)/,/^(?:[0-9]+)/,/^(?:(==|!=|<=|>=|<|>))/,/^(?:[+\-*/%]?=)/,/^(?:(\&\&)|\|\|)/,/^(?:[a-zA-Z_][a-zA-Z0-9._]*)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};function L(){this.yy={}}return T.lexer=P,L.prototype=T,T.Parser=L,new L}();return"undefined"!=typeof require&&void 0!==this&&(this.parser=i,this.Parser=i.Parser,this.parse=function(){return i.parse.apply(i,arguments)},this.main=function(){},void 0!==t&&require.main===t&&this.main(Jb.argv.slice(1))),t.exports}.call({});var Nb={};Nb={parse:Mb.parse};function cb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function db(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?cb(Object(t),!0).forEach(function(r){Ia(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cb(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function Ia(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Ob={ASSIGNMENT_EXPRESSION:[{type:"NODE",key:"right"}],SCRIPT:[{type:"ARRAY",key:"body"}],EXPRESSION_BLOCK:[{type:"ARRAY",key:"body"}],UNARY_EXPRESSION:[{type:"NODE",key:"value"}],NUMBER_LITERAL:[],IDENTIFIER:[],CALL_EXPRESSION:[{type:"ARRAY",key:"arguments"},{type:"NODE",key:"callee"}],BINARY_EXPRESSION:[{type:"NODE",key:"left"},{type:"NODE",key:"right"}],LOGICAL_EXPRESSION:[{type:"NODE",key:"left"},{type:"NODE",key:"right"}]};function Ja(e,r){var t=Ob[e.type],n=e;if(null==t)throw new Error("Unknown children definition for ".concat(e.type));return t.forEach(function(t){if("NODE"===t.type){var o=e[t.key],$=Ja(o,r);$!==o&&(n=db({},n,Ia({},t.key,$)))}else if("ARRAY"===t.type){var p=e[t.key],y=p.map(function(e){return Ja(e,r)});p.some(function(e,r){return e!==y[r]})&&(n=db({},n,Ia({},t.key,y)))}}),r(n)}var ga={};function Pb(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function eb(n,r){for(var e=0;e<r.length;e++){var t=r[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}function Qb(n,r,e){return r&&eb(n.prototype,r),e&&eb(n,e),n}function Rb(n,r){for(var e=[],t=0;t<n.length;t++){e.push(n[t]),t===n.length-1||e.push(r)}return e}Object.defineProperty(ga,"__esModule",{value:!0});var fb=Rb;function Sb(n){return[].concat.apply([],n)}ga.arrayJoin=fb;var ta=Sb;function Tb(n,r){return new Array(n).fill(null).map(function(n,e){return r(e)})}ga.flatten=ta;var Ub=Tb;function Vb(n,r){return new Array(n).fill(r).join("")}ga.times=Ub;var Ka=Vb;ga.repeat=Ka;var Wb=function(){function n(){Pb(this,n),this._map=new Map}return Qb(n,[{key:"get",value:function(n,r){var e=null==n?r:"".concat(n,"::").concat(r);return this._map.has(e)||this._map.set(e,this._map.size),this._map.get(e)}},{key:"size",value:function(){return this._map.size}}]),n}(),Xb=Wb;function Yb(n){if(0===n.length)throw new Error("Cannot format an empty list");if(1===n.length)return n[0];var r=n.map(function(n){return"\"".concat(n,"\"")}),e=r.pop();return r.join(", ")+" and ".concat(e)}ga.ScopedIdMap=Xb;var Zb=Yb;ga.formatList=Zb;var xa={};function $b(r){return($b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function gb(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function hb(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&La(r,t)}function ib(r){return function(){var t,e=Ma(r);if(jb()){var o=Ma(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return _b(this,t)}}function _b(r,t){return!t||"object"!==$b(t)&&"function"!=typeof t?ac(r):t}function ac(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function bc(r){var t="function"==typeof Map?new Map:void 0;return(bc=function(r){if(null===r||!dc(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,e)}function e(){return cc(r,arguments,Ma(this).constructor)}return e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),La(e,r)})(r)}function cc(r,t,e){return(cc=jb()?Reflect.construct:function(r,t,e){var o=[null];o.push.apply(o,t);var n=new(Function.bind.apply(r,o));return e&&La(n,e.prototype),n}).apply(null,arguments)}function jb(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}function dc(r){return-1!==Function.toString.call(r).indexOf("[native code]")}function La(r,t){return(La=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r})(r,t)}function Ma(r){return(Ma=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}Object.defineProperty(xa,"__esModule",{value:!0});function kb(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=Math.max(r.first_line-1-e,0),n=r.last_line+e,$=t.split("\n").slice(o,n).map(function(t,e){var n=e+o+1,$=n>=r.first_line&&n<=r.last_line;return"".concat($?">":" "," ").concat(n," | ").concat(t)});if(r.first_line===r.last_line){var a=Ka(r.first_column," "),i=Ka(r.last_column-r.first_column,"^"),c=r.first_line-o;$.splice(c,0," | ".concat(a).concat(i))}return $.join("\n")}var ec=kb;xa.printLoc=ec;var lb=function(r){hb(e,bc(Error));var t=ib(e);function e(r,o,n){var $;return gb(this,e),($=t.call(this,r)).sourceContext=kb(o,n),$.loc=o,$}return e}(),fc=function(r){hb(e,lb);var t=ib(e);function e(){return gb(this,e),t.apply(this,arguments)}return e}();function gc(r,t,e){return new fc(r,t,e)}var ha=gc;function hc(r,t,e){return new lb(r,t,e)}xa.createUserError=ha;var ea=hc;xa.createCompilerError=ea;var mb={};function ic(r,e){return mc(r)||lc(r,e)||kc(r,e)||jc()}function jc(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kc(r,e){if(r){if("string"==typeof r)return nb(r,e);var a=Object.prototype.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?nb(r,e):void 0}}function nb(r,e){(null==e||e>r.length)&&(e=r.length);for(var a=0,t=new Array(e);a<e;a++)t[a]=r[a];return t}function lc(r,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var a=[],t=!0,$=!1,o=void 0;try{for(var n,v=r[Symbol.iterator]();!(t=(n=v.next()).done)&&(a.push(n.value),!e||a.length!==e);t=!0);}catch(i){$=!0,o=i}finally{try{t||null==v.return||v.return()}finally{if($)throw o}}return a}}function mc(r){if(Array.isArray(r))return r}Object.defineProperty(mb,"__esModule",{value:!0});function ob(r,e){var a=Ea(e,r.first_column),t=Ea(e,r.last_column);return{first_column:a.column,last_column:t.column,first_line:a.line,last_line:t.line}}function nc(r){var e=ic(Za(r),2),a=e[0],t=e[1];try{var $=Nb.parse(a);return Ja($,function(e){if(1!==e.loc.first_line||1!=e.loc.last_line)throw ea("Unexpected multiline",e.loc,r);return Object.assign(Object.assign({},e),{loc:ob(e.loc,t)})})}catch(o){if(null==o.hash)throw o;throw ha("Parse Error: ".concat(o.message.split("\n")[3]),ob(o.hash.loc,t),r)}}var Na=nc;mb.parse=Na;var Oa={};function oc(a,t){var o,r,$,e=52,p=64-e-1,w=(1<<p)-1,M=w>>1,h=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,c=0,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,o=w):(o=Math.floor(Math.log(t)/Math.LN2),t*($=Math.pow(2,-o))<1&&(o--,$*=2),(t+=o+M>=1?h/$:h*Math.pow(2,1-M))*$>=2&&(o++,$/=2),o+M>=w?(r=0,o=w):o+M>=1?(r=(t*$-1)*Math.pow(2,e),o+=M):(r=t*Math.pow(2,M-1)*Math.pow(2,e),o=0));e>=8;a[0+c]=255&r,c+=1,r/=256,e-=8);for(o=o<<e|r,p+=e;p>0;a[0+c]=255&o,c+=1,o/=256,p-=8);a[0+c-1]|=128*i}Object.defineProperty(Oa,"__esModule",{value:!0});var pc=oc;Oa.write=pc;var K={};function Z(r){return tc(r)||sc(r)||rc(r)||qc()}function qc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rc(r,$){if(r){if("string"==typeof r)return Pa(r,$);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Pa(r,$):void 0}}function sc(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function tc(r){if(Array.isArray(r))return Pa(r)}function Pa(r,$){(null==$||$>r.length)&&($=r.length);for(var e=0,t=new Array($);e<$;e++)t[e]=r[e];return t}var uc=K&&K.__importStar||function(r){if(r&&r.__esModule)return r;var $={};if(null!=r)for(var e in r)Object.hasOwnProperty.call(r,e)&&($[e]=r[e]);return $.default=r,$};Object.defineProperty(K,"__esModule",{value:!0});var vc=uc(Oa),pb=[0,97,115,109];K.MAGIC=pb;var qb=[1,0,0,0];K.WASM_VERSION=qb;var ya=1e-5;K.EPSILON=ya;var ia={TYPE:1,IMPORT:2,FUNC:3,MEMORY:5,GLOBAL:6,EXPORT:7,CODE:10};K.SECTION=ia;var rb={FUNC:0,TABLE:1,MEMORY:2,GLOBAL:3};K.EXPORT_TYPE=rb;var q={block:function(r){return[2,r]},loop:function(r){return[3,r]},if:function(r){return[4,r]},else:5,end:11,br_if:function(r){return[13].concat(Z(aa(r)))},call:function(r){return[16].concat(Z(aa(r)))},drop:26,select:27,local_get:function(r){return[32].concat(Z(aa(r)))},local_set:function(r){return[33].concat(Z(aa(r)))},local_tee:function(r){return[34].concat(Z(aa(r)))},global_get:function(r){return[35].concat(Z(aa(r)))},global_set:function(r){return[36].concat(Z(aa(r)))},f64_load:function(r,$){return[43].concat(Z(aa(r)),Z(aa($)))},f64_store:function(r,$){return[57].concat(Z(aa(r)),Z(aa($)))},i32_const:function(r){return[65].concat(Z(wb(r)))},f64_const:function(r){return[68].concat(Z(vb(r)))},i32_eqz:69,i32_ne:71,i32_lt_s:72,i32_lt_u:73,i32_gt_s:74,i32_le_s:76,i32_le_u:77,i32_ge_s:78,f64_eq:97,f64_ne:98,f64_lt:99,f64_gt:100,f64_le:101,f64_ge:102,i32_add:106,i32_sub:107,i32_mul:108,i32_rem_s:111,i32_and:113,i32_or:114,i64_rem_s:129,i64_and:131,i64_or:132,f64_abs:153,f64_neg:154,f64_ceil:155,f64_floor:156,f64_sqrt:159,f64_add:160,f64_sub:161,f64_mul:162,f64_div:163,f64_min:164,f64_max:165,i32_trunc_f64_s:170,i32_trunc_f64_u:171,i64_trunc_s_f64:176,f64_convert_i64_s:185,f64_convert_i32_s:183};K.op=q;var H={i32:127,i64:126,f32:125,f64:124};K.VAL_TYPE=H;var Qa={const:0,var:1};K.MUTABILITY=Qa;var ba={void:64,i32:127,i64:126,f32:125,f64:124};K.BLOCK=ba;var sb=96;K.FUNCTION_TYPE=sb;var wc=2;K.MEMORY_IDX=wc;var tb=3;K.GLOBAL_TYPE=tb;var ub=0;K.TYPE_IDX=ub;var oa=[q.f64_abs].concat(Z(q.f64_const(ya)),[q.f64_lt]);K.IS_ZEROISH=oa;var ca=[q.f64_abs].concat(Z(q.f64_const(ya)),[q.f64_gt]);function vb(r){var $=new Uint8Array(8);return vc.write($,r),$}K.IS_NOT_ZEROISH=ca;var xc=vb;K.encodef64=xc;var pa=function(r){return[r.length].concat(r.split("").map(function(r){return r.charCodeAt(0)}))};function aa(r){var $=[];do{var e=127&r;0!==(r>>>=7)&&(e|=128),$.push(e)}while(0!==r);return $}K.encodeString=pa;var la=aa;function wb(r){for(var $=[],e=0,t=Math.ceil(Math.log2(Math.abs(r))),o=r<0,n=!0;n;)e=127&r,r>>=7,o&&(r|=-(1<<t-7)),0==r&&0==(64&e)||-1==r&&64==(64&e)?n=!1:e|=128,$.push(e);return $}K.unsignedLEB128=la;var yc=wb;K.signedLEB128=yc;var ua=function(r){return aa(r.length).concat(r)};K.encodeFlatVector=ua;var Ra=function(r){return aa(r.length).concat(ta(r))};function zc(r,$){if(0===$.length)return[];var e=ua(Ra($));return e.unshift(r),e}K.encodeNestedVector=Ra;var ja=zc;K.encodeSection=ja;var qa={};Object.defineProperty(qa,"__esModule",{value:!0});var Ac=1e-5,Bc={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,atan2:Math.atan2,rand:function(a){return Math.random()*a},pow:Math.pow,log:Math.log,log10:Math.log10,exp:Math.exp,sigmoid:function(a,t){var $=1+Math.exp(-a*t);return Math.abs($)>Ac?1/$:0}},Cc=Bc;qa.default=Cc;var za={};Object.defineProperty(za,"__esModule",{value:!0});var Dc=65536,Ec=8,Fc=2,xb=1048576;za.MAX_LOOP_COUNT=xb;var Aa=8388608;za.BUFFER_SIZE=Aa;var Sa=Math.ceil(Aa*Ec*Fc/Dc);za.WASM_MEMORY_SIZE=Sa;var yb={};function G(n){return Jc(n)||Ic(n)||Hc(n)||Gc()}function Gc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Hc(n,$){if(n){if("string"==typeof n)return Ta(n,$);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ta(n,$):void 0}}function Ic(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}function Jc(n){if(Array.isArray(n))return Ta(n)}function Ta(n,$){(null==$||$>n.length)&&($=n.length);for(var e=0,r=new Array($);e<$;e++)r[e]=n[e];return r}Object.defineProperty(yb,"__esModule",{value:!0});var va={sqr:{args:[H.f64],returns:[H.f64],binary:[].concat(G(q.local_get(0)),G(q.local_get(0)),[q.f64_mul])},bor:{args:[H.f64,H.f64],returns:[H.f64],binary:[].concat(G(q.local_get(0)),G(ca),G(q.local_get(1)),G(ca),[q.i32_or],G(q.i32_const(0)),[q.i32_ne,q.f64_convert_i32_s])},band:{args:[H.f64,H.f64],returns:[H.f64],binary:[].concat(G(q.local_get(0)),G(ca),G(q.local_get(1)),G(ca),[q.i32_and],G(q.i32_const(0)),[q.i32_ne,q.f64_convert_i32_s])},sign:{args:[H.f64],returns:[H.f64],binary:[].concat(G(q.f64_const(0)),G(q.local_get(0)),[q.f64_lt],G(q.local_get(0)),G(q.f64_const(0)),[q.f64_lt,q.i32_sub,q.f64_convert_i32_s])},mod:{args:[H.f64,H.f64],returns:[H.f64],localVariables:[H.i32],binary:[].concat(G(q.local_get(1)),[q.i32_trunc_f64_s],G(q.local_tee(2)),G(q.i32_const(0)),[q.i32_ne],G(q.if(ba.f64)),G(q.local_get(0)),[q.i32_trunc_f64_s],G(q.local_get(2)),[q.i32_rem_s,q.f64_convert_i32_s,q.else],G(q.f64_const(0)),[q.end])},bitwiseOr:{args:[H.f64,H.f64],returns:[H.f64],binary:[].concat(G(q.local_get(0)),[q.i64_trunc_s_f64],G(q.local_get(1)),[q.i64_trunc_s_f64,q.i64_or,q.f64_convert_i64_s])},bitwiseAnd:{args:[H.f64,H.f64],returns:[H.f64],binary:[].concat(G(q.local_get(0)),[q.i64_trunc_s_f64],G(q.local_get(1)),[q.i64_trunc_s_f64,q.i64_and,q.f64_convert_i64_s])},div:{args:[H.f64,H.f64],returns:[H.f64],localVariables:[H.i32],binary:[].concat(G(q.local_get(1)),G(q.f64_const(0)),[q.f64_ne],G(q.if(ba.f64)),G(q.local_get(0)),G(q.local_get(1)),[q.f64_div,q.else],G(q.f64_const(0)),[q.end])},_getBufferIndex:{args:[H.f64],returns:[H.i32],localVariables:[H.f64,H.i32],binary:[].concat(G(q.f64_const(ya)),G(q.local_get(0)),[q.f64_add],G(q.local_tee(1)),[q.i32_trunc_f64_s],G(q.local_set(2)),G(q.i32_const(-1)),G(q.local_get(2)),G(q.i32_const(8)),[q.i32_mul],G(q.local_get(2)),G(q.i32_const(0)),[q.i32_lt_s],G(q.local_get(2)),G(q.i32_const(Aa-1)),[q.i32_gt_s,q.i32_or,q.select])}};yb.localFuncMap=va;var Ba={};function Kc(r,$){return Nc(r)||Mc(r,$)||zb(r,$)||Lc()}function Lc(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Mc(r,$){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var a=[],o=!0,e=!1,n=void 0;try{for(var t,_=r[Symbol.iterator]();!(o=(t=_.next()).done)&&(a.push(t.value),!$||a.length!==$);o=!0);}catch(c){e=!0,n=c}finally{try{o||null==_.return||_.return()}finally{if(e)throw n}}return a}}function Nc(r){if(Array.isArray(r))return r}function z(r){return Qc(r)||Pc(r)||zb(r)||Oc()}function Oc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zb(r,$){if(r){if("string"==typeof r)return Ua(r,$);var a=Object.prototype.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Ua(r,$):void 0}}function Pc(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function Qc(r){if(Array.isArray(r))return Ua(r)}function Ua(r,$){(null==$||$>r.length)&&($=r.length);for(var a=0,o=new Array($);a<$;a++)o[a]=r[a];return o}var Rc=Ba&&Ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ba,"__esModule",{value:!0});var Ab=Rc(qa);function Y(r,$){var a,o,e;switch(r.type){case"SCRIPT":var n=r.body.map(function(r,a){return[].concat(z(Y(r,$)),[q.drop])});return ta(n);case"EXPRESSION_BLOCK":return Va(r.body,$);case"BINARY_EXPRESSION":var t=Y(r.left,$),_=Y(r.right,$),c={"+":[q.f64_add],"-":[q.f64_sub],"*":[q.f64_mul],"/":$.resolveFunc("div"),"%":$.resolveFunc("mod"),"|":$.resolveFunc("bitwiseOr"),"&":$.resolveFunc("bitwiseAnd"),"^":$.resolveFunc("pow"),"==":[q.f64_sub].concat(z(oa),[q.f64_convert_i32_s]),"!=":[q.f64_sub].concat(z(ca),[q.f64_convert_i32_s]),"<":[q.f64_lt,q.f64_convert_i32_s],">":[q.f64_gt,q.f64_convert_i32_s],"<=":[q.f64_le,q.f64_convert_i32_s],">=":[q.f64_ge,q.f64_convert_i32_s]}[r.operator];if(null==c)throw ea("Unknown binary expression operator ".concat(r.operator),r.loc,$.rawSource);return[].concat(z(t),z(_),z(c));case"CALL_EXPRESSION":var i=r.callee.value,v=r.arguments,l=function(a){if(v.length<a)throw ha("Too few arguments passed to `".concat(i,"()`. Expected ").concat(a," but only got ").concat(v.length,"."),r.loc,$.rawSource);if(v.length>a)throw ha("Too many arguments passed to `".concat(i,"()`. Expected ").concat(a," but got ").concat(v.length,"."),v[a].loc,$.rawSource)};switch(i){case"exec2":return l(2),Va(r.arguments,$);case"exec3":return l(3),Va(r.arguments,$);case"if":l(3);var V=Kc(r.arguments,3);return Uc(V[0],V[1],V[2],$);case"while":return l(1),Sc(r.arguments[0],$);case"loop":return l(2),Tc(r.arguments[0],r.arguments[1],$);case"megabuf":case"gmegabuf":l(1);var s=$.resolveLocal(H.i32);return[].concat(z(Y(r.arguments[0],$)),z(null!==(a=$.resolveFunc("_getBufferIndex"))&&void 0!==a?a:[]),z(q.local_tee(s)),z(q.i32_const(-1)),[q.i32_ne],z(q.if(ba.f64)),z(q.local_get(s)),z(q.f64_load(3,Cb(i))),[q.else],z(q.f64_const(0)),[q.end]);case"assign":l(2);var W=r.arguments[0];if("IDENTIFIER"!=W.type)throw ha("Expected the first argument of `assign()` to be an identifier.",W.loc,$.rawSource);var u=$.resolveVar(W.value);return[].concat(z(Y(r.arguments[1],$)),z(q.global_set(u)),z(q.global_get(u)));}var g=ta(r.arguments.map(function(r){return Y(r,$)}));switch(i){case"abs":return l(1),[].concat(z(g),[q.f64_abs]);case"sqrt":return l(1),[].concat(z(g),[q.f64_abs,q.f64_sqrt]);case"int":return l(1),[].concat(z(g),[q.f64_floor]);case"min":return l(2),[].concat(z(g),[q.f64_min]);case"max":return l(2),[].concat(z(g),[q.f64_max]);case"above":return l(2),[].concat(z(g),[q.f64_gt,q.f64_convert_i32_s]);case"below":return l(2),[].concat(z(g),[q.f64_lt,q.f64_convert_i32_s]);case"equal":return l(2),[].concat(z(g),[q.f64_sub],z(oa),[q.f64_convert_i32_s]);case"bnot":return l(1),[].concat(z(g),z(oa),[q.f64_convert_i32_s]);case"floor":return l(1),[].concat(z(g),[q.f64_floor]);case"ceil":return l(1),[].concat(z(g),[q.f64_ceil]);}var d=$.resolveFunc(i);if(null==d||i.startsWith("_"))throw ha("\"".concat(i,"\" is not defined."),r.callee.loc,$.rawSource);if(null!=Ab.default[i])l(Ab.default[i].length);else{if(null==va[i])throw ea("Missing arity information for the function `".concat(i,"()`"),r.callee.loc,$.rawSource);l(va[i].args.length)}return[].concat(z(g),z(d));case"ASSIGNMENT_EXPRESSION":var m=r.left,p=Y(r.right,$),b=Vc(r,$);if("IDENTIFIER"===m.type){var y=$.resolveVar(m.value),f=q.global_get(y),A=q.global_set(y);return null===b?[].concat(z(p),z(A),z(f)):[].concat(z(f),z(p),z(b),z(A),z(f))}if("CALL_EXPRESSION"!==m.type)throw ea("Unexpected left hand side type for assignment: ".concat(m.type),r.loc,$.rawSource);var C=$.resolveLocal(H.i32);if(1!==m.arguments.length)throw ha("Expected 1 argument when assinging to a buffer but got ".concat(m.arguments.length,"."),0===m.arguments.length?m.loc:m.arguments[1].loc,$.rawSource);var E=m.callee.value;if("gmegabuf"!==E&&"megabuf"!==E)throw ha("The only function calls which may be assigned to are `gmegabuf()` and `megabuf()`.",m.callee.loc,$.rawSource);var h=Cb(E);if(null===b){var S=$.resolveLocal(H.i32),I=$.resolveLocal(H.f64);return[].concat(z(p),z(q.local_set(I)),z(Y(m.arguments[0],$)),z(null!==(o=$.resolveFunc("_getBufferIndex"))&&void 0!==o?o:[]),z(q.local_tee(S)),z(q.i32_const(0)),[q.i32_lt_s],z(q.if(ba.f64)),z(q.f64_const(0)),[q.else],z(q.local_get(S)),z(q.local_tee(C)),z(q.local_get(I)),z(q.f64_store(3,h)),z(q.local_get(I)),[q.end])}var w=$.resolveLocal(H.i32),L=$.resolveLocal(H.i32),O=$.resolveLocal(H.f64),T=$.resolveLocal(H.f64);return[].concat(z(p),z(q.local_set(O)),z(Y(m.arguments[0],$)),z(null!==(e=$.resolveFunc("_getBufferIndex"))&&void 0!==e?e:[]),z(q.local_tee(w)),z(q.i32_const(-1)),[q.i32_ne],z(q.local_tee(L)),z(q.if(ba.f64)),z(q.local_get(w)),z(q.f64_load(3,h)),[q.else],z(q.f64_const(0)),[q.end],z(q.local_get(O)),z(b),z(q.local_tee(T)),z(q.local_get(L)),z(q.if(ba.void)),z(q.local_get(w)),z(q.local_get(T)),z(q.f64_store(3,h)),[q.end]);case"LOGICAL_EXPRESSION":var U=Y(r.left,$),R=Y(r.right,$),x={"&&":{comparison:oa,shortCircutValue:0},"||":{comparison:ca,shortCircutValue:1}}[r.operator];if(null==x)throw ea("Unknown logical expression operator ".concat(r.operator),r.loc,$.rawSource);var F=x.comparison,N=x.shortCircutValue;return[].concat(z(U),z(F),z(q.if(ba.f64)),z(q.f64_const(N)),[q.else],z(R),z(ca),[q.f64_convert_i32_s,q.end]);case"UNARY_EXPRESSION":var B=Y(r.value,$),P={"-":[q.f64_neg],"+":[],"!":[].concat(z(oa),[q.f64_convert_i32_s])}[r.operator];if(null==P)throw ea("Unknown logical unary operator ".concat(r.operator),r.loc,$.rawSource);return[].concat(z(B),z(P));case"IDENTIFIER":var k=r.value;return q.global_get($.resolveVar(k));case"NUMBER_LITERAL":return q.f64_const(r.value);default:throw ea("Unknown AST node type ".concat(r.type),r.loc,$.rawSource);}}var Bb=Y;function Va(r,$){var a=r.map(function(r,a){return Y(r,$)});return ta(fb(a,[q.drop]))}function Sc(r,$){var a=Y(r,$),o=$.resolveLocal(H.i32);return[].concat(z(q.i32_const(0)),z(q.local_set(o)),z(q.loop(ba.void)),z(q.local_get(o)),z(q.i32_const(1)),[q.i32_add],z(q.local_tee(o)),z(q.i32_const(xb)),[q.i32_lt_u],z(a),z(ca),[q.i32_and],z(q.br_if(0)),[q.end],z(q.f64_const(0)))}function Tc(r,$,a){var o=Y($,a),e=a.resolveLocal(H.i32);return[].concat(z(q.block(ba.void)),z(Y(r,a)),[q.i32_trunc_f64_s],z(q.local_tee(e)),z(q.i32_const(0)),[q.i32_le_s],z(q.br_if(1)),z(q.loop(ba.void)),z(o),[q.drop],z(q.local_get(e)),z(q.i32_const(1)),[q.i32_sub],z(q.local_tee(e)),z(q.i32_const(0)),[q.i32_ne],z(q.br_if(0)),[q.end,q.end],z(q.f64_const(0)))}function Uc(r,$,a,o){return[].concat(z(Y(r,o)),z(ca),z(q.if(ba.f64)),z(Y($,o)),[q.else],z(Y(a,o)),[q.end])}function Cb(r){switch(r){case"gmegabuf":return 8*Aa;case"megabuf":return 0;}}function Vc(r,$){var a={"+=":[q.f64_add],"-=":[q.f64_sub],"*=":[q.f64_mul],"/=":[q.f64_div],"%=":$.resolveFunc("mod"),"=":null}[r.operator];if(void 0===a)throw ea("Unknown assignment operator \"".concat(r.operator,"\""),r.loc,$.rawSource);return a}Ba.emit=Bb;var ra={};function J(r){return Yc(r)||Xc(r)||Db(r)||Wc()}function Wc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Xc(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function Yc(r){if(Array.isArray(r))return Wa(r)}function wa(r,e){return _c(r)||$c(r,e)||Db(r,e)||Zc()}function Zc(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Db(r,e){if(r){if("string"==typeof r)return Wa(r,e);var a=Object.prototype.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Wa(r,e):void 0}}function Wa(r,e){(null==e||e>r.length)&&(e=r.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=r[a];return n}function $c(r,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var a=[],n=!0,$=!1,o=void 0;try{for(var t,d=r[Symbol.iterator]();!(n=(t=d.next()).done)&&(a.push(t.value),!e||a.length!==e);n=!0);}catch(i){$=!0,o=i}finally{try{n||null==d.return||d.return()}finally{if($)throw o}}return a}}function _c(r){if(Array.isArray(r))return r}var ad=ra&&ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},bd=ra&&ra.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(null!=r)for(var a in r)Object.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e.default=r,e};Object.defineProperty(ra,"__esModule",{value:!0});var cd=ad(qa),Xa=bd(ga);function dd(r){var e=r.pools,a=r.functions,n=r.eelVersion,$=void 0===n?2:n,o=r.preParsed,t=void 0!==o&&o;if(Object.keys(e).includes("shims"))throw new Error("You may not name a pool \"shims\". \"shims\" is reserved for injected JavaScript functions.");var d=[];Object.entries(e).forEach(function(r){var e=wa(r,2),a=e[0];e[1].forEach(function(r){d.push([a,r])})});var i=new Xa.ScopedIdMap;d.forEach(function(r){var e=wa(r,2),a=e[0],n=e[1];i.get(a,n)});var c=Object.entries(cd.default).map(function(r){var e=wa(r,2),a=e[0],n=e[1];return{args:new Array(n.length).fill(null).map(function(r){return H.f64}),returns:[H.f64],name:a}}),l=[],u=[];Object.entries(a).forEach(function(r){var a=wa(r,2),n=a[0],o=a[1],d=o.pool,v=o.code;if(null==e[d]){var s=Object.keys(e);if(0===s.length)throw new Error("The function \"".concat(n,"\" was declared as using a variable ")+"pool named \"".concat(d,"\" but no pools were defined."));throw new Error("The function \"".concat(n,"\" was declared as using a variable ")+"pool named \"".concat(d,"\" which is not among the variable ")+"pools defined. The defined variable pools are: "+"".concat(Xa.formatList(s),"."))}var _=t?v:Na(v);if("string"==typeof _)throw new Error("Got passed unparsed code without setting the preParsed flag");if("SCRIPT"!==_.type)throw new Error("Invalid AST");if(0!==_.body.length){var D=[],X={resolveVar:function(r){return /^reg\d\d$/.test(r)?i.get(null,r):i.get(d,r)},resolveLocal:function(r){return D.push(r),D.length-1},resolveFunc:function(r){var e=c.findIndex(function(e){return e.name===r});if(-1!==e){var a=q.call(e);return"rand"===r&&1===$?[].concat(J(a),[q.f64_floor]):a}if(null==va[r])return null;var n=l.indexOf(r);return-1===n&&(l.push(r),n=l.length-1),q.call(n+c.length)},rawSource:v},f=Bb(_,X);u.push({binary:f,exportName:n,args:[],returns:[],localVariables:D})}});var v=l.map(function(r){var e=va[r];if(null==e)throw new Error("Undefined local function \"".concat(r,"\""));return e}),s=function(r){return[].concat(J(r.args),["|"],J(r.returns)).join("-")},_=[],D=new Map;function X(r){var e=s(r),a=D.get(e);if(null==a)throw new Error("Failed to get a type index for key ".concat(e));return a}[].concat(J(c),J(v),u).forEach(function(r){var e=s(r);D.has(e)||(_.push([sb].concat(J(ua(r.args)),J(ua(r.returns)))),D.set(e,_.length-1))});var f=[].concat(J(d.map(function(r){var e=wa(r,2),a=e[0],n=e[1];return[].concat(J(pa(a)),J(pa(n)),[tb,H.f64,Qa.var])})),J(c.map(function(r,e){var a=X(r);return[].concat(J(pa("shims")),J(pa(r.name)),[ub].concat(J(la(a))))}))),m=[].concat(J(v),u).map(function(r){var e=X(r);return la(e)}),y=[[1].concat(J(la(Sa)),J(la(Sa)))],p=i.size()-d.length,g=Xa.times(p,function(){return[H.f64,Qa.var].concat(J(q.f64_const(0)),[q.end])}),b=[].concat(u).map(function(r,e){var a=e+c.length+v.length;return[].concat(J(pa(r.exportName)),[rb.FUNC],J(la(a)))}),A=[].concat(J(v),u).map(function(r){var e,a=(null!==(e=r.localVariables)&&void 0!==e?e:[]).map(function(r){return[].concat(J(la(1)),[r])});return ua([].concat(J(Ra(a)),J(r.binary),[q.end]))});return new Uint8Array([].concat(J(pb),J(qb),J(ja(ia.TYPE,_)),J(ja(ia.IMPORT,f)),J(ja(ia.FUNC,m)),J(ja(ia.MEMORY,y)),J(ja(ia.GLOBAL,g)),J(ja(ia.EXPORT,b)),J(ja(ia.CODE,A))))}var Ya=dd;ra.compileModule=Ya;var Ca={};function ed(r,e){return id(r)||hd(r,e)||gd(r,e)||fd()}function fd(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gd(r,e){if(r){if("string"==typeof r)return Eb(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Eb(r,e):void 0}}function Eb(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=r[t];return a}function hd(r,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var t=[],a=!0,n=!1,o=void 0;try{for(var u,l=r[Symbol.iterator]();!(a=(u=l.next()).done)&&(t.push(u.value),!e||t.length!==e);a=!0);}catch($){n=!0,o=$}finally{try{a||null==l.return||l.return()}finally{if(n)throw o}}return t}}function id(r){if(Array.isArray(r))return r}function Fb(r,e,t,a,n,o,u){try{var l=r[o](u),$=l.value}catch(i){return void t(i)}l.done?e($):Promise.resolve($).then(a,n)}function jd(r){return function(){var e=this,t=arguments;return new Promise(function(a,n){var o=r.apply(e,t);function u(r){Fb(o,a,n,u,l,"next",r)}function l(r){Fb(o,a,n,u,l,"throw",r)}u(void 0)})}}var kd=Ca&&Ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ca,"__esModule",{value:!0});var ld=kd(qa);function md(r){return nd.apply(this,arguments)}function nd(){return(nd=jd(regeneratorRuntime.mark(function r(e){var t,a,n,o,u,l,$,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.pools,a=e.functions,n=e.eelVersion,o=void 0===n?2:n,u={},Object.entries(t).forEach(function(r){var e=ed(r,2),t=e[0],a=e[1];u[t]=new Set(Object.keys(a))}),l=Ya({pools:u,functions:a,eelVersion:o}),r.next=6,WebAssembly.compile(l);case 6:return $=r.sent,i=Object.assign(Object.assign({},t),{shims:ld.default}),r.next=10,WebAssembly.instantiate($,i);case 10:return r.abrupt("return",r.sent);case 11:case"end":return r.stop();}},r)}))).apply(this,arguments)}var Gb=md;Ca.loadModule=Gb;var fa={},od=fa&&fa.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(fa,"__esModule",{value:!0});var pd=Na;fa.parse=pd;var qd=Ya;fa.compileModule=qd;var rd=od(qa),sd=rd.default;fa.shims=sd;var td=Gb;fa.loadModule=td;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=fa}else if(typeof define==="function"&&define.amd){define(function(){return fa})}})(); |