view on requirebin
Created
September 1, 2013 23:37
-
-
Save hughsk/6408031 to your computer and use it in GitHub Desktop.
requirebin sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var observer = require('continuous-observer') | |
var topdown = require('topdown-physics') | |
var cave = require('cave-automata-2d') | |
var fill = require('ndarray-fill') | |
var aabb = require('aabb-2d') | |
var zero = require('zeros') | |
var raf = require('raf') | |
var canvas = document.createElement('canvas') | |
var ctx = canvas.getContext('2d') | |
// Set up the controls, so that we can control | |
// the camera with the arrow keys or WASD. | |
var controls = require('kb-controls-iframed')({ | |
'<up>': 'up', | |
'<down>': 'down', | |
'<left>': 'left', | |
'<right>': 'right', | |
'W': 'up', | |
'S': 'down', | |
'A': 'left', | |
'D': 'right' | |
}) | |
var field = require('ndarray-continuous')({ | |
shape: [28, 28], // Make each chunk 28 elements high/wide | |
getter: getter | |
}) | |
// This method generates a new chunk for | |
// the continuous ndarray if it's needed. | |
// | |
// Here we're creating an empty ndarray, then | |
// filling it up with cave-automata-2d. We're | |
// also inverting it so that we can get links | |
// between the chunks without much extra work. | |
function getter(position, done) { | |
var array = zero(this.shape) | |
cave(array)(10) | |
invert(array) | |
return done(null, array) | |
} | |
function invert(array) { | |
return fill(array, function(x, y) { | |
return 1 - array.get(x, y) | |
}) | |
} | |
// We'll use continuous-observer to add and remove | |
// chunks as needed, based on the camera's position | |
// each frame. | |
var moveTo = observer(field) | |
var camera = { | |
x: 0, | |
y: 0 | |
} | |
// Create a player axis-aligned bounding box | |
// for and instantiate topdown-physics | |
var player = aabb([0, 0], [1, 1]) | |
var physics = topdown(player, field, { | |
friction: 0.1, | |
interval: 1 / 400, | |
physical: function(n) { | |
// Consider any truthy number in the array to | |
// be a solid object | |
return !!n | |
} | |
}) | |
raf().on('data', function() { | |
if (controls.up) physics.spd[1] = -0.25 | |
if (controls.down) physics.spd[1] = +0.25 | |
if (controls.left) physics.spd[0] = -0.25 | |
if (controls.right) physics.spd[0] = +0.25 | |
physics.tick() | |
camera.x = player.base[0] | |
camera.y = player.base[1] | |
moveTo([camera.x, camera.y]) | |
ctx.fillStyle = '#f2f2f2' | |
ctx.fillRect(0, 0, canvas.width, canvas.height) | |
// Iterate over each chunk in the continuous-ndarray, | |
// drawing each one according to their position on the | |
// grid. | |
field.each(function(chunk) { | |
var pos = chunk.position | |
var w = chunk.shape[0] | |
var h = chunk.shape[1] | |
var offset = { | |
x: chunk.position[0] * chunk.shape[0], | |
y: chunk.position[1] * chunk.shape[1] | |
} | |
ctx.fillStyle = '#af3' | |
for (var x = 0; x < w; x += 1) { | |
for (var y = 0; y < h; y += 1) { | |
if (chunk.get(x, y) > 0) { | |
ctx.fillRect( | |
(offset.x + x - camera.x) * 40 + canvas.width / 2, | |
(offset.y + y - camera.y) * 40 + canvas.height / 2, | |
39, | |
39 | |
) | |
} | |
} | |
} | |
}) | |
ctx.fillStyle = '#f53' | |
ctx.fillRect(canvas.width / 2, canvas.height / 2, 39, 39) | |
}) | |
document.body.style.margin = | |
document.body.style.padding = 0 | |
document.body.style.overflow = 'hidden' | |
document.body.appendChild(canvas) | |
canvas.width = window.innerWidth | |
canvas.height = window.innerHeight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getter(e,t){var r=zero(this.shape);return cave(r)(10),invert(r),t(null,r)}function invert(e){return fill(e,function(t,r){return 1-e.get(t,r)})}require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({"ndarray-fill":[function(e,t){t.exports=e("ZgKnQ/")},{}],"ZgKnQ/":[function(e,t){"use strict";var r=e("cwise")({args:["index","array","scalar"],body:function(e,t,r){t=r.apply(void 0,e)}});t.exports=function(e,t){return r(e,t),e}},{cwise:1}],1:[function(e,t){"use strict";function r(e){for(var t in e)0>o.indexOf(t)&&0>a.indexOf(t)&&console.warn("cwise: Unknown argument '"+t+"' passed to expression compiler");for(var r=0;o.length>r;++r)if(!e[o[r]])throw Error("cwise: Missing argument: "+o[r]);return i({args:e.args,pre:n(e.pre||function(){}),body:n(e.body),post:n(e.post||function(){}),debug:!!e.printCode,funcName:e.funcName||e.body.name||"cwise",blockSize:e.blockSize||64})}var n=e("cwise-parser"),i=e("cwise-compiler"),o=["args","body"],a=["pre","post","printCode","funcName","blockSize"];t.exports=r},{"cwise-parser":2,"cwise-compiler":3}],3:[function(e,t){"use strict";function r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.scalarArgs=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function n(e){var t=new r;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var o=0;n.length>o;++o)switch(n[o]){case"array":if(t.arrayArgs.push(o),t.shimArgs.push("array"+o),t.pre.args.length>o&&t.pre.args[o].count>0)throw Error("cwise: pre() block may not reference array args");if(t.post.args.length>o&&t.post.args[o].count>0)throw Error("cwise: post() block may not reference array args");break;case"scalar":t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);break;case"index":if(t.indexArgs.push(o),t.pre.args.length>o&&t.pre.args[o].count>0)throw Error("cwise: pre() block may not reference array index");if(t.body.args.length>o&&t.body.args[o].lvalue)throw Error("cwise: body() block may not write to array index");if(t.post.args.length>o&&t.post.args[o].count>0)throw Error("cwise: post() block may not reference array index");break;case"shape":if(t.shapeArgs.push(o),t.pre.args.length>o&&t.pre.args[o].lvalue)throw Error("cwise: pre() block may not write to array shape");if(t.body.args.length>o&&t.body.args[o].lvalue)throw Error("cwise: body() block may not write to array shape");if(t.post.args.length>o&&t.post.args[o].lvalue)throw Error("cwise: post() block may not write to array shape");break;default:throw Error("cwise: Unknown argument type "+n[o])}if(0>=t.arrayArgs.length)throw Error("cwise: No array arguments specified");if(t.pre.args.length>n.length)throw Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,i(t)}var i=e("./lib/thunk.js");t.exports=n},{"./lib/thunk.js":4}],2:[function(e,t){"use strict";function r(e,t,r){this.name=e,this.lvalue=t,this.rvalue=r,this.count=0}function n(e,t,r,n){this.body=e,this.args=t,this.thisVars=r,this.localVars=n}function i(e){if("eval"===e)throw Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:"undefined"!=typeof GLOBAL?e in GLOBAL:"undefined"!=typeof self?e in self:!1}function o(e){for(var t=e.body[0].expression.callee.params,r=Array(t.length),n=0;t.length>n;++n)r[n]=t[n].name;return r}function a(e){function t(e){var t=y+e.replace(/\_/g,"__");return E.push(t),t}function a(e){var t="this_"+e.replace(/\_/g,"__");return S.push(t),t}function p(e,t){for(var r=e.range[0],n=e.range[1],i=r+1;n>i;++i)x[i]="";x[r]=t}function l(e){return"'"+e.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'"}function f(e){return x.slice(e.range[0],e.range[1]).join("")}function h(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?j:j|A:"UpdateExpression"===e.parent.type?j|A:A}for(var d=["(",e,")()"].join(""),v=s.parse(d,{range:!0}),y="_inline_"+c++ +"_",m=o(v),g=Array(m.length),b=0;m.length>b;++b)g[b]=new r([y,"arg",b,"_"].join(""),!1,!1);for(var x=Array(d.length),b=0,w=d.length;w>b;++b)x[b]=d.charAt(b);var E=[],S=[],j=1,A=2;(function L(e,r){if(e.parent=r,"MemberExpression"===e.type)e.computed?(L(e.object,e),L(e.property,e)):"ThisExpression"===e.object.type?p(e,a(e.property.name)):L(e.object,e);else{if("ThisExpression"===e.type)throw Error("cwise-parser: Computed this is not allowed");if("Identifier"===e.type){var n=e.name,o=m.indexOf(n);if(o>=0){var s=g[o],u=h(e);u&j&&(s.lvalue=!0),u&A&&(s.rvalue=!0),++s.count,p(e,s.name)}else i(n)||p(e,t(n))}else if("Literal"===e.type)"string"==typeof e.value&&p(e,l(e.value));else{if("WithStatement"===e.type)throw Error("cwise-parser: with() statements not allowed");for(var c=Object.keys(e),f=0,d=c.length;d>f;++f)if("parent"!==c[f]){var v=e[c[f]];if(v)if(v instanceof Array)for(var y=0;v.length>y;++y)v[y]&&"string"==typeof v[y].type&&L(v[y],e);else"string"==typeof v.type&&L(v,e)}}}})(v.body[0].expression.callee.body,void 0),u(E),u(S);var k=new n(f(v.body[0].expression.callee.body),g,S,E);return k}var s=e("esprima"),u=e("uniq"),c=0;t.exports=a},{esprima:5,uniq:6}],4:[function(e,t){"use strict";function r(e){var t=["'use strict'","var CACHED={}"],r=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",e.arrayArgs[0],".shape"].join("")],u=0;e.arrayArgs.length>u;++u){var c=e.arrayArgs[u];r.push(["t",c,"=array",c,".dtype,","r",c,"=array",c,".order"].join("")),o.push("t"+c),o.push("r"+c),a.push("t"+c),a.push("r"+c+".join()"),s.push("array"+c+".data"),s.push("array"+c+".stride"),s.push("array"+c+".offset|0")}for(var u=0;e.scalarArgs.length>u;++u)s.push("scalar"+e.scalarArgs[u]);r.push(["type=[",a.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",s.join(","),")}"].join("")),e.debug&&console.log("Generated thunk:",t.join("\n"));var p=Function("compile",t.join("\n"));return p(n.bind(void 0,e))}var n=e("./compile.js");t.exports=r},{"./compile.js":7}],6:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,i=e[0],o=e[0],a=1;n>a;++a)if(o=i,i=e[a],t(i,o)){if(a===r){r++;continue}e[r++]=i}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],i=e[0],o=1;r>o;++o,i=n)if(i=n,n=e[o],n!==i){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function i(e,t,i){return 0===e.length?[]:t?(i||e.sort(t),r(e,t)):(i||e.sort(),n(e))}t.exports=i},{}],5:[function(e,t,r){(function(){(function(e,t){"use strict";"function"==typeof define&&define.amd?define(["exports"],t):r!==void 0?t(r):t(e.esprima={})})(this,function(e){"use strict";function t(e,t){if(!e)throw Error("ASSERT: "+t)}function r(e,t){return fr.slice(e,t)}function n(e){return"0123456789".indexOf(e)>=0}function i(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function o(e){return"01234567".indexOf(e)>=0}function a(e){return" "===e||" "===e||""===e||"\f"===e||" "===e||e.charCodeAt(0)>=5760&&" ".indexOf(e)>=0}function s(e){return"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e}function u(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e.charCodeAt(0)>=128&&lr.NonAsciiIdentifierStart.test(e)}function c(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&lr.NonAsciiIdentifierPart.test(e)}function p(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function l(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0}return!1}function f(e){return"eval"===e||"arguments"===e}function h(e){var t=!1;switch(e.length){case 2:t="if"===e||"in"===e||"do"===e;break;case 3:t="var"===e||"for"===e||"new"===e||"try"===e;break;case 4:t="this"===e||"else"===e||"case"===e||"void"===e||"with"===e;break;case 5:t="while"===e||"break"===e||"catch"===e||"throw"===e;break;case 6:t="return"===e||"typeof"===e||"delete"===e||"switch"===e;break;case 7:t="default"===e||"finally"===e;break;case 8:t="function"===e||"continue"===e||"debugger"===e;break;case 10:t="instanceof"===e}if(t)return!0;switch(e){case"const":return!0;case"yield":case"let":return!0}return hr&&l(e)?!0:p(e)}function d(){var e,t,r;for(t=!1,r=!1;mr>dr;)if(e=fr[dr],r)e=fr[dr++],s(e)&&(r=!1,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,yr=dr);else if(t)s(e)?("\r"===e&&"\n"===fr[dr+1]&&++dr,++vr,++dr,yr=dr,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")):(e=fr[dr++],dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL"),"*"===e&&(e=fr[dr],"/"===e&&(++dr,t=!1)));else if("/"===e)if(e=fr[dr+1],"/"===e)dr+=2,r=!0;else{if("*"!==e)break;dr+=2,t=!0,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")}else if(a(e))++dr;else{if(!s(e))break;++dr,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,yr=dr}}function v(e){var t,r,n,o=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(mr>dr&&i(fr[dr])))return"";n=fr[dr++],o=16*o+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(o)}function y(){var e,t,r,n;if(e=fr[dr],u(e)){if(t=dr,"\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!u(e))return;r=e}else dr=n,r="u"}else r=fr[dr++];for(;mr>dr&&(e=fr[dr],c(e));)if("\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!c(e))return;r+=e}else dr=n,r+="u"}else r+=fr[dr++];return 1===r.length?{type:ar.Identifier,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:h(r)?{type:ar.Keyword,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:"null"===r?{type:ar.NullLiteral,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:"true"===r||"false"===r?{type:ar.BooleanLiteral,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:{type:ar.Identifier,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}}}function m(){var e,t,r,i=dr,o=fr[dr];return";"===o||"{"===o||"}"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:yr,range:[i,dr]}):","===o||"("===o||")"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:yr,range:[i,dr]}):(e=fr[dr+1],"."!==o||n(e)?(t=fr[dr+2],r=fr[dr+3],">"===o&&">"===e&&">"===t&&"="===r?(dr+=4,{type:ar.Punctuator,value:">>>=",lineNumber:vr,lineStart:yr,range:[i,dr]}):"="===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"===",lineNumber:vr,lineStart:yr,range:[i,dr]}):"!"===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"!==",lineNumber:vr,lineStart:yr,range:[i,dr]}):">"===o&&">"===e&&">"===t?(dr+=3,{type:ar.Punctuator,value:">>>",lineNumber:vr,lineStart:yr,range:[i,dr]}):"<"===o&&"<"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"<<=",lineNumber:vr,lineStart:yr,range:[i,dr]}):">"===o&&">"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:">>=",lineNumber:vr,lineStart:yr,range:[i,dr]}):"="===e&&"<>=!+-*%&|^/".indexOf(o)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:yr,range:[i,dr]}):o===e&&"+-<>&|".indexOf(o)>=0&&"+-<>&|".indexOf(e)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:yr,range:[i,dr]}):"[]<>+-*%&|^!~?:=/".indexOf(o)>=0?{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:yr,range:[i,dr]}:void 0):{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:yr,range:[i,dr]})}function g(){var e,r,a;if(a=fr[dr],t(n(a)||"."===a,"Numeric literal must start with a decimal digit or a decimal point"),r=dr,e="","."!==a){if(e=fr[dr++],a=fr[dr],"0"===e){if("x"===a||"X"===a){for(e+=fr[dr++];mr>dr&&(a=fr[dr],i(a));)e+=fr[dr++];return 2>=e.length&&L({},pr.UnexpectedToken,"ILLEGAL"),mr>dr&&(a=fr[dr],u(a)&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,16),lineNumber:vr,lineStart:yr,range:[r,dr]}}if(o(a)){for(e+=fr[dr++];mr>dr&&(a=fr[dr],o(a));)e+=fr[dr++];return mr>dr&&(a=fr[dr],(u(a)||n(a))&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:vr,lineStart:yr,range:[r,dr]}}n(a)&&L({},pr.UnexpectedToken,"ILLEGAL")}for(;mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++]}if("."===a)for(e+=fr[dr++];mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];if("e"===a||"E"===a)if(e+=fr[dr++],a=fr[dr],("+"===a||"-"===a)&&(e+=fr[dr++]),a=fr[dr],n(a))for(e+=fr[dr++];mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];else a="character "+a,dr>=mr&&(a="<end>"),L({},pr.UnexpectedToken,"ILLEGAL");return mr>dr&&(a=fr[dr],u(a)&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseFloat(e),lineNumber:vr,lineStart:yr,range:[r,dr]}}function b(){var e,r,n,i,a,u,c="",p=!1;for(e=fr[dr],t("'"===e||'"'===e,"String literal must starts with a quote"),r=dr,++dr;mr>dr;){if(n=fr[dr++],n===e){e="";break}if("\\"===n)if(n=fr[dr++],s(n))++vr,"\r"===n&&"\n"===fr[dr]&&++dr;else switch(n){case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"u":case"x":u=dr,a=v(n),a?c+=a:(dr=u,c+=n);break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="";break;default:o(n)?(i="01234567".indexOf(n),0!==i&&(p=!0),mr>dr&&o(fr[dr])&&(p=!0,i=8*i+"01234567".indexOf(fr[dr++]),"0123".indexOf(n)>=0&&mr>dr&&o(fr[dr])&&(i=8*i+"01234567".indexOf(fr[dr++]))),c+=String.fromCharCode(i)):c+=n}else{if(s(n))break;c+=n}}return""!==e&&L({},pr.UnexpectedToken,"ILLEGAL"),{type:ar.StringLiteral,value:c,octal:p,lineNumber:vr,lineStart:yr,range:[r,dr]}}function x(){var e,r,n,i,o,a,u,p=!1,l=!1;for(gr=null,d(),n=dr,r=fr[dr],t("/"===r,"Regular expression literal must start with a slash"),e=fr[dr++];mr>dr;)if(r=fr[dr++],e+=r,"\\"===r)r=fr[dr++],s(r)&&L({},pr.UnterminatedRegExp),e+=r;else if(p)"]"===r&&(p=!1);else{if("/"===r){l=!0;break}"["===r?p=!0:s(r)&&L({},pr.UnterminatedRegExp)}for(l||L({},pr.UnterminatedRegExp),i=e.substr(1,e.length-2),o="";mr>dr&&(r=fr[dr],c(r));)if(++dr,"\\"===r&&mr>dr)if(r=fr[dr],"u"===r)if(++dr,u=dr,r=v("u"))for(o+=r,e+="\\u";dr>u;++u)e+=fr[u];else dr=u,o+="u",e+="\\u";else e+="\\";else o+=r,e+=r;try{a=RegExp(i,o)}catch(f){L({},pr.InvalidRegExp)}return{literal:e,value:a,range:[n,dr]}}function w(e){return e.type===ar.Identifier||e.type===ar.Keyword||e.type===ar.BooleanLiteral||e.type===ar.NullLiteral}function E(){var e,t;return d(),dr>=mr?{type:ar.EOF,lineNumber:vr,lineStart:yr,range:[dr,dr]}:(t=m(),t!==void 0?t:(e=fr[dr],"'"===e||'"'===e?b():"."===e||n(e)?g():(t=y(),t!==void 0?t:(L({},pr.UnexpectedToken,"ILLEGAL"),void 0))))}function S(){var e;return gr?(dr=gr.range[1],vr=gr.lineNumber,yr=gr.lineStart,e=gr,gr=null,e):(gr=null,E())}function j(){var e,t,r;return null!==gr?gr:(e=dr,t=vr,r=yr,gr=E(),dr=e,vr=t,yr=r,gr)}function A(){var e,t,r,n;return e=dr,t=vr,r=yr,d(),n=vr!==t,dr=e,vr=t,yr=r,n}function L(e,t){var r,n=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,function(e,t){return n[t]||""});throw"number"==typeof e.lineNumber?(r=Error("Line "+e.lineNumber+": "+i),r.index=e.range[0],r.lineNumber=e.lineNumber,r.column=e.range[0]-yr+1):(r=Error("Line "+vr+": "+i),r.index=dr,r.lineNumber=vr,r.column=dr-yr+1),r}function k(){try{L.apply(null,arguments)}catch(e){if(!xr.errors)throw e;xr.errors.push(e)}}function _(e){if(e.type===ar.EOF&&L(e,pr.UnexpectedEOS),e.type===ar.NumericLiteral&&L(e,pr.UnexpectedNumber),e.type===ar.StringLiteral&&L(e,pr.UnexpectedString),e.type===ar.Identifier&&L(e,pr.UnexpectedIdentifier),e.type===ar.Keyword){if(p(e.value))L(e,pr.UnexpectedReserved);else if(hr&&l(e.value))return k(e,pr.StrictReservedWord),void 0;L(e,pr.UnexpectedToken,e.value)}L(e,pr.UnexpectedToken,e.value)}function I(e){var t=S();(t.type!==ar.Punctuator||t.value!==e)&&_(t)}function O(e){var t=S();(t.type!==ar.Keyword||t.value!==e)&&_(t)}function N(e){var t=j();return t.type===ar.Punctuator&&t.value===e}function P(e){var t=j();return t.type===ar.Keyword&&t.value===e}function C(){var e=j(),t=e.value;return e.type!==ar.Punctuator?!1:"="===t||"*="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t}function F(){var e,t;if(";"===fr[dr])return S(),void 0;if(t=vr,d(),vr===t){if(N(";"))return S(),void 0;e=j(),e.type===ar.EOF||N("}")||_(e)}}function M(e){return e.type===ur.Identifier||e.type===ur.MemberExpression}function D(){var e=[];for(I("[");!N("]");)N(",")?(S(),e.push(null)):(e.push(ct()),N("]")||I(","));return I("]"),{type:ur.ArrayExpression,elements:e}}function R(e,t){var r,n;return r=hr,n=Dt(),t&&hr&&f(e[0].name)&&k(t,pr.StrictParamName),hr=r,{type:ur.FunctionExpression,id:null,params:e,defaults:[],body:n,rest:null,generator:!1,expression:!1}}function U(){var e=S();return e.type===ar.StringLiteral||e.type===ar.NumericLiteral?(hr&&e.octal&&k(e,pr.StrictOctalLiteral),Zt(e)):{type:ur.Identifier,name:e.value}}function B(){var e,t,r,n;return e=j(),e.type===ar.Identifier?(r=U(),"get"!==e.value||N(":")?"set"!==e.value||N(":")?(I(":"),{type:ur.Property,key:r,value:ct(),kind:"init"}):(t=U(),I("("),e=j(),e.type!==ar.Identifier?(I(")"),k(e,pr.UnexpectedToken,e.value),{type:ur.Property,key:t,value:R([]),kind:"set"}):(n=[ht()],I(")"),{type:ur.Property,key:t,value:R(n,e),kind:"set"})):(t=U(),I("("),I(")"),{type:ur.Property,key:t,value:R([]),kind:"get"})):e.type!==ar.EOF&&e.type!==ar.Punctuator?(t=U(),I(":"),{type:ur.Property,key:t,value:ct(),kind:"init"}):(_(e),void 0)}function T(){var e,t,r,n=[],i={},o=String;for(I("{");!N("}");)e=B(),t=e.key.type===ur.Identifier?e.key.name:o(e.key.value),r="init"===e.kind?cr.Data:"get"===e.kind?cr.Get:cr.Set,Object.prototype.hasOwnProperty.call(i,t)?(i[t]===cr.Data?hr&&r===cr.Data?k({},pr.StrictDuplicateProperty):r!==cr.Data&&k({},pr.AccessorDataProperty):r===cr.Data?k({},pr.AccessorDataProperty):i[t]&r&&k({},pr.AccessorGetSet),i[t]|=r):i[t]=r,n.push(e),N("}")||I(",");return I("}"),{type:ur.ObjectExpression,properties:n}}function q(){var e;return I("("),e=pt(),I(")"),e}function V(){var e=j(),t=e.type;if(t===ar.Identifier)return{type:ur.Identifier,name:S().value};if(t===ar.StringLiteral||t===ar.NumericLiteral)return hr&&e.octal&&k(e,pr.StrictOctalLiteral),Zt(S());if(t===ar.Keyword){if(P("this"))return S(),{type:ur.ThisExpression};if(P("function"))return Ut()}return t===ar.BooleanLiteral?(S(),e.value="true"===e.value,Zt(e)):t===ar.NullLiteral?(S(),e.value=null,Zt(e)):N("[")?D():N("{")?T():N("(")?q():N("/")||N("/=")?Zt(x()):_(S())}function G(){var e=[];if(I("("),!N(")"))for(;mr>dr&&(e.push(ct()),!N(")"));)I(",");return I(")"),e}function z(){var e=S();return w(e)||_(e),{type:ur.Identifier,name:e.value}}function H(){return I("."),z()}function K(){var e;return I("["),e=pt(),I("]"),e}function W(){var e;return O("new"),e={type:ur.NewExpression,callee:X(),arguments:[]},N("(")&&(e.arguments=G()),e}function Z(){var e;for(e=P("new")?W():V();N(".")||N("[")||N("(");)e=N("(")?{type:ur.CallExpression,callee:e,arguments:G()}:N("[")?{type:ur.MemberExpression,computed:!0,object:e,property:K()}:{type:ur.MemberExpression,computed:!1,object:e,property:H()};return e}function X(){var e;for(e=P("new")?W():V();N(".")||N("[");)e=N("[")?{type:ur.MemberExpression,computed:!0,object:e,property:K()}:{type:ur.MemberExpression,computed:!1,object:e,property:H()};return e}function Y(){var e,t=Z();return e=j(),e.type!==ar.Punctuator?t:(!N("++")&&!N("--")||A()||(hr&&t.type===ur.Identifier&&f(t.name)&&k({},pr.StrictLHSPostfix),M(t)||k({},pr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:S().value,argument:t,prefix:!1}),t)}function J(){var e,t;return e=j(),e.type!==ar.Punctuator&&e.type!==ar.Keyword?Y():N("++")||N("--")?(e=S(),t=J(),hr&&t.type===ur.Identifier&&f(t.name)&&k({},pr.StrictLHSPrefix),M(t)||k({},pr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:e.value,argument:t,prefix:!0}):N("+")||N("-")||N("~")||N("!")?t={type:ur.UnaryExpression,operator:S().value,argument:J(),prefix:!0}:P("delete")||P("void")||P("typeof")?(t={type:ur.UnaryExpression,operator:S().value,argument:J(),prefix:!0},hr&&"delete"===t.operator&&t.argument.type===ur.Identifier&&k({},pr.StrictDelete),t):Y()}function $(){for(var e=J();N("*")||N("/")||N("%");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:J()};return e}function Q(){for(var e=$();N("+")||N("-");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:$()};return e}function et(){for(var e=Q();N("<<")||N(">>")||N(">>>");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:Q()};return e}function tt(){var e,t;for(t=br.allowIn,br.allowIn=!0,e=et();N("<")||N(">")||N("<=")||N(">=")||t&&P("in")||P("instanceof");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:et()};return br.allowIn=t,e}function rt(){for(var e=tt();N("==")||N("!=")||N("===")||N("!==");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:tt()};return e}function nt(){for(var e=rt();N("&");)S(),e={type:ur.BinaryExpression,operator:"&",left:e,right:rt()};return e}function it(){for(var e=nt();N("^");)S(),e={type:ur.BinaryExpression,operator:"^",left:e,right:nt()};return e}function ot(){for(var e=it();N("|");)S(),e={type:ur.BinaryExpression,operator:"|",left:e,right:it()};return e}function at(){for(var e=ot();N("&&");)S(),e={type:ur.LogicalExpression,operator:"&&",left:e,right:ot()};return e}function st(){for(var e=at();N("||");)S(),e={type:ur.LogicalExpression,operator:"||",left:e,right:at()};return e}function ut(){var e,t,r;return e=st(),N("?")&&(S(),t=br.allowIn,br.allowIn=!0,r=ct(),br.allowIn=t,I(":"),e={type:ur.ConditionalExpression,test:e,consequent:r,alternate:ct()}),e}function ct(){var e,t;return e=j(),t=ut(),C()&&(M(t)||k({},pr.InvalidLHSInAssignment),hr&&t.type===ur.Identifier&&f(t.name)&&k(e,pr.StrictLHSAssignment),t={type:ur.AssignmentExpression,operator:S().value,left:t,right:ct()}),t}function pt(){var e=ct();if(N(","))for(e={type:ur.SequenceExpression,expressions:[e]};mr>dr&&N(",");)S(),e.expressions.push(ct());return e}function lt(){for(var e,t=[];mr>dr&&!N("}")&&(e=Bt(),void 0!==e);)t.push(e);return t}function ft(){var e;return I("{"),e=lt(),I("}"),{type:ur.BlockStatement,body:e}}function ht(){var e=S();return e.type!==ar.Identifier&&_(e),{type:ur.Identifier,name:e.value}}function dt(e){var t=ht(),r=null;return hr&&f(t.name)&&k({},pr.StrictVarName),"const"===e?(I("="),r=ct()):N("=")&&(S(),r=ct()),{type:ur.VariableDeclarator,id:t,init:r}}function vt(e){var t=[];do{if(t.push(dt(e)),!N(","))break;S()}while(mr>dr);return t}function yt(){var e;return O("var"),e=vt(),F(),{type:ur.VariableDeclaration,declarations:e,kind:"var"}}function mt(e){var t;return O(e),t=vt(e),F(),{type:ur.VariableDeclaration,declarations:t,kind:e}}function gt(){return I(";"),{type:ur.EmptyStatement}}function bt(){var e=pt();return F(),{type:ur.ExpressionStatement,expression:e}}function xt(){var e,t,r;return O("if"),I("("),e=pt(),I(")"),t=Mt(),P("else")?(S(),r=Mt()):r=null,{type:ur.IfStatement,test:e,consequent:t,alternate:r}}function wt(){var e,t,r;return O("do"),r=br.inIteration,br.inIteration=!0,e=Mt(),br.inIteration=r,O("while"),I("("),t=pt(),I(")"),N(";")&&S(),{type:ur.DoWhileStatement,body:e,test:t}}function Et(){var e,t,r;return O("while"),I("("),e=pt(),I(")"),r=br.inIteration,br.inIteration=!0,t=Mt(),br.inIteration=r,{type:ur.WhileStatement,test:e,body:t}}function St(){var e=S();return{type:ur.VariableDeclaration,declarations:vt(),kind:e.value}}function jt(){var e,t,r,n,i,o,a;return e=t=r=null,O("for"),I("("),N(";")?S():(P("var")||P("let")?(br.allowIn=!1,e=St(),br.allowIn=!0,1===e.declarations.length&&P("in")&&(S(),n=e,i=pt(),e=null)):(br.allowIn=!1,e=pt(),br.allowIn=!0,P("in")&&(M(e)||k({},pr.InvalidLHSInForIn),S(),n=e,i=pt(),e=null)),n===void 0&&I(";")),n===void 0&&(N(";")||(t=pt()),I(";"),N(")")||(r=pt())),I(")"),a=br.inIteration,br.inIteration=!0,o=Mt(),br.inIteration=a,n===void 0?{type:ur.ForStatement,init:e,test:t,update:r,body:o}:{type:ur.ForInStatement,left:n,right:i,body:o,each:!1}}function At(){var e,t=null;return O("continue"),";"===fr[dr]?(S(),br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:null}):A()?(br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||L({},pr.UnknownLabel,t.name)),F(),null!==t||br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:t})}function Lt(){var e,t=null;return O("break"),";"===fr[dr]?(S(),br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:null}):A()?(br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||L({},pr.UnknownLabel,t.name)),F(),null!==t||br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:t})}function kt(){var e,t=null;return O("return"),br.inFunctionBody||k({},pr.IllegalReturn)," "===fr[dr]&&u(fr[dr+1])?(t=pt(),F(),{type:ur.ReturnStatement,argument:t}):A()?{type:ur.ReturnStatement,argument:null}:(N(";")||(e=j(),N("}")||e.type===ar.EOF||(t=pt())),F(),{type:ur.ReturnStatement,argument:t})}function _t(){var e,t;return hr&&k({},pr.StrictModeWith),O("with"),I("("),e=pt(),I(")"),t=Mt(),{type:ur.WithStatement,object:e,body:t}}function It(){var e,t,r=[];for(P("default")?(S(),e=null):(O("case"),e=pt()),I(":");mr>dr&&!(N("}")||P("default")||P("case"))&&(t=Mt(),void 0!==t);)r.push(t);return{type:ur.SwitchCase,test:e,consequent:r}}function Ot(){var e,t,r,n,i;if(O("switch"),I("("),e=pt(),I(")"),I("{"),t=[],N("}"))return S(),{type:ur.SwitchStatement,discriminant:e,cases:t};for(n=br.inSwitch,br.inSwitch=!0,i=!1;mr>dr&&!N("}");)r=It(),null===r.test&&(i&&L({},pr.MultipleDefaultsInSwitch),i=!0),t.push(r);return br.inSwitch=n,I("}"),{type:ur.SwitchStatement,discriminant:e,cases:t}}function Nt(){var e;return O("throw"),A()&&L({},pr.NewlineAfterThrow),e=pt(),F(),{type:ur.ThrowStatement,argument:e}}function Pt(){var e;return O("catch"),I("("),N(")")&&_(j()),e=ht(),hr&&f(e.name)&&k({},pr.StrictCatchVariable),I(")"),{type:ur.CatchClause,param:e,body:ft()}}function Ct(){var e,t=[],r=null;return O("try"),e=ft(),P("catch")&&t.push(Pt()),P("finally")&&(S(),r=ft()),0!==t.length||r||L({},pr.NoCatchOrFinally),{type:ur.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:r}}function Ft(){return O("debugger"),F(),{type:ur.DebuggerStatement}}function Mt(){var e,t,r=j();if(r.type===ar.EOF&&_(r),r.type===ar.Punctuator)switch(r.value){case";":return gt();case"{":return ft();case"(":return bt();default:}if(r.type===ar.Keyword)switch(r.value){case"break":return Lt();case"continue":return At();case"debugger":return Ft();case"do":return wt();case"for":return jt();case"function":return Rt();case"if":return xt();case"return":return kt();case"switch":return Ot();case"throw":return Nt();case"try":return Ct();case"var":return yt();case"while":return Et();case"with":return _t();default:}return e=pt(),e.type===ur.Identifier&&N(":")?(S(),Object.prototype.hasOwnProperty.call(br.labelSet,e.name)&&L({},pr.Redeclaration,"Label",e.name),br.labelSet[e.name]=!0,t=Mt(),delete br.labelSet[e.name],{type:ur.LabeledStatement,label:e,body:t}):(F(),{type:ur.ExpressionStatement,expression:e})}function Dt(){var e,t,n,i,o,a,s,u,c=[];for(I("{");mr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Bt(),c.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&k(i,pr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(o=br.labelSet,a=br.inIteration,s=br.inSwitch,u=br.inFunctionBody,br.labelSet={},br.inIteration=!1,br.inSwitch=!1,br.inFunctionBody=!0;mr>dr&&!N("}")&&(e=Bt(),void 0!==e);)c.push(e);return I("}"),br.labelSet=o,br.inIteration=a,br.inSwitch=s,br.inFunctionBody=u,{type:ur.BlockStatement,body:c}}function Rt(){var e,t,r,n,i,o,a,s,u,c=[];if(O("function"),n=j(),e=ht(),hr?f(n.value)&&k(n,pr.StrictFunctionName):f(n.value)?(o=n,a=pr.StrictFunctionName):l(n.value)&&(o=n,a=pr.StrictReservedWord),I("("),!N(")"))for(u={};mr>dr&&(n=j(),t=ht(),hr?(f(n.value)&&(i=n,a=pr.StrictParamName),Object.prototype.hasOwnProperty.call(u,n.value)&&(i=n,a=pr.StrictParamDupe)):o||(f(n.value)?(o=n,a=pr.StrictParamName):l(n.value)?(o=n,a=pr.StrictReservedWord):Object.prototype.hasOwnProperty.call(u,n.value)&&(o=n,a=pr.StrictParamDupe)),c.push(t),u[t.name]=!0,!N(")"));)I(",");return I(")"),s=hr,r=Dt(),hr&&o&&L(o,a),hr&&i&&k(i,a),hr=s,{type:ur.FunctionDeclaration,id:e,params:c,defaults:[],body:r,rest:null,generator:!1,expression:!1}}function Ut(){var e,t,r,n,i,o,a,s,u=null,c=[];if(O("function"),N("(")||(e=j(),u=ht(),hr?f(e.value)&&k(e,pr.StrictFunctionName):f(e.value)?(r=e,n=pr.StrictFunctionName):l(e.value)&&(r=e,n=pr.StrictReservedWord)),I("("),!N(")"))for(s={};mr>dr&&(e=j(),i=ht(),hr?(f(e.value)&&(t=e,n=pr.StrictParamName),Object.prototype.hasOwnProperty.call(s,e.value)&&(t=e,n=pr.StrictParamDupe)):r||(f(e.value)?(r=e,n=pr.StrictParamName):l(e.value)?(r=e,n=pr.StrictReservedWord):Object.prototype.hasOwnProperty.call(s,e.value)&&(r=e,n=pr.StrictParamDupe)),c.push(i),s[i.name]=!0,!N(")"));)I(",");return I(")"),a=hr,o=Dt(),hr&&r&&L(r,n),hr&&t&&k(t,n),hr=a,{type:ur.FunctionExpression,id:u,params:c,defaults:[],body:o,rest:null,generator:!1,expression:!1}}function Bt(){var e=j();if(e.type===ar.Keyword)switch(e.value){case"const":case"let":return mt(e.value);case"function":return Rt();default:return Mt()}return e.type!==ar.EOF?Mt():void 0}function Tt(){for(var e,t,n,i,o=[];mr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Bt(),o.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&k(i,pr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(;mr>dr&&(e=Bt(),void 0!==e);)o.push(e);return o}function qt(){var e;return hr=!1,e={type:ur.Program,body:Tt()}}function Vt(e,r,n,i,o){t("number"==typeof n,"Comment must have valid position"),xr.comments.length>0&&xr.comments[xr.comments.length-1].range[1]>n||xr.comments.push({type:e,value:r,range:[n,i],loc:o})}function Gt(){var e,t,r,n,i,o;for(e="",i=!1,o=!1;mr>dr;)if(t=fr[dr],o)t=fr[dr++],s(t)?(r.end={line:vr,column:dr-yr-1},o=!1,Vt("Line",e,n,dr-1,r),"\r"===t&&"\n"===fr[dr]&&++dr,++vr,yr=dr,e=""):dr>=mr?(o=!1,e+=t,r.end={line:vr,column:mr-yr},Vt("Line",e,n,mr,r)):e+=t;else if(i)s(t)?("\r"===t&&"\n"===fr[dr+1]?(++dr,e+="\r\n"):e+=t,++vr,++dr,yr=dr,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")):(t=fr[dr++],dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL"),e+=t,"*"===t&&(t=fr[dr],"/"===t&&(e=e.substr(0,e.length-1),i=!1,++dr,r.end={line:vr,column:dr-yr},Vt("Block",e,n,dr,r),e="")));else if("/"===t)if(t=fr[dr+1],"/"===t)r={start:{line:vr,column:dr-yr}},n=dr,dr+=2,o=!0,dr>=mr&&(r.end={line:vr,column:dr-yr},o=!1,Vt("Line",e,n,dr,r));else{if("*"!==t)break;n=dr,dr+=2,i=!0,r={start:{line:vr,column:dr-yr-2}},dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")}else if(a(t))++dr;else{if(!s(t))break;++dr,"\r"===t&&"\n"===fr[dr]&&++dr,++vr,yr=dr}}function zt(){var e,t,r,n=[];for(e=0;xr.comments.length>e;++e)t=xr.comments[e],r={type:t.type,value:t.value},xr.range&&(r.range=t.range),xr.loc&&(r.loc=t.loc),n.push(r);xr.comments=n}function Ht(){var e,t,n,i,o;return d(),e=dr,t={start:{line:vr,column:dr-yr}},n=xr.advance(),t.end={line:vr,column:dr-yr},n.type!==ar.EOF&&(i=[n.range[0],n.range[1]],o=r(n.range[0],n.range[1]),xr.tokens.push({type:sr[n.type],value:o,range:i,loc:t})),n}function Kt(){var e,t,r,n;return d(),e=dr,t={start:{line:vr,column:dr-yr}},r=xr.scanRegExp(),t.end={line:vr,column:dr-yr},xr.tokens.length>0&&(n=xr.tokens[xr.tokens.length-1],n.range[0]===e&&"Punctuator"===n.type&&("/"===n.value||"/="===n.value)&&xr.tokens.pop()),xr.tokens.push({type:"RegularExpression",value:r.literal,range:[e,dr],loc:t}),r}function Wt(){var e,t,r,n=[];for(e=0;xr.tokens.length>e;++e)t=xr.tokens[e],r={type:t.type,value:t.value},xr.range&&(r.range=t.range),xr.loc&&(r.loc=t.loc),n.push(r);xr.tokens=n}function Zt(e){return{type:ur.Literal,value:e.value} | |
}function Xt(e){return{type:ur.Literal,value:e.value,raw:r(e.range[0],e.range[1])}}function Yt(){var e={};return e.range=[dr,dr],e.loc={start:{line:vr,column:dr-yr},end:{line:vr,column:dr-yr}},e.end=function(){this.range[1]=dr,this.loc.end.line=vr,this.loc.end.column=dr-yr},e.applyGroup=function(e){xr.range&&(e.groupRange=[this.range[0],this.range[1]]),xr.loc&&(e.groupLoc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e.apply=function(e){xr.range&&(e.range=[this.range[0],this.range[1]]),xr.loc&&(e.loc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e}function Jt(){var e,t;return d(),e=Yt(),I("("),t=pt(),I(")"),e.end(),e.applyGroup(t),t}function $t(){var e,t;for(d(),e=Yt(),t=P("new")?W():V();N(".")||N("[");)N("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:K()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:H()},e.end(),e.apply(t));return t}function Qt(){var e,t;for(d(),e=Yt(),t=P("new")?W():V();N(".")||N("[")||N("(");)N("(")?(t={type:ur.CallExpression,callee:t,arguments:G()},e.end(),e.apply(t)):N("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:K()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:H()},e.end(),e.apply(t));return t}function er(e){var t,r,n;t="[object Array]"===Object.prototype.toString.apply(e)?[]:{};for(r in e)e.hasOwnProperty(r)&&"groupRange"!==r&&"groupLoc"!==r&&(n=e[r],t[r]=null===n||"object"!=typeof n||n instanceof RegExp?n:er(n));return t}function tr(e,t){return function(r){function n(e){return e.type===ur.LogicalExpression||e.type===ur.BinaryExpression}function i(r){var o,a;n(r.left)&&i(r.left),n(r.right)&&i(r.right),e&&(r.left.groupRange||r.right.groupRange?(o=r.left.groupRange?r.left.groupRange[0]:r.left.range[0],a=r.right.groupRange?r.right.groupRange[1]:r.right.range[1],r.range=[o,a]):r.range===void 0&&(o=r.left.range[0],a=r.right.range[1],r.range=[o,a])),t&&(r.left.groupLoc||r.right.groupLoc?(o=r.left.groupLoc?r.left.groupLoc.start:r.left.loc.start,a=r.right.groupLoc?r.right.groupLoc.end:r.right.loc.end,r.loc={start:o,end:a}):r.loc===void 0&&(r.loc={start:r.left.loc.start,end:r.right.loc.end}))}return function(){var o,a;return d(),o=Yt(),a=r.apply(null,arguments),o.end(),e&&a.range===void 0&&o.apply(a),t&&a.loc===void 0&&o.apply(a),n(a)&&i(a),a}}}function rr(){var e;xr.comments&&(xr.skipComment=d,d=Gt),xr.raw&&(xr.createLiteral=Zt,Zt=Xt),(xr.range||xr.loc)&&(xr.parseGroupExpression=q,xr.parseLeftHandSideExpression=X,xr.parseLeftHandSideExpressionAllowCall=Z,q=Jt,X=$t,Z=Qt,e=tr(xr.range,xr.loc),xr.parseAdditiveExpression=Q,xr.parseAssignmentExpression=ct,xr.parseBitwiseANDExpression=nt,xr.parseBitwiseORExpression=ot,xr.parseBitwiseXORExpression=it,xr.parseBlock=ft,xr.parseFunctionSourceElements=Dt,xr.parseCatchClause=Pt,xr.parseComputedMember=K,xr.parseConditionalExpression=ut,xr.parseConstLetDeclaration=mt,xr.parseEqualityExpression=rt,xr.parseExpression=pt,xr.parseForVariableDeclaration=St,xr.parseFunctionDeclaration=Rt,xr.parseFunctionExpression=Ut,xr.parseLogicalANDExpression=at,xr.parseLogicalORExpression=st,xr.parseMultiplicativeExpression=$,xr.parseNewExpression=W,xr.parseNonComputedProperty=z,xr.parseObjectProperty=B,xr.parseObjectPropertyKey=U,xr.parsePostfixExpression=Y,xr.parsePrimaryExpression=V,xr.parseProgram=qt,xr.parsePropertyFunction=R,xr.parseRelationalExpression=tt,xr.parseStatement=Mt,xr.parseShiftExpression=et,xr.parseSwitchCase=It,xr.parseUnaryExpression=J,xr.parseVariableDeclaration=dt,xr.parseVariableIdentifier=ht,Q=e(xr.parseAdditiveExpression),ct=e(xr.parseAssignmentExpression),nt=e(xr.parseBitwiseANDExpression),ot=e(xr.parseBitwiseORExpression),it=e(xr.parseBitwiseXORExpression),ft=e(xr.parseBlock),Dt=e(xr.parseFunctionSourceElements),Pt=e(xr.parseCatchClause),K=e(xr.parseComputedMember),ut=e(xr.parseConditionalExpression),mt=e(xr.parseConstLetDeclaration),rt=e(xr.parseEqualityExpression),pt=e(xr.parseExpression),St=e(xr.parseForVariableDeclaration),Rt=e(xr.parseFunctionDeclaration),Ut=e(xr.parseFunctionExpression),X=e(X),at=e(xr.parseLogicalANDExpression),st=e(xr.parseLogicalORExpression),$=e(xr.parseMultiplicativeExpression),W=e(xr.parseNewExpression),z=e(xr.parseNonComputedProperty),B=e(xr.parseObjectProperty),U=e(xr.parseObjectPropertyKey),Y=e(xr.parsePostfixExpression),V=e(xr.parsePrimaryExpression),qt=e(xr.parseProgram),R=e(xr.parsePropertyFunction),tt=e(xr.parseRelationalExpression),Mt=e(xr.parseStatement),et=e(xr.parseShiftExpression),It=e(xr.parseSwitchCase),J=e(xr.parseUnaryExpression),dt=e(xr.parseVariableDeclaration),ht=e(xr.parseVariableIdentifier)),xr.tokens!==void 0&&(xr.advance=E,xr.scanRegExp=x,E=Ht,x=Kt)}function nr(){"function"==typeof xr.skipComment&&(d=xr.skipComment),xr.raw&&(Zt=xr.createLiteral),(xr.range||xr.loc)&&(Q=xr.parseAdditiveExpression,ct=xr.parseAssignmentExpression,nt=xr.parseBitwiseANDExpression,ot=xr.parseBitwiseORExpression,it=xr.parseBitwiseXORExpression,ft=xr.parseBlock,Dt=xr.parseFunctionSourceElements,Pt=xr.parseCatchClause,K=xr.parseComputedMember,ut=xr.parseConditionalExpression,mt=xr.parseConstLetDeclaration,rt=xr.parseEqualityExpression,pt=xr.parseExpression,St=xr.parseForVariableDeclaration,Rt=xr.parseFunctionDeclaration,Ut=xr.parseFunctionExpression,q=xr.parseGroupExpression,X=xr.parseLeftHandSideExpression,Z=xr.parseLeftHandSideExpressionAllowCall,at=xr.parseLogicalANDExpression,st=xr.parseLogicalORExpression,$=xr.parseMultiplicativeExpression,W=xr.parseNewExpression,z=xr.parseNonComputedProperty,B=xr.parseObjectProperty,U=xr.parseObjectPropertyKey,V=xr.parsePrimaryExpression,Y=xr.parsePostfixExpression,qt=xr.parseProgram,R=xr.parsePropertyFunction,tt=xr.parseRelationalExpression,Mt=xr.parseStatement,et=xr.parseShiftExpression,It=xr.parseSwitchCase,J=xr.parseUnaryExpression,dt=xr.parseVariableDeclaration,ht=xr.parseVariableIdentifier),"function"==typeof xr.scanRegExp&&(E=xr.advance,x=xr.scanRegExp)}function ir(e){var t,r=e.length,n=[];for(t=0;r>t;++t)n[t]=e.charAt(t);return n}function or(e,t){var r,n;n=String,"string"==typeof e||e instanceof String||(e=n(e)),fr=e,dr=0,vr=fr.length>0?1:0,yr=0,mr=fr.length,gr=null,br={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},xr={},t!==void 0&&(xr.range="boolean"==typeof t.range&&t.range,xr.loc="boolean"==typeof t.loc&&t.loc,xr.raw="boolean"==typeof t.raw&&t.raw,"boolean"==typeof t.tokens&&t.tokens&&(xr.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(xr.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(xr.errors=[])),mr>0&&fr[0]===void 0&&(e instanceof String&&(fr=e.valueOf()),fr[0]===void 0&&(fr=ir(e))),rr();try{r=qt(),xr.comments!==void 0&&(zt(),r.comments=xr.comments),xr.tokens!==void 0&&(Wt(),r.tokens=xr.tokens),xr.errors!==void 0&&(r.errors=xr.errors),(xr.range||xr.loc)&&(r.body=er(r.body))}catch(i){throw i}finally{nr(),xr={}}return r}var ar,sr,ur,cr,pr,lr,fr,hr,dr,vr,yr,mr,gr,br,xr;ar={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},sr={},sr[ar.BooleanLiteral]="Boolean",sr[ar.EOF]="<end>",sr[ar.Identifier]="Identifier",sr[ar.Keyword]="Keyword",sr[ar.NullLiteral]="Null",sr[ar.NumericLiteral]="Numeric",sr[ar.Punctuator]="Punctuator",sr[ar.StringLiteral]="String",ur={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},cr={Data:1,Get:2,Set:4},pr={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},lr={NonAsciiIdentifierStart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},"esprima"[0]===void 0&&(r=function(e,t){return fr.slice(e,t).join("")}),e.version="1.0.4",e.parse=or,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in ur)ur.hasOwnProperty(e)&&(t[e]=ur[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()})})()},{}],7:[function(e,t){"use strict";function r(e,t,r){var n,i,o=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],c=[],p=0,l=0;for(n=0;o>n;++n)c.push(["i",n,"=0"].join(""));for(i=0;a>i;++i)for(n=0;o>n;++n)l=p,p=e[n],0===n?c.push(["d",i,"s",n,"=t",i,"[",p,"]"].join("")):c.push(["d",i,"s",n,"=(t",i,"[",p,"]-s",l,"*t",i,"[",l,"])"].join(""));for(u.push("var "+c.join(",")),n=o-1;n>=0;--n)p=e[n],u.push(["for(i",n,"=0;i",n,"<s",p,";++i",n,"){"].join(""));for(u.push(r),n=0;o>n;++n){for(l=p,p=e[n],i=0;a>i;++i)u.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&u.push(["index[",l,"]-=s",l].join("")),u.push(["++index[",p,"]"].join(""))),u.push("}")}return u.join("\n")}function n(e,t,n,i){for(var o=t.length,a=n.arrayArgs.length,s=n.blockSize,u=n.indexArgs.length>0,c=[],p=0;a>p;++p)c.push(["var offset",p,"=p",p].join(""));for(var p=e;o>p;++p)c.push(["for(var j"+p+"=SS[",t[p],"]|0;j",p,">0;){"].join("")),c.push(["if(j",p,"<",s,"){"].join("")),c.push(["s",t[p],"=j",p].join("")),c.push(["j",p,"=0"].join("")),c.push(["}else{s",t[p],"=",s].join("")),c.push(["j",p,"-=",s,"}"].join("")),u&&c.push(["index[",t[p],"]=j",p].join(""));for(var p=0;a>p;++p){for(var l=["offset"+p],f=e;o>f;++f)l.push(["j",f,"*t",p,"[",t[f],"]"].join(""));c.push(["p",p,"=(",l.join("+"),")"].join(""))}c.push(r(t,n,i));for(var p=e;o>p;++p)c.push("}");return c.join("\n")}function i(e){for(var t=0,r=e[0].length;r>t;){for(var n=1;e.length>n;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function o(e,t,r){for(var n=e.body,i=[],o=[],a=0;e.args.length>a;++a){var s=e.args[a];if(!(0>=s.count)){var u=RegExp(s.name,"g");switch(t.argTypes[a]){case"array":var c=t.arrayArgs.indexOf(a);1===s.count?"generic"===r[c]?s.lvalue?(i.push(["var l",c,"=a",c,".get(p",c,")"].join("")),n=n.replace(u,"l"+c),o.push(["a",c,".set(p",c,",l",c,")"].join(""))):n=n.replace(u,["a",c,".get(p",c,")"].join("")):n=n.replace(u,["a",c,"[p",c,"]"].join("")):"generic"===r[c]?(i.push(["var l",c,"=a",c,".get(p",c,")"].join("")),n=n.replace(u,"l"+c),s.lvalue&&o.push(["a",c,".set(p",c,",l",c,")"].join(""))):(i.push(["var l",c,"=a",c,"[p",c,"]"].join("")),n=n.replace(u,"l"+c),s.lvalue&&o.push(["a",c,"[p",c,"]=l",c].join("")));break;case"scalar":n=n.replace(u,"Y"+t.scalarArgs.indexOf(a));break;case"index":n=n.replace(u,"index");break;case"shape":n=n.replace(u,"shape")}}}return[i.join("\n"),n,o.join("\n")].join("\n").trim()}function a(e){for(var t=Array(e.length),r=!0,n=0;e.length>n;++n){var i=e[n],o=i.match(/\d+/);o=o?o[0]:"",t[n]=0===i.charAt(0)?"u"+i.charAt(1)+o:i.charAt(0)+o,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function s(e,t){for(var s=0|t[1].length,c=Array(e.arrayArgs.length),p=Array(e.arrayArgs.length),l=["SS"],f=["'use strict'"],h=[],d=0;s>d;++d)h.push(["s",d,"=SS[",d,"]"].join(""));for(var v=0;e.arrayArgs.length>v;++v)l.push("a"+v),l.push("t"+v),l.push("p"+v),p[v]=t[2*v],c[v]=t[2*v+1];for(var v=0;e.scalarArgs.length>v;++v)l.push("Y"+v);if(e.shapeArgs.length>0&&h.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var y=Array(s),v=0;s>v;++v)y[v]="0";h.push(["index=[",y.join(","),"]"].join(""))}var m=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));h=h.concat(m),f.push("var "+h.join(","));for(var v=0;e.arrayArgs.length>v;++v)f.push("p"+v+"|=0");e.pre.body.length>3&&f.push(o(e.pre,e,p));var g=o(e.body,e,p),b=i(c);s>b?f.push(n(b,c[0],e,g)):f.push(r(c[0],e,g)),e.post.body.length>3&&f.push(o(e.post,e,p)),e.debug&&console.log("Generated cwise routine for ",t,":\n\n",f.join("\n"));var x=[e.funcName||"unnamed","_cwise_loop_",c[0].join("s"),"m",b,a(p)].join(""),w=Function(["function ",x,"(",l.join(","),"){",f.join("\n"),"} return ",x].join(""));return w()}var u=e("uniq");t.exports=s},{uniq:8}],8:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,i=e[0],o=e[0],a=1;n>a;++a)if(o=i,i=e[a],t(i,o)){if(a===r){r++;continue}e[r++]=i}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],i=e[0],o=1;r>o;++o,i=n)if(i=n,n=e[o],n!==i){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function i(e,t,i){return 0===e.length?[]:t?(i||e.sort(t),r(e,t)):(i||e.sort(),n(e))}t.exports=i},{}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({zeros:[function(e,t){t.exports=e("xvt2Cj")},{}],xvt2Cj:[function(e,t){"use strict";var r=e("ndarray");t.exports=function(e){for(var t=1,n=0;e.length>n;++n)t*=e[n];return r(new Float64Array(t),e)}},{ndarray:1}],1:[function(e,t){"use strict";function r(e,t){return e[0]-t[0]}function n(){var e,t=this.stride,n=Array(t.length);for(e=0;n.length>e;++e)n[e]=[Math.abs(t[e]),e];n.sort(r);var i=Array(n.length);for(e=0;i.length>e;++e)i[e]=n[e][1];return i}function i(e,t){if(0===t){var r=Function([c,"ZeroArray.prototype.dtype='"+e+"'","return function construct_ZeroArray(a,b,c,d){return new ZeroArray(a,d)}"].join("\n"));return r()}var i="generic"===e,o=["'use strict'"],a=s(t),l=a.map(function(e){return"i"+e}),f="this.offset+"+a.map(function(e){return["this._stride",e,"*i",e].join("")}).join("+"),h=["View",t,"d",e].join("");o.push(["function ",h,"(a,",a.map(function(e){return"b"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",d){this.data=a"].join(""));for(var d=0;t>d;++d)o.push(["this._shape",d,"=b",d,"|0"].join(""));for(var d=0;t>d;++d)o.push(["this._stride",d,"=c",d,"|0"].join(""));o.push("this.offset=d|0}"),o.push(["var proto=",h,".prototype"].join("")),o.push(["proto.dtype='",e,"'"].join("")),o.push("proto.dimension="+t);var v=["VStride",t,"d",e].join(""),y=["VShape",t,"d",e].join(""),m={stride:v,shape:y};for(var g in m){var b=m[g];o.push(["function ",b,"(v) {this._v=v} var aproto=",b,".prototype"].join("")),o.push(["aproto.length=",t].join(""));for(var x=[],d=0;t>d;++d)x.push(["this._v._",g,d].join(""));o.push(["aproto.toJSON=function ",b,"_toJSON(){return [",x.join(","),"]}"].join("")),o.push(["aproto.toString=function ",b,"_toJSON(){return [",x.join(","),"].join()}"].join(""));for(var d=0;t>d;++d)o.push(["Object.defineProperty(aproto,",d,",{get:function(){return this._v._",g,d,"},set:function(v){return this._v._",g,d,"=v|0},enumerable:true})"].join(""));for(var d=0;u.length>d;++d)u[d]in Array.prototype&&o.push(["aproto.",u[d],"=Array.prototype.",u[d]].join(""));o.push(["Object.defineProperty(proto,'",g,"',{get:function ",b,"_get(){return new ",b,"(this)},set: function ",b,"_set(v){"].join(""));for(var d=0;t>d;++d)o.push(["this._",g,d,"=v[",d,"]|0"].join(""));o.push("return v}})")}o.push(["Object.defineProperty(proto,'size',{get:function ",h,"_size(){return ",a.map(function(e){return["this._shape",e].join("")}).join("*"),"}})"].join("")),1===t?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),4>t?(o.push(["function ",h,"_order(){"].join("")),2===t?o.push("return (Math.abs(this._stride0)>Math.abs(this._stride1))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this._stride0),s1=Math.abs(this._stride1),s2=Math.abs(this._stride2);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push(["proto.set=function ",h,"_set(",l.join(","),",v){"].join("")),i?o.push(["return this.data.set(",f,",v)}"].join("")):o.push(["return this.data[",f,"]=v}"].join("")),o.push(["proto.get=function ",h,"_get(",l.join(","),"){"].join("")),i?o.push(["return this.data.get(",f,")}"].join("")):o.push(["return this.data[",f,"]}"].join("")),o.push(["proto.hi=function ",h,"_hi(",l.join(","),"){return new ",h,"(this.data,",a.map(function(e){return["typeof i",e,"!=='number'?this._shape",e,":i",e,"|0"].join("")}).join(","),",",a.map(function(e){return"this._stride"+e}).join(","),",this.offset)}"].join(""));var w=a.map(function(e){return"a"+e+"=this._shape"+e}),E=a.map(function(e){return"c"+e+"=this._stride"+e});o.push(["proto.lo=function ",h,"_lo(",l.join(","),"){var b=this.offset,d=0,",w.join(","),",",E.join(",")].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;b+=c",d,"*d;a",d,"-=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",b)}"].join("")),o.push(["proto.step=function ",h,"_step(",l.join(","),"){var ",a.map(function(e){return"a"+e+"=this._shape"+e}).join(","),",",a.map(function(e){return"b"+e+"=this._stride"+e}).join(","),",c=this.offset,d=0,ceil=Math.ceil"].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;if(d<0){c+=b",d,"*(a",d,"-1);a",d,"=ceil(-a",d,"/d)}else{a",d,"=ceil(a",d,"/d)}b",d,"*=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"b"+e}).join(","),",c)}"].join(""));for(var S=Array(t),j=Array(t),d=0;t>d;++d)S[d]=["a[i",d,"|0]"].join(""),j[d]=["b[i",d,"|0]"].join("");o.push(["proto.transpose=function ",h,"_transpose(",l,"){var a=this.shape,b=this.stride;return new ",h,"(this.data,",S.join(","),",",j.join(","),",this.offset)}"].join("")),o.push(["proto.pick=function ",h,"_pick(",l,"){var a=[],b=[],c=this.offset"].join(""));for(var d=0;t>d;++d)o.push(["if(i",d,">=0){c=(c+this._stride",d,"*i",d,")|0}else{a.push(this._shape",d,");b.push(this._stride",d,")}"].join(""));o.push("var ctor=CTOR_LIST[a.length];return ctor(this.data,a,b,c)}"),o.push(["return function construct_",h,"(data,shape,stride,offset){return new ",h,"(data,",a.map(function(e){return"shape["+e+"]"}).join(","),",",a.map(function(e){return"stride["+e+"]"}).join(","),",offset)}"].join(""));var A=Function("CTOR_LIST","ORDER",o.join("\n"));return A(p[e],n)}function o(e){return e instanceof Float64Array?"float64":e instanceof Float32Array?"float32":e instanceof Int32Array?"int32":e instanceof Uint32Array?"uint32":e instanceof Uint8Array?"uint8":e instanceof Uint16Array?"uint16":e instanceof Int16Array?"int16":e instanceof Int8Array?"int8":e instanceof Array?"array":"generic"}function a(e,t,r,n){void 0===t&&(t=[e.length]);var a=t.length;if(void 0===r){r=Array(a);for(var s=a-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===n){n=0;for(var s=0;a>s;++s)0>r[s]&&(n-=(t[s]-1)*r[s])}for(var c=o(e),l=p[c];a>=l.length;)l.push(i(c,l.length));var f=l[a];return f(e,t,r,n)}var s=e("iota-array"),u=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c="function ZeroArray(a,d) {this.data = a;this.offset = d};var proto=ZeroArray.prototype;proto.size=0;proto.shape=[];proto.stride=[];proto.order=[];proto.get=proto.set=function() {return Number.NaN};proto.lo=proto.hi=proto.transpose=proto.step=proto.pick=function() {return new ZeroArray(this.data,this.shape,this.stride,this.offset)}",p={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],generic:[]};t.exports=a},{"iota-array":2}],2:[function(e,t){"use strict";function r(e){for(var t=Array(e),r=0;e>r;++r)t[r]=r;return t}t.exports=r},{}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({"cave-automata-2d":[function(e,t){t.exports=e("CKdiaf")},{}],CKdiaf:[function(e,t){function r(e,t){function r(t){u=n,c=i,p=v,l=d,t=t||1;for(var r=0;t>r;r+=1)r%2?m(e,f):m(f,e);return t%2&&o(e,function(e,t){return f.get(e,t)}),e}t=t||{};var n=e.shape[0],i=e.shape[1],f=t.buffer||a([n,i]),h=t.density||.5,d=t.threshold||5,v="border"in t?t.border:1,y="fill"in t?t.fill:!0,m=s[v?"border":"vanilla"];return y&&o(e,function(e,t){return h>=Math.random()||1>=e||e>=n-2||1>=t||t>=i-2?1:0}),t.iterations&&r(t.iterations),r}var n=e("moore")(1,2).concat([[0,0]]),i=e("ndarray-stencil"),o=e("ndarray-fill"),a=e("zeros");n.length;var s={};t.exports=r;var u=null,c=null,p=null,l=null;s.vanilla=i(n,function(e,t,r,n,i,o,a,s,u){return e+t+r+n+i+o+a+s+u>=l?1:0},{useIndex:!1}),s.border=i(n,function(e,t,r,n,i,o,a,s,f,h){return e+t+r+n+i+o+a+s+f>=l||p>h[0]||h[0]>u-p-3||p>h[1]||h[1]>c-p-3?1:0},{useIndex:!0})},{moore:1,"ndarray-fill":2,zeros:3,"ndarray-stencil":4}],1:[function(e,t){function r(e,t){function r(n,i,o){if(o===t-1)for(var a=-e;e>=a;a+=1)(a||i.some(function(e){return e}))&&n.push(i.concat(a));else for(var a=-e;e>=a;a+=1)r(n,i.concat(a),o+1);return n}return t=t||2,e=e||1,r([],[],0)}t.exports=r},{}],3:[function(e,t){"use strict";var r=e("ndarray");t.exports=function(e){for(var t=1,n=0;e.length>n;++n)t*=e[n];return r(new Float64Array(t),e)}},{ndarray:5}],2:[function(e,t){"use strict";var r=e("cwise")({args:["index","array","scalar"],body:function(e,t,r){t=r.apply(void 0,e)}});t.exports=function(e,t){return r(e,t),e}},{cwise:6}],4:[function(e,t){"use strict";function r(e,t,r,n){for(var i=[],o=["scalar","array"],a=0;e>a;++a)o.push("array"),i.push("a"+a);n.useIndex&&(i.push("idx"),o.push("index")),i.push(["out=func(",i.join(","),")"].join("")),i.unshift("out"),i.unshift("func");var s=u({args:o,body:Function.apply(void 0,i),funcName:"StencilOp"});return s.bind(void 0,r)}function n(e,t){for(var r=Array(t.length),n=0;e.length>n;++n){var i=-t[n]-e[n];r[n]=0===i?"s"+n:["s",n,"-",-i].join("")}return r.join(",")}function i(e,t){for(var r=Array(t.length),n=0;e.length>n;++n){var i=-e[n]-t[n];r[n]=0===i?"0":i}return r.join(",")}function o(e,t,r,o){e.length;var a=t.length,u=["'use strict'"];u.push("var s=out.shape");for(var c=0;a>c;++c)u.push(["var s",c,"=s[",c,"]|0"].join(""));u.push(["func(out.hi(",n(r,s(a)),").lo(",i(t,s(a)),")"].join(""));for(var c=0;e.length>c;++c)u.push([",inp.hi(",n(r,e[c]),").lo(",i(t,e[c]),")"].join(""));u.push(")");var p=Function("func","out","inp",u.join("\n"));return p.bind(void 0,o)}function a(e,t,n){if(n=n||{},0===e.length)throw Error("ndarray-stencil: Need to specify at least one point for stencil");for(var i=e.length,a=e[0].length,u=s(a),c=s(a),p=0;i>p;++p)for(var l=e[p],f=0;a>f;++f)u[f]=Math.min(u[f],l[f]),c[f]=Math.max(c[f],l[f]);var h=r(i,a,t,n);return o(e,u,c,h)}var s=e("dup"),u=e("cwise");t.exports=a},{cwise:7,dup:8}],8:[function(e,t){"use strict";function r(e,t,n){var i=0|e[n];if(0>=i)return[];var o,a=Array(i);if(n===e.length-1)for(o=0;i>o;++o)a[o]=t;else for(o=0;i>o;++o)a[o]=r(e,t,n+1);return a}function n(e,t){var r,n;for(r=Array(e),n=0;e>n;++n)r[n]=t;return r}function i(e,t){switch(t===void 0&&(t=0),typeof e){case"number":if(e>0)return n(0|e,t);break;case"object":if("number"==typeof e.length)return r(e,t,0)}return[]}t.exports=i},{}],5:[function(e,t){"use strict";function r(e,t){return e[0]-t[0]}function n(){var e,t=this.stride,n=Array(t.length);for(e=0;n.length>e;++e)n[e]=[Math.abs(t[e]),e];n.sort(r);var i=Array(n.length);for(e=0;i.length>e;++e)i[e]=n[e][1];return i}function i(e,t){if(0===t){var r=Function([c,"ZeroArray.prototype.dtype='"+e+"'","return function construct_ZeroArray(a,b,c,d){return new ZeroArray(a,d)}"].join("\n"));return r()}var i="generic"===e,o=["'use strict'"],a=s(t),l=a.map(function(e){return"i"+e}),f="this.offset+"+a.map(function(e){return["this._stride",e,"*i",e].join("")}).join("+"),h=["View",t,"d",e].join("");o.push(["function ",h,"(a,",a.map(function(e){return"b"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",d){this.data=a"].join(""));for(var d=0;t>d;++d)o.push(["this._shape",d,"=b",d,"|0"].join(""));for(var d=0;t>d;++d)o.push(["this._stride",d,"=c",d,"|0"].join(""));o.push("this.offset=d|0}"),o.push(["var proto=",h,".prototype"].join("")),o.push(["proto.dtype='",e,"'"].join("")),o.push("proto.dimension="+t);var v=["VStride",t,"d",e].join(""),y=["VShape",t,"d",e].join(""),m={stride:v,shape:y};for(var g in m){var b=m[g];o.push(["function ",b,"(v) {this._v=v} var aproto=",b,".prototype"].join("")),o.push(["aproto.length=",t].join(""));for(var x=[],d=0;t>d;++d)x.push(["this._v._",g,d].join(""));o.push(["aproto.toJSON=function ",b,"_toJSON(){return [",x.join(","),"]}"].join("")),o.push(["aproto.toString=function ",b,"_toJSON(){return [",x.join(","),"].join()}"].join(""));for(var d=0;t>d;++d)o.push(["Object.defineProperty(aproto,",d,",{get:function(){return this._v._",g,d,"},set:function(v){return this._v._",g,d,"=v|0},enumerable:true})"].join(""));for(var d=0;u.length>d;++d)u[d]in Array.prototype&&o.push(["aproto.",u[d],"=Array.prototype.",u[d]].join(""));o.push(["Object.defineProperty(proto,'",g,"',{get:function ",b,"_get(){return new ",b,"(this)},set: function ",b,"_set(v){"].join(""));for(var d=0;t>d;++d)o.push(["this._",g,d,"=v[",d,"]|0"].join(""));o.push("return v}})")}o.push(["Object.defineProperty(proto,'size',{get:function ",h,"_size(){return ",a.map(function(e){return["this._shape",e].join("")}).join("*"),"}})"].join("")),1===t?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),4>t?(o.push(["function ",h,"_order(){"].join("")),2===t?o.push("return (Math.abs(this._stride0)>Math.abs(this._stride1))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this._stride0),s1=Math.abs(this._stride1),s2=Math.abs(this._stride2);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push(["proto.set=function ",h,"_set(",l.join(","),",v){"].join("")),i?o.push(["return this.data.set(",f,",v)}"].join("")):o.push(["return this.data[",f,"]=v}"].join("")),o.push(["proto.get=function ",h,"_get(",l.join(","),"){"].join("")),i?o.push(["return this.data.get(",f,")}"].join("")):o.push(["return this.data[",f,"]}"].join("")),o.push(["proto.hi=function ",h,"_hi(",l.join(","),"){return new ",h,"(this.data,",a.map(function(e){return["typeof i",e,"!=='number'?this._shape",e,":i",e,"|0"].join("")}).join(","),",",a.map(function(e){return"this._stride"+e}).join(","),",this.offset)}"].join(""));var w=a.map(function(e){return"a"+e+"=this._shape"+e}),E=a.map(function(e){return"c"+e+"=this._stride"+e});o.push(["proto.lo=function ",h,"_lo(",l.join(","),"){var b=this.offset,d=0,",w.join(","),",",E.join(",")].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;b+=c",d,"*d;a",d,"-=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",b)}"].join("")),o.push(["proto.step=function ",h,"_step(",l.join(","),"){var ",a.map(function(e){return"a"+e+"=this._shape"+e | |
}).join(","),",",a.map(function(e){return"b"+e+"=this._stride"+e}).join(","),",c=this.offset,d=0,ceil=Math.ceil"].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;if(d<0){c+=b",d,"*(a",d,"-1);a",d,"=ceil(-a",d,"/d)}else{a",d,"=ceil(a",d,"/d)}b",d,"*=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"b"+e}).join(","),",c)}"].join(""));for(var S=Array(t),j=Array(t),d=0;t>d;++d)S[d]=["a[i",d,"|0]"].join(""),j[d]=["b[i",d,"|0]"].join("");o.push(["proto.transpose=function ",h,"_transpose(",l,"){var a=this.shape,b=this.stride;return new ",h,"(this.data,",S.join(","),",",j.join(","),",this.offset)}"].join("")),o.push(["proto.pick=function ",h,"_pick(",l,"){var a=[],b=[],c=this.offset"].join(""));for(var d=0;t>d;++d)o.push(["if(i",d,">=0){c=(c+this._stride",d,"*i",d,")|0}else{a.push(this._shape",d,");b.push(this._stride",d,")}"].join(""));o.push("var ctor=CTOR_LIST[a.length];return ctor(this.data,a,b,c)}"),o.push(["return function construct_",h,"(data,shape,stride,offset){return new ",h,"(data,",a.map(function(e){return"shape["+e+"]"}).join(","),",",a.map(function(e){return"stride["+e+"]"}).join(","),",offset)}"].join(""));var A=Function("CTOR_LIST","ORDER",o.join("\n"));return A(p[e],n)}function o(e){return e instanceof Float64Array?"float64":e instanceof Float32Array?"float32":e instanceof Int32Array?"int32":e instanceof Uint32Array?"uint32":e instanceof Uint8Array?"uint8":e instanceof Uint16Array?"uint16":e instanceof Int16Array?"int16":e instanceof Int8Array?"int8":e instanceof Array?"array":"generic"}function a(e,t,r,n){void 0===t&&(t=[e.length]);var a=t.length;if(void 0===r){r=Array(a);for(var s=a-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===n){n=0;for(var s=0;a>s;++s)0>r[s]&&(n-=(t[s]-1)*r[s])}for(var c=o(e),l=p[c];a>=l.length;)l.push(i(c,l.length));var f=l[a];return f(e,t,r,n)}var s=e("iota-array"),u=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c="function ZeroArray(a,d) {this.data = a;this.offset = d};var proto=ZeroArray.prototype;proto.size=0;proto.shape=[];proto.stride=[];proto.order=[];proto.get=proto.set=function() {return Number.NaN};proto.lo=proto.hi=proto.transpose=proto.step=proto.pick=function() {return new ZeroArray(this.data,this.shape,this.stride,this.offset)}",p={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],generic:[]};t.exports=a},{"iota-array":9}],6:[function(e,t){"use strict";function r(e){for(var t in e)0>o.indexOf(t)&&0>a.indexOf(t)&&console.warn("cwise: Unknown argument '"+t+"' passed to expression compiler");for(var r=0;o.length>r;++r)if(!e[o[r]])throw Error("cwise: Missing argument: "+o[r]);return i({args:e.args,pre:n(e.pre||function(){}),body:n(e.body),post:n(e.post||function(){}),debug:!!e.printCode,funcName:e.funcName||e.body.name||"cwise",blockSize:e.blockSize||64})}var n=e("cwise-parser"),i=e("cwise-compiler"),o=["args","body"],a=["pre","post","printCode","funcName","blockSize"];t.exports=r},{"cwise-compiler":10,"cwise-parser":11}],7:[function(e,t){"use strict";function r(e){for(var t in e)0>o.indexOf(t)&&0>a.indexOf(t)&&console.warn("cwise: Unknown argument '"+t+"' passed to expression compiler");for(var r=0;o.length>r;++r)if(!e[o[r]])throw Error("cwise: Missing argument: "+o[r]);return i({args:e.args,pre:n(e.pre||function(){}),body:n(e.body),post:n(e.post||function(){}),debug:!!e.printCode,funcName:e.funcName||e.body.name||"cwise",blockSize:e.blockSize||64})}var n=e("cwise-parser"),i=e("cwise-compiler"),o=["args","body"],a=["pre","post","printCode","funcName","blockSize"];t.exports=r},{"cwise-parser":12,"cwise-compiler":13}],9:[function(e,t){"use strict";function r(e){for(var t=Array(e),r=0;e>r;++r)t[r]=r;return t}t.exports=r},{}],10:[function(e,t){"use strict";function r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.scalarArgs=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function n(e){var t=new r;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var o=0;n.length>o;++o)switch(n[o]){case"array":if(t.arrayArgs.push(o),t.shimArgs.push("array"+o),t.pre.args.length>o&&t.pre.args[o].count>0)throw Error("cwise: pre() block may not reference array args");if(t.post.args.length>o&&t.post.args[o].count>0)throw Error("cwise: post() block may not reference array args");break;case"scalar":t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);break;case"index":if(t.indexArgs.push(o),t.pre.args.length>o&&t.pre.args[o].count>0)throw Error("cwise: pre() block may not reference array index");if(t.body.args.length>o&&t.body.args[o].lvalue)throw Error("cwise: body() block may not write to array index");if(t.post.args.length>o&&t.post.args[o].count>0)throw Error("cwise: post() block may not reference array index");break;case"shape":if(t.shapeArgs.push(o),t.pre.args.length>o&&t.pre.args[o].lvalue)throw Error("cwise: pre() block may not write to array shape");if(t.body.args.length>o&&t.body.args[o].lvalue)throw Error("cwise: body() block may not write to array shape");if(t.post.args.length>o&&t.post.args[o].lvalue)throw Error("cwise: post() block may not write to array shape");break;default:throw Error("cwise: Unknown argument type "+n[o])}if(0>=t.arrayArgs.length)throw Error("cwise: No array arguments specified");if(t.pre.args.length>n.length)throw Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,i(t)}var i=e("./lib/thunk.js");t.exports=n},{"./lib/thunk.js":14}],13:[function(e,t){"use strict";function r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.scalarArgs=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function n(e){var t=new r;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var o=0;n.length>o;++o)switch(n[o]){case"array":if(t.arrayArgs.push(o),t.shimArgs.push("array"+o),t.pre.args.length>o&&t.pre.args[o].count>0)throw Error("cwise: pre() block may not reference array args");if(t.post.args.length>o&&t.post.args[o].count>0)throw Error("cwise: post() block may not reference array args");break;case"scalar":t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);break;case"index":if(t.indexArgs.push(o),t.pre.args.length>o&&t.pre.args[o].count>0)throw Error("cwise: pre() block may not reference array index");if(t.body.args.length>o&&t.body.args[o].lvalue)throw Error("cwise: body() block may not write to array index");if(t.post.args.length>o&&t.post.args[o].count>0)throw Error("cwise: post() block may not reference array index");break;case"shape":if(t.shapeArgs.push(o),t.pre.args.length>o&&t.pre.args[o].lvalue)throw Error("cwise: pre() block may not write to array shape");if(t.body.args.length>o&&t.body.args[o].lvalue)throw Error("cwise: body() block may not write to array shape");if(t.post.args.length>o&&t.post.args[o].lvalue)throw Error("cwise: post() block may not write to array shape");break;default:throw Error("cwise: Unknown argument type "+n[o])}if(0>=t.arrayArgs.length)throw Error("cwise: No array arguments specified");if(t.pre.args.length>n.length)throw Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,i(t)}var i=e("./lib/thunk.js");t.exports=n},{"./lib/thunk.js":15}],11:[function(e,t){"use strict";function r(e,t,r){this.name=e,this.lvalue=t,this.rvalue=r,this.count=0}function n(e,t,r,n){this.body=e,this.args=t,this.thisVars=r,this.localVars=n}function i(e){if("eval"===e)throw Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:"undefined"!=typeof GLOBAL?e in GLOBAL:"undefined"!=typeof self?e in self:!1}function o(e){for(var t=e.body[0].expression.callee.params,r=Array(t.length),n=0;t.length>n;++n)r[n]=t[n].name;return r}function a(e){function t(e){var t=y+e.replace(/\_/g,"__");return E.push(t),t}function a(e){var t="this_"+e.replace(/\_/g,"__");return S.push(t),t}function p(e,t){for(var r=e.range[0],n=e.range[1],i=r+1;n>i;++i)x[i]="";x[r]=t}function l(e){return"'"+e.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'"}function f(e){return x.slice(e.range[0],e.range[1]).join("")}function h(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?j:j|A:"UpdateExpression"===e.parent.type?j|A:A}for(var d=["(",e,")()"].join(""),v=s.parse(d,{range:!0}),y="_inline_"+c++ +"_",m=o(v),g=Array(m.length),b=0;m.length>b;++b)g[b]=new r([y,"arg",b,"_"].join(""),!1,!1);for(var x=Array(d.length),b=0,w=d.length;w>b;++b)x[b]=d.charAt(b);var E=[],S=[],j=1,A=2;(function L(e,r){if(e.parent=r,"MemberExpression"===e.type)e.computed?(L(e.object,e),L(e.property,e)):"ThisExpression"===e.object.type?p(e,a(e.property.name)):L(e.object,e);else{if("ThisExpression"===e.type)throw Error("cwise-parser: Computed this is not allowed");if("Identifier"===e.type){var n=e.name,o=m.indexOf(n);if(o>=0){var s=g[o],u=h(e);u&j&&(s.lvalue=!0),u&A&&(s.rvalue=!0),++s.count,p(e,s.name)}else i(n)||p(e,t(n))}else if("Literal"===e.type)"string"==typeof e.value&&p(e,l(e.value));else{if("WithStatement"===e.type)throw Error("cwise-parser: with() statements not allowed");for(var c=Object.keys(e),f=0,d=c.length;d>f;++f)if("parent"!==c[f]){var v=e[c[f]];if(v)if(v instanceof Array)for(var y=0;v.length>y;++y)v[y]&&"string"==typeof v[y].type&&L(v[y],e);else"string"==typeof v.type&&L(v,e)}}}})(v.body[0].expression.callee.body,void 0),u(E),u(S);var k=new n(f(v.body[0].expression.callee.body),g,S,E);return k}var s=e("esprima"),u=e("uniq"),c=0;t.exports=a},{esprima:16,uniq:17}],12:[function(e,t){"use strict";function r(e,t,r){this.name=e,this.lvalue=t,this.rvalue=r,this.count=0}function n(e,t,r,n){this.body=e,this.args=t,this.thisVars=r,this.localVars=n}function i(e){if("eval"===e)throw Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:"undefined"!=typeof GLOBAL?e in GLOBAL:"undefined"!=typeof self?e in self:!1}function o(e){for(var t=e.body[0].expression.callee.params,r=Array(t.length),n=0;t.length>n;++n)r[n]=t[n].name;return r}function a(e){function t(e){var t=y+e.replace(/\_/g,"__");return E.push(t),t}function a(e){var t="this_"+e.replace(/\_/g,"__");return S.push(t),t}function p(e,t){for(var r=e.range[0],n=e.range[1],i=r+1;n>i;++i)x[i]="";x[r]=t}function l(e){return"'"+e.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'"}function f(e){return x.slice(e.range[0],e.range[1]).join("")}function h(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?j:j|A:"UpdateExpression"===e.parent.type?j|A:A}for(var d=["(",e,")()"].join(""),v=s.parse(d,{range:!0}),y="_inline_"+c++ +"_",m=o(v),g=Array(m.length),b=0;m.length>b;++b)g[b]=new r([y,"arg",b,"_"].join(""),!1,!1);for(var x=Array(d.length),b=0,w=d.length;w>b;++b)x[b]=d.charAt(b);var E=[],S=[],j=1,A=2;(function L(e,r){if(e.parent=r,"MemberExpression"===e.type)e.computed?(L(e.object,e),L(e.property,e)):"ThisExpression"===e.object.type?p(e,a(e.property.name)):L(e.object,e);else{if("ThisExpression"===e.type)throw Error("cwise-parser: Computed this is not allowed");if("Identifier"===e.type){var n=e.name,o=m.indexOf(n);if(o>=0){var s=g[o],u=h(e);u&j&&(s.lvalue=!0),u&A&&(s.rvalue=!0),++s.count,p(e,s.name)}else i(n)||p(e,t(n))}else if("Literal"===e.type)"string"==typeof e.value&&p(e,l(e.value));else{if("WithStatement"===e.type)throw Error("cwise-parser: with() statements not allowed");for(var c=Object.keys(e),f=0,d=c.length;d>f;++f)if("parent"!==c[f]){var v=e[c[f]];if(v)if(v instanceof Array)for(var y=0;v.length>y;++y)v[y]&&"string"==typeof v[y].type&&L(v[y],e);else"string"==typeof v.type&&L(v,e)}}}})(v.body[0].expression.callee.body,void 0),u(E),u(S);var k=new n(f(v.body[0].expression.callee.body),g,S,E);return k}var s=e("esprima"),u=e("uniq"),c=0;t.exports=a},{esprima:18,uniq:19}],14:[function(e,t){"use strict";function r(e){var t=["'use strict'","var CACHED={}"],r=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",e.arrayArgs[0],".shape"].join("")],u=0;e.arrayArgs.length>u;++u){var c=e.arrayArgs[u];r.push(["t",c,"=array",c,".dtype,","r",c,"=array",c,".order"].join("")),o.push("t"+c),o.push("r"+c),a.push("t"+c),a.push("r"+c+".join()"),s.push("array"+c+".data"),s.push("array"+c+".stride"),s.push("array"+c+".offset|0")}for(var u=0;e.scalarArgs.length>u;++u)s.push("scalar"+e.scalarArgs[u]);r.push(["type=[",a.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",s.join(","),")}"].join("")),e.debug&&console.log("Generated thunk:",t.join("\n"));var p=Function("compile",t.join("\n"));return p(n.bind(void 0,e))}var n=e("./compile.js");t.exports=r},{"./compile.js":20}],15:[function(e,t){"use strict";function r(e){var t=["'use strict'","var CACHED={}"],r=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",e.arrayArgs[0],".shape"].join("")],u=0;e.arrayArgs.length>u;++u){var c=e.arrayArgs[u];r.push(["t",c,"=array",c,".dtype,","r",c,"=array",c,".order"].join("")),o.push("t"+c),o.push("r"+c),a.push("t"+c),a.push("r"+c+".join()"),s.push("array"+c+".data"),s.push("array"+c+".stride"),s.push("array"+c+".offset|0")}for(var u=0;e.scalarArgs.length>u;++u)s.push("scalar"+e.scalarArgs[u]);r.push(["type=[",a.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",s.join(","),")}"].join("")),e.debug&&console.log("Generated thunk:",t.join("\n"));var p=Function("compile",t.join("\n"));return p(n.bind(void 0,e))}var n=e("./compile.js");t.exports=r},{"./compile.js":21}],16:[function(e,t,r){(function(){(function(e,t){"use strict";"function"==typeof define&&define.amd?define(["exports"],t):r!==void 0?t(r):t(e.esprima={})})(this,function(e){"use strict";function t(e,t){if(!e)throw Error("ASSERT: "+t)}function r(e,t){return fr.slice(e,t)}function n(e){return"0123456789".indexOf(e)>=0}function i(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function o(e){return"01234567".indexOf(e)>=0}function a(e){return" "===e||" "===e||""===e||"\f"===e||" "===e||e.charCodeAt(0)>=5760&&" ".indexOf(e)>=0}function s(e){return"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e}function u(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e.charCodeAt(0)>=128&&lr.NonAsciiIdentifierStart.test(e)}function c(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&lr.NonAsciiIdentifierPart.test(e)}function p(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function l(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0}return!1}function f(e){return"eval"===e||"arguments"===e}function h(e){var t=!1;switch(e.length){case 2:t="if"===e||"in"===e||"do"===e;break;case 3:t="var"===e||"for"===e||"new"===e||"try"===e;break;case 4:t="this"===e||"else"===e||"case"===e||"void"===e||"with"===e;break;case 5:t="while"===e||"break"===e||"catch"===e||"throw"===e;break;case 6:t="return"===e||"typeof"===e||"delete"===e||"switch"===e;break;case 7:t="default"===e||"finally"===e;break;case 8:t="function"===e||"continue"===e||"debugger"===e;break;case 10:t="instanceof"===e}if(t)return!0;switch(e){case"const":return!0;case"yield":case"let":return!0}return hr&&l(e)?!0:p(e)}function d(){var e,t,r;for(t=!1,r=!1;mr>dr;)if(e=fr[dr],r)e=fr[dr++],s(e)&&(r=!1,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,yr=dr);else if(t)s(e)?("\r"===e&&"\n"===fr[dr+1]&&++dr,++vr,++dr,yr=dr,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")):(e=fr[dr++],dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL"),"*"===e&&(e=fr[dr],"/"===e&&(++dr,t=!1)));else if("/"===e)if(e=fr[dr+1],"/"===e)dr+=2,r=!0;else{if("*"!==e)break;dr+=2,t=!0,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")}else if(a(e))++dr;else{if(!s(e))break;++dr,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,yr=dr}}function v(e){var t,r,n,o=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(mr>dr&&i(fr[dr])))return"";n=fr[dr++],o=16*o+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(o)}function y(){var e,t,r,n;if(e=fr[dr],u(e)){if(t=dr,"\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!u(e))return;r=e}else dr=n,r="u"}else r=fr[dr++];for(;mr>dr&&(e=fr[dr],c(e));)if("\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!c(e))return;r+=e}else dr=n,r+="u"}else r+=fr[dr++];return 1===r.length?{type:ar.Identifier,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:h(r)?{type:ar.Keyword,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:"null"===r?{type:ar.NullLiteral,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:"true"===r||"false"===r?{type:ar.BooleanLiteral,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:{type:ar.Identifier,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}}}function m(){var e,t,r,i=dr,o=fr[dr];return";"===o||"{"===o||"}"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:yr,range:[i,dr]}):","===o||"("===o||")"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:yr,range:[i,dr]}):(e=fr[dr+1],"."!==o||n(e)?(t=fr[dr+2],r=fr[dr+3],">"===o&&">"===e&&">"===t&&"="===r?(dr+=4,{type:ar.Punctuator,value:">>>=",lineNumber:vr,lineStart:yr,range:[i,dr]}):"="===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"===",lineNumber:vr,lineStart:yr,range:[i,dr]}):"!"===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"!==",lineNumber:vr,lineStart:yr,range:[i,dr]}):">"===o&&">"===e&&">"===t?(dr+=3,{type:ar.Punctuator,value:">>>",lineNumber:vr,lineStart:yr,range:[i,dr]}):"<"===o&&"<"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"<<=",lineNumber:vr,lineStart:yr,range:[i,dr]}):">"===o&&">"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:">>=",lineNumber:vr,lineStart:yr,range:[i,dr]}):"="===e&&"<>=!+-*%&|^/".indexOf(o)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:yr,range:[i,dr]}):o===e&&"+-<>&|".indexOf(o)>=0&&"+-<>&|".indexOf(e)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:yr,range:[i,dr]}):"[]<>+-*%&|^!~?:=/".indexOf(o)>=0?{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:yr,range:[i,dr]}:void 0):{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:yr,range:[i,dr]})}function g(){var e,r,a;if(a=fr[dr],t(n(a)||"."===a,"Numeric literal must start with a decimal digit or a decimal point"),r=dr,e="","."!==a){if(e=fr[dr++],a=fr[dr],"0"===e){if("x"===a||"X"===a){for(e+=fr[dr++];mr>dr&&(a=fr[dr],i(a));)e+=fr[dr++];return 2>=e.length&&L({},pr.UnexpectedToken,"ILLEGAL"),mr>dr&&(a=fr[dr],u(a)&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,16),lineNumber:vr,lineStart:yr,range:[r,dr]}}if(o(a)){for(e+=fr[dr++];mr>dr&&(a=fr[dr],o(a));)e+=fr[dr++];return mr>dr&&(a=fr[dr],(u(a)||n(a))&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:vr,lineStart:yr,range:[r,dr]}}n(a)&&L({},pr.UnexpectedToken,"ILLEGAL")}for(;mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++]}if("."===a)for(e+=fr[dr++];mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];if("e"===a||"E"===a)if(e+=fr[dr++],a=fr[dr],("+"===a||"-"===a)&&(e+=fr[dr++]),a=fr[dr],n(a))for(e+=fr[dr++];mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];else a="character "+a,dr>=mr&&(a="<end>"),L({},pr.UnexpectedToken,"ILLEGAL");return mr>dr&&(a=fr[dr],u(a)&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseFloat(e),lineNumber:vr,lineStart:yr,range:[r,dr]}}function b(){var e,r,n,i,a,u,c="",p=!1;for(e=fr[dr],t("'"===e||'"'===e,"String literal must starts with a quote"),r=dr,++dr;mr>dr;){if(n=fr[dr++],n===e){e="";break}if("\\"===n)if(n=fr[dr++],s(n))++vr,"\r"===n&&"\n"===fr[dr]&&++dr;else switch(n){case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"u":case"x":u=dr,a=v(n),a?c+=a:(dr=u,c+=n);break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="";break;default:o(n)?(i="01234567".indexOf(n),0!==i&&(p=!0),mr>dr&&o(fr[dr])&&(p=!0,i=8*i+"01234567".indexOf(fr[dr++]),"0123".indexOf(n)>=0&&mr>dr&&o(fr[dr])&&(i=8*i+"01234567".indexOf(fr[dr++]))),c+=String.fromCharCode(i)):c+=n}else{if(s(n))break;c+=n}}return""!==e&&L({},pr.UnexpectedToken,"ILLEGAL"),{type:ar.StringLiteral,value:c,octal:p,lineNumber:vr,lineStart:yr,range:[r,dr]}}function x(){var e,r,n,i,o,a,u,p=!1,l=!1;for(gr=null,d(),n=dr,r=fr[dr],t("/"===r,"Regular expression literal must start with a slash"),e=fr[dr++];mr>dr;)if(r=fr[dr++],e+=r,p)"]"===r&&(p=!1);else if("\\"===r)r=fr[dr++],s(r)&&L({},pr.UnterminatedRegExp),e+=r;else{if("/"===r){l=!0;break}"["===r?p=!0:s(r)&&L({},pr.UnterminatedRegExp)}for(l||L({},pr.UnterminatedRegExp),i=e.substr(1,e.length-2),o="";mr>dr&&(r=fr[dr],c(r));)if(++dr,"\\"===r&&mr>dr)if(r=fr[dr],"u"===r)if(++dr,u=dr,r=v("u"))for(o+=r,e+="\\u";dr>u;++u)e+=fr[u];else dr=u,o+="u",e+="\\u";else e+="\\";else o+=r,e+=r;try{a=RegExp(i,o)}catch(f){L({},pr.InvalidRegExp)}return{literal:e,value:a,range:[n,dr]}}function w(e){return e.type===ar.Identifier||e.type===ar.Keyword||e.type===ar.BooleanLiteral||e.type===ar.NullLiteral}function E(){var e,t;return d(),dr>=mr?{type:ar.EOF,lineNumber:vr,lineStart:yr,range:[dr,dr]}:(t=m(),t!==void 0?t:(e=fr[dr],"'"===e||'"'===e?b():"."===e||n(e)?g():(t=y(),t!==void 0?t:(L({},pr.UnexpectedToken,"ILLEGAL"),void 0))))}function S(){var e;return gr?(dr=gr.range[1],vr=gr.lineNumber,yr=gr.lineStart,e=gr,gr=null,e):(gr=null,E())}function j(){var e,t,r;return null!==gr?gr:(e=dr,t=vr,r=yr,gr=E(),dr=e,vr=t,yr=r,gr)}function A(){var e,t,r,n;return e=dr,t=vr,r=yr,d(),n=vr!==t,dr=e,vr=t,yr=r,n}function L(e,t){var r,n=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,function(e,t){return n[t]||""});throw"number"==typeof e.lineNumber?(r=Error("Line "+e.lineNumber+": "+i),r.index=e.range[0],r.lineNumber=e.lineNumber,r.column=e.range[0]-yr+1):(r=Error("Line "+vr+": "+i),r.index=dr,r.lineNumber=vr,r.column=dr-yr+1),r}function k(){try{L.apply(null,arguments)}catch(e){if(!xr.errors)throw e;xr.errors.push(e)}}function _(e){if(e.type===ar.EOF&&L(e,pr.UnexpectedEOS),e.type===ar.NumericLiteral&&L(e,pr.UnexpectedNumber),e.type===ar.StringLiteral&&L(e,pr.UnexpectedString),e.type===ar.Identifier&&L(e,pr.UnexpectedIdentifier),e.type===ar.Keyword){if(p(e.value))L(e,pr.UnexpectedReserved);else if(hr&&l(e.value))return k(e,pr.StrictReservedWord),void 0;L(e,pr.UnexpectedToken,e.value)}L(e,pr.UnexpectedToken,e.value)}function I(e){var t=S();(t.type!==ar.Punctuator||t.value!==e)&&_(t)}function O(e){var t=S();(t.type!==ar.Keyword||t.value!==e)&&_(t)}function N(e){var t=j();return t.type===ar.Punctuator&&t.value===e}function P(e){var t=j();return t.type===ar.Keyword&&t.value===e}function C(){var e=j(),t=e.value;return e.type!==ar.Punctuator?!1:"="===t||"*="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t}function F(){var e,t;if(";"===fr[dr])return S(),void 0;if(t=vr,d(),vr===t){if(N(";"))return S(),void 0;e=j(),e.type===ar.EOF||N("}")||_(e)}}function M(e){return e.type===ur.Identifier||e.type===ur.MemberExpression}function D(){var e=[];for(I("[");!N("]");)N(",")?(S(),e.push(null)):(e.push(ct()),N("]")||I(","));return I("]"),{type:ur.ArrayExpression,elements:e}}function R(e,t){var r,n;return r=hr,n=Dt(),t&&hr&&f(e[0].name)&&k(t,pr.StrictParamName),hr=r,{type:ur.FunctionExpression,id:null,params:e,defaults:[],body:n,rest:null,generator:!1,expression:!1}}function U(){var e=S();return e.type===ar.StringLiteral||e.type===ar.NumericLiteral?(hr&&e.octal&&k(e,pr.StrictOctalLiteral),Zt(e)):{type:ur.Identifier,name:e.value}}function B(){var e,t,r,n;return e=j(),e.type===ar.Identifier?(r=U(),"get"!==e.value||N(":")?"set"!==e.value||N(":")?(I(":"),{type:ur.Property,key:r,value:ct(),kind:"init"}):(t=U(),I("("),e=j(),e.type!==ar.Identifier?(I(")"),k(e,pr.UnexpectedToken,e.value),{type:ur.Property,key:t,value:R([]),kind:"set"}):(n=[ht()],I(")"),{type:ur.Property,key:t,value:R(n,e),kind:"set"})):(t=U(),I("("),I(")"),{type:ur.Property,key:t,value:R([]),kind:"get"})):e.type!==ar.EOF&&e.type!==ar.Punctuator?(t=U(),I(":"),{type:ur.Property,key:t,value:ct(),kind:"init"}):(_(e),void 0)}function T(){var e,t,r,n=[],i={},o=String;for(I("{");!N("}");)e=B(),t=e.key.type===ur.Identifier?e.key.name:o(e.key.value),r="init"===e.kind?cr.Data:"get"===e.kind?cr.Get:cr.Set,Object.prototype.hasOwnProperty.call(i,t)?(i[t]===cr.Data?hr&&r===cr.Data?k({},pr.StrictDuplicateProperty):r!==cr.Data&&k({},pr.AccessorDataProperty):r===cr.Data?k({},pr.AccessorDataProperty):i[t]&r&&k({},pr.AccessorGetSet),i[t]|=r):i[t]=r,n.push(e),N("}")||I(",");return I("}"),{type:ur.ObjectExpression,properties:n}}function q(){var e;return I("("),e=pt(),I(")"),e}function V(){var e=j(),t=e.type;if(t===ar.Identifier)return{type:ur.Identifier,name:S().value};if(t===ar.StringLiteral||t===ar.NumericLiteral)return hr&&e.octal&&k(e,pr.StrictOctalLiteral),Zt(S());if(t===ar.Keyword){if(P("this"))return S(),{type:ur.ThisExpression};if(P("function"))return Ut()}return t===ar.BooleanLiteral?(S(),e.value="true"===e.value,Zt(e)):t===ar.NullLiteral?(S(),e.value=null,Zt(e)):N("[")?D():N("{")?T():N("(")?q():N("/")||N("/=")?Zt(x()):_(S())}function G(){var e=[];if(I("("),!N(")"))for(;mr>dr&&(e.push(ct()),!N(")"));)I(",");return I(")"),e}function z(){var e=S();return w(e)||_(e),{type:ur.Identifier,name:e.value}}function H(){return I("."),z()}function K(){var e;return I("["),e=pt(),I("]"),e}function W(){var e;return O("new"),e={type:ur.NewExpression,callee:X(),arguments:[]},N("(")&&(e.arguments=G()),e}function Z(){var e;for(e=P("new")?W():V();N(".")||N("[")||N("(");)e=N("(")?{type:ur.CallExpression,callee:e,arguments:G()}:N("[")?{type:ur.MemberExpression,computed:!0,object:e,property:K()}:{type:ur.MemberExpression,computed:!1,object:e,property:H()};return e}function X(){var e;for(e=P("new")?W():V();N(".")||N("[");)e=N("[")?{type:ur.MemberExpression,computed:!0,object:e,property:K()}:{type:ur.MemberExpression,computed:!1,object:e,property:H()};return e}function Y(){var e,t=Z();return e=j(),e.type!==ar.Punctuator?t:(!N("++")&&!N("--")||A()||(hr&&t.type===ur.Identifier&&f(t.name)&&k({},pr.StrictLHSPostfix),M(t)||L({},pr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:S().value,argument:t,prefix:!1}),t)}function J(){var e,t;return e=j(),e.type!==ar.Punctuator&&e.type!==ar.Keyword?Y():N("++")||N("--")?(e=S(),t=J(),hr&&t.type===ur.Identifier&&f(t.name)&&k({},pr.StrictLHSPrefix),M(t)||L({},pr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:e.value,argument:t,prefix:!0}):N("+")||N("-")||N("~")||N("!")?t={type:ur.UnaryExpression,operator:S().value,argument:J(),prefix:!0}:P("delete")||P("void")||P("typeof")?(t={type:ur.UnaryExpression,operator:S().value,argument:J(),prefix:!0},hr&&"delete"===t.operator&&t.argument.type===ur.Identifier&&k({},pr.StrictDelete),t):Y()}function $(){for(var e=J();N("*")||N("/")||N("%");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:J()};return e}function Q(){for(var e=$();N("+")||N("-");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:$()};return e}function et(){for(var e=Q();N("<<")||N(">>")||N(">>>");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:Q()};return e}function tt(){var e,t;for(t=br.allowIn,br.allowIn=!0,e=et();N("<")||N(">")||N("<=")||N(">=")||t&&P("in")||P("instanceof");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:et()};return br.allowIn=t,e}function rt(){for(var e=tt();N("==")||N("!=")||N("===")||N("!==");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:tt()};return e}function nt(){for(var e=rt();N("&");)S(),e={type:ur.BinaryExpression,operator:"&",left:e,right:rt()};return e}function it(){for(var e=nt();N("^");)S(),e={type:ur.BinaryExpression,operator:"^",left:e,right:nt()};return e}function ot(){for(var e=it();N("|");)S(),e={type:ur.BinaryExpression,operator:"|",left:e,right:it()};return e}function at(){for(var e=ot();N("&&");)S(),e={type:ur.LogicalExpression,operator:"&&",left:e,right:ot()};return e}function st(){for(var e=at();N("||");)S(),e={type:ur.LogicalExpression,operator:"||",left:e,right:at()};return e}function ut(){var e,t,r;return e=st(),N("?")&&(S(),t=br.allowIn,br.allowIn=!0,r=ct(),br.allowIn=t,I(":"),e={type:ur.ConditionalExpression,test:e,consequent:r,alternate:ct()}),e}function ct(){var e,t;return e=j(),t=ut(),C()&&(M(t)||L({},pr.InvalidLHSInAssignment),hr&&t.type===ur.Identifier&&f(t.name)&&k(e,pr.StrictLHSAssignment),t={type:ur.AssignmentExpression,operator:S().value,left:t,right:ct()}),t}function pt(){var e=ct();if(N(","))for(e={type:ur.SequenceExpression,expressions:[e]};mr>dr&&N(",");)S(),e.expressions.push(ct());return e}function lt(){for(var e,t=[];mr>dr&&!N("}")&&(e=Bt(),void 0!==e);)t.push(e);return t}function ft(){var e;return I("{"),e=lt(),I("}"),{type:ur.BlockStatement,body:e}}function ht(){var e=S();return e.type!==ar.Identifier&&_(e),{type:ur.Identifier,name:e.value}}function dt(e){var t=ht(),r=null;return hr&&f(t.name)&&k({},pr.StrictVarName),"const"===e?(I("="),r=ct()):N("=")&&(S(),r=ct()),{type:ur.VariableDeclarator,id:t,init:r}}function vt(e){var t=[];do{if(t.push(dt(e)),!N(","))break;S()}while(mr>dr);return t}function yt(){var e;return O("var"),e=vt(),F(),{type:ur.VariableDeclaration,declarations:e,kind:"var"}}function mt(e){var t;return O(e),t=vt(e),F(),{type:ur.VariableDeclaration,declarations:t,kind:e}}function gt(){return I(";"),{type:ur.EmptyStatement}}function bt(){var e=pt();return F(),{type:ur.ExpressionStatement,expression:e}}function xt(){var e,t,r;return O("if"),I("("),e=pt(),I(")"),t=Mt(),P("else")?(S(),r=Mt()):r=null,{type:ur.IfStatement,test:e,consequent:t,alternate:r}}function wt(){var e,t,r;return O("do"),r=br.inIteration,br.inIteration=!0,e=Mt(),br.inIteration=r,O("while"),I("("),t=pt(),I(")"),N(";")&&S(),{type:ur.DoWhileStatement,body:e,test:t}}function Et(){var e,t,r;return O("while"),I("("),e=pt(),I(")"),r=br.inIteration,br.inIteration=!0,t=Mt(),br.inIteration=r,{type:ur.WhileStatement,test:e,body:t}}function St(){var e=S();return{type:ur.VariableDeclaration,declarations:vt(),kind:e.value}}function jt(){var e,t,r,n,i,o,a;return e=t=r=null,O("for"),I("("),N(";")?S():(P("var")||P("let")?(br.allowIn=!1,e=St(),br.allowIn=!0,1===e.declarations.length&&P("in")&&(S(),n=e,i=pt(),e=null)):(br.allowIn=!1,e=pt(),br.allowIn=!0,P("in")&&(M(e)||L({},pr.InvalidLHSInForIn),S(),n=e,i=pt(),e=null)),n===void 0&&I(";")),n===void 0&&(N(";")||(t=pt()),I(";"),N(")")||(r=pt())),I(")"),a=br.inIteration,br.inIteration=!0,o=Mt(),br.inIteration=a,n===void 0?{type:ur.ForStatement,init:e,test:t,update:r,body:o}:{type:ur.ForInStatement,left:n,right:i,body:o,each:!1}}function At(){var e,t=null;return O("continue"),";"===fr[dr]?(S(),br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:null}):A()?(br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||L({},pr.UnknownLabel,t.name)),F(),null!==t||br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:t})}function Lt(){var e,t=null;return O("break"),";"===fr[dr]?(S(),br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:null}):A()?(br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||L({},pr.UnknownLabel,t.name)),F(),null!==t||br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:t}) | |
}function kt(){var e,t=null;return O("return"),br.inFunctionBody||k({},pr.IllegalReturn)," "===fr[dr]&&u(fr[dr+1])?(t=pt(),F(),{type:ur.ReturnStatement,argument:t}):A()?{type:ur.ReturnStatement,argument:null}:(N(";")||(e=j(),N("}")||e.type===ar.EOF||(t=pt())),F(),{type:ur.ReturnStatement,argument:t})}function _t(){var e,t;return hr&&k({},pr.StrictModeWith),O("with"),I("("),e=pt(),I(")"),t=Mt(),{type:ur.WithStatement,object:e,body:t}}function It(){var e,t,r=[];for(P("default")?(S(),e=null):(O("case"),e=pt()),I(":");mr>dr&&!(N("}")||P("default")||P("case"))&&(t=Mt(),void 0!==t);)r.push(t);return{type:ur.SwitchCase,test:e,consequent:r}}function Ot(){var e,t,r,n,i;if(O("switch"),I("("),e=pt(),I(")"),I("{"),N("}"))return S(),{type:ur.SwitchStatement,discriminant:e};for(t=[],n=br.inSwitch,br.inSwitch=!0,i=!1;mr>dr&&!N("}");)r=It(),null===r.test&&(i&&L({},pr.MultipleDefaultsInSwitch),i=!0),t.push(r);return br.inSwitch=n,I("}"),{type:ur.SwitchStatement,discriminant:e,cases:t}}function Nt(){var e;return O("throw"),A()&&L({},pr.NewlineAfterThrow),e=pt(),F(),{type:ur.ThrowStatement,argument:e}}function Pt(){var e;return O("catch"),I("("),N(")")&&_(j()),e=ht(),hr&&f(e.name)&&k({},pr.StrictCatchVariable),I(")"),{type:ur.CatchClause,param:e,body:ft()}}function Ct(){var e,t=[],r=null;return O("try"),e=ft(),P("catch")&&t.push(Pt()),P("finally")&&(S(),r=ft()),0!==t.length||r||L({},pr.NoCatchOrFinally),{type:ur.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:r}}function Ft(){return O("debugger"),F(),{type:ur.DebuggerStatement}}function Mt(){var e,t,r=j();if(r.type===ar.EOF&&_(r),r.type===ar.Punctuator)switch(r.value){case";":return gt();case"{":return ft();case"(":return bt();default:}if(r.type===ar.Keyword)switch(r.value){case"break":return Lt();case"continue":return At();case"debugger":return Ft();case"do":return wt();case"for":return jt();case"function":return Rt();case"if":return xt();case"return":return kt();case"switch":return Ot();case"throw":return Nt();case"try":return Ct();case"var":return yt();case"while":return Et();case"with":return _t();default:}return e=pt(),e.type===ur.Identifier&&N(":")?(S(),Object.prototype.hasOwnProperty.call(br.labelSet,e.name)&&L({},pr.Redeclaration,"Label",e.name),br.labelSet[e.name]=!0,t=Mt(),delete br.labelSet[e.name],{type:ur.LabeledStatement,label:e,body:t}):(F(),{type:ur.ExpressionStatement,expression:e})}function Dt(){var e,t,n,i,o,a,s,u,c=[];for(I("{");mr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Bt(),c.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&k(i,pr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(o=br.labelSet,a=br.inIteration,s=br.inSwitch,u=br.inFunctionBody,br.labelSet={},br.inIteration=!1,br.inSwitch=!1,br.inFunctionBody=!0;mr>dr&&!N("}")&&(e=Bt(),void 0!==e);)c.push(e);return I("}"),br.labelSet=o,br.inIteration=a,br.inSwitch=s,br.inFunctionBody=u,{type:ur.BlockStatement,body:c}}function Rt(){var e,t,r,n,i,o,a,s,u,c=[];if(O("function"),n=j(),e=ht(),hr?f(n.value)&&k(n,pr.StrictFunctionName):f(n.value)?(o=n,a=pr.StrictFunctionName):l(n.value)&&(o=n,a=pr.StrictReservedWord),I("("),!N(")"))for(u={};mr>dr&&(n=j(),t=ht(),hr?(f(n.value)&&(i=n,a=pr.StrictParamName),Object.prototype.hasOwnProperty.call(u,n.value)&&(i=n,a=pr.StrictParamDupe)):o||(f(n.value)?(o=n,a=pr.StrictParamName):l(n.value)?(o=n,a=pr.StrictReservedWord):Object.prototype.hasOwnProperty.call(u,n.value)&&(o=n,a=pr.StrictParamDupe)),c.push(t),u[t.name]=!0,!N(")"));)I(",");return I(")"),s=hr,r=Dt(),hr&&o&&L(o,a),hr&&i&&k(i,a),hr=s,{type:ur.FunctionDeclaration,id:e,params:c,defaults:[],body:r,rest:null,generator:!1,expression:!1}}function Ut(){var e,t,r,n,i,o,a,s,u=null,c=[];if(O("function"),N("(")||(e=j(),u=ht(),hr?f(e.value)&&k(e,pr.StrictFunctionName):f(e.value)?(r=e,n=pr.StrictFunctionName):l(e.value)&&(r=e,n=pr.StrictReservedWord)),I("("),!N(")"))for(s={};mr>dr&&(e=j(),i=ht(),hr?(f(e.value)&&(t=e,n=pr.StrictParamName),Object.prototype.hasOwnProperty.call(s,e.value)&&(t=e,n=pr.StrictParamDupe)):r||(f(e.value)?(r=e,n=pr.StrictParamName):l(e.value)?(r=e,n=pr.StrictReservedWord):Object.prototype.hasOwnProperty.call(s,e.value)&&(r=e,n=pr.StrictParamDupe)),c.push(i),s[i.name]=!0,!N(")"));)I(",");return I(")"),a=hr,o=Dt(),hr&&r&&L(r,n),hr&&t&&k(t,n),hr=a,{type:ur.FunctionExpression,id:u,params:c,defaults:[],body:o,rest:null,generator:!1,expression:!1}}function Bt(){var e=j();if(e.type===ar.Keyword)switch(e.value){case"const":case"let":return mt(e.value);case"function":return Rt();default:return Mt()}return e.type!==ar.EOF?Mt():void 0}function Tt(){for(var e,t,n,i,o=[];mr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Bt(),o.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&k(i,pr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(;mr>dr&&(e=Bt(),void 0!==e);)o.push(e);return o}function qt(){var e;return hr=!1,e={type:ur.Program,body:Tt()}}function Vt(e,r,n,i,o){t("number"==typeof n,"Comment must have valid position"),xr.comments.length>0&&xr.comments[xr.comments.length-1].range[1]>n||xr.comments.push({type:e,value:r,range:[n,i],loc:o})}function Gt(){var e,t,r,n,i,o;for(e="",i=!1,o=!1;mr>dr;)if(t=fr[dr],o)t=fr[dr++],s(t)?(r.end={line:vr,column:dr-yr-1},o=!1,Vt("Line",e,n,dr-1,r),"\r"===t&&"\n"===fr[dr]&&++dr,++vr,yr=dr,e=""):dr>=mr?(o=!1,e+=t,r.end={line:vr,column:mr-yr},Vt("Line",e,n,mr,r)):e+=t;else if(i)s(t)?("\r"===t&&"\n"===fr[dr+1]?(++dr,e+="\r\n"):e+=t,++vr,++dr,yr=dr,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")):(t=fr[dr++],dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL"),e+=t,"*"===t&&(t=fr[dr],"/"===t&&(e=e.substr(0,e.length-1),i=!1,++dr,r.end={line:vr,column:dr-yr},Vt("Block",e,n,dr,r),e="")));else if("/"===t)if(t=fr[dr+1],"/"===t)r={start:{line:vr,column:dr-yr}},n=dr,dr+=2,o=!0,dr>=mr&&(r.end={line:vr,column:dr-yr},o=!1,Vt("Line",e,n,dr,r));else{if("*"!==t)break;n=dr,dr+=2,i=!0,r={start:{line:vr,column:dr-yr-2}},dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")}else if(a(t))++dr;else{if(!s(t))break;++dr,"\r"===t&&"\n"===fr[dr]&&++dr,++vr,yr=dr}}function zt(){var e,t,r,n=[];for(e=0;xr.comments.length>e;++e)t=xr.comments[e],r={type:t.type,value:t.value},xr.range&&(r.range=t.range),xr.loc&&(r.loc=t.loc),n.push(r);xr.comments=n}function Ht(){var e,t,n,i,o;return d(),e=dr,t={start:{line:vr,column:dr-yr}},n=xr.advance(),t.end={line:vr,column:dr-yr},n.type!==ar.EOF&&(i=[n.range[0],n.range[1]],o=r(n.range[0],n.range[1]),xr.tokens.push({type:sr[n.type],value:o,range:i,loc:t})),n}function Kt(){var e,t,r,n;return d(),e=dr,t={start:{line:vr,column:dr-yr}},r=xr.scanRegExp(),t.end={line:vr,column:dr-yr},xr.tokens.length>0&&(n=xr.tokens[xr.tokens.length-1],n.range[0]===e&&"Punctuator"===n.type&&("/"===n.value||"/="===n.value)&&xr.tokens.pop()),xr.tokens.push({type:"RegularExpression",value:r.literal,range:[e,dr],loc:t}),r}function Wt(){var e,t,r,n=[];for(e=0;xr.tokens.length>e;++e)t=xr.tokens[e],r={type:t.type,value:t.value},xr.range&&(r.range=t.range),xr.loc&&(r.loc=t.loc),n.push(r);xr.tokens=n}function Zt(e){return{type:ur.Literal,value:e.value}}function Xt(e){return{type:ur.Literal,value:e.value,raw:r(e.range[0],e.range[1])}}function Yt(){var e={};return e.range=[dr,dr],e.loc={start:{line:vr,column:dr-yr},end:{line:vr,column:dr-yr}},e.end=function(){this.range[1]=dr,this.loc.end.line=vr,this.loc.end.column=dr-yr},e.applyGroup=function(e){xr.range&&(e.groupRange=[this.range[0],this.range[1]]),xr.loc&&(e.groupLoc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e.apply=function(e){xr.range&&(e.range=[this.range[0],this.range[1]]),xr.loc&&(e.loc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e}function Jt(){var e,t;return d(),e=Yt(),I("("),t=pt(),I(")"),e.end(),e.applyGroup(t),t}function $t(){var e,t;for(d(),e=Yt(),t=P("new")?W():V();N(".")||N("[");)N("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:K()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:H()},e.end(),e.apply(t));return t}function Qt(){var e,t;for(d(),e=Yt(),t=P("new")?W():V();N(".")||N("[")||N("(");)N("(")?(t={type:ur.CallExpression,callee:t,arguments:G()},e.end(),e.apply(t)):N("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:K()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:H()},e.end(),e.apply(t));return t}function er(e){var t,r,n;t="[object Array]"===Object.prototype.toString.apply(e)?[]:{};for(r in e)e.hasOwnProperty(r)&&"groupRange"!==r&&"groupLoc"!==r&&(n=e[r],t[r]=null===n||"object"!=typeof n||n instanceof RegExp?n:er(n));return t}function tr(e,t){return function(r){function n(e){return e.type===ur.LogicalExpression||e.type===ur.BinaryExpression}function i(r){var o,a;n(r.left)&&i(r.left),n(r.right)&&i(r.right),e&&(r.left.groupRange||r.right.groupRange?(o=r.left.groupRange?r.left.groupRange[0]:r.left.range[0],a=r.right.groupRange?r.right.groupRange[1]:r.right.range[1],r.range=[o,a]):r.range===void 0&&(o=r.left.range[0],a=r.right.range[1],r.range=[o,a])),t&&(r.left.groupLoc||r.right.groupLoc?(o=r.left.groupLoc?r.left.groupLoc.start:r.left.loc.start,a=r.right.groupLoc?r.right.groupLoc.end:r.right.loc.end,r.loc={start:o,end:a}):r.loc===void 0&&(r.loc={start:r.left.loc.start,end:r.right.loc.end}))}return function(){var o,a;return d(),o=Yt(),a=r.apply(null,arguments),o.end(),e&&a.range===void 0&&o.apply(a),t&&a.loc===void 0&&o.apply(a),n(a)&&i(a),a}}}function rr(){var e;xr.comments&&(xr.skipComment=d,d=Gt),xr.raw&&(xr.createLiteral=Zt,Zt=Xt),(xr.range||xr.loc)&&(xr.parseGroupExpression=q,xr.parseLeftHandSideExpression=X,xr.parseLeftHandSideExpressionAllowCall=Z,q=Jt,X=$t,Z=Qt,e=tr(xr.range,xr.loc),xr.parseAdditiveExpression=Q,xr.parseAssignmentExpression=ct,xr.parseBitwiseANDExpression=nt,xr.parseBitwiseORExpression=ot,xr.parseBitwiseXORExpression=it,xr.parseBlock=ft,xr.parseFunctionSourceElements=Dt,xr.parseCatchClause=Pt,xr.parseComputedMember=K,xr.parseConditionalExpression=ut,xr.parseConstLetDeclaration=mt,xr.parseEqualityExpression=rt,xr.parseExpression=pt,xr.parseForVariableDeclaration=St,xr.parseFunctionDeclaration=Rt,xr.parseFunctionExpression=Ut,xr.parseLogicalANDExpression=at,xr.parseLogicalORExpression=st,xr.parseMultiplicativeExpression=$,xr.parseNewExpression=W,xr.parseNonComputedProperty=z,xr.parseObjectProperty=B,xr.parseObjectPropertyKey=U,xr.parsePostfixExpression=Y,xr.parsePrimaryExpression=V,xr.parseProgram=qt,xr.parsePropertyFunction=R,xr.parseRelationalExpression=tt,xr.parseStatement=Mt,xr.parseShiftExpression=et,xr.parseSwitchCase=It,xr.parseUnaryExpression=J,xr.parseVariableDeclaration=dt,xr.parseVariableIdentifier=ht,Q=e(xr.parseAdditiveExpression),ct=e(xr.parseAssignmentExpression),nt=e(xr.parseBitwiseANDExpression),ot=e(xr.parseBitwiseORExpression),it=e(xr.parseBitwiseXORExpression),ft=e(xr.parseBlock),Dt=e(xr.parseFunctionSourceElements),Pt=e(xr.parseCatchClause),K=e(xr.parseComputedMember),ut=e(xr.parseConditionalExpression),mt=e(xr.parseConstLetDeclaration),rt=e(xr.parseEqualityExpression),pt=e(xr.parseExpression),St=e(xr.parseForVariableDeclaration),Rt=e(xr.parseFunctionDeclaration),Ut=e(xr.parseFunctionExpression),X=e(X),at=e(xr.parseLogicalANDExpression),st=e(xr.parseLogicalORExpression),$=e(xr.parseMultiplicativeExpression),W=e(xr.parseNewExpression),z=e(xr.parseNonComputedProperty),B=e(xr.parseObjectProperty),U=e(xr.parseObjectPropertyKey),Y=e(xr.parsePostfixExpression),V=e(xr.parsePrimaryExpression),qt=e(xr.parseProgram),R=e(xr.parsePropertyFunction),tt=e(xr.parseRelationalExpression),Mt=e(xr.parseStatement),et=e(xr.parseShiftExpression),It=e(xr.parseSwitchCase),J=e(xr.parseUnaryExpression),dt=e(xr.parseVariableDeclaration),ht=e(xr.parseVariableIdentifier)),xr.tokens!==void 0&&(xr.advance=E,xr.scanRegExp=x,E=Ht,x=Kt)}function nr(){"function"==typeof xr.skipComment&&(d=xr.skipComment),xr.raw&&(Zt=xr.createLiteral),(xr.range||xr.loc)&&(Q=xr.parseAdditiveExpression,ct=xr.parseAssignmentExpression,nt=xr.parseBitwiseANDExpression,ot=xr.parseBitwiseORExpression,it=xr.parseBitwiseXORExpression,ft=xr.parseBlock,Dt=xr.parseFunctionSourceElements,Pt=xr.parseCatchClause,K=xr.parseComputedMember,ut=xr.parseConditionalExpression,mt=xr.parseConstLetDeclaration,rt=xr.parseEqualityExpression,pt=xr.parseExpression,St=xr.parseForVariableDeclaration,Rt=xr.parseFunctionDeclaration,Ut=xr.parseFunctionExpression,q=xr.parseGroupExpression,X=xr.parseLeftHandSideExpression,Z=xr.parseLeftHandSideExpressionAllowCall,at=xr.parseLogicalANDExpression,st=xr.parseLogicalORExpression,$=xr.parseMultiplicativeExpression,W=xr.parseNewExpression,z=xr.parseNonComputedProperty,B=xr.parseObjectProperty,U=xr.parseObjectPropertyKey,V=xr.parsePrimaryExpression,Y=xr.parsePostfixExpression,qt=xr.parseProgram,R=xr.parsePropertyFunction,tt=xr.parseRelationalExpression,Mt=xr.parseStatement,et=xr.parseShiftExpression,It=xr.parseSwitchCase,J=xr.parseUnaryExpression,dt=xr.parseVariableDeclaration,ht=xr.parseVariableIdentifier),"function"==typeof xr.scanRegExp&&(E=xr.advance,x=xr.scanRegExp)}function ir(e){var t,r=e.length,n=[];for(t=0;r>t;++t)n[t]=e.charAt(t);return n}function or(e,t){var r,n;n=String,"string"==typeof e||e instanceof String||(e=n(e)),fr=e,dr=0,vr=fr.length>0?1:0,yr=0,mr=fr.length,gr=null,br={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},xr={},t!==void 0&&(xr.range="boolean"==typeof t.range&&t.range,xr.loc="boolean"==typeof t.loc&&t.loc,xr.raw="boolean"==typeof t.raw&&t.raw,"boolean"==typeof t.tokens&&t.tokens&&(xr.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(xr.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(xr.errors=[])),mr>0&&fr[0]===void 0&&(e instanceof String&&(fr=e.valueOf()),fr[0]===void 0&&(fr=ir(e))),rr();try{r=qt(),xr.comments!==void 0&&(zt(),r.comments=xr.comments),xr.tokens!==void 0&&(Wt(),r.tokens=xr.tokens),xr.errors!==void 0&&(r.errors=xr.errors),(xr.range||xr.loc)&&(r.body=er(r.body))}catch(i){throw i}finally{nr(),xr={}}return r}var ar,sr,ur,cr,pr,lr,fr,hr,dr,vr,yr,mr,gr,br,xr;ar={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},sr={},sr[ar.BooleanLiteral]="Boolean",sr[ar.EOF]="<end>",sr[ar.Identifier]="Identifier",sr[ar.Keyword]="Keyword",sr[ar.NullLiteral]="Null",sr[ar.NumericLiteral]="Numeric",sr[ar.Punctuator]="Punctuator",sr[ar.StringLiteral]="String",ur={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},cr={Data:1,Get:2,Set:4},pr={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},lr={NonAsciiIdentifierStart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},"esprima"[0]===void 0&&(r=function(e,t){return fr.slice(e,t).join("")}),e.version="1.0.3",e.parse=or,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in ur)ur.hasOwnProperty(e)&&(t[e]=ur[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()})})()},{}],17:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,i=e[0],o=e[0],a=1;n>a;++a)if(o=i,i=e[a],t(i,o)){if(a===r){r++;continue}e[r++]=i}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],i=e[0],o=1;r>o;++o,i=n)if(i=n,n=e[o],n!==i){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function i(e,t,i){return 0===e.length?[]:t?(i||e.sort(t),r(e,t)):(i||e.sort(),n(e))}t.exports=i},{}],18:[function(e,t,r){(function(){(function(e,t){"use strict";"function"==typeof define&&define.amd?define(["exports"],t):r!==void 0?t(r):t(e.esprima={})})(this,function(e){"use strict";function t(e,t){if(!e)throw Error("ASSERT: "+t)}function r(e,t){return fr.slice(e,t)}function n(e){return"0123456789".indexOf(e)>=0}function i(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function o(e){return"01234567".indexOf(e)>=0}function a(e){return" "===e||" "===e||""===e||"\f"===e||" "===e||e.charCodeAt(0)>=5760&&" ".indexOf(e)>=0}function s(e){return"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e}function u(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e.charCodeAt(0)>=128&&lr.NonAsciiIdentifierStart.test(e)}function c(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&lr.NonAsciiIdentifierPart.test(e)}function p(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function l(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0}return!1}function f(e){return"eval"===e||"arguments"===e}function h(e){var t=!1;switch(e.length){case 2:t="if"===e||"in"===e||"do"===e;break;case 3:t="var"===e||"for"===e||"new"===e||"try"===e;break;case 4:t="this"===e||"else"===e||"case"===e||"void"===e||"with"===e;break;case 5:t="while"===e||"break"===e||"catch"===e||"throw"===e;break;case 6:t="return"===e||"typeof"===e||"delete"===e||"switch"===e;break;case 7:t="default"===e||"finally"===e;break;case 8:t="function"===e||"continue"===e||"debugger"===e;break;case 10:t="instanceof"===e}if(t)return!0;switch(e){case"const":return!0;case"yield":case"let":return!0}return hr&&l(e)?!0:p(e)}function d(){var e,t,r;for(t=!1,r=!1;mr>dr;)if(e=fr[dr],r)e=fr[dr++],s(e)&&(r=!1,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,yr=dr);else if(t)s(e)?("\r"===e&&"\n"===fr[dr+1]&&++dr,++vr,++dr,yr=dr,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")):(e=fr[dr++],dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL"),"*"===e&&(e=fr[dr],"/"===e&&(++dr,t=!1)));else if("/"===e)if(e=fr[dr+1],"/"===e)dr+=2,r=!0;else{if("*"!==e)break;dr+=2,t=!0,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")}else if(a(e))++dr;else{if(!s(e))break;++dr,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,yr=dr}}function v(e){var t,r,n,o=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(mr>dr&&i(fr[dr])))return"";n=fr[dr++],o=16*o+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(o)}function y(){var e,t,r,n;if(e=fr[dr],u(e)){if(t=dr,"\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!u(e))return;r=e}else dr=n,r="u"}else r=fr[dr++];for(;mr>dr&&(e=fr[dr],c(e));)if("\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!c(e))return;r+=e}else dr=n,r+="u"}else r+=fr[dr++];return 1===r.length?{type:ar.Identifier,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:h(r)?{type:ar.Keyword,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:"null"===r?{type:ar.NullLiteral,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:"true"===r||"false"===r?{type:ar.BooleanLiteral,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}:{type:ar.Identifier,value:r,lineNumber:vr,lineStart:yr,range:[t,dr]}}}function m(){var e,t,r,i=dr,o=fr[dr];return";"===o||"{"===o||"}"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:yr,range:[i,dr]}):","===o||"("===o||")"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:yr,range:[i,dr]}):(e=fr[dr+1],"."!==o||n(e)?(t=fr[dr+2],r=fr[dr+3],">"===o&&">"===e&&">"===t&&"="===r?(dr+=4,{type:ar.Punctuator,value:">>>=",lineNumber:vr,lineStart:yr,range:[i,dr]}):"="===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"===",lineNumber:vr,lineStart:yr,range:[i,dr]}):"!"===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"!==",lineNumber:vr,lineStart:yr,range:[i,dr]}):">"===o&&">"===e&&">"===t?(dr+=3,{type:ar.Punctuator,value:">>>",lineNumber:vr,lineStart:yr,range:[i,dr]}):"<"===o&&"<"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"<<=",lineNumber:vr,lineStart:yr,range:[i,dr]}):">"===o&&">"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:">>=",lineNumber:vr,lineStart:yr,range:[i,dr]}):"="===e&&"<>=!+-*%&|^/".indexOf(o)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:yr,range:[i,dr]}):o===e&&"+-<>&|".indexOf(o)>=0&&"+-<>&|".indexOf(e)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:yr,range:[i,dr]}):"[]<>+-*%&|^!~?:=/".indexOf(o)>=0?{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:yr,range:[i,dr]}:void 0):{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:yr,range:[i,dr]})}function g(){var e,r,a;if(a=fr[dr],t(n(a)||"."===a,"Numeric literal must start with a decimal digit or a decimal point"),r=dr,e="","."!==a){if(e=fr[dr++],a=fr[dr],"0"===e){if("x"===a||"X"===a){for(e+=fr[dr++];mr>dr&&(a=fr[dr],i(a));)e+=fr[dr++];return 2>=e.length&&L({},pr.UnexpectedToken,"ILLEGAL"),mr>dr&&(a=fr[dr],u(a)&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,16),lineNumber:vr,lineStart:yr,range:[r,dr]}}if(o(a)){for(e+=fr[dr++];mr>dr&&(a=fr[dr],o(a));)e+=fr[dr++];return mr>dr&&(a=fr[dr],(u(a)||n(a))&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:vr,lineStart:yr,range:[r,dr]}}n(a)&&L({},pr.UnexpectedToken,"ILLEGAL")}for(;mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++]}if("."===a)for(e+=fr[dr++];mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];if("e"===a||"E"===a)if(e+=fr[dr++],a=fr[dr],("+"===a||"-"===a)&&(e+=fr[dr++]),a=fr[dr],n(a))for(e+=fr[dr++];mr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];else a="character "+a,dr>=mr&&(a="<end>"),L({},pr.UnexpectedToken,"ILLEGAL");return mr>dr&&(a=fr[dr],u(a)&&L({},pr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseFloat(e),lineNumber:vr,lineStart:yr,range:[r,dr]}}function b(){var e,r,n,i,a,u,c="",p=!1;for(e=fr[dr],t("'"===e||'"'===e,"String literal must starts with a quote"),r=dr,++dr;mr>dr;){if(n=fr[dr++],n===e){e="";break}if("\\"===n)if(n=fr[dr++],s(n))++vr,"\r"===n&&"\n"===fr[dr]&&++dr;else switch(n){case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"u":case"x":u=dr,a=v(n),a?c+=a:(dr=u,c+=n);break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="";break;default:o(n)?(i="01234567".indexOf(n),0!==i&&(p=!0),mr>dr&&o(fr[dr])&&(p=!0,i=8*i+"01234567".indexOf(fr[dr++]),"0123".indexOf(n)>=0&&mr>dr&&o(fr[dr])&&(i=8*i+"01234567".indexOf(fr[dr++]))),c+=String.fromCharCode(i)):c+=n}else{if(s(n))break;c+=n}}return""!==e&&L({},pr.UnexpectedToken,"ILLEGAL"),{type:ar.StringLiteral,value:c,octal:p,lineNumber:vr,lineStart:yr,range:[r,dr]}}function x(){var e,r,n,i,o,a,u,p=!1,l=!1;for(gr=null,d(),n=dr,r=fr[dr],t("/"===r,"Regular expression literal must start with a slash"),e=fr[dr++];mr>dr;)if(r=fr[dr++],e+=r,p)"]"===r&&(p=!1);else if("\\"===r)r=fr[dr++],s(r)&&L({},pr.UnterminatedRegExp),e+=r;else{if("/"===r){l=!0;break}"["===r?p=!0:s(r)&&L({},pr.UnterminatedRegExp)}for(l||L({},pr.UnterminatedRegExp),i=e.substr(1,e.length-2),o="";mr>dr&&(r=fr[dr],c(r));)if(++dr,"\\"===r&&mr>dr)if(r=fr[dr],"u"===r)if(++dr,u=dr,r=v("u"))for(o+=r,e+="\\u";dr>u;++u)e+=fr[u];else dr=u,o+="u",e+="\\u";else e+="\\";else o+=r,e+=r;try{a=RegExp(i,o)}catch(f){L({},pr.InvalidRegExp)}return{literal:e,value:a,range:[n,dr]}}function w(e){return e.type===ar.Identifier||e.type===ar.Keyword||e.type===ar.BooleanLiteral||e.type===ar.NullLiteral}function E(){var e,t;return d(),dr>=mr?{type:ar.EOF,lineNumber:vr,lineStart:yr,range:[dr,dr]}:(t=m(),t!==void 0?t:(e=fr[dr],"'"===e||'"'===e?b():"."===e||n(e)?g():(t=y(),t!==void 0?t:(L({},pr.UnexpectedToken,"ILLEGAL"),void 0))))}function S(){var e;return gr?(dr=gr.range[1],vr=gr.lineNumber,yr=gr.lineStart,e=gr,gr=null,e):(gr=null,E())}function j(){var e,t,r;return null!==gr?gr:(e=dr,t=vr,r=yr,gr=E(),dr=e,vr=t,yr=r,gr)}function A(){var e,t,r,n;return e=dr,t=vr,r=yr,d(),n=vr!==t,dr=e,vr=t,yr=r,n}function L(e,t){var r,n=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,function(e,t){return n[t]||""});throw"number"==typeof e.lineNumber?(r=Error("Line "+e.lineNumber+": "+i),r.index=e.range[0],r.lineNumber=e.lineNumber,r.column=e.range[0]-yr+1):(r=Error("Line "+vr+": "+i),r.index=dr,r.lineNumber=vr,r.column=dr-yr+1),r}function k(){try{L.apply(null,arguments)}catch(e){if(!xr.errors)throw e;xr.errors.push(e)}}function _(e){if(e.type===ar.EOF&&L(e,pr.UnexpectedEOS),e.type===ar.NumericLiteral&&L(e,pr.UnexpectedNumber),e.type===ar.StringLiteral&&L(e,pr.UnexpectedString),e.type===ar.Identifier&&L(e,pr.UnexpectedIdentifier),e.type===ar.Keyword){if(p(e.value))L(e,pr.UnexpectedReserved);else if(hr&&l(e.value))return k(e,pr.StrictReservedWord),void 0;L(e,pr.UnexpectedToken,e.value)}L(e,pr.UnexpectedToken,e.value)}function I(e){var t=S();(t.type!==ar.Punctuator||t.value!==e)&&_(t)}function O(e){var t=S();(t.type!==ar.Keyword||t.value!==e)&&_(t)}function N(e){var t=j();return t.type===ar.Punctuator&&t.value===e}function P(e){var t=j();return t.type===ar.Keyword&&t.value===e}function C(){var e=j(),t=e.value;return e.type!==ar.Punctuator?!1:"="===t||"*="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t}function F(){var e,t;if(";"===fr[dr])return S(),void 0;if(t=vr,d(),vr===t){if(N(";"))return S(),void 0;e=j(),e.type===ar.EOF||N("}")||_(e)}}function M(e){return e.type===ur.Identifier||e.type===ur.MemberExpression}function D(){var e=[];for(I("[");!N("]");)N(",")?(S(),e.push(null)):(e.push(ct()),N("]")||I(","));return I("]"),{type:ur.ArrayExpression,elements:e}}function R(e,t){var r,n;return r=hr,n=Dt(),t&&hr&&f(e[0].name)&&k(t,pr.StrictParamName),hr=r,{type:ur.FunctionExpression,id:null,params:e,defaults:[],body:n,rest:null,generator:!1,expression:!1}}function U(){var e=S();return e.type===ar.StringLiteral||e.type===ar.NumericLiteral?(hr&&e.octal&&k(e,pr.StrictOctalLiteral),Zt(e)):{type:ur.Identifier,name:e.value}}function B(){var e,t,r,n;return e=j(),e.type===ar.Identifier?(r=U(),"get"!==e.value||N(":")?"set"!==e.value||N(":")?(I(":"),{type:ur.Property,key:r,value:ct(),kind:"init"}):(t=U(),I("("),e=j(),e.type!==ar.Identifier?(I(")"),k(e,pr.UnexpectedToken,e.value),{type:ur.Property,key:t,value:R([]),kind:"set"}):(n=[ht()],I(")"),{type:ur.Property,key:t,value:R(n,e),kind:"set"})):(t=U(),I("("),I(")"),{type:ur.Property,key:t,value:R([]),kind:"get"})):e.type!==ar.EOF&&e.type!==ar.Punctuator?(t=U(),I(":"),{type:ur.Property,key:t,value:ct(),kind:"init"}):(_(e),void 0)}function T(){var e,t,r,n=[],i={},o=String;for(I("{");!N("}");)e=B(),t=e.key.type===ur.Identifier?e.key.name:o(e.key.value),r="init"===e.kind?cr.Data:"get"===e.kind?cr.Get:cr.Set,Object.prototype.hasOwnProperty.call(i,t)?(i[t]===cr.Data?hr&&r===cr.Data?k({},pr.StrictDuplicateProperty):r!==cr.Data&&k({},pr.AccessorDataProperty):r===cr.Data?k({},pr.AccessorDataProperty):i[t]&r&&k({},pr.AccessorGetSet),i[t]|=r):i[t]=r,n.push(e),N("}")||I(",");return I("}"),{type:ur.ObjectExpression,properties:n}}function q(){var e;return I("("),e=pt(),I(")"),e}function V(){var e=j(),t=e.type;if(t===ar.Identifier)return{type:ur.Identifier,name:S().value};if(t===ar.StringLiteral||t===ar.NumericLiteral)return hr&&e.octal&&k(e,pr.StrictOctalLiteral),Zt(S());if(t===ar.Keyword){if(P("this"))return S(),{type:ur.ThisExpression}; | |
if(P("function"))return Ut()}return t===ar.BooleanLiteral?(S(),e.value="true"===e.value,Zt(e)):t===ar.NullLiteral?(S(),e.value=null,Zt(e)):N("[")?D():N("{")?T():N("(")?q():N("/")||N("/=")?Zt(x()):_(S())}function G(){var e=[];if(I("("),!N(")"))for(;mr>dr&&(e.push(ct()),!N(")"));)I(",");return I(")"),e}function z(){var e=S();return w(e)||_(e),{type:ur.Identifier,name:e.value}}function H(){return I("."),z()}function K(){var e;return I("["),e=pt(),I("]"),e}function W(){var e;return O("new"),e={type:ur.NewExpression,callee:X(),arguments:[]},N("(")&&(e.arguments=G()),e}function Z(){var e;for(e=P("new")?W():V();N(".")||N("[")||N("(");)e=N("(")?{type:ur.CallExpression,callee:e,arguments:G()}:N("[")?{type:ur.MemberExpression,computed:!0,object:e,property:K()}:{type:ur.MemberExpression,computed:!1,object:e,property:H()};return e}function X(){var e;for(e=P("new")?W():V();N(".")||N("[");)e=N("[")?{type:ur.MemberExpression,computed:!0,object:e,property:K()}:{type:ur.MemberExpression,computed:!1,object:e,property:H()};return e}function Y(){var e,t=Z();return e=j(),e.type!==ar.Punctuator?t:(!N("++")&&!N("--")||A()||(hr&&t.type===ur.Identifier&&f(t.name)&&k({},pr.StrictLHSPostfix),M(t)||L({},pr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:S().value,argument:t,prefix:!1}),t)}function J(){var e,t;return e=j(),e.type!==ar.Punctuator&&e.type!==ar.Keyword?Y():N("++")||N("--")?(e=S(),t=J(),hr&&t.type===ur.Identifier&&f(t.name)&&k({},pr.StrictLHSPrefix),M(t)||L({},pr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:e.value,argument:t,prefix:!0}):N("+")||N("-")||N("~")||N("!")?t={type:ur.UnaryExpression,operator:S().value,argument:J(),prefix:!0}:P("delete")||P("void")||P("typeof")?(t={type:ur.UnaryExpression,operator:S().value,argument:J(),prefix:!0},hr&&"delete"===t.operator&&t.argument.type===ur.Identifier&&k({},pr.StrictDelete),t):Y()}function $(){for(var e=J();N("*")||N("/")||N("%");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:J()};return e}function Q(){for(var e=$();N("+")||N("-");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:$()};return e}function et(){for(var e=Q();N("<<")||N(">>")||N(">>>");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:Q()};return e}function tt(){var e,t;for(t=br.allowIn,br.allowIn=!0,e=et();N("<")||N(">")||N("<=")||N(">=")||t&&P("in")||P("instanceof");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:et()};return br.allowIn=t,e}function rt(){for(var e=tt();N("==")||N("!=")||N("===")||N("!==");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:tt()};return e}function nt(){for(var e=rt();N("&");)S(),e={type:ur.BinaryExpression,operator:"&",left:e,right:rt()};return e}function it(){for(var e=nt();N("^");)S(),e={type:ur.BinaryExpression,operator:"^",left:e,right:nt()};return e}function ot(){for(var e=it();N("|");)S(),e={type:ur.BinaryExpression,operator:"|",left:e,right:it()};return e}function at(){for(var e=ot();N("&&");)S(),e={type:ur.LogicalExpression,operator:"&&",left:e,right:ot()};return e}function st(){for(var e=at();N("||");)S(),e={type:ur.LogicalExpression,operator:"||",left:e,right:at()};return e}function ut(){var e,t,r;return e=st(),N("?")&&(S(),t=br.allowIn,br.allowIn=!0,r=ct(),br.allowIn=t,I(":"),e={type:ur.ConditionalExpression,test:e,consequent:r,alternate:ct()}),e}function ct(){var e,t;return e=j(),t=ut(),C()&&(M(t)||L({},pr.InvalidLHSInAssignment),hr&&t.type===ur.Identifier&&f(t.name)&&k(e,pr.StrictLHSAssignment),t={type:ur.AssignmentExpression,operator:S().value,left:t,right:ct()}),t}function pt(){var e=ct();if(N(","))for(e={type:ur.SequenceExpression,expressions:[e]};mr>dr&&N(",");)S(),e.expressions.push(ct());return e}function lt(){for(var e,t=[];mr>dr&&!N("}")&&(e=Bt(),void 0!==e);)t.push(e);return t}function ft(){var e;return I("{"),e=lt(),I("}"),{type:ur.BlockStatement,body:e}}function ht(){var e=S();return e.type!==ar.Identifier&&_(e),{type:ur.Identifier,name:e.value}}function dt(e){var t=ht(),r=null;return hr&&f(t.name)&&k({},pr.StrictVarName),"const"===e?(I("="),r=ct()):N("=")&&(S(),r=ct()),{type:ur.VariableDeclarator,id:t,init:r}}function vt(e){var t=[];do{if(t.push(dt(e)),!N(","))break;S()}while(mr>dr);return t}function yt(){var e;return O("var"),e=vt(),F(),{type:ur.VariableDeclaration,declarations:e,kind:"var"}}function mt(e){var t;return O(e),t=vt(e),F(),{type:ur.VariableDeclaration,declarations:t,kind:e}}function gt(){return I(";"),{type:ur.EmptyStatement}}function bt(){var e=pt();return F(),{type:ur.ExpressionStatement,expression:e}}function xt(){var e,t,r;return O("if"),I("("),e=pt(),I(")"),t=Mt(),P("else")?(S(),r=Mt()):r=null,{type:ur.IfStatement,test:e,consequent:t,alternate:r}}function wt(){var e,t,r;return O("do"),r=br.inIteration,br.inIteration=!0,e=Mt(),br.inIteration=r,O("while"),I("("),t=pt(),I(")"),N(";")&&S(),{type:ur.DoWhileStatement,body:e,test:t}}function Et(){var e,t,r;return O("while"),I("("),e=pt(),I(")"),r=br.inIteration,br.inIteration=!0,t=Mt(),br.inIteration=r,{type:ur.WhileStatement,test:e,body:t}}function St(){var e=S();return{type:ur.VariableDeclaration,declarations:vt(),kind:e.value}}function jt(){var e,t,r,n,i,o,a;return e=t=r=null,O("for"),I("("),N(";")?S():(P("var")||P("let")?(br.allowIn=!1,e=St(),br.allowIn=!0,1===e.declarations.length&&P("in")&&(S(),n=e,i=pt(),e=null)):(br.allowIn=!1,e=pt(),br.allowIn=!0,P("in")&&(M(e)||L({},pr.InvalidLHSInForIn),S(),n=e,i=pt(),e=null)),n===void 0&&I(";")),n===void 0&&(N(";")||(t=pt()),I(";"),N(")")||(r=pt())),I(")"),a=br.inIteration,br.inIteration=!0,o=Mt(),br.inIteration=a,n===void 0?{type:ur.ForStatement,init:e,test:t,update:r,body:o}:{type:ur.ForInStatement,left:n,right:i,body:o,each:!1}}function At(){var e,t=null;return O("continue"),";"===fr[dr]?(S(),br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:null}):A()?(br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||L({},pr.UnknownLabel,t.name)),F(),null!==t||br.inIteration||L({},pr.IllegalContinue),{type:ur.ContinueStatement,label:t})}function Lt(){var e,t=null;return O("break"),";"===fr[dr]?(S(),br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:null}):A()?(br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||L({},pr.UnknownLabel,t.name)),F(),null!==t||br.inIteration||br.inSwitch||L({},pr.IllegalBreak),{type:ur.BreakStatement,label:t})}function kt(){var e,t=null;return O("return"),br.inFunctionBody||k({},pr.IllegalReturn)," "===fr[dr]&&u(fr[dr+1])?(t=pt(),F(),{type:ur.ReturnStatement,argument:t}):A()?{type:ur.ReturnStatement,argument:null}:(N(";")||(e=j(),N("}")||e.type===ar.EOF||(t=pt())),F(),{type:ur.ReturnStatement,argument:t})}function _t(){var e,t;return hr&&k({},pr.StrictModeWith),O("with"),I("("),e=pt(),I(")"),t=Mt(),{type:ur.WithStatement,object:e,body:t}}function It(){var e,t,r=[];for(P("default")?(S(),e=null):(O("case"),e=pt()),I(":");mr>dr&&!(N("}")||P("default")||P("case"))&&(t=Mt(),void 0!==t);)r.push(t);return{type:ur.SwitchCase,test:e,consequent:r}}function Ot(){var e,t,r,n,i;if(O("switch"),I("("),e=pt(),I(")"),I("{"),N("}"))return S(),{type:ur.SwitchStatement,discriminant:e};for(t=[],n=br.inSwitch,br.inSwitch=!0,i=!1;mr>dr&&!N("}");)r=It(),null===r.test&&(i&&L({},pr.MultipleDefaultsInSwitch),i=!0),t.push(r);return br.inSwitch=n,I("}"),{type:ur.SwitchStatement,discriminant:e,cases:t}}function Nt(){var e;return O("throw"),A()&&L({},pr.NewlineAfterThrow),e=pt(),F(),{type:ur.ThrowStatement,argument:e}}function Pt(){var e;return O("catch"),I("("),N(")")&&_(j()),e=ht(),hr&&f(e.name)&&k({},pr.StrictCatchVariable),I(")"),{type:ur.CatchClause,param:e,body:ft()}}function Ct(){var e,t=[],r=null;return O("try"),e=ft(),P("catch")&&t.push(Pt()),P("finally")&&(S(),r=ft()),0!==t.length||r||L({},pr.NoCatchOrFinally),{type:ur.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:r}}function Ft(){return O("debugger"),F(),{type:ur.DebuggerStatement}}function Mt(){var e,t,r=j();if(r.type===ar.EOF&&_(r),r.type===ar.Punctuator)switch(r.value){case";":return gt();case"{":return ft();case"(":return bt();default:}if(r.type===ar.Keyword)switch(r.value){case"break":return Lt();case"continue":return At();case"debugger":return Ft();case"do":return wt();case"for":return jt();case"function":return Rt();case"if":return xt();case"return":return kt();case"switch":return Ot();case"throw":return Nt();case"try":return Ct();case"var":return yt();case"while":return Et();case"with":return _t();default:}return e=pt(),e.type===ur.Identifier&&N(":")?(S(),Object.prototype.hasOwnProperty.call(br.labelSet,e.name)&&L({},pr.Redeclaration,"Label",e.name),br.labelSet[e.name]=!0,t=Mt(),delete br.labelSet[e.name],{type:ur.LabeledStatement,label:e,body:t}):(F(),{type:ur.ExpressionStatement,expression:e})}function Dt(){var e,t,n,i,o,a,s,u,c=[];for(I("{");mr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Bt(),c.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&k(i,pr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(o=br.labelSet,a=br.inIteration,s=br.inSwitch,u=br.inFunctionBody,br.labelSet={},br.inIteration=!1,br.inSwitch=!1,br.inFunctionBody=!0;mr>dr&&!N("}")&&(e=Bt(),void 0!==e);)c.push(e);return I("}"),br.labelSet=o,br.inIteration=a,br.inSwitch=s,br.inFunctionBody=u,{type:ur.BlockStatement,body:c}}function Rt(){var e,t,r,n,i,o,a,s,u,c=[];if(O("function"),n=j(),e=ht(),hr?f(n.value)&&k(n,pr.StrictFunctionName):f(n.value)?(o=n,a=pr.StrictFunctionName):l(n.value)&&(o=n,a=pr.StrictReservedWord),I("("),!N(")"))for(u={};mr>dr&&(n=j(),t=ht(),hr?(f(n.value)&&(i=n,a=pr.StrictParamName),Object.prototype.hasOwnProperty.call(u,n.value)&&(i=n,a=pr.StrictParamDupe)):o||(f(n.value)?(o=n,a=pr.StrictParamName):l(n.value)?(o=n,a=pr.StrictReservedWord):Object.prototype.hasOwnProperty.call(u,n.value)&&(o=n,a=pr.StrictParamDupe)),c.push(t),u[t.name]=!0,!N(")"));)I(",");return I(")"),s=hr,r=Dt(),hr&&o&&L(o,a),hr&&i&&k(i,a),hr=s,{type:ur.FunctionDeclaration,id:e,params:c,defaults:[],body:r,rest:null,generator:!1,expression:!1}}function Ut(){var e,t,r,n,i,o,a,s,u=null,c=[];if(O("function"),N("(")||(e=j(),u=ht(),hr?f(e.value)&&k(e,pr.StrictFunctionName):f(e.value)?(r=e,n=pr.StrictFunctionName):l(e.value)&&(r=e,n=pr.StrictReservedWord)),I("("),!N(")"))for(s={};mr>dr&&(e=j(),i=ht(),hr?(f(e.value)&&(t=e,n=pr.StrictParamName),Object.prototype.hasOwnProperty.call(s,e.value)&&(t=e,n=pr.StrictParamDupe)):r||(f(e.value)?(r=e,n=pr.StrictParamName):l(e.value)?(r=e,n=pr.StrictReservedWord):Object.prototype.hasOwnProperty.call(s,e.value)&&(r=e,n=pr.StrictParamDupe)),c.push(i),s[i.name]=!0,!N(")"));)I(",");return I(")"),a=hr,o=Dt(),hr&&r&&L(r,n),hr&&t&&k(t,n),hr=a,{type:ur.FunctionExpression,id:u,params:c,defaults:[],body:o,rest:null,generator:!1,expression:!1}}function Bt(){var e=j();if(e.type===ar.Keyword)switch(e.value){case"const":case"let":return mt(e.value);case"function":return Rt();default:return Mt()}return e.type!==ar.EOF?Mt():void 0}function Tt(){for(var e,t,n,i,o=[];mr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Bt(),o.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&k(i,pr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(;mr>dr&&(e=Bt(),void 0!==e);)o.push(e);return o}function qt(){var e;return hr=!1,e={type:ur.Program,body:Tt()}}function Vt(e,r,n,i,o){t("number"==typeof n,"Comment must have valid position"),xr.comments.length>0&&xr.comments[xr.comments.length-1].range[1]>n||xr.comments.push({type:e,value:r,range:[n,i],loc:o})}function Gt(){var e,t,r,n,i,o;for(e="",i=!1,o=!1;mr>dr;)if(t=fr[dr],o)t=fr[dr++],s(t)?(r.end={line:vr,column:dr-yr-1},o=!1,Vt("Line",e,n,dr-1,r),"\r"===t&&"\n"===fr[dr]&&++dr,++vr,yr=dr,e=""):dr>=mr?(o=!1,e+=t,r.end={line:vr,column:mr-yr},Vt("Line",e,n,mr,r)):e+=t;else if(i)s(t)?("\r"===t&&"\n"===fr[dr+1]?(++dr,e+="\r\n"):e+=t,++vr,++dr,yr=dr,dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")):(t=fr[dr++],dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL"),e+=t,"*"===t&&(t=fr[dr],"/"===t&&(e=e.substr(0,e.length-1),i=!1,++dr,r.end={line:vr,column:dr-yr},Vt("Block",e,n,dr,r),e="")));else if("/"===t)if(t=fr[dr+1],"/"===t)r={start:{line:vr,column:dr-yr}},n=dr,dr+=2,o=!0,dr>=mr&&(r.end={line:vr,column:dr-yr},o=!1,Vt("Line",e,n,dr,r));else{if("*"!==t)break;n=dr,dr+=2,i=!0,r={start:{line:vr,column:dr-yr-2}},dr>=mr&&L({},pr.UnexpectedToken,"ILLEGAL")}else if(a(t))++dr;else{if(!s(t))break;++dr,"\r"===t&&"\n"===fr[dr]&&++dr,++vr,yr=dr}}function zt(){var e,t,r,n=[];for(e=0;xr.comments.length>e;++e)t=xr.comments[e],r={type:t.type,value:t.value},xr.range&&(r.range=t.range),xr.loc&&(r.loc=t.loc),n.push(r);xr.comments=n}function Ht(){var e,t,n,i,o;return d(),e=dr,t={start:{line:vr,column:dr-yr}},n=xr.advance(),t.end={line:vr,column:dr-yr},n.type!==ar.EOF&&(i=[n.range[0],n.range[1]],o=r(n.range[0],n.range[1]),xr.tokens.push({type:sr[n.type],value:o,range:i,loc:t})),n}function Kt(){var e,t,r,n;return d(),e=dr,t={start:{line:vr,column:dr-yr}},r=xr.scanRegExp(),t.end={line:vr,column:dr-yr},xr.tokens.length>0&&(n=xr.tokens[xr.tokens.length-1],n.range[0]===e&&"Punctuator"===n.type&&("/"===n.value||"/="===n.value)&&xr.tokens.pop()),xr.tokens.push({type:"RegularExpression",value:r.literal,range:[e,dr],loc:t}),r}function Wt(){var e,t,r,n=[];for(e=0;xr.tokens.length>e;++e)t=xr.tokens[e],r={type:t.type,value:t.value},xr.range&&(r.range=t.range),xr.loc&&(r.loc=t.loc),n.push(r);xr.tokens=n}function Zt(e){return{type:ur.Literal,value:e.value}}function Xt(e){return{type:ur.Literal,value:e.value,raw:r(e.range[0],e.range[1])}}function Yt(){var e={};return e.range=[dr,dr],e.loc={start:{line:vr,column:dr-yr},end:{line:vr,column:dr-yr}},e.end=function(){this.range[1]=dr,this.loc.end.line=vr,this.loc.end.column=dr-yr},e.applyGroup=function(e){xr.range&&(e.groupRange=[this.range[0],this.range[1]]),xr.loc&&(e.groupLoc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e.apply=function(e){xr.range&&(e.range=[this.range[0],this.range[1]]),xr.loc&&(e.loc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e}function Jt(){var e,t;return d(),e=Yt(),I("("),t=pt(),I(")"),e.end(),e.applyGroup(t),t}function $t(){var e,t;for(d(),e=Yt(),t=P("new")?W():V();N(".")||N("[");)N("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:K()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:H()},e.end(),e.apply(t));return t}function Qt(){var e,t;for(d(),e=Yt(),t=P("new")?W():V();N(".")||N("[")||N("(");)N("(")?(t={type:ur.CallExpression,callee:t,arguments:G()},e.end(),e.apply(t)):N("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:K()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:H()},e.end(),e.apply(t));return t}function er(e){var t,r,n;t="[object Array]"===Object.prototype.toString.apply(e)?[]:{};for(r in e)e.hasOwnProperty(r)&&"groupRange"!==r&&"groupLoc"!==r&&(n=e[r],t[r]=null===n||"object"!=typeof n||n instanceof RegExp?n:er(n));return t}function tr(e,t){return function(r){function n(e){return e.type===ur.LogicalExpression||e.type===ur.BinaryExpression}function i(r){var o,a;n(r.left)&&i(r.left),n(r.right)&&i(r.right),e&&(r.left.groupRange||r.right.groupRange?(o=r.left.groupRange?r.left.groupRange[0]:r.left.range[0],a=r.right.groupRange?r.right.groupRange[1]:r.right.range[1],r.range=[o,a]):r.range===void 0&&(o=r.left.range[0],a=r.right.range[1],r.range=[o,a])),t&&(r.left.groupLoc||r.right.groupLoc?(o=r.left.groupLoc?r.left.groupLoc.start:r.left.loc.start,a=r.right.groupLoc?r.right.groupLoc.end:r.right.loc.end,r.loc={start:o,end:a}):r.loc===void 0&&(r.loc={start:r.left.loc.start,end:r.right.loc.end}))}return function(){var o,a;return d(),o=Yt(),a=r.apply(null,arguments),o.end(),e&&a.range===void 0&&o.apply(a),t&&a.loc===void 0&&o.apply(a),n(a)&&i(a),a}}}function rr(){var e;xr.comments&&(xr.skipComment=d,d=Gt),xr.raw&&(xr.createLiteral=Zt,Zt=Xt),(xr.range||xr.loc)&&(xr.parseGroupExpression=q,xr.parseLeftHandSideExpression=X,xr.parseLeftHandSideExpressionAllowCall=Z,q=Jt,X=$t,Z=Qt,e=tr(xr.range,xr.loc),xr.parseAdditiveExpression=Q,xr.parseAssignmentExpression=ct,xr.parseBitwiseANDExpression=nt,xr.parseBitwiseORExpression=ot,xr.parseBitwiseXORExpression=it,xr.parseBlock=ft,xr.parseFunctionSourceElements=Dt,xr.parseCatchClause=Pt,xr.parseComputedMember=K,xr.parseConditionalExpression=ut,xr.parseConstLetDeclaration=mt,xr.parseEqualityExpression=rt,xr.parseExpression=pt,xr.parseForVariableDeclaration=St,xr.parseFunctionDeclaration=Rt,xr.parseFunctionExpression=Ut,xr.parseLogicalANDExpression=at,xr.parseLogicalORExpression=st,xr.parseMultiplicativeExpression=$,xr.parseNewExpression=W,xr.parseNonComputedProperty=z,xr.parseObjectProperty=B,xr.parseObjectPropertyKey=U,xr.parsePostfixExpression=Y,xr.parsePrimaryExpression=V,xr.parseProgram=qt,xr.parsePropertyFunction=R,xr.parseRelationalExpression=tt,xr.parseStatement=Mt,xr.parseShiftExpression=et,xr.parseSwitchCase=It,xr.parseUnaryExpression=J,xr.parseVariableDeclaration=dt,xr.parseVariableIdentifier=ht,Q=e(xr.parseAdditiveExpression),ct=e(xr.parseAssignmentExpression),nt=e(xr.parseBitwiseANDExpression),ot=e(xr.parseBitwiseORExpression),it=e(xr.parseBitwiseXORExpression),ft=e(xr.parseBlock),Dt=e(xr.parseFunctionSourceElements),Pt=e(xr.parseCatchClause),K=e(xr.parseComputedMember),ut=e(xr.parseConditionalExpression),mt=e(xr.parseConstLetDeclaration),rt=e(xr.parseEqualityExpression),pt=e(xr.parseExpression),St=e(xr.parseForVariableDeclaration),Rt=e(xr.parseFunctionDeclaration),Ut=e(xr.parseFunctionExpression),X=e(X),at=e(xr.parseLogicalANDExpression),st=e(xr.parseLogicalORExpression),$=e(xr.parseMultiplicativeExpression),W=e(xr.parseNewExpression),z=e(xr.parseNonComputedProperty),B=e(xr.parseObjectProperty),U=e(xr.parseObjectPropertyKey),Y=e(xr.parsePostfixExpression),V=e(xr.parsePrimaryExpression),qt=e(xr.parseProgram),R=e(xr.parsePropertyFunction),tt=e(xr.parseRelationalExpression),Mt=e(xr.parseStatement),et=e(xr.parseShiftExpression),It=e(xr.parseSwitchCase),J=e(xr.parseUnaryExpression),dt=e(xr.parseVariableDeclaration),ht=e(xr.parseVariableIdentifier)),xr.tokens!==void 0&&(xr.advance=E,xr.scanRegExp=x,E=Ht,x=Kt)}function nr(){"function"==typeof xr.skipComment&&(d=xr.skipComment),xr.raw&&(Zt=xr.createLiteral),(xr.range||xr.loc)&&(Q=xr.parseAdditiveExpression,ct=xr.parseAssignmentExpression,nt=xr.parseBitwiseANDExpression,ot=xr.parseBitwiseORExpression,it=xr.parseBitwiseXORExpression,ft=xr.parseBlock,Dt=xr.parseFunctionSourceElements,Pt=xr.parseCatchClause,K=xr.parseComputedMember,ut=xr.parseConditionalExpression,mt=xr.parseConstLetDeclaration,rt=xr.parseEqualityExpression,pt=xr.parseExpression,St=xr.parseForVariableDeclaration,Rt=xr.parseFunctionDeclaration,Ut=xr.parseFunctionExpression,q=xr.parseGroupExpression,X=xr.parseLeftHandSideExpression,Z=xr.parseLeftHandSideExpressionAllowCall,at=xr.parseLogicalANDExpression,st=xr.parseLogicalORExpression,$=xr.parseMultiplicativeExpression,W=xr.parseNewExpression,z=xr.parseNonComputedProperty,B=xr.parseObjectProperty,U=xr.parseObjectPropertyKey,V=xr.parsePrimaryExpression,Y=xr.parsePostfixExpression,qt=xr.parseProgram,R=xr.parsePropertyFunction,tt=xr.parseRelationalExpression,Mt=xr.parseStatement,et=xr.parseShiftExpression,It=xr.parseSwitchCase,J=xr.parseUnaryExpression,dt=xr.parseVariableDeclaration,ht=xr.parseVariableIdentifier),"function"==typeof xr.scanRegExp&&(E=xr.advance,x=xr.scanRegExp)}function ir(e){var t,r=e.length,n=[];for(t=0;r>t;++t)n[t]=e.charAt(t);return n}function or(e,t){var r,n;n=String,"string"==typeof e||e instanceof String||(e=n(e)),fr=e,dr=0,vr=fr.length>0?1:0,yr=0,mr=fr.length,gr=null,br={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},xr={},t!==void 0&&(xr.range="boolean"==typeof t.range&&t.range,xr.loc="boolean"==typeof t.loc&&t.loc,xr.raw="boolean"==typeof t.raw&&t.raw,"boolean"==typeof t.tokens&&t.tokens&&(xr.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(xr.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(xr.errors=[])),mr>0&&fr[0]===void 0&&(e instanceof String&&(fr=e.valueOf()),fr[0]===void 0&&(fr=ir(e))),rr();try{r=qt(),xr.comments!==void 0&&(zt(),r.comments=xr.comments),xr.tokens!==void 0&&(Wt(),r.tokens=xr.tokens),xr.errors!==void 0&&(r.errors=xr.errors),(xr.range||xr.loc)&&(r.body=er(r.body))}catch(i){throw i}finally{nr(),xr={}}return r}var ar,sr,ur,cr,pr,lr,fr,hr,dr,vr,yr,mr,gr,br,xr;ar={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},sr={},sr[ar.BooleanLiteral]="Boolean",sr[ar.EOF]="<end>",sr[ar.Identifier]="Identifier",sr[ar.Keyword]="Keyword",sr[ar.NullLiteral]="Null",sr[ar.NumericLiteral]="Numeric",sr[ar.Punctuator]="Punctuator",sr[ar.StringLiteral]="String",ur={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},cr={Data:1,Get:2,Set:4},pr={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},lr={NonAsciiIdentifierStart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},"esprima"[0]===void 0&&(r=function(e,t){return fr.slice(e,t).join("")}),e.version="1.0.3",e.parse=or,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in ur)ur.hasOwnProperty(e)&&(t[e]=ur[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()})})()},{}],19:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,i=e[0],o=e[0],a=1;n>a;++a)if(o=i,i=e[a],t(i,o)){if(a===r){r++;continue}e[r++]=i}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],i=e[0],o=1;r>o;++o,i=n)if(i=n,n=e[o],n!==i){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function i(e,t,i){return 0===e.length?[]:t?(i||e.sort(t),r(e,t)):(i||e.sort(),n(e))}t.exports=i},{}],20:[function(e,t){"use strict";function r(e,t,r){var n,i,o=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],c=[],p=0,l=0;for(n=0;o>n;++n)c.push(["i",n,"=0"].join(""));for(i=0;a>i;++i)for(n=0;o>n;++n)l=p,p=e[n],0===n?c.push(["d",i,"s",n,"=t",i,"[",p,"]"].join("")):c.push(["d",i,"s",n,"=(t",i,"[",p,"]-s",l,"*t",i,"[",l,"])"].join(""));for(u.push("var "+c.join(",")),n=o-1;n>=0;--n)p=e[n],u.push(["for(i",n,"=0;i",n,"<s",p,";++i",n,"){"].join(""));for(u.push(r),n=0;o>n;++n){for(l=p,p=e[n],i=0;a>i;++i)u.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&u.push(["index[",l,"]-=s",l].join("")),u.push(["++index[",p,"]"].join(""))),u.push("}")}return u.join("\n")}function n(e,t,n,i){for(var o=t.length,a=n.arrayArgs.length,s=n.blockSize,u=n.indexArgs.length>0,c=[],p=0;a>p;++p)c.push(["var offset",p,"=p",p].join(""));for(var p=e;o>p;++p)c.push(["for(var j"+p+"=SS[",t[p],"]|0;j",p,">0;){"].join("")),c.push(["if(j",p,"<",s,"){"].join("")),c.push(["s",t[p],"=j",p].join("")),c.push(["j",p,"=0"].join("")),c.push(["}else{s",t[p],"=",s].join("")),c.push(["j",p,"-=",s,"}"].join("")),u&&c.push(["index[",t[p],"]=j",p].join(""));for(var p=0;a>p;++p){for(var l=["offset"+p],f=e;o>f;++f)l.push(["j",f,"*t",p,"[",t[f],"]"].join(""));c.push(["p",p,"=(",l.join("+"),")"].join(""))}c.push(r(t,n,i));for(var p=e;o>p;++p)c.push("}");return c.join("\n")}function i(e){for(var t=0,r=e[0].length;r>t;){for(var n=1;e.length>n;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function o(e,t,r){for(var n=e.body,i=[],o=[],a=0;e.args.length>a;++a){var s=e.args[a];if(!(0>=s.count)){var u=RegExp(s.name,"g");switch(t.argTypes[a]){case"array":var c=t.arrayArgs.indexOf(a);1===s.count?"generic"===r[c]?s.lvalue?(i.push(["var l",c,"=a",c,".get(p",c,")"].join("")),n=n.replace(u,"l"+c),o.push(["a",c,".set(p",c,",l",c,")"].join(""))):n=n.replace(u,["a",c,".get(p",c,")"].join("")):n=n.replace(u,["a",c,"[p",c,"]"].join("")):"generic"===r[c]?(i.push(["var l",c,"=a",c,".get(p",c,")"].join("")),n=n.replace(u,"l"+c),s.lvalue&&o.push(["a",c,".set(p",c,",l",c,")"].join(""))):(i.push(["var l",c,"=a",c,"[p",c,"]"].join("")),n=n.replace(u,"l"+c),s.lvalue&&o.push(["a",c,"[p",c,"]=l",c].join("")));break;case"scalar":n=n.replace(u,"Y"+t.scalarArgs.indexOf(a));break;case"index":n=n.replace(u,"index");break;case"shape":n=n.replace(u,"shape")}}}return[i.join("\n"),n,o.join("\n")].join("\n").trim()}function a(e){for(var t=Array(e.length),r=!0,n=0;e.length>n;++n){var i=e[n],o=i.match(/\d+/);o=o?o[0]:"",t[n]=0===i.charAt(0)?"u"+i.charAt(1)+o:i.charAt(0)+o,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function s(e,t){for(var s=0|t[1].length,c=Array(e.arrayArgs.length),p=Array(e.arrayArgs.length),l=["SS"],f=["'use strict'"],h=[],d=0;s>d;++d)h.push(["s",d,"=SS[",d,"]"].join(""));for(var v=0;e.arrayArgs.length>v;++v)l.push("a"+v),l.push("t"+v),l.push("p"+v),p[v]=t[2*v],c[v]=t[2*v+1];for(var v=0;e.scalarArgs.length>v;++v)l.push("Y"+v);if(e.shapeArgs.length>0&&h.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var y=Array(s),v=0;s>v;++v)y[v]="0";h.push(["index=[",y.join(","),"]"].join(""))}var m=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));h=h.concat(m),f.push("var "+h.join(","));for(var v=0;e.arrayArgs.length>v;++v)f.push("p"+v+"|=0");e.pre.body.length>3&&f.push(o(e.pre,e,p));var g=o(e.body,e,p),b=i(c);s>b?f.push(n(b,c[0],e,g)):f.push(r(c[0],e,g)),e.post.body.length>3&&f.push(o(e.post,e,p)),e.debug&&console.log("Generated cwise routine for ",t,":\n\n",f.join("\n"));var x=[e.funcName||"unnamed","_cwise_loop_",c[0].join("s"),"m",b,a(p)].join(""),w=Function(["function ",x,"(",l.join(","),"){",f.join("\n"),"} return ",x].join(""));return w()}var u=e("uniq");t.exports=s},{uniq:22}],21:[function(e,t){"use strict";function r(e,t,r){var n,i,o=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],c=[],p=0,l=0;for(n=0;o>n;++n)c.push(["i",n,"=0"].join(""));for(i=0;a>i;++i)for(n=0;o>n;++n)l=p,p=e[n],0===n?c.push(["d",i,"s",n,"=t",i,"[",p,"]"].join("")):c.push(["d",i,"s",n,"=(t",i,"[",p,"]-s",l,"*t",i,"[",l,"])"].join(""));for(u.push("var "+c.join(",")),n=o-1;n>=0;--n)p=e[n],u.push(["for(i",n,"=0;i",n,"<s",p,";++i",n,"){"].join(""));for(u.push(r),n=0;o>n;++n){for(l=p,p=e[n],i=0;a>i;++i)u.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&u.push(["index[",l,"]-=s",l].join("")),u.push(["++index[",p,"]"].join(""))),u.push("}")}return u.join("\n")}function n(e,t,n,i){for(var o=t.length,a=n.arrayArgs.length,s=n.blockSize,u=n.indexArgs.length>0,c=[],p=0;a>p;++p)c.push(["var offset",p,"=p",p].join(""));for(var p=e;o>p;++p)c.push(["for(var j"+p+"=SS[",t[p],"]|0;j",p,">0;){"].join("")),c.push(["if(j",p,"<",s,"){"].join("")),c.push(["s",t[p],"=j",p].join("")),c.push(["j",p,"=0"].join("")),c.push(["}else{s",t[p],"=",s].join("")),c.push(["j",p,"-=",s,"}"].join("")),u&&c.push(["index[",t[p],"]=j",p].join("")); | |
for(var p=0;a>p;++p){for(var l=["offset"+p],f=e;o>f;++f)l.push(["j",f,"*t",p,"[",t[f],"]"].join(""));c.push(["p",p,"=(",l.join("+"),")"].join(""))}c.push(r(t,n,i));for(var p=e;o>p;++p)c.push("}");return c.join("\n")}function i(e){for(var t=0,r=e[0].length;r>t;){for(var n=1;e.length>n;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function o(e,t,r){for(var n=e.body,i=[],o=[],a=0;e.args.length>a;++a){var s=e.args[a];if(!(0>=s.count)){var u=RegExp(s.name,"g");switch(t.argTypes[a]){case"array":var c=t.arrayArgs.indexOf(a);1===s.count?"generic"===r[c]?s.lvalue?(i.push(["var l",c,"=a",c,".get(p",c,")"].join("")),n=n.replace(u,"l"+c),o.push(["a",c,".set(p",c,",l",c,")"].join(""))):n=n.replace(u,["a",c,".get(p",c,")"].join("")):n=n.replace(u,["a",c,"[p",c,"]"].join("")):"generic"===r[c]?(i.push(["var l",c,"=a",c,".get(p",c,")"].join("")),n=n.replace(u,"l"+c),s.lvalue&&o.push(["a",c,".set(p",c,",l",c,")"].join(""))):(i.push(["var l",c,"=a",c,"[p",c,"]"].join("")),n=n.replace(u,"l"+c),s.lvalue&&o.push(["a",c,"[p",c,"]=l",c].join("")));break;case"scalar":n=n.replace(u,"Y"+t.scalarArgs.indexOf(a));break;case"index":n=n.replace(u,"index");break;case"shape":n=n.replace(u,"shape")}}}return[i.join("\n"),n,o.join("\n")].join("\n").trim()}function a(e){for(var t=Array(e.length),r=!0,n=0;e.length>n;++n){var i=e[n],o=i.match(/\d+/);o=o?o[0]:"",t[n]=0===i.charAt(0)?"u"+i.charAt(1)+o:i.charAt(0)+o,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function s(e,t){for(var s=0|t[1].length,c=Array(e.arrayArgs.length),p=Array(e.arrayArgs.length),l=["SS"],f=["'use strict'"],h=[],d=0;s>d;++d)h.push(["s",d,"=SS[",d,"]"].join(""));for(var v=0;e.arrayArgs.length>v;++v)l.push("a"+v),l.push("t"+v),l.push("p"+v),p[v]=t[2*v],c[v]=t[2*v+1];for(var v=0;e.scalarArgs.length>v;++v)l.push("Y"+v);if(e.shapeArgs.length>0&&h.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var y=Array(s),v=0;s>v;++v)y[v]="0";h.push(["index=[",y.join(","),"]"].join(""))}var m=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));h=h.concat(m),f.push("var "+h.join(","));for(var v=0;e.arrayArgs.length>v;++v)f.push("p"+v+"|=0");e.pre.body.length>3&&f.push(o(e.pre,e,p));var g=o(e.body,e,p),b=i(c);s>b?f.push(n(b,c[0],e,g)):f.push(r(c[0],e,g)),e.post.body.length>3&&f.push(o(e.post,e,p)),e.debug&&console.log("Generated cwise routine for ",t,":\n\n",f.join("\n"));var x=[e.funcName||"unnamed","_cwise_loop_",c[0].join("s"),"m",b,a(p)].join(""),w=Function(["function ",x,"(",l.join(","),"){",f.join("\n"),"} return ",x].join(""));return w()}var u=e("uniq");t.exports=s},{uniq:23}],22:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,i=e[0],o=e[0],a=1;n>a;++a)if(o=i,i=e[a],t(i,o)){if(a===r){r++;continue}e[r++]=i}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],i=e[0],o=1;r>o;++o,i=n)if(i=n,n=e[o],n!==i){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function i(e,t,i){return 0===e.length?[]:t?(i||e.sort(t),r(e,t)):(i||e.sort(),n(e))}t.exports=i},{}],23:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,i=e[0],o=e[0],a=1;n>a;++a)if(o=i,i=e[a],t(i,o)){if(a===r){r++;continue}e[r++]=i}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],i=e[0],o=1;r>o;++o,i=n)if(i=n,n=e[o],n!==i){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function i(e,t,i){return 0===e.length?[]:t?(i||e.sort(t),r(e,t)):(i||e.sort(),n(e))}t.exports=i},{}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({1:[function(e,t){var r=t.exports={};r.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){if(e.source===window&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var t=r.shift();t()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],2:[function(e,t,r){(function(e){function t(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;e.length>r;r++)if(t===e[r])return r;return-1}e.EventEmitter||(e.EventEmitter=function(){});var n=r.EventEmitter=e.EventEmitter,i="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=10;n.prototype.setMaxListeners=function(e){this._events||(this._events={}),this._events.maxListeners=e},n.prototype.emit=function(e){if("error"===e&&(!this._events||!this._events.error||i(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var t=this._events[e];if(!t)return!1;if("function"==typeof t){switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:var r=Array.prototype.slice.call(arguments,1);t.apply(this,r)}return!0}if(i(t)){for(var r=Array.prototype.slice.call(arguments,1),n=t.slice(),o=0,a=n.length;a>o;o++)n[o].apply(this,r);return!0}return!1},n.prototype.addListener=function(e,t){if("function"!=typeof t)throw Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",e,t),this._events[e])if(i(this._events[e])){if(!this._events[e].warned){var r;r=void 0!==this._events.maxListeners?this._events.maxListeners:o,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}this._events[e].push(t)}else this._events[e]=[this._events[e],t];else this._events[e]=t;return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){var r=this;return r.on(e,function n(){r.removeListener(e,n),t.apply(this,arguments)}),this},n.prototype.removeListener=function(e,r){if("function"!=typeof r)throw Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;var n=this._events[e];if(i(n)){var o=t(n,r);if(0>o)return this;n.splice(o,1),0==n.length&&delete this._events[e]}else this._events[e]===r&&delete this._events[e];return this},n.prototype.removeAllListeners=function(e){return 0===arguments.length?(this._events={},this):(e&&this._events&&this._events[e]&&(this._events[e]=null),this)},n.prototype.listeners=function(e){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),i(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]}})(e("__browserify_process"))},{__browserify_process:1}],"ndarray-continuous":[function(e,t){t.exports=e("j9v/Ir")},{}],"j9v/Ir":[function(e,t){function r(){}function n(e){if(!(this instanceof n))return new n(e);if(i.call(this),e=e||{},Array.isArray(e)&&(e={shape:e}),e.getter&&(this.getter=e.getter),!e.shape)throw Error("You need to provide a default shape for your ndarrays");this.offsets=[],this.shape=e.shape,this.dims=this.shape.length,this.index=a(this.dims,4,null,"position"),this.pending=a(this.dims,4,null,"position");for(var t=1,r=0;this.shape.length>r;r+=1)this.offsets[r]=t,t*=this.shape[r]}var i=e("events").EventEmitter,o=e("ndarray-group"),a=e("morton-page"),s=e("inherits"),u=e("cell-range"),c=e("map-async"),p=e("zeros");t.exports=n,s(n,i),n.prototype.each=function(e){for(var t=this.index.pages,r=0;t.length>r;r+=1)for(var n=0;t[r].length>n;n+=1)e.call(this,t[r][n])},n.prototype.size=function(){for(var e=this.index.pages,t=0,r=0;e.length>r;r+=1)t+=e[r].length;return t},n.prototype.chunk=function(e,t){function n(r,n){var i=0;if(o.pending.remove.apply(o.pending,e),r){for(t(r);s.length>i;i+=1)s[i](r);return s.length=0}for(u=n,n.position=e.slice(0),o.index.add(n),o.emit("created",n),t(null,n);s.length>i;i+=1)s[i](null,n);return s.length=0,n}var i=this.index.get.apply(this.index,e),o=this;if(t=t||r,i)return t(null,i),i;var a=this.pending.get.apply(this.pending,e);if(a)return a.push(t),null;var s=[];s.position=e,this.pending.add(s),this.getter.call(this,e,n);var u=null;return u},n.prototype.group=function(e,t,n){var i=u(e,t),a=this.offsets;this.shape;var s=this.dims,p=this;n=n||r,i.sort(function(e,t){for(var r=0,n=0,i=0;s>i;i+=1)r+=e[i]*a[i],n+=t[i]*a[i];return r-n});var l=null;return c(i,function(e,t){p.chunk(e,t)},function(r,i){if(r)return n(r);for(var a=[],s=0;e.length>s;s+=1)a[s]=t[s]-e[s]+1;l=o(a,i),n(null,l)}),l},n.prototype.range=function(e,t,n){var i=[],o=[],a=this.dims,s=[],u=[];n=n||r;for(var c=0;a>c;c+=1)i[c]=Math.floor(e[c]/this.shape[c]),o[c]=Math.ceil(t[c]/this.shape[c]),s[c]=-i[c]*this.shape[c]+e[c],u[c]=-i[c]*this.shape[c]+t[c]+1;var p=null;return this.group(i,o,function(e,t){return e?n(e):(t=t.hi.apply(t,u),t=t.lo.apply(t,s),n(null,p=t),void 0)}),p},n.prototype.get=function(e,t){for(var r=[],n=0,i=this.dims,o=this.shape,a=i;a--;)r[a]=Math.floor(e[a]/o[a]);return t=t||function(){},this.chunk(r,function(a,s){if(a)return t(a);for(var u=i;u--;)r[u]=e[u]-r[u]*o[u];return n=s.get.apply(s,r),t(null,n),n}),n},n.prototype.set=function(e,t,r){for(var n=[],i=this.shape,o=this.dims,a=o;a--;)n[a]=Math.floor(e[a]/i[a]);r=r||function(){},this.chunk(n,function(a,s){if(a)return r(a);for(var u=o;u--;)n[u]=e[u]-n[u]*i[u];return n[o]=t,s.set.apply(s,n),r(null)})},n.prototype.remove=function(e,t){var n=this.index.get.apply(this.index,e);return t=t||r,n?(this.emit("removed",n),this.index.remove.apply(this.index,e),t(null,n),!0):(t(null),!1)},n.prototype.getter=function(e,t){return t(null,p(this.shape))}},{events:2,"morton-page":3,"ndarray-group":4,"cell-range":5,inherits:6,zeros:7,"map-async":8}],5:[function(e,t){function r(e,t){function r(i,o,a){if(a===n-1)for(var s=e[a];t[a]>=s;s+=1)s===t[a]?(o.push(s),i.push(o)):i.push(o.concat(s));else for(var s=e[a];t[a]>=s;s+=1)s==t[a]?(o.push(s),r(i,o,a+1)):r(i,o.concat(s),a+1);return i}if(e.length!==t.length)throw Error("Both arguments must be arrays of equal length");var n=e.length;return t[t.length-1],r([],[],0)}t.exports=r},{}],6:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],8:[function(e,t){function r(e,t,r,i){function o(e){function t(t,r){return t?i&&i(t):(s[e]=r,0===--u&&i&&i(null,s),void 0)}return t}var a=Object.keys(e),s=Array.isArray(e)?[]:{},u=a.length;if("function"==typeof r&&(i=r,r=this),0===a.length)return i(null,s);for(var c=0,p=a.length;p>c;c++){var l=a[c],f=e[l];n(t,o(l),r,f,l,e)}}function n(e,t,r,n,i,o){var a=e.length;1===a?e.call(r,t):2===a?e.call(r,n,t):3===a?e.call(r,n,i,t):e.call(r,n,i,o,t)}t.exports=r},{}],3:[function(e,t){"use strict";function r(e,t,r,n){for(var a=Array(e),s=0;e>s;++s)a[s]="x"+s;var u=i(n),c=u?"."+n:"['"+n+"']",p=["'use strict'"],l=["MortonCache",e,"b",t].join("");p.push(["function ",l,"(sz){","this.pages=new Array(",1<<t,");","for(var i=0;i<",1<<t,";++i){this.pages[i]=[]};","}"].join("")),p.push(["var proto=",l,".prototype"].join("")),p.push("proto.bits="+t),p.push("proto.shift="+r),p.push("proto.key='"+n+"'"),p.push("proto.add=function(page){"),p.push(["this.pages[(interleave.apply(undefined, page",c,")>>",r,")&",(1<<t)-1,"].push(page)"].join("")),p.push("}");for(var f=[],s=0;e>s;++s)f.push(["(k[",s,"]===",a[s],")"].join(""));p.push(["proto.get=function(",a.join(","),"){","var pages=this.pages[(interleave(",a.join(","),")>>",r,")&",(1<<t)-1,"],n=pages.length;","for(var i=0;i<n;++i){","var p=pages[i],k=p",c,";","if(",f.join("&&"),"){ return p }","}","return null }"].join("")),p.push(["proto.remove=function(",a.join(","),"){","var pages=this.pages[(interleave(",a.join(","),")>>",r,")&",(1<<t)-1,"],n=pages.length;","for(var i=0;i<n;++i){","var k=pages[i]",c,";","if(",f.join("&&"),"){pages[i]=pages[pages.length-1];pages.pop();break;}","}","}"].join("")),p.push("return "+l);var h=Function("interleave",p.join("\n"));return h(o[e])}function n(e,t,n,i){n=n||0,i=i||"key",i=i.replace(/\'/g,"\\'");var o=[e,t,n,i].join(":"),s=a[o];return s?new s:(s=r(e,t,n,i),a[o]=s,new s)}var i=e("is-property"),o=e("bit-interleave"),a={};t.exports=n},{"is-property":9,"bit-interleave":10}],4:[function(e,t){function r(e,t){function r(){for(var e=0,r=0;s>r;r+=1)c[r]=i(arguments[r],l[r]),e+=o(arguments[r]/l[r])*h[r];var n=t[e];if(!n)throw Error("Position "+[].slice.call(arguments).join(",")+" (array "+(e+1)+"/"+t.length+") is out of bounds");return n.get.apply(n,c)}function a(){for(var e=0,r=0;s>r;r+=1)u[r]=i(arguments[r],l[r]),e+=o(arguments[r]/l[r])*h[r];var n=t[e];return u[s]=arguments[s],n.set.apply(n,u)}for(var s=e.length,u=[],c=[],p=[],l=[],f=1,h=[],d=0;s>d;d+=1)l[d]=t[0].shape[d],p[d]=l[d]*e[d],h[d]=f,f*=e[d];if(f!==t.length)throw Error("You need to supply a list of ndarrays "+f+" elements long");var v=n(p,r,a);return v.children=t,v}var n=e("ndarray-proxy"),i=e("mod-loop"),o=Math.floor;t.exports=r},{"ndarray-proxy":11,"mod-loop":12}],7:[function(e,t){"use strict";var r=e("ndarray");t.exports=function(e){for(var t=1,n=0;e.length>n;++n)t*=e[n];return r(new Float64Array(t),e)}},{ndarray:13}],9:[function(e,t){"use strict";function r(e){return/^[^0-9\/\\.\-+*!~()\[\];:?'"<>,{}|`~%\^& \f\n\r\t\v\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]\w*$/.test(e)}t.exports=r},{}],12:[function(e,t){function r(e,t){return e>0?e%t:(e+=(~~(e/t)+1)*t,e%t)}t.exports=r},{}],10:[function(e,t){"use strict";function r(e){for(var t=Array(e),r=["'use strict'"],n=0|Math.floor(32/e),o=0|32-n*e,a=(1<<n)-1,s=(1<<n+1)-1,u=[],c=[],p=i.nextPow2(n+1)>>1;p>0;p>>=1){for(var l=(1<<p)-1,f=0,h=0;32>h;h+=e*p)f|=l<<h;c.push(f>>>0),u.push(p*(e-1))}for(var d=i.nextPow2(n+1)===i.nextPow2(n)?0:1,v=0;e>v;++v)if(t[v]="x"+v,o>0){r.push(["x",v,"&=",s].join(""));for(var h=0;u.length>h;++h)r.push(["x",v,"=(x",v,"|(x",v,"<<",u[h],"))&",c[h]].join(""));--o}else{r.push(["x",v,"&=",a].join(""));for(var h=d;u.length>h;++h)r.push(["x",v,"=(x",v,"|(x",v,"<<",u[h],"))&",c[h]].join(""))}for(var y=["x0"],v=1;e>v;++v)y.push(["(x",v,"<<",v,")"].join(""));return r.push("return "+y.join("+")),t.push(r.join("\n")),Function.apply(void 0,t)}function n(e){for(var t=[],r=[],n=["'use strict'"],i=["switch(arguments.length){"],o=0;32>=o;++o)t.push("interleave"+o),i.push(["case ",o,": return interleave",o,"(",r.join(","),")"].join("")),32>o&&r.push("x"+o);i.push("default: return 0 }"),n.push(["return function interleaven(",r.join(","),"){",i.join("\n"),"}"].join("")),t.push(n.join("\n"));var a=Function.apply(void 0,t);return a.apply(void 0,e)}var i=e("bit-twiddle");(function(){var e=Array(33);e[0]=function(){},e[1]=function(e){return e};for(var i=2;33>i;++i)e[i]=r(i);t.exports=n(e);for(var i=0;32>=i;++i)t.exports[i]=e[i]})()},{"bit-twiddle":14}],11:[function(e,t){"use strict";function r(){throw Error("ndarray-lazy: Getter not implemented")}function n(){throw Error("ndarray-lazy: Setter not implemented")}function i(e,t,i){var s=e.length;if(0===s)return o([],[]);for(var u=Array(s),c=0,p="Proxy1DStore",l=0;s>l;++l)u[l]=a.log2(a.nextPow2(e[l])),c+=u[l];if(c>32)throw Error("ndarray-lazy: Not enough addressable bits. Can't create lazy array: "+e);for(var f=Array(s),h=Array(s),d=0,l=s-1;l>=0;--l)f[l]=1<<d,h[l]=0===d?"i&"+((1<<u[l])-1):["(i>>>",d,")&",(1<<u[l])-1].join(""),d+=u[l];var v=["'use strict'"];v.push(["function ",p,"(){};var proto=",p].join("")),v.push("proto.length="+(1<<c)),v.push(["proto.get=function(i){return get_func(",h.join(","),")}"].join("")),v.push("proto.set=function(i,v){return set_func(",h.join(","),",v)}"),v.push("return "+p);var y=Function("get_func","set_func",v.join("\n"));return o(y(t||r,i||n),e,f,0)}var o=e("ndarray"),a=e("bit-twiddle");t.exports=i},{ndarray:15,"bit-twiddle":16}],13:[function(e,t){"use strict";function r(e,t){return e[0]-t[0]}function n(){var e,t=this.stride,n=Array(t.length);for(e=0;n.length>e;++e)n[e]=[Math.abs(t[e]),e];n.sort(r);var i=Array(n.length);for(e=0;i.length>e;++e)i[e]=n[e][1];return i}function i(e,t){if(0===t){var r=Function([c,"ZeroArray.prototype.dtype='"+e+"'","return function construct_ZeroArray(a,b,c,d){return new ZeroArray(a,d)}"].join("\n"));return r()}var i="generic"===e,o=["'use strict'"],a=s(t),l=a.map(function(e){return"i"+e}),f="this.offset+"+a.map(function(e){return["this._stride",e,"*i",e].join("")}).join("+"),h=["View",t,"d",e].join("");o.push(["function ",h,"(a,",a.map(function(e){return"b"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",d){this.data=a"].join(""));for(var d=0;t>d;++d)o.push(["this._shape",d,"=b",d,"|0"].join(""));for(var d=0;t>d;++d)o.push(["this._stride",d,"=c",d,"|0"].join(""));o.push("this.offset=d|0}"),o.push(["var proto=",h,".prototype"].join("")),o.push(["proto.dtype='",e,"'"].join("")),o.push("proto.dimension="+t);var v=["VStride",t,"d",e].join(""),y=["VShape",t,"d",e].join(""),m={stride:v,shape:y};for(var g in m){var b=m[g];o.push(["function ",b,"(v) {this._v=v} var aproto=",b,".prototype"].join("")),o.push(["aproto.length=",t].join(""));for(var x=[],d=0;t>d;++d)x.push(["this._v._",g,d].join(""));o.push(["aproto.toJSON=function ",b,"_toJSON(){return [",x.join(","),"]}"].join("")),o.push(["aproto.toString=function ",b,"_toJSON(){return [",x.join(","),"].join()}"].join(""));for(var d=0;t>d;++d)o.push(["Object.defineProperty(aproto,",d,",{get:function(){return this._v._",g,d,"},set:function(v){return this._v._",g,d,"=v|0},enumerable:true})"].join(""));for(var d=0;u.length>d;++d)u[d]in Array.prototype&&o.push(["aproto.",u[d],"=Array.prototype.",u[d]].join(""));o.push(["Object.defineProperty(proto,'",g,"',{get:function ",b,"_get(){return new ",b,"(this)},set: function ",b,"_set(v){"].join(""));for(var d=0;t>d;++d)o.push(["this._",g,d,"=v[",d,"]|0"].join(""));o.push("return v}})")}o.push(["Object.defineProperty(proto,'size',{get:function ",h,"_size(){return ",a.map(function(e){return["this._shape",e].join("")}).join("*"),"}})"].join("")),1===t?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),4>t?(o.push(["function ",h,"_order(){"].join("")),2===t?o.push("return (Math.abs(this._stride0)>Math.abs(this._stride1))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this._stride0),s1=Math.abs(this._stride1),s2=Math.abs(this._stride2);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push(["proto.set=function ",h,"_set(",l.join(","),",v){"].join("")),i?o.push(["return this.data.set(",f,",v)}"].join("")):o.push(["return this.data[",f,"]=v}"].join("")),o.push(["proto.get=function ",h,"_get(",l.join(","),"){"].join("")),i?o.push(["return this.data.get(",f,")}"].join("")):o.push(["return this.data[",f,"]}"].join("")),o.push(["proto.hi=function ",h,"_hi(",l.join(","),"){return new ",h,"(this.data,",a.map(function(e){return["typeof i",e,"!=='number'?this._shape",e,":i",e,"|0"].join("")}).join(","),",",a.map(function(e){return"this._stride"+e}).join(","),",this.offset)}"].join(""));var w=a.map(function(e){return"a"+e+"=this._shape"+e}),E=a.map(function(e){return"c"+e+"=this._stride"+e});o.push(["proto.lo=function ",h,"_lo(",l.join(","),"){var b=this.offset,d=0,",w.join(","),",",E.join(",")].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;b+=c",d,"*d;a",d,"-=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",b)}"].join("")),o.push(["proto.step=function ",h,"_step(",l.join(","),"){var ",a.map(function(e){return"a"+e+"=this._shape"+e}).join(","),",",a.map(function(e){return"b"+e+"=this._stride"+e}).join(","),",c=this.offset,d=0,ceil=Math.ceil"].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;if(d<0){c+=b",d,"*(a",d,"-1);a",d,"=ceil(-a",d,"/d)}else{a",d,"=ceil(a",d,"/d)}b",d,"*=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"b"+e}).join(","),",c)}"].join(""));for(var S=Array(t),j=Array(t),d=0;t>d;++d)S[d]=["a[i",d,"|0]"].join(""),j[d]=["b[i",d,"|0]"].join("");o.push(["proto.transpose=function ",h,"_transpose(",l,"){var a=this.shape,b=this.stride;return new ",h,"(this.data,",S.join(","),",",j.join(","),",this.offset)}"].join("")),o.push(["proto.pick=function ",h,"_pick(",l,"){var a=[],b=[],c=this.offset"].join(""));for(var d=0;t>d;++d)o.push(["if(i",d,">=0){c=(c+this._stride",d,"*i",d,")|0}else{a.push(this._shape",d,");b.push(this._stride",d,")}"].join(""));o.push("var ctor=CTOR_LIST[a.length];return ctor(this.data,a,b,c)}"),o.push(["return function construct_",h,"(data,shape,stride,offset){return new ",h,"(data,",a.map(function(e){return"shape["+e+"]"}).join(","),",",a.map(function(e){return"stride["+e+"]"}).join(","),",offset)}"].join(""));var A=Function("CTOR_LIST","ORDER",o.join("\n"));return A(p[e],n)}function o(e){return e instanceof Float64Array?"float64":e instanceof Float32Array?"float32":e instanceof Int32Array?"int32":e instanceof Uint32Array?"uint32":e instanceof Uint8Array?"uint8":e instanceof Uint16Array?"uint16":e instanceof Int16Array?"int16":e instanceof Int8Array?"int8":e instanceof Array?"array":"generic"}function a(e,t,r,n){void 0===t&&(t=[e.length]);var a=t.length;if(void 0===r){r=Array(a);for(var s=a-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===n){n=0;for(var s=0;a>s;++s)0>r[s]&&(n-=(t[s]-1)*r[s])}for(var c=o(e),l=p[c];a>=l.length;)l.push(i(c,l.length));var f=l[a];return f(e,t,r,n)}var s=e("iota-array"),u=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c="function ZeroArray(a,d) {this.data = a;this.offset = d};var proto=ZeroArray.prototype;proto.size=0;proto.shape=[];proto.stride=[];proto.order=[];proto.get=proto.set=function() {return Number.NaN};proto.lo=proto.hi=proto.transpose=proto.step=proto.pick=function() {return new ZeroArray(this.data,this.shape,this.stride,this.offset)}",p={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],generic:[]};t.exports=a},{"iota-array":17}],14:[function(e,t,r){"use strict";"use restrict";function n(e){var t=32;return e&=-e,e&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<<i-1,r.sign=function(e){return(e>0)-(0>e)},r.abs=function(e){var t=e>>i-1;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(t>e)},r.max=function(e,t){return e^(e^t)&-(t>e)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return e-=1431655765&e>>>1,e=(858993459&e)+(858993459&e>>>2),16843009*(252645135&e+(e>>>4))>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,1&27030>>>e};var o=Array(256);(function(e){for(var t=0;256>t;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=255&n<<i}})(o),r.reverse=function(e){return o[255&e]<<24|o[255&e>>>8]<<16|o[255&e>>>16]<<8|o[255&e>>>24]},r.interleave2=function(e,t){return e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1},r.deinterleave2=function(e,t){return e=1431655765&e>>>t,e=858993459&(e|e>>>1),e=252645135&(e|e>>>2),e=16711935&(e|e>>>4),e=65535&(e|e>>>16),e<<16>>16},r.interleave3=function(e,t,r){return e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e|=t<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),e|r<<2},r.deinterleave3=function(e,t){return e=1227133513&e>>>t,e=3272356035&(e|e>>>2),e=251719695&(e|e>>>4),e=4278190335&(e|e>>>8),e=1023&(e|e>>>16),e<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],16:[function(e,t,r){"use strict";"use restrict";function n(e){var t=32;return e&=-e,e&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<<i-1,r.sign=function(e){return(e>0)-(0>e)},r.abs=function(e){var t=e>>i-1;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(t>e)},r.max=function(e,t){return e^(e^t)&-(t>e)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return e-=1431655765&e>>>1,e=(858993459&e)+(858993459&e>>>2),16843009*(252645135&e+(e>>>4))>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,1&27030>>>e};var o=Array(256);(function(e){for(var t=0;256>t;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=255&n<<i}})(o),r.reverse=function(e){return o[255&e]<<24|o[255&e>>>8]<<16|o[255&e>>>16]<<8|o[255&e>>>24]},r.interleave2=function(e,t){return e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1},r.deinterleave2=function(e,t){return e=1431655765&e>>>t,e=858993459&(e|e>>>1),e=252645135&(e|e>>>2),e=16711935&(e|e>>>4),e=65535&(e|e>>>16),e<<16>>16},r.interleave3=function(e,t,r){return e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e|=t<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),e|r<<2},r.deinterleave3=function(e,t){return e=1227133513&e>>>t,e=3272356035&(e|e>>>2),e=251719695&(e|e>>>4),e=4278190335&(e|e>>>8),e=1023&(e|e>>>16),e<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],17:[function(e,t){"use strict";function r(e){for(var t=Array(e),r=0;e>r;++r)t[r]=r;return t}t.exports=r},{}],15:[function(e,t){"use strict";function r(e,t){return e[0]-t[0]}function n(){var e,t=this.stride,n=Array(t.length);for(e=0;n.length>e;++e)n[e]=[Math.abs(t[e]),e];n.sort(r);var i=Array(n.length);for(e=0;i.length>e;++e)i[e]=n[e][1];return i}function i(e,t){if(0===t){var r=Function([c,"ZeroArray.prototype.dtype='"+e+"'","return function construct_ZeroArray(a,b,c,d){return new ZeroArray(a,d)}"].join("\n"));return r()}var i="generic"===e,o=["'use strict'"],a=s(t),l=a.map(function(e){return"i"+e}),f="this.offset+"+a.map(function(e){return["this._stride",e,"*i",e].join("")}).join("+"),h=["View",t,"d",e].join("");o.push(["function ",h,"(a,",a.map(function(e){return"b"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",d){this.data=a"].join(""));for(var d=0;t>d;++d)o.push(["this._shape",d,"=b",d,"|0"].join(""));for(var d=0;t>d;++d)o.push(["this._stride",d,"=c",d,"|0"].join(""));o.push("this.offset=d|0}"),o.push(["var proto=",h,".prototype"].join("")),o.push(["proto.dtype='",e,"'"].join("")),o.push("proto.dimension="+t);var v=["VStride",t,"d",e].join(""),y=["VShape",t,"d",e].join(""),m={stride:v,shape:y};for(var g in m){var b=m[g];o.push(["function ",b,"(v) {this._v=v} var aproto=",b,".prototype"].join("")),o.push(["aproto.length=",t].join(""));for(var x=[],d=0;t>d;++d)x.push(["this._v._",g,d].join(""));o.push(["aproto.toJSON=function ",b,"_toJSON(){return [",x.join(","),"]}"].join("")),o.push(["aproto.toString=function ",b,"_toJSON(){return [",x.join(","),"].join()}"].join(""));for(var d=0;t>d;++d)o.push(["Object.defineProperty(aproto,",d,",{get:function(){return this._v._",g,d,"},set:function(v){return this._v._",g,d,"=v|0},enumerable:true})"].join(""));for(var d=0;u.length>d;++d)u[d]in Array.prototype&&o.push(["aproto.",u[d],"=Array.prototype.",u[d]].join(""));o.push(["Object.defineProperty(proto,'",g,"',{get:function ",b,"_get(){return new ",b,"(this)},set: function ",b,"_set(v){"].join(""));for(var d=0;t>d;++d)o.push(["this._",g,d,"=v[",d,"]|0"].join(""));o.push("return v}})")}o.push(["Object.defineProperty(proto,'size',{get:function ",h,"_size(){return ",a.map(function(e){return["this._shape",e].join("")}).join("*"),"}})"].join("")),1===t?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),4>t?(o.push(["function ",h,"_order(){"].join("")),2===t?o.push("return (Math.abs(this._stride0)>Math.abs(this._stride1))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this._stride0),s1=Math.abs(this._stride1),s2=Math.abs(this._stride2);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push(["proto.set=function ",h,"_set(",l.join(","),",v){"].join("")),i?o.push(["return this.data.set(",f,",v)}"].join("")):o.push(["return this.data[",f,"]=v}"].join("")),o.push(["proto.get=function ",h,"_get(",l.join(","),"){"].join("")),i?o.push(["return this.data.get(",f,")}"].join("")):o.push(["return this.data[",f,"]}"].join("")),o.push(["proto.hi=function ",h,"_hi(",l.join(","),"){return new ",h,"(this.data,",a.map(function(e){return["typeof i",e,"!=='number'?this._shape",e,":i",e,"|0"].join("")}).join(","),",",a.map(function(e){return"this._stride"+e}).join(","),",this.offset)}"].join(""));var w=a.map(function(e){return"a"+e+"=this._shape"+e}),E=a.map(function(e){return"c"+e+"=this._stride"+e});o.push(["proto.lo=function ",h,"_lo(",l.join(","),"){var b=this.offset,d=0,",w.join(","),",",E.join(",")].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;b+=c",d,"*d;a",d,"-=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"c"+e}).join(","),",b)}"].join("")),o.push(["proto.step=function ",h,"_step(",l.join(","),"){var ",a.map(function(e){return"a"+e+"=this._shape"+e}).join(","),",",a.map(function(e){return"b"+e+"=this._stride"+e}).join(","),",c=this.offset,d=0,ceil=Math.ceil"].join(""));for(var d=0;t>d;++d)o.push(["if(typeof i",d,"==='number'){d=i",d,"|0;if(d<0){c+=b",d,"*(a",d,"-1);a",d,"=ceil(-a",d,"/d)}else{a",d,"=ceil(a",d,"/d)}b",d,"*=d}"].join(""));o.push(["return new ",h,"(this.data,",a.map(function(e){return"a"+e}).join(","),",",a.map(function(e){return"b"+e}).join(","),",c)}"].join(""));for(var S=Array(t),j=Array(t),d=0;t>d;++d)S[d]=["a[i",d,"|0]"].join(""),j[d]=["b[i",d,"|0]"].join("");o.push(["proto.transpose=function ",h,"_transpose(",l,"){var a=this.shape,b=this.stride;return new ",h,"(this.data,",S.join(","),",",j.join(","),",this.offset)}"].join("")),o.push(["proto.pick=function ",h,"_pick(",l,"){var a=[],b=[],c=this.offset"].join("")); | |
for(var d=0;t>d;++d)o.push(["if(i",d,">=0){c=(c+this._stride",d,"*i",d,")|0}else{a.push(this._shape",d,");b.push(this._stride",d,")}"].join(""));o.push("var ctor=CTOR_LIST[a.length];return ctor(this.data,a,b,c)}"),o.push(["return function construct_",h,"(data,shape,stride,offset){return new ",h,"(data,",a.map(function(e){return"shape["+e+"]"}).join(","),",",a.map(function(e){return"stride["+e+"]"}).join(","),",offset)}"].join(""));var A=Function("CTOR_LIST","ORDER",o.join("\n"));return A(p[e],n)}function o(e){return e instanceof Float64Array?"float64":e instanceof Float32Array?"float32":e instanceof Int32Array?"int32":e instanceof Uint32Array?"uint32":e instanceof Uint8Array?"uint8":e instanceof Uint16Array?"uint16":e instanceof Int16Array?"int16":e instanceof Int8Array?"int8":e instanceof Array?"array":"generic"}function a(e,t,r,n){void 0===t&&(t=[e.length]);var a=t.length;if(void 0===r){r=Array(a);for(var s=a-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===n){n=0;for(var s=0;a>s;++s)0>r[s]&&(n-=(t[s]-1)*r[s])}for(var c=o(e),l=p[c];a>=l.length;)l.push(i(c,l.length));var f=l[a];return f(e,t,r,n)}var s=e("iota-array"),u=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c="function ZeroArray(a,d) {this.data = a;this.offset = d};var proto=ZeroArray.prototype;proto.size=0;proto.shape=[];proto.stride=[];proto.order=[];proto.get=proto.set=function() {return Number.NaN};proto.lo=proto.hi=proto.transpose=proto.step=proto.pick=function() {return new ZeroArray(this.data,this.shape,this.stride,this.offset)}",p={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],generic:[]};t.exports=a},{"iota-array":18}],18:[function(e,t){"use strict";function r(e){for(var t=Array(e),r=0;e>r;++r)t[r]=r;return t}t.exports=r},{}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({raf:[function(e,t){t.exports=e("3xkq9l")},{}],"3xkq9l":[function(e,t){(function(){function r(e){function t(){var n=r.now(),s=n-i;i=n,o.emit("data",s),o.paused||a(t,e)}var i=r.now(),o=new n;return o.pause=function(){o.paused=!0},o.resume=function(){o.paused=!1},a(t,e),o}t.exports=r;var n=e("events").EventEmitter,i="undefined"==typeof window?this:window,o=i.performance&&i.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date},a=i.requestAnimationFrame||i.webkitRequestAnimationFrame||i.mozRequestAnimationFrame||i.msRequestAnimationFrame||i.oRequestAnimationFrame||(i.setImmediate?function(e){setImmediate(e)}:function(e){setTimeout(e,0)});r.polyfill=a,r.now=o})()},{events:1}],2:[function(e,t){var r=t.exports={};r.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){if(e.source===window&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var t=r.shift();t()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],1:[function(e,t,r){(function(e){function t(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;e.length>r;r++)if(t===e[r])return r;return-1}e.EventEmitter||(e.EventEmitter=function(){});var n=r.EventEmitter=e.EventEmitter,i="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=10;n.prototype.setMaxListeners=function(e){this._events||(this._events={}),this._events.maxListeners=e},n.prototype.emit=function(e){if("error"===e&&(!this._events||!this._events.error||i(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var t=this._events[e];if(!t)return!1;if("function"==typeof t){switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:var r=Array.prototype.slice.call(arguments,1);t.apply(this,r)}return!0}if(i(t)){for(var r=Array.prototype.slice.call(arguments,1),n=t.slice(),o=0,a=n.length;a>o;o++)n[o].apply(this,r);return!0}return!1},n.prototype.addListener=function(e,t){if("function"!=typeof t)throw Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",e,t),this._events[e])if(i(this._events[e])){if(!this._events[e].warned){var r;r=void 0!==this._events.maxListeners?this._events.maxListeners:o,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}this._events[e].push(t)}else this._events[e]=[this._events[e],t];else this._events[e]=t;return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){var r=this;return r.on(e,function n(){r.removeListener(e,n),t.apply(this,arguments)}),this},n.prototype.removeListener=function(e,r){if("function"!=typeof r)throw Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;var n=this._events[e];if(i(n)){var o=t(n,r);if(0>o)return this;n.splice(o,1),0==n.length&&delete this._events[e]}else this._events[e]===r&&delete this._events[e];return this},n.prototype.removeAllListeners=function(e){return 0===arguments.length?(this._events={},this):(e&&this._events&&this._events[e]&&(this._events[e]=null),this)},n.prototype.listeners=function(e){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),i(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]}})(e("__browserify_process"))},{__browserify_process:2}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({"kb-controls-iframed":[function(e,t){t.exports=e("l20TNK")},{}],l20TNK:[function(e,t){var r=e("ever"),n=e("vkey"),i=Math.max;t.exports=function(e,t,o){function a(){for(var e in t)o[t[e]]=0,y[e]=1}function s(e){return function(){return a(),m=e,this}}function u(e){return function(t){m&&(t.preventDefault(),e(t))}}function c(e,r){return function(n){var a=e(n),s=t[a];s&&(o[s]+=r?i(y[a]--,0):-(y[a]=1),!r&&0>o[s]&&(o[s]=0))}}function p(e){return"<mouse "+e.which+">"}function l(e){return n[e.keyCode]||e.char}var f=null;if(void 0===t||!e.ownerDocument){o=t,t=e,e=this.document.body;try{f=window.top.document.body}catch(h){}}var d=r(e),v=f?r(f):d,y={},m=!0;o=o||{};for(var g in t){if("enabled"===t[g]||"enable"===t[g]||"disable"===t[g]||"destroy"===t[g])throw Error(t[g]+" is reserved");o[t[g]]=0,y[g]=1}return v.on("keyup",u(c(l,!1))),v.on("keydown",u(c(l,!0))),d.on("mouseup",u(c(p,!1))),d.on("mousedown",u(c(p,!0))),o.enabled=function(){return m},o.enable=s(!0),o.disable=s(!1),o.destroy=function(){v.removeAllListeners(),d.removeAllListeners()},o}},{ever:1,vkey:2}],2:[function(e,t){(function(){var e,r="undefined"!=typeof window?window.navigator.userAgent:"",n=/OS X/.test(r),i=/Opera/.test(r),o=!/like Gecko/.test(r)&&!i,a=t.exports={0:n?"<menu>":"<UNK>",1:"<mouse 1>",2:"<mouse 2>",3:"<break>",4:"<mouse 3>",5:"<mouse 4>",6:"<mouse 5>",8:"<backspace>",9:"<tab>",12:"<clear>",13:"<enter>",16:"<shift>",17:"<control>",18:"<alt>",19:"<pause>",20:"<caps-lock>",21:"<ime-hangul>",23:"<ime-junja>",24:"<ime-final>",25:"<ime-kanji>",27:"<escape>",28:"<ime-convert>",29:"<ime-nonconvert>",30:"<ime-accept>",31:"<ime-mode-change>",27:"<escape>",32:"<space>",33:"<page-up>",34:"<page-down>",35:"<end>",36:"<home>",37:"<left>",38:"<up>",39:"<right>",40:"<down>",41:"<select>",42:"<print>",43:"<execute>",44:"<snapshot>",45:"<insert>",46:"<delete>",47:"<help>",91:"<meta>",92:"<meta>",93:n?"<meta>":"<menu>",95:"<sleep>",106:"<num-*>",107:"<num-+>",108:"<num-enter>",109:"<num-->",110:"<num-.>",111:"<num-/>",144:"<num-lock>",145:"<scroll-lock>",160:"<shift-left>",161:"<shift-right>",162:"<control-left>",163:"<control-right>",164:"<alt-left>",165:"<alt-right>",166:"<browser-back>",167:"<browser-forward>",168:"<browser-refresh>",169:"<browser-stop>",170:"<browser-search>",171:"<browser-favorites>",172:"<browser-home>",173:n&&o?"-":"<volume-mute>",174:"<volume-down>",175:"<volume-up>",176:"<next-track>",177:"<prev-track>",178:"<stop>",179:"<play-pause>",180:"<launch-mail>",181:"<launch-media-select>",182:"<launch-app 1>",183:"<launch-app 2>",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",223:"<meta>",224:"<meta>",226:"<alt-gr>",229:"<ime-process>",231:i?"`":"<unicode>",246:"<attention>",247:"<crsel>",248:"<exsel>",249:"<erase-eof>",250:"<play>",251:"<zoom>",252:"<no-name>",253:"<pa-1>",254:"<clear>"};for(e=58;65>e;++e)a[e]=String.fromCharCode(e);for(e=48;58>e;++e)a[e]=e-48+"";for(e=65;91>e;++e)a[e]=String.fromCharCode(e);for(e=96;107>e;++e)a[e]="<num-"+(e-96)+">";for(e=112;136>e;++e)a[e]="F"+(e-111)})()},{}],1:[function(e,t){function r(e){this.element=e}function n(e){var t=Object.prototype.toString.call(e);return/\[object \S+Event\]/.test(t)}var i=e("events").EventEmitter;t.exports=function(e){return new r(e)},r.prototype=new i,r.prototype.on=function(e,t,r){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),this._events[e].push(t),this.element.addEventListener(e,t,r||!1),this},r.prototype.addListener=r.prototype.on,r.prototype.removeListener=function(e,t,r){this._events||(this._events={}),this.element.removeEventListener(e,t,r||!1);var n=this.listeners(e),i=n.indexOf(t);return i>=0&&n.splice(i,1),this},r.prototype.removeAllListeners=function(e){function t(e){for(var t=r.listeners(e),n=0;t.length>n;n++)r.removeListener(e,t[n])}var r=this;if(e)t(e);else if(r._events)for(var n in r._events)n&&t(n);return i.prototype.removeAllListeners.apply(r,arguments)};var o=e("./init.json");r.prototype.emit=function(e,t){if("object"==typeof e&&(t=e,e=t.type),!n(t)){var i=r.typeOf(e),a=t||{};void 0===a.type&&(a.type=e),t=document.createEvent(i+"s");for(var s="function"==typeof t["init"+i]?"init"+i:"initEvent",u=o[s],c={},p=[],l=0;u.length>l;l++){var f=u[l];p.push(a[f]),c[f]=!0}t[s].apply(t,p);for(var f in a)c[f]||(t[f]=a[f])}return this.element.dispatchEvent(t)},r.types=e("./types.json"),r.typeOf=function(){var e={};for(var t in r.types)for(var n=r.types[t],i=0;n.length>i;i++)e[n[i]]=t;return function(t){return e[t]||"Event"}}()},{events:3,"./types.json":4,"./init.json":5}],6:[function(e,t){var r=t.exports={};r.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){if(e.source===window&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var t=r.shift();t()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],3:[function(e,t,r){(function(e){function t(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;e.length>r;r++)if(t===e[r])return r;return-1}e.EventEmitter||(e.EventEmitter=function(){});var n=r.EventEmitter=e.EventEmitter,i="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=10;n.prototype.setMaxListeners=function(e){this._events||(this._events={}),this._events.maxListeners=e},n.prototype.emit=function(e){if("error"===e&&(!this._events||!this._events.error||i(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var t=this._events[e];if(!t)return!1;if("function"==typeof t){switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:var r=Array.prototype.slice.call(arguments,1);t.apply(this,r)}return!0}if(i(t)){for(var r=Array.prototype.slice.call(arguments,1),n=t.slice(),o=0,a=n.length;a>o;o++)n[o].apply(this,r);return!0}return!1},n.prototype.addListener=function(e,t){if("function"!=typeof t)throw Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",e,t),this._events[e])if(i(this._events[e])){if(!this._events[e].warned){var r;r=void 0!==this._events.maxListeners?this._events.maxListeners:o,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}this._events[e].push(t)}else this._events[e]=[this._events[e],t];else this._events[e]=t;return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){var r=this;return r.on(e,function n(){r.removeListener(e,n),t.apply(this,arguments)}),this},n.prototype.removeListener=function(e,r){if("function"!=typeof r)throw Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;var n=this._events[e];if(i(n)){var o=t(n,r);if(0>o)return this;n.splice(o,1),0==n.length&&delete this._events[e]}else this._events[e]===r&&delete this._events[e];return this},n.prototype.removeAllListeners=function(e){return 0===arguments.length?(this._events={},this):(e&&this._events&&this._events[e]&&(this._events[e]=null),this)},n.prototype.listeners=function(e){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),i(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]}})(e("__browserify_process"))},{__browserify_process:6}],4:[function(e,t){t.exports={MouseEvent:["click","mousedown","mouseup","mouseover","mousemove","mouseout"],KeyBoardEvent:["keydown","keyup","keypress"],MutationEvent:["DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified"],HTMLEvent:["load","unload","abort","error","select","change","submit","reset","focus","blur","resize","scroll"],UIEvent:["DOMFocusIn","DOMFocusOut","DOMActivate"]}},{}],5:[function(e,t){t.exports={initEvent:["type","canBubble","cancelable"],initUIEvent:["type","canBubble","cancelable","view","detail"],initMouseEvent:["type","canBubble","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget"],initMutationEvent:["type","canBubble","cancelable","relatedNode","prevValue","newValue","attrName","attrChange"]}},{}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({"continuous-observer":[function(e,t){t.exports=e("9zD7g5")},{}],"9zD7g5":[function(e,t){function r(e,t,r){function c(e,t){return d[0]=e,p(d,t)}function p(n,o){return Array.isArray(n[0])?(o=o||function(){},i(n,function(t,r){t=t.slice();for(var n=f;n--;)t[n]=a(t[n]/l[n]);i(h,function(r,n){for(var i=t.slice(),o=f;o--;)i[o]+=r[o];e.chunk(i,n)},r)},function(i){if(i)return next(i);for(var a,s,c=1/0,p=[],h=0,d=n.length,v=e.index.pages,y=0;v.length>y;y+=1)for(var m=0;v[y].length>m;m+=1){for(a=v[y][m].position,c=1/0,s=0;d>s;s+=1){h=0;for(var g=0;f>g;g+=1)h+=u(a[g]-n[s][g]/l[g]);c=c>h?h:c}c>t+r&&p.push(a)}for(s=p.length;s--;)e.remove(p[s]);return o(null)}),void 0):c(n,o)}t=0|+t||1,r=s((0|+r)-t,t);var l=e.shape,f=l.length,h=o(n(f,-t),n(f,t)),d=[];return p}var n=e("dup"),i=e("map-async"),o=e("cell-range"),a=Math.round;Math.min;var s=Math.max,u=Math.abs;t.exports=r},{dup:1,"cell-range":2,"map-async":3}],1:[function(e,t){"use strict";function r(e,t,n){var i=0|e[n];if(0>=i)return[];var o,a=Array(i);if(n===e.length-1)for(o=0;i>o;++o)a[o]=t;else for(o=0;i>o;++o)a[o]=r(e,t,n+1);return a}function n(e,t){var r,n;for(r=Array(e),n=0;e>n;++n)r[n]=t;return r}function i(e,t){switch(t===void 0&&(t=0),typeof e){case"number":if(e>0)return n(0|e,t);break;case"object":if("number"==typeof e.length)return r(e,t,0)}return[]}t.exports=i},{}],2:[function(e,t){function r(e,t){function r(i,o,a){if(a===n-1)for(var s=e[a];t[a]>=s;s+=1)s===t[a]?(o.push(s),i.push(o)):i.push(o.concat(s));else for(var s=e[a];t[a]>=s;s+=1)s==t[a]?(o.push(s),r(i,o,a+1)):r(i,o.concat(s),a+1);return i}if(e.length!==t.length)throw Error("Both arguments must be arrays of equal length");var n=e.length;return t[t.length-1],r([],[],0)}t.exports=r},{}],3:[function(e,t){function r(e,t,r,i){function o(e){function t(t,r){return t?i&&i(t):(s[e]=r,0===--u&&i&&i(null,s),void 0)}return t}var a=Object.keys(e),s=Array.isArray(e)?[]:{},u=a.length;if("function"==typeof r&&(i=r,r=this),0===a.length)return i(null,s);for(var c=0,p=a.length;p>c;c++){var l=a[c],f=e[l];n(t,o(l),r,f,l,e)}}function n(e,t,r,n,i,o){var a=e.length;1===a?e.call(r,t):2===a?e.call(r,n,t):3===a?e.call(r,n,i,t):e.call(r,n,i,o,t)}t.exports=r},{}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({"aabb-2d":[function(e,t){t.exports=e("2mIUc1")},{}],"2mIUc1":[function(e,t){function r(e,t){return this instanceof r?(this.base=e,this.vec=t,this.mag=n.length(this.vec),this.max=n.create(),n.add(this.max,this.base,this.vec),void 0):new r(e,t)}t.exports=r;var n=e("gl-matrix").vec2,i=r,o=i.prototype;o.perimeter=function(){return 2*(this.vec[0]+this.vec[1])},o.area=function(){return this.vec[0]*this.vec[0]+this.vec[1]*this.vec[1]},o.intperimeter=function(){return this.vec[0]+this.vec[1]<<1},o.width=function(){return this.vec[0]},o.height=function(){return this.vec[1]},o.x0=function(){return this.base[0]},o.y0=function(){return this.base[1]},o.x1=function(){return this.max[0]},o.y1=function(){return this.max[1]},o.translate=function(e){return n.add(this.max,this.max,e),n.add(this.base,this.base,e),this},o.expand=function(e){var t=n.create(),i=n.create();return n.max(t,e.max,this.max),n.min(i,e.base,this.base),n.sub(t,t,i),new r(i,t)},o.intersects=function(e){return e.base[0]>this.max[0]?!1:e.base[1]>this.max[1]?!1:e.max[0]<this.base[0]?!1:e.max[1]<this.base[1]?!1:!0},o.union=function(e){if(!this.intersects(e))return null;var t=Math.max(e.base[0],this.base[0]),n=Math.max(e.base[1],this.base[1]),i=Math.min(e.max[0],this.max[0]),o=Math.min(e.max[1],this.max[1]);return new r([t,n],[i-t,o-n])}},{"gl-matrix":1}],1:[function(e,t,r){(function(){(function(){"use strict";var e={};r===void 0?"function"==typeof define&&"object"==typeof define.amd&&define.amd?(e.exports={},define(function(){return e.exports})):e.exports=window:e.exports=r,function(e){var t={};if(!r)var r=1e-6;t.create=function(){return new Float32Array(2)},t.clone=function(e){var t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},t.fromValues=function(e,t){var r=new Float32Array(2);return r[0]=e,r[1]=t,r},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},t.set=function(e,t,r){return e[0]=t,e[1]=r,e},t.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},t.sub=t.subtract=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e},t.mul=t.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e},t.div=t.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e},t.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e},t.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e},t.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},t.dist=t.distance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)},t.sqrDist=t.squaredDistance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n},t.len=t.length=function(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)},t.sqrLen=t.squaredLength=function(e){var t=e[0],r=e[1];return t*t+r*r},t.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},t.normalize=function(e,t){var r=t[0],n=t[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},t.cross=function(e,t,r){var n=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=n,e},t.lerp=function(e,t,r,n){var i=t[0],o=t[1];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e},t.transformMat2=function(e,t,r){var n=t[0],i=t[1];return e[0]=n*r[0]+i*r[1],e[1]=n*r[2]+i*r[3],e},t.forEach=function(){var e=new Float32Array(2);return function(t,r,n,i,o,a){var s,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,t.length):t.length,s=n;u>s;s+=r)e[0]=t[s],e[1]=t[s+1],o(e,e,a),t[s]=e[0],t[s+1]=e[1];return t}}(),t.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},e!==void 0&&(e.vec2=t);var n={};if(!r)var r=1e-6;n.create=function(){return new Float32Array(3)},n.clone=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},n.fromValues=function(e,t,r){var n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n},n.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},n.set=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e},n.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},n.sub=n.subtract=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},n.mul=n.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e},n.div=n.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e},n.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e},n.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e},n.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},n.dist=n.distance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)},n.sqrDist=n.squaredDistance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i},n.len=n.length=function(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)},n.sqrLen=n.squaredLength=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n},n.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},n.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o),e},n.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},n.cross=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],s=r[1],u=r[2];return e[0]=i*u-o*s,e[1]=o*a-n*u,e[2]=n*s-i*a,e},n.lerp=function(e,t,r,n){var i=t[0],o=t[1],a=t[2];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=a+n*(r[2]-a),e},n.transformMat4=function(e,t,r){var n=t[0],i=t[1],o=t[2];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12],e[1]=r[1]*n+r[5]*i+r[9]*o+r[13],e[2]=r[2]*n+r[6]*i+r[10]*o+r[14],e},n.transformQuat=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],s=r[1],u=r[2],c=r[3],p=c*n+s*o-u*i,l=c*i+u*n-a*o,f=c*o+a*i-s*n,h=-a*n-s*i-u*o;return e[0]=p*c+h*-a+l*-u-f*-s,e[1]=l*c+h*-s+f*-a-p*-u,e[2]=f*c+h*-u+p*-s-l*-a,e},n.forEach=function(){var e=new Float32Array(3);return function(t,r,n,i,o,a){var s,u;for(r||(r=3),n||(n=0),u=i?Math.min(i*r+n,t.length):t.length,s=n;u>s;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}(),n.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},e!==void 0&&(e.vec3=n);var i={};if(!r)var r=1e-6;i.create=function(){return new Float32Array(4)},i.clone=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.fromValues=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i},i.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.set=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e},i.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},i.sub=i.subtract=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e},i.mul=i.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},i.div=i.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e},i.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},i.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},i.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},i.dist=i.distance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+o*o)},i.sqrDist=i.squaredDistance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return r*r+n*n+i*i+o*o},i.len=i.length=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)},i.sqrLen=i.squaredLength=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i},i.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},i.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a),e},i.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},i.lerp=function(e,t,r,n){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=a+n*(r[2]-a),e[3]=s+n*(r[3]-s),e},i.transformMat4=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e},i.transformQuat=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],s=r[1],u=r[2],c=r[3],p=c*n+s*o-u*i,l=c*i+u*n-a*o,f=c*o+a*i-s*n,h=-a*n-s*i-u*o;return e[0]=p*c+h*-a+l*-u-f*-s,e[1]=l*c+h*-s+f*-a-p*-u,e[2]=f*c+h*-u+p*-s-l*-a,e},i.forEach=function(){var e=new Float32Array(4);return function(t,r,n,i,o,a){var s,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,t.length):t.length,s=n;u>s;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}(),i.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},e!==void 0&&(e.vec4=i);var o={},a=new Float32Array([1,0,0,1]);if(!r)var r=1e-6;o.create=function(){return new Float32Array(a)},o.clone=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},o.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},o.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},o.transpose=function(e,t){if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},o.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*o-i*n;return a?(a=1/a,e[0]=o*a,e[1]=-n*a,e[2]=-i*a,e[3]=r*a,e):null},o.adjoint=function(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e},o.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},o.mul=o.multiply=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=r[0],u=r[1],c=r[2],p=r[3];return e[0]=n*s+i*c,e[1]=n*u+i*p,e[2]=o*s+a*c,e[3]=o*u+a*p,e},o.rotate=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=n*-s+i*u,e[2]=o*u+a*s,e[3]=o*-s+a*u,e},o.scale=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=r[0],u=r[1];return e[0]=n*s,e[1]=i*u,e[2]=o*s,e[3]=a*u,e},o.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},e!==void 0&&(e.mat2=o);var s={},u=new Float32Array([1,0,0,0,1,0,0,0,1]);if(!r)var r=1e-6;s.create=function(){return new Float32Array(u)},s.clone=function(e){var t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},s.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},s.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},s.transpose=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},s.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],p=t[8],l=p*a-s*c,f=-p*o+s*u,h=c*o-a*u,d=r*l+n*f+i*h;return d?(d=1/d,e[0]=l*d,e[1]=(-p*n+i*c)*d,e[2]=(s*n-i*a)*d,e[3]=f*d,e[4]=(p*r-i*u)*d,e[5]=(-s*r+i*o)*d,e[6]=h*d,e[7]=(-c*r+n*u)*d,e[8]=(a*r-n*o)*d,e):null},s.adjoint=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],p=t[8];return e[0]=a*p-s*c,e[1]=i*c-n*p,e[2]=n*s-i*a,e[3]=s*u-o*p,e[4]=r*p-i*u,e[5]=i*o-r*s,e[6]=o*c-a*u,e[7]=n*u-r*c,e[8]=r*a-n*o,e},s.determinant=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8];return t*(c*o-a*u)+r*(-c*i+a*s)+n*(u*i-o*s)},s.mul=s.multiply=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],p=t[7],l=t[8],f=r[0],h=r[1],d=r[2],v=r[3],y=r[4],m=r[5],g=r[6],b=r[7],x=r[8];return e[0]=f*n+h*a+d*c,e[1]=f*i+h*s+d*p,e[2]=f*o+h*u+d*l,e[3]=v*n+y*a+m*c,e[4]=v*i+y*s+m*p,e[5]=v*o+y*u+m*l,e[6]=g*n+b*a+x*c,e[7]=g*i+b*s+x*p,e[8]=g*o+b*u+x*l,e},s.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},e!==void 0&&(e.mat3=s);var c={},p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);if(!r)var r=1e-6;c.create=function(){return new Float32Array(p)},c.clone=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},c.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},c.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},c.transpose=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},c.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],p=t[8],l=t[9],f=t[10],h=t[11],d=t[12],v=t[13],y=t[14],m=t[15],g=r*s-n*a,b=r*u-i*a,x=r*c-o*a,w=n*u-i*s,E=n*c-o*s,S=i*c-o*u,j=p*v-l*d,A=p*y-f*d,L=p*m-h*d,k=l*y-f*v,_=l*m-h*v,I=f*m-h*y,O=g*I-b*_+x*k+w*L-E*A+S*j;return O?(O=1/O,e[0]=(s*I-u*_+c*k)*O,e[1]=(i*_-n*I-o*k)*O,e[2]=(v*S-y*E+m*w)*O,e[3]=(f*E-l*S-h*w)*O,e[4]=(u*L-a*I-c*A)*O,e[5]=(r*I-i*L+o*A)*O,e[6]=(y*x-d*S-m*b)*O,e[7]=(p*S-f*x+h*b)*O,e[8]=(a*_-s*L+c*j)*O,e[9]=(n*L-r*_-o*j)*O,e[10]=(d*E-v*x+m*g)*O,e[11]=(l*x-p*E-h*g)*O,e[12]=(s*A-a*k-u*j)*O,e[13]=(r*k-n*A+i*j)*O,e[14]=(v*b-d*w-y*g)*O,e[15]=(p*w-l*b+f*g)*O,e):null | |
},c.adjoint=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],p=t[8],l=t[9],f=t[10],h=t[11],d=t[12],v=t[13],y=t[14],m=t[15];return e[0]=s*(f*m-h*y)-l*(u*m-c*y)+v*(u*h-c*f),e[1]=-(n*(f*m-h*y)-l*(i*m-o*y)+v*(i*h-o*f)),e[2]=n*(u*m-c*y)-s*(i*m-o*y)+v*(i*c-o*u),e[3]=-(n*(u*h-c*f)-s*(i*h-o*f)+l*(i*c-o*u)),e[4]=-(a*(f*m-h*y)-p*(u*m-c*y)+d*(u*h-c*f)),e[5]=r*(f*m-h*y)-p*(i*m-o*y)+d*(i*h-o*f),e[6]=-(r*(u*m-c*y)-a*(i*m-o*y)+d*(i*c-o*u)),e[7]=r*(u*h-c*f)-a*(i*h-o*f)+p*(i*c-o*u),e[8]=a*(l*m-h*v)-p*(s*m-c*v)+d*(s*h-c*l),e[9]=-(r*(l*m-h*v)-p*(n*m-o*v)+d*(n*h-o*l)),e[10]=r*(s*m-c*v)-a*(n*m-o*v)+d*(n*c-o*s),e[11]=-(r*(s*h-c*l)-a*(n*h-o*l)+p*(n*c-o*s)),e[12]=-(a*(l*y-f*v)-p*(s*y-u*v)+d*(s*f-u*l)),e[13]=r*(l*y-f*v)-p*(n*y-i*v)+d*(n*f-i*l),e[14]=-(r*(s*y-u*v)-a*(n*y-i*v)+d*(n*u-i*s)),e[15]=r*(s*f-u*l)-a*(n*f-i*l)+p*(n*u-i*s),e},c.determinant=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],p=e[9],l=e[10],f=e[11],h=e[12],d=e[13],v=e[14],y=e[15],m=t*a-r*o,g=t*s-n*o,b=t*u-i*o,x=r*s-n*a,w=r*u-i*a,E=n*u-i*s,S=c*d-p*h,j=c*v-l*h,A=c*y-f*h,L=p*v-l*d,k=p*y-f*d,_=l*y-f*v;return m*_-g*k+b*L+x*A-w*j+E*S},c.mul=c.multiply=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],p=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],y=t[13],m=t[14],g=t[15],b=r[0],x=r[1],w=r[2],E=r[3];return e[0]=b*n+x*s+w*l+E*v,e[1]=b*i+x*u+w*f+E*y,e[2]=b*o+x*c+w*h+E*m,e[3]=b*a+x*p+w*d+E*g,b=r[4],x=r[5],w=r[6],E=r[7],e[4]=b*n+x*s+w*l+E*v,e[5]=b*i+x*u+w*f+E*y,e[6]=b*o+x*c+w*h+E*m,e[7]=b*a+x*p+w*d+E*g,b=r[8],x=r[9],w=r[10],E=r[11],e[8]=b*n+x*s+w*l+E*v,e[9]=b*i+x*u+w*f+E*y,e[10]=b*o+x*c+w*h+E*m,e[11]=b*a+x*p+w*d+E*g,b=r[12],x=r[13],w=r[14],E=r[15],e[12]=b*n+x*s+w*l+E*v,e[13]=b*i+x*u+w*f+E*y,e[14]=b*o+x*c+w*h+E*m,e[15]=b*a+x*p+w*d+E*g,e},c.translate=function(e,t,r){var n,i,o,a,s,u,c,p,l,f,h,d,v=r[0],y=r[1],m=r[2];return t===e?(e[12]=t[0]*v+t[4]*y+t[8]*m+t[12],e[13]=t[1]*v+t[5]*y+t[9]*m+t[13],e[14]=t[2]*v+t[6]*y+t[10]*m+t[14],e[15]=t[3]*v+t[7]*y+t[11]*m+t[15]):(n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],p=t[7],l=t[8],f=t[9],h=t[10],d=t[11],e[0]=n,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=u,e[6]=c,e[7]=p,e[8]=l,e[9]=f,e[10]=h,e[11]=d,e[12]=n*v+s*y+l*m+t[12],e[13]=i*v+u*y+f*m+t[13],e[14]=o*v+c*y+h*m+t[14],e[15]=a*v+p*y+d*m+t[15]),e},c.scale=function(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},c.rotate=function(e,t,n,i){var o,a,s,u,c,p,l,f,h,d,v,y,m,g,b,x,w,E,S,j,A,L,k,_,I=i[0],O=i[1],N=i[2],P=Math.sqrt(I*I+O*O+N*N);return r>Math.abs(P)?null:(P=1/P,I*=P,O*=P,N*=P,o=Math.sin(n),a=Math.cos(n),s=1-a,u=t[0],c=t[1],p=t[2],l=t[3],f=t[4],h=t[5],d=t[6],v=t[7],y=t[8],m=t[9],g=t[10],b=t[11],x=I*I*s+a,w=O*I*s+N*o,E=N*I*s-O*o,S=I*O*s-N*o,j=O*O*s+a,A=N*O*s+I*o,L=I*N*s+O*o,k=O*N*s-I*o,_=N*N*s+a,e[0]=u*x+f*w+y*E,e[1]=c*x+h*w+m*E,e[2]=p*x+d*w+g*E,e[3]=l*x+v*w+b*E,e[4]=u*S+f*j+y*A,e[5]=c*S+h*j+m*A,e[6]=p*S+d*j+g*A,e[7]=l*S+v*j+b*A,e[8]=u*L+f*k+y*_,e[9]=c*L+h*k+m*_,e[10]=p*L+d*k+g*_,e[11]=l*L+v*k+b*_,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},c.rotateX=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],p=t[9],l=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*n,e[5]=a*i+p*n,e[6]=s*i+l*n,e[7]=u*i+f*n,e[8]=c*i-o*n,e[9]=p*i-a*n,e[10]=l*i-s*n,e[11]=f*i-u*n,e},c.rotateY=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],p=t[9],l=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*n,e[1]=a*i-p*n,e[2]=s*i-l*n,e[3]=u*i-f*n,e[8]=o*n+c*i,e[9]=a*n+p*i,e[10]=s*n+l*i,e[11]=u*n+f*i,e},c.rotateZ=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],p=t[5],l=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*n,e[1]=a*i+p*n,e[2]=s*i+l*n,e[3]=u*i+f*n,e[4]=c*i-o*n,e[5]=p*i-a*n,e[6]=l*i-s*n,e[7]=f*i-u*n,e},c.fromRotationTranslation=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=n+n,u=i+i,c=o+o,p=n*s,l=n*u,f=n*c,h=i*u,d=i*c,v=o*c,y=a*s,m=a*u,g=a*c;return e[0]=1-(h+v),e[1]=l+g,e[2]=f-m,e[3]=0,e[4]=l-g,e[5]=1-(p+v),e[6]=d+y,e[7]=0,e[8]=f+m,e[9]=d-y,e[10]=1-(p+h),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},c.frustum=function(e,t,r,n,i,o,a){var s=1/(r-t),u=1/(i-n),c=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(a+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*a*o*c,e[15]=0,e},c.perspective=function(e,t,r,n,i){var o=1/Math.tan(t/2),a=1/(n-i);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*a,e[15]=0,e},c.ortho=function(e,t,r,n,i,o,a){var s=1/(t-r),u=1/(n-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(a+o)*c,e[15]=1,e},c.lookAt=function(e,t,n,i){var o,a,s,u,p,l,f,h,d,v,y=t[0],m=t[1],g=t[2],b=i[0],x=i[1],w=i[2],E=n[0],S=n[1],j=n[2];return r>Math.abs(y-E)&&r>Math.abs(m-S)&&r>Math.abs(g-j)?c.identity(e):(f=y-E,h=m-S,d=g-j,v=1/Math.sqrt(f*f+h*h+d*d),f*=v,h*=v,d*=v,o=x*d-w*h,a=w*f-b*d,s=b*h-x*f,v=Math.sqrt(o*o+a*a+s*s),v?(v=1/v,o*=v,a*=v,s*=v):(o=0,a=0,s=0),u=h*s-d*a,p=d*o-f*s,l=f*a-h*o,v=Math.sqrt(u*u+p*p+l*l),v?(v=1/v,u*=v,p*=v,l*=v):(u=0,p=0,l=0),e[0]=o,e[1]=u,e[2]=f,e[3]=0,e[4]=a,e[5]=p,e[6]=h,e[7]=0,e[8]=s,e[9]=l,e[10]=d,e[11]=0,e[12]=-(o*y+a*m+s*g),e[13]=-(u*y+p*m+l*g),e[14]=-(f*y+h*m+d*g),e[15]=1,e)},c.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},e!==void 0&&(e.mat4=c);var l={},f=new Float32Array([0,0,0,1]);if(!r)var r=1e-6;l.create=function(){return new Float32Array(f)},l.clone=i.clone,l.fromValues=i.fromValues,l.copy=i.copy,l.set=i.set,l.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},l.setAxisAngle=function(e,t,r){r=.5*r;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e},l.add=i.add,l.mul=l.multiply=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=r[0],u=r[1],c=r[2],p=r[3];return e[0]=n*p+a*s+i*c-o*u,e[1]=i*p+a*u+o*s-n*c,e[2]=o*p+a*c+n*u-i*s,e[3]=a*p-n*s-i*u-o*c,e},l.scale=i.scale,l.rotateX=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+a*s,e[1]=i*u+o*s,e[2]=o*u-i*s,e[3]=a*u-n*s,e},l.rotateY=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-o*s,e[1]=i*u+a*s,e[2]=o*u+n*s,e[3]=a*u-i*s,e},l.rotateZ=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=o*u+a*s,e[3]=a*u-o*s,e},l.calculateW=function(e,t){var r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=-Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e},l.dot=i.dot,l.lerp=i.lerp,l.slerp=function(e,t,r,n){var i,o,a,s,u=t[0],c=t[1],p=t[2],l=t[3],f=r[0],h=r[1],d=r[2],v=t[3],y=u*f+c*h+p*d+l*v;return Math.abs(y)>=1?(e!==t&&(e[0]=u,e[1]=c,e[2]=p,e[3]=l),e):(i=Math.acos(y),o=Math.sqrt(1-y*y),.001>Math.abs(o)?(e[0]=.5*u+.5*f,e[1]=.5*c+.5*h,e[2]=.5*p+.5*d,e[3]=.5*l+.5*v,e):(a=Math.sin((1-n)*i)/o,s=Math.sin(n*i)/o,e[0]=u*a+f*s,e[1]=c*a+h*s,e[2]=p*a+d*s,e[3]=l*a+v*s,e))},l.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=o*s,e},l.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},l.len=l.length=i.length,l.sqrLen=l.squaredLength=i.squaredLength,l.normalize=i.normalize,l.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},e!==void 0&&(e.quat=l)}(e.exports)})()})()},{}]},{},[]),require=function(e,t,r){function n(r,o){if(!t[r]){if(!e[r]){var a="function"==typeof require&&require;if(!o&&a)return a(r,!0);if(i)return i(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var i=e[r][1][t];return n(i?i:t)},s,s.exports)}return t[r].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)n(r[o]);return n}({1:[function(e,t){var r=t.exports={};r.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){if(e.source===window&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var t=r.shift();t()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],2:[function(e,t,r){(function(e){function t(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;e.length>r;r++)if(t===e[r])return r;return-1}e.EventEmitter||(e.EventEmitter=function(){});var n=r.EventEmitter=e.EventEmitter,i="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=10;n.prototype.setMaxListeners=function(e){this._events||(this._events={}),this._events.maxListeners=e},n.prototype.emit=function(e){if("error"===e&&(!this._events||!this._events.error||i(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var t=this._events[e];if(!t)return!1;if("function"==typeof t){switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:var r=Array.prototype.slice.call(arguments,1);t.apply(this,r)}return!0}if(i(t)){for(var r=Array.prototype.slice.call(arguments,1),n=t.slice(),o=0,a=n.length;a>o;o++)n[o].apply(this,r);return!0}return!1},n.prototype.addListener=function(e,t){if("function"!=typeof t)throw Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",e,t),this._events[e])if(i(this._events[e])){if(!this._events[e].warned){var r;r=void 0!==this._events.maxListeners?this._events.maxListeners:o,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}this._events[e].push(t)}else this._events[e]=[this._events[e],t];else this._events[e]=t;return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){var r=this;return r.on(e,function n(){r.removeListener(e,n),t.apply(this,arguments)}),this},n.prototype.removeListener=function(e,r){if("function"!=typeof r)throw Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;var n=this._events[e];if(i(n)){var o=t(n,r);if(0>o)return this;n.splice(o,1),0==n.length&&delete this._events[e]}else this._events[e]===r&&delete this._events[e];return this},n.prototype.removeAllListeners=function(e){return 0===arguments.length?(this._events={},this):(e&&this._events&&this._events[e]&&(this._events[e]=null),this)},n.prototype.listeners=function(e){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),i(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]}})(e("__browserify_process"))},{__browserify_process:1}],"topdown-physics":[function(e,t){t.exports=e("h1uSSn")},{}],h1uSSn:[function(e,t){function r(e,t,o){if(!(this instanceof r))return new r(e,t,o);if(!e)throw Error("You must pass an AABB as the first argument");if(!t)throw Error("You must pass a continuous ndarray as the second argument");o=o||{},a.call(this),this.player=e,this.min=e.base,this.max=e.max,this.spd=[0,0],this.field=t,this.interval=o.interval||1/32,this.friction="friction"in o?1-o.friction:.9,this.physical=o.physical?n(o.physical):i}function n(e){return"function"==typeof e?e:function(){return e}}function i(e){return e}function o(e){return e>0?1:1>e?-1:0}var a=e("events").EventEmitter,s=e("inherits"),u=Math.floor,c=Math.abs,p=Math.min;t.exports=r,s(r,a);var l=[],f=[0,0];r.prototype.tick=function(){var e=this.interval,t=this.physical,r=this.field,n=this.friction,i=this.max[0]-this.min[0],a=this.max[1]-this.min[1],s=!1,h=!1,d=!1,v=!1,y=!1;for(l[0]=this.spd[0],l[1]=this.spd[1],f[0]=this.min[0],f[1]=this.min[1];l[0]||l[1];){var m=o(l[0])*p(e,c(l[0])),g=o(l[1])*p(e,c(l[1]));f[0]+=m,f[1]+=g,l[0]-=m,l[1]-=g,h=t(r.get([u(f[0]),u(f[1])])),d=t(r.get([u(f[0]+i),u(f[1])])),v=t(r.get([u(f[0]+i),u(f[1]+a)])),y=t(r.get([u(f[0]),u(f[1]+a)])),0>this.spd[0]?(h||y)&&(f[0]-=m,s=!0):this.spd[0]>0&&(d||v)&&(f[0]-=m,s=!0),0>this.spd[1]?(d||h)&&(f[1]-=g,s=!0):this.spd[1]>0&&(v||y)&&(f[1]-=g,s=!0)}f[0]-=this.min[0],f[1]-=this.min[1],this.spd[0]*=n,this.spd[1]*=n,this.player.translate(f),s&&this.emit("collision")}},{events:2,inherits:3}],3:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}]},{},[]);var observer=require("continuous-observer"),topdown=require("topdown-physics"),cave=require("cave-automata-2d"),fill=require("ndarray-fill"),aabb=require("aabb-2d"),zero=require("zeros"),raf=require("raf"),canvas=document.createElement("canvas"),ctx=canvas.getContext("2d"),controls=require("kb-controls-iframed")({"<up>":"up","<down>":"down","<left>":"left","<right>":"right",W:"up",S:"down",A:"left",D:"right"}),field=require("ndarray-continuous")({shape:[28,28],getter:getter}),moveTo=observer(field),camera={x:0,y:0},player=aabb([0,0],[1,1]),physics=topdown(player,field,{friction:.1,interval:.0025,physical:function(e){return!!e}});raf().on("data",function(){controls.up&&(physics.spd[1]=-.25),controls.down&&(physics.spd[1]=.25),controls.left&&(physics.spd[0]=-.25),controls.right&&(physics.spd[0]=.25),physics.tick(),camera.x=player.base[0],camera.y=player.base[1],moveTo([camera.x,camera.y]),ctx.fillStyle="#f2f2f2",ctx.fillRect(0,0,canvas.width,canvas.height),field.each(function(e){e.position;var t=e.shape[0],r=e.shape[1],n={x:e.position[0]*e.shape[0],y:e.position[1]*e.shape[1]};ctx.fillStyle="#af3";for(var i=0;t>i;i+=1)for(var o=0;r>o;o+=1)e.get(i,o)>0&&ctx.fillRect(40*(n.x+i-camera.x)+canvas.width/2,40*(n.y+o-camera.y)+canvas.height/2,39,39)}),ctx.fillStyle="#f53",ctx.fillRect(canvas.width/2,canvas.height/2,39,39)}),document.body.style.margin=document.body.style.padding=0,document.body.style.overflow="hidden",document.body.appendChild(canvas),canvas.width=window.innerWidth,canvas.height=window.innerHeight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; } | |
body, html { height: 100%; width: 100%; }</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment