-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
14 lines (14 loc) · 68.8 KB
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){r(47),r(82),r(83),r(84),r(85)},,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){(function(t,n){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/
"use strict";function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,r){if(o()<r)throw new RangeError("Invalid typed array length");return t.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=t.prototype):(null===e&&(e=new t(r)),e.length=r),e}function t(e,r,n){if(!(t.TYPED_ARRAY_SUPPORT||this instanceof t))return new t(e,r,n);if("number"==typeof e){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}return u(this,e,r,n)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?p(t,e,r,n):"string"==typeof e?l(t,e,r):d(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e,r,n){return s(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}function c(e,r){if(s(r),e=a(e,r<0?0:0|g(r)),!t.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)e[n]=0;return e}function l(e,r,n){if("string"==typeof n&&""!==n||(n="utf8"),!t.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|v(r,n);e=a(e,i);var o=e.write(r,n);return o!==i&&(e=e.slice(0,o)),e}function h(t,e){var r=e.length<0?0:0|g(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(e,r,n,i){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return r=void 0===n&&void 0===i?new Uint8Array(r):void 0===i?new Uint8Array(r,n):new Uint8Array(r,n,i),t.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=t.prototype):e=h(e,r),e}function d(e,r){if(t.isBuffer(r)){var n=0|g(r.length);return e=a(e,n),0===e.length?e:(r.copy(e,0,0,n),e)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?a(e,0):h(e,r);if("Buffer"===r.type&&Q(r.data))return h(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function y(e){return+e!=e&&(e=0),t.alloc(+e)}function v(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(i)return X(e).length;r=(""+r).toLowerCase(),i=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:x(e,r,n,i,o);if("number"==typeof r)return r=255&r,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):x(e,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function x(t,e,r,n,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,u=t.length,s=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,r/=2}var f;if(i){var c=-1;for(f=r;f<u;f++)if(o(t,f)===o(e,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===s)return c*a}else c!==-1&&(f-=f-c),c=-1}else for(r+s>u&&(r=u-s),f=r;f>=0;f--){for(var l=!0,h=0;h<s;h++)if(o(t,f+h)!==o(e,h)){l=!1;break}if(l)return f}return-1}function E(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function A(t,e,r,n){return J(X(e,t.length-r),t,r,n)}function S(t,e,r,n){return J(G(e),t,r,n)}function _(t,e,r,n){return S(t,e,r,n)}function T(t,e,r,n){return J(V(e),t,r,n)}function R(t,e,r,n){return J($(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?Z.fromByteArray(t):Z.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=r){var s,f,c,l;switch(u){case 1:o<128&&(a=o);break;case 2:s=t[i+1],128===(192&s)&&(l=(31&o)<<6|63&s,l>127&&(a=l));break;case 3:s=t[i+1],f=t[i+2],128===(192&s)&&128===(192&f)&&(l=(15&o)<<12|(63&s)<<6|63&f,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:s=t[i+1],f=t[i+2],c=t[i+3],128===(192&s)&&128===(192&f)&&128===(192&c)&&(l=(15&o)<<18|(63&s)<<12|(63&f)<<6|63&c,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=u}return j(n)}function j(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return r}function P(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function B(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=q(t[o]);return i}function U(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,r,n,i,o,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function k(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function H(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function F(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||F(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,i){return i||F(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(t,e,r,n,52,8),r+8}function Y(t){if(t=z(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function $(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function V(t){return Z.toByteArray(Y(t))}function J(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function W(t){return t!==t}var Z=r(24),K=r(25),Q=r(26);e.Buffer=t,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=o(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,r){return u(null,t,e,r)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,r){return f(null,t,e,r)},t.allocUnsafe=function(t){return c(null,t)},t.allocUnsafeSlow=function(t){return c(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!Q(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return t.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=t.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!t.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i},t.byteLength=v,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)b(this,e,e+1);return this},t.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},t.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},t.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):m.apply(this,arguments)},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},t.prototype.compare=function(e,r,n,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,u=n-r,s=Math.min(a,u),f=this.slice(i,o),c=e.slice(r,n),l=0;l<s;++l)if(f[l]!==c[l]){a=f[l],u=c[l];break}return a<u?-1:u<a?1:0},t.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},t.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},t.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},t.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return A(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(t.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=t.prototype;else{var o=r-e;i=new t(o,(void 0));for(var a=0;a<o;++a)i[a]=this[a+e]}return i},t.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},t.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},t.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),K.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),K.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),K.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),K.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;L(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},t.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;L(this,t,e,r,i,0)}var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):k(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):k(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):H(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):H(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):k(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):k(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):H(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r=0|r,n||L(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):H(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o,a=i-n;if(this===e&&n<r&&r<i)for(o=a-1;o>=0;--o)e[o+r]=this[o+n];else if(a<1e3||!t.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+r]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),r);return a},t.prototype.fill=function(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e=255&e);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=r;a<n;++a)this[a]=e;else{var u=t.isBuffer(e)?e:X(new t(e,i).toString()),s=u.length;for(a=0;a<n-r;++a)this[a+r]=u[a%s]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(e,r(23).Buffer,function(){return this}())},function(t,e){"use strict";function r(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)u[e]=t[e],s[t.charCodeAt(e)]=e;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63}function n(t){var e,r,n,i,o,a,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new f(3*u/4-o),n=o>0?u-4:u;var c=0;for(e=0,r=0;e<n;e+=4,r+=3)i=s[t.charCodeAt(e)]<<18|s[t.charCodeAt(e+1)]<<12|s[t.charCodeAt(e+2)]<<6|s[t.charCodeAt(e+3)],a[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=255&i;return 2===o?(i=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,a[c++]=255&i):1===o&&(i=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,a[c++]=i>>8&255,a[c++]=255&i),a}function i(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function o(t,e,r){for(var n,o=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(i(n));return o.join("")}function a(t){for(var e,r=t.length,n=r%3,i="",a=[],s=16383,f=0,c=r-n;f<c;f+=s)a.push(o(t,f,f+s>c?c:f+s));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),a.push(i),a.join("")}e.toByteArray=n,e.fromByteArray=a;var u=[],s=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array;r()},function(t,e){e.read=function(t,e,r,n,i){var o,a,u=8*i-n-1,s=(1<<u)-1,f=s>>1,c=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-c)-1,p>>=-c,c+=u;c>0;o=256*o+t[e+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===s)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,n),o-=f}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,u,s,f=8*o-i-1,c=(1<<f)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+l>=1?h/s:h*Math.pow(2,1-l),e*s>=2&&(a++,s/=2),a+l>=c?(u=0,a=c):a+l>=1?(u=(e*s-1)*Math.pow(2,i),a+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&u,p+=d,u/=256,i-=8);for(a=a<<i|u,f+=i;f>0;t[r+p]=255&a,p+=d,a/=256,f-=8);t[r+p-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},,,,,,,,,,,,,,,,,,,,,function(t,e,r){function n(t,e){o(t.font,function(r,n){if(r)throw r;var i=new THREE.TextureLoader;i.load(t.image,function(t){e(n,t)})})}if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var i=r(48),o=r(65),a=r(80);r(81),AFRAME.registerComponent("bmfont-text",{schema:{text:{type:"string"},width:{type:"number","default":1e3},align:{type:"string","default":"left"},letterSpacing:{type:"number","default":0},lineHeight:{type:"number","default":38},fnt:{type:"string","default":"https://cdn.rawgit.com/bryik/aframe-bmfont-text-component/aa0655cf90f646e12c40ab4708ea90b4686cfb45/assets/DejaVu-sdf.fnt"},fntImage:{type:"string","default":"https://cdn.rawgit.com/bryik/aframe-bmfont-text-component/aa0655cf90f646e12c40ab4708ea90b4686cfb45/assets/DejaVu-sdf.png"},mode:{type:"string","default":"normal"},color:{type:"color","default":"#000"},opacity:{type:"number","default":"1.0"}},update:function(t){function e(t,e){e.needsUpdate=!0,e.anisotropy=16;var n={font:t,text:o.text,width:o.width,align:o.align,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,mode:o.mode},u=i(n),s=new THREE.RawShaderMaterial(a({map:e,side:THREE.DoubleSide,transparent:!0,color:o.color,opacity:o.opacity})),f=new THREE.Mesh(u,s);f.rotation.y=Math.PI,f.scale.multiplyScalar(-.005),r.setObject3D("bmfont-text",f)}var r=this.el,o=this.data;n({font:o.fnt,image:o.fntImage},e)},remove:function(){this.el.removeObject3D("bmfont-text")}})},function(t,e,r){function n(t){l.call(this),"string"==typeof t&&(t={text:t}),this._opt=s({},t),t&&this.update(t)}var i=r(49),o=r(54),a=r(55),u=r(59),s=r(62),f=r(63),c=r(64),l=THREE.BufferGeometry;t.exports=function(t){return new n(t)},o(n,l),n.prototype.update=function(t){if("string"==typeof t&&(t={text:t}),t=s({},this._opt,t),!t.font)throw new TypeError("must specify a { font } in options");this.layout=i(t);var e=t.flipY!==!1,r=t.font,n=r.common.scaleW,o=r.common.scaleH,c=this.layout.glyphs.filter(function(t){var e=t.data;return e.width*e.height>0});this.visibleGlyphs=c;var l=f.positions(c),h=f.uvs(c,n,o,e),p=a({clockwise:!0,type:"uint16",count:c.length});if(u.index(this,p,1,"uint16"),u.attr(this,"position",l,2),u.attr(this,"uv",h,2),!t.multipage&&"page"in this.attributes)this.removeAttribute("page");else if(t.multipage){var d=f.pages(c);u.attr(this,"page",d,1)}},n.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var t=this.attributes.position.array,e=this.attributes.position.itemSize;return!t||!e||t.length<2?(this.boundingSphere.radius=0,void this.boundingSphere.center.set(0,0,0)):(c.computeSphere(t,this.boundingSphere),void(isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')))},n.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var t=this.boundingBox,e=this.attributes.position.array,r=this.attributes.position.itemSize;return!e||!r||e.length<2?void t.makeEmpty():void c.computeBox(e,t)}},function(t,e,r){function n(t){this.glyphs=[],this._measure=this.computeMetrics.bind(this),this.update(t)}function i(t){Object.defineProperty(n.prototype,t,{get:o(t),configurable:!0})}function o(t){return new Function(["return function "+t+"() {"," return this._"+t,"}"].join("\n"))()}function a(t,e){if(!t.chars||0===t.chars.length)return null;var r=d(t.chars,e);return r>=0?t.chars[r]:null}function u(t){for(var e=0;e<y.length;e++){var r=y[e].charCodeAt(0),n=d(t.chars,r);if(n>=0)return t.chars[n].height}return 0}function s(t){for(var e=0;e<v.length;e++){var r=v[e].charCodeAt(0),n=d(t.chars,r);if(n>=0)return t.chars[n]}return 0}function f(t){for(var e=0;e<m.length;e++){var r=m[e].charCodeAt(0),n=d(t.chars,r);if(n>=0)return t.chars[n].height}return 0}function c(t,e,r){if(!t.kernings||0===t.kernings.length)return 0;for(var n=t.kernings,i=0;i<n.length;i++){var o=n[i];if(o.first===e&&o.second===r)return o.amount}return 0}function l(t){return"center"===t?E:"right"===t?A:x}var h=r(50),p=r(51),d=r(52)("id"),g=r(53),y=["x","e","a","o","n","s","r","c","u","m","v","w","z"],v=["m","w"],m=["H","I","N","E","F","K","L","T","U","V","W","X","Y","Z"],b="\t".charCodeAt(0),w=" ".charCodeAt(0),x=0,E=1,A=2;t.exports=function(t){return new n(t)},n.prototype.update=function(t){if(t=p({measure:this._measure},t),this._opt=t,this._opt.tabSize=g(this._opt.tabSize,4),!t.font)throw new Error("must provide a valid bitmap font");var e=this.glyphs,r=t.text||"",n=t.font;this._setupSpaceGlyphs(n);var i=h.lines(r,t),o=t.width||0;e.length=0;var a=i.reduce(function(t,e){return Math.max(t,e.width,o)},0),s=0,d=0,y=g(t.lineHeight,n.common.lineHeight),v=n.common.base,m=y-v,b=t.letterSpacing||0,w=y*i.length-m,x=l(this._opt.align);d-=w,this._width=a,this._height=w,this._descender=y-v,this._baseline=v,this._xHeight=u(n),this._capHeight=f(n),this._lineHeight=y,this._ascender=y-m-this._xHeight;var S=this;i.forEach(function(t,i){for(var o,u=t.start,f=t.end,l=t.width,h=u;h<f;h++){var p=r.charCodeAt(h),g=S.getGlyph(n,p);if(g){o&&(s+=c(n,o.id,g.id));var v=s;x===E?v+=(a-l)/2:x===A&&(v+=a-l),e.push({position:[v,d],data:g,index:h,line:i}),s+=g.xadvance+b,o=g}}d+=y,s=0}),this._linesTotal=i.length},n.prototype._setupSpaceGlyphs=function(t){if(this._fallbackSpaceGlyph=null,this._fallbackTabGlyph=null,t.chars&&0!==t.chars.length){var e=a(t,w)||s(t)||t.chars[0],r=this._opt.tabSize*e.xadvance;this._fallbackSpaceGlyph=e,this._fallbackTabGlyph=p(e,{x:0,y:0,xadvance:r,id:b,xoffset:0,yoffset:0,width:0,height:0})}},n.prototype.getGlyph=function(t,e){var r=a(t,e);return r?r:e===b?this._fallbackTabGlyph:e===w?this._fallbackSpaceGlyph:null},n.prototype.computeMetrics=function(t,e,r,n){var i,o,a=this._opt.letterSpacing||0,u=this._opt.font,s=0,f=0,l=0;if(!u.chars||0===u.chars.length)return{start:e,end:e,width:0};r=Math.min(t.length,r);for(var h=e;h<r;h++){var p=t.charCodeAt(h),i=this.getGlyph(u,p);if(i){var d=(i.xoffset,o?c(u,o.id,i.id):0);s+=d;var g=s+i.xadvance+a,y=s+i.width;if(y>=n||g>=n)break;s=g,f=y,o=i}l++}return o&&(f+=o.xoffset),{start:e,end:e+l,width:f}},["width","height","descender","ascender","xHeight","baseline","capHeight","lineHeight"].forEach(i)},function(t,e){function r(t,e,r,n){var i=t.indexOf(e,r);return i===-1||i>n?n:i}function n(t){return f.test(t)}function i(t,e,r,n,i){for(var o=[],a=r,s=r;s<n&&s<e.length;s++){var f=e.charAt(s),c=u.test(f);if(c||s===n-1){var l=c?s:s+1,h=t(e,a,l,i);o.push(h),a=s+1}}return o}function o(t,e,i,o,a,u){var f=[],c=a;for("nowrap"===u&&(c=Number.MAX_VALUE);i<o&&i<e.length;){for(var l=r(e,s,i,o);i<l&&n(e.charAt(i));)i++;var h=t(e,i,l,c),p=i+(h.end-h.start),d=p+s.length;if(p<l){for(;p>i&&!n(e.charAt(p));)p--;if(p===i)d>i+s.length&&d--,p=d;else for(d=p;p>i&&n(e.charAt(p-s.length));)p--}if(p>=i){var g=t(e,i,p,c);f.push(g)}i=d}return f}function a(t,e,r,n){var i=Math.min(n,r-e);return{start:e,end:e+i}}var u=/\n/,s="\n",f=/\s/;t.exports=function(e,r){var n=t.exports.lines(e,r);return n.map(function(t){return e.substring(t.start,t.end)}).join("\n")},t.exports.lines=function(t,e){if(e=e||{},0===e.width&&"nowrap"!==e.mode)return[];t=t||"";var r="number"==typeof e.width?e.width:Number.MAX_VALUE,n=Math.max(0,e.start||0),u="number"==typeof e.end?e.end:t.length,s=e.mode,f=e.measure||a;return"pre"===s?i(f,t,n,u,r):o(f,t,n,u,r,s)}},function(t,e){function r(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)n.call(r,i)&&(t[i]=r[i])}return t}t.exports=r;var n=Object.prototype.hasOwnProperty},function(t,e){t.exports=function(t){if(!t||"string"!=typeof t)throw new Error("must specify property for indexof search");return new Function("array","value","start",["start = start || 0","for (var i=start; i<array.length; i++)",' if (array[i]["'+t+'"] === value)'," return i","return -1"].join("\n"))}},function(t,e){t.exports=function(t,e){return"number"==typeof t?t:"number"==typeof e?e:0}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){var n=r(56),i=r(57),o=r(58),a=[0,2,3],u=[2,1,3];t.exports=function(t,e){t&&(i(t)||o(t))||(e=t||{},t=null),e="number"==typeof e?{count:e}:e||{};for(var r="string"==typeof e.type?e.type:"uint16",s="number"==typeof e.count?e.count:1,f=e.start||0,c=e.clockwise!==!1?a:u,l=c[0],h=c[1],p=c[2],d=6*s,g=t||new(n(r))(d),y=0,v=0;y<d;y+=6,v+=4){var m=y+f;g[m+0]=v+0,g[m+1]=v+1,g[m+2]=v+2,g[m+3]=v+l,g[m+4]=v+h,g[m+5]=v+p}return g}},function(t,e){t.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},function(t,e){function r(t){return t.BYTES_PER_ELEMENT&&"[object ArrayBuffer]"===n.call(t.buffer)||Array.isArray(t)}var n=Object.prototype.toString;t.exports=r},function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function n(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/
t.exports=function(t){return null!=t&&(r(t)||n(t)||!!t._isBuffer)}},function(t,e,r){function n(t,e,r,n){"number"!=typeof r&&(r=1),"string"!=typeof n&&(n="uint16");var i=!t.index&&"function"!=typeof t.setIndex,a=i?t.getAttribute("index"):t.index,u=o(a,e,r,n);u&&(i?t.addAttribute("index",u):t.index=u)}function i(t,e,r,n,i){if("number"!=typeof n&&(n=3),"string"!=typeof i&&(i="float32"),Array.isArray(r)&&Array.isArray(r[0])&&r[0].length!==n)throw new Error("Nested vertex array has unexpected size; expected "+n+" but found "+r[0].length);var a=t.getAttribute(e),u=o(a,r,n,i);u&&t.addAttribute(e,u)}function o(t,e,r,n){return e=e||[],!t||a(t,e,r)?(e=u(e,n),t&&!s&&(s=!0,console.warn(["A WebGL buffer is being updated with a new size or itemSize, ","however ThreeJS only supports fixed-size buffers.\nThe old buffer may ","still be kept in memory.\n","To avoid memory leaks, it is recommended that you dispose ","your geometries and create new ones, or support the following PR in ThreeJS:\n","https://github.com/mrdoob/three.js/pull/9631"].join(""))),t=new THREE.BufferAttribute(e,r),t.needsUpdate=!0,t):(u(e,t.array),t.needsUpdate=!0,null)}function a(t,e,r){if(t.itemSize!==r)return!0;if(!t.array)return!0;var n=t.array.length;return Array.isArray(e)&&Array.isArray(e[0])?n!==e.length*r:n!==e.length}var u=r(60),s=!1;t.exports.attr=i,t.exports.index=n},function(t,e,r){function n(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var n=t[0].length,o=t.length*n;e&&"string"!=typeof e||(e=new(i(e||"float32"))(o+r));var a=e.length-r;if(o!==a)throw new Error("source length "+o+" ("+n+"x"+t.length+") does not match destination length "+a);for(var u=0,s=r;u<t.length;u++)for(var f=0;f<n;f++)e[s++]=t[u][f]}else if(e&&"string"!=typeof e)e.set(t,r);else{var c=i(e||"float32");0===r?e=new c(t):(e=new c(t.length+r),e.set(t,r))}return e}var i=r(61);t.exports=n},function(t,e){t.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},function(t,e){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(o){return!1}}var i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=n()?Object.assign:function(t,e){for(var n,a,u=r(t),s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var f in n)i.call(n,f)&&(u[f]=n[f]);if(Object.getOwnPropertySymbols){a=Object.getOwnPropertySymbols(n);for(var c=0;c<a.length;c++)o.call(n,a[c])&&(u[a[c]]=n[a[c]])}}return u}},function(t,e){t.exports.pages=function r(t){var r=new Float32Array(4*t.length*1),e=0;return t.forEach(function(t){var n=t.data.page||0;r[e++]=n,r[e++]=n,r[e++]=n,r[e++]=n}),r},t.exports.uvs=function n(t,e,r,i){var n=new Float32Array(4*t.length*2),o=0;return t.forEach(function(t){var a=t.data,u=a.x+a.width,s=a.y+a.height,f=a.x/e,c=a.y/r,l=u/e,h=s/r;i&&(c=(r-a.y)/r,h=(r-s)/r),n[o++]=f,n[o++]=c,n[o++]=f,n[o++]=h,n[o++]=l,n[o++]=h,n[o++]=l,n[o++]=c}),n},t.exports.positions=function i(t){var i=new Float32Array(4*t.length*2),e=0;return t.forEach(function(t){var r=t.data,n=t.position[0]+r.xoffset,o=t.position[1]+r.yoffset,a=r.width,u=r.height;i[e++]=n,i[e++]=o,i[e++]=n,i[e++]=o+u,i[e++]=n+a,i[e++]=o+u,i[e++]=n+a,i[e++]=o}),i}},function(t,e){function r(t){var e=t.length/n;i.min[0]=t[0],i.min[1]=t[1],i.max[0]=t[0],i.max[1]=t[1];for(var r=0;r<e;r++){var o=t[r*n+0],a=t[r*n+1];i.min[0]=Math.min(o,i.min[0]),i.min[1]=Math.min(a,i.min[1]),i.max[0]=Math.max(o,i.max[0]),i.max[1]=Math.max(a,i.max[1])}}var n=2,i={min:[0,0],max:[0,0]};t.exports.computeBox=function(t,e){r(t),e.min.set(i.min[0],i.min[1],0),e.max.set(i.max[0],i.max[1],0)},t.exports.computeSphere=function(t,e){r(t);var n=i.min[0],o=i.min[1],a=i.max[0],u=i.max[1],s=a-n,f=u-o,c=Math.sqrt(s*s+f*f);e.center.set(n+s/2,o+f/2,0),e.radius=c/2}},function(t,e,r){(function(e){function n(t){var e=Object.prototype.toString;return"[object ArrayBuffer]"===e.call(t)}function i(t){if(h)return l(t,{responseType:"arraybuffer"});if("undefined"==typeof window.XMLHttpRequest)throw new Error("your browser does not support XHR loading");var e=new window.XMLHttpRequest;return e.overrideMimeType("text/plain; charset=x-user-defined"),l({xhr:e},t)}var o=r(66),a=function(){},u=r(73),s=r(74),f=r(77),c=r(78),l=r(72),h=function(){return window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}();t.exports=function(t,r){r="function"==typeof r?r:a,"string"==typeof t?t={uri:t}:t||(t={});var l=t.binary;l&&(t=i(t)),o(t,function(i,o,l){if(i)return r(i);if(!/^2/.test(o.statusCode))return r(new Error("http status code: "+o.statusCode));if(!l)return r(new Error("no body result"));var h=!1;if(n(l)){var p=new Uint8Array(l);l=new e(p,"binary")}c(l)&&(h=!0,"string"==typeof l&&(l=new e(l,"binary"))),h||(e.isBuffer(l)&&(l=l.toString(t.encoding)),l=l.trim());var d;try{var g=o.headers["content-type"];d=h?f(l):/json/.test(g)||"{"===l.charAt(0)?JSON.parse(l):/xml/.test(g)||"<"===l.charAt(0)?s(l):u(l)}catch(y){r(new Error("error parsing font "+y.message)),r=a}r(null,d)})}}).call(e,r(23).Buffer)},function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t.length;r++)e(t[r])}function i(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function o(t,e,r){var n=t;return l(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=p(e,{uri:t}),n.callback=r,n}function a(t,e,r){return e=o(t,e,r),u(e)}function u(t){function e(){4===l.readyState&&o()}function r(){var t=void 0;if(t=l.response?l.response:l.responseText||s(l),x)try{t=JSON.parse(t)}catch(e){}return t}function n(t){return clearTimeout(g),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,f(t,c)}function o(){if(!d){var e;clearTimeout(g),e=t.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var n=c,i=null;return 0!==e?(n={body:r(),statusCode:e,method:v,headers:{},url:y,rawRequest:l},l.getAllResponseHeaders&&(n.headers=h(l.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),f(i,n,n.body)}}if("undefined"==typeof t.callback)throw new Error("callback argument missing");var u=!1,f=function(e,r,n){u||(u=!0,t.callback(e,r,n))},c={body:void 0,headers:{},statusCode:0,method:v,url:y,rawRequest:l},l=t.xhr||null;l||(l=t.cors||t.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var p,d,g,y=l.url=t.uri||t.url,v=l.method=t.method||"GET",m=t.body||t.data||null,b=l.headers=t.headers||{},w=!!t.sync,x=!1;if("json"in t&&(x=!0,b.accept||b.Accept||(b.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(b["content-type"]||b["Content-Type"]||(b["Content-Type"]="application/json"),m=JSON.stringify(t.json))),l.onreadystatechange=e,l.onload=o,l.onerror=n,l.onprogress=function(){},l.ontimeout=n,l.open(v,y,!w,t.username,t.password),w||(l.withCredentials=!!t.withCredentials),!w&&t.timeout>0&&(g=setTimeout(function(){d=!0,l.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)},t.timeout)),l.setRequestHeader)for(p in b)b.hasOwnProperty(p)&&l.setRequestHeader(p,b[p]);else if(t.headers&&!i(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(l.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(l),l.send(m),l}function s(t){if("document"===t.responseType)return t.responseXML;var e=204===t.status&&t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function f(){}var c=r(67),l=r(68),h=r(69),p=r(72);t.exports=a,a.XMLHttpRequest=c.XMLHttpRequest||f,a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:c.XDomainRequest,n(["get","put","post","patch","head","delete"],function(t){a["delete"===t?"del":t]=function(e,r,n){return r=o(e,r,n),r.method=t.toUpperCase(),u(r)}})},function(t,e){(function(e){"undefined"!=typeof window?t.exports=window:"undefined"!=typeof e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(e,function(){return this}())},function(t,e){function r(t){var e=n.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}t.exports=r;var n=Object.prototype.toString},function(t,e,r){var n=r(70),i=r(71),o=function(t){return"[object Array]"===Object.prototype.toString.call(t)};t.exports=function(t){if(!t)return{};var e={};return i(n(t).split("\n"),function(t){var r=t.indexOf(":"),i=n(t.slice(0,r)).toLowerCase(),a=n(t.slice(r+1));"undefined"==typeof e[i]?e[i]=a:o(e[i])?e[i].push(a):e[i]=[e[i],a]}),e}},function(t,e){function r(t){return t.replace(/^\s*|\s*$/g,"")}e=t.exports=r,e.left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}},function(t,e,r){function n(t,e,r){if(!u(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===s.call(t)?i(t,e,r):"string"==typeof t?o(t,e,r):a(t,e,r)}function i(t,e,r){for(var n=0,i=t.length;n<i;n++)f.call(t,n)&&e.call(r,t[n],n,t)}function o(t,e,r){for(var n=0,i=t.length;n<i;n++)e.call(r,t.charAt(n),n,t)}function a(t,e,r){for(var n in t)f.call(t,n)&&e.call(r,t[n],n,t)}var u=r(68);t.exports=n;var s=Object.prototype.toString,f=Object.prototype.hasOwnProperty},function(t,e){function r(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)n.call(r,i)&&(t[i]=r[i])}return t}t.exports=r;var n=Object.prototype.hasOwnProperty},function(t,e){function r(t,e){if(t=t.replace(/\t+/g," ").trim(),!t)return null;var r=t.indexOf(" ");if(r===-1)throw new Error("no named row at line "+e);var i=t.substring(0,r);t=t.substring(r+1),t=t.replace(/letter=[\'\"]\S+[\'\"]/gi,""),t=t.split("="),t=t.map(function(t){return t.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)});for(var o=[],a=0;a<t.length;a++){var u=t[a];0===a?o.push({key:u[0],data:""}):a===t.length-1?o[o.length-1].data=n(u[0]):(o[o.length-1].data=n(u[0]),o.push({key:u[1],data:""}))}var s={key:i,data:{}};return o.forEach(function(t){s.data[t.key]=t.data}),s}function n(t){return t&&0!==t.length?0===t.indexOf('"')||0===t.indexOf("'")?t.substring(1,t.length-1):t.indexOf(",")!==-1?i(t):parseInt(t,10):""}function i(t){return t.split(",").map(function(t){return parseInt(t,10)})}t.exports=function(t){if(!t)throw new Error("no data provided");t=t.toString().trim();var e={pages:[],chars:[],kernings:[]},n=t.split(/\r\n?|\n/g);if(0===n.length)throw new Error("no data in BMFont file");for(var i=0;i<n.length;i++){var o=r(n[i],i);if(o)if("page"===o.key){if("number"!=typeof o.data.id)throw new Error("malformed file at line "+i+" -- needs page id=N");if("string"!=typeof o.data.file)throw new Error("malformed file at line "+i+' -- needs page file="path"');e.pages[o.data.id]=o.data.file}else"chars"===o.key||"kernings"===o.key||("char"===o.key?e.chars.push(o.data):"kerning"===o.key?e.kernings.push(o.data):e[o.key]=o.data)}return e}},function(t,e,r){function n(t){var e=i(t);return e.reduce(function(t,e){var r=o(e.nodeName);return t[r]=e.nodeValue,t},{})}function i(t){for(var e=[],r=0;r<t.attributes.length;r++)e.push(t.attributes[r]);return e}function o(t){return s[t.toLowerCase()]||t}var a=r(75),u=r(76),s={scaleh:"scaleH",scalew:"scaleW",stretchh:"stretchH",lineheight:"lineHeight",alphachnl:"alphaChnl",redchnl:"redChnl",greenchnl:"greenChnl",bluechnl:"blueChnl"};t.exports=function(t){t=t.toString();var e=u(t),r={pages:[],chars:[],kernings:[]};["info","common"].forEach(function(t){var i=e.getElementsByTagName(t)[0];i&&(r[t]=a(n(i)))});var i=e.getElementsByTagName("pages")[0];if(!i)throw new Error("malformed file -- no <pages> element");for(var o=i.getElementsByTagName("page"),s=0;s<o.length;s++){var f=o[s],c=parseInt(f.getAttribute("id"),10),l=f.getAttribute("file");if(isNaN(c))throw new Error('malformed file -- page "id" attribute is NaN');if(!l)throw new Error('malformed file -- needs page "file" attribute');r.pages[parseInt(c,10)]=l}return["chars","kernings"].forEach(function(t){var i=e.getElementsByTagName(t)[0];if(i)for(var o=t.substring(0,t.length-1),u=i.getElementsByTagName(o),s=0;s<u.length;s++){var f=u[s];r[t].push(a(n(f)))}}),r}},function(t,e){function r(t){return t.split(",").map(function(t){return parseInt(t,10)})}var n="chasrset";t.exports=function(t){n in t&&(t.charset=t[n],delete t[n]);for(var e in t)"face"!==e&&"charset"!==e&&("padding"===e||"spacing"===e?t[e]=r(t[e]):t[e]=parseInt(t[e],10));return t}},function(t,e){t.exports=function(){return"undefined"!=typeof window.DOMParser?function(t){var e=new window.DOMParser;return e.parseFromString(t,"application/xml")}:"undefined"!=typeof window.ActiveXObject&&new window.ActiveXObject("Microsoft.XMLDOM")?function(t){var e=new window.ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e}:function(t){var e=document.createElement("div");return e.innerHTML=t,e}}()},function(t,e){function r(t,e,r){if(r>e.length-1)return 0;var s=e.readUInt8(r++),f=e.readInt32LE(r);switch(r+=4,s){case 1:t.info=n(e,r);break;case 2:t.common=i(e,r);break;case 3:t.pages=o(e,r,f);break;case 4:t.chars=a(e,r,f);break;case 5:t.kernings=u(e,r,f)}return 5+f}function n(t,e){var r={};r.size=t.readInt16LE(e);var n=t.readUInt8(e+2);return r.smooth=n>>7&1,r.unicode=n>>6&1,r.italic=n>>5&1,r.bold=n>>4&1,n>>3&1&&(r.fixedHeight=1),r.charset=t.readUInt8(e+3)||"",r.stretchH=t.readUInt16LE(e+4),r.aa=t.readUInt8(e+6),r.padding=[t.readInt8(e+7),t.readInt8(e+8),t.readInt8(e+9),t.readInt8(e+10)],r.spacing=[t.readInt8(e+11),t.readInt8(e+12)],r.outline=t.readUInt8(e+13),r.face=f(t,e+14),r}function i(t,e){var r={};r.lineHeight=t.readUInt16LE(e),r.base=t.readUInt16LE(e+2),r.scaleW=t.readUInt16LE(e+4),r.scaleH=t.readUInt16LE(e+6),r.pages=t.readUInt16LE(e+8);t.readUInt8(e+10);return r.packed=0,r.alphaChnl=t.readUInt8(e+11),r.redChnl=t.readUInt8(e+12),r.greenChnl=t.readUInt8(e+13),r.blueChnl=t.readUInt8(e+14),r}function o(t,e,r){for(var n=[],i=s(t,e),o=i.length+1,a=r/o,u=0;u<a;u++)n[u]=t.slice(e,e+i.length).toString("utf8"),e+=o;return n}function a(t,e,r){for(var n=[],i=r/20,o=0;o<i;o++){var a={},u=20*o;a.id=t.readUInt32LE(e+0+u),a.x=t.readUInt16LE(e+4+u),a.y=t.readUInt16LE(e+6+u),a.width=t.readUInt16LE(e+8+u),a.height=t.readUInt16LE(e+10+u),a.xoffset=t.readInt16LE(e+12+u),a.yoffset=t.readInt16LE(e+14+u),a.xadvance=t.readInt16LE(e+16+u),a.page=t.readUInt8(e+18+u),a.chnl=t.readUInt8(e+19+u),n[o]=a}return n}function u(t,e,r){for(var n=[],i=r/10,o=0;o<i;o++){var a={},u=10*o;a.first=t.readUInt32LE(e+0+u),a.second=t.readUInt32LE(e+4+u),a.amount=t.readInt16LE(e+8+u),n[o]=a}return n}function s(t,e){for(var r=e;r<t.length&&0!==t[r];r++);return t.slice(e,r)}function f(t,e){return s(t,e).toString("utf8")}var c=[66,77,70];t.exports=function(t){if(t.length<6)throw new Error("invalid buffer length for BMFont");var e=c.every(function(e,r){return t.readUInt8(r)===e});if(!e)throw new Error("BMFont missing BMF byte header");var n=3,i=t.readUInt8(n++);if(i>3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var o={kernings:[],chars:[]},a=0;a<5;a++)n+=r(o,t,n);return o}},function(t,e,r){(function(e){var n=r(79),i=new e([66,77,70,3]);t.exports=function(t){return"string"==typeof t?"BMF"===t.substring(0,3):t.length>4&&n(t.slice(0,4),i)}}).call(e,r(23).Buffer)},function(t,e,r){var n=r(23).Buffer;t.exports=function(t,e){if(n.isBuffer(t)&&n.isBuffer(e)){if("function"==typeof t.equals)return t.equals(e);if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}}},function(t,e,r){var n=r(62);t.exports=function(t){t=t||{};var e="number"==typeof t.opacity?t.opacity:1,r="number"==typeof t.alphaTest?t.alphaTest:1e-4,i=t.precision||"highp",o=t.color,a=t.map;return delete t.map,delete t.color,delete t.precision,delete t.opacity,n({uniforms:{opacity:{type:"f",value:e},map:{type:"t",value:a||new THREE.Texture},color:{type:"c",value:new THREE.Color(o)}},vertexShader:["attribute vec2 uv;","attribute vec4 position;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * position;","}"].join("\n"),fragmentShader:["#ifdef GL_OES_standard_derivatives","#extension GL_OES_standard_derivatives : enable","#endif","precision "+i+" float;","uniform float opacity;","uniform vec3 color;","uniform sampler2D map;","varying vec2 vUv;","float aastep(float value) {"," #ifdef GL_OES_standard_derivatives"," float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757;"," #else"," float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));"," #endif"," return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);","}","void main() {"," vec4 texColor = texture2D(map, vUv);"," float alpha = aastep(texColor.a);"," gl_FragColor = vec4(color, opacity * alpha);",0===r?"":" if (gl_FragColor.a < "+r+") discard;","}"].join("\n")},t)}},function(t,e){var r=AFRAME.utils.extendDeep,n=AFRAME.primitives.getMeshMixin();AFRAME.registerPrimitive("a-text",r({},n,{defaultComponents:{"bmfont-text":{}},mappings:{text:"bmfont-text.text",width:"bmfont-text.width",align:"bmfont-text.align",letterSpacing:"bmfont-text.letterSpacing",lineHeight:"bmfont-text.lineHeight",fnt:"bmfont-text.fnt",fntImage:"bmfont-text.fntImage",mode:"bmfont-text.mode",color:"bmfont-text.color",opacity:"bmfont-text.opacity"}}))},function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("entity-generator",{schema:{mixin:{"default":""},num:{"default":10}},init:function(){for(var t=this.data,e=0;e<t.num;e++){var r=document.createElement("a-entity");r.setAttribute("mixin",t.mixin),this.el.appendChild(r)}}})},function(t,e){function r(t,e,r){for(var n=[],i=Math.ceil(e/t.columns),o=0;o<i;o++)for(var a=0;a<t.columns;a++)n.push([a*t.margin,o*t.margin,0]);return n}function n(t,e,r){for(var n=[],i=0;i<e;i++){var o=i*(2*Math.PI)/e;n.push([r.x+t.radius*Math.cos(o),r.y,r.z+t.radius*Math.sin(o)])}return n}function i(t,e,n){return t.columns=e,r(t,e,n)}function o(t,e,r){return s([[1,0,0],[0,1,0],[0,0,1],[-1,0,0],[0,-1,0],[0,0,-1]],r,t.radius/2)}function a(t,e,r){var n=(1+Math.sqrt(5))/2,i=1/n,o=2-n,a=-1*i,u=-1*o;return s([[-1,o,0],[-1,u,0],[0,-1,o],[0,-1,u],[0,1,o],[0,1,u],[1,o,0],[1,u,0],[i,i,i],[i,i,a],[i,a,i],[i,a,a],[o,0,1],[o,0,-1],[a,i,i],[a,i,a],[a,a,i],[a,a,a],[u,0,1],[u,0,-1]],r,t.radius/2)}function u(t,e,r){var n=Math.sqrt(3),i=-1/Math.sqrt(3),o=2*Math.sqrt(2/3);return s([[0,0,n+i],[-1,0,i],[1,0,i],[0,o,0]],r,t.radius/2)}function s(t,e,r){return e=[e.x,e.y,e.z],t.map(function(t){return t.map(function(t,n){return t*r+e[n]})})}function f(t,e){t.forEach(function(t,r){var n=e[r];t.setAttribute("position",{x:n[0],y:n[1],z:n[2]})})}AFRAME.registerComponent("layout",{schema:{columns:{"default":1,min:0,"if":{type:["box"]}},margin:{"default":1,min:0,"if":{type:["box","line"]}},radius:{"default":1,min:0,"if":{type:["circle","cube","dodecahedron","pyramid"]}},type:{"default":"line",oneOf:["box","circle","cube","dodecahedron","line","pyramid"]}},init:function(){var t=this,e=this.el;this.children=e.getChildEntities(),this.initialPositions=[],this.children.forEach(function(e){function r(){var r=e.getComputedAttribute("position");t.initialPositions.push([r.x,r.y,r.z])}return e.hasLoaded?r():void e.addEventListener("loaded",r)}),e.addEventListener("child-attached",function(r){r.detail.el.parentNode===e&&(t.children.push(r.detail.el),t.update())})},update:function(t){var e,s,c=this.children,l=this.data,h=this.el,p=c.length,d=h.getComputedAttribute("position");switch(l.type){case"box":e=r;break;case"circle":e=n;break;case"cube":e=o;break;case"dodecahedron":e=a;break;case"pyramid":e=u;break;default:e=i}s=e(l,p,d),f(c,s)},remove:function(){this.el.removeEventListener("child-attached",this.childAttachedCallback),f(this.children,this.initialPositions)}}),t.exports.getBoxPositions=r,t.exports.getCirclePositions=n,t.exports.getLinePositions=i,t.exports.getCubePositions=o,t.exports.getDodecahedronPositions=a,t.exports.getPyramidPositions=u},function(t,e){!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e,r){return new Promise(function(n){l(e).then(function(){g[t]={template:u(e)(r.trim()),type:e},n(g[t])})})}function i(t,e,r){switch(e){case m:return t(r);case b:return t(r);case w:return Mustache.render(t,r);case x:return t.render(r);default:return console.log(t),console.log(r),h(t,r)}}function o(t,e){var r=document.querySelector(t),i=r.getAttribute("type"),o=r.innerHTML;if(!e){if(!i)throw new Error("Must provide `type` attribute for <script> templates (e.g., handlebars, jade, nunjucks, html)");if(-1!==i.indexOf("handlebars"))e=m;else if(-1!==i.indexOf("jade"))e=b;else if(-1!==i.indexOf("mustache"))e=w;else if(-1!==i.indexOf("nunjucks"))e=x;else{if(-1===i.indexOf("html"))return void y("Template type could not be inferred from the script tag. Please add a type.");e=E}}return new Promise(function(r){n(t,e,o).then(function(t){r(t,e)})})}function a(t,e){return new Promise(function(r){var i;i=new XMLHttpRequest,i.addEventListener("load",function(){n(t,e,i.response).then(function(t){r(t,e)})}),i.open("GET",t),i.send()})}function u(t){switch(t){case m:return s;case b:return f;case w:return s;case x:return c;default:return function(t){return t}}}function s(t){return Handlebars.compile(t)}function f(t){return jade.compile(t)}function c(t){return nunjucks.compile(t)}function l(t){return new Promise(function(e){if(!t||"html"===t)return e();var r=A[t];if(A[t]===!0)return e();r||(r=document.createElement("script"),A[t]=r,r.setAttribute("src",S[t]),v('Lazy-loading %s engine. Please add <script src="%s"> to your page.',t,S[t]),document.body.appendChild(r));var n=r.onload||function(){};r.onload=function(){n(),A[t]=!0,e()}})}var h=r(11),p=AFRAME.utils.debug,d=AFRAME.utils.extend,g={},y=p("template-component:error"),v=p("template-component:info"),m="handlebars",b="jade",w="mustache",x="nunjucks",E="html",A={};A[m]=!!window.Handlebars,A[b]=!!window.jade,A[w]=!!window.Mustache,A[x]=!!window.nunjucks;var S={};S[m]="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js",S[b]="https://cdnjs.cloudflare.com/ajax/libs/jade/1.11.0/jade.min.js",S[w]="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.2.1/mustache.min.js",S[x]="https://cdnjs.cloudflare.com/ajax/libs/nunjucks/2.3.0/nunjucks.min.js",AFRAME.registerComponent("template",{schema:{insert:{"default":"beforeend"},type:{"default":""},src:{"default":""},data:{"default":""}},update:function(t){var e=this.data,r=this.el,n="#"===e.src[0]?o:a,i=g[e.src];if(t&&t.src!==e.src)for(;r.firstChild;)r.removeChild(r.firstChild);return i?void this.renderTemplate(i):void n(e.src,e.type).then(this.renderTemplate.bind(this))},renderTemplate:function(t){var e=this.el,r=this.data,n={};Object.keys(e.dataset).forEach(function(t){n[t]=e.dataset[t]}),r.data&&(n=d(n,e.getComputedAttribute(r.data)));var o=i(t.template,t.type,n);e.insertAdjacentHTML(r.insert,o)}}),AFRAME.registerComponent("template-set",{schema:{on:{type:"string"},src:{type:"string"},data:{type:"string"}},init:function(){var t=this.data,e=this.el;e.addEventListener(t.on,function(){e.setAttribute("template",{src:t.src,data:t.data})})}})},function(t,e){"use strict";var r=Array.prototype.forEach,n=Object.create;t.exports=function(t){var e=n(null);return r.call(arguments,function(t){e[t]=!0}),e}},function(t,e){"use strict";t.exports=function(t){if(null==t)throw new TypeError("Cannot use null or undefined");return t}},function(t,e,r){"use strict";t.exports=r(12)()?Array.from:r(13)},function(t,e){"use strict";var r=Array.prototype.forEach,n=Object.create,i=function(t,e){var r;for(r in t)e[r]=t[r]};t.exports=function(t){var e=n(null);return r.call(arguments,function(t){null!=t&&i(Object(t),e)}),e}},function(t,e,r){"use strict";t.exports=r(28)()?Object.assign:r(29)},function(t,e){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,r){"use strict";t.exports=r(33)()?String.prototype.contains:r(34)},function(t,e,r){"use strict";var n=r(3),i=r(1);t.exports=i.apply(null,n("\n\r\u2028\u2029"))},function(t,e,r){"use strict";var n,i,o,a,u,s,f,c,l,h,p=r(36);u=function(t){return"\\"===t?s:"$"===t?f:(i+=t,u)},s=function(t){return"\\"!==t&&"$"!==t&&(i+="\\"),i+=t,u},f=function(t){return"{"===t?(o.push(i),i="",c):"$"===t?(i+="$",f):(i+="$"+t,u)},c=function(t){var e,r=h.slice(n);return p(r,"}",function(t){return p.nest>=0?p.next():void(e=t)}),null!=e?(a.push(h.slice(n,n+e)),n+=e,i="",u):(e=r.length,n+=e,i+=r,c)},l=function(t){return"\\"!==t&&"}"!==t&&(i+="\\"),i+=t,c},t.exports=function(t){var e,r,p;for(i="",o=[],a=[],h=String(t),e=h.length,r=u,n=0;e>n;++n)r=r(h[n]);return r===u?o.push(i):r===s?o.push(i+"\\"):r===f?o.push(i+"$"):r===c?o[o.length-1]+="${"+i:r===l&&(o[o.length-1]+="${"+i+"\\"),p={literals:o,substitutions:a},o=a=null,p}},function(t,e,r){"use strict";var n=r(10),i=r(41);t.exports=function(t,e){return i(n(t),e,arguments[2])}},function(t,e){"use strict";t.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(t=["raz","dwa"],e=r(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,r){"use strict";var n=r(20).iterator,i=r(14),o=r(15),a=r(27),u=r(7),s=r(2),f=r(35),c=Array.isArray,l=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;t.exports=function(t){var e,r,d,g,y,v,m,b,w,x,E=arguments[1],A=arguments[2];if(t=Object(s(t)),null!=E&&u(E),this&&this!==Array&&o(this))e=this;else{if(!E){if(i(t))return y=t.length,1!==y?Array.apply(null,t):(g=new Array(1),g[0]=t[0],g);if(c(t)){for(g=new Array(y=t.length),r=0;y>r;++r)g[r]=t[r];return g}}g=[]}if(!c(t))if(void 0!==(w=t[n])){for(m=u(w).call(t),e&&(g=new e),b=m.next(),r=0;!b.done;)x=E?l.call(E,A,b.value,r):b.value,e?(h.value=x,p(g,r,h)):g[r]=x,b=m.next(),++r;y=r}else if(f(t)){for(y=t.length,e&&(g=new e),r=0,d=0;y>r;++r)x=t[r],y>r+1&&(v=x.charCodeAt(0),v>=55296&&56319>=v&&(x+=t[++r])),x=E?l.call(E,A,x,d):x,e?(h.value=x,p(g,d,h)):g[d]=x,++d;y=d}if(void 0===y)for(y=a(t.length),e&&(g=new e(y)),r=0;y>r;++r)x=E?l.call(E,A,t[r],r):t[r],e?(h.value=x,p(g,r,h)):g[r]=x;return e&&(h.value=null,g.length=y),g}},function(t,e){"use strict";var r=Object.prototype.toString,n=r.call(function(){return arguments}());t.exports=function(t){return r.call(t)===n}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(r(16));t.exports=function(t){return"function"==typeof t&&n.call(t)===i}},function(t,e){"use strict";t.exports=function(){}},function(t,e,r){"use strict";t.exports=r(18)()?Math.sign:r(19)},function(t,e){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},function(t,e){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,r){"use strict";t.exports=r(21)()?Symbol:r(24)},function(t,e){"use strict";var r={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(e){return!1}return!(!r[typeof Symbol.iterator]||!r[typeof Symbol.toPrimitive])&&!!r[typeof Symbol.toStringTag]}},function(t,e){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,r){"use strict";var n,i=r(5),o=r(4),a=r(6),u=r(8);n=t.exports=function(t,e){var r,n,a,s,f;return arguments.length<2||"string"!=typeof t?(s=e,e=t,t=null):s=arguments[2],null==t?(r=a=!0,n=!1):(r=u.call(t,"c"),n=u.call(t,"e"),a=u.call(t,"w")),f={value:e,configurable:r,enumerable:n,writable:a},s?i(o(s),f):f},n.gs=function(t,e,r){var n,s,f,c;return"string"!=typeof t?(f=r,r=e,e=t,t=null):f=arguments[3],null==e?e=void 0:a(e)?null==r?r=void 0:a(r)||(f=r,r=void 0):(f=e,e=r=void 0),null==t?(n=!0,s=!1):(n=u.call(t,"c"),s=u.call(t,"e")),c={get:e,set:r,configurable:n,enumerable:s},f?i(o(f),c):c}},function(t,e,r){"use strict";var n,i,o,a,u=r(23),s=r(25),f=Object.create,c=Object.defineProperties,l=Object.defineProperty,h=Object.prototype,p=f(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),a=!0}catch(d){}}var g=function(){var t=f(null);return function(e){for(var r,n,i=0;t[e+(i||"")];)++i;return e+=i||"",t[e]=!0,r="@@"+e,l(h,r,u.gs(null,function(t){n||(n=!0,l(this,r,u(t)),n=!1)})),r}}();o=function(t){if(this instanceof o)throw new TypeError("TypeError: Symbol is not a constructor");return i(t)},t.exports=i=function y(t){var e;if(this instanceof y)throw new TypeError("TypeError: Symbol is not a constructor");return a?n(t):(e=f(o.prototype),t=void 0===t?"":String(t),c(e,{__description__:u("",t),__name__:u("",g(t))}))},c(i,{"for":u(function(t){return p[t]?p[t]:p[t]=i(String(t))}),keyFor:u(function(t){var e;s(t);for(e in p)if(p[e]===t)return e}),hasInstance:u("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:u("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:u("",n&&n.iterator||i("iterator")),match:u("",n&&n.match||i("match")),replace:u("",n&&n.replace||i("replace")),search:u("",n&&n.search||i("search")),species:u("",n&&n.species||i("species")),split:u("",n&&n.split||i("split")),toPrimitive:u("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:u("",n&&n.toStringTag||i("toStringTag")),unscopables:u("",n&&n.unscopables||i("unscopables"))}),c(o.prototype,{constructor:u(i),toString:u("",function(){return this.__name__})}),c(i.prototype,{toString:u(function(){return"Symbol ("+s(this).__description__+")"}),valueOf:u(function(){return s(this)})}),l(i.prototype,i.toPrimitive,u("",function(){var t=s(this);return"symbol"==typeof t?t:t.toString()})),l(i.prototype,i.toStringTag,u("c","Symbol")),l(o.prototype,i.toStringTag,u("c",i.prototype[i.toStringTag])),l(o.prototype,i.toPrimitive,u("c",i.prototype[i.toPrimitive]))},function(t,e,r){"use strict";var n=r(22);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,r){"use strict";var n=r(17),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?n(t)*o(i(t)):t)}},function(t,e,r){"use strict";var n=r(26),i=Math.max;t.exports=function(t){return i(0,n(t))}},function(t,e){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,r){"use strict";var n=r(30),i=r(2),o=Math.max;t.exports=function(t,e){var r,a,u,s=o(arguments.length,2);for(t=Object(i(t)),u=function(n){try{t[n]=e[n]}catch(i){r||(r=i)}},a=1;s>a;++a)e=arguments[a],n(e).forEach(u);if(void 0!==r)throw r;return t}},function(t,e,r){"use strict";t.exports=r(31)()?Object.keys:r(32)},function(t,e){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e){"use strict";var r=Object.keys;t.exports=function(t){return r(null==t?t:Object(t))}},function(t,e){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(r.contains("dwa")===!0&&r.contains("foo")===!1);
}},function(t,e){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},function(t,e){"use strict";var r=Object.prototype.toString,n=r.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===n)||!1}},function(t,e,r){"use strict";var n,i,o,a,u,s,f,c,l,h,p,d,g,y,v,m,b,w,x,E,A,S,_,T,R,O,M,j=r(3),P=r(1),C=r(2),B=r(7),U=r(39),I=r(9),L=r(38),k=Object.prototype.hasOwnProperty,H=P.apply(null,j(";{=([,<>+-*/%&|^!~?:}")),F=P.apply(null,j(";{=([,<>+-*/%&|^!~?:})]."));n=function(t){if(d&&!(p>=t))for(;p!==t;){if(!d)return;k.call(L,d)?k.call(I,d)&&(y=p,++g):m=d,d=E[++p]}},i=function(t){null!=R&&w.push([O,R,t]),O={point:p+1,line:g,column:p+1-y},R=p},o=function(){var t;return O.raw=E.slice(R,p),x.push(O),w.length?(t=w.pop(),O=t[0],R=t[1],void(M=t[2])):(O=null,R=null,void(M=null))},a=function(){var t=M;return M=b,++b,n(p+1),i(t),u},s=function(){if("'"===d||'"'===d)return T=d,d=E[++p],f;if("("===d||"{"===d||"["===d)++b;else if(")"===d||"}"===d||"]"===d)M===--b&&o();else if("/"===d&&k.call(H,m))return d=E[++p],h;return d!==A||!S&&m&&!v&&!k.call(F,m)?(m=d,d=E[++p],u):_(p,m,b)},c=function(){for(;;){if(!d)return;if(k.call(I,d))return y=p+1,void++g;d=E[++p]}},l=function(){for(;;){if(!d)return;if("*"!==d)k.call(I,d)&&(y=p+1,++g),d=E[++p];else if(d=E[++p],"/"===d)return}},u=function(){var t;for(v=!1;;){if(!d)return;if(k.call(L,d))v=!0,k.call(I,d)&&(y=p+1,++g);else{if("/"!==d)break;if(t=E[p+1],"/"===t)d=E[p+=2],v=!0,c();else{if("*"!==t)break;d=E[p+=2],v=!0,l()}}d=E[++p]}return s},f=function(){for(;;){if(!d)return;if(d===T)return d=E[++p],m=T,u;"\\"===d&&k.call(I,E[++p])&&(y=p+1,++g),d=E[++p]}},h=function(){for(;;){if(!d)return;if("/"===d)return m="/",d=E[++p],u;"\\"===d&&++p,d=E[++p]}},t.exports=e=function(t,r,n){var i;if(E=String(C(t)),A=String(C(r)),1!==A.length)throw new TypeError(A+" should be one character long string");for(_=B(n),S=k.call(F,A),p=0,d=E[p],g=1,y=0,v=!1,m=null,b=0,w=[],x=[],e.forceStop=!1,i=u;i;)i=i();return x},Object.defineProperties(e,{$ws:U(u),$common:U(s),collectNest:U(a),move:U(n),index:U.gs(function(){return p}),line:U.gs(function(){return g}),nest:U.gs(function(){return b}),columnIndex:U.gs(function(){return y}),next:U(function(t){return d?(n(p+(t||1)),u()):void 0}),resume:U(function(){return s})})},function(t,e,r){"use strict";var n=r(3),i=r(1);t.exports=i.apply(null,n(" \f\t\x0B "))},function(t,e,r){"use strict";var n=r(1),i=r(9),o=r(37);t.exports=n.apply(null,Object.keys(i).concat(Object.keys(o)))},function(t,e,r){"use strict";var n,i=r(5),o=r(4),a=r(6),u=r(8);n=t.exports=function(t,e){var r,n,a,s,f;return arguments.length<2||"string"!=typeof t?(s=e,e=t,t=null):s=arguments[2],null==t?(r=a=!0,n=!1):(r=u.call(t,"c"),n=u.call(t,"e"),a=u.call(t,"w")),f={value:e,configurable:r,enumerable:n,writable:a},s?i(o(s),f):f},n.gs=function(t,e,r){var n,s,f,c;return"string"!=typeof t?(f=r,r=e,e=t,t=null):f=arguments[3],null==e?e=void 0:a(e)?null==r?r=void 0:a(r)||(f=r,r=void 0):(f=e,e=r=void 0),null==t?(n=!0,s=!1):(n=u.call(t,"c"),s=u.call(t,"e")),c={get:e,set:r,configurable:n,enumerable:s},f?i(o(f),c):c}},function(t,e){"use strict";var r=Array.prototype.reduce;t.exports=function(t){var e=arguments;return r.call(t,function(t,r,n){return t+(void 0===e[n]?"":String(e[n]))+r})}},function(t,e,r){"use strict";var n=r(42),i=r(40);t.exports=function(t,e){return i.apply(null,n(t,e,arguments[2]))}},function(t,e,r){"use strict";var n=r(2),i=r(4),o=Array.prototype.map,a=Object.keys,u=JSON.stringify;t.exports=function(t,e){var r,s,f,c=Object(arguments[2]);return n(t)&&n(t.literals)&&n(t.substitutions),e=i(e),r=a(e),s=r.join(", "),f=r.map(function(t){return e[t]}),[t.literals].concat(o.call(t.substitutions,function(t){var e;if(t){try{e=new Function(s,"return ("+t+")")}catch(r){throw new TypeError("Unable to compile expression:\n\targs: "+u(s)+"\n\tbody: "+u(t)+"\n\terror: "+r.stack)}try{return e.apply(null,f)}catch(r){if(c.partial)return"${"+t+"}";throw new TypeError("Unable to resolve expression:\n\targs: "+u(s)+"\n\tbody: "+u(t)+"\n\terror: "+r.stack)}}}))}}])},function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var r;AFRAME.registerSystem("audioanalyser",{init:function(){this.analysers={}},getOrCreateAnalyser:function(t){r||(r=new AudioContext);var e=this.analysers,n=r.createAnalyser(),i=t.src,o=i.getAttribute("src");if(e[o])return e[o];var a=r.createMediaElementSource(i);return a.connect(n),n.connect(r.destination),n.smoothingTimeConstant=t.smoothingTimeConstant,n.fftSize=t.fftSize,e[o]=n,e[o]}}),AFRAME.registerComponent("audioanalyser",{schema:{enableBeatDetection:{"default":!0},enableLevels:{"default":!0},enableWaveform:{"default":!0},enableVolume:{"default":!0},fftSize:{"default":2048},smoothingTimeConstant:{"default":.8},src:{type:"selector"},unique:{"default":!1}},init:function(){this.analyser=null,this.levels=null,this.waveform=null,this.volume=0},update:function(){function t(t){r.analyser=t,r.levels=new Uint8Array(r.analyser.frequencyBinCount),r.waveform=new Uint8Array(r.analyser.fftSize),r.el.emit("audioanalyser-ready",{analyser:t})}var e=this.data,r=this,n=this.system;e.src&&t(e.unique?n.createAnalyser(e):n.getOrCreateAnalyser(e))},tick:function(){var t=this.data;if(this.analyser){if((t.enableLevels||t.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),t.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),t.enableVolume||t.enableBeatDetection){for(var e=0,r=0;r<this.levels.length;r++)e+=this.levels[r];this.volume=e/this.levels.length}if(t.enableBeatDetection){var n=.99,i=60,o=.15;volume=this.volume,this.beatCutOff||(this.beatCutOff=volume),volume>this.beatCutOff&&volume>o?(console.log("[audioanalyser] Beat detected."),this.el.emit("audioanalyser-beat"),this.beatCutOff=1.5*volume,this.beatTime=0):this.beatTime<=i?this.beatTime++:(this.beatCutOff*=n,this.beatCutOff=Math.max(this.beatCutOff,o))}}}})}]);