UNPKG

http-teapot

Version:

Add a teapot easter egg to any HTTP server.

2 lines 214 kB
!function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t){var e,n=t("mesh-viewer")();n.camera.lookAt([0,3,40],[0,3,0],[0,1,0]),n.on("viewer-init",function(){e=n.createMesh(t("teapot"))}),n.on("gl-render",function(){e.draw()})},{"mesh-viewer":89,teapot:90}],2:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);var i,o=typeof t;if("number"===o)i=t>0?t>>>0:0;else if("string"===o)"base64"===e&&(t=M(t)),i=r.byteLength(t,e);else{if("object"!==o||null===t)throw new TypeError("must start with number, buffer, array or string");"Buffer"===t.type&&P(t.data)&&(t=t.data),i=+t.length>0?Math.floor(+t.length):0}if(this.length>C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");var a;r.TYPED_ARRAY_SUPPORT?a=r._augment(new Uint8Array(i)):(a=this,a.length=i,a._isBuffer=!0);var s;if(r.TYPED_ARRAY_SUPPORT&&"number"==typeof t.byteLength)a._set(t);else if(x(t))if(r.isBuffer(t))for(s=0;i>s;s++)a[s]=t.readUInt8(s);else for(s=0;i>s;s++)a[s]=(t[s]%256+256)%256;else if("string"===o)a.write(t,0,e);else if("number"===o&&!r.TYPED_ARRAY_SUPPORT&&!n)for(s=0;i>s;s++)a[s]=0;return a}function i(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[n+a]=s}return a}function o(t,e,n,r){var i=I(k(e),t,n,r);return i}function a(t,e,n,r){var i=I(L(e),t,n,r);return i}function s(t,e,n,r){return a(t,e,n,r)}function u(t,e,n,r){var i=I(T(e),t,n,r);return i}function c(t,e,n,r){var i=I(S(e),t,n,r);return i}function l(t,e,n){return O.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function f(t,e,n){var r="",i="";n=Math.min(t.length,n);for(var o=e;n>o;o++)t[o]<=127?(r+=F(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+F(i)}function h(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function p(t,e,n){return h(t,e,n)}function d(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=j(t[o]);return i}function v(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function m(t,e,n){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function g(t,e,n,i,o,a){if(!r.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||a>e)throw new TypeError("value is out of bounds");if(n+i>t.length)throw new TypeError("index out of range")}function y(t,e,n,r){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);o>i;i++)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function b(t,e,n,r){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);o>i;i++)t[n+i]=e>>>8*(r?i:3-i)&255}function w(t,e,n,r,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(n+r>t.length)throw new TypeError("index out of range")}function _(t,e,n,r,i){return i||w(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),B.write(t,e,n,r,23,4),n+4}function A(t,e,n,r,i){return i||w(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),B.write(t,e,n,r,52,8),n+8}function M(t){for(t=E(t).replace(N,"");t.length%4!==0;)t+="=";return t}function E(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function x(t){return P(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function j(t){return 16>t?"0"+t.toString(16):t.toString(16)}function k(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(127>=r)e.push(r);else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(t.slice(i,n+1)).substr(1).split("%"),a=0;a<o.length;a++)e.push(parseInt(o[a],16))}}return e}function L(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}function S(t){for(var e,n,r,i=[],o=0;o<t.length;o++)e=t.charCodeAt(o),n=e>>8,r=e%256,i.push(r),i.push(n);return i}function T(t){return O.toByteArray(t)}function I(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);i++)e[i+n]=t[i];return i}function F(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}var O=t("base64-js"),B=t("ieee754"),P=t("is-array");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192;var C=1073741823;r.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(n){return!1}}(),r.isBuffer=function(t){return!(null==t||!t._isBuffer)},r.compare=function(t,e){if(!r.isBuffer(t)||!r.isBuffer(e))throw new TypeError("Arguments must be Buffers");for(var n=t.length,i=e.length,o=0,a=Math.min(n,i);a>o&&t[o]===e[o];o++);return o!==a&&(n=t[o],i=e[o]),i>n?-1:n>i?1:0},r.isEncoding=function(t){switch(String(t).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}},r.concat=function(t,e){if(!P(t))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===t.length)return new r(0);if(1===t.length)return t[0];var n;if(void 0===e)for(e=0,n=0;n<t.length;n++)e+=t[n].length;var i=new r(e),o=0;for(n=0;n<t.length;n++){var a=t[n];a.copy(i,o),o+=a.length}return i},r.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"ascii":case"binary":case"raw":n=t.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;case"hex":n=t.length>>>1;break;case"utf8":case"utf-8":n=k(t).length;break;case"base64":n=T(t).length;break;default:n=t.length}return n},r.prototype.length=void 0,r.prototype.parent=void 0,r.prototype.toString=function(t,e,n){var r=!1;if(e>>>=0,n=void 0===n||1/0===n?this.length:n>>>0,t||(t="utf8"),0>e&&(e=0),n>this.length&&(n=this.length),e>=n)return"";for(;;)switch(t){case"hex":return d(this,e,n);case"utf8":case"utf-8":return f(this,e,n);case"ascii":return h(this,e,n);case"binary":return p(this,e,n);case"base64":return l(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}},r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return 0===r.compare(this,t)},r.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},r.prototype.compare=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return r.compare(this,t)},r.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var l=r;r=e,e=n,n=l}e=Number(e)||0;var f=this.length-e;n?(n=Number(n),n>f&&(n=f)):n=f,r=String(r||"utf8").toLowerCase();var h;switch(r){case"hex":h=i(this,t,e,n);break;case"utf8":case"utf-8":h=o(this,t,e,n);break;case"ascii":h=a(this,t,e,n);break;case"binary":h=s(this,t,e,n);break;case"base64":h=u(this,t,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=c(this,t,e,n);break;default:throw new TypeError("Unknown encoding: "+r)}return h},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.slice=function(t,e){var n=this.length;if(t=~~t,e=void 0===e?n:~~e,0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),t>e&&(e=t),r.TYPED_ARRAY_SUPPORT)return r._augment(this.subarray(t,e));for(var i=e-t,o=new r(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+t];return o},r.prototype.readUInt8=function(t,e){return e||m(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return e||m(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return e||m(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return e||m(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return e||m(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readInt8=function(t,e){return e||m(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){e||m(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(t,e){e||m(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(t,e){return e||m(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return e||m(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return e||m(t,4,this.length),B.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return e||m(t,4,this.length),B.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return e||m(t,8,this.length),B.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return e||m(t,8,this.length),B.read(this,t,!1,52,8)},r.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,1,255,0),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t,e+1},r.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):y(this,t,e,!0),e+2},r.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):y(this,t,e,!1),e+2},r.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t):b(this,t,e,!0),e+4},r.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):b(this,t,e,!1),e+4},r.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,1,127,-128),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=t,e+1},r.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):y(this,t,e,!0),e+2},r.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):y(this,t,e,!1),e+2},r.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):b(this,t,e,!0),e+4},r.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||g(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):b(this,t,e,!1),e+4},r.prototype.writeFloatLE=function(t,e,n){return _(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){return _(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){return A(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){return A(this,t,e,!1,n)},r.prototype.copy=function(t,e,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){if(n>i)throw new TypeError("sourceEnd < sourceStart");if(0>e||e>=t.length)throw new TypeError("targetStart out of bounds");if(0>n||n>=o.length)throw new TypeError("sourceStart out of bounds");if(0>i||i>o.length)throw new TypeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var a=i-n;if(100>a||!r.TYPED_ARRAY_SUPPORT)for(var s=0;a>s;s++)t[s+e]=this[s+n];else t._set(this.subarray(n,n+a),e)}},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),e>n)throw new TypeError("end < start");if(n!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>n||n>this.length)throw new TypeError("end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var i=k(t.toString()),o=i.length;for(r=e;n>r;r++)this[r]=i[r%o]}return this}},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r.TYPED_ARRAY_SUPPORT)return new r(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var R=r.prototype;r._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=R.get,t.set=R.set,t.write=R.write,t.toString=R.toString,t.toLocaleString=R.toString,t.toJSON=R.toJSON,t.equals=R.equals,t.compare=R.compare,t.copy=R.copy,t.slice=R.slice,t.readUInt8=R.readUInt8,t.readUInt16LE=R.readUInt16LE,t.readUInt16BE=R.readUInt16BE,t.readUInt32LE=R.readUInt32LE,t.readUInt32BE=R.readUInt32BE,t.readInt8=R.readInt8,t.readInt16LE=R.readInt16LE,t.readInt16BE=R.readInt16BE,t.readInt32LE=R.readInt32LE,t.readInt32BE=R.readInt32BE,t.readFloatLE=R.readFloatLE,t.readFloatBE=R.readFloatBE,t.readDoubleLE=R.readDoubleLE,t.readDoubleBE=R.readDoubleBE,t.writeUInt8=R.writeUInt8,t.writeUInt16LE=R.writeUInt16LE,t.writeUInt16BE=R.writeUInt16BE,t.writeUInt32LE=R.writeUInt32LE,t.writeUInt32BE=R.writeUInt32BE,t.writeInt8=R.writeInt8,t.writeInt16LE=R.writeInt16LE,t.writeInt16BE=R.writeInt16BE,t.writeInt32LE=R.writeInt32LE,t.writeInt32BE=R.writeInt32BE,t.writeFloatLE=R.writeFloatLE,t.writeFloatBE=R.writeFloatBE,t.writeDoubleLE=R.writeDoubleLE,t.writeDoubleBE=R.writeDoubleBE,t.fill=R.fill,t.inspect=R.inspect,t.toArrayBuffer=R.toArrayBuffer,t};var N=/[^+\/0-9A-z]/g},{"base64-js":3,ieee754:4,"is-array":5}],3:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===a?62:e===s?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:c+26>e?e-c+26:void 0}function n(t){function n(t){c[f++]=t}var r,i,a,s,u,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var f=0;for(r=0,i=0;a>r;r+=4,i+=3)s=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===u?(s=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&s)):1===u&&(s=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(s>>8&255),n(255&s)),c}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,a,s=t.length%3,u="";for(i=0,a=t.length-s;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(s){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}("undefined"==typeof n?this.base64js={}:n)},{}],4:[function(t,e,n){n.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,v=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*v}},{}],5:[function(t,e){var n=Array.isArray,r=Object.prototype.toString;e.exports=n||function(t){return!!t&&"[object Array]"==r.call(t)}},{}],6:[function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,s,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,s=new Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];n.apply(this,s)}else if(o(n)){for(i=arguments.length,s=new Array(i-1),u=1;i>u;u++)s[u-1]=arguments[u];for(c=n.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,s)}return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],a=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(s=a;s-->0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?r(t._events[e])?1:t._events[e].length:0}},{}],7:[function(t,e){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],8:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),o=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return o.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],9:[function(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],10:[function(t,e,n){(function(e,r){function i(t,e){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(e)?r.showHidden=e:e&&n._extend(r,e),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function a(t){return t}function s(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&j(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return b(i)||(i=u(t,i,r)),i}var o=c(t,e);if(o)return o;var a=Object.keys(e),v=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),x(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(e);if(0===a.length){if(j(e)){var m=e.name?": "+e.name:"";return t.stylize("[Function"+m+"]","special")}if(A(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(E(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return l(e)}var g="",y=!1,w=["{","}"];if(d(e)&&(y=!0,w=["[","]"]),j(e)){var _=e.name?": "+e.name:"";g=" [Function"+_+"]"}if(A(e)&&(g=" "+RegExp.prototype.toString.call(e)),E(e)&&(g=" "+Date.prototype.toUTCString.call(e)),x(e)&&(g=" "+l(e)),0===a.length&&(!y||0==e.length))return w[0]+g+w[1];if(0>r)return A(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var M;return M=y?f(t,e,r,v,a):a.map(function(n){return h(t,e,r,v,n,y)}),t.seen.pop(),p(M,g,w)}function c(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):v(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i){for(var o=[],a=0,s=e.length;s>a;++a)o.push(I(e,String(a))?h(t,e,n,r,String(a),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,n,r,i,!0))}),o}function h(t,e,n,r,i,o){var a,s,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?s=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(s=t.stylize("[Setter]","special")),I(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(c.value)<0?(s=m(n)?u(t,c.value,null):u(t,c.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function d(t){return Array.isArray(t)}function v(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return"symbol"==typeof t}function _(t){return void 0===t}function A(t){return M(t)&&"[object RegExp]"===L(t)}function M(t){return"object"==typeof t&&null!==t}function E(t){return M(t)&&"[object Date]"===L(t)}function x(t){return M(t)&&("[object Error]"===L(t)||t instanceof Error)}function j(t){return"function"==typeof t}function k(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function L(t){return Object.prototype.toString.call(t)}function S(t){return 10>t?"0"+t.toString(10):t.toString(10)}function T(){var t=new Date,e=[S(t.getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":");return[t.getDate(),P[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var F=/%[sdj%]/g;n.format=function(t){if(!b(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(i(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(t).replace(F,function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}}),s=r[n];o>n;s=r[++n])a+=m(s)||!M(s)?" "+s:" "+i(s);return a},n.deprecate=function(t,i){function o(){if(!a){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),a=!0}return t.apply(this,arguments)}if(_(r.process))return function(){return n.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var a=!1;return o};var O,B={};n.debuglog=function(t){if(_(O)&&(O=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!B[t])if(new RegExp("\\b"+t+"\\b","i").test(O)){var r=e.pid;B[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else B[t]=function(){};return B[t]},n.inspect=i,i.colors={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]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=d,n.isBoolean=v,n.isNull=m,n.isNullOrUndefined=g,n.isNumber=y,n.isString=b,n.isSymbol=w,n.isUndefined=_,n.isRegExp=A,n.isObject=M,n.isDate=E,n.isError=x,n.isFunction=j,n.isPrimitive=k,n.isBuffer=t("./support/isBuffer");var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",T(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!M(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":9,_process:8,inherits:7}],11:[function(t,e){"use strict";function n(t){var e=r();return t.on("tick",function(){var n=t.down("control"),r=t.down("shift"),i=t.down("mouse-left"),o=t.down("mouse-right"),a=t.down("mouse-middle");if(!i||n||r||e.rotate([t.mouseX/t.width-.5,t.mouseY/t.height-.5],[t.prevMouseX/t.width-.5,t.prevMouseY/t.height-.5]),(o||i&&n&&!r)&&e.pan([(t.mouseX-t.prevMouseX)/t.width,(t.mouseY-t.prevMouseY)/t.height]),t.scroll[1]&&(e.distance*=Math.exp(t.scroll[1]/t.height)),a||i&&!n&&r){var s=t.mouseY-t.prevMouseY;s&&(e.distance*=Math.exp(s/t.height))}}),e}var r=t("orbit-camera");e.exports=n},{"orbit-camera":13}],12:[function(t,e,n){!function(t){"use strict";var e={};"undefined"==typeof n?"function"==typeof define&&"object"==typeof define.amd&&define.amd?(e.exports={},define(function(){return e.exports})):e.exports="undefined"!=typeof window?window:t:e.exports=n,function(t){if(!e)var e=1e-6;if(!n)var n="undefined"!=typeof Float32Array?Float32Array:Array;if(!r)var r=Math.random;var i={};i.setMatrixArrayType=function(t){n=t},"undefined"!=typeof t&&(t.glMatrix=i);var o=Math.PI/180;i.toRadian=function(t){return t*o};var a={};a.create=function(){var t=new n(2);return t[0]=0,t[1]=0,t},a.clone=function(t){var e=new n(2);return e[0]=t[0],e[1]=t[1],e},a.fromValues=function(t,e){var r=new n(2);return r[0]=t,r[1]=e,r},a.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},a.set=function(t,e,n){return t[0]=e,t[1]=n,t},a.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},a.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},a.sub=a.subtract,a.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},a.mul=a.multiply,a.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},a.div=a.divide,a.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},a.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},a.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},a.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},a.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},a.dist=a.distance,a.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r},a.sqrDist=a.squaredDistance,a.length=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},a.len=a.length,a.squaredLength=function(t){var e=t[0],n=t[1];return e*e+n*n},a.sqrLen=a.squaredLength,a.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},a.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},a.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},a.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},a.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},a.random=function(t,e){e=e||1;var n=2*r()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},a.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},a.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},a.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},a.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},a.forEach=function(){var t=a.create();return function(e,n,r,i,o,a){var s,u;for(n||(n=2),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;u>s;s+=n)t[0]=e[s],t[1]=e[s+1],o(t,t,a),e[s]=t[0],e[s+1]=t[1];return e}}(),a.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},"undefined"!=typeof t&&(t.vec2=a);var s={};s.create=function(){var t=new n(3);return t[0]=0,t[1]=0,t[2]=0,t},s.clone=function(t){var e=new n(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},s.fromValues=function(t,e,r){var i=new n(3);return i[0]=t,i[1]=e,i[2]=r,i},s.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},s.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t },s.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},s.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},s.sub=s.subtract,s.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t},s.mul=s.multiply,s.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t},s.div=s.divide,s.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},s.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},s.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},s.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},s.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},s.dist=s.distance,s.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i},s.sqrDist=s.squaredDistance,s.length=function(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)},s.len=s.length,s.squaredLength=function(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r},s.sqrLen=s.squaredLength,s.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},s.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},s.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},s.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t},s.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t},s.random=function(t,e){e=e||1;var n=2*r()*Math.PI,i=2*r()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t},s.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12],t[1]=n[1]*r+n[5]*i+n[9]*o+n[13],t[2]=n[2]*r+n[6]*i+n[10]*o+n[14],t},s.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},s.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*r+s*o-u*i,f=c*i+u*r-a*o,h=c*o+a*i-s*r,p=-a*r-s*i-u*o;return t[0]=l*c+p*-a+f*-u-h*-s,t[1]=f*c+p*-s+h*-a-l*-u,t[2]=h*c+p*-u+l*-s-f*-a,t},s.rotateX=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},s.rotateY=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},s.rotateZ=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},s.forEach=function(){var t=s.create();return function(e,n,r,i,o,a){var s,u;for(n||(n=3),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;u>s;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),s.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},"undefined"!=typeof t&&(t.vec3=s);var u={};u.create=function(){var t=new n(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},u.clone=function(t){var e=new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},u.fromValues=function(t,e,r,i){var o=new n(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=i,o},u.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},u.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},u.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},u.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t},u.sub=u.subtract,u.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},u.mul=u.multiply,u.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},u.div=u.divide,u.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},u.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},u.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},u.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},u.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+o*o)},u.dist=u.distance,u.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o},u.sqrDist=u.squaredDistance,u.length=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)},u.len=u.length,u.squaredLength=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i},u.sqrLen=u.squaredLength,u.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},u.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a),t},u.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},u.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t},u.random=function(t,e){return e=e||1,t[0]=r(),t[1]=r(),t[2]=r(),t[3]=r(),u.normalize(t,t),u.scale(t,t,e),t},u.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t},u.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*r+s*o-u*i,f=c*i+u*r-a*o,h=c*o+a*i-s*r,p=-a*r-s*i-u*o;return t[0]=l*c+p*-a+f*-u-h*-s,t[1]=f*c+p*-s+h*-a-l*-u,t[2]=h*c+p*-u+l*-s-f*-a,t},u.forEach=function(){var t=u.create();return function(e,n,r,i,o,a){var s,u;for(n||(n=4),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;u>s;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),u.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},"undefined"!=typeof t&&(t.vec4=u);var c={};c.create=function(){var t=new n(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},c.clone=function(t){var e=new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},c.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},c.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},c.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},c.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*o-i*r;return a?(a=1/a,t[0]=o*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null},c.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},c.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},c.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*s+o*u,t[1]=i*s+a*u,t[2]=r*c+o*l,t[3]=i*c+a*l,t},c.mul=c.multiply,c.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*s,t[1]=i*u+a*s,t[2]=r*-s+o*u,t[3]=i*-s+a*u,t},c.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1];return t[0]=r*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t},c.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},c.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},c.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},"undefined"!=typeof t&&(t.mat2=c);var l={};l.create=function(){var t=new n(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},l.clone=function(t){var e=new n(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},l.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},l.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},l.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=n*o-r*i;return u?(u=1/u,t[0]=o*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*s-o*a)*u,t[5]=(r*a-n*s)*u,t):null},l.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},l.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1],f=n[2],h=n[3],p=n[4],d=n[5];return t[0]=r*c+o*l,t[1]=i*c+a*l,t[2]=r*f+o*h,t[3]=i*f+a*h,t[4]=r*p+o*d+s,t[5]=i*p+a*d+u,t},l.mul=l.multiply,l.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=Math.sin(n),l=Math.cos(n);return t[0]=r*l+o*c,t[1]=i*l+a*c,t[2]=r*-c+o*l,t[3]=i*-c+a*l,t[4]=s,t[5]=u,t},l.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r*c,t[1]=i*c,t[2]=o*l,t[3]=a*l,t[4]=s,t[5]=u,t},l.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=r*c+o*l+s,t[5]=i*c+a*l+u,t},l.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},l.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},"undefined"!=typeof t&&(t.mat2d=l);var f={};f.create=function(){var t=new n(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},f.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},f.clone=function(t){var e=new n(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},f.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},f.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},f.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},f.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=l*a-s*c,h=-l*o+s*u,p=c*o-a*u,d=n*f+r*h+i*p;return d?(d=1/d,t[0]=f*d,t[1]=(-l*r+i*c)*d,t[2]=(s*r-i*a)*d,t[3]=h*d,t[4]=(l*n-i*u)*d,t[5]=(-s*n+i*o)*d,t[6]=p*d,t[7]=(-c*n+r*u)*d,t[8]=(a*n-r*o)*d,t):null},f.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8];return t[0]=a*l-s*c,t[1]=i*c-r*l,t[2]=r*s-i*a,t[3]=s*u-o*l,t[4]=n*l-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t},f.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)},f.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=n[0],p=n[1],d=n[2],v=n[3],m=n[4],g=n[5],y=n[6],b=n[7],w=n[8];return t[0]=h*r+p*a+d*c,t[1]=h*i+p*s+d*l,t[2]=h*o+p*u+d*f,t[3]=v*r+m*a+g*c,t[4]=v*i+m*s+g*l,t[5]=v*o+m*u+g*f,t[6]=y*r+b*a+w*c,t[7]=y*i+b*s+w*l,t[8]=y*o+b*u+w*f,t},f.mul=f.multiply,f.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=n[0],p=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*r+p*a+c,t[7]=h*i+p*s+l,t[8]=h*o+p*u+f,t},f.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=Math.sin(n),p=Math.cos(n);return t[0]=p*r+h*a,t[1]=p*i+h*s,t[2]=p*o+h*u,t[3]=p*a-h*r,t[4]=p*s-h*i,t[5]=p*u-h*o,t[6]=c,t[7]=l,t[8]=f,t},f.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},f.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},f.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,f=r*s,h=i*a,p=i*s,d=i*u,v=o*a,m=o*s,g=o*u;return t[0]=1-f-d,t[3]=l-g,t[6]=h+m,t[1]=l+g,t[4]=1-c-d,t[7]=p-v,t[2]=h-m,t[5]=p+v,t[8]=1-c-f,t},f.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],m=e[14],g=e[15],y=n*s-r*a,b=n*u-i*a,w=n*c-o*a,_=r*u-i*s,A=r*c-o*s,M=i*c-o*u,E=l*v-f*d,x=l*m-h*d,j=l*g-p*d,k=f*m-h*v,L=f*g-p*v,S=h*g-p*m,T=y*S-b*L+w*k+_*j-A*x+M*E;return T?(T=1/T,t[0]=(s*S-u*L+c*k)*T,t[1]=(u*j-a*S-c*x)*T,t[2]=(a*L-s*j+c*E)*T,t[3]=(i*L-r*S-o*k)*T,t[4]=(n*S-i*j+o*x)*T,t[5]=(r*j-n*L-o*E)*T,t[6]=(v*M-m*A+g*_)*T,t[7]=(m*w-d*M-g*b)*T,t[8]=(d*A-v*w+g*y)*T,t):null},f.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},f.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},"undefined"!=typeof t&&(t.mat3=f);var h={};h.create=function(){var t=new n(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},h.clone=function(t){var e=new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},h.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},h.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},h.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},h.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],m=e[14],g=e[15],y=n*s-r*a,b=n*u-i*a,w=n*c-o*a,_=r*u-i*s,A=r*c-o*s,M=i*c-o*u,E=l*v-f*d,x=l*m-h*d,j=l*g-p*d,k=f*m-h*v,L=f*g-p*v,S=h*g-p*m,T=y*S-b*L+w*k+_*j-A*x+M*E;return T?(T=1/T,t[0]=(s*S-u*L+c*k)*T,t[1]=(i*L-r*S-o*k)*T,t[2]=(v*M-m*A+g*_)*T,t[3]=(h*A-f*M-p*_)*T,t[4]=(u*j-a*S-c*x)*T,t[5]=(n*S-i*j+o*x)*T,t[6]=(m*w-d*M-g*b)*T,t[7]=(l*M-h*w+p*b)*T,t[8]=(a*L-s*j+c*E)*T,t[9]=(r*j-n*L-o*E)*T,t[10]=(d*A-v*w+g*y)*T,t[11]=(f*w-l*A-p*y)*T,t[12]=(s*x-a*k-u*E)*T,t[13]=(n*k-r*x+i*E)*T,t[14]=(v*b-d*_-m*y)*T,t[15]=(l*_-f*b+h*y)*T,t):null},h.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],m=e[14],g=e[15];return t[0]=s*(h*g-p*m)-f*(u*g-c*m)+v*(u*p-c*h),t[1]=-(r*(h*g-p*m)-f*(i*g-o*m)+v*(i*p-o*h)),t[2]=r*(u*g-c*m)-s*(i*g-o*m)+v*(i*c-o*u),t[3]=-(r*(u*p-c*h)-s*(i*p-o*h)+f*(i*c-o*u)),t[4]=-(a*(h*g-p*m)-l*(u*g-c*m)+d*(u*p-c*h)),t[5]=n*(h*g-p*m)-l*(i*g-o*m)+d*(i*p-o*h),t[6]=-(n*(u*g-c*m)-a*(i*g-o*m)+d*(i*c-o*u)),t[7]=n*(u*p-c*h)-a*(i*p-o*h)+l*(i*c-o*u),t[8]=a*(f*g-p*v)-l*(s*g-c*v)+d*(s*p-c*f),t[9]=-(n*(f*g-p*v)-l*(r*g-o*v)+d*(r*p-o*f)),t[10]=n*(s*g-c*v)-a*(r*g-o*v)+d*(r*c-o*s),t[11]=-(n*(s*p-c*f)-a*(r*p-o*f)+l*(r*c-o*s)),t[12]=-(a*(f*m-h*v)-l*(s*m-u*v)+d*(s*h-u*f)),t[13]=n*(f*m-h*v)-l*(r*m-i*v)+d*(r*h-i*f),t[14]=-(n*(s*m-u*v)-a*(r*m-i*v)+d*(r*u-i*s)),t[15]=n*(s*h-u*f)-a*(r*h-i*f)+l*(r*u-i*s),t},h.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11],p=t[12],d=t[13],v=t[14],m=t[15],g=e*a-n*o,y=e*s-r*o,b=e*u-i*o,w=n*s-r*a,_=n*u-i*a,A=r*u-i*s,M=c*d-l*p,E=c*v-f*p,x=c*m-h*p,j=l*v-f*d,k=l*m-h*d,L=f*m-h*v;return g*L-y*k+b*j+w*x-_*E+A*M},h.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],p=e[10],d=e[11],v=e[12],m=e[13],g=e[14],y=e[15],b=n[0],w=n[1],_=n[2],A=n[3];return t[0]=b*r+w*s+_*f+A*v,t[1]=b*i+w*u+_*h+A*m,t[2]=b*o+w*c+_*p+A*g,t[3]=b*a+w*l+_*d+A*y,b=n[4],w=n[5],_=n[6],A=n[7],t[4]=b*r+w*s+_*f+A*v,t[5]=b*i+w*u+_*h+A*m,t[6]=b*o+w*c+_*p+A*g,t[7]=b*a+w*l+_*d+A*y,b=n[8],w=n[9],_=n[10],A=n[11],t[8]=b*r+w*s+_*f+A*v,t[9]=b*i+w*u+_*h+A*m,t[10]=b*o+w*c+_*p+A*g,t[11]=b*a+w*l+_*d+A*y,b=n[12],w=n[13],_=n[14],A=n[15],t[12]=b*r+w*s+_*f+A*v,t[13]=b*i+w*u+_*h+A*m,t[14]=b*o+w*c+_*p+A*g,t[15]=b*a+w*l+_*d+A*y,t},h.mul=h.multiply,h.translate=function(t,e,n){var r,i,o,a,s,u,c,l,f,h,p,d,v=n[0],m=n[1],g=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*g+e[12],t[13]=e[1]*v+e[5]*m+e[9]*g+e[13],t[14]=e[2]*v+e[6]*m+e[10]*g+e[14],t[15]=e[3]*v+e[7]*m+e[11]*g+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=r*v+s*m+f*g+e[12],t[13]=i*v+u*m+h*g+e[13],t[14]=o*v+c*m+p*g+e[14],t[15]=a*v+l*m+d*g+e[15]),t},h.scale=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},h.rotate=function(t,n,r,i){var o,a,s,u,c,l,f,h,p,d,v,m,g,y,b,w,_,A,M,E,x,j,k,L,S=i[0],T=i[1],I=i[2],F=Math.sqrt(S*S+T*T+I*I);return Math.abs(F)<e?null:(F=1/F,S*=F,T*=F,I*=F,o=Math.sin(r),a=Math.cos(r),s=1-a,u=n[0],c=n[1],l=n[2],f=n[3],h=n[4],p=n[5],d=n[6],v=n[7],m=n[8],g=n[9],y=n[10],b=n[11],w=S*S*s+a,_=T*S*s+I*o,A=I*S*s-T*o,M=S*T*s-I*o,E=T*T*s+a,x=I*T*s+S*o,j=S*I*s+T*o,k=T*I*s-S*o,L=I*I*s+a,t[0]=u*w+h*_+m*A,t[1]=c*w+p*_+g*A,t[2]=l*w+d*_+y*A,t[3]=f*w+v*_+b*A,t[4]=u*M+h*E+m*x,t[5]=c*M+p*E+g*x,t[6]=l*M+d*E+y*x,t[7]=f*M+v*E+b*x,t[8]=u*j+h*k+m*L,t[9]=c*j+p*k+g*L,t[10]=l*j+d*k+y*L,t[11]=f*j+v*k+b*L,n!==t&&(t[12]=n[12],t[13]=n[13],t[14