(function(){var e=function(t,n){var r=e.resolve(t,n||"/"),i=e.modules[r];if(!i)throw new Error("Failed to resolve module "+t+", tried "+r);var s=e.cache[r],o=s?s.exports:i();return o};e.paths=[],e.modules={},e.cache={},e.extensions=[".js",".coffee",".json"],e._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},e.resolve=function(){return function(t,n){function u(t){t=r.normalize(t);if(e.modules[t])return t;for(var n=0;n=0;i--){if(t[i]==="node_modules")continue;var s=t.slice(0,i+1).join("/")+"/node_modules";n.push(s)}return n}n||(n="/");if(e._core[t])return t;var r=e.modules.path();n=r.resolve("/",n);var i=n||"/";if(t.match(/^(?:\.\.?\/|\/)/)){var s=u(r.resolve(i,t))||a(r.resolve(i,t));if(s)return s}var o=f(t,i);if(o)return o;throw new Error("Cannot find module '"+t+"'")}}(),e.alias=function(t,n){var r=e.modules.path(),i=null;try{i=e.resolve(t+"/package.json","/")}catch(s){i=e.resolve(t,"/")}var o=r.dirname(i),u=(Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t})(e.modules);for(var a=0;a=0;r--){var i=e[r];i=="."?e.splice(r,1):i===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var f=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;n.resolve=function(){var e="",t=!1;for(var n=arguments.length;n>=-1&&!t;n--){var r=n>=0?arguments[n]:s.cwd();if(typeof r!="string"||!r)continue;e=r+"/"+e,t=r.charAt(0)==="/"}return e=a(u(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."},n.normalize=function(e){var t=e.charAt(0)==="/",n=e.slice(-1)==="/";return e=a(u(e.split("/"),function(e){return!!e}),!t).join("/"),!e&&!t&&(e="."),e&&n&&(e+="/"),(t?"/":"")+e},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(u(e,function(e,t){return e&&typeof e=="string"}).join("/"))},n.dirname=function(e){var t=f.exec(e)[1]||"",n=!1;return t?t.length===1||n&&t.length<=3&&t.charAt(1)===":"?t:t.substring(0,t.length-1):"."},n.basename=function(e,t){var n=f.exec(e)[2]||"";return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return f.exec(e)[3]||""}}),e.define("__browserify_process",function(e,t,n,r,i,s,o){var s=t.exports={};s.nextTick=function(){var e=typeof window!="undefined"&&window.setImmediate,t=typeof window!="undefined"&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){if(e.source===window&&e.data==="browserify-tick"){e.stopPropagation();if(n.length>0){var t=n.shift();t()}}},!0),function(t){n.push(t),window.postMessage("browserify-tick","*")}}return function(t){setTimeout(t,0)}}(),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.binding=function(t){if(t==="evals")return e("vm");throw new Error("No such module. (Possibly not yet loaded)")},function(){var t="/",n;s.cwd=function(){return t},s.chdir=function(r){n||(n=e("path")),t=n.resolve(r,t)}}()}),e.define("/package.json",function(e,t,n,r,i,s,o){t.exports={main:"index.js"}}),e.define("/index.js",function(e,t,n,r,i,s,o){var u=e("./src/topology.js");n.vertex_stars=u.vertex_stars,n.edges=u.edges;var a=e("./src/repair.js");n.fuse_vertices=a.fuse_vertices,n.marching_cubes=e("./src/marchingcubes.js").marching_cubes,n.marching_tetrahedra=e("./src/marchingtetrahedra.js").marching_tetrahedra,n.surface_nets=e("./src/surfacenets.js").surface_nets;var f=e("./src/normals.js");n.vertex_normals=f.vertex_normals,n.face_normals=f.face_normals,n.surface_distance_to_point=e("./src/metric.js").surface_distance_to_point;var l=e("./src/shapes.js");n.grid_mesh=l.grid_mesh,n.cube_mesh=l.cube_mesh,n.sphere_mesh=l.sphere_mesh,n.loop_subdivision=e("./src/loop_subdivision.js").loop_subdivision}),e.define("/src/topology.js",function(e,t,n,r,i,s,o){function u(e){var t=0;for(var n=0;n0?1<1e-6&&(N=S/T);for(var C=0;C<3;++C)y[C]=h[C]+w[C]+N*(E[C]-w[C]);r.push(y)}var k=a[p];for(var d=0;d1e-6&&(c=n/c);for(var h=0;h<3;++h)f[h]+=s[h]+c*(a[h]-s[h]);return r.push(f),r.length-1}var t=e.potential,n=e.resolution,r=[],i=[],s=0,o=new Float32Array(8),f=new Int32Array(12),l=[0,0,0];for(l[2]=0;l[2]>1):0}a[t]=i}})();var f=new Array(4096);(function(){for(var e=0;ef.length){var p=f.length;f.length=l[2]*2;while(p1e-6))continue;L=C/L;for(var y=0,g=1;y<3;++y,g<<=1){var A=T&g,O=N&g;A!==O?S[y]+=A?1-L:L:S[y]+=A?1:0}}var M=1/x;for(var b=0;b<3;++b)S[b]=o[b]+M*S[b];f[d]=r.length,r.push(S);for(var b=0;b<3;++b){if(!(E&1<u){var w=i[f],E=1/Math.sqrt(m*y);for(var b=0;b<3;++b){var S=(b+1)%3,x=(b+2)%3;w[b]+=E*(g[S]*v[x]-g[x]*v[S])}}}}for(var s=0;su){var E=1/Math.sqrt(T);for(var b=0;b<3;++b)w[b]*=E}else for(var b=0;b<3;++b)w[b]=0}return i},n.face_normals=function(e){var t=e.positions,n=e.faces,r=n.length,i=new Array(r);for(var s=0;su?p=1/Math.sqrt(p):p=0;for(var f=0;f<3;++f)h[f]*=p;i[s]=h}return i}}),e.define("/src/metric.js",function(e,t,n,r,i,s,o){function c(e,t,n,r,i,s){var o=new Array(3),u=new Array(3),a=0;for(var f=0;f<3;++f)o[f]=t[f]-e[f],a+=o[f]*o[f],u[f]=n[f]-e[f];if(a0){var h=u.pop();if(h.v in l)continue;var p=h.d,d=h.v;l[d]=p;var v=t[d],m=i[d];for(var g=0;gs)break;var m=i[d];for(var L=0;Ls)continue;var M=l[A[2]];Oo&&(l[A[2]]=Math.min(M,O),N=!1)}}if(N)return l}}var u=e("assert"),a=e("./heap.js").BinaryHeap,f=e("./topology.js").vertex_stars,l=1e-6;n.quadratic_distance=c,n.surface_distance_to_point=h}),e.define("assert",function(e,t,n,r,i,s,o){function c(e,t){return t===undefined?""+t:typeof t=="number"&&(isNaN(t)||!isFinite(t))?t.toString():typeof t=="function"||t instanceof RegExp?t.toString():t}function h(e,t){return typeof e=="string"?e.length=0;s--)if(n[s]!=r[s])return!1;for(s=n.length-1;s>=0;s--){i=n[s];if(!v(e[i],t[i]))return!1}return!0}function b(e,t){return!e||!t?!1:t instanceof RegExp?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1}function w(e,t,n,r){var i;typeof n=="string"&&(r=n,n=null);try{t()}catch(s){i=s}r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&p("Missing expected exception"+r),!e&&b(i,n)&&p("Got unwanted exception"+r);if(e&&i&&n&&!b(i,n)||!e&&i)throw i}var u=e("util"),a=e("buffer").Buffer,f=Array.prototype.slice,l=t.exports=d;l.AssertionError=function(t){this.name="AssertionError",this.message=t.message,this.actual=t.actual,this.expected=t.expected,this.operator=t.operator;var n=t.stackStartFunction||p;Error.captureStackTrace&&Error.captureStackTrace(this,n)},u.inherits(l.AssertionError,Error),l.AssertionError.prototype.toString=function(){return this.message?[this.name+":",this.message].join(" "):[this.name+":",h(JSON.stringify(this.actual,c),128),this.operator,h(JSON.stringify(this.expected,c),128)].join(" ")},l.AssertionError.__proto__=Error.prototype,l.fail=p,l.ok=d,l.equal=function(t,n,r){t!=n&&p(t,n,r,"==",l.equal)},l.notEqual=function(t,n,r){t==n&&p(t,n,r,"!=",l.notEqual)},l.deepEqual=function(t,n,r){v(t,n)||p(t,n,r,"deepEqual",l.deepEqual)},l.notDeepEqual=function(t,n,r){v(t,n)&&p(t,n,r,"notDeepEqual",l.notDeepEqual)},l.strictEqual=function(t,n,r){t!==n&&p(t,n,r,"===",l.strictEqual)},l.notStrictEqual=function(t,n,r){t===n&&p(t,n,r,"!==",l.notStrictEqual)},l.throws=function(e,t,n){w.apply(this,[!0].concat(f.call(arguments)))},l.doesNotThrow=function(e,t,n){w.apply(this,[!1].concat(f.call(arguments)))},l.ifError=function(e){if(e)throw e}}),e.define("util",function(e,t,n,r,i,s,o){function a(e){return e instanceof Array||Array.isArray(e)||e&&e!==Object.prototype&&a(e.__proto__)}function f(e){return e instanceof RegExp||typeof e=="object"&&Object.prototype.toString.call(e)==="[object RegExp]"}function l(e){if(e instanceof Date)return!0;if(typeof e!="object")return!1;var t=Date.prototype&&v(Date.prototype),n=e.__proto__&&v(e.__proto__);return JSON.stringify(n)===JSON.stringify(t)}function c(e){return e<10?"0"+e.toString(10):e.toString(10)}function p(){var e=new Date,t=[c(e.getHours()),c(e.getMinutes()),c(e.getSeconds())].join(":");return[e.getDate(),h[e.getMonth()],t].join(" ")}var u=e("events");n.print=function(){},n.puts=function(){},n.debug=function(){},n.inspect=function(e,t,r,i){function u(e,r){if(e&&typeof e.inspect=="function"&&e!==n&&(!e.constructor||e.constructor.prototype!==e))return e.inspect(r);switch(typeof e){case"undefined":return o("undefined","undefined");case"string":var i="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return o(i,"string");case"number":return o(""+e,"number");case"boolean":return o(""+e,"boolean")}if(e===null)return o("null","null");var c=d(e),h=t?v(e):c;if(typeof e=="function"&&h.length===0){if(f(e))return o(""+e,"regexp");var p=e.name?": "+e.name:"";return o("[Function"+p+"]","special")}if(l(e)&&h.length===0)return o(e.toUTCString(),"date");var m,g,y;a(e)?(g="Array",y=["[","]"]):(g="Object",y=["{","}"]);if(typeof e=="function"){var b=e.name?": "+e.name:"";m=f(e)?" "+e:" [Function"+b+"]"}else m="";l(e)&&(m=" "+e.toUTCString());if(h.length===0)return y[0]+m+y[1];if(r<0)return f(e)?o(""+e,"regexp"):o("[Object]","special");s.push(e);var w=h.map(function(t){var n,i;e.__lookupGetter__&&(e.__lookupGetter__(t)?e.__lookupSetter__(t)?i=o("[Getter/Setter]","special"):i=o("[Getter]","special"):e.__lookupSetter__(t)&&(i=o("[Setter]","special"))),c.indexOf(t)<0&&(n="["+t+"]"),i||(s.indexOf(e[t])<0?(r===null?i=u(e[t]):i=u(e[t],r-1),i.indexOf("\n")>-1&&(a(e)?i=i.split("\n").map(function(e){return" "+e}).join("\n").substr(2):i="\n"+i.split("\n").map(function(e){return" "+e}).join("\n"))):i=o("[Circular]","special"));if(typeof n=="undefined"){if(g==="Array"&&t.match(/^\d+$/))return i;n=JSON.stringify(""+t),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=o(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=o(n,"string"))}return n+": "+i});s.pop();var E=0,S=w.reduce(function(e,t){return E++,t.indexOf("\n")>=0&&E++,e+t.length+1},0);return S>50?w=y[0]+(m===""?"":m+"\n ")+" "+w.join(",\n ")+" "+y[1]:w=y[0]+m+" "+w.join(", ")+" "+y[1],w}var s=[],o=function(e,t){var n={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r={special:"cyan",number:"blue","boolean":"yellow","undefined":"grey","null":"bold",string:"green",date:"magenta",regexp:"red"}[t];return r?"["+n[r][0]+"m"+e+"["+n[r][1]+"m":e};return i||(o=function(e,t){return e}),u(e,typeof r=="undefined"?2:r)};var h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(e){},n.pump=null;var d=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},v=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.hasOwnProperty.call(e,n)&&t.push(n);return t},m=Object.create||function(e,t){var n;if(e===null)n={__proto__:null};else{if(typeof e!="object")throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,n=new r,n.__proto__=e}return typeof t!="undefined"&&Object.defineProperties&&Object.defineProperties(n,t),n};n.inherits=function(e,t){e.super_=t,e.prototype=m(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};var g=/%[sdj%]/g;n.format=function(e){if(typeof e!="string"){var t=[];for(var r=0;r=s)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":return JSON.stringify(i[r++]);default:return e}});for(var u=i[r];r0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}this._events[e].push(t)}else this._events[e]=[this._events[e],t];return this},u.prototype.on=u.prototype.addListener,u.prototype.once=function(e,t){var n=this;return n.on(e,function r(){n.removeListener(e,r),t.apply(this,arguments)}),this},u.prototype.removeListener=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;var n=this._events[e];if(a(n)){var r=n.indexOf(t);if(r<0)return this;n.splice(r,1),n.length==0&&delete this._events[e]}else this._events[e]===t&&delete this._events[e];return this},u.prototype.removeAllListeners=function(e){return e&&this._events&&this._events[e]&&(this._events[e]=null),this},u.prototype.listeners=function(e){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),a(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]}}),e.define("buffer",function(e,t,n,r,i,s,o){t.exports=e("buffer-browserify")}),e.define("/node_modules/buffer-browserify/package.json",function(e,t,n,r,i,s,o){t.exports={main:"index.js",browserify:"index.js"}}),e.define("/node_modules/buffer-browserify/index.js",function(e,t,n,r,i,s,o){function u(e){this.length=e}function f(e){return e<16?"0"+e.toString(16):e.toString(16)}function l(e){var t=[];for(var n=0;n=t.length||s>=e.length)break;t[s+n]=e[s],s++}return s}function d(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function v(e){return e=~~Math.ceil(+e),e<0?0:e}function m(e,t,n){if(!(this instanceof m))return new m(e,t,n);var r;if(typeof n=="number")this.length=v(t),this.parent=e,this.offset=n;else{switch(r=typeof e){case"number":this.length=v(e);break;case"string":this.length=m.byteLength(e,t);break;case"object":this.length=v(e.length);break;default:throw new Error("First argument needs to be a number, array or string.")}this.length>m.poolSize?(this.parent=new u(this.length),this.offset=0):((!y||y.length-y.used>>0 ):(i=e.parent[e.offset+t+2]<<16,i|=e.parent[e.offset+t+1]<<8,i|=e.parent[e.offset+t],i+=e.parent[e.offset+t+3]<<24>>>0),i}function S(e,t,n,r){var i,s;return r||(a.ok(typeof n=="boolean","missing or invalid endian"),a.ok(t!==undefined&&t!==null,"missing offset"),a.ok(t+1=0,"specified a negative value for writing an unsigned value"),a.ok(e<=t,"value is larger than maximum value for type"),a.ok(Math.floor(e)===e,"value has a fractional component")}function k(e,t,n,r,i){i||(a.ok(t!==undefined&&t!==null,"missing value"),a.ok(typeof r=="boolean","missing or invalid endian"),a.ok(n!==undefined&&n!==null,"missing offset"),a.ok(n+1>>8,e.parent[e.offset+n+1]=t&255):(e.parent[e.offset+n+1]=(t&65280)>>>8,e.parent[e.offset+n]=t&255)}function L(e,t,n,r,i){i||(a.ok(t!==undefined&&t!==null,"missing value"),a.ok(typeof r=="boolean","missing or invalid endian"),a.ok(n!==undefined&&n!==null,"missing offset"),a.ok(n+3>>24&255,e.parent[e.offset+n+1]=t>>>16&255,e.parent[e.offset+n+2]=t>>>8&255,e.parent[e.offset+n+3]=t&255):(e.parent[e.offset+n+3]=t>>>24&255,e.parent[e.offset+n+2]=t>>>16&255,e.parent[e.offset+n+1]=t>>>8&255,e.parent[e.offset+n]=t&255)}function A(e,t,n){a.ok(typeof e=="number","cannot write a non-number as a number"),a.ok(e<=t,"value larger than maximum allowed value"),a.ok(e>=n,"value smaller than minimum allowed value"),a.ok(Math.floor(e)===e,"value has a fractional component")}function O(e,t,n){a.ok(typeof e=="number","cannot write a non-number as a number"),a.ok(e<=t,"value larger than maximum allowed value"),a.ok(e>=n,"value smaller than minimum allowed value")}function M(e,t,n,r,i){i||(a.ok(t!==undefined&&t!==null,"missing value"),a.ok(typeof r=="boolean","missing or invalid endian"),a.ok(n!==undefined&&n!==null,"missing offset"),a.ok(n+1=0?k(e,t,n,r,i):k(e,65535+t+1,n,r,i)}function _(e,t,n,r,i){i||(a.ok(t!==undefined&&t!==null,"missing value"),a.ok(typeof r=="boolean","missing or invalid endian"),a.ok(n!==undefined&&n!==null,"missing offset"),a.ok(n+3=0?L(e,t,n,r,i):L(e,4294967295+t+1,n,r,i)}function D(t,n,r,i,s){s||(a.ok(n!==undefined&&n!==null,"missing value"),a.ok(typeof i=="boolean","missing or invalid endian"),a.ok(r!==undefined&&r!==null,"missing offset"),a.ok(r+3"},u.prototype.hexSlice=function(e,t){var n=this.length;if(!e||e<0)e=0;if(!t||t<0||t>n)t=n;var r="";for(var i=e;ir&&(n=r)):n=r;var i=e.length;if(i%2)throw new Error("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;ss&&(n=s)):n=s,r=String(r||"utf8").toLowerCase();switch(r){case"hex":return this.hexWrite(e,t,n);case"utf8":case"utf-8":return this.utf8Write(e,t,n);case"ascii":return this.asciiWrite(e,t,n);case"binary":return this.binaryWrite(e,t,n);case"base64":return this.base64Write(e,t,n);case"ucs2":case"ucs-2":return this.ucs2Write(e,t,n);default:throw new Error("Unknown encoding")}},u.prototype.slice=function(e,t){t===undefined&&(t=this.length);if(t>this.length)throw new Error("oob");if(e>t)throw new Error("oob");return new m(this,t-e,+e)},u.prototype.copy=function(e,t,n,r){var i=[];for(var s=n;s"},m.prototype.get=function(t){if(t<0||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]},m.prototype.set=function(t,n){if(t<0||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]=n},m.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=undefined);else{var i=r;r=t,t=n,n=i}t=+t||0;var s=this.length-t;n?(n=+n,n>s&&(n=s)):n=s,r=String(r||"utf8").toLowerCase();var o;switch(r){case"hex":o=this.parent.hexWrite(e,this.offset+t,n);break;case"utf8":case"utf-8":o=this.parent.utf8Write(e,this.offset+t,n);break;case"ascii":o=this.parent.asciiWrite(e,this.offset+t,n);break;case"binary":o=this.parent.binaryWrite(e,this.offset+t,n);break;case"base64":o=this.parent.base64Write(e,this.offset+t,n);break;case"ucs2":case"ucs-2":o=this.parent.ucs2Write(e,this.offset+t,n);break;default:throw new Error("Unknown encoding")}return m._charsWritten=u._charsWritten,o},m.prototype.toString=function(e,t,n){e=String(e||"utf8").toLowerCase(),typeof t=="undefined"||t<0?t=0:t>this.length&&(t=this.length),typeof n=="undefined"||n>this.length?n=this.length:n<0&&(n=0),t+=this.offset,n+=this.offset;switch(e){case"hex":return this.parent.hexSlice(t,n);case"utf8":case"utf-8":return this.parent.utf8Slice(t,n);case"ascii":return this.parent.asciiSlice(t,n);case"binary":return this.parent.binarySlice(t,n);case"base64":return this.parent.base64Slice(t,n);case"ucs2":case"ucs-2":return this.parent.ucs2Slice(t,n);default:throw new Error("Unknown encoding")}},m.byteLength=u.byteLength,m.prototype.fill=function(t,n,r){t||(t=0),n||(n=0),r||(r=this.length),typeof t=="string"&&(t=t.charCodeAt(0));if(typeof t!="number"||isNaN(t))throw new Error("value is not a number");if(r=this.length)throw new Error("start out of bounds");if(r<0||r>this.length)throw new Error("end out of bounds");return this.parent.fill(t,n+this.offset,r+this.offset)},m.prototype.copy=function(e,t,n,r){var i=this;n||(n=0),r||(r=this.length),t||(t=0);if(r=e.length)throw new Error("targetStart out of bounds");if(n<0||n>=i.length)throw new Error("sourceStart out of bounds");if(r<0||r>i.length)throw new Error("sourceEnd out of bounds");return r>this.length&&(r=this.length),e.length-tthis.length)throw new Error("oob");if(e>t)throw new Error("oob");return new m(this.parent,t-e,+e+this.offset)},m.prototype.utf8Slice=function(e,t){return this.toString("utf8",e,t)},m.prototype.binarySlice=function(e,t){return this.toString("binary",e,t)},m.prototype.asciiSlice=function(e,t){return this.toString("ascii",e,t)},m.prototype.utf8Write=function(e,t){return this.write(e,t,"utf8")},m.prototype.binaryWrite=function(e,t){return this.write(e,t,"binary")},m.prototype.asciiWrite=function(e,t){return this.write(e,t,"ascii")},m.prototype.readUInt8=function(e,t){var n=this;return t||(a.ok(e!==undefined&&e!==null,"missing offset"),a.ok(e=0?r.writeUInt8(e,t,n):r.writeUInt8(255+e+1,t,n)},m.prototype.writeInt16LE=function(e,t,n){M(this,e,t,!1,n)},m.prototype.writeInt16BE=function(e,t,n){M(this,e,t,!0,n)},m.prototype.writeInt32LE=function(e,t,n){_(this,e,t,!1,n)},m.prototype.writeInt32BE=function(e,t,n){_(this,e,t,!0,n)},m.prototype.writeFloatLE=function(e,t,n){D(this,e,t,!1,n)},m.prototype.writeFloatBE=function(e,t,n){D(this,e,t,!0,n)},m.prototype.writeDoubleLE=function(e,t,n){P(this,e,t,!1,n)},m.prototype.writeDoubleBE=function(e,t,n){P(this,e,t,!0,n)},u.prototype.readUInt8=m.prototype.readUInt8,u.prototype.readUInt16LE=m.prototype.readUInt16LE,u.prototype.readUInt16BE=m.prototype.readUInt16BE,u.prototype.readUInt32LE=m.prototype.readUInt32LE,u.prototype.readUInt32BE=m.prototype.readUInt32BE,u.prototype.readInt8=m.prototype.readInt8,u.prototype.readInt16LE=m.prototype.readInt16LE,u.prototype.readInt16BE=m.prototype.readInt16BE,u.prototype.readInt32LE=m.prototype.readInt32LE,u.prototype.readInt32BE=m.prototype.readInt32BE,u.prototype.readFloatLE=m.prototype.readFloatLE,u.prototype.readFloatBE=m.prototype.readFloatBE,u.prototype.readDoubleLE=m.prototype.readDoubleLE,u.prototype.readDoubleBE=m.prototype.readDoubleBE,u.prototype.writeUInt8=m.prototype.writeUInt8,u.prototype.writeUInt16LE=m.prototype.writeUInt16LE,u.prototype.writeUInt16BE=m.prototype.writeUInt16BE,u.prototype.writeUInt32LE=m.prototype.writeUInt32LE,u.prototype.writeUInt32BE=m.prototype.writeUInt32BE,u.prototype.writeInt8=m.prototype.writeInt8,u.prototype.writeInt16LE=m.prototype.writeInt16LE,u.prototype.writeInt16BE=m.prototype.writeInt16BE,u.prototype.writeInt32LE=m.prototype.writeInt32LE,u.prototype.writeInt32BE=m.prototype.writeInt32BE,u.prototype.writeFloatLE=m.prototype.writeFloatLE,u.prototype.writeFloatBE=m.prototype.writeFloatBE,u.prototype.writeDoubleLE=m.prototype.writeDoubleLE,u.prototype.writeDoubleBE=m.prototype.writeDoubleBE}),e.define("/node_modules/buffer-browserify/node_modules/base64-js/package.json",function(e,t,n,r,i,s,o){t.exports={main:"lib/b64.js"}}),e.define("/node_modules/buffer-browserify/node_modules/base64-js/lib/b64.js",function(e,t,n,r,i,s,o){(function(e){"use strict";function r(e){var t,r,i,s,o,u;if(e.length%4>0)throw"Invalid string. Length must be a multiple of 4";o=e.indexOf("="),o=o>0?e.length-o:0,u=[],i=o>0?e.length-4:e.length;for(t=0,r=0;t>16),u.push((s&65280)>>8),u.push(s&255);return o===2?(s=n.indexOf(e[t])<<2|n.indexOf(e[t+1])>>4,u.push(s&255)):o===1&&(s=n.indexOf(e[t])<<10|n.indexOf(e[t+1])<<4|n.indexOf(e[t+2])>>2,u.push(s>>8&255),u.push(s&255)),u}function i(e){function u(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[e&63]}var t,r=e.length%3,i="",s,o;for(t=0,o=e.length-r;t>2],i+=n[s<<4&63],i+="==";break;case 2:s=(e[e.length-2]<<8)+e[e.length-1],i+=n[s>>10],i+=n[s>>4&63],i+=n[s<<2&63],i+="="}return i}var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports.toByteArray=r,t.exports.fromByteArray=i})()}),e.define("/node_modules/buffer-browserify/buffer_ieee754.js",function(e,t,n,r,i,s,o){n.readIEEE754=function(e,t,n,r,i){var s,o,u=i*8-r-1,a=(1<>1,l=-7,c=n?0:i-1,h=n?1:-1,p=e[t+c];c+=h,s=p&(1<<-l)-1,p>>=-l,l+=u;for(;l>0;s=s*256+e[t+c],c+=h,l-=8);o=s&(1<<-l)-1,s>>=-l,l+=r;for(;l>0;o=o*256+e[t+c],c+=h,l-=8);if(s===0)s=1-f;else{if(s===a)return o?NaN:(p?-1:1)*Infinity;o+=Math.pow(2,r),s-=f}return(p?-1:1)*o*Math.pow(2,s-r)},n.writeIEEE754=function(e,t,n,r,i,s){var o,u,a,f=s*8-i-1,l=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?s-1:0,d=r?-1:1,v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t),isNaN(t)||t===Infinity?(u=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+c>=1?t+=h/a:t+=h*Math.pow(2,1-c),t*a>=2&&(o++,a/=2),o+c>=l?(u=0,o=l):o+c>=1?(u=(t*a-1)*Math.pow(2,i),o+=c):(u=t*Math.pow(2,c-1)*Math.pow(2,i),o=0));for(;i>=8;e[n+p]=u&255,p+=d,u/=256,i-=8);o=o<0;e[n+p]=o&255,p+=d,o/=256,f-=8);e[n+p-d]|=v*128}}),e.define("/src/heap.js",function(e,t,n,r,i,s,o){function u(e){this.content=[],this.scoreFunction=e}u.prototype={push:function(e){this.content.push(e),this.bubbleUp(this.content.length-1)},pop:function(){var e=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.sinkDown(0)),e},remove:function(e){var t=this.content.length;for(var n=0;n0){var n=Math.floor((e+1)/2)-1,r=this.content[n];if(!(this.scoreFunction(t)>1,i=2*r+1,o=new Array(6*i*i),a=[];for(var f=0;f<3;++f){var l=(f+1)%3,c=(f+2)%3;for(var h=0;h<2;++h){var p=2*f+h,d=new Array(3);d[l]=-r,d[c]=-r,d[f]=(1-2*h)*r;for(var v=0;v