Skip to content

Instantly share code, notes, and snippets.

@brycebaril
Forked from max-mapper/index.js
Created March 14, 2014 22:19
Show Gist options
  • Save brycebaril/9558178 to your computer and use it in GitHub Desktop.
Save brycebaril/9558178 to your computer and use it in GitHub Desktop.
requirebin sketch
var observer = require('continuous-observer')
var cave = require('cave-automata-2d')
var fill = require('ndarray-fill')
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')(document.body, {
'<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
}
raf().on('data', function() {
if (controls.up) camera.y -= 0.25
if (controls.down) camera.y += 0.25
if (controls.left) camera.x -= 0.25
if (controls.right) camera.x += 0.25
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,
(offset.y + y - camera.y) * 40,
40,
40
)
}
}
}
})
})
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
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,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;n.length>a;a++)i(n[a]);return i}({1:[function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(r=this._events[e],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,s=Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];r.apply(this,s)}else if(o(r)){for(i=arguments.length,s=Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];for(l=r.slice(),i=l.length,u=0;i>u;u++)l[u].apply(this,s)}return!0},r.prototype.addListener=function(e,t){var i;if(!n(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned){var i;i=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(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())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(r)){for(s=a;s-->0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?n(e._events[t])?1:e._events[t].length:0}},{}],hinVIu:[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,g[e]=1}function s(e){return function(){return a(),y=e,this}}function u(e){return function(t){y&&e(t)}}function l(e,r){return function(n){var a=e(n),s=t[a];s&&(o[s]+=r?i(g[a]--,0):-(g[a]=1),!r&&0>o[s]&&(o[s]=0))}}function c(e){return"<mouse "+e.which+">"}function p(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,g={},y=!0;o=o||{};for(var m in t){if("enabled"===t[m]||"enable"===t[m]||"disable"===t[m]||"destroy"===t[m])throw Error(t[m]+" is reserved");o[t[m]]=0,g[m]=1}return v.on("keyup",u(l(p,!1))),v.on("keydown",u(l(p,!0))),d.on("mouseup",u(l(c,!1))),d.on("mousedown",u(l(c,!0))),o.enabled=function(){return y},o.enable=s(!0),o.disable=s(!1),o.destroy=function(){v.removeAllListeners(),d.removeAllListeners()},o}},{ever:4,vkey:7}],"kb-controls":[function(e,t){t.exports=e("hinVIu")},{}],4:[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],l={},c=[],p=0;u.length>p;p++){var f=u[p];c.push(a[f]),l[f]=!0}t[s].apply(t,c);for(var f in a)l[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"}}()},{"./init.json":5,"./types.json":6,events:1}],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"]}},{}],6:[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"]}},{}],7:[function(e,t){var r,n="undefined"!=typeof window?window.navigator.userAgent:"",i=/OS X/.test(n),o=/Opera/.test(n),a=!/like Gecko/.test(n)&&!o,s=t.exports={0:i?"<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:i?"<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:i&&a?"-":"<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:o?"`":"<unicode>",246:"<attention>",247:"<crsel>",248:"<exsel>",249:"<erase-eof>",250:"<play>",251:"<zoom>",252:"<no-name>",253:"<pa-1>",254:"<clear>"};for(r=58;65>r;++r)s[r]=String.fromCharCode(r);for(r=48;58>r;++r)s[r]=r-48+"";for(r=65;91>r;++r)s[r]=String.fromCharCode(r);for(r=96;106>r;++r)s[r]="<num-"+(r-96)+">";for(r=112;136>r;++r)s[r]="F"+(r-111)},{}]},{},[]),require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;n.length>a;a++)i(n[a]);return i}({"xl+HH6":[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:3}],"ndarray-fill":[function(e,t){t.exports=e("xl+HH6")},{}],3:[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":4,"cwise-parser":8}],4:[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":6}],5:[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=[],l=[],c=0,p=0;for(n=0;o>n;++n)l.push(["i",n,"=0"].join(""));for(i=0;a>i;++i)for(n=0;o>n;++n)p=c,c=e[n],0===n?l.push(["d",i,"s",n,"=t",i,"[",c,"]"].join("")):l.push(["d",i,"s",n,"=(t",i,"[",c,"]-s",p,"*t",i,"[",p,"])"].join(""));for(u.push("var "+l.join(",")),n=o-1;n>=0;--n)c=e[n],u.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(u.push(r),n=0;o>n;++n){for(p=c,c=e[n],i=0;a>i;++i)u.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&u.push(["index[",p,"]-=s",p].join("")),u.push(["++index[",c,"]"].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,l=[],c=0;a>c;++c)l.push(["var offset",c,"=p",c].join(""));for(var c=e;o>c;++c)l.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(var c=0;a>c;++c){for(var p=["offset"+c],f=e;o>f;++f)p.push(["j",f,"*t",c,"[",t[f],"]"].join(""));l.push(["p",c,"=(",p.join("+"),")"].join(""))}l.push(r(t,n,i));for(var c=e;o>c;++c)l.push("}");return l.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 l=t.arrayArgs.indexOf(a);1===s.count?"generic"===r[l]?s.lvalue?(i.push(["var l",l,"=a",l,".get(p",l,")"].join("")),n=n.replace(u,"l"+l),o.push(["a",l,".set(p",l,",l",l,")"].join(""))):n=n.replace(u,["a",l,".get(p",l,")"].join("")):n=n.replace(u,["a",l,"[p",l,"]"].join("")):"generic"===r[l]?(i.push(["var l",l,"=a",l,".get(p",l,")"].join("")),n=n.replace(u,"l"+l),s.lvalue&&o.push(["a",l,".set(p",l,",l",l,")"].join(""))):(i.push(["var l",l,"=a",l,"[p",l,"]"].join("")),n=n.replace(u,"l"+l),s.lvalue&&o.push(["a",l,"[p",l,"]=l",l].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,l=Array(e.arrayArgs.length),c=Array(e.arrayArgs.length),p=["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)p.push("a"+v),p.push("t"+v),p.push("p"+v),c[v]=t[2*v],l[v]=t[2*v+1];for(var v=0;e.scalarArgs.length>v;++v)p.push("Y"+v);if(e.shapeArgs.length>0&&h.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var g=Array(s),v=0;s>v;++v)g[v]="0";h.push(["index=[",g.join(","),"]"].join(""))}var y=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));h=h.concat(y),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,c));var m=o(e.body,e,c),b=i(l);s>b?f.push(n(b,l[0],e,m)):f.push(r(l[0],e,m)),e.post.body.length>3&&f.push(o(e.post,e,c)),e.debug&&console.log("Generated cwise routine for ",t,":\n\n",f.join("\n"));var w=[e.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",b,a(c)].join(""),E=Function(["function ",w,"(",p.join(","),"){",f.join("\n"),"} return ",w].join(""));return E()}var u=e("uniq");t.exports=s},{uniq:7}],6:[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 l=e.arrayArgs[u];r.push(["t",l,"=array",l,".dtype,","r",l,"=array",l,".order"].join("")),o.push("t"+l),o.push("r"+l),a.push("t"+l),a.push("r"+l+".join()"),s.push("array"+l+".data"),s.push("array"+l+".stride"),s.push("array"+l+".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 c=Function("compile",t.join("\n"));return c(n.bind(void 0,e))}var n=e("./compile.js");t.exports=r},{"./compile.js":5}],7:[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},{}],8:[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=g+e.replace(/\_/g,"__");return x.push(t),t}function a(e){var t="this_"+e.replace(/\_/g,"__");return S.push(t),t}function c(e,t){for(var r=e.range[0],n=e.range[1],i=r+1;n>i;++i)w[i]="";w[r]=t}function p(e){return"'"+e.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'"}function f(e){return w.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}),g="_inline_"+l++ +"_",y=o(v),m=Array(y.length),b=0;y.length>b;++b)m[b]=new r([g,"arg",b,"_"].join(""),!1,!1);for(var w=Array(d.length),b=0,E=d.length;E>b;++b)w[b]=d.charAt(b);var x=[],S=[],j=1,A=2;(function I(e,r){if(e.parent=r,"MemberExpression"===e.type)e.computed?(I(e.object,e),I(e.property,e)):"ThisExpression"===e.object.type?c(e,a(e.property.name)):I(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=y.indexOf(n);if(o>=0){var s=m[o],u=h(e);u&j&&(s.lvalue=!0),u&A&&(s.rvalue=!0),++s.count,c(e,s.name)}else i(n)||c(e,t(n))}else if("Literal"===e.type)"string"==typeof e.value&&c(e,p(e.value));else{if("WithStatement"===e.type)throw Error("cwise-parser: with() statements not allowed");for(var l=Object.keys(e),f=0,d=l.length;d>f;++f)if("parent"!==l[f]){var v=e[l[f]];if(v)if(v instanceof Array)for(var g=0;v.length>g;++g)v[g]&&"string"==typeof v[g].type&&I(v[g],e);else"string"==typeof v.type&&I(v,e)}}}})(v.body[0].expression.callee.body,void 0),u(x),u(S);var L=new n(f(v.body[0].expression.callee.body),m,S,x);return L}var s=e("esprima"),u=e("uniq"),l=0;t.exports=a},{esprima:9,uniq:10}],9:[function(e,t,r){(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&&pr.NonAsciiIdentifierStart.test(e)}function l(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&pr.NonAsciiIdentifierPart.test(e)}function c(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function p(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&&p(e)?!0:c(e)}function d(){var e,t,r;for(t=!1,r=!1;yr>dr;)if(e=fr[dr],r)e=fr[dr++],s(e)&&(r=!1,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,gr=dr);else if(t)s(e)?("\r"===e&&"\n"===fr[dr+1]&&++dr,++vr,++dr,gr=dr,dr>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")):(e=fr[dr++],dr>=yr&&I({},cr.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>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")}else if(a(e))++dr;else{if(!s(e))break;++dr,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,gr=dr}}function v(e){var t,r,n,o=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(yr>dr&&i(fr[dr])))return"";n=fr[dr++],o=16*o+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(o)}function g(){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(;yr>dr&&(e=fr[dr],l(e));)if("\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!l(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:gr,range:[t,dr]}:h(r)?{type:ar.Keyword,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}:"null"===r?{type:ar.NullLiteral,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}:"true"===r||"false"===r?{type:ar.BooleanLiteral,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}:{type:ar.Identifier,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}}}function y(){var e,t,r,i=dr,o=fr[dr];return";"===o||"{"===o||"}"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:gr,range:[i,dr]}):","===o||"("===o||")"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:gr,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:gr,range:[i,dr]}):"="===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"===",lineNumber:vr,lineStart:gr,range:[i,dr]}):"!"===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"!==",lineNumber:vr,lineStart:gr,range:[i,dr]}):">"===o&&">"===e&&">"===t?(dr+=3,{type:ar.Punctuator,value:">>>",lineNumber:vr,lineStart:gr,range:[i,dr]}):"<"===o&&"<"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"<<=",lineNumber:vr,lineStart:gr,range:[i,dr]}):">"===o&&">"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:">>=",lineNumber:vr,lineStart:gr,range:[i,dr]}):"="===e&&"<>=!+-*%&|^/".indexOf(o)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:gr,range:[i,dr]}):o===e&&"+-<>&|".indexOf(o)>=0&&"+-<>&|".indexOf(e)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:gr,range:[i,dr]}):"[]<>+-*%&|^!~?:=/".indexOf(o)>=0?{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:gr,range:[i,dr]}:void 0):{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:gr,range:[i,dr]})}function m(){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++];yr>dr&&(a=fr[dr],i(a));)e+=fr[dr++];return 2>=e.length&&I({},cr.UnexpectedToken,"ILLEGAL"),yr>dr&&(a=fr[dr],u(a)&&I({},cr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,16),lineNumber:vr,lineStart:gr,range:[r,dr]}}if(o(a)){for(e+=fr[dr++];yr>dr&&(a=fr[dr],o(a));)e+=fr[dr++];return yr>dr&&(a=fr[dr],(u(a)||n(a))&&I({},cr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:vr,lineStart:gr,range:[r,dr]}}n(a)&&I({},cr.UnexpectedToken,"ILLEGAL")}for(;yr>dr&&(a=fr[dr],n(a));)e+=fr[dr++]}if("."===a)for(e+=fr[dr++];yr>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++];yr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];else a="character "+a,dr>=yr&&(a="<end>"),I({},cr.UnexpectedToken,"ILLEGAL");return yr>dr&&(a=fr[dr],u(a)&&I({},cr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseFloat(e),lineNumber:vr,lineStart:gr,range:[r,dr]}}function b(){var e,r,n,i,a,u,l="",c=!1;for(e=fr[dr],t("'"===e||'"'===e,"String literal must starts with a quote"),r=dr,++dr;yr>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":l+="\n";break;case"r":l+="\r";break;case"t":l+=" ";break;case"u":case"x":u=dr,a=v(n),a?l+=a:(dr=u,l+=n);break;case"b":l+="\b";break;case"f":l+="\f";break;case"v":l+=" ";break;default:o(n)?(i="01234567".indexOf(n),0!==i&&(c=!0),yr>dr&&o(fr[dr])&&(c=!0,i=8*i+"01234567".indexOf(fr[dr++]),"0123".indexOf(n)>=0&&yr>dr&&o(fr[dr])&&(i=8*i+"01234567".indexOf(fr[dr++]))),l+=String.fromCharCode(i)):l+=n}else{if(s(n))break;l+=n}}return""!==e&&I({},cr.UnexpectedToken,"ILLEGAL"),{type:ar.StringLiteral,value:l,octal:c,lineNumber:vr,lineStart:gr,range:[r,dr]}}function w(){var e,r,n,i,o,a,u,c=!1,p=!1;for(mr=null,d(),n=dr,r=fr[dr],t("/"===r,"Regular expression literal must start with a slash"),e=fr[dr++];yr>dr;)if(r=fr[dr++],e+=r,"\\"===r)r=fr[dr++],s(r)&&I({},cr.UnterminatedRegExp),e+=r;else if(c)"]"===r&&(c=!1);else{if("/"===r){p=!0;break}"["===r?c=!0:s(r)&&I({},cr.UnterminatedRegExp)}for(p||I({},cr.UnterminatedRegExp),i=e.substr(1,e.length-2),o="";yr>dr&&(r=fr[dr],l(r));)if(++dr,"\\"===r&&yr>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){I({},cr.InvalidRegExp)}return{literal:e,value:a,range:[n,dr]}}function E(e){return e.type===ar.Identifier||e.type===ar.Keyword||e.type===ar.BooleanLiteral||e.type===ar.NullLiteral}function x(){var e,t;return d(),dr>=yr?{type:ar.EOF,lineNumber:vr,lineStart:gr,range:[dr,dr]}:(t=y(),t!==void 0?t:(e=fr[dr],"'"===e||'"'===e?b():"."===e||n(e)?m():(t=g(),t!==void 0?t:(I({},cr.UnexpectedToken,"ILLEGAL"),void 0))))}function S(){var e;return mr?(dr=mr.range[1],vr=mr.lineNumber,gr=mr.lineStart,e=mr,mr=null,e):(mr=null,x())}function j(){var e,t,r;return null!==mr?mr:(e=dr,t=vr,r=gr,mr=x(),dr=e,vr=t,gr=r,mr)}function A(){var e,t,r,n;return e=dr,t=vr,r=gr,d(),n=vr!==t,dr=e,vr=t,gr=r,n}function I(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]-gr+1):(r=Error("Line "+vr+": "+i),r.index=dr,r.lineNumber=vr,r.column=dr-gr+1),r}function L(){try{I.apply(null,arguments)}catch(e){if(!wr.errors)throw e;wr.errors.push(e)}}function _(e){if(e.type===ar.EOF&&I(e,cr.UnexpectedEOS),e.type===ar.NumericLiteral&&I(e,cr.UnexpectedNumber),e.type===ar.StringLiteral&&I(e,cr.UnexpectedString),e.type===ar.Identifier&&I(e,cr.UnexpectedIdentifier),e.type===ar.Keyword){if(c(e.value))I(e,cr.UnexpectedReserved);else if(hr&&p(e.value))return L(e,cr.StrictReservedWord),void 0;I(e,cr.UnexpectedToken,e.value)}I(e,cr.UnexpectedToken,e.value)}function k(e){var t=S();(t.type!==ar.Punctuator||t.value!==e)&&_(t)}function B(e){var t=S();(t.type!==ar.Keyword||t.value!==e)&&_(t)}function U(e){var t=j();return t.type===ar.Punctuator&&t.value===e}function N(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 O(){var e,t;if(";"===fr[dr])return S(),void 0;if(t=vr,d(),vr===t){if(U(";"))return S(),void 0;e=j(),e.type===ar.EOF||U("}")||_(e)}}function P(e){return e.type===ur.Identifier||e.type===ur.MemberExpression}function F(){var e=[];for(k("[");!U("]");)U(",")?(S(),e.push(null)):(e.push(lt()),U("]")||k(","));return k("]"),{type:ur.ArrayExpression,elements:e}}function M(e,t){var r,n;return r=hr,n=Ft(),t&&hr&&f(e[0].name)&&L(t,cr.StrictParamName),hr=r,{type:ur.FunctionExpression,id:null,params:e,defaults:[],body:n,rest:null,generator:!1,expression:!1}}function D(){var e=S();return e.type===ar.StringLiteral||e.type===ar.NumericLiteral?(hr&&e.octal&&L(e,cr.StrictOctalLiteral),Xt(e)):{type:ur.Identifier,name:e.value}}function T(){var e,t,r,n;return e=j(),e.type===ar.Identifier?(r=D(),"get"!==e.value||U(":")?"set"!==e.value||U(":")?(k(":"),{type:ur.Property,key:r,value:lt(),kind:"init"}):(t=D(),k("("),e=j(),e.type!==ar.Identifier?(k(")"),L(e,cr.UnexpectedToken,e.value),{type:ur.Property,key:t,value:M([]),kind:"set"}):(n=[ht()],k(")"),{type:ur.Property,key:t,value:M(n,e),kind:"set"})):(t=D(),k("("),k(")"),{type:ur.Property,key:t,value:M([]),kind:"get"})):e.type!==ar.EOF&&e.type!==ar.Punctuator?(t=D(),k(":"),{type:ur.Property,key:t,value:lt(),kind:"init"}):(_(e),void 0)}function R(){var e,t,r,n=[],i={},o=String;for(k("{");!U("}");)e=T(),t=e.key.type===ur.Identifier?e.key.name:o(e.key.value),r="init"===e.kind?lr.Data:"get"===e.kind?lr.Get:lr.Set,Object.prototype.hasOwnProperty.call(i,t)?(i[t]===lr.Data?hr&&r===lr.Data?L({},cr.StrictDuplicateProperty):r!==lr.Data&&L({},cr.AccessorDataProperty):r===lr.Data?L({},cr.AccessorDataProperty):i[t]&r&&L({},cr.AccessorGetSet),i[t]|=r):i[t]=r,n.push(e),U("}")||k(",");return k("}"),{type:ur.ObjectExpression,properties:n}}function q(){var e;return k("("),e=ct(),k(")"),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&&L(e,cr.StrictOctalLiteral),Xt(S());if(t===ar.Keyword){if(N("this"))return S(),{type:ur.ThisExpression};if(N("function"))return Dt()}return t===ar.BooleanLiteral?(S(),e.value="true"===e.value,Xt(e)):t===ar.NullLiteral?(S(),e.value=null,Xt(e)):U("[")?F():U("{")?R():U("(")?q():U("/")||U("/=")?Xt(w()):_(S())}function G(){var e=[];if(k("("),!U(")"))for(;yr>dr&&(e.push(lt()),!U(")"));)k(",");return k(")"),e}function W(){var e=S();return E(e)||_(e),{type:ur.Identifier,name:e.value}}function z(){return k("."),W()}function H(){var e;return k("["),e=ct(),k("]"),e}function K(){var e;return B("new"),e={type:ur.NewExpression,callee:Y(),arguments:[]},U("(")&&(e.arguments=G()),e
}function X(){var e;for(e=N("new")?K():V();U(".")||U("[")||U("(");)e=U("(")?{type:ur.CallExpression,callee:e,arguments:G()}:U("[")?{type:ur.MemberExpression,computed:!0,object:e,property:H()}:{type:ur.MemberExpression,computed:!1,object:e,property:z()};return e}function Y(){var e;for(e=N("new")?K():V();U(".")||U("[");)e=U("[")?{type:ur.MemberExpression,computed:!0,object:e,property:H()}:{type:ur.MemberExpression,computed:!1,object:e,property:z()};return e}function J(){var e,t=X();return e=j(),e.type!==ar.Punctuator?t:(!U("++")&&!U("--")||A()||(hr&&t.type===ur.Identifier&&f(t.name)&&L({},cr.StrictLHSPostfix),P(t)||L({},cr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:S().value,argument:t,prefix:!1}),t)}function Z(){var e,t;return e=j(),e.type!==ar.Punctuator&&e.type!==ar.Keyword?J():U("++")||U("--")?(e=S(),t=Z(),hr&&t.type===ur.Identifier&&f(t.name)&&L({},cr.StrictLHSPrefix),P(t)||L({},cr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:e.value,argument:t,prefix:!0}):U("+")||U("-")||U("~")||U("!")?t={type:ur.UnaryExpression,operator:S().value,argument:Z(),prefix:!0}:N("delete")||N("void")||N("typeof")?(t={type:ur.UnaryExpression,operator:S().value,argument:Z(),prefix:!0},hr&&"delete"===t.operator&&t.argument.type===ur.Identifier&&L({},cr.StrictDelete),t):J()}function $(){for(var e=Z();U("*")||U("/")||U("%");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:Z()};return e}function Q(){for(var e=$();U("+")||U("-");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:$()};return e}function et(){for(var e=Q();U("<<")||U(">>")||U(">>>");)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();U("<")||U(">")||U("<=")||U(">=")||t&&N("in")||N("instanceof");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:et()};return br.allowIn=t,e}function rt(){for(var e=tt();U("==")||U("!=")||U("===")||U("!==");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:tt()};return e}function nt(){for(var e=rt();U("&");)S(),e={type:ur.BinaryExpression,operator:"&",left:e,right:rt()};return e}function it(){for(var e=nt();U("^");)S(),e={type:ur.BinaryExpression,operator:"^",left:e,right:nt()};return e}function ot(){for(var e=it();U("|");)S(),e={type:ur.BinaryExpression,operator:"|",left:e,right:it()};return e}function at(){for(var e=ot();U("&&");)S(),e={type:ur.LogicalExpression,operator:"&&",left:e,right:ot()};return e}function st(){for(var e=at();U("||");)S(),e={type:ur.LogicalExpression,operator:"||",left:e,right:at()};return e}function ut(){var e,t,r;return e=st(),U("?")&&(S(),t=br.allowIn,br.allowIn=!0,r=lt(),br.allowIn=t,k(":"),e={type:ur.ConditionalExpression,test:e,consequent:r,alternate:lt()}),e}function lt(){var e,t;return e=j(),t=ut(),C()&&(P(t)||L({},cr.InvalidLHSInAssignment),hr&&t.type===ur.Identifier&&f(t.name)&&L(e,cr.StrictLHSAssignment),t={type:ur.AssignmentExpression,operator:S().value,left:t,right:lt()}),t}function ct(){var e=lt();if(U(","))for(e={type:ur.SequenceExpression,expressions:[e]};yr>dr&&U(",");)S(),e.expressions.push(lt());return e}function pt(){for(var e,t=[];yr>dr&&!U("}")&&(e=Tt(),void 0!==e);)t.push(e);return t}function ft(){var e;return k("{"),e=pt(),k("}"),{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)&&L({},cr.StrictVarName),"const"===e?(k("="),r=lt()):U("=")&&(S(),r=lt()),{type:ur.VariableDeclarator,id:t,init:r}}function vt(e){var t=[];do{if(t.push(dt(e)),!U(","))break;S()}while(yr>dr);return t}function gt(){var e;return B("var"),e=vt(),O(),{type:ur.VariableDeclaration,declarations:e,kind:"var"}}function yt(e){var t;return B(e),t=vt(e),O(),{type:ur.VariableDeclaration,declarations:t,kind:e}}function mt(){return k(";"),{type:ur.EmptyStatement}}function bt(){var e=ct();return O(),{type:ur.ExpressionStatement,expression:e}}function wt(){var e,t,r;return B("if"),k("("),e=ct(),k(")"),t=Pt(),N("else")?(S(),r=Pt()):r=null,{type:ur.IfStatement,test:e,consequent:t,alternate:r}}function Et(){var e,t,r;return B("do"),r=br.inIteration,br.inIteration=!0,e=Pt(),br.inIteration=r,B("while"),k("("),t=ct(),k(")"),U(";")&&S(),{type:ur.DoWhileStatement,body:e,test:t}}function xt(){var e,t,r;return B("while"),k("("),e=ct(),k(")"),r=br.inIteration,br.inIteration=!0,t=Pt(),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,B("for"),k("("),U(";")?S():(N("var")||N("let")?(br.allowIn=!1,e=St(),br.allowIn=!0,1===e.declarations.length&&N("in")&&(S(),n=e,i=ct(),e=null)):(br.allowIn=!1,e=ct(),br.allowIn=!0,N("in")&&(P(e)||L({},cr.InvalidLHSInForIn),S(),n=e,i=ct(),e=null)),n===void 0&&k(";")),n===void 0&&(U(";")||(t=ct()),k(";"),U(")")||(r=ct())),k(")"),a=br.inIteration,br.inIteration=!0,o=Pt(),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 B("continue"),";"===fr[dr]?(S(),br.inIteration||I({},cr.IllegalContinue),{type:ur.ContinueStatement,label:null}):A()?(br.inIteration||I({},cr.IllegalContinue),{type:ur.ContinueStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||I({},cr.UnknownLabel,t.name)),O(),null!==t||br.inIteration||I({},cr.IllegalContinue),{type:ur.ContinueStatement,label:t})}function It(){var e,t=null;return B("break"),";"===fr[dr]?(S(),br.inIteration||br.inSwitch||I({},cr.IllegalBreak),{type:ur.BreakStatement,label:null}):A()?(br.inIteration||br.inSwitch||I({},cr.IllegalBreak),{type:ur.BreakStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||I({},cr.UnknownLabel,t.name)),O(),null!==t||br.inIteration||br.inSwitch||I({},cr.IllegalBreak),{type:ur.BreakStatement,label:t})}function Lt(){var e,t=null;return B("return"),br.inFunctionBody||L({},cr.IllegalReturn)," "===fr[dr]&&u(fr[dr+1])?(t=ct(),O(),{type:ur.ReturnStatement,argument:t}):A()?{type:ur.ReturnStatement,argument:null}:(U(";")||(e=j(),U("}")||e.type===ar.EOF||(t=ct())),O(),{type:ur.ReturnStatement,argument:t})}function _t(){var e,t;return hr&&L({},cr.StrictModeWith),B("with"),k("("),e=ct(),k(")"),t=Pt(),{type:ur.WithStatement,object:e,body:t}}function kt(){var e,t,r=[];for(N("default")?(S(),e=null):(B("case"),e=ct()),k(":");yr>dr&&!(U("}")||N("default")||N("case"))&&(t=Pt(),void 0!==t);)r.push(t);return{type:ur.SwitchCase,test:e,consequent:r}}function Bt(){var e,t,r,n,i;if(B("switch"),k("("),e=ct(),k(")"),k("{"),t=[],U("}"))return S(),{type:ur.SwitchStatement,discriminant:e,cases:t};for(n=br.inSwitch,br.inSwitch=!0,i=!1;yr>dr&&!U("}");)r=kt(),null===r.test&&(i&&I({},cr.MultipleDefaultsInSwitch),i=!0),t.push(r);return br.inSwitch=n,k("}"),{type:ur.SwitchStatement,discriminant:e,cases:t}}function Ut(){var e;return B("throw"),A()&&I({},cr.NewlineAfterThrow),e=ct(),O(),{type:ur.ThrowStatement,argument:e}}function Nt(){var e;return B("catch"),k("("),U(")")&&_(j()),e=ht(),hr&&f(e.name)&&L({},cr.StrictCatchVariable),k(")"),{type:ur.CatchClause,param:e,body:ft()}}function Ct(){var e,t=[],r=null;return B("try"),e=ft(),N("catch")&&t.push(Nt()),N("finally")&&(S(),r=ft()),0!==t.length||r||I({},cr.NoCatchOrFinally),{type:ur.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:r}}function Ot(){return B("debugger"),O(),{type:ur.DebuggerStatement}}function Pt(){var e,t,r=j();if(r.type===ar.EOF&&_(r),r.type===ar.Punctuator)switch(r.value){case";":return mt();case"{":return ft();case"(":return bt();default:}if(r.type===ar.Keyword)switch(r.value){case"break":return It();case"continue":return At();case"debugger":return Ot();case"do":return Et();case"for":return jt();case"function":return Mt();case"if":return wt();case"return":return Lt();case"switch":return Bt();case"throw":return Ut();case"try":return Ct();case"var":return gt();case"while":return xt();case"with":return _t();default:}return e=ct(),e.type===ur.Identifier&&U(":")?(S(),Object.prototype.hasOwnProperty.call(br.labelSet,e.name)&&I({},cr.Redeclaration,"Label",e.name),br.labelSet[e.name]=!0,t=Pt(),delete br.labelSet[e.name],{type:ur.LabeledStatement,label:e,body:t}):(O(),{type:ur.ExpressionStatement,expression:e})}function Ft(){var e,t,n,i,o,a,s,u,l=[];for(k("{");yr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Tt(),l.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&L(i,cr.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;yr>dr&&!U("}")&&(e=Tt(),void 0!==e);)l.push(e);return k("}"),br.labelSet=o,br.inIteration=a,br.inSwitch=s,br.inFunctionBody=u,{type:ur.BlockStatement,body:l}}function Mt(){var e,t,r,n,i,o,a,s,u,l=[];if(B("function"),n=j(),e=ht(),hr?f(n.value)&&L(n,cr.StrictFunctionName):f(n.value)?(o=n,a=cr.StrictFunctionName):p(n.value)&&(o=n,a=cr.StrictReservedWord),k("("),!U(")"))for(u={};yr>dr&&(n=j(),t=ht(),hr?(f(n.value)&&(i=n,a=cr.StrictParamName),Object.prototype.hasOwnProperty.call(u,n.value)&&(i=n,a=cr.StrictParamDupe)):o||(f(n.value)?(o=n,a=cr.StrictParamName):p(n.value)?(o=n,a=cr.StrictReservedWord):Object.prototype.hasOwnProperty.call(u,n.value)&&(o=n,a=cr.StrictParamDupe)),l.push(t),u[t.name]=!0,!U(")"));)k(",");return k(")"),s=hr,r=Ft(),hr&&o&&I(o,a),hr&&i&&L(i,a),hr=s,{type:ur.FunctionDeclaration,id:e,params:l,defaults:[],body:r,rest:null,generator:!1,expression:!1}}function Dt(){var e,t,r,n,i,o,a,s,u=null,l=[];if(B("function"),U("(")||(e=j(),u=ht(),hr?f(e.value)&&L(e,cr.StrictFunctionName):f(e.value)?(r=e,n=cr.StrictFunctionName):p(e.value)&&(r=e,n=cr.StrictReservedWord)),k("("),!U(")"))for(s={};yr>dr&&(e=j(),i=ht(),hr?(f(e.value)&&(t=e,n=cr.StrictParamName),Object.prototype.hasOwnProperty.call(s,e.value)&&(t=e,n=cr.StrictParamDupe)):r||(f(e.value)?(r=e,n=cr.StrictParamName):p(e.value)?(r=e,n=cr.StrictReservedWord):Object.prototype.hasOwnProperty.call(s,e.value)&&(r=e,n=cr.StrictParamDupe)),l.push(i),s[i.name]=!0,!U(")"));)k(",");return k(")"),a=hr,o=Ft(),hr&&r&&I(r,n),hr&&t&&L(t,n),hr=a,{type:ur.FunctionExpression,id:u,params:l,defaults:[],body:o,rest:null,generator:!1,expression:!1}}function Tt(){var e=j();if(e.type===ar.Keyword)switch(e.value){case"const":case"let":return yt(e.value);case"function":return Mt();default:return Pt()}return e.type!==ar.EOF?Pt():void 0}function Rt(){for(var e,t,n,i,o=[];yr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Tt(),o.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&L(i,cr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(;yr>dr&&(e=Tt(),void 0!==e);)o.push(e);return o}function qt(){var e;return hr=!1,e={type:ur.Program,body:Rt()}}function Vt(e,r,n,i,o){t("number"==typeof n,"Comment must have valid position"),wr.comments.length>0&&wr.comments[wr.comments.length-1].range[1]>n||wr.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;yr>dr;)if(t=fr[dr],o)t=fr[dr++],s(t)?(r.end={line:vr,column:dr-gr-1},o=!1,Vt("Line",e,n,dr-1,r),"\r"===t&&"\n"===fr[dr]&&++dr,++vr,gr=dr,e=""):dr>=yr?(o=!1,e+=t,r.end={line:vr,column:yr-gr},Vt("Line",e,n,yr,r)):e+=t;else if(i)s(t)?("\r"===t&&"\n"===fr[dr+1]?(++dr,e+="\r\n"):e+=t,++vr,++dr,gr=dr,dr>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")):(t=fr[dr++],dr>=yr&&I({},cr.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-gr},Vt("Block",e,n,dr,r),e="")));else if("/"===t)if(t=fr[dr+1],"/"===t)r={start:{line:vr,column:dr-gr}},n=dr,dr+=2,o=!0,dr>=yr&&(r.end={line:vr,column:dr-gr},o=!1,Vt("Line",e,n,dr,r));else{if("*"!==t)break;n=dr,dr+=2,i=!0,r={start:{line:vr,column:dr-gr-2}},dr>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")}else if(a(t))++dr;else{if(!s(t))break;++dr,"\r"===t&&"\n"===fr[dr]&&++dr,++vr,gr=dr}}function Wt(){var e,t,r,n=[];for(e=0;wr.comments.length>e;++e)t=wr.comments[e],r={type:t.type,value:t.value},wr.range&&(r.range=t.range),wr.loc&&(r.loc=t.loc),n.push(r);wr.comments=n}function zt(){var e,t,n,i,o;return d(),e=dr,t={start:{line:vr,column:dr-gr}},n=wr.advance(),t.end={line:vr,column:dr-gr},n.type!==ar.EOF&&(i=[n.range[0],n.range[1]],o=r(n.range[0],n.range[1]),wr.tokens.push({type:sr[n.type],value:o,range:i,loc:t})),n}function Ht(){var e,t,r,n;return d(),e=dr,t={start:{line:vr,column:dr-gr}},r=wr.scanRegExp(),t.end={line:vr,column:dr-gr},wr.tokens.length>0&&(n=wr.tokens[wr.tokens.length-1],n.range[0]===e&&"Punctuator"===n.type&&("/"===n.value||"/="===n.value)&&wr.tokens.pop()),wr.tokens.push({type:"RegularExpression",value:r.literal,range:[e,dr],loc:t}),r}function Kt(){var e,t,r,n=[];for(e=0;wr.tokens.length>e;++e)t=wr.tokens[e],r={type:t.type,value:t.value},wr.range&&(r.range=t.range),wr.loc&&(r.loc=t.loc),n.push(r);wr.tokens=n}function Xt(e){return{type:ur.Literal,value:e.value}}function Yt(e){return{type:ur.Literal,value:e.value,raw:r(e.range[0],e.range[1])}}function Jt(){var e={};return e.range=[dr,dr],e.loc={start:{line:vr,column:dr-gr},end:{line:vr,column:dr-gr}},e.end=function(){this.range[1]=dr,this.loc.end.line=vr,this.loc.end.column=dr-gr},e.applyGroup=function(e){wr.range&&(e.groupRange=[this.range[0],this.range[1]]),wr.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){wr.range&&(e.range=[this.range[0],this.range[1]]),wr.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 Zt(){var e,t;return d(),e=Jt(),k("("),t=ct(),k(")"),e.end(),e.applyGroup(t),t}function $t(){var e,t;for(d(),e=Jt(),t=N("new")?K():V();U(".")||U("[");)U("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:H()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:z()},e.end(),e.apply(t));return t}function Qt(){var e,t;for(d(),e=Jt(),t=N("new")?K():V();U(".")||U("[")||U("(");)U("(")?(t={type:ur.CallExpression,callee:t,arguments:G()},e.end(),e.apply(t)):U("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:H()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:z()},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=Jt(),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;wr.comments&&(wr.skipComment=d,d=Gt),wr.raw&&(wr.createLiteral=Xt,Xt=Yt),(wr.range||wr.loc)&&(wr.parseGroupExpression=q,wr.parseLeftHandSideExpression=Y,wr.parseLeftHandSideExpressionAllowCall=X,q=Zt,Y=$t,X=Qt,e=tr(wr.range,wr.loc),wr.parseAdditiveExpression=Q,wr.parseAssignmentExpression=lt,wr.parseBitwiseANDExpression=nt,wr.parseBitwiseORExpression=ot,wr.parseBitwiseXORExpression=it,wr.parseBlock=ft,wr.parseFunctionSourceElements=Ft,wr.parseCatchClause=Nt,wr.parseComputedMember=H,wr.parseConditionalExpression=ut,wr.parseConstLetDeclaration=yt,wr.parseEqualityExpression=rt,wr.parseExpression=ct,wr.parseForVariableDeclaration=St,wr.parseFunctionDeclaration=Mt,wr.parseFunctionExpression=Dt,wr.parseLogicalANDExpression=at,wr.parseLogicalORExpression=st,wr.parseMultiplicativeExpression=$,wr.parseNewExpression=K,wr.parseNonComputedProperty=W,wr.parseObjectProperty=T,wr.parseObjectPropertyKey=D,wr.parsePostfixExpression=J,wr.parsePrimaryExpression=V,wr.parseProgram=qt,wr.parsePropertyFunction=M,wr.parseRelationalExpression=tt,wr.parseStatement=Pt,wr.parseShiftExpression=et,wr.parseSwitchCase=kt,wr.parseUnaryExpression=Z,wr.parseVariableDeclaration=dt,wr.parseVariableIdentifier=ht,Q=e(wr.parseAdditiveExpression),lt=e(wr.parseAssignmentExpression),nt=e(wr.parseBitwiseANDExpression),ot=e(wr.parseBitwiseORExpression),it=e(wr.parseBitwiseXORExpression),ft=e(wr.parseBlock),Ft=e(wr.parseFunctionSourceElements),Nt=e(wr.parseCatchClause),H=e(wr.parseComputedMember),ut=e(wr.parseConditionalExpression),yt=e(wr.parseConstLetDeclaration),rt=e(wr.parseEqualityExpression),ct=e(wr.parseExpression),St=e(wr.parseForVariableDeclaration),Mt=e(wr.parseFunctionDeclaration),Dt=e(wr.parseFunctionExpression),Y=e(Y),at=e(wr.parseLogicalANDExpression),st=e(wr.parseLogicalORExpression),$=e(wr.parseMultiplicativeExpression),K=e(wr.parseNewExpression),W=e(wr.parseNonComputedProperty),T=e(wr.parseObjectProperty),D=e(wr.parseObjectPropertyKey),J=e(wr.parsePostfixExpression),V=e(wr.parsePrimaryExpression),qt=e(wr.parseProgram),M=e(wr.parsePropertyFunction),tt=e(wr.parseRelationalExpression),Pt=e(wr.parseStatement),et=e(wr.parseShiftExpression),kt=e(wr.parseSwitchCase),Z=e(wr.parseUnaryExpression),dt=e(wr.parseVariableDeclaration),ht=e(wr.parseVariableIdentifier)),wr.tokens!==void 0&&(wr.advance=x,wr.scanRegExp=w,x=zt,w=Ht)}function nr(){"function"==typeof wr.skipComment&&(d=wr.skipComment),wr.raw&&(Xt=wr.createLiteral),(wr.range||wr.loc)&&(Q=wr.parseAdditiveExpression,lt=wr.parseAssignmentExpression,nt=wr.parseBitwiseANDExpression,ot=wr.parseBitwiseORExpression,it=wr.parseBitwiseXORExpression,ft=wr.parseBlock,Ft=wr.parseFunctionSourceElements,Nt=wr.parseCatchClause,H=wr.parseComputedMember,ut=wr.parseConditionalExpression,yt=wr.parseConstLetDeclaration,rt=wr.parseEqualityExpression,ct=wr.parseExpression,St=wr.parseForVariableDeclaration,Mt=wr.parseFunctionDeclaration,Dt=wr.parseFunctionExpression,q=wr.parseGroupExpression,Y=wr.parseLeftHandSideExpression,X=wr.parseLeftHandSideExpressionAllowCall,at=wr.parseLogicalANDExpression,st=wr.parseLogicalORExpression,$=wr.parseMultiplicativeExpression,K=wr.parseNewExpression,W=wr.parseNonComputedProperty,T=wr.parseObjectProperty,D=wr.parseObjectPropertyKey,V=wr.parsePrimaryExpression,J=wr.parsePostfixExpression,qt=wr.parseProgram,M=wr.parsePropertyFunction,tt=wr.parseRelationalExpression,Pt=wr.parseStatement,et=wr.parseShiftExpression,kt=wr.parseSwitchCase,Z=wr.parseUnaryExpression,dt=wr.parseVariableDeclaration,ht=wr.parseVariableIdentifier),"function"==typeof wr.scanRegExp&&(x=wr.advance,w=wr.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,gr=0,yr=fr.length,mr=null,br={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},wr={},t!==void 0&&(wr.range="boolean"==typeof t.range&&t.range,wr.loc="boolean"==typeof t.loc&&t.loc,wr.raw="boolean"==typeof t.raw&&t.raw,"boolean"==typeof t.tokens&&t.tokens&&(wr.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(wr.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(wr.errors=[])),yr>0&&fr[0]===void 0&&(e instanceof String&&(fr=e.valueOf()),fr[0]===void 0&&(fr=ir(e))),rr();try{r=qt(),wr.comments!==void 0&&(Wt(),r.comments=wr.comments),wr.tokens!==void 0&&(Kt(),r.tokens=wr.tokens),wr.errors!==void 0&&(r.errors=wr.errors),(wr.range||wr.loc)&&(r.body=er(r.body))}catch(i){throw i}finally{nr(),wr={}}return r}var ar,sr,ur,lr,cr,pr,fr,hr,dr,vr,gr,yr,mr,br,wr;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"},lr={Data:1,Get:2,Set:4},cr={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"},pr={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}()})},{}],10:[function(e,t){t.exports=e(7)},{}]},{},[]),require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;n.length>a;a++)i(n[a]);return i}({1:[function(e,t,r){function n(e,t,r){if(!(this instanceof n))return new n(e,t,r);var i=typeof e;if("base64"===t&&"string"===i)for(e=_(e);0!==e.length%4;)e+="=";var o;if("number"===i)o=U(e);else if("string"===i)o=n.byteLength(e,t);else{if("object"!==i)throw Error("First argument needs to be a number, array or string.");o=U(e.length)}var a;n._useTypedArrays?a=k(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var s;if(n._useTypedArrays&&"function"==typeof Uint8Array&&e instanceof Uint8Array)a._set(e);else if(C(e))for(s=0;o>s;s++)a[s]=n.isBuffer(e)?e.readUInt8(s):e[s];else if("string"===i)a.write(e,0,t);else if("number"===i&&!n._useTypedArrays&&!r)for(s=0;o>s;s++)a[s]=0;return a}function i(e,t,r,i){r=Number(r)||0;var o=e.length-r;i?(i=Number(i),i>o&&(i=o)):i=o;var a=t.length;W(0===a%2,"Invalid hex string"),i>a/2&&(i=a/2);for(var s=0;i>s;s++){var u=parseInt(t.substr(2*s,2),16);W(!isNaN(u),"Invalid hex string"),e[r+s]=u}return n._charsWritten=2*s,s}function o(e,t,r,i){var o=n._charsWritten=T(P(t),e,r,i);return o}function a(e,t,r,i){var o=n._charsWritten=T(F(t),e,r,i);return o}function s(e,t,r,n){return a(e,t,r,n)}function u(e,t,r,i){var o=n._charsWritten=T(D(t),e,r,i);return o}function l(e,t,r,i){var o=n._charsWritten=T(M(t),e,r,i);return o}function c(e,t,r){return 0===t&&r===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(t,r))}function p(e,t,r){var n="",i="";r=Math.min(e.length,r);for(var o=t;r>o;o++)127>=e[o]?(n+=R(i)+String.fromCharCode(e[o]),i=""):i+="%"+e[o].toString(16);return n+R(i)}function f(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;i++)n+=String.fromCharCode(e[i]);return n}function h(e,t,r){return f(e,t,r)}function d(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=t;r>o;o++)i+=O(e[o]);return i}function v(e,t,r){for(var n=e.slice(t,r),i="",o=0;n.length>o;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function g(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+1,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(o=e[t],i>t+1&&(o|=e[t+1]<<8)):(o=e[t]<<8,i>t+1&&(o|=e[t+1])),o}}function y(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+3,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(i>t+2&&(o=e[t+2]<<16),i>t+1&&(o|=e[t+1]<<8),o|=e[t],i>t+3&&(o+=e[t+3]<<24>>>0)):(i>t+1&&(o=e[t+1]<<16),i>t+2&&(o|=e[t+2]<<8),i>t+3&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}}function m(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+1,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o=g(e,t,r,!0),a=32768&o;return a?-1*(65535-o+1):o}}function b(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+3,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o=y(e,t,r,!0),a=2147483648&o;return a?-1*(4294967295-o+1):o}}function w(e,t,r,n){return n||(W("boolean"==typeof r,"missing or invalid endian"),W(e.length>t+3,"Trying to read beyond buffer length")),H.read(e,t,r,23,4)}function E(e,t,r,n){return n||(W("boolean"==typeof r,"missing or invalid endian"),W(e.length>t+7,"Trying to read beyond buffer length")),H.read(e,t,r,52,8)}function x(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+1,"trying to write beyond buffer length"),q(t,65535));var o=e.length;if(!(r>=o))for(var a=0,s=Math.min(o-r,2);s>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function S(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"trying to write beyond buffer length"),q(t,4294967295));var o=e.length;if(!(r>=o))for(var a=0,s=Math.min(o-r,4);s>a;a++)e[r+a]=255&t>>>8*(n?a:3-a)}function j(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+1,"Trying to write beyond buffer length"),V(t,32767,-32768));var o=e.length;r>=o||(t>=0?x(e,t,r,n,i):x(e,65535+t+1,r,n,i))}function A(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"Trying to write beyond buffer length"),V(t,2147483647,-2147483648));var o=e.length;r>=o||(t>=0?S(e,t,r,n,i):S(e,4294967295+t+1,r,n,i))}function I(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"Trying to write beyond buffer length"),G(t,3.4028234663852886e38,-3.4028234663852886e38));var o=e.length;r>=o||H.write(e,t,r,n,23,4)}function L(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+7,"Trying to write beyond buffer length"),G(t,1.7976931348623157e308,-1.7976931348623157e308));var o=e.length;r>=o||H.write(e,t,r,n,52,8)
}function _(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function k(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=K.get,e.set=K.set,e.write=K.write,e.toString=K.toString,e.toLocaleString=K.toString,e.toJSON=K.toJSON,e.copy=K.copy,e.slice=K.slice,e.readUInt8=K.readUInt8,e.readUInt16LE=K.readUInt16LE,e.readUInt16BE=K.readUInt16BE,e.readUInt32LE=K.readUInt32LE,e.readUInt32BE=K.readUInt32BE,e.readInt8=K.readInt8,e.readInt16LE=K.readInt16LE,e.readInt16BE=K.readInt16BE,e.readInt32LE=K.readInt32LE,e.readInt32BE=K.readInt32BE,e.readFloatLE=K.readFloatLE,e.readFloatBE=K.readFloatBE,e.readDoubleLE=K.readDoubleLE,e.readDoubleBE=K.readDoubleBE,e.writeUInt8=K.writeUInt8,e.writeUInt16LE=K.writeUInt16LE,e.writeUInt16BE=K.writeUInt16BE,e.writeUInt32LE=K.writeUInt32LE,e.writeUInt32BE=K.writeUInt32BE,e.writeInt8=K.writeInt8,e.writeInt16LE=K.writeInt16LE,e.writeInt16BE=K.writeInt16BE,e.writeInt32LE=K.writeInt32LE,e.writeInt32BE=K.writeInt32BE,e.writeFloatLE=K.writeFloatLE,e.writeFloatBE=K.writeFloatBE,e.writeDoubleLE=K.writeDoubleLE,e.writeDoubleBE=K.writeDoubleBE,e.fill=K.fill,e.inspect=K.inspect,e.toArrayBuffer=K.toArrayBuffer,e}function B(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function U(e){return e=~~Math.ceil(+e),0>e?0:e}function N(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function C(e){return N(e)||n.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function O(e){return 16>e?"0"+e.toString(16):e.toString(16)}function P(e){for(var t=[],r=0;e.length>r;r++){var n=e.charCodeAt(r);if(127>=n)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),a=0;o.length>a;a++)t.push(parseInt(o[a],16))}}return t}function F(e){for(var t=[],r=0;e.length>r;r++)t.push(255&e.charCodeAt(r));return t}function M(e){for(var t,r,n,i=[],o=0;e.length>o;o++)t=e.charCodeAt(o),r=t>>8,n=t%256,i.push(n),i.push(r);return i}function D(e){return z.toByteArray(e)}function T(e,t,r,n){for(var i=0;n>i&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function R(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function q(e,t){W("number"==typeof e,"cannot write a non-number as a number"),W(e>=0,"specified a negative value for writing an unsigned value"),W(t>=e,"value is larger than maximum value for type"),W(Math.floor(e)===e,"value has a fractional component")}function V(e,t,r){W("number"==typeof e,"cannot write a non-number as a number"),W(t>=e,"value larger than maximum allowed value"),W(e>=r,"value smaller than minimum allowed value"),W(Math.floor(e)===e,"value has a fractional component")}function G(e,t,r){W("number"==typeof e,"cannot write a non-number as a number"),W(t>=e,"value larger than maximum allowed value"),W(e>=r,"value smaller than minimum allowed value")}function W(e,t){if(!e)throw Error(t||"Failed assertion")}var z=e("base64-js"),H=e("ieee754");r.Buffer=n,r.SlowBuffer=n,r.INSPECT_MAX_BYTES=50,n.poolSize=8192,n._useTypedArrays=function(){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer)return!1;try{var e=new Uint8Array(0);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),n.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},n.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=P(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=D(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw Error("Unknown encoding")}return r},n.concat=function(e,t){if(W(N(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new n(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;e.length>r;r++)t+=e[r].length;var i=new n(t),o=0;for(r=0;e.length>r;r++){var a=e[r];a.copy(i,o),o+=a.length}return i},n.prototype.write=function(e,t,r,n){if(isFinite(t))isFinite(r)||(n=r,r=void 0);else{var c=n;n=t,t=r,r=c}t=Number(t)||0;var p=this.length-t;r?(r=Number(r),r>p&&(r=p)):r=p,n=((n||"utf8")+"").toLowerCase();var f;switch(n){case"hex":f=i(this,e,t,r);break;case"utf8":case"utf-8":f=o(this,e,t,r);break;case"ascii":f=a(this,e,t,r);break;case"binary":f=s(this,e,t,r);break;case"base64":f=u(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":f=l(this,e,t,r);break;default:throw Error("Unknown encoding")}return f},n.prototype.toString=function(e,t,r){var n=this;if(e=((e||"utf8")+"").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=n.length,r===t)return"";var i;switch(e){case"hex":i=d(n,t,r);break;case"utf8":case"utf-8":i=p(n,t,r);break;case"ascii":i=f(n,t,r);break;case"binary":i=h(n,t,r);break;case"base64":i=c(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=v(n,t,r);break;default:throw Error("Unknown encoding")}return i},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.copy=function(e,t,r,n){var i=this;if(r||(r=0),n||0===n||(n=this.length),t||(t=0),n!==r&&0!==e.length&&0!==i.length){W(n>=r,"sourceEnd < sourceStart"),W(t>=0&&e.length>t,"targetStart out of bounds"),W(r>=0&&i.length>r,"sourceStart out of bounds"),W(n>=0&&i.length>=n,"sourceEnd out of bounds"),n>this.length&&(n=this.length),n-r>e.length-t&&(n=e.length-t+r);for(var o=0;n-r>o;o++)e[o+t]=this[o+r]}},n.prototype.slice=function(e,t){var r=this.length;if(e=B(e,r,0),t=B(t,r,r),n._useTypedArrays)return k(this.subarray(e,t));for(var i=t-e,o=new n(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+e];return o},n.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},n.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},n.prototype.readUInt8=function(e,t){return t||(W(void 0!==e&&null!==e,"missing offset"),W(this.length>e,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},n.prototype.readUInt16LE=function(e,t){return g(this,e,!0,t)},n.prototype.readUInt16BE=function(e,t){return g(this,e,!1,t)},n.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},n.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},n.prototype.readInt8=function(e,t){if(t||(W(void 0!==e&&null!==e,"missing offset"),W(this.length>e,"Trying to read beyond buffer length")),!(e>=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},n.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},n.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},n.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},n.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},n.prototype.readFloatLE=function(e,t){return w(this,e,!0,t)},n.prototype.readFloatBE=function(e,t){return w(this,e,!1,t)},n.prototype.readDoubleLE=function(e,t){return E(this,e,!0,t)},n.prototype.readDoubleBE=function(e,t){return E(this,e,!1,t)},n.prototype.writeUInt8=function(e,t,r){r||(W(void 0!==e&&null!==e,"missing value"),W(void 0!==t&&null!==t,"missing offset"),W(this.length>t,"trying to write beyond buffer length"),q(e,255)),t>=this.length||(this[t]=e)},n.prototype.writeUInt16LE=function(e,t,r){x(this,e,t,!0,r)},n.prototype.writeUInt16BE=function(e,t,r){x(this,e,t,!1,r)},n.prototype.writeUInt32LE=function(e,t,r){S(this,e,t,!0,r)},n.prototype.writeUInt32BE=function(e,t,r){S(this,e,t,!1,r)},n.prototype.writeInt8=function(e,t,r){r||(W(void 0!==e&&null!==e,"missing value"),W(void 0!==t&&null!==t,"missing offset"),W(this.length>t,"Trying to write beyond buffer length"),V(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},n.prototype.writeInt16LE=function(e,t,r){j(this,e,t,!0,r)},n.prototype.writeInt16BE=function(e,t,r){j(this,e,t,!1,r)},n.prototype.writeInt32LE=function(e,t,r){A(this,e,t,!0,r)},n.prototype.writeInt32BE=function(e,t,r){A(this,e,t,!1,r)},n.prototype.writeFloatLE=function(e,t,r){I(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){I(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){L(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){L(this,e,t,!1,r)},n.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),W("number"==typeof e&&!isNaN(e),"value is not a number"),W(r>=t,"end < start"),r!==t&&0!==this.length){W(t>=0&&this.length>t,"start out of bounds"),W(r>=0&&this.length>=r,"end out of bounds");for(var n=t;r>n;n++)this[n]=e}},n.prototype.inspect=function(){for(var e=[],t=this.length,n=0;t>n;n++)if(e[n]=O(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},n.prototype.toArrayBuffer=function(){if("function"==typeof Uint8Array){if(n._useTypedArrays)return new n(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var K=n.prototype},{"base64-js":2,ieee754:3}],2:[function(e,t){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){"use strict";function e(e){var t=e.charCodeAt(0);return t===a?62:t===s?63:u>t?-1:u+10>t?t-u+26+26:c+26>t?t-c:l+26>t?t-l+26:void 0}function n(t){function r(e){l[p++]=e}var n,i,a,s,u,l;if(t.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var c=t.length;u="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,l=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var p=0;for(n=0,i=0;a>n;n+=4,i+=3)s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===u?(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&s)):1===u&&(s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(255&s>>8),r(255&s)),l}function i(e){function t(e){return r.charAt(e)}function n(e){return t(63&e>>18)+t(63&e>>12)+t(63&e>>6)+t(63&e)}var i,o,a,s=e.length%3,u="";for(i=0,a=e.length-s;a>i;i+=3)o=(e[i]<<16)+(e[i+1]<<8)+e[i+2],u+=n(o);switch(s){case 1:o=e[e.length-1],u+=t(o>>2),u+=t(63&o<<4),u+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],u+=t(o>>10),u+=t(63&o>>4),u+=t(63&o<<2),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array;"0".charCodeAt(0);var a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),l="a".charCodeAt(0),c="A".charCodeAt(0);t.exports.toByteArray=n,t.exports.fromByteArray=i})()},{}],3:[function(e,t,r){r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,p=r?i-1:0,f=r?-1:1,h=e[t+p];for(p+=f,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,v=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),1>t*(u=Math.pow(2,-a))&&(a--,u*=2),t+=a+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*u-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=d,a/=256,l-=8);e[r+h-d]|=128*v}},{}],4:[function(e,t){(function(r){"use strict";function n(e,t){return e[0]-t[0]}function i(){var e,t=this.stride,r=Array(t.length);for(e=0;r.length>e;++e)r[e]=[Math.abs(t[e]),e];r.sort(n);var i=Array(r.length);for(e=0;i.length>e;++e)i[e]=r[e][1];return i}function o(e,t){var r=["View",t,"d",e].join(""),n="generic"===e;if(0===t){var o=["function ",r,"(a,d) {this.data = a;this.offset = d};var proto=",r,".prototype;proto.dtype='",e,"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=proto.pick=function ",r,"_copy() {return new ",r,"(this.data,this.offset)};proto.get=function ",r,"_get(){return ",n?"this.data.get(this.offset)":"this.data[this.offset]","};proto.set=function ",r,"_set(v){return ",n?"this.data.get(this.offset)":"this.data[this.offset]","=v};return function construct_",r,"(a,b,c,d){return new ",r,"(a,d)}"].join(""),a=Function(o);return a()}var o=["'use strict'"],s=u(t),p=s.map(function(e){return"i"+e}),f="this.offset+"+s.map(function(e){return["this._stride",e,"*i",e].join("")}).join("+");o.push(["function ",r,"(a,",s.map(function(e){return"b"+e}).join(","),",",s.map(function(e){return"c"+e}).join(","),",d){this.data=a"].join(""));for(var h=0;t>h;++h)o.push(["this._shape",h,"=b",h,"|0"].join(""));for(var h=0;t>h;++h)o.push(["this._stride",h,"=c",h,"|0"].join(""));o.push("this.offset=d|0}"),o.push(["var proto=",r,".prototype"].join("")),o.push(["proto.dtype='",e,"'"].join("")),o.push("proto.dimension="+t);var d=["VStride",t,"d",e].join(""),v=["VShape",t,"d",e].join(""),g={stride:d,shape:v};for(var y in g){var m=g[y];o.push(["function ",m,"(v) {this._v=v} var aproto=",m,".prototype"].join("")),o.push(["aproto.length=",t].join(""));for(var b=[],h=0;t>h;++h)b.push(["this._v._",y,h].join(""));o.push(["aproto.toJSON=function ",m,"_toJSON(){return [",b.join(","),"]}"].join("")),o.push(["aproto.toString=function ",m,"_toString(){return [",b.join(","),"].join()}"].join(""));for(var h=0;t>h;++h)o.push(["Object.defineProperty(aproto,",h,",{get:function(){return this._v._",y,h,"},set:function(v){return this._v._",y,h,"=v|0},enumerable:true})"].join(""));for(var h=0;l.length>h;++h)l[h]in Array.prototype&&o.push(["aproto.",l[h],"=Array.prototype.",l[h]].join(""));o.push(["Object.defineProperty(proto,'",y,"',{get:function ",m,"_get(){return new ",m,"(this)},set: function ",m,"_set(v){"].join(""));for(var h=0;t>h;++h)o.push(["this._",y,h,"=v[",h,"]|0"].join(""));o.push("return v}})")}o.push(["Object.defineProperty(proto,'size',{get:function ",r,"_size(){return ",s.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 ",r,"_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 ",r,"_set(",p.join(","),",v){"].join("")),n?o.push(["return this.data.set(",f,",v)}"].join("")):o.push(["return this.data[",f,"]=v}"].join("")),o.push(["proto.get=function ",r,"_get(",p.join(","),"){"].join("")),n?o.push(["return this.data.get(",f,")}"].join("")):o.push(["return this.data[",f,"]}"].join("")),o.push(["proto.index=function ",r,"_index(",p.join(),"){return ",f,"}"].join("")),o.push(["proto.hi=function ",r,"_hi(",p.join(","),"){return new ",r,"(this.data,",s.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this._shape",e,":i",e,"|0"].join("")}).join(","),",",s.map(function(e){return"this._stride"+e}).join(","),",this.offset)}"].join(""));var w=s.map(function(e){return"a"+e+"=this._shape"+e}),E=s.map(function(e){return"c"+e+"=this._stride"+e});o.push(["proto.lo=function ",r,"_lo(",p.join(","),"){var b=this.offset,d=0,",w.join(","),",",E.join(",")].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'&&i",h,">=0){d=i",h,"|0;b+=c",h,"*d;a",h,"-=d}"].join(""));o.push(["return new ",r,"(this.data,",s.map(function(e){return"a"+e}).join(","),",",s.map(function(e){return"c"+e}).join(","),",b)}"].join("")),o.push(["proto.step=function ",r,"_step(",p.join(","),"){var ",s.map(function(e){return"a"+e+"=this._shape"+e}).join(","),",",s.map(function(e){return"b"+e+"=this._stride"+e}).join(","),",c=this.offset,d=0,ceil=Math.ceil"].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'){d=i",h,"|0;if(d<0){c+=b",h,"*(a",h,"-1);a",h,"=ceil(-a",h,"/d)}else{a",h,"=ceil(a",h,"/d)}b",h,"*=d}"].join(""));o.push(["return new ",r,"(this.data,",s.map(function(e){return"a"+e}).join(","),",",s.map(function(e){return"b"+e}).join(","),",c)}"].join(""));for(var x=Array(t),S=Array(t),h=0;t>h;++h)x[h]=["a[i",h,"|0]"].join(""),S[h]=["b[i",h,"|0]"].join("");o.push(["proto.transpose=function ",r,"_transpose(",p,"){var a=this.shape,b=this.stride;return new ",r,"(this.data,",x.join(","),",",S.join(","),",this.offset)}"].join("")),o.push(["proto.pick=function ",r,"_pick(",p,"){var a=[],b=[],c=this.offset"].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'&&i",h,">=0){c=(c+this._stride",h,"*i",h,")|0}else{a.push(this._shape",h,");b.push(this._stride",h,")}"].join(""));o.push("var ctor=CTOR_LIST[a.length];return ctor(this.data,a,b,c)}"),o.push(["return function construct_",r,"(data,shape,stride,offset){return new ",r,"(data,",s.map(function(e){return"shape["+e+"]"}).join(","),",",s.map(function(e){return"stride["+e+"]"}).join(","),",offset)}"].join(""));var a=Function("CTOR_LIST","ORDER",o.join("\n"));return a(c[e],i)}function a(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 Uint8ClampedArray?"uint8_clamped":r!==void 0&&e instanceof r?"buffer":e instanceof Array?"array":"generic"}function s(e,t,r,n){void 0===t&&(t=[e.length]);var i=t.length;if(void 0===r){r=Array(i);for(var s=i-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===n){n=0;for(var s=0;i>s;++s)0>r[s]&&(n-=(t[s]-1)*r[s])}for(var l=a(e),p=c[l];i>=p.length;)p.push(o(l,p.length));var f=p[i];return f(e,t,r,n)}var u=e("iota-array"),l=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=s}).call(this,e("buffer").Buffer)},{buffer:1,"iota-array":5}],5:[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},{}],iyMy7G:[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:4}],zeros:[function(e,t){t.exports=e("iyMy7G")},{}]},{},[]),require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;n.length>a;a++)i(n[a]);return i}({1:[function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(r=this._events[e],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,s=Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];r.apply(this,s)}else if(o(r)){for(i=arguments.length,s=Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];for(l=r.slice(),i=l.length,u=0;i>u;u++)l[u].apply(this,s)}return!0},r.prototype.addListener=function(e,t){var i;if(!n(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned){var i;i=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(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())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(r)){for(s=a;s-->0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?n(e._events[t])?1:e._events[t].length:0}},{}],"5kejYY":[function(e,t){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}],raf:[function(e,t){t.exports=e("5kejYY")},{}]},{},[]),require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;n.length>a;a++)i(n[a]);return i}({Ny7IUw:[function(e,t){function r(e,t,r){function l(e,t){return v[0]=e,c(v,t)}function c(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]/p[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,l,c=1/0,h=0,v=n.length,g=e.index.pages,y=0;g.length>y;y+=1)for(var m=0;g[y].length>m;m+=1){for(s=g[y][m].position,c=1/0,l=0;v>l;l+=1){h=0;for(var b=0;f>b;b+=1)a=u(s[b]-n[l][b]/p[b]),h=a>h?a:h;c=c>h?h:c}c>t+r&&d.push(s)}for(l=d.length;l--;)e.remove(d[l]);return d.length=0,o(null)}),void 0):l(n,o)}t=0|+t||1,r=s((0|+r)-t,t);var p=e.shape,f=p.length,h=o(n(f,-t),n(f,t)),d=[],v=[];return c}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},{"cell-range":3,dup:4,"map-async":5}],"continuous-observer":[function(e,t){t.exports=e("Ny7IUw")},{}],3:[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},{}],4:[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){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 l=0,c=a.length;c>l;l++){var p=a[l],f=e[p];n(t,o(p),r,f,p,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,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;n.length>a;a++)i(n[a]);return i}({1:[function(e,t,r){function n(e,t,r){if(!(this instanceof n))return new n(e,t,r);var i=typeof e;if("base64"===t&&"string"===i)for(e=_(e);0!==e.length%4;)e+="=";var o;if("number"===i)o=U(e);else if("string"===i)o=n.byteLength(e,t);else{if("object"!==i)throw Error("First argument needs to be a number, array or string.");o=U(e.length)}var a;n._useTypedArrays?a=k(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var s;if(n._useTypedArrays&&"function"==typeof Uint8Array&&e instanceof Uint8Array)a._set(e);else if(C(e))for(s=0;o>s;s++)a[s]=n.isBuffer(e)?e.readUInt8(s):e[s];else if("string"===i)a.write(e,0,t);else if("number"===i&&!n._useTypedArrays&&!r)for(s=0;o>s;s++)a[s]=0;return a}function i(e,t,r,i){r=Number(r)||0;var o=e.length-r;i?(i=Number(i),i>o&&(i=o)):i=o;var a=t.length;W(0===a%2,"Invalid hex string"),i>a/2&&(i=a/2);for(var s=0;i>s;s++){var u=parseInt(t.substr(2*s,2),16);W(!isNaN(u),"Invalid hex string"),e[r+s]=u}return n._charsWritten=2*s,s}function o(e,t,r,i){var o=n._charsWritten=T(P(t),e,r,i);return o}function a(e,t,r,i){var o=n._charsWritten=T(F(t),e,r,i);return o}function s(e,t,r,n){return a(e,t,r,n)}function u(e,t,r,i){var o=n._charsWritten=T(D(t),e,r,i);return o}function l(e,t,r,i){var o=n._charsWritten=T(M(t),e,r,i);return o}function c(e,t,r){return 0===t&&r===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(t,r))}function p(e,t,r){var n="",i="";r=Math.min(e.length,r);for(var o=t;r>o;o++)127>=e[o]?(n+=R(i)+String.fromCharCode(e[o]),i=""):i+="%"+e[o].toString(16);return n+R(i)}function f(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;i++)n+=String.fromCharCode(e[i]);return n}function h(e,t,r){return f(e,t,r)}function d(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=t;r>o;o++)i+=O(e[o]);return i}function v(e,t,r){for(var n=e.slice(t,r),i="",o=0;n.length>o;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function g(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+1,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(o=e[t],i>t+1&&(o|=e[t+1]<<8)):(o=e[t]<<8,i>t+1&&(o|=e[t+1])),o}}function y(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+3,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(i>t+2&&(o=e[t+2]<<16),i>t+1&&(o|=e[t+1]<<8),o|=e[t],i>t+3&&(o+=e[t+3]<<24>>>0)):(i>t+1&&(o=e[t+1]<<16),i>t+2&&(o|=e[t+2]<<8),i>t+3&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}}function m(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+1,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o=g(e,t,r,!0),a=32768&o;return a?-1*(65535-o+1):o}}function b(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+3,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o=y(e,t,r,!0),a=2147483648&o;return a?-1*(4294967295-o+1):o}}function w(e,t,r,n){return n||(W("boolean"==typeof r,"missing or invalid endian"),W(e.length>t+3,"Trying to read beyond buffer length")),H.read(e,t,r,23,4)}function E(e,t,r,n){return n||(W("boolean"==typeof r,"missing or invalid endian"),W(e.length>t+7,"Trying to read beyond buffer length")),H.read(e,t,r,52,8)}function x(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+1,"trying to write beyond buffer length"),q(t,65535));var o=e.length;if(!(r>=o))for(var a=0,s=Math.min(o-r,2);s>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function S(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"trying to write beyond buffer length"),q(t,4294967295));var o=e.length;if(!(r>=o))for(var a=0,s=Math.min(o-r,4);s>a;a++)e[r+a]=255&t>>>8*(n?a:3-a)}function j(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+1,"Trying to write beyond buffer length"),V(t,32767,-32768));var o=e.length;r>=o||(t>=0?x(e,t,r,n,i):x(e,65535+t+1,r,n,i))}function A(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"Trying to write beyond buffer length"),V(t,2147483647,-2147483648));var o=e.length;r>=o||(t>=0?S(e,t,r,n,i):S(e,4294967295+t+1,r,n,i))}function I(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"Trying to write beyond buffer length"),G(t,3.4028234663852886e38,-3.4028234663852886e38));var o=e.length;r>=o||H.write(e,t,r,n,23,4)}function L(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+7,"Trying to write beyond buffer length"),G(t,1.7976931348623157e308,-1.7976931348623157e308));var o=e.length;r>=o||H.write(e,t,r,n,52,8)}function _(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function k(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=K.get,e.set=K.set,e.write=K.write,e.toString=K.toString,e.toLocaleString=K.toString,e.toJSON=K.toJSON,e.copy=K.copy,e.slice=K.slice,e.readUInt8=K.readUInt8,e.readUInt16LE=K.readUInt16LE,e.readUInt16BE=K.readUInt16BE,e.readUInt32LE=K.readUInt32LE,e.readUInt32BE=K.readUInt32BE,e.readInt8=K.readInt8,e.readInt16LE=K.readInt16LE,e.readInt16BE=K.readInt16BE,e.readInt32LE=K.readInt32LE,e.readInt32BE=K.readInt32BE,e.readFloatLE=K.readFloatLE,e.readFloatBE=K.readFloatBE,e.readDoubleLE=K.readDoubleLE,e.readDoubleBE=K.readDoubleBE,e.writeUInt8=K.writeUInt8,e.writeUInt16LE=K.writeUInt16LE,e.writeUInt16BE=K.writeUInt16BE,e.writeUInt32LE=K.writeUInt32LE,e.writeUInt32BE=K.writeUInt32BE,e.writeInt8=K.writeInt8,e.writeInt16LE=K.writeInt16LE,e.writeInt16BE=K.writeInt16BE,e.writeInt32LE=K.writeInt32LE,e.writeInt32BE=K.writeInt32BE,e.writeFloatLE=K.writeFloatLE,e.writeFloatBE=K.writeFloatBE,e.writeDoubleLE=K.writeDoubleLE,e.writeDoubleBE=K.writeDoubleBE,e.fill=K.fill,e.inspect=K.inspect,e.toArrayBuffer=K.toArrayBuffer,e
}function B(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function U(e){return e=~~Math.ceil(+e),0>e?0:e}function N(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function C(e){return N(e)||n.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function O(e){return 16>e?"0"+e.toString(16):e.toString(16)}function P(e){for(var t=[],r=0;e.length>r;r++){var n=e.charCodeAt(r);if(127>=n)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),a=0;o.length>a;a++)t.push(parseInt(o[a],16))}}return t}function F(e){for(var t=[],r=0;e.length>r;r++)t.push(255&e.charCodeAt(r));return t}function M(e){for(var t,r,n,i=[],o=0;e.length>o;o++)t=e.charCodeAt(o),r=t>>8,n=t%256,i.push(n),i.push(r);return i}function D(e){return z.toByteArray(e)}function T(e,t,r,n){for(var i=0;n>i&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function R(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function q(e,t){W("number"==typeof e,"cannot write a non-number as a number"),W(e>=0,"specified a negative value for writing an unsigned value"),W(t>=e,"value is larger than maximum value for type"),W(Math.floor(e)===e,"value has a fractional component")}function V(e,t,r){W("number"==typeof e,"cannot write a non-number as a number"),W(t>=e,"value larger than maximum allowed value"),W(e>=r,"value smaller than minimum allowed value"),W(Math.floor(e)===e,"value has a fractional component")}function G(e,t,r){W("number"==typeof e,"cannot write a non-number as a number"),W(t>=e,"value larger than maximum allowed value"),W(e>=r,"value smaller than minimum allowed value")}function W(e,t){if(!e)throw Error(t||"Failed assertion")}var z=e("base64-js"),H=e("ieee754");r.Buffer=n,r.SlowBuffer=n,r.INSPECT_MAX_BYTES=50,n.poolSize=8192,n._useTypedArrays=function(){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer)return!1;try{var e=new Uint8Array(0);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),n.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},n.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=P(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=D(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw Error("Unknown encoding")}return r},n.concat=function(e,t){if(W(N(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new n(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;e.length>r;r++)t+=e[r].length;var i=new n(t),o=0;for(r=0;e.length>r;r++){var a=e[r];a.copy(i,o),o+=a.length}return i},n.prototype.write=function(e,t,r,n){if(isFinite(t))isFinite(r)||(n=r,r=void 0);else{var c=n;n=t,t=r,r=c}t=Number(t)||0;var p=this.length-t;r?(r=Number(r),r>p&&(r=p)):r=p,n=((n||"utf8")+"").toLowerCase();var f;switch(n){case"hex":f=i(this,e,t,r);break;case"utf8":case"utf-8":f=o(this,e,t,r);break;case"ascii":f=a(this,e,t,r);break;case"binary":f=s(this,e,t,r);break;case"base64":f=u(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":f=l(this,e,t,r);break;default:throw Error("Unknown encoding")}return f},n.prototype.toString=function(e,t,r){var n=this;if(e=((e||"utf8")+"").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=n.length,r===t)return"";var i;switch(e){case"hex":i=d(n,t,r);break;case"utf8":case"utf-8":i=p(n,t,r);break;case"ascii":i=f(n,t,r);break;case"binary":i=h(n,t,r);break;case"base64":i=c(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=v(n,t,r);break;default:throw Error("Unknown encoding")}return i},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.copy=function(e,t,r,n){var i=this;if(r||(r=0),n||0===n||(n=this.length),t||(t=0),n!==r&&0!==e.length&&0!==i.length){W(n>=r,"sourceEnd < sourceStart"),W(t>=0&&e.length>t,"targetStart out of bounds"),W(r>=0&&i.length>r,"sourceStart out of bounds"),W(n>=0&&i.length>=n,"sourceEnd out of bounds"),n>this.length&&(n=this.length),n-r>e.length-t&&(n=e.length-t+r);for(var o=0;n-r>o;o++)e[o+t]=this[o+r]}},n.prototype.slice=function(e,t){var r=this.length;if(e=B(e,r,0),t=B(t,r,r),n._useTypedArrays)return k(this.subarray(e,t));for(var i=t-e,o=new n(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+e];return o},n.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},n.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},n.prototype.readUInt8=function(e,t){return t||(W(void 0!==e&&null!==e,"missing offset"),W(this.length>e,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},n.prototype.readUInt16LE=function(e,t){return g(this,e,!0,t)},n.prototype.readUInt16BE=function(e,t){return g(this,e,!1,t)},n.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},n.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},n.prototype.readInt8=function(e,t){if(t||(W(void 0!==e&&null!==e,"missing offset"),W(this.length>e,"Trying to read beyond buffer length")),!(e>=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},n.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},n.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},n.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},n.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},n.prototype.readFloatLE=function(e,t){return w(this,e,!0,t)},n.prototype.readFloatBE=function(e,t){return w(this,e,!1,t)},n.prototype.readDoubleLE=function(e,t){return E(this,e,!0,t)},n.prototype.readDoubleBE=function(e,t){return E(this,e,!1,t)},n.prototype.writeUInt8=function(e,t,r){r||(W(void 0!==e&&null!==e,"missing value"),W(void 0!==t&&null!==t,"missing offset"),W(this.length>t,"trying to write beyond buffer length"),q(e,255)),t>=this.length||(this[t]=e)},n.prototype.writeUInt16LE=function(e,t,r){x(this,e,t,!0,r)},n.prototype.writeUInt16BE=function(e,t,r){x(this,e,t,!1,r)},n.prototype.writeUInt32LE=function(e,t,r){S(this,e,t,!0,r)},n.prototype.writeUInt32BE=function(e,t,r){S(this,e,t,!1,r)},n.prototype.writeInt8=function(e,t,r){r||(W(void 0!==e&&null!==e,"missing value"),W(void 0!==t&&null!==t,"missing offset"),W(this.length>t,"Trying to write beyond buffer length"),V(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},n.prototype.writeInt16LE=function(e,t,r){j(this,e,t,!0,r)},n.prototype.writeInt16BE=function(e,t,r){j(this,e,t,!1,r)},n.prototype.writeInt32LE=function(e,t,r){A(this,e,t,!0,r)},n.prototype.writeInt32BE=function(e,t,r){A(this,e,t,!1,r)},n.prototype.writeFloatLE=function(e,t,r){I(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){I(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){L(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){L(this,e,t,!1,r)},n.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),W("number"==typeof e&&!isNaN(e),"value is not a number"),W(r>=t,"end < start"),r!==t&&0!==this.length){W(t>=0&&this.length>t,"start out of bounds"),W(r>=0&&this.length>=r,"end out of bounds");for(var n=t;r>n;n++)this[n]=e}},n.prototype.inspect=function(){for(var e=[],t=this.length,n=0;t>n;n++)if(e[n]=O(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},n.prototype.toArrayBuffer=function(){if("function"==typeof Uint8Array){if(n._useTypedArrays)return new n(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var K=n.prototype},{"base64-js":2,ieee754:3}],2:[function(e,t){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){"use strict";function e(e){var t=e.charCodeAt(0);return t===a?62:t===s?63:u>t?-1:u+10>t?t-u+26+26:c+26>t?t-c:l+26>t?t-l+26:void 0}function n(t){function r(e){l[p++]=e}var n,i,a,s,u,l;if(t.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var c=t.length;u="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,l=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var p=0;for(n=0,i=0;a>n;n+=4,i+=3)s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===u?(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&s)):1===u&&(s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(255&s>>8),r(255&s)),l}function i(e){function t(e){return r.charAt(e)}function n(e){return t(63&e>>18)+t(63&e>>12)+t(63&e>>6)+t(63&e)}var i,o,a,s=e.length%3,u="";for(i=0,a=e.length-s;a>i;i+=3)o=(e[i]<<16)+(e[i+1]<<8)+e[i+2],u+=n(o);switch(s){case 1:o=e[e.length-1],u+=t(o>>2),u+=t(63&o<<4),u+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],u+=t(o>>10),u+=t(63&o>>4),u+=t(63&o<<2),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array;"0".charCodeAt(0);var a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),l="a".charCodeAt(0),c="A".charCodeAt(0);t.exports.toByteArray=n,t.exports.fromByteArray=i})()},{}],3:[function(e,t,r){r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,p=r?i-1:0,f=r?-1:1,h=e[t+p];for(p+=f,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,v=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),1>t*(u=Math.pow(2,-a))&&(a--,u*=2),t+=a+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*u-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=d,a/=256,l-=8);e[r+h-d]|=128*v}},{}],4:[function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(r=this._events[e],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,s=Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];r.apply(this,s)}else if(o(r)){for(i=arguments.length,s=Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];for(l=r.slice(),i=l.length,u=0;i>u;u++)l[u].apply(this,s)}return!0},r.prototype.addListener=function(e,t){var i;if(!n(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned){var i;i=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(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())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(r)){for(s=a;s-->0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?n(e._events[t])?1:e._events[t].length:0}},{}],"ndarray-continuous":[function(e,t){t.exports=e("IMCCB4")},{}],IMCCB4:[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"),l=e("map-async"),c=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,c=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 p=null;return l(i,function(e,t){c.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;p=o(a,i),n(null,p)}),p},n.prototype.range=function(e,t,n){var i=[],o=[],a=this.dims,s=[],u=[];n=n||r;for(var l=0;a>l;l+=1)i[l]=Math.floor(e[l]/this.shape[l]),o[l]=Math.ceil(t[l]/this.shape[l]),s[l]=-i[l]*this.shape[l]+e[l],u[l]=-i[l]*this.shape[l]+t[l]+1;var c=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,c=t),void 0)}),c},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,c(this.shape))}},{"cell-range":7,events:4,inherits:8,"map-async":9,"morton-page":13,"ndarray-group":14,zeros:22}],7:[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},{}],8:[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}},{}],9:[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 l=0,c=a.length;c>l;l++){var p=a[l],f=e[p];n(t,o(p),r,f,p,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},{}],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=[],l=[],c=i.nextPow2(n+1)>>1;c>0;c>>=1){for(var p=(1<<c)-1,f=0,h=0;32>h;h+=e*c)f|=p<<h;l.push(f>>>0),u.push(c*(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],"))&",l[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],"))&",l[h]].join(""))}for(var g=["x0"],v=1;e>v;++v)g.push(["(x",v,"<<",v,")"].join(""));return r.push("return "+g.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":11}],11:[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}},{}],12:[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},{}],13:[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),l=u?"."+n:"['"+n+"']",c=["'use strict'"],p=["MortonCache",e,"b",t].join("");c.push(["function ",p,"(sz){","this.pages=new Array(",1<<t,");","for(var i=0;i<",1<<t,";++i){this.pages[i]=[]};","}"].join("")),c.push(["var proto=",p,".prototype"].join("")),c.push("proto.bits="+t),c.push("proto.shift="+r),c.push("proto.key='"+n+"'"),c.push("proto.add=function(page){"),c.push(["this.pages[(interleave.apply(undefined, page",l,")>>",r,")&",(1<<t)-1,"].push(page)"].join("")),c.push("}");for(var f=[],s=0;e>s;++s)f.push(["(k[",s,"]===",a[s],")"].join(""));c.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",l,";","if(",f.join("&&"),"){ return p }","}","return null }"].join("")),c.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]",l,";","if(",f.join("&&"),"){pages[i]=pages[pages.length-1];pages.pop();break;}","}","}"].join("")),c.push("return "+p);var h=Function("interleave",c.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},{"bit-interleave":10,"is-property":12}],14:[function(e,t){function r(e,t){function r(){for(var e=0,r=0;s>r;r+=1)l[r]=i(arguments[r],p[r]),e+=o(arguments[r]/p[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,l)}function a(){for(var e=0,r=0;s>r;r+=1)u[r]=i(arguments[r],p[r]),e+=o(arguments[r]/p[r])*h[r];var n=t[e];return u[s]=arguments[s],n.set.apply(n,u)}for(var s=e.length,u=[],l=[],c=[],p=[],f=1,h=[],d=0;s>d;d+=1)p[d]=t[0].shape[d],c[d]=p[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(c,r,a);return v.children=t,v}var n=e("ndarray-proxy"),i=e("mod-loop"),o=Math.floor;t.exports=r},{"mod-loop":15,"ndarray-proxy":16}],15:[function(e,t){function r(e,t){return e>0?e%t:(e+=(~~(e/t)+1)*t,e%t)}t.exports=r},{}],16:[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),l=0,c="Proxy1DStore",p=0;s>p;++p)u[p]=a.log2(a.nextPow2(e[p])),l+=u[p];if(l>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,p=s-1;p>=0;--p)f[p]=1<<d,h[p]=0===d?"i&"+((1<<u[p])-1):["(i>>>",d,")&",(1<<u[p])-1].join(""),d+=u[p];var v=[];v.push(["function ",c,"(){};var proto=",c].join("")),v.push("proto.length="+(1<<l)),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 "+c);var g=Function("get_func","set_func",v.join("\n"));return o(g(t||r,i||n),e,f,0)}var o=e("ndarray"),a=e("bit-twiddle");t.exports=i},{"bit-twiddle":17,ndarray:18}],17:[function(e,t){t.exports=e(11)},{}],18:[function(e,t){(function(r){"use strict";function n(e,t){return e[0]-t[0]}function i(){var e,t=this.stride,r=Array(t.length);for(e=0;r.length>e;++e)r[e]=[Math.abs(t[e]),e];r.sort(n);var i=Array(r.length);for(e=0;i.length>e;++e)i[e]=r[e][1];return i}function o(e,t){var r=["View",t,"d",e].join(""),n="generic"===e;if(0===t){var o=["function ",r,"(a,d) {this.data = a;this.offset = d};var proto=",r,".prototype;proto.dtype='",e,"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=proto.pick=function ",r,"_copy() {return new ",r,"(this.data,this.offset)};proto.get=function ",r,"_get(){return ",n?"this.data.get(this.offset)":"this.data[this.offset]","};proto.set=function ",r,"_set(v){return ",n?"this.data.get(this.offset)":"this.data[this.offset]","=v};return function construct_",r,"(a,b,c,d){return new ",r,"(a,d)}"].join(""),a=Function(o);return a()}var o=["'use strict'"],s=u(t),p=s.map(function(e){return"i"+e}),f="this.offset+"+s.map(function(e){return["this._stride",e,"*i",e].join("")}).join("+");o.push(["function ",r,"(a,",s.map(function(e){return"b"+e}).join(","),",",s.map(function(e){return"c"+e}).join(","),",d){this.data=a"].join(""));for(var h=0;t>h;++h)o.push(["this._shape",h,"=b",h,"|0"].join(""));for(var h=0;t>h;++h)o.push(["this._stride",h,"=c",h,"|0"].join(""));o.push("this.offset=d|0}"),o.push(["var proto=",r,".prototype"].join("")),o.push(["proto.dtype='",e,"'"].join("")),o.push("proto.dimension="+t);var d=["VStride",t,"d",e].join(""),v=["VShape",t,"d",e].join(""),g={stride:d,shape:v};for(var y in g){var m=g[y];o.push(["function ",m,"(v) {this._v=v} var aproto=",m,".prototype"].join("")),o.push(["aproto.length=",t].join(""));for(var b=[],h=0;t>h;++h)b.push(["this._v._",y,h].join(""));o.push(["aproto.toJSON=function ",m,"_toJSON(){return [",b.join(","),"]}"].join("")),o.push(["aproto.toString=function ",m,"_toString(){return [",b.join(","),"].join()}"].join(""));for(var h=0;t>h;++h)o.push(["Object.defineProperty(aproto,",h,",{get:function(){return this._v._",y,h,"},set:function(v){return this._v._",y,h,"=v|0},enumerable:true})"].join(""));for(var h=0;l.length>h;++h)l[h]in Array.prototype&&o.push(["aproto.",l[h],"=Array.prototype.",l[h]].join(""));o.push(["Object.defineProperty(proto,'",y,"',{get:function ",m,"_get(){return new ",m,"(this)},set: function ",m,"_set(v){"].join(""));for(var h=0;t>h;++h)o.push(["this._",y,h,"=v[",h,"]|0"].join(""));o.push("return v}})")}o.push(["Object.defineProperty(proto,'size',{get:function ",r,"_size(){return ",s.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 ",r,"_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 ",r,"_set(",p.join(","),",v){"].join("")),n?o.push(["return this.data.set(",f,",v)}"].join("")):o.push(["return this.data[",f,"]=v}"].join("")),o.push(["proto.get=function ",r,"_get(",p.join(","),"){"].join("")),n?o.push(["return this.data.get(",f,")}"].join("")):o.push(["return this.data[",f,"]}"].join("")),o.push(["proto.index=function ",r,"_index(",p.join(),"){return ",f,"}"].join("")),o.push(["proto.hi=function ",r,"_hi(",p.join(","),"){return new ",r,"(this.data,",s.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this._shape",e,":i",e,"|0"].join("")}).join(","),",",s.map(function(e){return"this._stride"+e}).join(","),",this.offset)}"].join(""));var w=s.map(function(e){return"a"+e+"=this._shape"+e}),E=s.map(function(e){return"c"+e+"=this._stride"+e});o.push(["proto.lo=function ",r,"_lo(",p.join(","),"){var b=this.offset,d=0,",w.join(","),",",E.join(",")].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'&&i",h,">=0){d=i",h,"|0;b+=c",h,"*d;a",h,"-=d}"].join(""));o.push(["return new ",r,"(this.data,",s.map(function(e){return"a"+e}).join(","),",",s.map(function(e){return"c"+e}).join(","),",b)}"].join("")),o.push(["proto.step=function ",r,"_step(",p.join(","),"){var ",s.map(function(e){return"a"+e+"=this._shape"+e}).join(","),",",s.map(function(e){return"b"+e+"=this._stride"+e}).join(","),",c=this.offset,d=0,ceil=Math.ceil"].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'){d=i",h,"|0;if(d<0){c+=b",h,"*(a",h,"-1);a",h,"=ceil(-a",h,"/d)}else{a",h,"=ceil(a",h,"/d)}b",h,"*=d}"].join(""));o.push(["return new ",r,"(this.data,",s.map(function(e){return"a"+e}).join(","),",",s.map(function(e){return"b"+e}).join(","),",c)}"].join(""));for(var x=Array(t),S=Array(t),h=0;t>h;++h)x[h]=["a[i",h,"|0]"].join(""),S[h]=["b[i",h,"|0]"].join("");o.push(["proto.transpose=function ",r,"_transpose(",p,"){var a=this.shape,b=this.stride;return new ",r,"(this.data,",x.join(","),",",S.join(","),",this.offset)}"].join("")),o.push(["proto.pick=function ",r,"_pick(",p,"){var a=[],b=[],c=this.offset"].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'&&i",h,">=0){c=(c+this._stride",h,"*i",h,")|0}else{a.push(this._shape",h,");b.push(this._stride",h,")}"].join(""));o.push("var ctor=CTOR_LIST[a.length];return ctor(this.data,a,b,c)}"),o.push(["return function construct_",r,"(data,shape,stride,offset){return new ",r,"(data,",s.map(function(e){return"shape["+e+"]"}).join(","),",",s.map(function(e){return"stride["+e+"]"}).join(","),",offset)}"].join(""));var a=Function("CTOR_LIST","ORDER",o.join("\n"));return a(c[e],i)}function a(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 Uint8ClampedArray?"uint8_clamped":r!==void 0&&e instanceof r?"buffer":e instanceof Array?"array":"generic"}function s(e,t,r,n){void 0===t&&(t=[e.length]);var i=t.length;if(void 0===r){r=Array(i);for(var s=i-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===n){n=0;for(var s=0;i>s;++s)0>r[s]&&(n-=(t[s]-1)*r[s])}for(var l=a(e),p=c[l];i>=p.length;)p.push(o(l,p.length));var f=p[i];return f(e,t,r,n)}var u=e("iota-array"),l=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};
t.exports=s}).call(this,e("buffer").Buffer)},{buffer:1,"iota-array":19}],19:[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},{}],20:[function(e,t){t.exports=e(18)},{buffer:1,"iota-array":21}],21:[function(e,t){t.exports=e(19)},{}],22:[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:20}]},{},[]),require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;n.length>a;a++)i(n[a]);return i}({1:[function(e,t,r){function n(e,t,r){if(!(this instanceof n))return new n(e,t,r);var i=typeof e;if("base64"===t&&"string"===i)for(e=_(e);0!==e.length%4;)e+="=";var o;if("number"===i)o=U(e);else if("string"===i)o=n.byteLength(e,t);else{if("object"!==i)throw Error("First argument needs to be a number, array or string.");o=U(e.length)}var a;n._useTypedArrays?a=k(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var s;if(n._useTypedArrays&&"function"==typeof Uint8Array&&e instanceof Uint8Array)a._set(e);else if(C(e))for(s=0;o>s;s++)a[s]=n.isBuffer(e)?e.readUInt8(s):e[s];else if("string"===i)a.write(e,0,t);else if("number"===i&&!n._useTypedArrays&&!r)for(s=0;o>s;s++)a[s]=0;return a}function i(e,t,r,i){r=Number(r)||0;var o=e.length-r;i?(i=Number(i),i>o&&(i=o)):i=o;var a=t.length;W(0===a%2,"Invalid hex string"),i>a/2&&(i=a/2);for(var s=0;i>s;s++){var u=parseInt(t.substr(2*s,2),16);W(!isNaN(u),"Invalid hex string"),e[r+s]=u}return n._charsWritten=2*s,s}function o(e,t,r,i){var o=n._charsWritten=T(P(t),e,r,i);return o}function a(e,t,r,i){var o=n._charsWritten=T(F(t),e,r,i);return o}function s(e,t,r,n){return a(e,t,r,n)}function u(e,t,r,i){var o=n._charsWritten=T(D(t),e,r,i);return o}function l(e,t,r,i){var o=n._charsWritten=T(M(t),e,r,i);return o}function c(e,t,r){return 0===t&&r===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(t,r))}function p(e,t,r){var n="",i="";r=Math.min(e.length,r);for(var o=t;r>o;o++)127>=e[o]?(n+=R(i)+String.fromCharCode(e[o]),i=""):i+="%"+e[o].toString(16);return n+R(i)}function f(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;i++)n+=String.fromCharCode(e[i]);return n}function h(e,t,r){return f(e,t,r)}function d(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=t;r>o;o++)i+=O(e[o]);return i}function v(e,t,r){for(var n=e.slice(t,r),i="",o=0;n.length>o;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function g(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+1,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(o=e[t],i>t+1&&(o|=e[t+1]<<8)):(o=e[t]<<8,i>t+1&&(o|=e[t+1])),o}}function y(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+3,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(i>t+2&&(o=e[t+2]<<16),i>t+1&&(o|=e[t+1]<<8),o|=e[t],i>t+3&&(o+=e[t+3]<<24>>>0)):(i>t+1&&(o=e[t+1]<<16),i>t+2&&(o|=e[t+2]<<8),i>t+3&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}}function m(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+1,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o=g(e,t,r,!0),a=32768&o;return a?-1*(65535-o+1):o}}function b(e,t,r,n){n||(W("boolean"==typeof r,"missing or invalid endian"),W(void 0!==t&&null!==t,"missing offset"),W(e.length>t+3,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o=y(e,t,r,!0),a=2147483648&o;return a?-1*(4294967295-o+1):o}}function w(e,t,r,n){return n||(W("boolean"==typeof r,"missing or invalid endian"),W(e.length>t+3,"Trying to read beyond buffer length")),H.read(e,t,r,23,4)}function E(e,t,r,n){return n||(W("boolean"==typeof r,"missing or invalid endian"),W(e.length>t+7,"Trying to read beyond buffer length")),H.read(e,t,r,52,8)}function x(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+1,"trying to write beyond buffer length"),q(t,65535));var o=e.length;if(!(r>=o))for(var a=0,s=Math.min(o-r,2);s>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function S(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"trying to write beyond buffer length"),q(t,4294967295));var o=e.length;if(!(r>=o))for(var a=0,s=Math.min(o-r,4);s>a;a++)e[r+a]=255&t>>>8*(n?a:3-a)}function j(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+1,"Trying to write beyond buffer length"),V(t,32767,-32768));var o=e.length;r>=o||(t>=0?x(e,t,r,n,i):x(e,65535+t+1,r,n,i))}function A(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"Trying to write beyond buffer length"),V(t,2147483647,-2147483648));var o=e.length;r>=o||(t>=0?S(e,t,r,n,i):S(e,4294967295+t+1,r,n,i))}function I(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+3,"Trying to write beyond buffer length"),G(t,3.4028234663852886e38,-3.4028234663852886e38));var o=e.length;r>=o||H.write(e,t,r,n,23,4)}function L(e,t,r,n,i){i||(W(void 0!==t&&null!==t,"missing value"),W("boolean"==typeof n,"missing or invalid endian"),W(void 0!==r&&null!==r,"missing offset"),W(e.length>r+7,"Trying to write beyond buffer length"),G(t,1.7976931348623157e308,-1.7976931348623157e308));var o=e.length;r>=o||H.write(e,t,r,n,52,8)}function _(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function k(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=K.get,e.set=K.set,e.write=K.write,e.toString=K.toString,e.toLocaleString=K.toString,e.toJSON=K.toJSON,e.copy=K.copy,e.slice=K.slice,e.readUInt8=K.readUInt8,e.readUInt16LE=K.readUInt16LE,e.readUInt16BE=K.readUInt16BE,e.readUInt32LE=K.readUInt32LE,e.readUInt32BE=K.readUInt32BE,e.readInt8=K.readInt8,e.readInt16LE=K.readInt16LE,e.readInt16BE=K.readInt16BE,e.readInt32LE=K.readInt32LE,e.readInt32BE=K.readInt32BE,e.readFloatLE=K.readFloatLE,e.readFloatBE=K.readFloatBE,e.readDoubleLE=K.readDoubleLE,e.readDoubleBE=K.readDoubleBE,e.writeUInt8=K.writeUInt8,e.writeUInt16LE=K.writeUInt16LE,e.writeUInt16BE=K.writeUInt16BE,e.writeUInt32LE=K.writeUInt32LE,e.writeUInt32BE=K.writeUInt32BE,e.writeInt8=K.writeInt8,e.writeInt16LE=K.writeInt16LE,e.writeInt16BE=K.writeInt16BE,e.writeInt32LE=K.writeInt32LE,e.writeInt32BE=K.writeInt32BE,e.writeFloatLE=K.writeFloatLE,e.writeFloatBE=K.writeFloatBE,e.writeDoubleLE=K.writeDoubleLE,e.writeDoubleBE=K.writeDoubleBE,e.fill=K.fill,e.inspect=K.inspect,e.toArrayBuffer=K.toArrayBuffer,e}function B(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function U(e){return e=~~Math.ceil(+e),0>e?0:e}function N(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function C(e){return N(e)||n.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function O(e){return 16>e?"0"+e.toString(16):e.toString(16)}function P(e){for(var t=[],r=0;e.length>r;r++){var n=e.charCodeAt(r);if(127>=n)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),a=0;o.length>a;a++)t.push(parseInt(o[a],16))}}return t}function F(e){for(var t=[],r=0;e.length>r;r++)t.push(255&e.charCodeAt(r));return t}function M(e){for(var t,r,n,i=[],o=0;e.length>o;o++)t=e.charCodeAt(o),r=t>>8,n=t%256,i.push(n),i.push(r);return i}function D(e){return z.toByteArray(e)}function T(e,t,r,n){for(var i=0;n>i&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function R(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function q(e,t){W("number"==typeof e,"cannot write a non-number as a number"),W(e>=0,"specified a negative value for writing an unsigned value"),W(t>=e,"value is larger than maximum value for type"),W(Math.floor(e)===e,"value has a fractional component")}function V(e,t,r){W("number"==typeof e,"cannot write a non-number as a number"),W(t>=e,"value larger than maximum allowed value"),W(e>=r,"value smaller than minimum allowed value"),W(Math.floor(e)===e,"value has a fractional component")}function G(e,t,r){W("number"==typeof e,"cannot write a non-number as a number"),W(t>=e,"value larger than maximum allowed value"),W(e>=r,"value smaller than minimum allowed value")}function W(e,t){if(!e)throw Error(t||"Failed assertion")}var z=e("base64-js"),H=e("ieee754");r.Buffer=n,r.SlowBuffer=n,r.INSPECT_MAX_BYTES=50,n.poolSize=8192,n._useTypedArrays=function(){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer)return!1;try{var e=new Uint8Array(0);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),n.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},n.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=P(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=D(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw Error("Unknown encoding")}return r},n.concat=function(e,t){if(W(N(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new n(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;e.length>r;r++)t+=e[r].length;var i=new n(t),o=0;for(r=0;e.length>r;r++){var a=e[r];a.copy(i,o),o+=a.length}return i},n.prototype.write=function(e,t,r,n){if(isFinite(t))isFinite(r)||(n=r,r=void 0);else{var c=n;n=t,t=r,r=c}t=Number(t)||0;var p=this.length-t;r?(r=Number(r),r>p&&(r=p)):r=p,n=((n||"utf8")+"").toLowerCase();var f;switch(n){case"hex":f=i(this,e,t,r);break;case"utf8":case"utf-8":f=o(this,e,t,r);break;case"ascii":f=a(this,e,t,r);break;case"binary":f=s(this,e,t,r);break;case"base64":f=u(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":f=l(this,e,t,r);break;default:throw Error("Unknown encoding")}return f},n.prototype.toString=function(e,t,r){var n=this;if(e=((e||"utf8")+"").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=n.length,r===t)return"";var i;switch(e){case"hex":i=d(n,t,r);break;case"utf8":case"utf-8":i=p(n,t,r);break;case"ascii":i=f(n,t,r);break;case"binary":i=h(n,t,r);break;case"base64":i=c(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=v(n,t,r);break;default:throw Error("Unknown encoding")}return i},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.copy=function(e,t,r,n){var i=this;if(r||(r=0),n||0===n||(n=this.length),t||(t=0),n!==r&&0!==e.length&&0!==i.length){W(n>=r,"sourceEnd < sourceStart"),W(t>=0&&e.length>t,"targetStart out of bounds"),W(r>=0&&i.length>r,"sourceStart out of bounds"),W(n>=0&&i.length>=n,"sourceEnd out of bounds"),n>this.length&&(n=this.length),n-r>e.length-t&&(n=e.length-t+r);for(var o=0;n-r>o;o++)e[o+t]=this[o+r]}},n.prototype.slice=function(e,t){var r=this.length;if(e=B(e,r,0),t=B(t,r,r),n._useTypedArrays)return k(this.subarray(e,t));for(var i=t-e,o=new n(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+e];return o},n.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},n.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},n.prototype.readUInt8=function(e,t){return t||(W(void 0!==e&&null!==e,"missing offset"),W(this.length>e,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},n.prototype.readUInt16LE=function(e,t){return g(this,e,!0,t)},n.prototype.readUInt16BE=function(e,t){return g(this,e,!1,t)},n.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},n.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},n.prototype.readInt8=function(e,t){if(t||(W(void 0!==e&&null!==e,"missing offset"),W(this.length>e,"Trying to read beyond buffer length")),!(e>=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},n.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},n.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},n.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},n.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},n.prototype.readFloatLE=function(e,t){return w(this,e,!0,t)},n.prototype.readFloatBE=function(e,t){return w(this,e,!1,t)},n.prototype.readDoubleLE=function(e,t){return E(this,e,!0,t)},n.prototype.readDoubleBE=function(e,t){return E(this,e,!1,t)},n.prototype.writeUInt8=function(e,t,r){r||(W(void 0!==e&&null!==e,"missing value"),W(void 0!==t&&null!==t,"missing offset"),W(this.length>t,"trying to write beyond buffer length"),q(e,255)),t>=this.length||(this[t]=e)},n.prototype.writeUInt16LE=function(e,t,r){x(this,e,t,!0,r)},n.prototype.writeUInt16BE=function(e,t,r){x(this,e,t,!1,r)},n.prototype.writeUInt32LE=function(e,t,r){S(this,e,t,!0,r)},n.prototype.writeUInt32BE=function(e,t,r){S(this,e,t,!1,r)},n.prototype.writeInt8=function(e,t,r){r||(W(void 0!==e&&null!==e,"missing value"),W(void 0!==t&&null!==t,"missing offset"),W(this.length>t,"Trying to write beyond buffer length"),V(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},n.prototype.writeInt16LE=function(e,t,r){j(this,e,t,!0,r)},n.prototype.writeInt16BE=function(e,t,r){j(this,e,t,!1,r)},n.prototype.writeInt32LE=function(e,t,r){A(this,e,t,!0,r)},n.prototype.writeInt32BE=function(e,t,r){A(this,e,t,!1,r)},n.prototype.writeFloatLE=function(e,t,r){I(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){I(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){L(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){L(this,e,t,!1,r)},n.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),W("number"==typeof e&&!isNaN(e),"value is not a number"),W(r>=t,"end < start"),r!==t&&0!==this.length){W(t>=0&&this.length>t,"start out of bounds"),W(r>=0&&this.length>=r,"end out of bounds");for(var n=t;r>n;n++)this[n]=e}},n.prototype.inspect=function(){for(var e=[],t=this.length,n=0;t>n;n++)if(e[n]=O(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},n.prototype.toArrayBuffer=function(){if("function"==typeof Uint8Array){if(n._useTypedArrays)return new n(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var K=n.prototype},{"base64-js":2,ieee754:3}],2:[function(e,t){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){"use strict";function e(e){var t=e.charCodeAt(0);return t===a?62:t===s?63:u>t?-1:u+10>t?t-u+26+26:c+26>t?t-c:l+26>t?t-l+26:void 0}function n(t){function r(e){l[p++]=e}var n,i,a,s,u,l;if(t.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var c=t.length;u="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,l=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var p=0;for(n=0,i=0;a>n;n+=4,i+=3)s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===u?(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&s)):1===u&&(s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(255&s>>8),r(255&s)),l}function i(e){function t(e){return r.charAt(e)}function n(e){return t(63&e>>18)+t(63&e>>12)+t(63&e>>6)+t(63&e)}var i,o,a,s=e.length%3,u="";for(i=0,a=e.length-s;a>i;i+=3)o=(e[i]<<16)+(e[i+1]<<8)+e[i+2],u+=n(o);switch(s){case 1:o=e[e.length-1],u+=t(o>>2),u+=t(63&o<<4),u+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],u+=t(o>>10),u+=t(63&o>>4),u+=t(63&o<<2),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array;"0".charCodeAt(0);var a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),l="a".charCodeAt(0),c="A".charCodeAt(0);t.exports.toByteArray=n,t.exports.fromByteArray=i})()},{}],3:[function(e,t,r){r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,p=r?i-1:0,f=r?-1:1,h=e[t+p];for(p+=f,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,v=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),1>t*(u=Math.pow(2,-a))&&(a--,u*=2),t+=a+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*u-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=d,a/=256,l-=8);e[r+h-d]|=128*v}},{}],"cave-automata-2d":[function(e,t){t.exports=e("DjO9f+")},{}],"DjO9f+":[function(e,t){function r(e,t){function r(t){u=n,l=i,c=v,p=d,t=t||1;for(var r=0;t>r;r+=1)r%2?y(e,f):y(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,g="fill"in t?t.fill:!0,y=s[v?"border":"vanilla"];return g&&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,l=null,c=null,p=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>=p?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>=p||c>h[0]||h[0]>u-c-3||c>h[1]||h[1]>l-c-3?1:0},{useIndex:!0})},{moore:6,"ndarray-fill":7,"ndarray-stencil":25,zeros:28}],6:[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},{}],7:[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:8}],8:[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":9,"cwise-parser":13}],9:[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":11}],10:[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=[],l=[],c=0,p=0;for(n=0;o>n;++n)l.push(["i",n,"=0"].join(""));for(i=0;a>i;++i)for(n=0;o>n;++n)p=c,c=e[n],0===n?l.push(["d",i,"s",n,"=t",i,"[",c,"]"].join("")):l.push(["d",i,"s",n,"=(t",i,"[",c,"]-s",p,"*t",i,"[",p,"])"].join(""));for(u.push("var "+l.join(",")),n=o-1;n>=0;--n)c=e[n],u.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(u.push(r),n=0;o>n;++n){for(p=c,c=e[n],i=0;a>i;++i)u.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&u.push(["index[",p,"]-=s",p].join("")),u.push(["++index[",c,"]"].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,l=[],c=0;a>c;++c)l.push(["var offset",c,"=p",c].join(""));for(var c=e;o>c;++c)l.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(var c=0;a>c;++c){for(var p=["offset"+c],f=e;o>f;++f)p.push(["j",f,"*t",c,"[",t[f],"]"].join(""));l.push(["p",c,"=(",p.join("+"),")"].join(""))}l.push(r(t,n,i));for(var c=e;o>c;++c)l.push("}");return l.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 l=t.arrayArgs.indexOf(a);1===s.count?"generic"===r[l]?s.lvalue?(i.push(["var l",l,"=a",l,".get(p",l,")"].join("")),n=n.replace(u,"l"+l),o.push(["a",l,".set(p",l,",l",l,")"].join(""))):n=n.replace(u,["a",l,".get(p",l,")"].join("")):n=n.replace(u,["a",l,"[p",l,"]"].join("")):"generic"===r[l]?(i.push(["var l",l,"=a",l,".get(p",l,")"].join("")),n=n.replace(u,"l"+l),s.lvalue&&o.push(["a",l,".set(p",l,",l",l,")"].join(""))):(i.push(["var l",l,"=a",l,"[p",l,"]"].join("")),n=n.replace(u,"l"+l),s.lvalue&&o.push(["a",l,"[p",l,"]=l",l].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,l=Array(e.arrayArgs.length),c=Array(e.arrayArgs.length),p=["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)p.push("a"+v),p.push("t"+v),p.push("p"+v),c[v]=t[2*v],l[v]=t[2*v+1];for(var v=0;e.scalarArgs.length>v;++v)p.push("Y"+v);if(e.shapeArgs.length>0&&h.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var g=Array(s),v=0;s>v;++v)g[v]="0";h.push(["index=[",g.join(","),"]"].join(""))}var y=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));h=h.concat(y),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,c));var m=o(e.body,e,c),b=i(l);s>b?f.push(n(b,l[0],e,m)):f.push(r(l[0],e,m)),e.post.body.length>3&&f.push(o(e.post,e,c)),e.debug&&console.log("Generated cwise routine for ",t,":\n\n",f.join("\n"));var w=[e.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",b,a(c)].join(""),E=Function(["function ",w,"(",p.join(","),"){",f.join("\n"),"} return ",w].join(""));return E()}var u=e("uniq");t.exports=s},{uniq:12}],11:[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 l=e.arrayArgs[u];r.push(["t",l,"=array",l,".dtype,","r",l,"=array",l,".order"].join("")),o.push("t"+l),o.push("r"+l),a.push("t"+l),a.push("r"+l+".join()"),s.push("array"+l+".data"),s.push("array"+l+".stride"),s.push("array"+l+".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 c=Function("compile",t.join("\n"));return c(n.bind(void 0,e))}var n=e("./compile.js");t.exports=r},{"./compile.js":10}],12:[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},{}],13:[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=g+e.replace(/\_/g,"__");return x.push(t),t}function a(e){var t="this_"+e.replace(/\_/g,"__");return S.push(t),t}function c(e,t){for(var r=e.range[0],n=e.range[1],i=r+1;n>i;++i)w[i]="";w[r]=t}function p(e){return"'"+e.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'"}function f(e){return w.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}),g="_inline_"+l++ +"_",y=o(v),m=Array(y.length),b=0;y.length>b;++b)m[b]=new r([g,"arg",b,"_"].join(""),!1,!1);for(var w=Array(d.length),b=0,E=d.length;E>b;++b)w[b]=d.charAt(b);var x=[],S=[],j=1,A=2;(function I(e,r){if(e.parent=r,"MemberExpression"===e.type)e.computed?(I(e.object,e),I(e.property,e)):"ThisExpression"===e.object.type?c(e,a(e.property.name)):I(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=y.indexOf(n);if(o>=0){var s=m[o],u=h(e);u&j&&(s.lvalue=!0),u&A&&(s.rvalue=!0),++s.count,c(e,s.name)}else i(n)||c(e,t(n))}else if("Literal"===e.type)"string"==typeof e.value&&c(e,p(e.value));else{if("WithStatement"===e.type)throw Error("cwise-parser: with() statements not allowed");for(var l=Object.keys(e),f=0,d=l.length;d>f;++f)if("parent"!==l[f]){var v=e[l[f]];if(v)if(v instanceof Array)for(var g=0;v.length>g;++g)v[g]&&"string"==typeof v[g].type&&I(v[g],e);else"string"==typeof v.type&&I(v,e)}}}})(v.body[0].expression.callee.body,void 0),u(x),u(S);var L=new n(f(v.body[0].expression.callee.body),m,S,x);return L}var s=e("esprima"),u=e("uniq"),l=0;t.exports=a},{esprima:14,uniq:15}],14:[function(e,t,r){(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&&pr.NonAsciiIdentifierStart.test(e)}function l(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&pr.NonAsciiIdentifierPart.test(e)}function c(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function p(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&&p(e)?!0:c(e)}function d(){var e,t,r;for(t=!1,r=!1;yr>dr;)if(e=fr[dr],r)e=fr[dr++],s(e)&&(r=!1,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,gr=dr);else if(t)s(e)?("\r"===e&&"\n"===fr[dr+1]&&++dr,++vr,++dr,gr=dr,dr>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")):(e=fr[dr++],dr>=yr&&I({},cr.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>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")}else if(a(e))++dr;else{if(!s(e))break;++dr,"\r"===e&&"\n"===fr[dr]&&++dr,++vr,gr=dr}}function v(e){var t,r,n,o=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(yr>dr&&i(fr[dr])))return"";n=fr[dr++],o=16*o+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(o)}function g(){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(;yr>dr&&(e=fr[dr],l(e));)if("\\"===e){if(++dr,"u"!==fr[dr])return;if(++dr,n=dr,e=v("u")){if("\\"===e||!l(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:gr,range:[t,dr]}:h(r)?{type:ar.Keyword,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}:"null"===r?{type:ar.NullLiteral,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}:"true"===r||"false"===r?{type:ar.BooleanLiteral,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}:{type:ar.Identifier,value:r,lineNumber:vr,lineStart:gr,range:[t,dr]}
}}function y(){var e,t,r,i=dr,o=fr[dr];return";"===o||"{"===o||"}"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:gr,range:[i,dr]}):","===o||"("===o||")"===o?(++dr,{type:ar.Punctuator,value:o,lineNumber:vr,lineStart:gr,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:gr,range:[i,dr]}):"="===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"===",lineNumber:vr,lineStart:gr,range:[i,dr]}):"!"===o&&"="===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"!==",lineNumber:vr,lineStart:gr,range:[i,dr]}):">"===o&&">"===e&&">"===t?(dr+=3,{type:ar.Punctuator,value:">>>",lineNumber:vr,lineStart:gr,range:[i,dr]}):"<"===o&&"<"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:"<<=",lineNumber:vr,lineStart:gr,range:[i,dr]}):">"===o&&">"===e&&"="===t?(dr+=3,{type:ar.Punctuator,value:">>=",lineNumber:vr,lineStart:gr,range:[i,dr]}):"="===e&&"<>=!+-*%&|^/".indexOf(o)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:gr,range:[i,dr]}):o===e&&"+-<>&|".indexOf(o)>=0&&"+-<>&|".indexOf(e)>=0?(dr+=2,{type:ar.Punctuator,value:o+e,lineNumber:vr,lineStart:gr,range:[i,dr]}):"[]<>+-*%&|^!~?:=/".indexOf(o)>=0?{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:gr,range:[i,dr]}:void 0):{type:ar.Punctuator,value:fr[dr++],lineNumber:vr,lineStart:gr,range:[i,dr]})}function m(){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++];yr>dr&&(a=fr[dr],i(a));)e+=fr[dr++];return 2>=e.length&&I({},cr.UnexpectedToken,"ILLEGAL"),yr>dr&&(a=fr[dr],u(a)&&I({},cr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,16),lineNumber:vr,lineStart:gr,range:[r,dr]}}if(o(a)){for(e+=fr[dr++];yr>dr&&(a=fr[dr],o(a));)e+=fr[dr++];return yr>dr&&(a=fr[dr],(u(a)||n(a))&&I({},cr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:vr,lineStart:gr,range:[r,dr]}}n(a)&&I({},cr.UnexpectedToken,"ILLEGAL")}for(;yr>dr&&(a=fr[dr],n(a));)e+=fr[dr++]}if("."===a)for(e+=fr[dr++];yr>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++];yr>dr&&(a=fr[dr],n(a));)e+=fr[dr++];else a="character "+a,dr>=yr&&(a="<end>"),I({},cr.UnexpectedToken,"ILLEGAL");return yr>dr&&(a=fr[dr],u(a)&&I({},cr.UnexpectedToken,"ILLEGAL")),{type:ar.NumericLiteral,value:parseFloat(e),lineNumber:vr,lineStart:gr,range:[r,dr]}}function b(){var e,r,n,i,a,u,l="",c=!1;for(e=fr[dr],t("'"===e||'"'===e,"String literal must starts with a quote"),r=dr,++dr;yr>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":l+="\n";break;case"r":l+="\r";break;case"t":l+=" ";break;case"u":case"x":u=dr,a=v(n),a?l+=a:(dr=u,l+=n);break;case"b":l+="\b";break;case"f":l+="\f";break;case"v":l+=" ";break;default:o(n)?(i="01234567".indexOf(n),0!==i&&(c=!0),yr>dr&&o(fr[dr])&&(c=!0,i=8*i+"01234567".indexOf(fr[dr++]),"0123".indexOf(n)>=0&&yr>dr&&o(fr[dr])&&(i=8*i+"01234567".indexOf(fr[dr++]))),l+=String.fromCharCode(i)):l+=n}else{if(s(n))break;l+=n}}return""!==e&&I({},cr.UnexpectedToken,"ILLEGAL"),{type:ar.StringLiteral,value:l,octal:c,lineNumber:vr,lineStart:gr,range:[r,dr]}}function w(){var e,r,n,i,o,a,u,c=!1,p=!1;for(mr=null,d(),n=dr,r=fr[dr],t("/"===r,"Regular expression literal must start with a slash"),e=fr[dr++];yr>dr;)if(r=fr[dr++],e+=r,"\\"===r)r=fr[dr++],s(r)&&I({},cr.UnterminatedRegExp),e+=r;else if(c)"]"===r&&(c=!1);else{if("/"===r){p=!0;break}"["===r?c=!0:s(r)&&I({},cr.UnterminatedRegExp)}for(p||I({},cr.UnterminatedRegExp),i=e.substr(1,e.length-2),o="";yr>dr&&(r=fr[dr],l(r));)if(++dr,"\\"===r&&yr>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){I({},cr.InvalidRegExp)}return{literal:e,value:a,range:[n,dr]}}function E(e){return e.type===ar.Identifier||e.type===ar.Keyword||e.type===ar.BooleanLiteral||e.type===ar.NullLiteral}function x(){var e,t;return d(),dr>=yr?{type:ar.EOF,lineNumber:vr,lineStart:gr,range:[dr,dr]}:(t=y(),t!==void 0?t:(e=fr[dr],"'"===e||'"'===e?b():"."===e||n(e)?m():(t=g(),t!==void 0?t:(I({},cr.UnexpectedToken,"ILLEGAL"),void 0))))}function S(){var e;return mr?(dr=mr.range[1],vr=mr.lineNumber,gr=mr.lineStart,e=mr,mr=null,e):(mr=null,x())}function j(){var e,t,r;return null!==mr?mr:(e=dr,t=vr,r=gr,mr=x(),dr=e,vr=t,gr=r,mr)}function A(){var e,t,r,n;return e=dr,t=vr,r=gr,d(),n=vr!==t,dr=e,vr=t,gr=r,n}function I(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]-gr+1):(r=Error("Line "+vr+": "+i),r.index=dr,r.lineNumber=vr,r.column=dr-gr+1),r}function L(){try{I.apply(null,arguments)}catch(e){if(!wr.errors)throw e;wr.errors.push(e)}}function _(e){if(e.type===ar.EOF&&I(e,cr.UnexpectedEOS),e.type===ar.NumericLiteral&&I(e,cr.UnexpectedNumber),e.type===ar.StringLiteral&&I(e,cr.UnexpectedString),e.type===ar.Identifier&&I(e,cr.UnexpectedIdentifier),e.type===ar.Keyword){if(c(e.value))I(e,cr.UnexpectedReserved);else if(hr&&p(e.value))return L(e,cr.StrictReservedWord),void 0;I(e,cr.UnexpectedToken,e.value)}I(e,cr.UnexpectedToken,e.value)}function k(e){var t=S();(t.type!==ar.Punctuator||t.value!==e)&&_(t)}function B(e){var t=S();(t.type!==ar.Keyword||t.value!==e)&&_(t)}function U(e){var t=j();return t.type===ar.Punctuator&&t.value===e}function N(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 O(){var e,t;if(";"===fr[dr])return S(),void 0;if(t=vr,d(),vr===t){if(U(";"))return S(),void 0;e=j(),e.type===ar.EOF||U("}")||_(e)}}function P(e){return e.type===ur.Identifier||e.type===ur.MemberExpression}function F(){var e=[];for(k("[");!U("]");)U(",")?(S(),e.push(null)):(e.push(lt()),U("]")||k(","));return k("]"),{type:ur.ArrayExpression,elements:e}}function M(e,t){var r,n;return r=hr,n=Ft(),t&&hr&&f(e[0].name)&&L(t,cr.StrictParamName),hr=r,{type:ur.FunctionExpression,id:null,params:e,defaults:[],body:n,rest:null,generator:!1,expression:!1}}function D(){var e=S();return e.type===ar.StringLiteral||e.type===ar.NumericLiteral?(hr&&e.octal&&L(e,cr.StrictOctalLiteral),Xt(e)):{type:ur.Identifier,name:e.value}}function T(){var e,t,r,n;return e=j(),e.type===ar.Identifier?(r=D(),"get"!==e.value||U(":")?"set"!==e.value||U(":")?(k(":"),{type:ur.Property,key:r,value:lt(),kind:"init"}):(t=D(),k("("),e=j(),e.type!==ar.Identifier?(k(")"),L(e,cr.UnexpectedToken,e.value),{type:ur.Property,key:t,value:M([]),kind:"set"}):(n=[ht()],k(")"),{type:ur.Property,key:t,value:M(n,e),kind:"set"})):(t=D(),k("("),k(")"),{type:ur.Property,key:t,value:M([]),kind:"get"})):e.type!==ar.EOF&&e.type!==ar.Punctuator?(t=D(),k(":"),{type:ur.Property,key:t,value:lt(),kind:"init"}):(_(e),void 0)}function R(){var e,t,r,n=[],i={},o=String;for(k("{");!U("}");)e=T(),t=e.key.type===ur.Identifier?e.key.name:o(e.key.value),r="init"===e.kind?lr.Data:"get"===e.kind?lr.Get:lr.Set,Object.prototype.hasOwnProperty.call(i,t)?(i[t]===lr.Data?hr&&r===lr.Data?L({},cr.StrictDuplicateProperty):r!==lr.Data&&L({},cr.AccessorDataProperty):r===lr.Data?L({},cr.AccessorDataProperty):i[t]&r&&L({},cr.AccessorGetSet),i[t]|=r):i[t]=r,n.push(e),U("}")||k(",");return k("}"),{type:ur.ObjectExpression,properties:n}}function q(){var e;return k("("),e=ct(),k(")"),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&&L(e,cr.StrictOctalLiteral),Xt(S());if(t===ar.Keyword){if(N("this"))return S(),{type:ur.ThisExpression};if(N("function"))return Dt()}return t===ar.BooleanLiteral?(S(),e.value="true"===e.value,Xt(e)):t===ar.NullLiteral?(S(),e.value=null,Xt(e)):U("[")?F():U("{")?R():U("(")?q():U("/")||U("/=")?Xt(w()):_(S())}function G(){var e=[];if(k("("),!U(")"))for(;yr>dr&&(e.push(lt()),!U(")"));)k(",");return k(")"),e}function W(){var e=S();return E(e)||_(e),{type:ur.Identifier,name:e.value}}function z(){return k("."),W()}function H(){var e;return k("["),e=ct(),k("]"),e}function K(){var e;return B("new"),e={type:ur.NewExpression,callee:Y(),arguments:[]},U("(")&&(e.arguments=G()),e}function X(){var e;for(e=N("new")?K():V();U(".")||U("[")||U("(");)e=U("(")?{type:ur.CallExpression,callee:e,arguments:G()}:U("[")?{type:ur.MemberExpression,computed:!0,object:e,property:H()}:{type:ur.MemberExpression,computed:!1,object:e,property:z()};return e}function Y(){var e;for(e=N("new")?K():V();U(".")||U("[");)e=U("[")?{type:ur.MemberExpression,computed:!0,object:e,property:H()}:{type:ur.MemberExpression,computed:!1,object:e,property:z()};return e}function J(){var e,t=X();return e=j(),e.type!==ar.Punctuator?t:(!U("++")&&!U("--")||A()||(hr&&t.type===ur.Identifier&&f(t.name)&&L({},cr.StrictLHSPostfix),P(t)||L({},cr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:S().value,argument:t,prefix:!1}),t)}function Z(){var e,t;return e=j(),e.type!==ar.Punctuator&&e.type!==ar.Keyword?J():U("++")||U("--")?(e=S(),t=Z(),hr&&t.type===ur.Identifier&&f(t.name)&&L({},cr.StrictLHSPrefix),P(t)||L({},cr.InvalidLHSInAssignment),t={type:ur.UpdateExpression,operator:e.value,argument:t,prefix:!0}):U("+")||U("-")||U("~")||U("!")?t={type:ur.UnaryExpression,operator:S().value,argument:Z(),prefix:!0}:N("delete")||N("void")||N("typeof")?(t={type:ur.UnaryExpression,operator:S().value,argument:Z(),prefix:!0},hr&&"delete"===t.operator&&t.argument.type===ur.Identifier&&L({},cr.StrictDelete),t):J()}function $(){for(var e=Z();U("*")||U("/")||U("%");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:Z()};return e}function Q(){for(var e=$();U("+")||U("-");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:$()};return e}function et(){for(var e=Q();U("<<")||U(">>")||U(">>>");)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();U("<")||U(">")||U("<=")||U(">=")||t&&N("in")||N("instanceof");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:et()};return br.allowIn=t,e}function rt(){for(var e=tt();U("==")||U("!=")||U("===")||U("!==");)e={type:ur.BinaryExpression,operator:S().value,left:e,right:tt()};return e}function nt(){for(var e=rt();U("&");)S(),e={type:ur.BinaryExpression,operator:"&",left:e,right:rt()};return e}function it(){for(var e=nt();U("^");)S(),e={type:ur.BinaryExpression,operator:"^",left:e,right:nt()};return e}function ot(){for(var e=it();U("|");)S(),e={type:ur.BinaryExpression,operator:"|",left:e,right:it()};return e}function at(){for(var e=ot();U("&&");)S(),e={type:ur.LogicalExpression,operator:"&&",left:e,right:ot()};return e}function st(){for(var e=at();U("||");)S(),e={type:ur.LogicalExpression,operator:"||",left:e,right:at()};return e}function ut(){var e,t,r;return e=st(),U("?")&&(S(),t=br.allowIn,br.allowIn=!0,r=lt(),br.allowIn=t,k(":"),e={type:ur.ConditionalExpression,test:e,consequent:r,alternate:lt()}),e}function lt(){var e,t;return e=j(),t=ut(),C()&&(P(t)||L({},cr.InvalidLHSInAssignment),hr&&t.type===ur.Identifier&&f(t.name)&&L(e,cr.StrictLHSAssignment),t={type:ur.AssignmentExpression,operator:S().value,left:t,right:lt()}),t}function ct(){var e=lt();if(U(","))for(e={type:ur.SequenceExpression,expressions:[e]};yr>dr&&U(",");)S(),e.expressions.push(lt());return e}function pt(){for(var e,t=[];yr>dr&&!U("}")&&(e=Tt(),void 0!==e);)t.push(e);return t}function ft(){var e;return k("{"),e=pt(),k("}"),{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)&&L({},cr.StrictVarName),"const"===e?(k("="),r=lt()):U("=")&&(S(),r=lt()),{type:ur.VariableDeclarator,id:t,init:r}}function vt(e){var t=[];do{if(t.push(dt(e)),!U(","))break;S()}while(yr>dr);return t}function gt(){var e;return B("var"),e=vt(),O(),{type:ur.VariableDeclaration,declarations:e,kind:"var"}}function yt(e){var t;return B(e),t=vt(e),O(),{type:ur.VariableDeclaration,declarations:t,kind:e}}function mt(){return k(";"),{type:ur.EmptyStatement}}function bt(){var e=ct();return O(),{type:ur.ExpressionStatement,expression:e}}function wt(){var e,t,r;return B("if"),k("("),e=ct(),k(")"),t=Pt(),N("else")?(S(),r=Pt()):r=null,{type:ur.IfStatement,test:e,consequent:t,alternate:r}}function Et(){var e,t,r;return B("do"),r=br.inIteration,br.inIteration=!0,e=Pt(),br.inIteration=r,B("while"),k("("),t=ct(),k(")"),U(";")&&S(),{type:ur.DoWhileStatement,body:e,test:t}}function xt(){var e,t,r;return B("while"),k("("),e=ct(),k(")"),r=br.inIteration,br.inIteration=!0,t=Pt(),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,B("for"),k("("),U(";")?S():(N("var")||N("let")?(br.allowIn=!1,e=St(),br.allowIn=!0,1===e.declarations.length&&N("in")&&(S(),n=e,i=ct(),e=null)):(br.allowIn=!1,e=ct(),br.allowIn=!0,N("in")&&(P(e)||L({},cr.InvalidLHSInForIn),S(),n=e,i=ct(),e=null)),n===void 0&&k(";")),n===void 0&&(U(";")||(t=ct()),k(";"),U(")")||(r=ct())),k(")"),a=br.inIteration,br.inIteration=!0,o=Pt(),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 B("continue"),";"===fr[dr]?(S(),br.inIteration||I({},cr.IllegalContinue),{type:ur.ContinueStatement,label:null}):A()?(br.inIteration||I({},cr.IllegalContinue),{type:ur.ContinueStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||I({},cr.UnknownLabel,t.name)),O(),null!==t||br.inIteration||I({},cr.IllegalContinue),{type:ur.ContinueStatement,label:t})}function It(){var e,t=null;return B("break"),";"===fr[dr]?(S(),br.inIteration||br.inSwitch||I({},cr.IllegalBreak),{type:ur.BreakStatement,label:null}):A()?(br.inIteration||br.inSwitch||I({},cr.IllegalBreak),{type:ur.BreakStatement,label:null}):(e=j(),e.type===ar.Identifier&&(t=ht(),Object.prototype.hasOwnProperty.call(br.labelSet,t.name)||I({},cr.UnknownLabel,t.name)),O(),null!==t||br.inIteration||br.inSwitch||I({},cr.IllegalBreak),{type:ur.BreakStatement,label:t})}function Lt(){var e,t=null;return B("return"),br.inFunctionBody||L({},cr.IllegalReturn)," "===fr[dr]&&u(fr[dr+1])?(t=ct(),O(),{type:ur.ReturnStatement,argument:t}):A()?{type:ur.ReturnStatement,argument:null}:(U(";")||(e=j(),U("}")||e.type===ar.EOF||(t=ct())),O(),{type:ur.ReturnStatement,argument:t})}function _t(){var e,t;return hr&&L({},cr.StrictModeWith),B("with"),k("("),e=ct(),k(")"),t=Pt(),{type:ur.WithStatement,object:e,body:t}}function kt(){var e,t,r=[];for(N("default")?(S(),e=null):(B("case"),e=ct()),k(":");yr>dr&&!(U("}")||N("default")||N("case"))&&(t=Pt(),void 0!==t);)r.push(t);return{type:ur.SwitchCase,test:e,consequent:r}}function Bt(){var e,t,r,n,i;if(B("switch"),k("("),e=ct(),k(")"),k("{"),t=[],U("}"))return S(),{type:ur.SwitchStatement,discriminant:e,cases:t};for(n=br.inSwitch,br.inSwitch=!0,i=!1;yr>dr&&!U("}");)r=kt(),null===r.test&&(i&&I({},cr.MultipleDefaultsInSwitch),i=!0),t.push(r);return br.inSwitch=n,k("}"),{type:ur.SwitchStatement,discriminant:e,cases:t}}function Ut(){var e;return B("throw"),A()&&I({},cr.NewlineAfterThrow),e=ct(),O(),{type:ur.ThrowStatement,argument:e}}function Nt(){var e;return B("catch"),k("("),U(")")&&_(j()),e=ht(),hr&&f(e.name)&&L({},cr.StrictCatchVariable),k(")"),{type:ur.CatchClause,param:e,body:ft()}}function Ct(){var e,t=[],r=null;return B("try"),e=ft(),N("catch")&&t.push(Nt()),N("finally")&&(S(),r=ft()),0!==t.length||r||I({},cr.NoCatchOrFinally),{type:ur.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:r}}function Ot(){return B("debugger"),O(),{type:ur.DebuggerStatement}}function Pt(){var e,t,r=j();if(r.type===ar.EOF&&_(r),r.type===ar.Punctuator)switch(r.value){case";":return mt();case"{":return ft();case"(":return bt();default:}if(r.type===ar.Keyword)switch(r.value){case"break":return It();case"continue":return At();case"debugger":return Ot();case"do":return Et();case"for":return jt();case"function":return Mt();case"if":return wt();case"return":return Lt();case"switch":return Bt();case"throw":return Ut();case"try":return Ct();case"var":return gt();case"while":return xt();case"with":return _t();default:}return e=ct(),e.type===ur.Identifier&&U(":")?(S(),Object.prototype.hasOwnProperty.call(br.labelSet,e.name)&&I({},cr.Redeclaration,"Label",e.name),br.labelSet[e.name]=!0,t=Pt(),delete br.labelSet[e.name],{type:ur.LabeledStatement,label:e,body:t}):(O(),{type:ur.ExpressionStatement,expression:e})}function Ft(){var e,t,n,i,o,a,s,u,l=[];for(k("{");yr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Tt(),l.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&L(i,cr.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;yr>dr&&!U("}")&&(e=Tt(),void 0!==e);)l.push(e);return k("}"),br.labelSet=o,br.inIteration=a,br.inSwitch=s,br.inFunctionBody=u,{type:ur.BlockStatement,body:l}}function Mt(){var e,t,r,n,i,o,a,s,u,l=[];if(B("function"),n=j(),e=ht(),hr?f(n.value)&&L(n,cr.StrictFunctionName):f(n.value)?(o=n,a=cr.StrictFunctionName):p(n.value)&&(o=n,a=cr.StrictReservedWord),k("("),!U(")"))for(u={};yr>dr&&(n=j(),t=ht(),hr?(f(n.value)&&(i=n,a=cr.StrictParamName),Object.prototype.hasOwnProperty.call(u,n.value)&&(i=n,a=cr.StrictParamDupe)):o||(f(n.value)?(o=n,a=cr.StrictParamName):p(n.value)?(o=n,a=cr.StrictReservedWord):Object.prototype.hasOwnProperty.call(u,n.value)&&(o=n,a=cr.StrictParamDupe)),l.push(t),u[t.name]=!0,!U(")"));)k(",");return k(")"),s=hr,r=Ft(),hr&&o&&I(o,a),hr&&i&&L(i,a),hr=s,{type:ur.FunctionDeclaration,id:e,params:l,defaults:[],body:r,rest:null,generator:!1,expression:!1}}function Dt(){var e,t,r,n,i,o,a,s,u=null,l=[];if(B("function"),U("(")||(e=j(),u=ht(),hr?f(e.value)&&L(e,cr.StrictFunctionName):f(e.value)?(r=e,n=cr.StrictFunctionName):p(e.value)&&(r=e,n=cr.StrictReservedWord)),k("("),!U(")"))for(s={};yr>dr&&(e=j(),i=ht(),hr?(f(e.value)&&(t=e,n=cr.StrictParamName),Object.prototype.hasOwnProperty.call(s,e.value)&&(t=e,n=cr.StrictParamDupe)):r||(f(e.value)?(r=e,n=cr.StrictParamName):p(e.value)?(r=e,n=cr.StrictReservedWord):Object.prototype.hasOwnProperty.call(s,e.value)&&(r=e,n=cr.StrictParamDupe)),l.push(i),s[i.name]=!0,!U(")"));)k(",");return k(")"),a=hr,o=Ft(),hr&&r&&I(r,n),hr&&t&&L(t,n),hr=a,{type:ur.FunctionExpression,id:u,params:l,defaults:[],body:o,rest:null,generator:!1,expression:!1}}function Tt(){var e=j();if(e.type===ar.Keyword)switch(e.value){case"const":case"let":return yt(e.value);case"function":return Mt();default:return Pt()}return e.type!==ar.EOF?Pt():void 0}function Rt(){for(var e,t,n,i,o=[];yr>dr&&(t=j(),t.type===ar.StringLiteral)&&(e=Tt(),o.push(e),e.expression.type===ur.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(hr=!0,i&&L(i,cr.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(;yr>dr&&(e=Tt(),void 0!==e);)o.push(e);return o}function qt(){var e;return hr=!1,e={type:ur.Program,body:Rt()}}function Vt(e,r,n,i,o){t("number"==typeof n,"Comment must have valid position"),wr.comments.length>0&&wr.comments[wr.comments.length-1].range[1]>n||wr.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;yr>dr;)if(t=fr[dr],o)t=fr[dr++],s(t)?(r.end={line:vr,column:dr-gr-1},o=!1,Vt("Line",e,n,dr-1,r),"\r"===t&&"\n"===fr[dr]&&++dr,++vr,gr=dr,e=""):dr>=yr?(o=!1,e+=t,r.end={line:vr,column:yr-gr},Vt("Line",e,n,yr,r)):e+=t;else if(i)s(t)?("\r"===t&&"\n"===fr[dr+1]?(++dr,e+="\r\n"):e+=t,++vr,++dr,gr=dr,dr>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")):(t=fr[dr++],dr>=yr&&I({},cr.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-gr},Vt("Block",e,n,dr,r),e="")));else if("/"===t)if(t=fr[dr+1],"/"===t)r={start:{line:vr,column:dr-gr}},n=dr,dr+=2,o=!0,dr>=yr&&(r.end={line:vr,column:dr-gr},o=!1,Vt("Line",e,n,dr,r));else{if("*"!==t)break;n=dr,dr+=2,i=!0,r={start:{line:vr,column:dr-gr-2}},dr>=yr&&I({},cr.UnexpectedToken,"ILLEGAL")}else if(a(t))++dr;else{if(!s(t))break;++dr,"\r"===t&&"\n"===fr[dr]&&++dr,++vr,gr=dr}}function Wt(){var e,t,r,n=[];for(e=0;wr.comments.length>e;++e)t=wr.comments[e],r={type:t.type,value:t.value},wr.range&&(r.range=t.range),wr.loc&&(r.loc=t.loc),n.push(r);wr.comments=n}function zt(){var e,t,n,i,o;return d(),e=dr,t={start:{line:vr,column:dr-gr}},n=wr.advance(),t.end={line:vr,column:dr-gr},n.type!==ar.EOF&&(i=[n.range[0],n.range[1]],o=r(n.range[0],n.range[1]),wr.tokens.push({type:sr[n.type],value:o,range:i,loc:t})),n}function Ht(){var e,t,r,n;return d(),e=dr,t={start:{line:vr,column:dr-gr}},r=wr.scanRegExp(),t.end={line:vr,column:dr-gr},wr.tokens.length>0&&(n=wr.tokens[wr.tokens.length-1],n.range[0]===e&&"Punctuator"===n.type&&("/"===n.value||"/="===n.value)&&wr.tokens.pop()),wr.tokens.push({type:"RegularExpression",value:r.literal,range:[e,dr],loc:t}),r}function Kt(){var e,t,r,n=[];for(e=0;wr.tokens.length>e;++e)t=wr.tokens[e],r={type:t.type,value:t.value},wr.range&&(r.range=t.range),wr.loc&&(r.loc=t.loc),n.push(r);wr.tokens=n}function Xt(e){return{type:ur.Literal,value:e.value}}function Yt(e){return{type:ur.Literal,value:e.value,raw:r(e.range[0],e.range[1])}}function Jt(){var e={};return e.range=[dr,dr],e.loc={start:{line:vr,column:dr-gr},end:{line:vr,column:dr-gr}},e.end=function(){this.range[1]=dr,this.loc.end.line=vr,this.loc.end.column=dr-gr},e.applyGroup=function(e){wr.range&&(e.groupRange=[this.range[0],this.range[1]]),wr.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){wr.range&&(e.range=[this.range[0],this.range[1]]),wr.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 Zt(){var e,t;return d(),e=Jt(),k("("),t=ct(),k(")"),e.end(),e.applyGroup(t),t}function $t(){var e,t;for(d(),e=Jt(),t=N("new")?K():V();U(".")||U("[");)U("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:H()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:z()},e.end(),e.apply(t));return t}function Qt(){var e,t;for(d(),e=Jt(),t=N("new")?K():V();U(".")||U("[")||U("(");)U("(")?(t={type:ur.CallExpression,callee:t,arguments:G()},e.end(),e.apply(t)):U("[")?(t={type:ur.MemberExpression,computed:!0,object:t,property:H()},e.end(),e.apply(t)):(t={type:ur.MemberExpression,computed:!1,object:t,property:z()},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=Jt(),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;wr.comments&&(wr.skipComment=d,d=Gt),wr.raw&&(wr.createLiteral=Xt,Xt=Yt),(wr.range||wr.loc)&&(wr.parseGroupExpression=q,wr.parseLeftHandSideExpression=Y,wr.parseLeftHandSideExpressionAllowCall=X,q=Zt,Y=$t,X=Qt,e=tr(wr.range,wr.loc),wr.parseAdditiveExpression=Q,wr.parseAssignmentExpression=lt,wr.parseBitwiseANDExpression=nt,wr.parseBitwiseORExpression=ot,wr.parseBitwiseXORExpression=it,wr.parseBlock=ft,wr.parseFunctionSourceElements=Ft,wr.parseCatchClause=Nt,wr.parseComputedMember=H,wr.parseConditionalExpression=ut,wr.parseConstLetDeclaration=yt,wr.parseEqualityExpression=rt,wr.parseExpression=ct,wr.parseForVariableDeclaration=St,wr.parseFunctionDeclaration=Mt,wr.parseFunctionExpression=Dt,wr.parseLogicalANDExpression=at,wr.parseLogicalORExpression=st,wr.parseMultiplicativeExpression=$,wr.parseNewExpression=K,wr.parseNonComputedProperty=W,wr.parseObjectProperty=T,wr.parseObjectPropertyKey=D,wr.parsePostfixExpression=J,wr.parsePrimaryExpression=V,wr.parseProgram=qt,wr.parsePropertyFunction=M,wr.parseRelationalExpression=tt,wr.parseStatement=Pt,wr.parseShiftExpression=et,wr.parseSwitchCase=kt,wr.parseUnaryExpression=Z,wr.parseVariableDeclaration=dt,wr.parseVariableIdentifier=ht,Q=e(wr.parseAdditiveExpression),lt=e(wr.parseAssignmentExpression),nt=e(wr.parseBitwiseANDExpression),ot=e(wr.parseBitwiseORExpression),it=e(wr.parseBitwiseXORExpression),ft=e(wr.parseBlock),Ft=e(wr.parseFunctionSourceElements),Nt=e(wr.parseCatchClause),H=e(wr.parseComputedMember),ut=e(wr.parseConditionalExpression),yt=e(wr.parseConstLetDeclaration),rt=e(wr.parseEqualityExpression),ct=e(wr.parseExpression),St=e(wr.parseForVariableDeclaration),Mt=e(wr.parseFunctionDeclaration),Dt=e(wr.parseFunctionExpression),Y=e(Y),at=e(wr.parseLogicalANDExpression),st=e(wr.parseLogicalORExpression),$=e(wr.parseMultiplicativeExpression),K=e(wr.parseNewExpression),W=e(wr.parseNonComputedProperty),T=e(wr.parseObjectProperty),D=e(wr.parseObjectPropertyKey),J=e(wr.parsePostfixExpression),V=e(wr.parsePrimaryExpression),qt=e(wr.parseProgram),M=e(wr.parsePropertyFunction),tt=e(wr.parseRelationalExpression),Pt=e(wr.parseStatement),et=e(wr.parseShiftExpression),kt=e(wr.parseSwitchCase),Z=e(wr.parseUnaryExpression),dt=e(wr.parseVariableDeclaration),ht=e(wr.parseVariableIdentifier)),wr.tokens!==void 0&&(wr.advance=x,wr.scanRegExp=w,x=zt,w=Ht)}function nr(){"function"==typeof wr.skipComment&&(d=wr.skipComment),wr.raw&&(Xt=wr.createLiteral),(wr.range||wr.loc)&&(Q=wr.parseAdditiveExpression,lt=wr.parseAssignmentExpression,nt=wr.parseBitwiseANDExpression,ot=wr.parseBitwiseORExpression,it=wr.parseBitwiseXORExpression,ft=wr.parseBlock,Ft=wr.parseFunctionSourceElements,Nt=wr.parseCatchClause,H=wr.parseComputedMember,ut=wr.parseConditionalExpression,yt=wr.parseConstLetDeclaration,rt=wr.parseEqualityExpression,ct=wr.parseExpression,St=wr.parseForVariableDeclaration,Mt=wr.parseFunctionDeclaration,Dt=wr.parseFunctionExpression,q=wr.parseGroupExpression,Y=wr.parseLeftHandSideExpression,X=wr.parseLeftHandSideExpressionAllowCall,at=wr.parseLogicalANDExpression,st=wr.parseLogicalORExpression,$=wr.parseMultiplicativeExpression,K=wr.parseNewExpression,W=wr.parseNonComputedProperty,T=wr.parseObjectProperty,D=wr.parseObjectPropertyKey,V=wr.parsePrimaryExpression,J=wr.parsePostfixExpression,qt=wr.parseProgram,M=wr.parsePropertyFunction,tt=wr.parseRelationalExpression,Pt=wr.parseStatement,et=wr.parseShiftExpression,kt=wr.parseSwitchCase,Z=wr.parseUnaryExpression,dt=wr.parseVariableDeclaration,ht=wr.parseVariableIdentifier),"function"==typeof wr.scanRegExp&&(x=wr.advance,w=wr.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,gr=0,yr=fr.length,mr=null,br={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},wr={},t!==void 0&&(wr.range="boolean"==typeof t.range&&t.range,wr.loc="boolean"==typeof t.loc&&t.loc,wr.raw="boolean"==typeof t.raw&&t.raw,"boolean"==typeof t.tokens&&t.tokens&&(wr.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(wr.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(wr.errors=[])),yr>0&&fr[0]===void 0&&(e instanceof String&&(fr=e.valueOf()),fr[0]===void 0&&(fr=ir(e))),rr();try{r=qt(),wr.comments!==void 0&&(Wt(),r.comments=wr.comments),wr.tokens!==void 0&&(Kt(),r.tokens=wr.tokens),wr.errors!==void 0&&(r.errors=wr.errors),(wr.range||wr.loc)&&(r.body=er(r.body))}catch(i){throw i}finally{nr(),wr={}}return r}var ar,sr,ur,lr,cr,pr,fr,hr,dr,vr,gr,yr,mr,br,wr;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"},lr={Data:1,Get:2,Set:4},cr={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"},pr={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}()})},{}],15:[function(e,t){t.exports=e(12)},{}],16:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"cwise-compiler":17,"cwise-parser":21}],17:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{"./lib/thunk.js":19}],18:[function(e,t){t.exports=e(10)},{uniq:20}],19:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{"./compile.js":18}],20:[function(e,t){t.exports=e(12)},{}],21:[function(e,t){t.exports=e(13)},{esprima:22,uniq:23}],22:[function(e,t){t.exports=e(14)},{}],23:[function(e,t){t.exports=e(12)},{}],24:[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},{}],25:[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 l=0;a>l;++l)u.push(["var s",l,"=s[",l,"]|0"].join(""));u.push(["func(out.hi(",n(r,s(a)),").lo(",i(t,s(a)),")"].join(""));for(var l=0;e.length>l;++l)u.push([",inp.hi(",n(r,e[l]),").lo(",i(t,e[l]),")"].join(""));u.push(")");var c=Function("func","out","inp",u.join("\n"));return c.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),l=s(a),c=0;i>c;++c)for(var p=e[c],f=0;a>f;++f)u[f]=Math.min(u[f],p[f]),l[f]=Math.max(l[f],p[f]);var h=r(i,a,t,n);return o(e,u,l,h)}var s=e("dup"),u=e("cwise");t.exports=a},{cwise:16,dup:24}],26:[function(e,t){(function(r){"use strict";function n(e,t){return e[0]-t[0]}function i(){var e,t=this.stride,r=Array(t.length);for(e=0;r.length>e;++e)r[e]=[Math.abs(t[e]),e];r.sort(n);var i=Array(r.length);for(e=0;i.length>e;++e)i[e]=r[e][1];return i}function o(e,t){var r=["View",t,"d",e].join(""),n="generic"===e;if(0===t){var o=["function ",r,"(a,d) {this.data = a;this.offset = d};var proto=",r,".prototype;proto.dtype='",e,"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=proto.pick=function ",r,"_copy() {return new ",r,"(this.data,this.offset)};proto.get=function ",r,"_get(){return ",n?"this.data.get(this.offset)":"this.data[this.offset]","};proto.set=function ",r,"_set(v){return ",n?"this.data.get(this.offset)":"this.data[this.offset]","=v};return function construct_",r,"(a,b,c,d){return new ",r,"(a,d)}"].join(""),a=Function(o);return a()}var o=["'use strict'"],s=u(t),p=s.map(function(e){return"i"+e}),f="this.offset+"+s.map(function(e){return["this._stride",e,"*i",e].join("")}).join("+");o.push(["function ",r,"(a,",s.map(function(e){return"b"+e}).join(","),",",s.map(function(e){return"c"+e}).join(","),",d){this.data=a"].join(""));for(var h=0;t>h;++h)o.push(["this._shape",h,"=b",h,"|0"].join(""));for(var h=0;t>h;++h)o.push(["this._stride",h,"=c",h,"|0"].join(""));o.push("this.offset=d|0}"),o.push(["var proto=",r,".prototype"].join("")),o.push(["proto.dtype='",e,"'"].join("")),o.push("proto.dimension="+t);var d=["VStride",t,"d",e].join(""),v=["VShape",t,"d",e].join(""),g={stride:d,shape:v};for(var y in g){var m=g[y];o.push(["function ",m,"(v) {this._v=v} var aproto=",m,".prototype"].join("")),o.push(["aproto.length=",t].join(""));for(var b=[],h=0;t>h;++h)b.push(["this._v._",y,h].join(""));o.push(["aproto.toJSON=function ",m,"_toJSON(){return [",b.join(","),"]}"].join("")),o.push(["aproto.toString=function ",m,"_toString(){return [",b.join(","),"].join()}"].join(""));for(var h=0;t>h;++h)o.push(["Object.defineProperty(aproto,",h,",{get:function(){return this._v._",y,h,"},set:function(v){return this._v._",y,h,"=v|0},enumerable:true})"].join(""));for(var h=0;l.length>h;++h)l[h]in Array.prototype&&o.push(["aproto.",l[h],"=Array.prototype.",l[h]].join(""));o.push(["Object.defineProperty(proto,'",y,"',{get:function ",m,"_get(){return new ",m,"(this)},set: function ",m,"_set(v){"].join(""));for(var h=0;t>h;++h)o.push(["this._",y,h,"=v[",h,"]|0"].join(""));o.push("return v}})")}o.push(["Object.defineProperty(proto,'size',{get:function ",r,"_size(){return ",s.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 ",r,"_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 ",r,"_set(",p.join(","),",v){"].join("")),n?o.push(["return this.data.set(",f,",v)}"].join("")):o.push(["return this.data[",f,"]=v}"].join("")),o.push(["proto.get=function ",r,"_get(",p.join(","),"){"].join("")),n?o.push(["return this.data.get(",f,")}"].join("")):o.push(["return this.data[",f,"]}"].join("")),o.push(["proto.index=function ",r,"_index(",p.join(),"){return ",f,"}"].join("")),o.push(["proto.hi=function ",r,"_hi(",p.join(","),"){return new ",r,"(this.data,",s.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this._shape",e,":i",e,"|0"].join("")}).join(","),",",s.map(function(e){return"this._stride"+e}).join(","),",this.offset)}"].join(""));var w=s.map(function(e){return"a"+e+"=this._shape"+e}),E=s.map(function(e){return"c"+e+"=this._stride"+e});o.push(["proto.lo=function ",r,"_lo(",p.join(","),"){var b=this.offset,d=0,",w.join(","),",",E.join(",")].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'&&i",h,">=0){d=i",h,"|0;b+=c",h,"*d;a",h,"-=d}"].join(""));o.push(["return new ",r,"(this.data,",s.map(function(e){return"a"+e}).join(","),",",s.map(function(e){return"c"+e}).join(","),",b)}"].join("")),o.push(["proto.step=function ",r,"_step(",p.join(","),"){var ",s.map(function(e){return"a"+e+"=this._shape"+e}).join(","),",",s.map(function(e){return"b"+e+"=this._stride"+e}).join(","),",c=this.offset,d=0,ceil=Math.ceil"].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'){d=i",h,"|0;if(d<0){c+=b",h,"*(a",h,"-1);a",h,"=ceil(-a",h,"/d)}else{a",h,"=ceil(a",h,"/d)}b",h,"*=d}"].join(""));o.push(["return new ",r,"(this.data,",s.map(function(e){return"a"+e}).join(","),",",s.map(function(e){return"b"+e}).join(","),",c)}"].join(""));for(var x=Array(t),S=Array(t),h=0;t>h;++h)x[h]=["a[i",h,"|0]"].join(""),S[h]=["b[i",h,"|0]"].join("");o.push(["proto.transpose=function ",r,"_transpose(",p,"){var a=this.shape,b=this.stride;return new ",r,"(this.data,",x.join(","),",",S.join(","),",this.offset)}"].join("")),o.push(["proto.pick=function ",r,"_pick(",p,"){var a=[],b=[],c=this.offset"].join(""));for(var h=0;t>h;++h)o.push(["if(typeof i",h,"==='number'&&i",h,">=0){c=(c+this._stride",h,"*i",h,")|0}else{a.push(this._shape",h,");b.push(this._stride",h,")}"].join(""));o.push("var ctor=CTOR_LIST[a.length];return ctor(this.data,a,b,c)}"),o.push(["return function construct_",r,"(data,shape,stride,offset){return new ",r,"(data,",s.map(function(e){return"shape["+e+"]"}).join(","),",",s.map(function(e){return"stride["+e+"]"}).join(","),",offset)}"].join(""));var a=Function("CTOR_LIST","ORDER",o.join("\n"));return a(c[e],i)}function a(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 Uint8ClampedArray?"uint8_clamped":r!==void 0&&e instanceof r?"buffer":e instanceof Array?"array":"generic"}function s(e,t,r,n){void 0===t&&(t=[e.length]);var i=t.length;if(void 0===r){r=Array(i);for(var s=i-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===n){n=0;for(var s=0;i>s;++s)0>r[s]&&(n-=(t[s]-1)*r[s])}for(var l=a(e),p=c[l];i>=p.length;)p.push(o(l,p.length));var f=p[i];return f(e,t,r,n)}var u=e("iota-array"),l=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=s}).call(this,e("buffer").Buffer)},{buffer:1,"iota-array":27}],27:[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},{}],28:[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:26}]},{},[]);var observer=require("continuous-observer"),cave=require("cave-automata-2d"),fill=require("ndarray-fill"),zero=require("zeros"),raf=require("raf"),canvas=document.createElement("canvas"),ctx=canvas.getContext("2d"),controls=require("kb-controls")(document.body,{"<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};raf().on("data",function(){controls.up&&(camera.y-=.25),controls.down&&(camera.y+=.25),controls.left&&(camera.x-=.25),controls.right&&(camera.x+=.25),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),40*(n.y+o-camera.y),40,40)})}),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;
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"kb-controls": "0.1.1",
"ndarray-fill": "0.1.0",
"zeros": "0.0.0",
"raf": "0.0.3",
"continuous-observer": "0.2.0",
"ndarray-continuous": "0.4.2",
"cave-automata-2d": "0.3.1"
}
}
<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