diff --git a/bin/gpu-core.js b/bin/gpu-core.js index 031cdab8..234d69be 100644 --- a/bin/gpu-core.js +++ b/bin/gpu-core.js @@ -5,7 +5,7 @@ * GPU Accelerated JavaScript * * @version 1.7.1 - * @date Wed Sep 05 2018 22:33:41 GMT+0100 (BST) + * @date Fri Sep 07 2018 18:47:52 GMT+0100 (BST) * * @license MIT * The MIT License diff --git a/bin/gpu-core.min.js b/bin/gpu-core.min.js index bde2b159..8be9ec8f 100644 --- a/bin/gpu-core.min.js +++ b/bin/gpu-core.min.js @@ -5,7 +5,7 @@ * GPU Accelerated JavaScript * * @version 1.7.1 - * @date Wed Sep 05 2018 22:33:41 GMT+0100 (BST) + * @date Fri Sep 07 2018 18:47:52 GMT+0100 (BST) * * @license MIT * The MIT License diff --git a/bin/gpu.js b/bin/gpu.js index 1d405834..50705e2c 100644 --- a/bin/gpu.js +++ b/bin/gpu.js @@ -5,7 +5,7 @@ * GPU Accelerated JavaScript * * @version 1.7.1 - * @date Wed Sep 05 2018 22:33:41 GMT+0100 (BST) + * @date Fri Sep 07 2018 18:47:52 GMT+0100 (BST) * * @license MIT * The MIT License @@ -3948,23 +3948,22 @@ module.exports = function (_KernelBase) { var length = size[0] * size[1]; - var _formatArrayTransfer2 = this._formatArrayTransfer(value, length), - valuesFlat = _formatArrayTransfer2.valuesFlat, - bitRatio = _formatArrayTransfer2.bitRatio; - - var buffer = void 0; if (this.floatTextures) { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0], size[1], 0, gl.RGBA, gl.FLOAT, valuesFlat); } else { - buffer = new Uint8Array(valuesFlat.buffer); + var _formatArrayTransfer2 = this._formatArrayTransfer(value, length), + _valuesFlat = _formatArrayTransfer2.valuesFlat, + bitRatio = _formatArrayTransfer2.bitRatio; + + var buffer = new Uint8Array(_valuesFlat.buffer, _valuesFlat.byteOffset, _valuesFlat.length * 4 / bitRatio); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0] / bitRatio, size[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, buffer); + this.setUniform1i('user_' + name + 'BitRatio', bitRatio); } if (!this.hardcodeConstants) { this.setUniform3iv('user_' + name + 'Dim', dim); this.setUniform2iv('user_' + name + 'Size', size); } - this.setUniform1i('user_' + name + 'BitRatio', bitRatio); this.setUniform1i('user_' + name, this.argumentsLength); break; } @@ -3991,22 +3990,22 @@ module.exports = function (_KernelBase) { var _length = _size[0] * _size[1]; - var _formatArrayTransfer3 = this._formatArrayTransfer(value.value, _length), - _valuesFlat = _formatArrayTransfer3.valuesFlat, - _bitRatio = _formatArrayTransfer3.bitRatio; - if (this.floatTextures) { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, _size[0], _size[1], 0, gl.RGBA, gl.FLOAT, inputArray); } else { - var _buffer = new Uint8Array(_valuesFlat.buffer); + var _formatArrayTransfer3 = this._formatArrayTransfer(value.value, _length), + _valuesFlat2 = _formatArrayTransfer3.valuesFlat, + _bitRatio = _formatArrayTransfer3.bitRatio; + + var _buffer = new Uint8Array(_valuesFlat2.buffer, _valuesFlat2.byteOffset, _valuesFlat2.length * 4 / _bitRatio); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, _size[0] / _bitRatio, _size[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, _buffer); + this.setUniform1i('user_' + name + 'BitRatio', _bitRatio); } if (!this.hardcodeConstants) { this.setUniform3iv('user_' + name + 'Dim', _dim); this.setUniform2iv('user_' + name + 'Size', _size); } - this.setUniform1i('user_' + name + 'BitRatio', _bitRatio); this.setUniform1i('user_' + name, this.argumentsLength); break; } @@ -4081,14 +4080,14 @@ module.exports = function (_KernelBase) { var length = size[0] * size[1]; var _formatArrayTransfer4 = this._formatArrayTransfer(value, length), - valuesFlat = _formatArrayTransfer4.valuesFlat, + _valuesFlat3 = _formatArrayTransfer4.valuesFlat, bitRatio = _formatArrayTransfer4.bitRatio; var buffer = void 0; if (this.floatTextures) { - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0], size[1], 0, gl.RGBA, gl.FLOAT, valuesFlat); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0], size[1], 0, gl.RGBA, gl.FLOAT, _valuesFlat3); } else { - buffer = new Uint8Array(valuesFlat.buffer); + buffer = new Uint8Array(_valuesFlat3.buffer); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0] / bitRatio, size[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, buffer); } @@ -4124,13 +4123,13 @@ module.exports = function (_KernelBase) { var _length2 = _size4[0] * _size4[1]; var _formatArrayTransfer5 = this._formatArrayTransfer(value.value, _length2), - _valuesFlat2 = _formatArrayTransfer5.valuesFlat, + _valuesFlat4 = _formatArrayTransfer5.valuesFlat, _bitRatio2 = _formatArrayTransfer5.bitRatio; if (this.floatTextures) { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, _size4[0], _size4[1], 0, gl.RGBA, gl.FLOAT, inputArray); } else { - var _buffer2 = new Uint8Array(_valuesFlat2.buffer); + var _buffer2 = new Uint8Array(_valuesFlat4.buffer); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, _size4[0] / _bitRatio2, _size4[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, _buffer2); } @@ -5128,23 +5127,23 @@ module.exports = function (_WebGLKernel) { var length = size[0] * size[1]; - var _formatArrayTransfer = this._formatArrayTransfer(value, length), - valuesFlat = _formatArrayTransfer.valuesFlat, - bitRatio = _formatArrayTransfer.bitRatio; - var buffer = void 0; if (this.floatTextures) { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, size[0], size[1], 0, gl.RGBA, gl.FLOAT, valuesFlat); } else { - buffer = new Uint8Array(valuesFlat.buffer); + var _formatArrayTransfer = this._formatArrayTransfer(value, length), + _valuesFlat = _formatArrayTransfer.valuesFlat, + bitRatio = _formatArrayTransfer.bitRatio; + + buffer = new Uint8Array(_valuesFlat.buffer, _valuesFlat.byteOffset, _valuesFlat.length * 4 / bitRatio); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0] / bitRatio, size[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, buffer); + this.setUniform1i('user_' + name + 'BitRatio', bitRatio); } if (!this.hardcodeConstants) { this.setUniform3iv('user_' + name + 'Dim', dim); this.setUniform2iv('user_' + name + 'Size', size); } - this.setUniform1i('user_' + name + 'BitRatio', bitRatio); this.setUniform1i('user_' + name, this.argumentsLength); break; } @@ -5171,22 +5170,22 @@ module.exports = function (_WebGLKernel) { var _length = _size[0] * _size[1]; - var _formatArrayTransfer2 = this._formatArrayTransfer(value.value, _length), - _valuesFlat = _formatArrayTransfer2.valuesFlat, - _bitRatio = _formatArrayTransfer2.bitRatio; - if (this.floatTextures) { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, _size[0], _size[1], 0, gl.RGBA, gl.FLOAT, inputArray); } else { - var _buffer = new Uint8Array(_valuesFlat.buffer); + var _formatArrayTransfer2 = this._formatArrayTransfer(value.value, _length), + _valuesFlat2 = _formatArrayTransfer2.valuesFlat, + _bitRatio = _formatArrayTransfer2.bitRatio; + + var _buffer = new Uint8Array(_valuesFlat2.buffer, _valuesFlat2.byteOffset, _valuesFlat2.length * 4 / _bitRatio); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, _size[0] / _bitRatio, _size[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, _buffer); + this.setUniform1i('user_' + name + 'BitRatio', _bitRatio); } if (!this.hardcodeConstants) { this.setUniform3iv('user_' + name + 'Dim', _dim); this.setUniform2iv('user_' + name + 'Size', _size); } - this.setUniform1i('user_' + name + 'BitRatio', _bitRatio); this.setUniform1i('user_' + name, this.argumentsLength); break; } @@ -5327,14 +5326,14 @@ module.exports = function (_WebGLKernel) { var length = size[0] * size[1]; var _formatArrayTransfer3 = this._formatArrayTransfer(value, length), - valuesFlat = _formatArrayTransfer3.valuesFlat, + _valuesFlat3 = _formatArrayTransfer3.valuesFlat, bitRatio = _formatArrayTransfer3.bitRatio; var buffer = void 0; if (this.floatTextures) { - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0], size[1], 0, gl.RGBA, gl.FLOAT, valuesFlat); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0], size[1], 0, gl.RGBA, gl.FLOAT, _valuesFlat3); } else { - buffer = new Uint8Array(valuesFlat.buffer); + buffer = new Uint8Array(_valuesFlat3.buffer); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size[0] / bitRatio, size[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, buffer); } @@ -5370,13 +5369,13 @@ module.exports = function (_WebGLKernel) { var _length2 = _size5[0] * _size5[1]; var _formatArrayTransfer4 = this._formatArrayTransfer(value.value, _length2), - _valuesFlat2 = _formatArrayTransfer4.valuesFlat, + _valuesFlat4 = _formatArrayTransfer4.valuesFlat, _bitRatio2 = _formatArrayTransfer4.bitRatio; if (this.floatTextures) { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, _size5[0], _size5[1], 0, gl.RGBA, gl.FLOAT, inputArray); } else { - var _buffer2 = new Uint8Array(_valuesFlat2.buffer); + var _buffer2 = new Uint8Array(_valuesFlat4.buffer); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, _size5[0] / _bitRatio2, _size5[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, _buffer2); } diff --git a/bin/gpu.min.js b/bin/gpu.min.js index 206451d8..de3e524a 100644 --- a/bin/gpu.min.js +++ b/bin/gpu.min.js @@ -5,7 +5,7 @@ * GPU Accelerated JavaScript * * @version 1.7.1 - * @date Wed Sep 05 2018 22:33:41 GMT+0100 (BST) + * @date Fri Sep 07 2018 18:47:52 GMT+0100 (BST) * * @license MIT * The MIT License @@ -14,9 +14,9 @@ */ "use strict";!function(){function t(e,n,i){function r(a,o){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return r(n||t)},c,c.exports,t,e,n,i)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a0&&e.push(", "),e.push(this.paramTypes[n]),e.push(" "),e.push("user_"),e.push(this.paramNames[n]);return e.push(");\n"),e}},{key:"astFunctionExpression",value:function(t,e){if(!this.isRootKernel){e.push("function"),this.kernalAst=t,e.push(" "),e.push(this.functionName),e.push("(");for(var n=0;n0&&e.push(", "),e.push(" "),e.push("user_"),e.push(i)}e.push(") {\n")}for(var r=0;r1){for(var s=null,a=0;a0&&e.push(","),this.astGeneric(t.declarations[n],e);return e.push(";"),e}},{key:"astVariableDeclarator",value:function(t,e){return this.astGeneric(t.id,e),null!==t.init&&(e.push("="),this.astGeneric(t.init,e)),e}},{key:"astIfStatement",value:function(t,e){return e.push("if ("),this.astGeneric(t.test,e),e.push(")"),"BlockStatement"===t.consequent.type?this.astGeneric(t.consequent,e):(e.push(" {\n"),this.astGeneric(t.consequent,e),e.push("\n}\n")),t.alternate&&(e.push("else "),"BlockStatement"===t.alternate.type?this.astGeneric(t.alternate,e):(e.push(" {\n"),this.astGeneric(t.alternate,e),e.push("\n}\n"))),e}},{key:"astBreakStatement",value:function(t,e){return e.push("break;\n"),e}},{key:"astContinueStatement",value:function(t,e){return e.push("continue;\n"),e}},{key:"astLogicalExpression",value:function(t,e){return e.push("("),this.astGeneric(t.left,e),e.push(t.operator),this.astGeneric(t.right,e),e.push(")"),e}},{key:"astUpdateExpression",value:function(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}},{key:"astUnaryExpression",value:function(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}},{key:"astThisExpression",value:function(t,e){return e.push("_this"),e}},{key:"astMemberExpression",value:function(t,e){if(t.computed)if("Identifier"===t.object.type||"MemberExpression"===t.object.type&&t.object.object.object&&"ThisExpression"===t.object.object.object.type&&"constants"===t.object.object.property.name)this.pushState("identifier"),this.astGeneric(t.object,e),this.popState("identifier"),e.push("["),this.isInput(t.object.name)?this.astGeneric(t.property,e):this.astGeneric(t.property,e),e.push("]");else if(t.object.object)if(t.object.object.object&&this.isInput(t.object.object.object.name)){this.pushMemberState(t.object.object.object.name),this.pushState("input-index-z"),this.astGeneric(t.object,e);var n=e.pop();e.push(" + "),this.popState("input-index-z"),this.pushState("input-index"),this.astGeneric(t.property,e),this.popState("input-index"),e.push(n),this.popMemberState(t.object.object.object.name)}else if(this.isInput(t.object.object.name)){this.pushMemberState(t.object.object.name),this.isState("input-index-z")||this.pushState("input-index-y"),this.astGeneric(t.object,e);var i=e.pop();e.push(" + "),this.isState("input-index-z")||this.popState("input-index-y");var r=this.isState("input-index-z");r?this.pushState("input-index-y"):this.pushState("input-index"),this.astGeneric(t.property,e),r?this.popState("input-index-y"):this.popState("input-index"),e.push(i),this.popMemberState(t.object.object.name)}else{this.astGeneric(t.object,e);var s=e.pop();e.push("]["),this.astGeneric(t.property,e),e.push(s)}else{this.astGeneric(t.object,e);var a=e.pop();e.push("]["),this.astGeneric(t.property,e),e.push(a)}else{var o=this.astMemberExpressionUnroll(t);switch("Identifier"===t.property.type&&t.computed&&(o="user_"+o),0===o.indexOf("this.constants")?o="constants_"+o.substring(15):0===o.indexOf("this")&&(o="_"+o),this.state){case"input-index-y":case"input-index-z":e.push("(")}switch(o){case"_this.output.x":e.push(this.output[0]);break;case"_this.output.y":e.push(this.output[1]);break;case"_this.output.z":e.push(this.output[2]);break;default:t.object&&t.object.name&&this.declarations[t.object.name]&&e.push("user_"),e.push(o)}switch(this.state){case"input-index-y":var u=this.paramSizes[this.paramNames.indexOf(this.memberState)];e.push(" * "+u[0]+")");break;case"input-index-z":var h=this.paramSizes[this.paramNames.indexOf(this.memberState)];e.push(" * "+h[0]*h[1]+")")}}return e}},{key:"astSequenceExpression",value:function(t,e){for(var n=0;n0&&e.push(","),this.astGeneric(t.expressions,e);return e}},{key:"astCallExpression",value:function(t,e){if(t.callee){var n=this.astMemberExpressionUnroll(t.callee);this.calledFunctions.indexOf(n)<0&&this.calledFunctions.push(n),this.hasOwnProperty("funcName")||(this.calledFunctionsArguments[n]=[]);var i=[];this.calledFunctionsArguments[n].push(i),e.push(n),e.push("(");for(var r=0;r0&&e.push(", "),this.astGeneric(s,e),"Identifier"===s.type){var a=this.paramNames.indexOf(s.name);a===-1?i.push(null):i.push({name:s.name,type:this.paramTypes[a]})}else i.push(null)}return e.push(")"),e}throw this.astErrorOutput("Unknown CallExpression",t)}},{key:"astArrayExpression",value:function(t,e){var n=t.elements.length;e.push("new Float32Array(");for(var i=0;i0&&e.push(", ");var r=t.elements[i];this.astGeneric(r,e)}return e.push(")"),e}},{key:"astDebuggerStatement",value:function(t,e){return e.push("debugger;"),e}},{key:"memberState",get:function(){return this.memberStates[this.memberStates.length-1]}}]),e}(o)},{"../../core/utils":32,"../function-node-base":7}],3:[function(t,e,n){function i(t){return/^function /.test(t)&&(t=t.substring(9)),t.replace(/[_]typeof/g,"typeof")}function r(t){return t.replace(/[_]typeof/g,"typeof")}var s=t("../../core/utils"),a=t("../kernel-run-shortcut");e.exports=function(t,e){return"() => {\n "+a.toString()+";\n const utils = {\n allPropertiesOf: "+r(s.allPropertiesOf.toString())+",\n clone: "+r(s.clone.toString())+",\n checkOutput: "+r(s.checkOutput.toString())+"\n };\n const Utils = utils;\n class "+(e||"Kernel")+" {\n constructor() { \n this.argumentsLength = 0;\n this._canvas = null;\n this._webGl = null;\n this.built = false;\n this.program = null;\n this.paramNames = "+JSON.stringify(t.paramNames)+";\n this.paramTypes = "+JSON.stringify(t.paramTypes)+";\n this.texSize = "+JSON.stringify(t.texSize)+";\n this.output = "+JSON.stringify(t.output)+";\n this._kernelString = `"+t._kernelString+"`;\n this.output = "+JSON.stringify(t.output)+";\n\t\t this.run = function() {\n this.run = null;\n this.build();\n return this.run.apply(this, arguments);\n }.bind(this);\n this.thread = {\n x: 0,\n y: 0,\n z: 0\n };\n }\n setCanvas(canvas) { this._canvas = canvas; return this; }\n setWebGl(webGl) { this._webGl = webGl; return this; }\n "+i(t.build.toString())+"\n "+i(t.setupParams.toString())+"\n "+i(t.setupConstants.toString())+"\n run () { "+t.kernelString+" }\n getKernelString() { return this._kernelString; }\n "+i(t.validateOptions.toString())+"\n };\n return kernelRunShortcut(new Kernel());\n };"}},{"../../core/utils":32,"../kernel-run-shortcut":9}],4:[function(t,e,n){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var n=0;n1?h=h.filter(function(t){return/^function/.test(t)?t:(c=t,!1)}):c=h.shift();var l=this._kernelString="\n\t\tvar LOOP_MAX = "+this._getLoopMaxString()+"\n\t\tvar constants = this.constants;\n\t\tvar _this = this;\n "+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(t){return" var "+t+" = null;\n"}).join(""))+"\n return function ("+this.paramNames.map(function(t){return"user_"+t}).join(", ")+") {\n "+this._processConstants()+"\n "+this._processParams()+"\n var ret = new Array("+n[2]+");\n "+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(t){return" "+t+"Z = new Array("+n[2]+");\n"}).join(""))+"\n for (this.thread.z = 0; this.thread.z < "+n[2]+"; this.thread.z++) {\n ret[this.thread.z] = new Array("+n[1]+");\n "+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(t){return" "+t+"Z[this.thread.z] = new Array("+n[1]+");\n"}).join(""))+"\n for (this.thread.y = 0; this.thread.y < "+n[1]+"; this.thread.y++) {\n ret[this.thread.z][this.thread.y] = "+(this.floatOutput?"new Float32Array("+n[0]+")":"new Array("+n[0]+")")+";\n "+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(e){return" "+e+"Z[this.thread.z][this.thread.y] = "+(t.floatOutput?"new Float32Array("+n[0]+")":"new Array("+n[0]+")")+";\n"}).join(""))+"\n for (this.thread.x = 0; this.thread.x < "+n[0]+"; this.thread.x++) {\n var kernelResult;\n "+c+"\n ret[this.thread.z][this.thread.y][this.thread.x] = kernelResult;\n"+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(t){return" "+t+"Z[this.thread.z][this.thread.y][this.thread.x] = "+t+";\n"}).join(""))+"\n }\n }\n }\n \n if (this.graphical) {\n this._imageData.data.set(this._colorData);\n this._canvasCtx.putImageData(this._imageData, 0, 0);\n return;\n }\n \n if (this.output.length === 1) {\n ret = ret[0][0];\n "+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(t){return" "+t+" = "+t+"Z[0][0];\n"}).join(""))+"\n \n } else if (this.output.length === 2) {\n ret = ret[0];\n "+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(t){return" "+t+" = "+t+"Z[0];\n"}).join(""))+"\n } else {\n "+(null===this.subKernelOutputVariableNames?"":this.subKernelOutputVariableNames.map(function(t){return" "+t+" = "+t+"Z;\n"}).join(""))+"\n }\n \n "+(null===this.subKernelOutputVariableNames?"return ret;\n":null!==this.subKernels?"var result = [\n "+this.subKernelOutputVariableNames.map(function(t){return""+t}).join(",\n")+"\n ];\n result.result = ret;\n return result;\n":"return {\n result: ret,\n "+Object.keys(this.subKernelProperties).map(function(e,n){return e+": "+t.subKernelOutputVariableNames[n]}).join(",\n")+"\n };")+"\n "+(h.length>0?h.join("\n"):"")+"\n }.bind(this);";return l}},{key:"toString",value:function(){return h(this)}},{key:"_getLoopMaxString",value:function(){return this.loopMaxIterations?" "+parseInt(this.loopMaxIterations)+";\n":" 1000;\n"}},{key:"_processConstants",value:function(){if(!this.constants)return"";var t=[];for(var e in this.constants){var n=this.constantTypes[e];switch(n){case"HTMLImage":t.push(" var constants_"+e+" = this._imageTo2DArray(this.constants."+e+")");break;case"HTMLImageArray":t.push(" var constants_"+e+" = this._imageTo3DArray(this.constants."+e+")");break;case"Input":t.push(" var constants_"+e+" = this.constants."+e+".value");break;default:t.push(" var constants_"+e+" = this.constants."+e)}}return t.join("\n")}},{key:"_processParams",value:function(){for(var t=[],e=0;e=0;a--){r[a]=new Array(t.width);for(var o=0;o=0||e.push(t)),e}},{key:"addKernel",value:function(t,e){var n=new this.Node("kernel",t,e);return n.setAddFunction(this.addFunction.bind(this)),n.isRootKernel=!0,this.addFunctionNode(n),n}},{key:"addSubKernel",value:function(t,e){var n=new this.Node(null,t,e);return n.setAddFunction(this.addFunction.bind(this)),n.isSubKernel=!0,this.addFunctionNode(n),n}},{key:"getPrototypeString",value:function(t){return this.getPrototypes(t).join("\n")}},{key:"getPrototypes",value:function(t){return this.rootKernel.generate(),t?this.getPrototypesFromFunctionNames(this.traceFunctionCalls(t,[]).reverse()):this.getPrototypesFromFunctionNames(Object.keys(this.nodeMap))}},{key:"getStringFromFunctionNames",value:function(t){for(var e=[],n=0;n ("+i.length+","+this.paramNames.length+")";this.paramTypes=i}else if("object"===("undefined"==typeof i?"undefined":_typeof(i))){var s=Object.keys(i);if(i.hasOwnProperty("returns")&&(this.returnType=i.returns,s.splice(s.indexOf("returns"),1)),s.length>0&&s.length!==this.paramNames.length)throw"Invalid argument type array length, against function length -> ("+s.length+","+this.paramNames.length+")";this.paramTypes=this.paramNames.map(function(t){return i.hasOwnProperty(t)?i[t]:"float"})}}else this.paramTypes=[];this.returnType||(this.returnType=r||"float")}return _createClass(BaseFunctionNode,[{key:"isIdentifierConstant",value:function(t){return!!this.constants&&this.constants.hasOwnProperty(t)}},{key:"isInput",value:function(t){return"Input"===this.paramTypes[this.paramNames.indexOf(t)]}},{key:"setAddFunction",value:function(t){return this.addFunction=t,this}},{key:"pushState",value:function(t){this.states.push(t)}},{key:"popState",value:function(t){if(this.state!==t)throw new Error("Cannot popState "+t+" when in "+this.state);this.states.pop()}},{key:"isState",value:function(t){return this.state===t}},{key:"getJsFunction",value:function getJsFunction(){if(this.jsFunction)return this.jsFunction;if(this.jsFunctionString)return this.jsFunction=eval(this.jsFunctionString),this.jsFunction;throw"Missing jsFunction, and jsFunctionString parameter"; }},{key:"astMemberExpressionUnroll",value:function(t){if("Identifier"===t.type)return t.name;if("ThisExpression"===t.type)return"this";if("MemberExpression"===t.type&&t.object&&t.property)return t.object.hasOwnProperty("name")&&"_"===t.object.name[0]?this.astMemberExpressionUnroll(t.property):this.astMemberExpressionUnroll(t.object)+"."+this.astMemberExpressionUnroll(t.property);if(t.hasOwnProperty("expressions")){var e=t.expressions[0];if("Literal"===e.type&&0===e.value&&2===t.expressions.length)return this.astMemberExpressionUnroll(t.expressions[1])}throw this.astErrorOutput("Unknown CallExpression_unroll",t)}},{key:"getJsAST",value:function(t){if(this.jsFunctionAST)return this.jsFunctionAST;if(t=t||acorn,null===t)throw"Missing JS to AST parser";var e=t.parse("var "+this.functionName+" = "+this.jsFunctionString+";",{locations:!0});if(null===e)throw"Failed to parse JS code";var n=e.body[0].declarations[0].init;return this.jsFunctionAST=n,n}},{key:"getFunctionString",value:function(){return this.generate(),this.functionString}},{key:"setFunctionString",value:function(t){this.functionString=t}},{key:"getParamType",value:function(t){var e=this.paramNames.indexOf(t);if(e===-1)return this.declarations.hasOwnProperty(t)?this.declarations[t]:null;if(this.parent){if(this.paramTypes[e])return this.paramTypes[e];for(var n=this.parent.calledFunctionsArguments[this.functionName],i=0;i0&&e.push(", ");var r=this.getParamType(i);switch(r){case"Texture":case"Input":case"Array":e.push("sampler2D");break;default:e.push("float")}e.push(" "),e.push("user_"),e.push(i)}e.push(") {\n");for(var s=0;s1){for(var s=null,a=0;a0&&e.push(",");var r=[];this.astGeneric(i,r),"getImage2D("===r[2]||"getImage3D("===r[2]?(0===n&&e.push("vec4 "),this.declarations[i.id.name]="vec4"):(0===n&&e.push("float "),this.declarations[i.id.name]="float"),e.push.apply(e,r)}return e.push(";"),e}},{key:"astVariableDeclarator",value:function(t,e){return this.astGeneric(t.id,e),null!==t.init&&(e.push("="),this.astGeneric(t.init,e)),e}},{key:"astIfStatement",value:function(t,e){return e.push("if ("),this.astGeneric(t.test,e),e.push(")"),"BlockStatement"===t.consequent.type?this.astGeneric(t.consequent,e):(e.push(" {\n"),this.astGeneric(t.consequent,e),e.push("\n}\n")),t.alternate&&(e.push("else "),"BlockStatement"===t.alternate.type?this.astGeneric(t.alternate,e):(e.push(" {\n"),this.astGeneric(t.alternate,e),e.push("\n}\n"))),e}},{key:"astBreakStatement",value:function(t,e){return e.push("break;\n"),e}},{key:"astContinueStatement",value:function(t,e){return e.push("continue;\n"),e}},{key:"astLogicalExpression",value:function(t,e){return e.push("("),this.astGeneric(t.left,e),e.push(t.operator),this.astGeneric(t.right,e),e.push(")"),e}},{key:"astUpdateExpression",value:function(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}},{key:"astUnaryExpression",value:function(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}},{key:"astThisExpression",value:function(t,e){return e.push("this"),e}},{key:"astMemberExpression",value:function(t,e){if(m("[in] astMemberExpression "+t.object.type),t.computed)if("Identifier"===t.object.type||"MemberExpression"===t.object.type&&t.object.object.object&&"ThisExpression"===t.object.object.object.type&&"constants"===t.object.object.property.name){var n=t.object.name,i=this.functionName||"kernel",r=!1;if(this.paramNames){var s=this.paramNames.indexOf(n);s>=0&&"float"===this.paramTypes[s]&&(r=!0)}if(m("- astMemberExpression "+n+" "+i),r)this.astGeneric(t.object,e),e.push("[int("),this.astGeneric(t.property,e),e.push(")]");else{var a=this.isState("in-get-call-parameters"),o=this.isState("multi-member-expression");o&&this.popState("multi-member-expression"),this.pushState("not-in-get-call-parameters");var u=null;switch(t.object.name?u=this.getParamType(t.object.name):t.object&&t.object.object&&t.object.object.object&&"ThisExpression"===t.object.object.object.type&&(u=this.getConstantType(t.object.property.name)),u){case"vec4":this.astGeneric(t.object,e),e.push("["),e.push(t.property.raw),e.push("]"),o&&this.popState("not-in-get-call-parameters");break;case"HTMLImageArray":e.push("getImage3D("),this.astGeneric(t.object,e),e.push(", ivec2("),this.astGeneric(t.object,e),e.push("Size[0],"),this.astGeneric(t.object,e),e.push("Size[1]), ivec3("),this.astGeneric(t.object,e),e.push("Dim[0],"),this.astGeneric(t.object,e),e.push("Dim[1],"),this.astGeneric(t.object,e),e.push("Dim[2]"),e.push("), "),this.popState("not-in-get-call-parameters"),this.pushState("in-get-call-parameters"),this.astGeneric(t.property,e),o||this.popState("in-get-call-parameters"),e.push(")");break;case"HTMLImage":e.push("getImage2D("),this.astGeneric(t.object,e),e.push(", ivec2("),this.astGeneric(t.object,e),e.push("Size[0],"),this.astGeneric(t.object,e),e.push("Size[1]), ivec3("),this.astGeneric(t.object,e),e.push("Dim[0],"),this.astGeneric(t.object,e),e.push("Dim[1],"),this.astGeneric(t.object,e),e.push("Dim[2]"),e.push("), "),this.popState("not-in-get-call-parameters"),this.pushState("in-get-call-parameters"),this.astGeneric(t.property,e),o||this.popState("in-get-call-parameters"),e.push(")");break;default:a&&e.push("int("),e.push("get("),this.astGeneric(t.object,e),e.push(", ivec2("),this.astGeneric(t.object,e),e.push("Size[0],"),this.astGeneric(t.object,e),e.push("Size[1]), ivec3("),this.astGeneric(t.object,e),e.push("Dim[0],"),this.astGeneric(t.object,e),e.push("Dim[1],"),this.astGeneric(t.object,e),e.push("Dim[2]"),e.push("), "),this.astGeneric(t.object,e),e.push("BitRatio"),e.push(", "),this.popState("not-in-get-call-parameters"),this.pushState("in-get-call-parameters"),this.astGeneric(t.property,e),o||this.popState("in-get-call-parameters"),e.push(")"),a&&e.push(")")}}}else{m("- astMemberExpression obj:",t.object);var h=(this.states.length,this.isState("in-get-call-parameters"));h||this.pushState("multi-member-expression"),this.astGeneric(t.object,e),this.isState("multi-member-expression")&&this.popState("multi-member-expression");var c=!h&&this.isState("in-get-call-parameters"),l=e.pop();e.push(","),m("- astMemberExpression prop:",t.property);var f=this.isState("should-pop-in-get-call-parameters");f&&this.popState("should-pop-in-get-call-parameters"),this.astGeneric(t.property,e),e.push(l),c?this.pushState("should-pop-in-get-call-parameters"):f&&this.popState("in-get-call-parameters")}else{var d=this.astMemberExpressionUnroll(t),g=d.toLowerCase();m("- astMemberExpression unrolled:",d),0===d.indexOf(p)&&(d="constants_"+d.slice(p.length));var x=!this.isState("in-get-call-parameters");switch(g){case"this.thread.x":x&&e.push("float("),e.push("threadId.x"),x&&e.push(")");break;case"this.thread.y":x&&e.push("float("),e.push("threadId.y"),x&&e.push(")");break;case"this.thread.z":x&&e.push("float("),e.push("threadId.z"),x&&e.push(")");break;case"this.output.x":e.push(this.output[0]+".0");break;case"this.output.y":e.push(this.output[1]+".0");break;case"this.output.z":e.push(this.output[2]+".0");break;default:t.object&&t.object.name&&this.declarations[t.object.name]&&e.push("user_"),e.push(d)}}return m("[out] astMemberExpression "+t.object.type),e}},{key:"astSequenceExpression",value:function(t,e){for(var n=0;n0&&e.push(","),this.astGeneric(t.expressions,e);return e}},{key:"astCallExpression",value:function(t,e){if(t.callee){var n=this.astMemberExpressionUnroll(t.callee);0===n.indexOf(c)&&(n=n.slice(c.length)),0===n.indexOf(l)&&(n=n.slice(l.length)),"atan2"===n&&(n="atan"),this.calledFunctions.indexOf(n)<0&&this.calledFunctions.push(n),this.hasOwnProperty("funcName")||(this.calledFunctionsArguments[n]=[]);var i=[];this.calledFunctionsArguments[n].push(i),e.push(n),e.push("(");for(var r=0;r0&&e.push(", "),this.astGeneric(s,e),"Identifier"===s.type){var a=this.paramNames.indexOf(s.name);a===-1?i.push(null):i.push({name:s.name,type:this.paramTypes[a]})}else i.push(null)}return e.push(")"),e}throw this.astErrorOutput("Unknown CallExpression",t)}},{key:"astArrayExpression",value:function(t,e){var n=t.elements.length;e.push("float["+n+"](");for(var i=0;i0&&e.push(", ");var r=t.elements[i];this.astGeneric(r,e)}return e.push(")"),e}},{key:"getFunctionPrototypeString",value:function(){return this.webGlFunctionPrototypeString?this.webGlFunctionPrototypeString:this.webGlFunctionPrototypeString=this.generate()}},{key:"build",value:function(){return this.getFunctionPrototypeString().length>0}}],[{key:"astFunctionPrototype",value:function(t,e){if(this.isRootKernel||this.isSubKernel)return e;e.push(this.returnType),e.push(" "),e.push(this.functionName),e.push("(");for(var n=0;n0&&e.push(", "),e.push(this.paramTypes[n]),e.push(" "),e.push("user_"),e.push(this.paramNames[n]);return e.push(");\n"),e}}]),e}(u)},{"../../core/utils":32,"../function-node-base":7}],13:[function(t,e,n){function i(t){return/^function /.test(t)&&(t=t.substring(9)),t.replace(/[_]typeof/g,"typeof")}function r(t){return t.replace(/[_]typeof/g,"typeof")}var s=t("../../core/utils"),a=t("../kernel-run-shortcut");e.exports=function(t,e){return"() => {\n "+a.toString()+";\n const utils = {\n allPropertiesOf: "+r(s.allPropertiesOf.toString())+",\n clone: "+r(s.clone.toString())+",\n splitArray: "+r(s.splitArray.toString())+",\n getArgumentType: "+r(s.getArgumentType.toString())+",\n getDimensions: "+r(s.getDimensions.toString())+",\n dimToTexSize: "+r(s.dimToTexSize.toString())+",\n flattenTo: "+r(s.flattenTo.toString())+",\n flatten2dArrayTo: "+r(s.flatten2dArrayTo.toString())+",\n flatten3dArrayTo: "+r(s.flatten3dArrayTo.toString())+",\n systemEndianness: '"+r(s.systemEndianness())+"',\n initWebGl: "+r(s.initWebGl.toString())+",\n isArray: "+r(s.isArray.toString())+",\n checkOutput: "+r(s.checkOutput.toString())+"\n };\n const Utils = utils;\n const canvases = [];\n const maxTexSizes = {};\n class "+(e||"Kernel")+" {\n constructor() {\n this.maxTexSize = null;\n this.argumentsLength = 0;\n this._canvas = null;\n this._webGl = null;\n this.built = false;\n this.program = null;\n this.paramNames = "+JSON.stringify(t.paramNames)+";\n this.paramTypes = "+JSON.stringify(t.paramTypes)+";\n this.texSize = "+JSON.stringify(t.texSize)+";\n this.output = "+JSON.stringify(t.output)+";\n this.compiledFragShaderString = `"+t.compiledFragShaderString+"`;\n\t\t this.compiledVertShaderString = `"+t.compiledVertShaderString+"`;\n\t\t this.programUniformLocationCache = {};\n\t\t this.textureCache = {};\n\t\t this.subKernelOutputTextures = null;\n\t\t this.subKernelOutputVariableNames = null;\n\t\t this.uniform1fCache = {};\n\t\t this.uniform1iCache = {};\n\t\t this.uniform2fCache = {};\n\t\t this.uniform2fvCache = {};\n\t\t this.uniform2ivCache = {};\n\t\t this.uniform3fvCache = {};\n\t\t this.uniform3ivCache = {};\n }\n "+i(t._getFragShaderString.toString())+"\n "+i(t._getVertShaderString.toString())+"\n validateOptions() {}\n setupParams() {}\n setupConstants() {}\n setCanvas(canvas) { this._canvas = canvas; return this; }\n setWebGl(webGl) { this._webGl = webGl; return this; }\n "+i(t.getUniformLocation.toString())+"\n "+i(t.setupParams.toString())+"\n "+i(t.setupConstants.toString())+"\n "+i(t.build.toString())+"\n\t\t "+i(t.run.toString())+"\n\t\t "+i(t._addArgument.toString())+"\n\t\t "+i(t.getArgumentTexture.toString())+"\n\t\t "+i(t.getTextureCache.toString())+"\n\t\t "+i(t.getOutputTexture.toString())+"\n\t\t "+i(t.renderOutput.toString())+"\n\t\t "+i(t.updateMaxTexSize.toString())+"\n\t\t "+i(t._setupOutputTexture.toString())+"\n\t\t "+i(t.detachTextureCache.toString())+"\n\t\t "+i(t.setUniform1f.toString())+"\n\t\t "+i(t.setUniform1i.toString())+"\n\t\t "+i(t.setUniform2f.toString())+"\n\t\t "+i(t.setUniform2fv.toString())+"\n\t\t "+i(t.setUniform2iv.toString())+"\n\t\t "+i(t.setUniform3fv.toString())+" \n\t\t "+i(t.setUniform3iv.toString())+" \n };\n return kernelRunShortcut(new Kernel());\n };"}},{"../../core/utils":32,"../kernel-run-shortcut":9}],14:[function(t,e,n){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){ -if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function g(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var r=Object.getPrototypeOf(t);return null===r?void 0:g(r,e,n)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(n)},o=function(){function t(t,e){for(var n=0;n0&&this._setupSubOutputTextures(this.subKernelOutputVariableNames.length))}},{key:"run",value:function(){null===this.program&&this.build.apply(this,arguments);var t=this.paramNames,e=this.paramTypes,n=this.texSize,i=this._webGl;i.useProgram(this.program),i.scissor(0,0,n[0],n[1]),this.hardcodeConstants||(this.setUniform3iv("uOutputDim",this.threadDim),this.setUniform2iv("uTexSize",n)),this.setUniform2f("ratio",n[0]/this.maxTexSize[0],n[1]/this.maxTexSize[1]),this.argumentsLength=0;for(var r=0;r0?t.join(";\n")+";\n":"\n"}},{key:"_replaceArtifacts",value:function(t,e){return t.replace(/[ ]*__([A-Z]+[0-9]*([_]?[A-Z])*)__;\n/g,function(t,n){if(e.hasOwnProperty(n))return e[n];throw"unhandled artifact "+n})}},{key:"_addKernels",value:function(){var t=this,e=this.functionBuilder,n=this._webGl;if(e.addFunctions(this.functions,{constants:this.constants,output:this.output}),e.addNativeFunctions(this.nativeFunctions),e.addKernel(this.fnString,{prototypeOnly:!1,constants:this.constants,output:this.output,debug:this.debug,loopMaxIterations:this.loopMaxIterations,paramNames:this.paramNames,paramTypes:this.paramTypes,constantTypes:this.constantTypes,fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy}),null!==this.subKernels){var i=this.drawBuffers=n.getExtension("WEBGL_draw_buffers");if(!i)throw new Error("could not instantiate draw buffers extension");this.subKernelOutputVariableNames=[],this.subKernels.forEach(function(e){return t._addSubKernel(e)})}else if(null!==this.subKernelProperties){var r=this.drawBuffers=n.getExtension("WEBGL_draw_buffers");if(!r)throw new Error("could not instantiate draw buffers extension");this.subKernelOutputVariableNames=[],Object.keys(this.subKernelProperties).forEach(function(e){return t._addSubKernel(t.subKernelProperties[e])})}}},{key:"_addSubKernel",value:function(t){this.functionBuilder.addSubKernel(t,{prototypeOnly:!1,constants:this.constants,output:this.output,debug:this.debug,loopMaxIterations:this.loopMaxIterations,fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy}),this.subKernelOutputVariableNames.push(t.name+"Result")}},{key:"_getFragShaderString",value:function(t){return null!==this.compiledFragShaderString?this.compiledFragShaderString:this.compiledFragShaderString=this._replaceArtifacts(this.constructor.fragShaderString,this._getFragShaderArtifactMap(t))}},{key:"_getVertShaderString",value:function(t){return null!==this.compiledVertShaderString?this.compiledVertShaderString:this.compiledVertShaderString=this.constructor.vertShaderString}},{key:"toString",value:function(){return f(this)}},{key:"addFunction",value:function(t){this.functionBuilder.addFunction(null,t)}},{key:"destroy",value:function(t){a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this.outputTexture&&this._webGl.deleteTexture(this.outputTexture),this.buffer&&this._webGl.deleteBuffer(this.buffer),this.framebuffer&&this._webGl.deleteFramebuffer(this.framebuffer),this.vertShader&&this._webGl.deleteShader(this.vertShader),this.fragShader&&this._webGl.deleteShader(this.fragShader),this.program&&this._webGl.deleteProgram(this.program);for(var n=Object.keys(this.textureCache),i=0;i=0&&(d[o]=null,m[o]=null)}delete this._webGl}}]),e}(u)},{"../../core/texture":30,"../../core/utils":32,"../kernel-base":8,"./kernel-string":13,"./shader-frag":16,"./shader-vert":17}],15:[function(t,e,n){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var n=0;n0&&e.push(", ");var r=this.getParamType(i);switch(r){case"Texture":case"Input":case"Array":case"HTMLImage":e.push("sampler2D");break;default:e.push("float")}e.push(" "),e.push("user_"),e.push(i)}e.push(") {\n");for(var s=0;s1&&r*s===i)return[r,s];for(var o=Math.sqrt(i),u=Math.ceil(o),h=Math.floor(o);u*h>i;)u--,h=Math.ceil(i/u);return r=h,s=Math.ceil(i/r),[r,s]}},{key:"getDimensions",value:function(t,e){var i=void 0;if(n.isArray(t)){for(var r=[],s=t;n.isArray(s);)r.push(s.length),s=s[0];i=r.reverse()}else if(t instanceof c)i=t.output;else{if(!(t instanceof h))throw"Unknown dimensions of "+t;i=t.size}if(e)for(i=n.clone(i);i.length<3;)i.push(1);return new Int32Array(i)}},{key:"pad",value:function(t,e){function n(t){return Array.apply(null,new Array(t)).map(Number.prototype.valueOf,0)}for(var i=t.length+2*e,r=t.map(function(t){return[].concat(n(e),t,n(e))}),s=0;st)return!1;if(n+=e[i+1],n>=t)return!0}}function n(t,n){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&F.test(String.fromCharCode(t)):n!==!1&&e(t,B)))}function i(t,n){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&M.test(String.fromCharCode(t)):n!==!1&&(e(t,B)||e(t,j)))))}function r(t,e){return new V(t,{beforeExpr:!0,binop:e})}function s(t,e){return void 0===e&&(e={}),e.keyword=t,K[t]=new V(t,e)}function a(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}function o(t,e){return Z.call(t,e)}function u(t,e){for(var n=1,i=0;;){Y.lastIndex=i;var r=Y.exec(t);if(!(r&&r.index=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),tt(e.onToken)){var i=e.onToken;e.onToken=function(t){return i.push(t)}}return tt(e.onComment)&&(e.onComment=c(e,e.onComment)),e}function c(t,e){return function(n,i,r,s,a,o){var u={type:n?"Block":"Line",value:i,start:r,end:s};t.locations&&(u.loc=new nt(this,a,o)),t.ranges&&(u.range=[r,s]),e.push(u)}}function l(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}function p(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}function f(t,e,n,i){return t.type=e,t.end=n,this.options.locations&&(t.loc.end=i),this.options.ranges&&(t.range[1]=n),t}function d(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(1023&t)+56320))}function m(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function g(t){return n(t,!0)||36===t||95===t}function x(t){return i(t,!0)||36===t||95===t||8204===t||8205===t}function v(t){return t>=65&&t<=90||t>=97&&t<=122}function y(t){return t>=0&&t<=1114111}function b(t){return 100===t||68===t||115===t||83===t||119===t||87===t}function _(t){return v(t)||95===t}function E(t){return _(t)||T(t)}function T(t){return t>=48&&t<=57}function S(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function k(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}function w(t){return t>=48&&t<=55}function A(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(1023&t)+56320))}function R(t,e){return new st(e,t).parse()}function O(t,e,n){var i=new st(n,t,e);return i.nextToken(),i.parseExpression()}function C(t,e){return new st(e,t)}function I(e,n,i){t.parse_dammit=e,t.LooseParser=n,t.pluginsLoose=i}var D={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},P="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",N={5:P,6:P+" const class extends export import super"},L=/^in(stanceof)?$/,U="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",G="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",F=new RegExp("["+U+"]"),M=new RegExp("["+U+G+"]");U=G=null;var B=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],j=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],V=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null},z={beforeExpr:!0},X={startsExpr:!0},K={},W={num:new V("num",X),regexp:new V("regexp",X),string:new V("string",X),name:new V("name",X),eof:new V("eof"),bracketL:new V("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new V("]"),braceL:new V("{",{beforeExpr:!0,startsExpr:!0}),braceR:new V("}"),parenL:new V("(",{beforeExpr:!0,startsExpr:!0}),parenR:new V(")"),comma:new V(",",z),semi:new V(";",z),colon:new V(":",z),dot:new V("."),question:new V("?",z),arrow:new V("=>",z),template:new V("template"),invalidTemplate:new V("invalidTemplate"),ellipsis:new V("...",z),backQuote:new V("`",X),dollarBraceL:new V("${",{beforeExpr:!0,startsExpr:!0}),eq:new V("=",{beforeExpr:!0,isAssign:!0}),assign:new V("_=",{beforeExpr:!0,isAssign:!0}),incDec:new V("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new V("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:r("||",1),logicalAND:r("&&",2),bitwiseOR:r("|",3),bitwiseXOR:r("^",4),bitwiseAND:r("&",5),equality:r("==/!=/===/!==",6),relational:r("/<=/>=",7),bitShift:r("<>/>>>",8),plusMin:new V("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:r("%",10),star:r("*",10),slash:r("/",10),starstar:new V("**",{beforeExpr:!0}),_break:s("break"),_case:s("case",z),_catch:s("catch"),_continue:s("continue"),_debugger:s("debugger"),_default:s("default",z),_do:s("do",{isLoop:!0,beforeExpr:!0}),_else:s("else",z),_finally:s("finally"),_for:s("for",{isLoop:!0}),_function:s("function",X),_if:s("if"),_return:s("return",z),_switch:s("switch"),_throw:s("throw",z),_try:s("try"),_var:s("var"),_const:s("const"),_while:s("while",{isLoop:!0}),_with:s("with"),_new:s("new",{beforeExpr:!0,startsExpr:!0}),_this:s("this",X),_super:s("super",X),_class:s("class",X),_extends:s("extends",z),_export:s("export"),_import:s("import"),_null:s("null",X),_true:s("true",X),_false:s("false",X),_in:s("in",{beforeExpr:!0,binop:7}),_instanceof:s("instanceof",{beforeExpr:!0,binop:7}),_typeof:s("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:s("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:s("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},H=/\r\n?|\n|\u2028|\u2029/,Y=new RegExp(H.source,"g"),q=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,J=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Q=Object.prototype,Z=Q.hasOwnProperty,$=Q.toString,tt=Array.isArray||function(t){return"[object Array]"===$.call(t)},et=function(t,e){this.line=t,this.column=e};et.prototype.offset=function(t){return new et(this.line,this.column+t)};var nt=function(t,e,n){this.start=e,this.end=n,null!==t.sourceFile&&(this.source=t.sourceFile)},it={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},rt={},st=function(t,e,n){this.options=t=h(t),this.sourceFile=t.sourceFile,this.keywords=l(N[t.ecmaVersion>=6?6:5]);var i="";if(!t.allowReserved){for(var r=t.ecmaVersion;!(i=D[r]);r--);"module"===t.sourceType&&(i+=" await")}this.reservedWords=l(i);var s=(i?i+" ":"")+D.strict;this.reservedWordsStrict=l(s),this.reservedWordsStrictBind=l(s+" "+D.strictBind),this.input=String(e),this.containsEsc=!1,this.loadPlugins(t.plugins),n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(H).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=W.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope(),this.regexpState=null};st.prototype.isKeyword=function(t){return this.keywords.test(t)},st.prototype.isReservedWord=function(t){return this.reservedWords.test(t)},st.prototype.extend=function(t,e){this[t]=e(this[t])},st.prototype.loadPlugins=function(t){var e=this;for(var n in t){var i=rt[n];if(!i)throw new Error("Plugin '"+n+"' not found");i(e,t[n])}},st.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};var at=st.prototype,ot=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/;at.strictDirective=function(t){for(var e=this;;){J.lastIndex=t,t+=J.exec(e.input)[0].length;var n=ot.exec(e.input.slice(t));if(!n)return!1;if("use strict"===(n[1]||n[2]))return!0;t+=n[0].length}},at.eat=function(t){return this.type===t&&(this.next(),!0)},at.isContextual=function(t){return this.type===W.name&&this.value===t&&!this.containsEsc},at.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},at.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},at.canInsertSemicolon=function(){return this.type===W.eof||this.type===W.braceR||H.test(this.input.slice(this.lastTokEnd,this.start))},at.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},at.semicolon=function(){this.eat(W.semi)||this.insertSemicolon()||this.unexpected()},at.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},at.expect=function(t){this.eat(t)||this.unexpected()},at.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},at.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var n=e?t.parenthesizedAssign:t.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},at.checkExpressionErrors=function(t,e){if(!t)return!1;var n=t.shorthandAssign,i=t.doubleProto;return e?(n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),void(i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property"))):n>=0||i>=0},at.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(t.sourceType=this.options.sourceType),this.finishNode(t,"Program")};var ht={kind:"loop"},ct={kind:"switch"};ut.isLet=function(){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;J.lastIndex=this.pos;var t=J.exec(this.input),e=this.pos+t[0].length,r=this.input.charCodeAt(e);if(91===r||123===r)return!0;if(n(r,!0)){for(var s=e+1;i(this.input.charCodeAt(s),!0);)++s;var a=this.input.slice(e,s);if(!L.test(a))return!0}return!1},ut.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;J.lastIndex=this.pos;var t=J.exec(this.input),e=this.pos+t[0].length;return!(H.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!==this.input.length&&i(this.input.charAt(e+8)))},ut.parseStatement=function(t,e,n){var i,r=this.type,s=this.startNode();switch(this.isLet()&&(r=W._var,i="let"),r){case W._break:case W._continue:return this.parseBreakContinueStatement(s,r.keyword);case W._debugger:return this.parseDebuggerStatement(s);case W._do:return this.parseDoStatement(s);case W._for:return this.parseForStatement(s); -case W._function:return!t&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1);case W._class:return t||this.unexpected(),this.parseClass(s,!0);case W._if:return this.parseIfStatement(s);case W._return:return this.parseReturnStatement(s);case W._switch:return this.parseSwitchStatement(s);case W._throw:return this.parseThrowStatement(s);case W._try:return this.parseTryStatement(s);case W._const:case W._var:return i=i||this.value,t||"var"===i||this.unexpected(),this.parseVarStatement(s,i);case W._while:return this.parseWhileStatement(s);case W._with:return this.parseWithStatement(s);case W.braceL:return this.parseBlock();case W.semi:return this.parseEmptyStatement(s);case W._export:case W._import:return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===W._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return t||this.unexpected(),this.next(),this.parseFunctionStatement(s,!0);var a=this.value,o=this.parseExpression();return r===W.name&&"Identifier"===o.type&&this.eat(W.colon)?this.parseLabeledStatement(s,a,o):this.parseExpressionStatement(s,o)}},ut.parseBreakContinueStatement=function(t,e){var n=this,i="break"===e;this.next(),this.eat(W.semi)||this.insertSemicolon()?t.label=null:this.type!==W.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(W.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},ut.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.inAsync&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ht),this.enterLexicalScope(),this.expect(W.parenL),this.type===W.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var n=this.isLet();if(this.type===W._var||this.type===W._const||n){var i=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),!(this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==i.declarations.length||"var"!==r&&i.declarations[0].init?(e>-1&&this.unexpected(e),this.parseFor(t,i)):(this.options.ecmaVersion>=9&&(this.type===W._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,i))}var s=new p,a=this.parseExpression(!0,s);return this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===W._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(a,!1,s),this.checkLVal(a),this.parseForIn(t,a)):(this.checkExpressionErrors(s,!0),e>-1&&this.unexpected(e),this.parseFor(t,a))},ut.parseFunctionStatement=function(t,e){return this.next(),this.parseFunction(t,!0,!1,e)},ut.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement(!this.strict&&this.type===W._function),t.alternate=this.eat(W._else)?this.parseStatement(!this.strict&&this.type===W._function):null,this.finishNode(t,"IfStatement")},ut.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(W.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},ut.parseSwitchStatement=function(t){var e=this;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(W.braceL),this.labels.push(ct),this.enterLexicalScope();for(var n,i=!1;this.type!==W.braceR;)if(e.type===W._case||e.type===W._default){var r=e.type===W._case;n&&e.finishNode(n,"SwitchCase"),t.cases.push(n=e.startNode()),n.consequent=[],e.next(),r?n.test=e.parseExpression():(i&&e.raiseRecoverable(e.lastTokStart,"Multiple default clauses"),i=!0,n.test=null),e.expect(W.colon)}else n||e.unexpected(),n.consequent.push(e.parseStatement(!0));return this.exitLexicalScope(),n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},ut.parseThrowStatement=function(t){return this.next(),H.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var lt=[];ut.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===W._catch){var e=this.startNode();this.next(),this.eat(W.parenL)?(e.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(e.param,"let"),this.expect(W.parenR)):(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterLexicalScope()),e.body=this.parseBlock(!1),this.exitLexicalScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(W._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},ut.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},ut.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(ht),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"WhileStatement")},ut.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement(!1),this.finishNode(t,"WithStatement")},ut.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},ut.parseLabeledStatement=function(t,e,n){for(var i=this,r=0,s=i.labels;r=0;u--){var h=i.labels[u];if(h.statementStart!==t.start)break;h.statementStart=i.start,h.kind=o}return this.labels.push({name:e,kind:o,statementStart:this.start}),t.body=this.parseStatement(!0),("ClassDeclaration"===t.body.type||"VariableDeclaration"===t.body.type&&"var"!==t.body.kind||"FunctionDeclaration"===t.body.type&&(this.strict||t.body.generator))&&this.raiseRecoverable(t.body.start,"Invalid labeled declaration"),this.labels.pop(),t.label=n,this.finishNode(t,"LabeledStatement")},ut.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},ut.parseBlock=function(t){var e=this;void 0===t&&(t=!0);var n=this.startNode();for(n.body=[],this.expect(W.braceL),t&&this.enterLexicalScope();!this.eat(W.braceR);){var i=e.parseStatement(!0);n.body.push(i)}return t&&this.exitLexicalScope(),this.finishNode(n,"BlockStatement")},ut.parseFor=function(t,e){return t.init=e,this.expect(W.semi),t.test=this.type===W.semi?null:this.parseExpression(),this.expect(W.semi),t.update=this.type===W.parenR?null:this.parseExpression(),this.expect(W.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"ForStatement")},ut.parseForIn=function(t,e){var n=this.type===W._in?"ForInStatement":"ForOfStatement";return this.next(),"ForInStatement"===n&&("AssignmentPattern"===e.type||"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(this.strict||"Identifier"!==e.declarations[0].id.type))&&this.raise(e.start,"Invalid assignment in for-in loop head"),t.left=e,t.right="ForInStatement"===n?this.parseExpression():this.parseMaybeAssign(),this.expect(W.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,n)},ut.parseVar=function(t,e,n){var i=this;for(t.declarations=[],t.kind=n;;){var r=i.startNode();if(i.parseVarId(r,n),i.eat(W.eq)?r.init=i.parseMaybeAssign(e):"const"!==n||i.type===W._in||i.options.ecmaVersion>=6&&i.isContextual("of")?"Identifier"===r.id.type||e&&(i.type===W._in||i.isContextual("of"))?r.init=null:i.raise(i.lastTokEnd,"Complex binding patterns require an initialization value"):i.unexpected(),t.declarations.push(i.finishNode(r,"VariableDeclarator")),!i.eat(W.comma))break}return t},ut.parseVarId=function(t,e){t.id=this.parseBindingAtom(e),this.checkLVal(t.id,e,!1)},ut.parseFunction=function(t,e,n,i){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(t.generator=this.eat(W.star)),this.options.ecmaVersion>=8&&(t.async=!!i),e&&(t.id="nullableID"===e&&this.type!==W.name?null:this.parseIdent(),t.id&&this.checkLVal(t.id,"var"));var r=this.inGenerator,s=this.inAsync,a=this.yieldPos,o=this.awaitPos,u=this.inFunction;return this.inGenerator=t.generator,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),e||(t.id=this.type===W.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,n),this.inGenerator=r,this.inAsync=s,this.yieldPos=a,this.awaitPos=o,this.inFunction=u,this.finishNode(t,e?"FunctionDeclaration":"FunctionExpression")},ut.parseFunctionParams=function(t){this.expect(W.parenL),t.params=this.parseBindingList(W.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},ut.parseClass=function(t,e){var n=this;this.next(),this.parseClassId(t,e),this.parseClassSuper(t);var i=this.startNode(),r=!1;for(i.body=[],this.expect(W.braceL);!this.eat(W.braceR);){var s=n.parseClassMember(i);s&&"MethodDefinition"===s.type&&"constructor"===s.kind&&(r&&n.raise(s.start,"Duplicate constructor in the same class"),r=!0)}return t.body=this.finishNode(i,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},ut.parseClassMember=function(t){var e=this;if(this.eat(W.semi))return null;var n=this.startNode(),i=function(t,i){void 0===i&&(i=!1);var r=e.start,s=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===W.parenL||i&&e.canInsertSemicolon())||(n.key&&e.unexpected(),n.computed=!1,n.key=e.startNodeAt(r,s),n.key.name=t,e.finishNode(n.key,"Identifier"),!1))};n.kind="method",n["static"]=i("static");var r=this.eat(W.star),s=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(W.star)):i("get")?n.kind="get":i("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var a=n.key;return n.computed||n["static"]||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?n["static"]&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),r&&this.raise(a.start,"Constructor can't be a generator"),s&&this.raise(a.start,"Constructor can't be an async method"),n.kind="constructor"),this.parseClassMethod(t,n,r,s),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},ut.parseClassMethod=function(t,e,n,i){e.value=this.parseMethod(n,i),t.body.push(this.finishNode(e,"MethodDefinition"))},ut.parseClassId=function(t,e){t.id=this.type===W.name?this.parseIdent():e===!0?this.unexpected():null},ut.parseClassSuper=function(t){t.superClass=this.eat(W._extends)?this.parseExprSubscripts():null},ut.parseExport=function(t,e){var n=this;if(this.next(),this.eat(W.star))return this.expectContextual("from"),this.type!==W.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(W._default)){this.checkExport(e,"default",this.lastTokStart);var i;if(this.type===W._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),t.declaration=this.parseFunction(r,"nullableID",!1,i)}else if(this.type===W._class){var s=this.startNode();t.declaration=this.parseClass(s,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(!0),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==W.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var a=0,o=t.specifiers;a=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,s=t.properties;r=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var i,r=t.key;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var s=t.kind;if(this.options.ecmaVersion>=6)return void("__proto__"===i&&"init"===s&&(e.proto&&(n&&n.doubleProto<0?n.doubleProto=r.start:this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),e.proto=!0));i="$"+i;var a=e[i];if(a){var o;o="init"===s?this.strict&&a.init||a.get||a.set:a.init||a[s],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=e[i]={init:!1,get:!1,set:!1};a[s]=!0}},ft.parseExpression=function(t,e){var n=this,i=this.start,r=this.startLoc,s=this.parseMaybeAssign(t,e);if(this.type===W.comma){var a=this.startNodeAt(i,r);for(a.expressions=[s];this.eat(W.comma);)a.expressions.push(n.parseMaybeAssign(t,e));return this.finishNode(a,"SequenceExpression")}return s},ft.parseMaybeAssign=function(t,e,n){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var i=!1,r=-1,s=-1;e?(r=e.parenthesizedAssign,s=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new p,i=!0);var a=this.start,o=this.startLoc;this.type!==W.parenL&&this.type!==W.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(t,e);if(n&&(u=n.call(this,u,a,o)),this.type.isAssign){var h=this.startNodeAt(a,o);return h.operator=this.value,h.left=this.type===W.eq?this.toAssignable(u,!1,e):u,i||p.call(e),e.shorthandAssign=-1,this.checkLVal(u),this.next(),h.right=this.parseMaybeAssign(t),this.finishNode(h,"AssignmentExpression")}return i&&this.checkExpressionErrors(e,!0),r>-1&&(e.parenthesizedAssign=r),s>-1&&(e.trailingComma=s),u},ft.parseMaybeConditional=function(t,e){var n=this.start,i=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(this.eat(W.question)){var s=this.startNodeAt(n,i);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect(W.colon),s.alternate=this.parseMaybeAssign(t),this.finishNode(s,"ConditionalExpression")}return r},ft.parseExprOps=function(t,e){var n=this.start,i=this.startLoc,r=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)?r:r.start===n&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,n,i,-1,t)},ft.parseExprOp=function(t,e,n,i,r){var s=this.type.binop;if(null!=s&&(!r||this.type!==W._in)&&s>i){var a=this.type===W.logicalOR||this.type===W.logicalAND,o=this.value;this.next();var u=this.start,h=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1),u,h,s,r),l=this.buildBinary(e,n,t,c,o,a);return this.parseExprOp(l,e,n,i,r)}return t},ft.buildBinary=function(t,e,n,i,r,s){var a=this.startNodeAt(t,e);return a.left=n,a.operator=r,a.right=i,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")},ft.parseMaybeUnary=function(t,e){var n,i=this,r=this.start,s=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))n=this.parseAwait(),e=!0;else if(this.type.prefix){var a=this.startNode(),o=this.type===W.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),o?this.checkLVal(a.argument):this.strict&&"delete"===a.operator&&"Identifier"===a.argument.type?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):e=!0,n=this.finishNode(a,o?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=i.startNodeAt(r,s);u.operator=i.value,u.prefix=!1,u.argument=n,i.checkLVal(n),i.next(),n=i.finishNode(u,"UpdateExpression")}}return!e&&this.eat(W.starstar)?this.buildBinary(r,s,n,this.parseMaybeUnary(null,!1),"**",!1):n},ft.parseExprSubscripts=function(t){var e=this.start,n=this.startLoc,i=this.parseExprAtom(t),r="ArrowFunctionExpression"===i.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(t)||r)return i;var s=this.parseSubscripts(i,e,n);return t&&"MemberExpression"===s.type&&(t.parenthesizedAssign>=s.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=s.start&&(t.parenthesizedBind=-1)),s},ft.parseSubscripts=function(t,e,n,i){for(var r=this,s=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(t.start,t.end),a=void 0;;)if((a=r.eat(W.bracketL))||r.eat(W.dot)){var o=r.startNodeAt(e,n);o.object=t,o.property=a?r.parseExpression():r.parseIdent(!0),o.computed=!!a,a&&r.expect(W.bracketR),t=r.finishNode(o,"MemberExpression")}else if(!i&&r.eat(W.parenL)){var u=new p,h=r.yieldPos,c=r.awaitPos;r.yieldPos=0,r.awaitPos=0;var l=r.parseExprList(W.parenR,r.options.ecmaVersion>=8,!1,u);if(s&&!r.canInsertSemicolon()&&r.eat(W.arrow))return r.checkPatternErrors(u,!1),r.checkYieldAwaitInDefaultParams(),r.yieldPos=h,r.awaitPos=c,r.parseArrowExpression(r.startNodeAt(e,n),l,!0);r.checkExpressionErrors(u,!0),r.yieldPos=h||r.yieldPos,r.awaitPos=c||r.awaitPos;var f=r.startNodeAt(e,n);f.callee=t,f.arguments=l,t=r.finishNode(f,"CallExpression")}else{if(r.type!==W.backQuote)return t;var d=r.startNodeAt(e,n);d.tag=t,d.quasi=r.parseTemplate({isTagged:!0}),t=r.finishNode(d,"TaggedTemplateExpression")}},ft.parseExprAtom=function(t){var e,n=this.potentialArrowAt===this.start;switch(this.type){case W._super:return this.inFunction||this.raise(this.start,"'super' outside of function or class"),e=this.startNode(),this.next(),this.type!==W.dot&&this.type!==W.bracketL&&this.type!==W.parenL&&this.unexpected(),this.finishNode(e,"Super");case W._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case W.name:var i=this.start,r=this.startLoc,s=this.containsEsc,a=this.parseIdent(this.type!==W.name);if(this.options.ecmaVersion>=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(W._function))return this.parseFunction(this.startNodeAt(i,r),!1,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(W.arrow))return this.parseArrowExpression(this.startNodeAt(i,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===W.name&&!s)return a=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(W.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,r),[a],!0)}return a;case W.regexp:var o=this.value;return e=this.parseLiteral(o.value),e.regex={pattern:o.pattern,flags:o.flags},e;case W.num:case W.string:return this.parseLiteral(this.value);case W._null:case W._true:case W._false:return e=this.startNode(),e.value=this.type===W._null?null:this.type===W._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case W.parenL:var u=this.start,h=this.parseParenAndDistinguishExpression(n);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(t.parenthesizedAssign=u),t.parenthesizedBind<0&&(t.parenthesizedBind=u)),h;case W.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(W.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case W.braceL:return this.parseObj(!1,t);case W._function:return e=this.startNode(),this.next(),this.parseFunction(e,!1);case W._class:return this.parseClass(this.startNode(),!1);case W._new:return this.parseNew();case W.backQuote:return this.parseTemplate();default:this.unexpected()}},ft.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(e,"Literal")},ft.parseParenExpression=function(){this.expect(W.parenL);var t=this.parseExpression();return this.expect(W.parenR),t},ft.parseParenAndDistinguishExpression=function(t){var e,n=this,i=this.start,r=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,o=this.start,u=this.startLoc,h=[],c=!0,l=!1,f=new p,d=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==W.parenR;){if(c?c=!1:n.expect(W.comma),s&&n.afterTrailingComma(W.parenR,!0)){l=!0;break}if(n.type===W.ellipsis){a=n.start,h.push(n.parseParenItem(n.parseRestBinding())),n.type===W.comma&&n.raise(n.start,"Comma is not permitted after the rest element");break}h.push(n.parseMaybeAssign(!1,f,n.parseParenItem))}var g=this.start,x=this.startLoc;if(this.expect(W.parenR),t&&!this.canInsertSemicolon()&&this.eat(W.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=m,this.parseParenArrowList(i,r,h);h.length&&!l||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=m||this.awaitPos,h.length>1?(e=this.startNodeAt(o,u),e.expressions=h,this.finishNodeAt(e,"SequenceExpression",g,x)):e=h[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(i,r);return v.expression=e,this.finishNode(v,"ParenthesizedExpression")}return e},ft.parseParenItem=function(t){return t},ft.parseParenArrowList=function(t,e,n){return this.parseArrowExpression(this.startNodeAt(t,e),n)};var dt=[];ft.parseNew=function(){var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(W.dot)){t.meta=e;var n=this.containsEsc;return t.property=this.parseIdent(!0),("target"!==t.property.name||n)&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var i=this.start,r=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(),i,r,!0),this.eat(W.parenL)?t.arguments=this.parseExprList(W.parenR,this.options.ecmaVersion>=8,!1):t.arguments=dt,this.finishNode(t,"NewExpression")},ft.parseTemplateElement=function(t){var e=t.isTagged,n=this.startNode();return this.type===W.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===W.backQuote,this.finishNode(n,"TemplateElement")},ft.parseTemplate=function(t){var e=this;void 0===t&&(t={});var n=t.isTagged;void 0===n&&(n=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:n});for(i.quasis=[r];!r.tail;)e.expect(W.dollarBraceL),i.expressions.push(e.parseExpression()),e.expect(W.braceR),i.quasis.push(r=e.parseTemplateElement({isTagged:n}));return this.next(),this.finishNode(i,"TemplateLiteral")},ft.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===W.name||this.type===W.num||this.type===W.string||this.type===W.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===W.star)&&!H.test(this.input.slice(this.lastTokEnd,this.start))},ft.parseObj=function(t,e){var n=this,i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(W.braceR);){if(r)r=!1;else if(n.expect(W.comma),n.afterTrailingComma(W.braceR))break;var a=n.parseProperty(t,e);t||n.checkPropClash(a,s,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},ft.parseProperty=function(t,e){var n,i,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(W.ellipsis))return t?(a.argument=this.parseIdent(!1),this.type===W.comma&&this.raise(this.start,"Comma is not permitted after the rest element"), +if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function g(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var r=Object.getPrototypeOf(t);return null===r?void 0:g(r,e,n)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(n)},o=function(){function t(t,e){for(var n=0;n0&&this._setupSubOutputTextures(this.subKernelOutputVariableNames.length))}},{key:"run",value:function(){null===this.program&&this.build.apply(this,arguments);var t=this.paramNames,e=this.paramTypes,n=this.texSize,i=this._webGl;i.useProgram(this.program),i.scissor(0,0,n[0],n[1]),this.hardcodeConstants||(this.setUniform3iv("uOutputDim",this.threadDim),this.setUniform2iv("uTexSize",n)),this.setUniform2f("ratio",n[0]/this.maxTexSize[0],n[1]/this.maxTexSize[1]),this.argumentsLength=0;for(var r=0;r0?t.join(";\n")+";\n":"\n"}},{key:"_replaceArtifacts",value:function(t,e){return t.replace(/[ ]*__([A-Z]+[0-9]*([_]?[A-Z])*)__;\n/g,function(t,n){if(e.hasOwnProperty(n))return e[n];throw"unhandled artifact "+n})}},{key:"_addKernels",value:function(){var t=this,e=this.functionBuilder,n=this._webGl;if(e.addFunctions(this.functions,{constants:this.constants,output:this.output}),e.addNativeFunctions(this.nativeFunctions),e.addKernel(this.fnString,{prototypeOnly:!1,constants:this.constants,output:this.output,debug:this.debug,loopMaxIterations:this.loopMaxIterations,paramNames:this.paramNames,paramTypes:this.paramTypes,constantTypes:this.constantTypes,fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy}),null!==this.subKernels){var i=this.drawBuffers=n.getExtension("WEBGL_draw_buffers");if(!i)throw new Error("could not instantiate draw buffers extension");this.subKernelOutputVariableNames=[],this.subKernels.forEach(function(e){return t._addSubKernel(e)})}else if(null!==this.subKernelProperties){var r=this.drawBuffers=n.getExtension("WEBGL_draw_buffers");if(!r)throw new Error("could not instantiate draw buffers extension");this.subKernelOutputVariableNames=[],Object.keys(this.subKernelProperties).forEach(function(e){return t._addSubKernel(t.subKernelProperties[e])})}}},{key:"_addSubKernel",value:function(t){this.functionBuilder.addSubKernel(t,{prototypeOnly:!1,constants:this.constants,output:this.output,debug:this.debug,loopMaxIterations:this.loopMaxIterations,fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy}),this.subKernelOutputVariableNames.push(t.name+"Result")}},{key:"_getFragShaderString",value:function(t){return null!==this.compiledFragShaderString?this.compiledFragShaderString:this.compiledFragShaderString=this._replaceArtifacts(this.constructor.fragShaderString,this._getFragShaderArtifactMap(t))}},{key:"_getVertShaderString",value:function(t){return null!==this.compiledVertShaderString?this.compiledVertShaderString:this.compiledVertShaderString=this.constructor.vertShaderString}},{key:"toString",value:function(){return f(this)}},{key:"addFunction",value:function(t){this.functionBuilder.addFunction(null,t)}},{key:"destroy",value:function(t){a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this.outputTexture&&this._webGl.deleteTexture(this.outputTexture),this.buffer&&this._webGl.deleteBuffer(this.buffer),this.framebuffer&&this._webGl.deleteFramebuffer(this.framebuffer),this.vertShader&&this._webGl.deleteShader(this.vertShader),this.fragShader&&this._webGl.deleteShader(this.fragShader),this.program&&this._webGl.deleteProgram(this.program);for(var n=Object.keys(this.textureCache),i=0;i=0&&(d[o]=null,m[o]=null)}delete this._webGl}}]),e}(u)},{"../../core/texture":30,"../../core/utils":32,"../kernel-base":8,"./kernel-string":13,"./shader-frag":16,"./shader-vert":17}],15:[function(t,e,n){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var n=0;n0&&e.push(", ");var r=this.getParamType(i);switch(r){case"Texture":case"Input":case"Array":case"HTMLImage":e.push("sampler2D");break;default:e.push("float")}e.push(" "),e.push("user_"),e.push(i)}e.push(") {\n");for(var s=0;s1&&r*s===i)return[r,s];for(var o=Math.sqrt(i),u=Math.ceil(o),h=Math.floor(o);u*h>i;)u--,h=Math.ceil(i/u);return r=h,s=Math.ceil(i/r),[r,s]}},{key:"getDimensions",value:function(t,e){var i=void 0;if(n.isArray(t)){for(var r=[],s=t;n.isArray(s);)r.push(s.length),s=s[0];i=r.reverse()}else if(t instanceof c)i=t.output;else{if(!(t instanceof h))throw"Unknown dimensions of "+t;i=t.size}if(e)for(i=n.clone(i);i.length<3;)i.push(1);return new Int32Array(i)}},{key:"pad",value:function(t,e){function n(t){return Array.apply(null,new Array(t)).map(Number.prototype.valueOf,0)}for(var i=t.length+2*e,r=t.map(function(t){return[].concat(n(e),t,n(e))}),s=0;st)return!1;if(n+=e[i+1],n>=t)return!0}}function n(t,n){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&F.test(String.fromCharCode(t)):n!==!1&&e(t,B)))}function i(t,n){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&M.test(String.fromCharCode(t)):n!==!1&&(e(t,B)||e(t,j)))))}function r(t,e){return new V(t,{beforeExpr:!0,binop:e})}function s(t,e){return void 0===e&&(e={}),e.keyword=t,K[t]=new V(t,e)}function a(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}function o(t,e){return Z.call(t,e)}function u(t,e){for(var n=1,i=0;;){Y.lastIndex=i;var r=Y.exec(t);if(!(r&&r.index=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),tt(e.onToken)){var i=e.onToken;e.onToken=function(t){return i.push(t)}}return tt(e.onComment)&&(e.onComment=c(e,e.onComment)),e}function c(t,e){return function(n,i,r,s,a,o){var u={type:n?"Block":"Line",value:i,start:r,end:s};t.locations&&(u.loc=new nt(this,a,o)),t.ranges&&(u.range=[r,s]),e.push(u)}}function l(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}function p(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}function f(t,e,n,i){return t.type=e,t.end=n,this.options.locations&&(t.loc.end=i),this.options.ranges&&(t.range[1]=n),t}function d(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(1023&t)+56320))}function m(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function g(t){return n(t,!0)||36===t||95===t}function x(t){return i(t,!0)||36===t||95===t||8204===t||8205===t}function v(t){return t>=65&&t<=90||t>=97&&t<=122}function y(t){return t>=0&&t<=1114111}function b(t){return 100===t||68===t||115===t||83===t||119===t||87===t}function _(t){return v(t)||95===t}function E(t){return _(t)||T(t)}function T(t){return t>=48&&t<=57}function S(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function k(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}function w(t){return t>=48&&t<=55}function A(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(1023&t)+56320))}function R(t,e){return new st(e,t).parse()}function O(t,e,n){var i=new st(n,t,e);return i.nextToken(),i.parseExpression()}function C(t,e){return new st(e,t)}function I(e,n,i){t.parse_dammit=e,t.LooseParser=n,t.pluginsLoose=i}var D={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},P="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",N={5:P,6:P+" const class extends export import super"},L=/^in(stanceof)?$/,U="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",G="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",F=new RegExp("["+U+"]"),M=new RegExp("["+U+G+"]");U=G=null;var B=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],j=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],V=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null},z={beforeExpr:!0},X={startsExpr:!0},K={},W={num:new V("num",X),regexp:new V("regexp",X),string:new V("string",X),name:new V("name",X),eof:new V("eof"),bracketL:new V("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new V("]"),braceL:new V("{",{beforeExpr:!0,startsExpr:!0}),braceR:new V("}"),parenL:new V("(",{beforeExpr:!0,startsExpr:!0}),parenR:new V(")"),comma:new V(",",z),semi:new V(";",z),colon:new V(":",z),dot:new V("."),question:new V("?",z),arrow:new V("=>",z),template:new V("template"),invalidTemplate:new V("invalidTemplate"),ellipsis:new V("...",z),backQuote:new V("`",X),dollarBraceL:new V("${",{beforeExpr:!0,startsExpr:!0}),eq:new V("=",{beforeExpr:!0,isAssign:!0}),assign:new V("_=",{beforeExpr:!0,isAssign:!0}),incDec:new V("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new V("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:r("||",1),logicalAND:r("&&",2),bitwiseOR:r("|",3),bitwiseXOR:r("^",4),bitwiseAND:r("&",5),equality:r("==/!=/===/!==",6),relational:r("/<=/>=",7),bitShift:r("<>/>>>",8),plusMin:new V("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:r("%",10),star:r("*",10),slash:r("/",10),starstar:new V("**",{beforeExpr:!0}),_break:s("break"),_case:s("case",z),_catch:s("catch"),_continue:s("continue"),_debugger:s("debugger"),_default:s("default",z),_do:s("do",{isLoop:!0,beforeExpr:!0}),_else:s("else",z),_finally:s("finally"),_for:s("for",{isLoop:!0}),_function:s("function",X),_if:s("if"),_return:s("return",z),_switch:s("switch"),_throw:s("throw",z),_try:s("try"),_var:s("var"),_const:s("const"),_while:s("while",{isLoop:!0}),_with:s("with"),_new:s("new",{beforeExpr:!0,startsExpr:!0}),_this:s("this",X),_super:s("super",X),_class:s("class",X),_extends:s("extends",z),_export:s("export"),_import:s("import"),_null:s("null",X),_true:s("true",X),_false:s("false",X),_in:s("in",{beforeExpr:!0,binop:7}),_instanceof:s("instanceof",{beforeExpr:!0,binop:7}),_typeof:s("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:s("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:s("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},H=/\r\n?|\n|\u2028|\u2029/,Y=new RegExp(H.source,"g"),q=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,J=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Q=Object.prototype,Z=Q.hasOwnProperty,$=Q.toString,tt=Array.isArray||function(t){return"[object Array]"===$.call(t)},et=function(t,e){this.line=t,this.column=e};et.prototype.offset=function(t){return new et(this.line,this.column+t)};var nt=function(t,e,n){this.start=e,this.end=n,null!==t.sourceFile&&(this.source=t.sourceFile)},it={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},rt={},st=function(t,e,n){this.options=t=h(t),this.sourceFile=t.sourceFile,this.keywords=l(N[t.ecmaVersion>=6?6:5]);var i="";if(!t.allowReserved){for(var r=t.ecmaVersion;!(i=D[r]);r--);"module"===t.sourceType&&(i+=" await")}this.reservedWords=l(i);var s=(i?i+" ":"")+D.strict;this.reservedWordsStrict=l(s),this.reservedWordsStrictBind=l(s+" "+D.strictBind),this.input=String(e),this.containsEsc=!1,this.loadPlugins(t.plugins),n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(H).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=W.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope(),this.regexpState=null};st.prototype.isKeyword=function(t){return this.keywords.test(t)},st.prototype.isReservedWord=function(t){return this.reservedWords.test(t)},st.prototype.extend=function(t,e){this[t]=e(this[t])},st.prototype.loadPlugins=function(t){var e=this;for(var n in t){var i=rt[n];if(!i)throw new Error("Plugin '"+n+"' not found");i(e,t[n])}},st.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};var at=st.prototype,ot=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/;at.strictDirective=function(t){for(var e=this;;){J.lastIndex=t,t+=J.exec(e.input)[0].length;var n=ot.exec(e.input.slice(t));if(!n)return!1;if("use strict"===(n[1]||n[2]))return!0;t+=n[0].length}},at.eat=function(t){return this.type===t&&(this.next(),!0)},at.isContextual=function(t){return this.type===W.name&&this.value===t&&!this.containsEsc},at.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},at.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},at.canInsertSemicolon=function(){return this.type===W.eof||this.type===W.braceR||H.test(this.input.slice(this.lastTokEnd,this.start))},at.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},at.semicolon=function(){this.eat(W.semi)||this.insertSemicolon()||this.unexpected()},at.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},at.expect=function(t){this.eat(t)||this.unexpected()},at.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},at.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var n=e?t.parenthesizedAssign:t.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},at.checkExpressionErrors=function(t,e){if(!t)return!1;var n=t.shorthandAssign,i=t.doubleProto;return e?(n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),void(i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property"))):n>=0||i>=0},at.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(t.sourceType=this.options.sourceType),this.finishNode(t,"Program")};var ht={kind:"loop"},ct={kind:"switch"};ut.isLet=function(){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;J.lastIndex=this.pos;var t=J.exec(this.input),e=this.pos+t[0].length,r=this.input.charCodeAt(e);if(91===r||123===r)return!0;if(n(r,!0)){for(var s=e+1;i(this.input.charCodeAt(s),!0);)++s;var a=this.input.slice(e,s);if(!L.test(a))return!0}return!1},ut.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;J.lastIndex=this.pos;var t=J.exec(this.input),e=this.pos+t[0].length;return!(H.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!==this.input.length&&i(this.input.charAt(e+8)))},ut.parseStatement=function(t,e,n){var i,r=this.type,s=this.startNode();switch(this.isLet()&&(r=W._var,i="let"),r){case W._break:case W._continue:return this.parseBreakContinueStatement(s,r.keyword);case W._debugger:return this.parseDebuggerStatement(s);case W._do: +return this.parseDoStatement(s);case W._for:return this.parseForStatement(s);case W._function:return!t&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1);case W._class:return t||this.unexpected(),this.parseClass(s,!0);case W._if:return this.parseIfStatement(s);case W._return:return this.parseReturnStatement(s);case W._switch:return this.parseSwitchStatement(s);case W._throw:return this.parseThrowStatement(s);case W._try:return this.parseTryStatement(s);case W._const:case W._var:return i=i||this.value,t||"var"===i||this.unexpected(),this.parseVarStatement(s,i);case W._while:return this.parseWhileStatement(s);case W._with:return this.parseWithStatement(s);case W.braceL:return this.parseBlock();case W.semi:return this.parseEmptyStatement(s);case W._export:case W._import:return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===W._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return t||this.unexpected(),this.next(),this.parseFunctionStatement(s,!0);var a=this.value,o=this.parseExpression();return r===W.name&&"Identifier"===o.type&&this.eat(W.colon)?this.parseLabeledStatement(s,a,o):this.parseExpressionStatement(s,o)}},ut.parseBreakContinueStatement=function(t,e){var n=this,i="break"===e;this.next(),this.eat(W.semi)||this.insertSemicolon()?t.label=null:this.type!==W.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(W.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},ut.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.inAsync&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ht),this.enterLexicalScope(),this.expect(W.parenL),this.type===W.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var n=this.isLet();if(this.type===W._var||this.type===W._const||n){var i=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),!(this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==i.declarations.length||"var"!==r&&i.declarations[0].init?(e>-1&&this.unexpected(e),this.parseFor(t,i)):(this.options.ecmaVersion>=9&&(this.type===W._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,i))}var s=new p,a=this.parseExpression(!0,s);return this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===W._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(a,!1,s),this.checkLVal(a),this.parseForIn(t,a)):(this.checkExpressionErrors(s,!0),e>-1&&this.unexpected(e),this.parseFor(t,a))},ut.parseFunctionStatement=function(t,e){return this.next(),this.parseFunction(t,!0,!1,e)},ut.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement(!this.strict&&this.type===W._function),t.alternate=this.eat(W._else)?this.parseStatement(!this.strict&&this.type===W._function):null,this.finishNode(t,"IfStatement")},ut.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(W.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},ut.parseSwitchStatement=function(t){var e=this;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(W.braceL),this.labels.push(ct),this.enterLexicalScope();for(var n,i=!1;this.type!==W.braceR;)if(e.type===W._case||e.type===W._default){var r=e.type===W._case;n&&e.finishNode(n,"SwitchCase"),t.cases.push(n=e.startNode()),n.consequent=[],e.next(),r?n.test=e.parseExpression():(i&&e.raiseRecoverable(e.lastTokStart,"Multiple default clauses"),i=!0,n.test=null),e.expect(W.colon)}else n||e.unexpected(),n.consequent.push(e.parseStatement(!0));return this.exitLexicalScope(),n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},ut.parseThrowStatement=function(t){return this.next(),H.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var lt=[];ut.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===W._catch){var e=this.startNode();this.next(),this.eat(W.parenL)?(e.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(e.param,"let"),this.expect(W.parenR)):(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterLexicalScope()),e.body=this.parseBlock(!1),this.exitLexicalScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(W._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},ut.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},ut.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(ht),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"WhileStatement")},ut.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement(!1),this.finishNode(t,"WithStatement")},ut.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},ut.parseLabeledStatement=function(t,e,n){for(var i=this,r=0,s=i.labels;r=0;u--){var h=i.labels[u];if(h.statementStart!==t.start)break;h.statementStart=i.start,h.kind=o}return this.labels.push({name:e,kind:o,statementStart:this.start}),t.body=this.parseStatement(!0),("ClassDeclaration"===t.body.type||"VariableDeclaration"===t.body.type&&"var"!==t.body.kind||"FunctionDeclaration"===t.body.type&&(this.strict||t.body.generator))&&this.raiseRecoverable(t.body.start,"Invalid labeled declaration"),this.labels.pop(),t.label=n,this.finishNode(t,"LabeledStatement")},ut.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},ut.parseBlock=function(t){var e=this;void 0===t&&(t=!0);var n=this.startNode();for(n.body=[],this.expect(W.braceL),t&&this.enterLexicalScope();!this.eat(W.braceR);){var i=e.parseStatement(!0);n.body.push(i)}return t&&this.exitLexicalScope(),this.finishNode(n,"BlockStatement")},ut.parseFor=function(t,e){return t.init=e,this.expect(W.semi),t.test=this.type===W.semi?null:this.parseExpression(),this.expect(W.semi),t.update=this.type===W.parenR?null:this.parseExpression(),this.expect(W.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"ForStatement")},ut.parseForIn=function(t,e){var n=this.type===W._in?"ForInStatement":"ForOfStatement";return this.next(),"ForInStatement"===n&&("AssignmentPattern"===e.type||"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(this.strict||"Identifier"!==e.declarations[0].id.type))&&this.raise(e.start,"Invalid assignment in for-in loop head"),t.left=e,t.right="ForInStatement"===n?this.parseExpression():this.parseMaybeAssign(),this.expect(W.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,n)},ut.parseVar=function(t,e,n){var i=this;for(t.declarations=[],t.kind=n;;){var r=i.startNode();if(i.parseVarId(r,n),i.eat(W.eq)?r.init=i.parseMaybeAssign(e):"const"!==n||i.type===W._in||i.options.ecmaVersion>=6&&i.isContextual("of")?"Identifier"===r.id.type||e&&(i.type===W._in||i.isContextual("of"))?r.init=null:i.raise(i.lastTokEnd,"Complex binding patterns require an initialization value"):i.unexpected(),t.declarations.push(i.finishNode(r,"VariableDeclarator")),!i.eat(W.comma))break}return t},ut.parseVarId=function(t,e){t.id=this.parseBindingAtom(e),this.checkLVal(t.id,e,!1)},ut.parseFunction=function(t,e,n,i){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(t.generator=this.eat(W.star)),this.options.ecmaVersion>=8&&(t.async=!!i),e&&(t.id="nullableID"===e&&this.type!==W.name?null:this.parseIdent(),t.id&&this.checkLVal(t.id,"var"));var r=this.inGenerator,s=this.inAsync,a=this.yieldPos,o=this.awaitPos,u=this.inFunction;return this.inGenerator=t.generator,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),e||(t.id=this.type===W.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,n),this.inGenerator=r,this.inAsync=s,this.yieldPos=a,this.awaitPos=o,this.inFunction=u,this.finishNode(t,e?"FunctionDeclaration":"FunctionExpression")},ut.parseFunctionParams=function(t){this.expect(W.parenL),t.params=this.parseBindingList(W.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},ut.parseClass=function(t,e){var n=this;this.next(),this.parseClassId(t,e),this.parseClassSuper(t);var i=this.startNode(),r=!1;for(i.body=[],this.expect(W.braceL);!this.eat(W.braceR);){var s=n.parseClassMember(i);s&&"MethodDefinition"===s.type&&"constructor"===s.kind&&(r&&n.raise(s.start,"Duplicate constructor in the same class"),r=!0)}return t.body=this.finishNode(i,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},ut.parseClassMember=function(t){var e=this;if(this.eat(W.semi))return null;var n=this.startNode(),i=function(t,i){void 0===i&&(i=!1);var r=e.start,s=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===W.parenL||i&&e.canInsertSemicolon())||(n.key&&e.unexpected(),n.computed=!1,n.key=e.startNodeAt(r,s),n.key.name=t,e.finishNode(n.key,"Identifier"),!1))};n.kind="method",n["static"]=i("static");var r=this.eat(W.star),s=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(W.star)):i("get")?n.kind="get":i("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var a=n.key;return n.computed||n["static"]||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?n["static"]&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),r&&this.raise(a.start,"Constructor can't be a generator"),s&&this.raise(a.start,"Constructor can't be an async method"),n.kind="constructor"),this.parseClassMethod(t,n,r,s),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},ut.parseClassMethod=function(t,e,n,i){e.value=this.parseMethod(n,i),t.body.push(this.finishNode(e,"MethodDefinition"))},ut.parseClassId=function(t,e){t.id=this.type===W.name?this.parseIdent():e===!0?this.unexpected():null},ut.parseClassSuper=function(t){t.superClass=this.eat(W._extends)?this.parseExprSubscripts():null},ut.parseExport=function(t,e){var n=this;if(this.next(),this.eat(W.star))return this.expectContextual("from"),this.type!==W.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(W._default)){this.checkExport(e,"default",this.lastTokStart);var i;if(this.type===W._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),t.declaration=this.parseFunction(r,"nullableID",!1,i)}else if(this.type===W._class){var s=this.startNode();t.declaration=this.parseClass(s,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(!0),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==W.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var a=0,o=t.specifiers;a=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,s=t.properties;r=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var i,r=t.key;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var s=t.kind;if(this.options.ecmaVersion>=6)return void("__proto__"===i&&"init"===s&&(e.proto&&(n&&n.doubleProto<0?n.doubleProto=r.start:this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),e.proto=!0));i="$"+i;var a=e[i];if(a){var o;o="init"===s?this.strict&&a.init||a.get||a.set:a.init||a[s],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=e[i]={init:!1,get:!1,set:!1};a[s]=!0}},ft.parseExpression=function(t,e){var n=this,i=this.start,r=this.startLoc,s=this.parseMaybeAssign(t,e);if(this.type===W.comma){var a=this.startNodeAt(i,r);for(a.expressions=[s];this.eat(W.comma);)a.expressions.push(n.parseMaybeAssign(t,e));return this.finishNode(a,"SequenceExpression")}return s},ft.parseMaybeAssign=function(t,e,n){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var i=!1,r=-1,s=-1;e?(r=e.parenthesizedAssign,s=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new p,i=!0);var a=this.start,o=this.startLoc;this.type!==W.parenL&&this.type!==W.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(t,e);if(n&&(u=n.call(this,u,a,o)),this.type.isAssign){var h=this.startNodeAt(a,o);return h.operator=this.value,h.left=this.type===W.eq?this.toAssignable(u,!1,e):u,i||p.call(e),e.shorthandAssign=-1,this.checkLVal(u),this.next(),h.right=this.parseMaybeAssign(t),this.finishNode(h,"AssignmentExpression")}return i&&this.checkExpressionErrors(e,!0),r>-1&&(e.parenthesizedAssign=r),s>-1&&(e.trailingComma=s),u},ft.parseMaybeConditional=function(t,e){var n=this.start,i=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(this.eat(W.question)){var s=this.startNodeAt(n,i);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect(W.colon),s.alternate=this.parseMaybeAssign(t),this.finishNode(s,"ConditionalExpression")}return r},ft.parseExprOps=function(t,e){var n=this.start,i=this.startLoc,r=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)?r:r.start===n&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,n,i,-1,t)},ft.parseExprOp=function(t,e,n,i,r){var s=this.type.binop;if(null!=s&&(!r||this.type!==W._in)&&s>i){var a=this.type===W.logicalOR||this.type===W.logicalAND,o=this.value;this.next();var u=this.start,h=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1),u,h,s,r),l=this.buildBinary(e,n,t,c,o,a);return this.parseExprOp(l,e,n,i,r)}return t},ft.buildBinary=function(t,e,n,i,r,s){var a=this.startNodeAt(t,e);return a.left=n,a.operator=r,a.right=i,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")},ft.parseMaybeUnary=function(t,e){var n,i=this,r=this.start,s=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))n=this.parseAwait(),e=!0;else if(this.type.prefix){var a=this.startNode(),o=this.type===W.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),o?this.checkLVal(a.argument):this.strict&&"delete"===a.operator&&"Identifier"===a.argument.type?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):e=!0,n=this.finishNode(a,o?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=i.startNodeAt(r,s);u.operator=i.value,u.prefix=!1,u.argument=n,i.checkLVal(n),i.next(),n=i.finishNode(u,"UpdateExpression")}}return!e&&this.eat(W.starstar)?this.buildBinary(r,s,n,this.parseMaybeUnary(null,!1),"**",!1):n},ft.parseExprSubscripts=function(t){var e=this.start,n=this.startLoc,i=this.parseExprAtom(t),r="ArrowFunctionExpression"===i.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(t)||r)return i;var s=this.parseSubscripts(i,e,n);return t&&"MemberExpression"===s.type&&(t.parenthesizedAssign>=s.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=s.start&&(t.parenthesizedBind=-1)),s},ft.parseSubscripts=function(t,e,n,i){for(var r=this,s=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(t.start,t.end),a=void 0;;)if((a=r.eat(W.bracketL))||r.eat(W.dot)){var o=r.startNodeAt(e,n);o.object=t,o.property=a?r.parseExpression():r.parseIdent(!0),o.computed=!!a,a&&r.expect(W.bracketR),t=r.finishNode(o,"MemberExpression")}else if(!i&&r.eat(W.parenL)){var u=new p,h=r.yieldPos,c=r.awaitPos;r.yieldPos=0,r.awaitPos=0;var l=r.parseExprList(W.parenR,r.options.ecmaVersion>=8,!1,u);if(s&&!r.canInsertSemicolon()&&r.eat(W.arrow))return r.checkPatternErrors(u,!1),r.checkYieldAwaitInDefaultParams(),r.yieldPos=h,r.awaitPos=c,r.parseArrowExpression(r.startNodeAt(e,n),l,!0);r.checkExpressionErrors(u,!0),r.yieldPos=h||r.yieldPos,r.awaitPos=c||r.awaitPos;var f=r.startNodeAt(e,n);f.callee=t,f.arguments=l,t=r.finishNode(f,"CallExpression")}else{if(r.type!==W.backQuote)return t;var d=r.startNodeAt(e,n);d.tag=t,d.quasi=r.parseTemplate({isTagged:!0}),t=r.finishNode(d,"TaggedTemplateExpression")}},ft.parseExprAtom=function(t){var e,n=this.potentialArrowAt===this.start;switch(this.type){case W._super:return this.inFunction||this.raise(this.start,"'super' outside of function or class"),e=this.startNode(),this.next(),this.type!==W.dot&&this.type!==W.bracketL&&this.type!==W.parenL&&this.unexpected(),this.finishNode(e,"Super");case W._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case W.name:var i=this.start,r=this.startLoc,s=this.containsEsc,a=this.parseIdent(this.type!==W.name);if(this.options.ecmaVersion>=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(W._function))return this.parseFunction(this.startNodeAt(i,r),!1,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(W.arrow))return this.parseArrowExpression(this.startNodeAt(i,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===W.name&&!s)return a=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(W.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,r),[a],!0)}return a;case W.regexp:var o=this.value;return e=this.parseLiteral(o.value),e.regex={pattern:o.pattern,flags:o.flags},e;case W.num:case W.string:return this.parseLiteral(this.value);case W._null:case W._true:case W._false:return e=this.startNode(),e.value=this.type===W._null?null:this.type===W._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case W.parenL:var u=this.start,h=this.parseParenAndDistinguishExpression(n);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(t.parenthesizedAssign=u),t.parenthesizedBind<0&&(t.parenthesizedBind=u)),h;case W.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(W.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case W.braceL:return this.parseObj(!1,t);case W._function:return e=this.startNode(),this.next(),this.parseFunction(e,!1);case W._class:return this.parseClass(this.startNode(),!1);case W._new:return this.parseNew();case W.backQuote:return this.parseTemplate();default:this.unexpected()}},ft.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(e,"Literal")},ft.parseParenExpression=function(){this.expect(W.parenL);var t=this.parseExpression();return this.expect(W.parenR),t},ft.parseParenAndDistinguishExpression=function(t){var e,n=this,i=this.start,r=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,o=this.start,u=this.startLoc,h=[],c=!0,l=!1,f=new p,d=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==W.parenR;){if(c?c=!1:n.expect(W.comma),s&&n.afterTrailingComma(W.parenR,!0)){l=!0;break}if(n.type===W.ellipsis){a=n.start,h.push(n.parseParenItem(n.parseRestBinding())),n.type===W.comma&&n.raise(n.start,"Comma is not permitted after the rest element");break}h.push(n.parseMaybeAssign(!1,f,n.parseParenItem))}var g=this.start,x=this.startLoc;if(this.expect(W.parenR),t&&!this.canInsertSemicolon()&&this.eat(W.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=m,this.parseParenArrowList(i,r,h);h.length&&!l||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=m||this.awaitPos,h.length>1?(e=this.startNodeAt(o,u),e.expressions=h,this.finishNodeAt(e,"SequenceExpression",g,x)):e=h[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(i,r);return v.expression=e,this.finishNode(v,"ParenthesizedExpression")}return e},ft.parseParenItem=function(t){return t},ft.parseParenArrowList=function(t,e,n){return this.parseArrowExpression(this.startNodeAt(t,e),n)};var dt=[];ft.parseNew=function(){var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(W.dot)){t.meta=e;var n=this.containsEsc;return t.property=this.parseIdent(!0),("target"!==t.property.name||n)&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var i=this.start,r=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(),i,r,!0),this.eat(W.parenL)?t.arguments=this.parseExprList(W.parenR,this.options.ecmaVersion>=8,!1):t.arguments=dt,this.finishNode(t,"NewExpression")},ft.parseTemplateElement=function(t){var e=t.isTagged,n=this.startNode();return this.type===W.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===W.backQuote,this.finishNode(n,"TemplateElement")},ft.parseTemplate=function(t){var e=this;void 0===t&&(t={});var n=t.isTagged;void 0===n&&(n=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:n});for(i.quasis=[r];!r.tail;)e.expect(W.dollarBraceL),i.expressions.push(e.parseExpression()),e.expect(W.braceR),i.quasis.push(r=e.parseTemplateElement({isTagged:n}));return this.next(),this.finishNode(i,"TemplateLiteral")},ft.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===W.name||this.type===W.num||this.type===W.string||this.type===W.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===W.star)&&!H.test(this.input.slice(this.lastTokEnd,this.start))},ft.parseObj=function(t,e){var n=this,i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(W.braceR);){if(r)r=!1;else if(n.expect(W.comma),n.afterTrailingComma(W.braceR))break;var a=n.parseProperty(t,e);t||n.checkPropClash(a,s,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},ft.parseProperty=function(t,e){var n,i,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(W.ellipsis))return t?(a.argument=this.parseIdent(!1),this.type===W.comma&&this.raise(this.start,"Comma is not permitted after the rest element"), this.finishNode(a,"RestElement")):(this.type===W.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,e),this.type===W.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(t||e)&&(r=this.start,s=this.startLoc),t||(n=this.eat(W.star)));var o=this.containsEsc;return this.parsePropertyName(a),!t&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(a)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(W.star),this.parsePropertyName(a,e)):i=!1,this.parsePropertyValue(a,t,n,i,r,s,e,o),this.finishNode(a,"Property")},ft.parsePropertyValue=function(t,e,n,i,r,s,a,o){if((n||i)&&this.type===W.colon&&this.unexpected(),this.eat(W.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===W.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(n,i);else if(e||o||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===W.comma||this.type===W.braceR)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?(this.checkUnreserved(t.key),t.kind="init",e?t.value=this.parseMaybeDefault(r,s,t.key):this.type===W.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,s,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(n||i)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var u="get"===t.kind?0:1;if(t.value.params.length!==u){var h=t.value.start;"get"===t.kind?this.raiseRecoverable(h,"getter should have no params"):this.raiseRecoverable(h,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},ft.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(W.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(W.bracketR),t.key;t.computed=!1}return t.key=this.type===W.num||this.type===W.string?this.parseExprAtom():this.parseIdent(!0)},ft.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=!1,t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},ft.parseMethod=function(t,e){var n=this.startNode(),i=this.inGenerator,r=this.inAsync,s=this.yieldPos,a=this.awaitPos,o=this.inFunction;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=t),this.options.ecmaVersion>=8&&(n.async=!!e),this.inGenerator=n.generator,this.inAsync=n.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),this.expect(W.parenL),n.params=this.parseBindingList(W.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1),this.inGenerator=i,this.inAsync=r,this.yieldPos=s,this.awaitPos=a,this.inFunction=o,this.finishNode(n,"FunctionExpression")},ft.parseArrowExpression=function(t,e,n){var i=this.inGenerator,r=this.inAsync,s=this.yieldPos,a=this.awaitPos,o=this.inFunction;return this.enterFunctionScope(),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!n),this.inGenerator=!1,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0),this.inGenerator=i,this.inAsync=r,this.yieldPos=s,this.awaitPos=a,this.inFunction=o,this.finishNode(t,"ArrowFunctionExpression")},ft.parseFunctionBody=function(t,e){var n=e&&this.type!==W.braceL,i=this.strict,r=!1;if(n)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);i&&!s||(r=this.strictDirective(this.end),r&&s&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var a=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(t,!i&&!r&&!e&&this.isSimpleParamList(t.params)),t.body=this.parseBlock(!1),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=a}this.exitFunctionScope(),this.strict&&t.id&&this.checkLVal(t.id,"none"),this.strict=i},ft.isSimpleParamList=function(t){for(var e=0,n=t;e0;)e[n]=arguments[n+1];for(var i=0,r=e;i=1;e--){var n=t.context[e];if("function"===n.token)return n.generator}return!1},Et.updateContext=function(t){var e,n=this.type;n.keyword&&t===W.dot?this.exprAllowed=!1:(e=n.updateContext)?e.call(this,t):this.exprAllowed=n.beforeExpr},W.parenR.updateContext=W.braceR.updateContext=function(){if(1===this.context.length)return void(this.exprAllowed=!0);var t=this.context.pop();t===_t.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr},W.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?_t.b_stat:_t.b_expr),this.exprAllowed=!0},W.dollarBraceL.updateContext=function(){this.context.push(_t.b_tmpl),this.exprAllowed=!0},W.parenL.updateContext=function(t){var e=t===W._if||t===W._for||t===W._with||t===W._while;this.context.push(e?_t.p_stat:_t.p_expr),this.exprAllowed=!0},W.incDec.updateContext=function(){},W._function.updateContext=W._class.updateContext=function(t){t.beforeExpr&&t!==W.semi&&t!==W._else&&(t!==W.colon&&t!==W.braceL||this.curContext()!==_t.b_stat)?this.context.push(_t.f_expr):this.context.push(_t.f_stat),this.exprAllowed=!1},W.backQuote.updateContext=function(){this.curContext()===_t.q_tmpl?this.context.pop():this.context.push(_t.q_tmpl),this.exprAllowed=!1},W.star.updateContext=function(t){if(t===W._function){var e=this.context.length-1;this.context[e]===_t.f_expr?this.context[e]=_t.f_expr_gen:this.context[e]=_t.f_gen}this.exprAllowed=!0},W.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var Tt={$LONE:["ASCII","ASCII_Hex_Digit","AHex","Alphabetic","Alpha","Any","Assigned","Bidi_Control","Bidi_C","Bidi_Mirrored","Bidi_M","Case_Ignorable","CI","Cased","Changes_When_Casefolded","CWCF","Changes_When_Casemapped","CWCM","Changes_When_Lowercased","CWL","Changes_When_NFKC_Casefolded","CWKCF","Changes_When_Titlecased","CWT","Changes_When_Uppercased","CWU","Dash","Default_Ignorable_Code_Point","DI","Deprecated","Dep","Diacritic","Dia","Emoji","Emoji_Component","Emoji_Modifier","Emoji_Modifier_Base","Emoji_Presentation","Extender","Ext","Grapheme_Base","Gr_Base","Grapheme_Extend","Gr_Ext","Hex_Digit","Hex","IDS_Binary_Operator","IDSB","IDS_Trinary_Operator","IDST","ID_Continue","IDC","ID_Start","IDS","Ideographic","Ideo","Join_Control","Join_C","Logical_Order_Exception","LOE","Lowercase","Lower","Math","Noncharacter_Code_Point","NChar","Pattern_Syntax","Pat_Syn","Pattern_White_Space","Pat_WS","Quotation_Mark","QMark","Radical","Regional_Indicator","RI","Sentence_Terminal","STerm","Soft_Dotted","SD","Terminal_Punctuation","Term","Unified_Ideograph","UIdeo","Uppercase","Upper","Variation_Selector","VS","White_Space","space","XID_Continue","XIDC","XID_Start","XIDS"],General_Category:["Cased_Letter","LC","Close_Punctuation","Pe","Connector_Punctuation","Pc","Control","Cc","cntrl","Currency_Symbol","Sc","Dash_Punctuation","Pd","Decimal_Number","Nd","digit","Enclosing_Mark","Me","Final_Punctuation","Pf","Format","Cf","Initial_Punctuation","Pi","Letter","L","Letter_Number","Nl","Line_Separator","Zl","Lowercase_Letter","Ll","Mark","M","Combining_Mark","Math_Symbol","Sm","Modifier_Letter","Lm","Modifier_Symbol","Sk","Nonspacing_Mark","Mn","Number","N","Open_Punctuation","Ps","Other","C","Other_Letter","Lo","Other_Number","No","Other_Punctuation","Po","Other_Symbol","So","Paragraph_Separator","Zp","Private_Use","Co","Punctuation","P","punct","Separator","Z","Space_Separator","Zs","Spacing_Mark","Mc","Surrogate","Cs","Symbol","S","Titlecase_Letter","Lt","Unassigned","Cn","Uppercase_Letter","Lu"],Script:["Adlam","Adlm","Ahom","Anatolian_Hieroglyphs","Hluw","Arabic","Arab","Armenian","Armn","Avestan","Avst","Balinese","Bali","Bamum","Bamu","Bassa_Vah","Bass","Batak","Batk","Bengali","Beng","Bhaiksuki","Bhks","Bopomofo","Bopo","Brahmi","Brah","Braille","Brai","Buginese","Bugi","Buhid","Buhd","Canadian_Aboriginal","Cans","Carian","Cari","Caucasian_Albanian","Aghb","Chakma","Cakm","Cham","Cherokee","Cher","Common","Zyyy","Coptic","Copt","Qaac","Cuneiform","Xsux","Cypriot","Cprt","Cyrillic","Cyrl","Deseret","Dsrt","Devanagari","Deva","Duployan","Dupl","Egyptian_Hieroglyphs","Egyp","Elbasan","Elba","Ethiopic","Ethi","Georgian","Geor","Glagolitic","Glag","Gothic","Goth","Grantha","Gran","Greek","Grek","Gujarati","Gujr","Gurmukhi","Guru","Han","Hani","Hangul","Hang","Hanunoo","Hano","Hatran","Hatr","Hebrew","Hebr","Hiragana","Hira","Imperial_Aramaic","Armi","Inherited","Zinh","Qaai","Inscriptional_Pahlavi","Phli","Inscriptional_Parthian","Prti","Javanese","Java","Kaithi","Kthi","Kannada","Knda","Katakana","Kana","Kayah_Li","Kali","Kharoshthi","Khar","Khmer","Khmr","Khojki","Khoj","Khudawadi","Sind","Lao","Laoo","Latin","Latn","Lepcha","Lepc","Limbu","Limb","Linear_A","Lina","Linear_B","Linb","Lisu","Lycian","Lyci","Lydian","Lydi","Mahajani","Mahj","Malayalam","Mlym","Mandaic","Mand","Manichaean","Mani","Marchen","Marc","Masaram_Gondi","Gonm","Meetei_Mayek","Mtei","Mende_Kikakui","Mend","Meroitic_Cursive","Merc","Meroitic_Hieroglyphs","Mero","Miao","Plrd","Modi","Mongolian","Mong","Mro","Mroo","Multani","Mult","Myanmar","Mymr","Nabataean","Nbat","New_Tai_Lue","Talu","Newa","Nko","Nkoo","Nushu","Nshu","Ogham","Ogam","Ol_Chiki","Olck","Old_Hungarian","Hung","Old_Italic","Ital","Old_North_Arabian","Narb","Old_Permic","Perm","Old_Persian","Xpeo","Old_South_Arabian","Sarb","Old_Turkic","Orkh","Oriya","Orya","Osage","Osge","Osmanya","Osma","Pahawh_Hmong","Hmng","Palmyrene","Palm","Pau_Cin_Hau","Pauc","Phags_Pa","Phag","Phoenician","Phnx","Psalter_Pahlavi","Phlp","Rejang","Rjng","Runic","Runr","Samaritan","Samr","Saurashtra","Saur","Sharada","Shrd","Shavian","Shaw","Siddham","Sidd","SignWriting","Sgnw","Sinhala","Sinh","Sora_Sompeng","Sora","Soyombo","Soyo","Sundanese","Sund","Syloti_Nagri","Sylo","Syriac","Syrc","Tagalog","Tglg","Tagbanwa","Tagb","Tai_Le","Tale","Tai_Tham","Lana","Tai_Viet","Tavt","Takri","Takr","Tamil","Taml","Tangut","Tang","Telugu","Telu","Thaana","Thaa","Thai","Tibetan","Tibt","Tifinagh","Tfng","Tirhuta","Tirh","Ugaritic","Ugar","Vai","Vaii","Warang_Citi","Wara","Yi","Yiii","Zanabazar_Square","Zanb"]};Array.prototype.push.apply(Tt.$LONE,Tt.General_Category),Tt.gc=Tt.General_Category,Tt.sc=Tt.Script_Extensions=Tt.scx=Tt.Script;var St=st.prototype,kt=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};kt.prototype.reset=function(t,e,n){var i=n.indexOf("u")!==-1;this.start=0|t,this.source=e+"",this.flags=n,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9},kt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},kt.prototype.at=function(t){var e=this.source,n=e.length;if(t>=n)return-1;var i=e.charCodeAt(t);return!this.switchU||i<=55295||i>=57344||t+1>=n?i:(i<<10)+e.charCodeAt(t+1)-56613888},kt.prototype.nextIndex=function(t){var e=this.source,n=e.length;if(t>=n)return n;var i=e.charCodeAt(t);return!this.switchU||i<=55295||i>=57344||t+1>=n?t+1:t+2},kt.prototype.current=function(){return this.at(this.pos)},kt.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},kt.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},kt.prototype.eat=function(t){return this.current()===t&&(this.advance(),!0)},St.validateRegExpFlags=function(t){for(var e=this,n=t.validFlags,i=t.flags,r=0;r-1&&e.raise(t.start,"Duplicate regular expression flag")}},St.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},St.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,n=t.backReferenceNames;e=9&&(n=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!n,!0}return t.pos=e,!1},St.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},St.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},St.regexp_eatBracedQuantifier=function(t,e){var n=t.pos;if(t.eat(123)){var i=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(i=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return r!==-1&&r=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},St.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},St.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},St.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!m(e)&&(t.lastIntValue=e,t.advance(),!0)},St.regexp_eatPatternCharacters=function(t){for(var e=t.pos,n=0;(n=t.current())!==-1&&!m(n);)t.advance();return t.pos!==e},St.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(e===-1||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e)&&(t.advance(),!0)},St.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return t.groupNames.indexOf(t.lastStringValue)!==-1&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},St.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},St.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=d(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=d(t.lastIntValue);return!0}return!1},St.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,n=t.current();return t.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(n=t.lastIntValue),g(n)?(t.lastIntValue=n,!0):(t.pos=e,!1)},St.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,n=t.current();return t.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(n=t.lastIntValue),x(n)?(t.lastIntValue=n,!0):(t.pos=e,!1)},St.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},St.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var n=t.lastIntValue;if(t.switchU)return n>t.maxBackReference&&(t.maxBackReference=n),!0;if(n<=t.numCapturingParens)return!0;t.pos=e}return!1},St.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},St.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},St.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},St.regexp_eatZero=function(t){return 48===t.current()&&!T(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},St.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},St.regexp_eatControlLetter=function(t){var e=t.current();return!!v(e)&&(t.lastIntValue=e%32,t.advance(),!0)},St.regexp_eatRegExpUnicodeEscapeSequence=function(t){var e=t.pos;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var n=t.lastIntValue;if(t.switchU&&n>=55296&&n<=56319){var i=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var r=t.lastIntValue;if(r>=56320&&r<=57343)return t.lastIntValue=1024*(n-55296)+(r-56320)+65536,!0}t.pos=i,t.lastIntValue=n}return!0}if(t.switchU&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&y(t.lastIntValue))return!0;t.switchU&&t.raise("Invalid unicode escape"),t.pos=e}return!1},St.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e)&&(t.lastIntValue=e,t.advance(),!0)},St.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1},St.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(b(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},St.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var n=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,n,i),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var r=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,r),!0}return!1},St.regexp_validateUnicodePropertyNameAndValue=function(t,e,n){Tt.hasOwnProperty(e)&&Tt[e].indexOf(n)!==-1||t.raise("Invalid property name")},St.regexp_validateUnicodePropertyNameOrValue=function(t,e){Tt.$LONE.indexOf(e)===-1&&t.raise("Invalid property name")},St.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";_(e=t.current());)t.lastStringValue+=d(e),t.advance();return""!==t.lastStringValue},St.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";E(e=t.current());)t.lastStringValue+=d(e),t.advance();return""!==t.lastStringValue},St.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},St.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},St.regexp_classRanges=function(t){for(var e=this;this.regexp_eatClassAtom(t);){var n=t.lastIntValue;if(t.eat(45)&&e.regexp_eatClassAtom(t)){var i=t.lastIntValue;!t.switchU||n!==-1&&i!==-1||t.raise("Invalid character class"),n!==-1&&i!==-1&&n>i&&t.raise("Range out of order in character class")}}},St.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var n=t.current();(99===n||w(n))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var i=t.current();return 93!==i&&(t.lastIntValue=i,t.advance(),!0)},St.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},St.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!T(e)&&95!==e)&&(t.lastIntValue=e%32,t.advance(),!0)},St.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},St.regexp_eatDecimalDigits=function(t){var e=t.pos,n=0;for(t.lastIntValue=0;T(n=t.current());)t.lastIntValue=10*t.lastIntValue+(n-48),t.advance();return t.pos!==e},St.regexp_eatHexDigits=function(t){var e=t.pos,n=0;for(t.lastIntValue=0;S(n=t.current());)t.lastIntValue=16*t.lastIntValue+k(n),t.advance();return t.pos!==e},St.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var n=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*n+t.lastIntValue:t.lastIntValue=8*e+n}else t.lastIntValue=e;return!0}return!1},St.regexp_eatOctalDigit=function(t){var e=t.current();return w(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},St.regexp_eatFixedHexDigits=function(t,e){var n=t.pos;t.lastIntValue=0;for(var i=0;i=this.input.length?this.finishToken(W.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},At.readToken=function(t){return n(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},At.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);if(t<=55295||t>=57344)return t;var e=this.input.charCodeAt(this.pos+1);return(t<<10)+e-56613888},At.skipBlockComment=function(){var t=this,e=this.options.onComment&&this.curPosition(),n=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations){Y.lastIndex=n;for(var r;(r=Y.exec(this.input))&&r.index8&&e<14||e>=5760&&q.test(String.fromCharCode(e))))break t;++t.pos}}},At.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=t,this.value=e,this.updateContext(n)},At.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(W.ellipsis)):(++this.pos,this.finishToken(W.dot))},At.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(W.assign,2):this.finishOp(W.slash,1)},At.readToken_mult_modulo_exp=function(t){ var e=this.input.charCodeAt(this.pos+1),n=1,i=42===t?W.star:W.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++n,i=W.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(W.assign,n+1):this.finishOp(i,n)},At.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(124===t?W.logicalOR:W.logicalAND,2):61===e?this.finishOp(W.assign,2):this.finishOp(124===t?W.bitwiseOR:W.bitwiseAND,1)},At.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(W.assign,2):this.finishOp(W.bitwiseXOR,1)},At.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!H.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(W.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(W.assign,2):this.finishOp(W.plusMin,1)},At.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),n=1;return e===t?(n=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(W.assign,n+1):this.finishOp(W.bitShift,n)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(n=2),this.finishOp(W.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},At.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(W.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(W.arrow)):this.finishOp(61===t?W.eq:W.prefix,1)},At.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(W.parenL);case 41:return++this.pos,this.finishToken(W.parenR);case 59:return++this.pos,this.finishToken(W.semi);case 44:return++this.pos,this.finishToken(W.comma);case 91:return++this.pos,this.finishToken(W.bracketL);case 93:return++this.pos,this.finishToken(W.bracketR);case 123:return++this.pos,this.finishToken(W.braceL);case 125:return++this.pos,this.finishToken(W.braceR);case 58:return++this.pos,this.finishToken(W.colon);case 63:return++this.pos,this.finishToken(W.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(W.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:return this.finishOp(W.prefix,1)}this.raise(this.pos,"Unexpected character '"+A(t)+"'")},At.finishOp=function(t,e){var n=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,n)},At.readRegexp=function(){for(var t,e,n=this,i=this.pos;;){n.pos>=n.input.length&&n.raise(i,"Unterminated regular expression");var r=n.input.charAt(n.pos);if(H.test(r)&&n.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===r)e=!0;else if("]"===r&&e)e=!1;else if("/"===r&&!e)break;t="\\"===r}++n.pos}var s=this.input.slice(i,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var u=this.regexpState||(this.regexpState=new kt(this));u.reset(i,s,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var h=null;try{h=new RegExp(s,o)}catch(c){}return this.finishToken(W.regexp,{pattern:s,flags:o,value:h})},At.readInt=function(t,e){for(var n=this,i=this.pos,r=0,s=0,a=null==e?1/0:e;s=97?o-97+10:o>=65?o-65+10:o>=48&&o<=57?o-48:1/0,u>=t)break;++n.pos,r=r*t+u}return this.pos===i||null!=e&&this.pos-i!==e?null:r},At.readRadixNumber=function(t){this.pos+=2;var e=this.readInt(t);return null==e&&this.raise(this.start+2,"Expected number in radix "+t),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(W.num,e)},At.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10)||this.raise(e,"Invalid number");var i=this.pos-e>=2&&48===this.input.charCodeAt(e);i&&this.strict&&this.raise(e,"Invalid number"),i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1);var r=this.input.charCodeAt(this.pos);46!==r||i||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||i||(r=this.input.charCodeAt(++this.pos),43!==r&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s=this.input.slice(e,this.pos),a=i?parseInt(s,8):parseFloat(s);return this.finishToken(W.num,a)},At.readCodePoint=function(){var t,e=this.input.charCodeAt(this.pos);if(123===e){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t},At.readString=function(t){for(var e=this,n="",i=++this.pos;;){e.pos>=e.input.length&&e.raise(e.start,"Unterminated string constant");var r=e.input.charCodeAt(e.pos);if(r===t)break;92===r?(n+=e.input.slice(i,e.pos),n+=e.readEscapedChar(!1),i=e.pos):(a(r,e.options.ecmaVersion>=10)&&e.raise(e.start,"Unterminated string constant"),++e.pos)}return n+=this.input.slice(i,this.pos++),this.finishToken(W.string,n)};var Rt={};At.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==Rt)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},At.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Rt;this.raise(t,e)},At.readTmplToken=function(){for(var t=this,e="",n=this.pos;;){t.pos>=t.input.length&&t.raise(t.start,"Unterminated template");var i=t.input.charCodeAt(t.pos);if(96===i||36===i&&123===t.input.charCodeAt(t.pos+1))return t.pos!==t.start||t.type!==W.template&&t.type!==W.invalidTemplate?(e+=t.input.slice(n,t.pos),t.finishToken(W.template,e)):36===i?(t.pos+=2,t.finishToken(W.dollarBraceL)):(++t.pos,t.finishToken(W.backQuote));if(92===i)e+=t.input.slice(n,t.pos),e+=t.readEscapedChar(!0),n=t.pos;else if(a(i)){switch(e+=t.input.slice(n,t.pos),++t.pos,i){case 13:10===t.input.charCodeAt(t.pos)&&++t.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}t.options.locations&&(++t.curLine,t.lineStart=t.pos),n=t.pos}else++t.pos}},At.readInvalidTemplateToken=function(){for(var t=this;this.pos=48&&e<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,e=this.input.charCodeAt(this.pos),"0"===n&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-n.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return String.fromCharCode(e)}},At.readHexChar=function(t){var e=this.pos,n=this.readInt(16,t);return null===n&&this.invalidStringToken(e,"Bad character escape sequence"),n},At.readWord1=function(){var t=this;this.containsEsc=!1;for(var e="",r=!0,s=this.pos,a=this.options.ecmaVersion>=6;this.pos