aframe-rails 0.6.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,472 @@
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AFRAME = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
2
+ (function (process){
3
+ var TWEEN=TWEEN||function(){var n=[];return{getAll:function(){return n},removeAll:function(){n=[]},add:function(t){n.push(t)},remove:function(t){var r=n.indexOf(t);-1!==r&&n.splice(r,1)},update:function(t,r){if(0===n.length)return!1;var i=0;for(t=void 0!==t?t:TWEEN.now();i<n.length;)n[i].update(t)||r?i++:n.splice(i,1);return!0}}}();"undefined"==typeof window&&"undefined"!=typeof process?TWEEN.now=function(){var n=process.hrtime();return 1e3*n[0]+n[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?TWEEN.now=window.performance.now.bind(window.performance):void 0!==Date.now?TWEEN.now=Date.now:TWEEN.now=function(){return(new Date).getTime()},TWEEN.Tween=function(n){var t,r=n,i={},u={},e={},o=1e3,a=0,f=!1,c=!1,s=!1,h=0,l=null,E=TWEEN.Easing.Linear.None,p=TWEEN.Interpolation.Linear,d=[],v=null,w=!1,I=null,M=null,T=null;this.to=function(n,t){return u=n,void 0!==t&&(o=t),this},this.start=function(n){TWEEN.add(this),c=!0,w=!1,l=void 0!==n?n:TWEEN.now(),l+=h;for(var t in u){if(u[t]instanceof Array){if(0===u[t].length)continue;u[t]=[r[t]].concat(u[t])}void 0!==r[t]&&(i[t]=r[t],i[t]instanceof Array==!1&&(i[t]*=1),e[t]=i[t]||0)}return this},this.stop=function(){return c?(TWEEN.remove(this),c=!1,null!==T&&T.call(r,r),this.stopChainedTweens(),this):this},this.end=function(){return this.update(l+o),this},this.stopChainedTweens=function(){for(var n=0,t=d.length;n<t;n++)d[n].stop()},this.delay=function(n){return h=n,this},this.repeat=function(n){return a=n,this},this.repeatDelay=function(n){return t=n,this},this.yoyo=function(n){return f=n,this},this.easing=function(n){return E=n,this},this.interpolation=function(n){return p=n,this},this.chain=function(){return d=arguments,this},this.onStart=function(n){return v=n,this},this.onUpdate=function(n){return I=n,this},this.onComplete=function(n){return M=n,this},this.onStop=function(n){return T=n,this},this.update=function(n){var c,T,N;if(n<l)return!0;!1===w&&(null!==v&&v.call(r,r),w=!0),T=(n-l)/o,T=T>1?1:T,N=E(T);for(c in u)if(void 0!==i[c]){var W=i[c]||0,O=u[c];O instanceof Array?r[c]=p(O,N):("string"==typeof O&&(O="+"===O.charAt(0)||"-"===O.charAt(0)?W+parseFloat(O):parseFloat(O)),"number"==typeof O&&(r[c]=W+(O-W)*N))}if(null!==I&&I.call(r,N),1===T){if(a>0){isFinite(a)&&a--;for(c in e){if("string"==typeof u[c]&&(e[c]=e[c]+parseFloat(u[c])),f){var m=e[c];e[c]=u[c],u[c]=m}i[c]=e[c]}return f&&(s=!s),l=void 0!==t?n+t:n+h,!0}null!==M&&M.call(r,r);for(var g=0,y=d.length;g<y;g++)d[g].start(l+o);return!1}return!0}},TWEEN.Easing={Linear:{None:function(n){return n}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.cos(n*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return.5*(1-Math.cos(Math.PI*n))}},Exponential:{In:function(n){return 0===n?0:Math.pow(1024,n-1)},Out:function(n){return 1===n?1:1-Math.pow(2,-10*n)},InOut:function(n){return 0===n?0:1===n?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(2-Math.pow(2,-10*(n-1)))}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return 0===n?0:1===n?1:-Math.pow(2,10*(n-1))*Math.sin(5*(n-1.1)*Math.PI)},Out:function(n){return 0===n?0:1===n?1:Math.pow(2,-10*n)*Math.sin(5*(n-.1)*Math.PI)+1},InOut:function(n){return 0===n?0:1===n?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin(5*(n-1.1)*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin(5*(n-1.1)*Math.PI)+1)}},Back:{In:function(n){var t=1.70158;return n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?n*n*((t+1)*n-t)*.5:.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-TWEEN.Easing.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?.5*TWEEN.Easing.Bounce.In(2*n):.5*TWEEN.Easing.Bounce.Out(2*n-1)+.5}}},TWEEN.Interpolation={Linear:function(n,t){var r=n.length-1,i=r*t,u=Math.floor(i),e=TWEEN.Interpolation.Utils.Linear;return t<0?e(n[0],n[1],i):t>1?e(n[r],n[r-1],r-i):e(n[u],n[u+1>r?r:u+1],i-u)},Bezier:function(n,t){for(var r=0,i=n.length-1,u=Math.pow,e=TWEEN.Interpolation.Utils.Bernstein,o=0;o<=i;o++)r+=u(1-t,i-o)*u(t,o)*n[o]*e(i,o);return r},CatmullRom:function(n,t){var r=n.length-1,i=r*t,u=Math.floor(i),e=TWEEN.Interpolation.Utils.CatmullRom;return n[0]===n[r]?(t<0&&(u=Math.floor(i=r*(1+t))),e(n[(u-1+r)%r],n[u],n[(u+1)%r],n[(u+2)%r],i-u)):t<0?n[0]-(e(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[r]-(e(n[r],n[r],n[r-1],n[r-1],i-r)-n[r]):e(n[u?u-1:0],n[u],n[r<u+1?r:u+1],n[r<u+2?r:u+2],i-u)},Utils:{Linear:function(n,t,r){return(t-n)*r+n},Bernstein:function(n,t){var r=TWEEN.Interpolation.Utils.Factorial;return r(n)/r(t)/r(n-t)},Factorial:function(){var n=[1];return function(t){var r=1;if(n[t])return n[t];for(var i=t;i>1;i--)r*=i;return n[t]=r,r}}(),CatmullRom:function(n,t,r,i,u){var e=.5*(r-n),o=.5*(i-t),a=u*u;return(2*t-2*r+e+o)*(u*a)+(-3*t+3*r-2*e-o)*a+e*u+t}}},function(n){"function"==typeof define&&define.amd?define([],function(){return TWEEN}):"undefined"!=typeof module&&"object"==typeof exports?module.exports=TWEEN:void 0!==n&&(n.TWEEN=TWEEN)}(this);
4
+ }).call(this,_dereq_('_process'))
5
+
6
+ },{"_process":6}],2:[function(_dereq_,module,exports){
7
+ function anArray(r){return r.BYTES_PER_ELEMENT&&"[object ArrayBuffer]"===str.call(r.buffer)||Array.isArray(r)}var str=Object.prototype.toString;module.exports=anArray;
8
+ },{}],3:[function(_dereq_,module,exports){
9
+ module.exports=function(e,n){return"number"==typeof e?e:"number"==typeof n?n:0};
10
+ },{}],4:[function(_dereq_,module,exports){
11
+ "use strict";function placeHoldersCount(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===o[r-2]?2:"="===o[r-1]?1:0}function byteLength(o){return 3*o.length/4-placeHoldersCount(o)}function toByteArray(o){var r,e,t,u,n,p=o.length;u=placeHoldersCount(o),n=new Arr(3*p/4-u),e=u>0?p-4:p;var a=0;for(r=0;r<e;r+=4)t=revLookup[o.charCodeAt(r)]<<18|revLookup[o.charCodeAt(r+1)]<<12|revLookup[o.charCodeAt(r+2)]<<6|revLookup[o.charCodeAt(r+3)],n[a++]=t>>16&255,n[a++]=t>>8&255,n[a++]=255&t;return 2===u?(t=revLookup[o.charCodeAt(r)]<<2|revLookup[o.charCodeAt(r+1)]>>4,n[a++]=255&t):1===u&&(t=revLookup[o.charCodeAt(r)]<<10|revLookup[o.charCodeAt(r+1)]<<4|revLookup[o.charCodeAt(r+2)]>>2,n[a++]=t>>8&255,n[a++]=255&t),n}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,u=[],n=r;n<e;n+=3)t=(o[n]<<16)+(o[n+1]<<8)+o[n+2],u.push(tripletToBase64(t));return u.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,u="",n=[],p=0,a=e-t;p<a;p+=16383)n.push(encodeChunk(o,p,p+16383>a?a:p+16383));return 1===t?(r=o[e-1],u+=lookup[r>>2],u+=lookup[r<<4&63],u+="=="):2===t&&(r=(o[e-2]<<8)+o[e-1],u+=lookup[r>>10],u+=lookup[r>>4&63],u+=lookup[r<<2&63],u+="="),n.push(u),n.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;
12
+ },{}],5:[function(_dereq_,module,exports){
13
+ "use strict";module.exports={createLink:function(e,t){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("link");n.href=e,n.rel="stylesheet";for(var d in t)if(t.hasOwnProperty(d)){var r=t[d];n.setAttribute("data-"+d,r)}a.appendChild(n)},createStyle:function(e,t){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css";for(var d in t)if(t.hasOwnProperty(d)){var r=t[d];n.setAttribute("data-"+d,r)}n.sheet?(n.innerHTML=e,n.sheet.cssText=e,a.appendChild(n)):n.styleSheet?(a.appendChild(n),n.styleSheet.cssText=e):(n.appendChild(document.createTextNode(e)),a.appendChild(n))}};
14
+ },{}],6:[function(_dereq_,module,exports){
15
+ function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}var process=module.exports={},cachedSetTimeout,cachedClearTimeout;!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
16
+ },{}],7:[function(_dereq_,module,exports){
17
+ var Buffer=_dereq_("buffer").Buffer;module.exports=function(f,e){if(Buffer.isBuffer(f)&&Buffer.isBuffer(e)){if("function"==typeof f.equals)return f.equals(e);if(f.length!==e.length)return!1;for(var r=0;r<f.length;r++)if(f[r]!==e[r])return!1;return!0}};
18
+ },{"buffer":8}],8:[function(_dereq_,module,exports){
19
+ (function (global){
20
+ "use strict";function typedArraySupport(){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(t){return!1}}function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,e){if(kMaxLength()<e)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=Buffer.prototype):(null===t&&(t=new Buffer(e)),t.length=e),t}function Buffer(t,e,r){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,e,r)}function from(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?fromArrayBuffer(t,e,r,n):"string"==typeof e?fromString(t,e,r):fromObject(t,e)}function assertSize(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 alloc(t,e,r,n){return assertSize(e),e<=0?createBuffer(t,e):void 0!==r?"string"==typeof n?createBuffer(t,e).fill(r,n):createBuffer(t,e).fill(r):createBuffer(t,e)}function allocUnsafe(t,e){if(assertSize(e),t=createBuffer(t,e<0?0:0|checked(e)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function fromString(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|byteLength(e,r);t=createBuffer(t,n);var f=t.write(e,r);return f!==n&&(t=t.slice(0,f)),t}function fromArrayLike(t,e){var r=e.length<0?0:0|checked(e.length);t=createBuffer(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function fromArrayBuffer(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Buffer.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=Buffer.prototype):t=fromArrayLike(t,e),t}function fromObject(t,e){if(Buffer.isBuffer(e)){var r=0|checked(e.length);return t=createBuffer(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||isnan(e.length)?createBuffer(t,0):fromArrayLike(t,e);if("Buffer"===e.type&&isArray(e.data))return fromArrayLike(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|t}function SlowBuffer(t){return+t!=t&&(t=0),Buffer.alloc(+t)}function byteLength(t,e){if(Buffer.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(t).length;default:if(n)return utf8ToBytes(t).length;e=(""+e).toLowerCase(),n=!0}}function slowToString(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 hexSlice(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return asciiSlice(this,e,r);case"latin1":case"binary":return latin1Slice(this,e,r);case"base64":return base64Slice(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function swap(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function bidirectionalIndexOf(t,e,r,n,f){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=f?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(f)return-1;r=t.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:arrayIndexOf(t,e,r,n,f);if("number"==typeof e)return e&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):arrayIndexOf(t,[e],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,r,n,f){function i(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,u/=2,s/=2,r/=2}var a;if(f){var h=-1;for(a=r;a<u;a++)if(i(t,a)===i(e,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===s)return h*o}else-1!==h&&(a-=a-h),h=-1}else for(r+s>u&&(r=u-s),a=r;a>=0;a--){for(var c=!0,l=0;l<s;l++)if(i(t,a+l)!==i(e,l)){c=!1;break}if(c)return a}return-1}function hexWrite(t,e,r,n){r=Number(r)||0;var f=t.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(e.substr(2*o,2),16);if(isNaN(u))return o;t[r+o]=u}return o}function utf8Write(t,e,r,n){return blitBuffer(utf8ToBytes(e,t.length-r),t,r,n)}function asciiWrite(t,e,r,n){return blitBuffer(asciiToBytes(e),t,r,n)}function latin1Write(t,e,r,n){return asciiWrite(t,e,r,n)}function base64Write(t,e,r,n){return blitBuffer(base64ToBytes(e),t,r,n)}function ucs2Write(t,e,r,n){return blitBuffer(utf16leToBytes(e,t.length-r),t,r,n)}function base64Slice(t,e,r){return 0===e&&r===t.length?base64.fromByteArray(t):base64.fromByteArray(t.slice(e,r))}function utf8Slice(t,e,r){r=Math.min(t.length,r);for(var n=[],f=e;f<r;){var i=t[f],o=null,u=i>239?4:i>223?3:i>191?2:1;if(f+u<=r){var s,a,h,c;switch(u){case 1:i<128&&(o=i);break;case 2:s=t[f+1],128==(192&s)&&(c=(31&i)<<6|63&s)>127&&(o=c);break;case 3:s=t[f+1],a=t[f+2],128==(192&s)&&128==(192&a)&&(c=(15&i)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(o=c);break;case 4:s=t[f+1],a=t[f+2],h=t[f+3],128==(192&s)&&128==(192&a)&&128==(192&h)&&(c=(15&i)<<18|(63&s)<<12|(63&a)<<6|63&h)>65535&&c<1114112&&(o=c)}}null===o?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),f+=u}return decodeCodePointsArray(n)}function decodeCodePointsArray(t){var e=t.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(127&t[f]);return n}function latin1Slice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(t[f]);return n}function hexSlice(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=e;i<r;++i)f+=toHex(t[i]);return f}function utf16leSlice(t,e,r){for(var n=t.slice(e,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(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 checkInt(t,e,r,n,f,i){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function objectWriteUInt16(t,e,r,n){e<0&&(e=65535+e+1);for(var f=0,i=Math.min(t.length-r,2);f<i;++f)t[r+f]=(e&255<<8*(n?f:1-f))>>>8*(n?f:1-f)}function objectWriteUInt32(t,e,r,n){e<0&&(e=4294967295+e+1);for(var f=0,i=Math.min(t.length-r,4);f<i;++f)t[r+f]=e>>>8*(n?f:3-f)&255}function checkIEEE754(t,e,r,n,f,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(t,e,r,n,f){return f||checkIEEE754(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(t,e,r,n,23,4),r+4}function writeDouble(t,e,r,n,f){return f||checkIEEE754(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(t,e,r,n,52,8),r+8}function base64clean(t){if(t=stringtrim(t).replace(INVALID_BASE64_RE,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,e){e=e||1/0;for(var r,n=t.length,f=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(e-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function utf16leToBytes(t,e){for(var r,n,f,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(t){return base64.toByteArray(base64clean(t))}function blitBuffer(t,e,r,n){for(var f=0;f<n&&!(f+r>=e.length||f>=t.length);++f)e[f+r]=t[f];return f}function isnan(t){return t!==t}var base64=_dereq_("base64-js"),ieee754=_dereq_("ieee754"),isArray=_dereq_("isarray");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:typedArraySupport(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(t){return t.__proto__=Buffer.prototype,t},Buffer.from=function(t,e,r){return from(null,t,e,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(t,e,r){return alloc(null,t,e,r)},Buffer.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer.allocUnsafeSlow=function(t){return allocUnsafe(null,t)},Buffer.isBuffer=function(t){return!(null==t||!t._isBuffer)},Buffer.compare=function(t,e){if(!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,f=0,i=Math.min(r,n);f<i;++f)if(t[f]!==e[f]){r=t[f],n=e[f];break}return r<n?-1:n<r?1:0},Buffer.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}},Buffer.concat=function(t,e){if(!isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=Buffer.allocUnsafe(e),f=0;for(r=0;r<t.length;++r){var i=t[r];if(!Buffer.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.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)swap(this,e,e+1);return this},Buffer.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)swap(this,e,e+3),swap(this,e+1,e+2);return this},Buffer.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)swap(this,e,e+7),swap(this,e+1,e+6),swap(this,e+2,e+5),swap(this,e+3,e+4);return this},Buffer.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(t){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Buffer.compare(this,t)},Buffer.prototype.inspect=function(){var t="",e=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,e,r,n,f){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),e<0||r>t.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&e>=r)return 0;if(n>=f)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,f>>>=0,this===t)return 0;for(var i=f-n,o=r-e,u=Math.min(i,o),s=this.slice(n,f),a=t.slice(e,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},Buffer.prototype.indexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!0)},Buffer.prototype.lastIndexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!1)},Buffer.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,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-e;if((void 0===r||r>f)&&(r=f),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,t,e,r);case"utf8":case"utf-8":return utf8Write(this,t,e,r);case"ascii":return asciiWrite(this,t,e,r);case"latin1":case"binary":return latin1Write(this,t,e,r);case"base64":return base64Write(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n;if(Buffer.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=Buffer.prototype;else{var f=e-t;n=new Buffer(f,void 0);for(var i=0;i<f;++i)n[i]=this[i+t]}return n},Buffer.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return n},Buffer.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t+--e],f=1;e>0&&(f*=256);)n+=this[t+--e]*f;return n},Buffer.prototype.readUInt8=function(t,e){return e||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,e){return e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,e){return e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,e){return e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUInt32BE=function(t,e){return e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return f*=128,n>=f&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=e,f=1,i=this[t+--n];n>0&&(f*=256);)i+=this[t+--n]*f;return f*=128,i>=f&&(i-=Math.pow(2,8*e)),i},Buffer.prototype.readInt8=function(t,e){return e||checkOffset(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,e){return e||checkOffset(t,4,this.length),ieee754.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return e||checkOffset(t,4,this.length),ieee754.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return e||checkOffset(t,8,this.length),ieee754.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return e||checkOffset(t,8,this.length),ieee754.read(this,t,!1,52,8)},Buffer.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){checkInt(this,t,e,r,Math.pow(2,8*r)-1,0)}var f=1,i=0;for(this[e]=255&t;++i<r&&(f*=256);)this[e+i]=t/f&255;return e+r},Buffer.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){checkInt(this,t,e,r,Math.pow(2,8*r)-1,0)}var f=r-1,i=1;for(this[e+f]=255&t;--f>=0&&(i*=256);)this[e+f]=t/i&255;return e+r},Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f)}var i=0,o=1,u=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeFloatLE=function(t,e,r){return writeFloat(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return writeFloat(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return writeDouble(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return writeDouble(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var f,i=n-r;if(this===t&&r<e&&e<n)for(f=i-1;f>=0;--f)t[f+e]=this[f+r];else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(f=0;f<i;++f)t[f+e]=this[f+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},Buffer.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var f=t.charCodeAt(0);f<256&&(t=f)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var i;if("number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var o=Buffer.isBuffer(t)?t:utf8ToBytes(new Buffer(t,n).toString()),u=o.length;for(i=0;i<r-e;++i)this[i+e]=o[i%u]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;
21
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
22
+
23
+ },{"base64-js":4,"ieee754":18,"isarray":9}],9:[function(_dereq_,module,exports){
24
+ var toString={}.toString;module.exports=Array.isArray||function(r){return"[object Array]"==toString.call(r)};
25
+ },{}],10:[function(_dereq_,module,exports){
26
+ function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function formatArgs(){var o=arguments,e=this.useColors;if(o[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+o[0]+(e?"%c ":" "),!e)return o;var r="color: "+this.color;o=[o[0],r,"color: inherit"].concat(Array.prototype.slice.call(o,1));var t=0,s=0;return o[0].replace(/%[a-z%]/g,function(o){"%%"!==o&&(t++,"%c"===o&&(s=t))}),o.splice(s,0,r),o}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(o){try{null==o?exports.storage.removeItem("debug"):exports.storage.debug=o}catch(o){}}function load(){var o;try{o=exports.storage.debug}catch(o){}return o}function localstorage(){try{return window.localStorage}catch(o){}}exports=module.exports=_dereq_("./debug"),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:localstorage(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(o){return JSON.stringify(o)},exports.enable(load());
27
+ },{"./debug":11}],11:[function(_dereq_,module,exports){
28
+ function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(e){function r(){}function o(){var e=o;null==e.useColors&&(e.useColors=exports.useColors()),null==e.color&&e.useColors&&(e.color=selectColor());var r=Array.prototype.slice.call(arguments);r[0]=exports.coerce(r[0]),"string"!=typeof r[0]&&(r=["%o"].concat(r));var s=0;r[0]=r[0].replace(/%([a-z%])/g,function(o,t){if("%%"===o)return o;s++;var n=exports.formatters[t];if("function"==typeof n){var l=r[s];o=n.call(e,l),r.splice(s,1),s--}return o}),"function"==typeof exports.formatArgs&&(r=exports.formatArgs.apply(e,r)),(o.log||exports.log||console.log.bind(console)).apply(e,r)}r.enabled=!1,o.enabled=!0;var s=exports.enabled(e)?o:r;return s.namespace=e,s}function enable(e){exports.save(e);for(var r=(e||"").split(/[\s,]+/),o=r.length,s=0;s<o;s++)r[s]&&(e=r[s].replace(/\*/g,".*?"),"-"===e[0]?exports.skips.push(new RegExp("^"+e.substr(1)+"$")):exports.names.push(new RegExp("^"+e+"$")))}function disable(){exports.enable("")}function enabled(e){var r,o;for(r=0,o=exports.skips.length;r<o;r++)if(exports.skips[r].test(e))return!1;for(r=0,o=exports.names.length;r<o;r++)if(exports.names[r].test(e))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}exports=module.exports=debug,exports.coerce=coerce,exports.disable=disable,exports.enable=enable,exports.enabled=enabled,exports.names=[],exports.skips=[],exports.formatters={};var prevColor=0;
29
+ },{}],12:[function(_dereq_,module,exports){
30
+ "use strict";function toObject(r){if(null===r||void 0===r)throw new TypeError("Sources cannot be null or undefined");return Object(r)}function assignKey(r,e,n){var t=e[n];if(void 0!==t&&null!==t){if(hasOwnProperty.call(r,n)&&(void 0===r[n]||null===r[n]))throw new TypeError("Cannot convert undefined or null to object ("+n+")");hasOwnProperty.call(r,n)&&isObj(t)?r[n]=assign(Object(r[n]),e[n]):r[n]=t}}function assign(r,e){if(r===e)return r;e=Object(e);for(var n in e)hasOwnProperty.call(e,n)&&assignKey(r,e,n);if(Object.getOwnPropertySymbols)for(var t=Object.getOwnPropertySymbols(e),o=0;o<t.length;o++)propIsEnumerable.call(e,t[o])&&assignKey(r,e,t[o]);return r}var isObj=_dereq_("is-obj"),hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function(r){r=toObject(r);for(var e=1;e<arguments.length;e++)assign(r,arguments[e]);return r};
31
+ },{"is-obj":22}],13:[function(_dereq_,module,exports){
32
+ !function(t,r,n,a){"use strict";function l(e,t){for(var r=0,n=e.length;r<n;r++)m(e[r],t)}function i(e){for(var t,r=0,n=e.length;r<n;r++)t=e[r],y(t,H[u(t)])}function o(e){return function(t){ae(t)&&(m(t,e),l(t.querySelectorAll(x),e))}}function u(e){var t=oe.call(e,"is"),r=e.nodeName.toUpperCase(),n=G.call(U,t?k+t.toUpperCase():_+r);return t&&-1<n&&!c(r,t)?-1:n}function c(e,t){return-1<x.indexOf(e+'[is="'+t+'"]')}function s(e){var t=e.currentTarget,r=e.attrChange,n=e.attrName,a=e.target;me&&(!a||a===t)&&t.attributeChangedCallback&&"style"!==n&&e.prevValue!==e.newValue&&t.attributeChangedCallback(n,r===e[F]?null:e.prevValue,r===e[I]?null:e.newValue)}function d(e){var t=o(e);return function(e){g.push(t,e.target)}}function f(e){be&&(be=!1,e.currentTarget.removeEventListener(P,f)),l((e.target||r).querySelectorAll(x),e.detail===T?T:L),ne&&p()}function h(e,t){var r=this;ue.call(r,e,t),C.call(r,{target:r})}function v(e,t){ee(e,t),O?O.observe(e,de):(pe&&(e.setAttribute=h,e[w]=E(e),e.addEventListener(R,C)),e.addEventListener(D,s)),e.createdCallback&&me&&(e.created=!0,e.createdCallback(),e.created=!1)}function p(){for(var e,t=0,r=le.length;t<r;t++)e=le[t],Z.contains(e)||(r--,le.splice(t--,1),m(e,T))}function b(e){throw new Error("A "+e+" type is already registered")}function m(e,t){var r,n=u(e);-1<n&&(N(e,H[n]),n=0,t!==L||e[L]?t===T&&!e[T]&&(e[L]=!1,e[T]=!0,n=1):(e[T]=!1,e[L]=!0,n=1,ne&&G.call(le,e)<0&&le.push(e)),n&&(r=e[t+"Callback"])&&r.call(e))}if(!(a in r)){var g,C,A,E,O,N,y,w="__"+a+(1e5*Math.random()>>0),L="attached",T="detached",M="extends",F="ADDITION",V="MODIFICATION",I="REMOVAL",D="DOMAttrModified",P="DOMContentLoaded",R="DOMSubtreeModified",_="<",k="=",q=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,S=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],U=[],H=[],x="",Z=r.documentElement,G=U.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},j=n.prototype,z=j.hasOwnProperty,K=j.isPrototypeOf,W=n.defineProperty,X=n.getOwnPropertyDescriptor,Y=n.getOwnPropertyNames,$=n.getPrototypeOf,B=n.setPrototypeOf,J=!!n.__proto__,Q=n.create||function e(t){return t?(e.prototype=t,new e):this},ee=B||(J?function(e,t){return e.__proto__=t,e}:Y&&X?function(){function e(e,t){for(var r,n=Y(t),a=0,l=n.length;a<l;a++)r=n[a],z.call(e,r)||W(e,r,X(t,r))}return function(t,r){do{e(t,r)}while((r=$(r))&&!K.call(r,t));return t}}():function(e,t){for(var r in t)e[r]=t[r];return e}),te=t.MutationObserver||t.WebKitMutationObserver,re=(t.HTMLElement||t.Element||t.Node).prototype,ne=!K.call(re,Z),ae=ne?function(e){return 1===e.nodeType}:function(e){return K.call(re,e)},le=ne&&[],ie=re.cloneNode,oe=re.getAttribute,ue=re.setAttribute,ce=re.removeAttribute,se=r.createElement,de=te&&{attributes:!0,characterData:!0,attributeOldValue:!0},fe=te||function(e){pe=!1,Z.removeEventListener(D,fe)},he=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},ve=!1,pe=!0,be=!0,me=!0;B||J?(N=function(e,t){K.call(t,e)||v(e,t)},y=v):(N=function(e,t){e[w]||(e[w]=n(!0),v(e,t))},y=N),ne?(pe=!1,function(){var t=X(re,"addEventListener"),r=t.value,n=function(e){var t=new CustomEvent(D,{bubbles:!0});t.attrName=e,t.prevValue=oe.call(this,e),t.newValue=null,t[I]=t.attrChange=2,ce.call(this,e),this.dispatchEvent(t)},a=function(t,r){var n=this.hasAttribute(t),a=n&&oe.call(this,t);e=new CustomEvent(D,{bubbles:!0}),ue.call(this,t,r),e.attrName=t,e.prevValue=n?a:null,e.newValue=r,n?e[V]=e.attrChange=1:e[F]=e.attrChange=0,this.dispatchEvent(e)},l=function(e){var t,r=e.currentTarget,n=r[w],a=e.propertyName;n.hasOwnProperty(a)&&(n=n[a],t=new CustomEvent(D,{bubbles:!0}),t.attrName=n.name,t.prevValue=n.value||null,t.newValue=n.value=r[a]||null,null==t.prevValue?t[F]=t.attrChange=0:t[V]=t.attrChange=1,r.dispatchEvent(t))};t.value=function(e,t,i){e===D&&this.attributeChangedCallback&&this.setAttribute!==a&&(this[w]={className:{name:"class",value:this.className}},this.setAttribute=a,this.removeAttribute=n,r.call(this,"propertychange",l)),r.call(this,e,t,i)},W(re,"addEventListener",t)}()):te||(Z.addEventListener(D,fe),Z.setAttribute(w,1),Z.removeAttribute(w),pe&&(C=function(e){var t,r,n,a=this;if(a===e.target){t=a[w],a[w]=r=E(a);for(n in r){if(!(n in t))return A(0,a,n,t[n],r[n],F);if(r[n]!==t[n])return A(1,a,n,t[n],r[n],V)}for(n in t)if(!(n in r))return A(2,a,n,t[n],r[n],I)}},A=function(e,t,r,n,a,l){var i={attrChange:e,currentTarget:t,attrName:r,prevValue:n,newValue:a};i[l]=e,s(i)},E=function(e){for(var t,r,n={},a=e.attributes,l=0,i=a.length;l<i;l++)t=a[l],"setAttribute"!==(r=t.name)&&(n[r]=t.value);return n})),r[a]=function(e,t){if(n=e.toUpperCase(),ve||(ve=!0,te?(O=function(e,t){function r(e,t){for(var r=0,n=e.length;r<n;t(e[r++]));}return new te(function(n){for(var a,l,i,o=0,u=n.length;o<u;o++)a=n[o],"childList"===a.type?(r(a.addedNodes,e),r(a.removedNodes,t)):(l=a.target,me&&l.attributeChangedCallback&&"style"!==a.attributeName&&(i=oe.call(l,a.attributeName))!==a.oldValue&&l.attributeChangedCallback(a.attributeName,a.oldValue,i))})}(o(L),o(T)),O.observe(r,{childList:!0,subtree:!0})):(g=[],he(function e(){for(;g.length;)g.shift().call(null,g.shift());he(e)}),r.addEventListener("DOMNodeInserted",d(L)),r.addEventListener("DOMNodeRemoved",d(T))),r.addEventListener(P,f),r.addEventListener("readystatechange",f),r.createElement=function(e,t){var n=se.apply(r,arguments),a=""+e,l=G.call(U,(t?k:_)+(t||a).toUpperCase()),i=-1<l;return t&&(n.setAttribute("is",t=t.toLowerCase()),i&&(i=c(a.toUpperCase(),t))),me=!r.createElement.innerHTMLHelper,i&&y(n,H[l]),n},re.cloneNode=function(e){var t=ie.call(this,!!e),r=u(t);return-1<r&&y(t,H[r]),e&&i(t.querySelectorAll(x)),t}),-2<G.call(U,k+n)+G.call(U,_+n)&&b(e),!q.test(n)||-1<G.call(S,n))throw new Error("The type "+e+" is invalid");var n,a,s=function(){return v?r.createElement(p,n):r.createElement(p)},h=t||j,v=z.call(h,M),p=v?t[M].toUpperCase():n;return v&&-1<G.call(U,_+p)&&b(p),a=U.push((v?k:_)+n)-1,x=x.concat(x.length?",":"",v?p+'[is="'+e.toLowerCase()+'"]':p),s.prototype=H[a]=z.call(h,"prototype")?h.prototype:Q(re),l(r.querySelectorAll(x),L),s}}}(window,document,Object,"registerElement");
33
+ },{}],14:[function(_dereq_,module,exports){
34
+ module.exports=function(r){switch(r){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}};
35
+ },{}],15:[function(_dereq_,module,exports){
36
+ function flattenVertexData(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&Array.isArray(e[0])){var a=e[0].length,n=e.length*a;t&&"string"!=typeof t||(t=new(dtype(t||"float32"))(n+r));var o=t.length-r;if(n!==o)throw new Error("source length "+n+" ("+a+"x"+e.length+") does not match destination length "+o);for(var s=0,f=r;s<e.length;s++)for(var l=0;l<a;l++)t[f++]=e[s][l]}else if(t&&"string"!=typeof t)t.set(e,r);else{var i=dtype(t||"float32");0===r?t=new i(e):(t=new i(e.length+r),t.set(e,r))}return t}var dtype=_dereq_("dtype");module.exports=flattenVertexData;
37
+ },{"dtype":14}],16:[function(_dereq_,module,exports){
38
+ function forEach(r,t,o){if(!isFunction(t))throw new TypeError("iterator must be a function");arguments.length<3&&(o=this),"[object Array]"===toString.call(r)?forEachArray(r,t,o):"string"==typeof r?forEachString(r,t,o):forEachObject(r,t,o)}function forEachArray(r,t,o){for(var n=0,a=r.length;n<a;n++)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}function forEachString(r,t,o){for(var n=0,a=r.length;n<a;n++)t.call(o,r.charAt(n),n,r)}function forEachObject(r,t,o){for(var n in r)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}var isFunction=_dereq_("is-function");module.exports=forEach;var toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty;
39
+ },{"is-function":21}],17:[function(_dereq_,module,exports){
40
+ (function (global){
41
+ var win;win="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},module.exports=win;
42
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
43
+
44
+ },{}],18:[function(_dereq_,module,exports){
45
+ exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),o+=p+N>=1?n/f:n*Math.pow(2,1-N),o*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
46
+ },{}],19:[function(_dereq_,module,exports){
47
+ "function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
48
+ },{}],20:[function(_dereq_,module,exports){
49
+ function isBuffer(f){return!!f.constructor&&"function"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}function isSlowBuffer(f){return"function"==typeof f.readFloatLE&&"function"==typeof f.slice&&isBuffer(f.slice(0,0))}module.exports=function(f){return null!=f&&(isBuffer(f)||isSlowBuffer(f)||!!f._isBuffer)};
50
+ },{}],21:[function(_dereq_,module,exports){
51
+ function isFunction(o){var t=toString.call(o);return"[object Function]"===t||"function"==typeof o&&"[object RegExp]"!==t||"undefined"!=typeof window&&(o===window.setTimeout||o===window.alert||o===window.confirm||o===window.prompt)}module.exports=isFunction;var toString=Object.prototype.toString;
52
+ },{}],22:[function(_dereq_,module,exports){
53
+ "use strict";module.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)};
54
+ },{}],23:[function(_dereq_,module,exports){
55
+ function TextLayout(t){this.glyphs=[],this._measure=this.computeMetrics.bind(this),this.update(t)}function addGetter(t){Object.defineProperty(TextLayout.prototype,t,{get:wrapper(t),configurable:!0})}function wrapper(t){return new Function(["return function "+t+"() {"," return this._"+t,"}"].join("\n"))()}function getGlyphById(t,e){if(!t.chars||0===t.chars.length)return null;var r=findChar(t.chars,e);return r>=0?t.chars[r]:null}function getXHeight(t){for(var e=0;e<X_HEIGHTS.length;e++){var r=X_HEIGHTS[e].charCodeAt(0),n=findChar(t.chars,r);if(n>=0)return t.chars[n].height}return 0}function getMGlyph(t){for(var e=0;e<M_WIDTHS.length;e++){var r=M_WIDTHS[e].charCodeAt(0),n=findChar(t.chars,r);if(n>=0)return t.chars[n]}return 0}function getCapHeight(t){for(var e=0;e<CAP_HEIGHTS.length;e++){var r=CAP_HEIGHTS[e].charCodeAt(0),n=findChar(t.chars,r);if(n>=0)return t.chars[n].height}return 0}function getKerning(t,e,r){if(!t.kernings||0===t.kernings.length)return 0;for(var n=t.kernings,i=0;i<n.length;i++){var a=n[i];if(a.first===e&&a.second===r)return a.amount}return 0}function getAlignType(t){return"center"===t?ALIGN_CENTER:"right"===t?ALIGN_RIGHT:ALIGN_LEFT}function findChar(t,e,r){r=r||0;for(var n=r;n<t.length;n++)if(t[n].id===e)return n;return-1}var wordWrap=_dereq_("word-wrapper"),xtend=_dereq_("xtend"),number=_dereq_("as-number"),X_HEIGHTS=["x","e","a","o","n","s","r","c","u","m","v","w","z"],M_WIDTHS=["m","w"],CAP_HEIGHTS=["H","I","N","E","F","K","L","T","U","V","W","X","Y","Z"],TAB_ID="\t".charCodeAt(0),SPACE_ID=" ".charCodeAt(0),ALIGN_LEFT=0,ALIGN_CENTER=1,ALIGN_RIGHT=2;module.exports=function(t){return new TextLayout(t)},TextLayout.prototype.update=function(t){if(t=xtend({measure:this._measure},t),this._opt=t,this._opt.tabSize=number(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=wordWrap.lines(r,t),a=t.width||0;e.length=0;var h=i.reduce(function(t,e){return Math.max(t,e.width,a)},0),o=0,s=0,c=number(t.lineHeight,n.common.lineHeight),u=n.common.base,l=c-u,p=t.letterSpacing||0,f=c*i.length-l,d=getAlignType(this._opt.align);s-=f,this._width=h,this._height=f,this._descender=c-u,this._baseline=u,this._xHeight=getXHeight(n),this._capHeight=getCapHeight(n),this._lineHeight=c,this._ascender=c-l-this._xHeight;var g=this;i.forEach(function(t,i){for(var a,u=t.start,l=t.end,f=t.width,_=u;_<l;_++){var y=r.charCodeAt(_),G=g.getGlyph(n,y);if(G){a&&(o+=getKerning(n,a.id,G.id));var T=o;d===ALIGN_CENTER?T+=(h-f)/2:d===ALIGN_RIGHT&&(T+=h-f),e.push({position:[T,s],data:G,index:_,line:i}),o+=G.xadvance+p,a=G}}s+=c,o=0}),this._linesTotal=i.length},TextLayout.prototype._setupSpaceGlyphs=function(t){if(this._fallbackSpaceGlyph=null,this._fallbackTabGlyph=null,t.chars&&0!==t.chars.length){var e=getGlyphById(t,SPACE_ID)||getMGlyph(t)||t.chars[0],r=this._opt.tabSize*e.xadvance;this._fallbackSpaceGlyph=e,this._fallbackTabGlyph=xtend(e,{x:0,y:0,xadvance:r,id:TAB_ID,xoffset:0,yoffset:0,width:0,height:0})}},TextLayout.prototype.getGlyph=function(t,e){var r=getGlyphById(t,e);return r||(e===TAB_ID?this._fallbackTabGlyph:e===SPACE_ID?this._fallbackSpaceGlyph:null)},TextLayout.prototype.computeMetrics=function(t,e,r,n){var i,a,h=this._opt.letterSpacing||0,o=this._opt.font,s=0,c=0,u=0;if(!o.chars||0===o.chars.length)return{start:e,end:e,width:0};r=Math.min(t.length,r);for(var l=e;l<r;l++){var p=t.charCodeAt(l),i=this.getGlyph(o,p);if(i){i.xoffset;s+=a?getKerning(o,a.id,i.id):0;var f=s+i.xadvance+h,d=s+i.width;if(d>=n||f>=n)break;s=f,c=d,a=i}u++}return a&&(c+=a.xoffset),{start:e,end:e+u,width:c}},["width","height","descender","ascender","xHeight","baseline","capHeight","lineHeight"].forEach(addGetter);
56
+ },{"as-number":3,"word-wrapper":72,"xtend":75}],24:[function(_dereq_,module,exports){
57
+ (function (Buffer){
58
+ function isArrayBuffer(r){return"[object ArrayBuffer]"===Object.prototype.toString.call(r)}function getBinaryOpts(r){if(xml2)return xtend(r,{responseType:"arraybuffer"});if(void 0===self.XMLHttpRequest)throw new Error("your browser does not support XHR loading");var e=new self.XMLHttpRequest;return e.overrideMimeType("text/plain; charset=x-user-defined"),xtend({xhr:e},r)}var xhr=_dereq_("xhr"),noop=function(){},parseASCII=_dereq_("parse-bmfont-ascii"),parseXML=_dereq_("parse-bmfont-xml"),readBinary=_dereq_("parse-bmfont-binary"),isBinaryFormat=_dereq_("./lib/is-binary"),xtend=_dereq_("xtend"),xml2=function(){return self.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}();module.exports=function(r,e){e="function"==typeof e?e:noop,"string"==typeof r?r={uri:r}:r||(r={}),r.binary&&(r=getBinaryOpts(r)),xhr(r,function(t,n,i){if(t)return e(t);if(!/^2/.test(n.statusCode))return e(new Error("http status code: "+n.statusCode));if(!i)return e(new Error("no body result"));var o=!1;if(isArrayBuffer(i)){var a=new Uint8Array(i);i=new Buffer(a,"binary")}isBinaryFormat(i)&&(o=!0,"string"==typeof i&&(i=new Buffer(i,"binary"))),o||(Buffer.isBuffer(i)&&(i=i.toString(r.encoding)),i=i.trim());var s;try{var u=n.headers["content-type"];s=o?readBinary(i):/json/.test(u)||"{"===i.charAt(0)?JSON.parse(i):/xml/.test(u)||"<"===i.charAt(0)?parseXML(i):parseASCII(i)}catch(r){e(new Error("error parsing font "+r.message)),e=noop}e(null,s)})};
59
+ }).call(this,_dereq_("buffer").Buffer)
60
+
61
+ },{"./lib/is-binary":25,"buffer":8,"parse-bmfont-ascii":27,"parse-bmfont-binary":28,"parse-bmfont-xml":29,"xhr":73,"xtend":75}],25:[function(_dereq_,module,exports){
62
+ (function (Buffer){
63
+ var equal=_dereq_("buffer-equal"),HEADER=new Buffer([66,77,70,3]);module.exports=function(e){return"string"==typeof e?"BMF"===e.substring(0,3):e.length>4&&equal(e.slice(0,4),HEADER)};
64
+ }).call(this,_dereq_("buffer").Buffer)
65
+
66
+ },{"buffer":8,"buffer-equal":7}],26:[function(_dereq_,module,exports){
67
+ "use strict";function toObject(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map(function(e){return r[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=shouldUseNative()?Object.assign:function(e,r){for(var t,n,o=toObject(e),a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);if(getOwnPropertySymbols){n=getOwnPropertySymbols(t);for(var c=0;c<n.length;c++)propIsEnumerable.call(t,n[c])&&(o[n[c]]=t[n[c]])}}return o};
68
+ },{}],27:[function(_dereq_,module,exports){
69
+ function splitLine(e,r){if(!(e=e.replace(/\t+/g," ").trim()))return null;var t=e.indexOf(" ");if(-1===t)throw new Error("no named row at line "+r);var a=e.substring(0,t);e=e.substring(t+1),e=e.replace(/letter=[\'\"]\S+[\'\"]/gi,""),e=e.split("="),e=e.map(function(e){return e.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)});for(var n=[],i=0;i<e.length;i++){var s=e[i];0===i?n.push({key:s[0],data:""}):i===e.length-1?n[n.length-1].data=parseData(s[0]):(n[n.length-1].data=parseData(s[0]),n.push({key:s[1],data:""}))}var o={key:a,data:{}};return n.forEach(function(e){o.data[e.key]=e.data}),o}function parseData(e){return e&&0!==e.length?0===e.indexOf('"')||0===e.indexOf("'")?e.substring(1,e.length-1):-1!==e.indexOf(",")?parseIntList(e):parseInt(e,10):""}function parseIntList(e){return e.split(",").map(function(e){return parseInt(e,10)})}module.exports=function(e){if(!e)throw new Error("no data provided");e=e.toString().trim();var r={pages:[],chars:[],kernings:[]},t=e.split(/\r\n?|\n/g);if(0===t.length)throw new Error("no data in BMFont file");for(var a=0;a<t.length;a++){var n=splitLine(t[a],a);if(n)if("page"===n.key){if("number"!=typeof n.data.id)throw new Error("malformed file at line "+a+" -- needs page id=N");if("string"!=typeof n.data.file)throw new Error("malformed file at line "+a+' -- needs page file="path"');r.pages[n.data.id]=n.data.file}else"chars"===n.key||"kernings"===n.key||("char"===n.key?r.chars.push(n.data):"kerning"===n.key?r.kernings.push(n.data):r[n.key]=n.data)}return r};
70
+ },{}],28:[function(_dereq_,module,exports){
71
+ function readBlock(r,e,n){if(n>e.length-1)return 0;var a=e.readUInt8(n++),t=e.readInt32LE(n);switch(n+=4,a){case 1:r.info=readInfo(e,n);break;case 2:r.common=readCommon(e,n);break;case 3:r.pages=readPages(e,n,t);break;case 4:r.chars=readChars(e,n,t);break;case 5:r.kernings=readKernings(e,n,t)}return 5+t}function readInfo(r,e){var n={};n.size=r.readInt16LE(e);var a=r.readUInt8(e+2);return n.smooth=a>>7&1,n.unicode=a>>6&1,n.italic=a>>5&1,n.bold=a>>4&1,a>>3&1&&(n.fixedHeight=1),n.charset=r.readUInt8(e+3)||"",n.stretchH=r.readUInt16LE(e+4),n.aa=r.readUInt8(e+6),n.padding=[r.readInt8(e+7),r.readInt8(e+8),r.readInt8(e+9),r.readInt8(e+10)],n.spacing=[r.readInt8(e+11),r.readInt8(e+12)],n.outline=r.readUInt8(e+13),n.face=readStringNT(r,e+14),n}function readCommon(r,e){var n={};n.lineHeight=r.readUInt16LE(e),n.base=r.readUInt16LE(e+2),n.scaleW=r.readUInt16LE(e+4),n.scaleH=r.readUInt16LE(e+6),n.pages=r.readUInt16LE(e+8);r.readUInt8(e+10);return n.packed=0,n.alphaChnl=r.readUInt8(e+11),n.redChnl=r.readUInt8(e+12),n.greenChnl=r.readUInt8(e+13),n.blueChnl=r.readUInt8(e+14),n}function readPages(r,e,n){for(var a=[],t=readNameNT(r,e),d=t.length+1,o=n/d,i=0;i<o;i++)a[i]=r.slice(e,e+t.length).toString("utf8"),e+=d;return a}function readChars(r,e,n){for(var a=[],t=n/20,d=0;d<t;d++){var o={},i=20*d;o.id=r.readUInt32LE(e+0+i),o.x=r.readUInt16LE(e+4+i),o.y=r.readUInt16LE(e+6+i),o.width=r.readUInt16LE(e+8+i),o.height=r.readUInt16LE(e+10+i),o.xoffset=r.readInt16LE(e+12+i),o.yoffset=r.readInt16LE(e+14+i),o.xadvance=r.readInt16LE(e+16+i),o.page=r.readUInt8(e+18+i),o.chnl=r.readUInt8(e+19+i),a[d]=o}return a}function readKernings(r,e,n){for(var a=[],t=n/10,d=0;d<t;d++){var o={},i=10*d;o.first=r.readUInt32LE(e+0+i),o.second=r.readUInt32LE(e+4+i),o.amount=r.readInt16LE(e+8+i),a[d]=o}return a}function readNameNT(r,e){for(var n=e;n<r.length&&0!==r[n];n++);return r.slice(e,n)}function readStringNT(r,e){return readNameNT(r,e).toString("utf8")}var HEADER=[66,77,70];module.exports=function(r){if(r.length<6)throw new Error("invalid buffer length for BMFont");if(!HEADER.every(function(e,n){return r.readUInt8(n)===e}))throw new Error("BMFont missing BMF byte header");var e=3;if(r.readUInt8(e++)>3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var n={kernings:[],chars:[]},a=0;a<5;a++)e+=readBlock(n,r,e);return n};
72
+ },{}],29:[function(_dereq_,module,exports){
73
+ function getAttribs(e){return getAttribList(e).reduce(function(e,t){return e[mapName(t.nodeName)]=t.nodeValue,e},{})}function getAttribList(e){for(var t=[],r=0;r<e.attributes.length;r++)t.push(e.attributes[r]);return t}function mapName(e){return NAME_MAP[e.toLowerCase()]||e}var parseAttributes=_dereq_("./parse-attribs"),parseFromString=_dereq_("xml-parse-from-string"),NAME_MAP={scaleh:"scaleH",scalew:"scaleW",stretchh:"stretchH",lineheight:"lineHeight",alphachnl:"alphaChnl",redchnl:"redChnl",greenchnl:"greenChnl",bluechnl:"blueChnl"};module.exports=function(e){e=e.toString();var t=parseFromString(e),r={pages:[],chars:[],kernings:[]};["info","common"].forEach(function(e){var a=t.getElementsByTagName(e)[0];a&&(r[e]=parseAttributes(getAttribs(a)))});var a=t.getElementsByTagName("pages")[0];if(!a)throw new Error("malformed file -- no <pages> element");for(var n=a.getElementsByTagName("page"),i=0;i<n.length;i++){var s=n[i],g=parseInt(s.getAttribute("id"),10),l=s.getAttribute("file");if(isNaN(g))throw new Error('malformed file -- page "id" attribute is NaN');if(!l)throw new Error('malformed file -- needs page "file" attribute');r.pages[parseInt(g,10)]=l}return["chars","kernings"].forEach(function(e){var a=t.getElementsByTagName(e)[0];if(a)for(var n=e.substring(0,e.length-1),i=a.getElementsByTagName(n),s=0;s<i.length;s++){var g=i[s];r[e].push(parseAttributes(getAttribs(g)))}}),r};
74
+ },{"./parse-attribs":30,"xml-parse-from-string":74}],30:[function(_dereq_,module,exports){
75
+ function parseIntList(t){return t.split(",").map(function(t){return parseInt(t,10)})}var GLYPH_DESIGNER_ERROR="chasrset";module.exports=function(t){GLYPH_DESIGNER_ERROR in t&&(t.charset=t[GLYPH_DESIGNER_ERROR],delete t[GLYPH_DESIGNER_ERROR]);for(var n in t)"face"!==n&&"charset"!==n&&(t[n]="padding"===n||"spacing"===n?parseIntList(t[n]):parseInt(t[n],10));return t};
76
+ },{}],31:[function(_dereq_,module,exports){
77
+ var trim=_dereq_("trim"),forEach=_dereq_("for-each"),isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)};module.exports=function(r){if(!r)return{};var t={};return forEach(trim(r).split("\n"),function(r){var i=r.indexOf(":"),e=trim(r.slice(0,i)).toLowerCase(),o=trim(r.slice(i+1));void 0===t[e]?t[e]=o:isArray(t[e])?t[e].push(o):t[e]=[t[e],o]}),t};
78
+ },{"for-each":16,"trim":46}],32:[function(_dereq_,module,exports){
79
+ (function (process){
80
+ function normalizeArray(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}function filter(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);return e}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,splitPath=function(r){return splitPathRe.exec(r).slice(1)};exports.resolve=function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:process.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(r=n+"/"+r,t="/"===n.charAt(0))}return r=normalizeArray(filter(r.split("/"),function(r){return!!r}),!t).join("/"),(t?"/":"")+r||"."},exports.normalize=function(r){var t=exports.isAbsolute(r),e="/"===substr(r,-1);return r=normalizeArray(filter(r.split("/"),function(r){return!!r}),!t).join("/"),r||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(r,function(r,t){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),s=e(t.split("/")),i=Math.min(n.length,s.length),o=i,u=0;u<i;u++)if(n[u]!==s[u]){o=u;break}for(var l=[],u=o;u<n.length;u++)l.push("..");return l=l.concat(s.slice(o)),l.join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(r){var t=splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},exports.basename=function(r,t){var e=splitPath(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){return splitPath(r)[3]};var substr="b"==="ab".substr(-1)?function(r,t,e){return r.substr(t,e)}:function(r,t,e){return t<0&&(t=r.length+t),r.substr(t,e)};
81
+ }).call(this,_dereq_('_process'))
82
+
83
+ },{"_process":6}],33:[function(_dereq_,module,exports){
84
+ (function (global){
85
+ var performance=global.performance||{},present=function(){for(var e=["now","webkitNow","msNow","mozNow","oNow"];e.length;){var n=e.shift();if(n in performance)return performance[n].bind(performance)}var r=Date.now||function(){return(new Date).getTime()},o=(performance.timing||{}).navigationStart||r();return function(){return r()-o}}();present.performanceNow=performance.now,present.noConflict=function(){performance.now=present.performanceNow},present.conflict=function(){performance.now=present},present.conflict(),module.exports=present;
86
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
87
+
88
+ },{}],34:[function(_dereq_,module,exports){
89
+ !function(t){function e(t,e){return function(){t.apply(e,arguments)}}function n(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,e(r,this),e(i,this))}function o(t){var e=this;if(null===this._state)return void this._deferreds.push(t);l(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return void(e._state?t.resolve:t.reject)(e._value);var o;try{o=n(e._value)}catch(e){return void t.reject(e)}t.resolve(o)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void f(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,u.call(this)}catch(t){i.call(this,t)}}function i(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=o}function f(t,e,n){var o=!1;try{t(function(t){o||(o=!0,e(t))},function(t){o||(o=!0,n(t))})}catch(t){if(o)return;o=!0,n(t)}}var s=setTimeout,l="function"==typeof setImmediate&&setImmediate||function(t){s(t,1)},h=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n(function(n,i){o.call(r,new c(t,e,n,i))})},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&h(arguments[0])?arguments[0]:arguments);return new n(function(e,n){function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var c=u.then;if("function"==typeof c)return void c.call(u,function(t){o(i,t)},n)}t[i]=u,0==--r&&e(t)}catch(t){n(t)}}if(0===t.length)return e([]);for(var r=t.length,i=0;i<t.length;i++)o(i,t[i])})},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n(function(e){e(t)})},n.reject=function(t){return new n(function(e,n){n(t)})},n.race=function(t){return new n(function(e,n){for(var o=0,r=t.length;o<r;o++)t[o].then(e,n)})},n._setImmediateFn=function(t){l=t},"undefined"!=typeof module&&module.exports?module.exports=n:t.Promise||(t.Promise=n)}(this);
90
+ },{}],35:[function(_dereq_,module,exports){
91
+ var dtype=_dereq_("dtype"),anArray=_dereq_("an-array"),isBuffer=_dereq_("is-buffer"),CW=[0,2,3],CCW=[2,1,3];module.exports=function(r,e){r&&(anArray(r)||isBuffer(r))||(e=r||{},r=null),e="number"==typeof e?{count:e}:e||{};for(var t="string"==typeof e.type?e.type:"uint16",u="number"==typeof e.count?e.count:1,n=e.start||0,a=!1!==e.clockwise?CW:CCW,f=a[0],o=a[1],y=a[2],i=6*u,p=r||new(dtype(t))(i),s=0,c=0;s<i;s+=6,c+=4){var C=s+n;p[C+0]=c+0,p[C+1]=c+1,p[C+2]=c+2,p[C+3]=c+f,p[C+4]=c+o,p[C+5]=c+y}return p};
92
+ },{"an-array":2,"dtype":14,"is-buffer":20}],36:[function(_dereq_,module,exports){
93
+ function parse(r,e){e=e||{};var n=e.preserveNumbers,t=function(r){return r.trim()},i={};return getKeyValueChunks(r).map(t).filter(Boolean).forEach(function(r){var e=r.indexOf(":"),t=r.substr(0,e).trim(),u=r.substr(e+1).trim();n&&isNumeric(u)&&(u=Number(u)),i[t]=u}),i}function isNumeric(r){return!isNaN(parseFloat(r))&&isFinite(r)}function getKeyValueChunks(r){for(var e,n=[],t=0,i=/url\([^\)]+$/,u="";t<r.length;)e=r.indexOf(";",t),-1===e&&(e=r.length),u+=r.substring(t,e),i.test(u)?(u+=";",t=e+1):(n.push(u),u="",t=e+1);return n}function stringify(r){return Object.keys(r).map(function(e){return e+":"+r[e]}).join(";")}function normalize(r,e){return stringify(parse(r,e))}module.exports.parse=parse,module.exports.stringify=stringify,module.exports.normalize=normalize;
94
+ },{}],37:[function(_dereq_,module,exports){
95
+ function TextGeometry(e){Base.call(this),"string"==typeof e&&(e={text:e}),this._opt=assign({},e),e&&this.update(e)}var createLayout=_dereq_("layout-bmfont-text"),inherits=_dereq_("inherits"),createIndices=_dereq_("quad-indices"),buffer=_dereq_("three-buffer-vertex-data"),assign=_dereq_("object-assign"),vertices=_dereq_("./lib/vertices"),utils=_dereq_("./lib/utils"),Base=THREE.BufferGeometry;module.exports=function(e){return new TextGeometry(e)},inherits(TextGeometry,Base),TextGeometry.prototype.update=function(e){if("string"==typeof e&&(e={text:e}),e=assign({},this._opt,e),!e.font)throw new TypeError("must specify a { font } in options");this.layout=createLayout(e);var t=!1!==e.flipY,i=e.font,r=i.common.scaleW,o=i.common.scaleH,s=this.layout.glyphs.filter(function(e){var t=e.data;return t.width*t.height>0});this.visibleGlyphs=s;var n=vertices.positions(s),u=vertices.uvs(s,r,o,t),a=createIndices({clockwise:!0,type:"uint16",count:s.length});if(buffer.index(this,a,1,"uint16"),buffer.attr(this,"position",n,2),buffer.attr(this,"uv",u,2),!e.multipage&&"page"in this.attributes)this.removeAttribute("page");else if(e.multipage){var h=vertices.pages(s);buffer.attr(this,"page",h,1)}},TextGeometry.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var e=this.attributes.position.array,t=this.attributes.position.itemSize;if(!e||!t||e.length<2)return this.boundingSphere.radius=0,void this.boundingSphere.center.set(0,0,0);utils.computeSphere(e,this.boundingSphere),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')},TextGeometry.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var e=this.boundingBox,t=this.attributes.position.array,i=this.attributes.position.itemSize;if(!t||!i||t.length<2)return void e.makeEmpty();utils.computeBox(t,e)};
96
+ },{"./lib/utils":38,"./lib/vertices":39,"inherits":19,"layout-bmfont-text":23,"object-assign":26,"quad-indices":35,"three-buffer-vertex-data":40}],38:[function(_dereq_,module,exports){
97
+ function bounds(x){var m=x.length/itemSize;box.min[0]=x[0],box.min[1]=x[1],box.max[0]=x[0],box.max[1]=x[1];for(var o=0;o<m;o++){var i=x[o*itemSize+0],a=x[o*itemSize+1];box.min[0]=Math.min(i,box.min[0]),box.min[1]=Math.min(a,box.min[1]),box.max[0]=Math.max(i,box.max[0]),box.max[1]=Math.max(a,box.max[1])}}var itemSize=2,box={min:[0,0],max:[0,0]};module.exports.computeBox=function(x,m){bounds(x),m.min.set(box.min[0],box.min[1],0),m.max.set(box.max[0],box.max[1],0)},module.exports.computeSphere=function(x,m){bounds(x);var o=box.min[0],i=box.min[1],a=box.max[0],n=box.max[1],b=a-o,e=n-i,t=Math.sqrt(b*b+e*e);m.center.set(o+b/2,i+e/2,0),m.radius=t/2};
98
+ },{}],39:[function(_dereq_,module,exports){
99
+ module.exports.pages=function(t){var o=new Float32Array(4*t.length*1),n=0;return t.forEach(function(t){var r=t.data.page||0;o[n++]=r,o[n++]=r,o[n++]=r,o[n++]=r}),o},module.exports.uvs=function(t,o,n,r){var a=new Float32Array(4*t.length*2),e=0;return t.forEach(function(t){var i=t.data,f=i.x+i.width,u=i.y+i.height,h=i.x/o,s=i.y/n,c=f/o,l=u/n;r&&(s=(n-i.y)/n,l=(n-u)/n),a[e++]=h,a[e++]=s,a[e++]=h,a[e++]=l,a[e++]=c,a[e++]=l,a[e++]=c,a[e++]=s}),a},module.exports.positions=function(t){var o=new Float32Array(4*t.length*2),n=0;return t.forEach(function(t){var r=t.data,a=t.position[0]+r.xoffset,e=t.position[1]+r.yoffset,i=r.width,f=r.height;o[n++]=a,o[n++]=e,o[n++]=a,o[n++]=e+f,o[n++]=a+i,o[n++]=e+f,o[n++]=a+i,o[n++]=e}),o};
100
+ },{}],40:[function(_dereq_,module,exports){
101
+ function setIndex(e,t,r,n){"number"!=typeof r&&(r=1),"string"!=typeof n&&(n="uint16");var i=!e.index&&"function"!=typeof e.setIndex,a=i?e.getAttribute("index"):e.index,u=updateAttribute(a,t,r,n);u&&(i?e.addAttribute("index",u):e.index=u)}function setAttribute(e,t,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=e.getAttribute(t),u=updateAttribute(a,r,n,i);u&&e.addAttribute(t,u)}function updateAttribute(e,t,r,n){if(t=t||[],!e||rebuildAttribute(e,t,r)){t=flatten(t,n);var i=e&&"function"!=typeof e.setArray;return e&&!i||(i&&!warned&&(warned=!0,console.warn(["A WebGL buffer is being updated with a new size or itemSize, ","however this version of 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 update to ThreeJS r82 or newer.\n","See here for discussion:\n","https://github.com/mrdoob/three.js/pull/9631"].join(""))),e=new THREE.BufferAttribute(t,r)),e.itemSize=r,e.needsUpdate=!0,"function"==typeof e.setArray&&e.setArray(t),e}return flatten(t,e.array),e.needsUpdate=!0,null}function rebuildAttribute(e,t,r){if(e.itemSize!==r)return!0;if(!e.array)return!0;var n=e.array.length;return Array.isArray(t)&&Array.isArray(t[0])?n!==t.length*r:n!==t.length}var flatten=_dereq_("flatten-vertex-data"),warned=!1;module.exports.attr=setAttribute,module.exports.index=setIndex;
102
+ },{"flatten-vertex-data":15}],41:[function(_dereq_,module,exports){
103
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.THREE=t.THREE||{})}(this,function(t){"use strict";function e(){}function i(t,e){this.x=t||0,this.y=e||0}function n(t,e,r,a,o,s,c,h,l,u){Object.defineProperty(this,"id",{value:ts++}),this.uuid=$o.generateUUID(),this.name="",this.image=void 0!==t?t:n.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:n.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:eo,this.wrapT=void 0!==a?a:eo,this.magFilter=void 0!==o?o:oo,this.minFilter=void 0!==s?s:co,this.anisotropy=void 0!==l?l:1,this.format=void 0!==c?c:Eo,this.type=void 0!==h?h:ho,this.offset=new i(0,0),this.repeat=new i(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:jo,this.version=0,this.onUpdate=null}function r(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}function a(t,e,i){this.uuid=$o.generateUUID(),this.width=t,this.height=e,this.scissor=new r(0,0,t,e),this.scissorTest=!1,this.viewport=new r(0,0,t,e),i=i||{},void 0===i.minFilter&&(i.minFilter=oo),this.texture=new n(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function o(t,e,i){a.call(this,t,e,i),this.activeCubeFace=0,this.activeMipMapLevel=0}function s(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==n?n:1}function c(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}function h(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function l(t,e,i,r,a,o,s,c,h,l){t=void 0!==t?t:[],e=void 0!==e?e:qa,n.call(this,t,e,i,r,a,o,s,c,h,l),this.flipY=!1}function u(){this.seq=[],this.map={}}function p(t,e,i){var n=t[0];if(n<=0||n>0)return t;var r=e*i,a=ns[r];if(void 0===a&&(a=new Float32Array(r),ns[r]=a),0!==e){n.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=i,t[o].toArray(a,s)}return a}function d(t,e){var i=rs[e];void 0===i&&(i=new Int32Array(e),rs[e]=i);for(var n=0;n!==e;++n)i[n]=t.allocTextureUnit();return i}function f(t,e){t.uniform1f(this.addr,e)}function m(t,e){t.uniform1i(this.addr,e)}function g(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function v(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function y(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function x(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function _(t,e){t.uniformMatrix3fv(this.addr,!1,e.elements||e)}function b(t,e){t.uniformMatrix4fv(this.addr,!1,e.elements||e)}function w(t,e,i){var n=i.allocTextureUnit();t.uniform1i(this.addr,n),i.setTexture2D(e||es,n)}function M(t,e,i){var n=i.allocTextureUnit();t.uniform1i(this.addr,n),i.setTextureCube(e||is,n)}function E(t,e){t.uniform2iv(this.addr,e)}function T(t,e){t.uniform3iv(this.addr,e)}function S(t,e){t.uniform4iv(this.addr,e)}function A(t){switch(t){case 5126:return f;case 35664:return g;case 35665:return v;case 35666:return y;case 35674:return x;case 35675:return _;case 35676:return b;case 35678:return w;case 35680:return M;case 5124:case 35670:return m;case 35667:case 35671:return E;case 35668:case 35672:return T;case 35669:case 35673:return S}}function L(t,e){t.uniform1fv(this.addr,e)}function R(t,e){t.uniform1iv(this.addr,e)}function P(t,e){t.uniform2fv(this.addr,p(e,this.size,2))}function C(t,e){t.uniform3fv(this.addr,p(e,this.size,3))}function I(t,e){t.uniform4fv(this.addr,p(e,this.size,4))}function U(t,e){t.uniformMatrix2fv(this.addr,!1,p(e,this.size,4))}function N(t,e){t.uniformMatrix3fv(this.addr,!1,p(e,this.size,9))}function D(t,e){t.uniformMatrix4fv(this.addr,!1,p(e,this.size,16))}function O(t,e,i){var n=e.length,r=d(i,n);t.uniform1iv(this.addr,r);for(var a=0;a!==n;++a)i.setTexture2D(e[a]||es,r[a])}function B(t,e,i){var n=e.length,r=d(i,n);t.uniform1iv(this.addr,r);for(var a=0;a!==n;++a)i.setTextureCube(e[a]||is,r[a])}function F(t){switch(t){case 5126:return L;case 35664:return P;case 35665:return C;case 35666:return I;case 35674:return U;case 35675:return N;case 35676:return D;case 35678:return O;case 35680:return B;case 5124:case 35670:return R;case 35667:case 35671:return E;case 35668:case 35672:return T;case 35669:case 35673:return S}}function z(t,e,i){this.id=t,this.addr=i,this.setValue=A(e.type)}function G(t,e,i){this.id=t,this.addr=i,this.size=e.size,this.setValue=F(e.type)}function H(t){this.id=t,u.call(this)}function V(t,e){t.seq.push(e),t.map[e.id]=e}function k(t,e,i){var n=t.name,r=n.length;for(as.lastIndex=0;;){var a=as.exec(n),o=as.lastIndex,s=a[1],c="]"===a[2],h=a[3];if(c&&(s|=0),void 0===h||"["===h&&o+2===r){V(i,void 0===h?new z(s,t,e):new G(s,t,e));break}var l=i.map,u=l[s];void 0===u&&(u=new H(s),V(i,u)),i=u}}function j(t,e,i){u.call(this),this.renderer=i;for(var n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),r=0;r<n;++r){var a=t.getActiveUniform(e,r),o=a.name;k(a,t.getUniformLocation(e,o),this)}}function W(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}function X(t,e,i,r,a,o,s,c,h,l,u,p){n.call(this,null,o,s,c,h,l,r,a,u,p),this.image={data:t,width:e,height:i},this.magFilter=void 0!==h?h:no,this.minFilter=void 0!==l?l:no,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function q(t,e){this.min=void 0!==t?t:new i(1/0,1/0),this.max=void 0!==e?e:new i(-1/0,-1/0)}function Y(t,e){function n(){var t=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),e=new Uint16Array([0,1,2,0,2,3]);a=f.createBuffer(),o=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,a),f.bufferData(f.ARRAY_BUFFER,t,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,o),f.bufferData(f.ELEMENT_ARRAY_BUFFER,e,f.STATIC_DRAW),p=f.createTexture(),d=f.createTexture(),m.bindTexture(f.TEXTURE_2D,p),f.texImage2D(f.TEXTURE_2D,0,f.RGB,16,16,0,f.RGB,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),m.bindTexture(f.TEXTURE_2D,d),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,16,16,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),s={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},h=r(s),l={vertex:f.getAttribLocation(h,"position"),uv:f.getAttribLocation(h,"uv")},u={renderType:f.getUniformLocation(h,"renderType"),map:f.getUniformLocation(h,"map"),occlusionMap:f.getUniformLocation(h,"occlusionMap"),opacity:f.getUniformLocation(h,"opacity"),color:f.getUniformLocation(h,"color"),scale:f.getUniformLocation(h,"scale"),rotation:f.getUniformLocation(h,"rotation"),screenPosition:f.getUniformLocation(h,"screenPosition")}}function r(e){var i=f.createProgram(),n=f.createShader(f.FRAGMENT_SHADER),r=f.createShader(f.VERTEX_SHADER),a="precision "+t.getPrecision()+" float;\n";return f.shaderSource(n,a+e.fragmentShader),f.shaderSource(r,a+e.vertexShader),f.compileShader(n),f.compileShader(r),f.attachShader(i,n),f.attachShader(i,r),f.linkProgram(i),i}var a,o,s,h,l,u,p,d,f=t.context,m=t.state;this.render=function(r,s,g){if(0!==e.length){var v=new c,y=g.w/g.z,x=.5*g.z,_=.5*g.w,b=16/g.w,w=new i(b*y,b),M=new c(1,1,0),E=new i(1,1),T=new q;T.min.set(g.x,g.y),T.max.set(g.x+(g.z-16),g.y+(g.w-16)),void 0===h&&n(),f.useProgram(h),m.initAttributes(),m.enableAttribute(l.vertex),m.enableAttribute(l.uv),m.disableUnusedAttributes(),f.uniform1i(u.occlusionMap,0),f.uniform1i(u.map,1),f.bindBuffer(f.ARRAY_BUFFER,a),f.vertexAttribPointer(l.vertex,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(l.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,o),m.disable(f.CULL_FACE),m.setDepthWrite(!1);for(var S=0,A=e.length;S<A;S++){b=16/g.w,w.set(b*y,b);var L=e[S];if(v.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),v.applyMatrix4(s.matrixWorldInverse),v.applyMatrix4(s.projectionMatrix),M.copy(v),E.x=g.x+M.x*x+x-8,E.y=g.y+M.y*_+_-8,!0===T.containsPoint(E)){m.activeTexture(f.TEXTURE0),m.bindTexture(f.TEXTURE_2D,null),m.activeTexture(f.TEXTURE1),m.bindTexture(f.TEXTURE_2D,p),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGB,E.x,E.y,16,16,0),f.uniform1i(u.renderType,0),f.uniform2f(u.scale,w.x,w.y),f.uniform3f(u.screenPosition,M.x,M.y,M.z),m.disable(f.BLEND),m.enable(f.DEPTH_TEST),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),m.activeTexture(f.TEXTURE0),m.bindTexture(f.TEXTURE_2D,d),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGBA,E.x,E.y,16,16,0),f.uniform1i(u.renderType,1),m.disable(f.DEPTH_TEST),m.activeTexture(f.TEXTURE1),m.bindTexture(f.TEXTURE_2D,p),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),L.positionScreen.copy(M),L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares(),f.uniform1i(u.renderType,2),m.enable(f.BLEND);for(var R=0,P=L.lensFlares.length;R<P;R++){var C=L.lensFlares[R];C.opacity>.001&&C.scale>.001&&(M.x=C.x,M.y=C.y,M.z=C.z,b=C.size*C.scale/g.w,w.x=b*y,w.y=b,f.uniform3f(u.screenPosition,M.x,M.y,M.z),f.uniform2f(u.scale,w.x,w.y),f.uniform1f(u.rotation,C.rotation),f.uniform1f(u.opacity,C.opacity),f.uniform3f(u.color,C.color.r,C.color.g,C.color.b),m.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),t.setTexture2D(C.texture,1),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0))}}}m.enable(f.CULL_FACE),m.enable(f.DEPTH_TEST),m.setDepthWrite(!0),t.resetGLState()}}}function Z(t,e){function i(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),e=new Uint16Array([0,1,2,0,2,3]);o=f.createBuffer(),h=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,o),f.bufferData(f.ARRAY_BUFFER,t,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h),f.bufferData(f.ELEMENT_ARRAY_BUFFER,e,f.STATIC_DRAW),l=r(),u={position:f.getAttribLocation(l,"position"),uv:f.getAttribLocation(l,"uv")},p={uvOffset:f.getUniformLocation(l,"uvOffset"),uvScale:f.getUniformLocation(l,"uvScale"),rotation:f.getUniformLocation(l,"rotation"),scale:f.getUniformLocation(l,"scale"),color:f.getUniformLocation(l,"color"),map:f.getUniformLocation(l,"map"),opacity:f.getUniformLocation(l,"opacity"),modelViewMatrix:f.getUniformLocation(l,"modelViewMatrix"),projectionMatrix:f.getUniformLocation(l,"projectionMatrix"),fogType:f.getUniformLocation(l,"fogType"),fogDensity:f.getUniformLocation(l,"fogDensity"),fogNear:f.getUniformLocation(l,"fogNear"),fogFar:f.getUniformLocation(l,"fogFar"),fogColor:f.getUniformLocation(l,"fogColor"),alphaTest:f.getUniformLocation(l,"alphaTest")};var i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");i.width=8,i.height=8;var a=i.getContext("2d");a.fillStyle="white",a.fillRect(0,0,8,8),d=new n(i),d.needsUpdate=!0}function r(){var e=f.createProgram(),i=f.createShader(f.VERTEX_SHADER),n=f.createShader(f.FRAGMENT_SHADER);return f.shaderSource(i,["precision "+t.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),f.shaderSource(n,["precision "+t.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),f.compileShader(i),f.compileShader(n),f.attachShader(e,i),f.attachShader(e,n),f.linkProgram(e),e}function a(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var o,h,l,u,p,d,f=t.context,m=t.state,g=new c,v=new s,y=new c;this.render=function(n,r){if(0!==e.length){void 0===l&&i(),f.useProgram(l),m.initAttributes(),m.enableAttribute(u.position),m.enableAttribute(u.uv),m.disableUnusedAttributes(),m.disable(f.CULL_FACE),m.enable(f.BLEND),f.bindBuffer(f.ARRAY_BUFFER,o),f.vertexAttribPointer(u.position,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(u.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h),f.uniformMatrix4fv(p.projectionMatrix,!1,r.projectionMatrix.elements),m.activeTexture(f.TEXTURE0),f.uniform1i(p.map,0);var s=0,c=0,x=n.fog;x?(f.uniform3f(p.fogColor,x.color.r,x.color.g,x.color.b),x.isFog?(f.uniform1f(p.fogNear,x.near),f.uniform1f(p.fogFar,x.far),f.uniform1i(p.fogType,1),s=1,c=1):x.isFogExp2&&(f.uniform1f(p.fogDensity,x.density),f.uniform1i(p.fogType,2),s=2,c=2)):(f.uniform1i(p.fogType,0),s=0,c=0);for(var _=0,b=e.length;_<b;_++){var w=e[_];w.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,w.matrixWorld),w.z=-w.modelViewMatrix.elements[14]}e.sort(a);for(var M=[],_=0,b=e.length;_<b;_++){var w=e[_],E=w.material;if(!1!==E.visible){f.uniform1f(p.alphaTest,E.alphaTest),f.uniformMatrix4fv(p.modelViewMatrix,!1,w.modelViewMatrix.elements),w.matrixWorld.decompose(g,v,y),M[0]=y.x,M[1]=y.y;var T=0;n.fog&&E.fog&&(T=c),s!==T&&(f.uniform1i(p.fogType,T),s=T),null!==E.map?(f.uniform2f(p.uvOffset,E.map.offset.x,E.map.offset.y),f.uniform2f(p.uvScale,E.map.repeat.x,E.map.repeat.y)):(f.uniform2f(p.uvOffset,0,0),f.uniform2f(p.uvScale,1,1)),f.uniform1f(p.opacity,E.opacity),f.uniform3f(p.color,E.color.r,E.color.g,E.color.b),f.uniform1f(p.rotation,E.rotation),f.uniform2fv(p.scale,M),m.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst),m.setDepthTest(E.depthTest),m.setDepthWrite(E.depthWrite),E.map?t.setTexture2D(E.map,0):t.setTexture2D(d,0),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0)}}m.enable(f.CULL_FACE),t.resetGLState()}}}function J(){Object.defineProperty(this,"id",{value:us++}),this.uuid=$o.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=la,this.side=ea,this.shading=aa,this.vertexColors=oa,this.opacity=1,this.transparent=!1,this.blendSrc=Ea,this.blendDst=Ta,this.blendEquation=ma,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Na,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function Q(t){J.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function K(t){J.call(this),this.type="MeshDepthMaterial",this.depthPacking=Qo,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function $(t,e){this.min=void 0!==t?t:new c(1/0,1/0,1/0),this.max=void 0!==e?e:new c(-1/0,-1/0,-1/0)}function tt(t,e){this.center=void 0!==t?t:new c,this.radius=void 0!==e?e:0}function et(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function it(t,e){this.normal=void 0!==t?t:new c(1,0,0),this.constant=void 0!==e?e:0}function nt(t,e,i,n,r,a){this.planes=[void 0!==t?t:new it,void 0!==e?e:new it,void 0!==i?i:new it,void 0!==n?n:new it,void 0!==r?r:new it,void 0!==a?a:new it]}function rt(t,e,n,o){function s(e,i,n,r){var a=e.geometry,o=null,s=E,c=e.customDepthMaterial;if(n&&(s=T,c=e.customDistanceMaterial),c)o=c;else{var h=!1;i.morphTargets&&(a&&a.isBufferGeometry?h=a.morphAttributes&&a.morphAttributes.position&&a.morphAttributes.position.length>0:a&&a.isGeometry&&(h=a.morphTargets&&a.morphTargets.length>0));var l=e.isSkinnedMesh&&i.skinning,u=0;h&&(u|=b),l&&(u|=w),o=s[u]}if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){var p=o.uuid,d=i.uuid,f=S[p];void 0===f&&(f={},S[p]=f);var m=f[d];void 0===m&&(m=o.clone(),f[d]=m),o=m}o.visible=i.visible,o.wireframe=i.wireframe;var g=i.side;return F.renderSingleSided&&g==na&&(g=ea),F.renderReverseSided&&(g===ea?g=ia:g===ia&&(g=ea)),o.side=g,o.clipShadows=i.clipShadows,o.clippingPlanes=i.clippingPlanes,o.wireframeLinewidth=i.wireframeLinewidth,o.linewidth=i.linewidth,n&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(r),o}function l(t,e,i){if(!1!==t.visible){if(0!=(t.layers.mask&e.layers.mask)&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!1===t.frustumCulled||!0===d.intersectsObject(t))){!0===t.material.visible&&(t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),_.push(t))}for(var n=t.children,r=0,a=n.length;r<a;r++)l(n[r],e,i)}}var u=t.context,p=t.state,d=new nt,f=new h,m=e.shadows,g=new i,v=new i(o.maxTextureSize,o.maxTextureSize),y=new c,x=new c,_=[],b=1,w=2,M=1+(b|w),E=new Array(M),T=new Array(M),S={},A=[new c(1,0,0),new c(-1,0,0),new c(0,0,1),new c(0,0,-1),new c(0,1,0),new c(0,-1,0)],L=[new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,0,1),new c(0,0,-1)],R=[new r,new r,new r,new r,new r,new r],P=new K;P.depthPacking=Ko,P.clipping=!0;for(var C=ls.distanceRGBA,I=os.clone(C.uniforms),U=0;U!==M;++U){var N=0!=(U&b),D=0!=(U&w),O=P.clone();O.morphTargets=N,O.skinning=D,E[U]=O;var B=new Q({defines:{USE_SHADOWMAP:""},uniforms:I,vertexShader:C.vertexShader,fragmentShader:C.fragmentShader,morphTargets:N,skinning:D,clipping:!0});T[U]=B}var F=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=$r,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(e,i){if(!1!==F.enabled&&(!1!==F.autoUpdate||!1!==F.needsUpdate)&&0!==m.length){p.buffers.color.setClear(1,1,1,1),p.disable(u.BLEND),p.setDepthTest(!0),p.setScissorTest(!1);for(var r,o,c=0,h=m.length;c<h;c++){var b=m[c],w=b.shadow;if(void 0!==w){var M=w.camera;if(g.copy(w.mapSize),g.min(v),b&&b.isPointLight){r=6,o=!0;var E=g.x,T=g.y;R[0].set(2*E,T,E,T),R[1].set(0,T,E,T),R[2].set(3*E,T,E,T),R[3].set(E,T,E,T),R[4].set(3*E,0,E,T),R[5].set(E,0,E,T),g.x*=4,g.y*=2}else r=1,o=!1;if(null===w.map){var S={minFilter:no,magFilter:no,format:Eo};w.map=new a(g.x,g.y,S),M.updateProjectionMatrix()}w.isSpotLightShadow&&w.update(b),w&&w.isRectAreaLightShadow&&w.update(b);var P=w.map,C=w.matrix;x.setFromMatrixPosition(b.matrixWorld),M.position.copy(x),t.setRenderTarget(P),t.clear();for(var I=0;I<r;I++){if(o){y.copy(M.position),y.add(A[I]),M.up.copy(L[I]),M.lookAt(y);var U=R[I];p.viewport(U)}else y.setFromMatrixPosition(b.target.matrixWorld),M.lookAt(y);M.updateMatrixWorld(),M.matrixWorldInverse.getInverse(M.matrixWorld),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(M.projectionMatrix),C.multiply(M.matrixWorldInverse),f.multiplyMatrices(M.projectionMatrix,M.matrixWorldInverse),d.setFromMatrix(f),_.length=0,l(e,i,M);for(var N=0,D=_.length;N<D;N++){var O=_[N],B=n.update(O),z=O.material;if(z&&z.isMultiMaterial)for(var G=B.groups,H=z.materials,V=0,k=G.length;V<k;V++){var j=G[V],W=H[j.materialIndex];if(!0===W.visible){var X=s(O,W,o,x);t.renderBufferDirect(M,null,B,X,O,j)}}else{var X=s(O,z,o,x);t.renderBufferDirect(M,null,B,X,O,null)}}}}else console.warn("THREE.WebGLShadowMap:",b,"has no shadow.")}var q=t.getClearColor(),Y=t.getClearAlpha();t.setClearColor(q,Y),F.needsUpdate=!1}}}function at(t,e){this.origin=void 0!==t?t:new c,this.direction=void 0!==e?e:new c}function ot(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._order=n||ot.DefaultOrder}function st(){this.mask=1}function ct(){function t(){r.setFromEuler(n,!1)}function e(){n.setFromQuaternion(r,void 0,!1)}Object.defineProperty(this,"id",{value:ps++}),this.uuid=$o.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ct.DefaultUp.clone();var i=new c,n=new ot,r=new s,a=new c(1,1,1);n.onChange(t),r.onChange(e),Object.defineProperties(this,{position:{enumerable:!0,value:i},rotation:{enumerable:!0,value:n},quaternion:{enumerable:!0,value:r},scale:{enumerable:!0,value:a},modelViewMatrix:{value:new h},normalMatrix:{value:new et}}),this.matrix=new h,this.matrixWorld=new h,this.matrixAutoUpdate=ct.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new st,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={},this.onBeforeRender=function(){},this.onAfterRender=function(){}}function ht(t,e){this.start=void 0!==t?t:new c,this.end=void 0!==e?e:new c}function lt(t,e,i){this.a=void 0!==t?t:new c,this.b=void 0!==e?e:new c,this.c=void 0!==i?i:new c}function ut(t,e,i,n,r,a){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new c,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new W,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}function pt(t){J.call(this),this.type="MeshBasicMaterial",this.color=new W(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=za,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function dt(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=$o.generateUUID(),this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function ft(t,e){dt.call(this,new Int8Array(t),e)}function mt(t,e){dt.call(this,new Uint8Array(t),e)}function gt(t,e){dt.call(this,new Uint8ClampedArray(t),e)}function vt(t,e){dt.call(this,new Int16Array(t),e)}function yt(t,e){dt.call(this,new Uint16Array(t),e)}function xt(t,e){dt.call(this,new Int32Array(t),e)}function _t(t,e){dt.call(this,new Uint32Array(t),e)}function bt(t,e){dt.call(this,new Float32Array(t),e)}function wt(t,e){dt.call(this,new Float64Array(t),e)}function Mt(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Et(t){for(var e=t.length,i=-1/0;e--;)t[e]>i&&(i=t[e]);return i}function Tt(){return ds++}function St(){Object.defineProperty(this,"id",{value:Tt()}),this.uuid=$o.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function At(){Object.defineProperty(this,"id",{value:Tt()}),this.uuid=$o.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function Lt(t,e){ct.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new At,this.material=void 0!==e?e:new pt({color:16777215*Math.random()}),this.drawMode=Ho,this.updateMorphTargets()}function Rt(t,e,i,n,r,a){St.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new Pt(t,e,i,n,r,a)),this.mergeVertices()}function Pt(t,e,i,n,r,a){function o(t,e,i,n,r,a,o,m,g,v,y){var x,_,b=a/g,w=o/v,M=a/2,E=o/2,T=m/2,S=g+1,A=v+1,L=0,R=0,P=new c;for(_=0;_<A;_++){var C=_*w-E;for(x=0;x<S;x++){var I=x*b-M;P[t]=I*n,P[e]=C*r,P[i]=T,l.push(P.x,P.y,P.z),P[t]=0,P[e]=0,P[i]=m>0?1:-1,u.push(P.x,P.y,P.z),p.push(x/g),p.push(1-_/v),L+=1}}for(_=0;_<v;_++)for(x=0;x<g;x++){var U=d+x+S*_,N=d+x+S*(_+1),D=d+(x+1)+S*(_+1),O=d+(x+1)+S*_;h.push(U,N,O),h.push(N,D,O),R+=6}s.addGroup(f,R,y),f+=R,d+=L}At.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};var s=this;n=Math.floor(n)||1,r=Math.floor(r)||1,a=Math.floor(a)||1;var h=[],l=[],u=[],p=[],d=0,f=0;o("z","y","x",-1,-1,i,e,t,a,r,0),o("z","y","x",1,-1,i,e,-t,a,r,1),o("x","z","y",1,1,t,i,e,n,a,2),o("x","z","y",1,-1,t,i,-e,n,a,3),o("x","y","z",1,-1,t,e,i,n,r,4),o("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(h),this.addAttribute("position",new bt(l,3)),this.addAttribute("normal",new bt(u,3)),this.addAttribute("uv",new bt(p,2))}function Ct(t,e,i,n){St.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new It(t,e,i,n))}function It(t,e,i,n){At.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};var r,a,o=t/2,s=e/2,c=Math.floor(i)||1,h=Math.floor(n)||1,l=c+1,u=h+1,p=t/c,d=e/h,f=[],m=[],g=[],v=[];for(a=0;a<u;a++){var y=a*d-s;for(r=0;r<l;r++){var x=r*p-o;m.push(x,-y,0),g.push(0,0,1),v.push(r/c),v.push(1-a/h)}}for(a=0;a<h;a++)for(r=0;r<c;r++){var _=r+l*a,b=r+l*(a+1),w=r+1+l*(a+1),M=r+1+l*a;f.push(_,b,M),f.push(b,w,M)}this.setIndex(f),this.addAttribute("position",new bt(m,3)),this.addAttribute("normal",new bt(g,3)),this.addAttribute("uv",new bt(v,2))}function Ut(){ct.call(this),this.type="Camera",this.matrixWorldInverse=new h,this.projectionMatrix=new h}function Nt(t,e,i,n){Ut.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Dt(t,e,i,n,r,a){Ut.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Ot(t,e,i){function n(t){s=t}function r(i){i.array instanceof Uint32Array&&e.get("OES_element_index_uint")?(c=t.UNSIGNED_INT,h=4):i.array instanceof Uint16Array?(c=t.UNSIGNED_SHORT,h=2):(c=t.UNSIGNED_BYTE,h=1)}function a(e,n){t.drawElements(s,n,c,e*h),i.calls++,i.vertices+=n,s===t.TRIANGLES&&(i.faces+=n/3)}function o(n,r,a){var o=e.get("ANGLE_instanced_arrays");if(null===o)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");o.drawElementsInstancedANGLE(s,a,c,r*h,n.maxInstancedCount),i.calls++,i.vertices+=a*n.maxInstancedCount,s===t.TRIANGLES&&(i.faces+=n.maxInstancedCount*a/3)}var s,c,h;return{setMode:n,setIndex:r,render:a,renderInstances:o}}function Bt(t,e,i){function n(t){o=t}function r(e,n){t.drawArrays(o,e,n),i.calls++,i.vertices+=n,o===t.TRIANGLES&&(i.faces+=n/3)}function a(n){var r=e.get("ANGLE_instanced_arrays");if(null===r)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var a=n.attributes.position,s=0;a.isInterleavedBufferAttribute?(s=a.data.count,r.drawArraysInstancedANGLE(o,0,s,n.maxInstancedCount)):(s=a.count,r.drawArraysInstancedANGLE(o,0,s,n.maxInstancedCount)),i.calls++,i.vertices+=s*n.maxInstancedCount,o===t.TRIANGLES&&(i.faces+=n.maxInstancedCount*s/3)}var o;return{setMode:n,render:r,renderInstances:a}}function Ft(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new c,color:new W,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":n={position:new c,direction:new c,color:new W,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":n={position:new c,color:new W,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"HemisphereLight":n={direction:new c,skyColor:new W,groundColor:new W};break
104
+ ;case"RectAreaLight":n={color:new W,position:new c,halfWidth:new c,halfHeight:new c}}return t[e.id]=n,n}}}function zt(t){for(var e=t.split("\n"),i=0;i<e.length;i++)e[i]=i+1+": "+e[i];return e.join("\n")}function Gt(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),!1===t.getShaderParameter(n,t.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(n),zt(i)),n}function Ht(t){switch(t){case jo:return["Linear","( value )"];case Wo:return["sRGB","( value )"];case qo:return["RGBE","( value )"];case Yo:return["RGBM","( value, 7.0 )"];case Zo:return["RGBM","( value, 16.0 )"];case Jo:return["RGBD","( value, 256.0 )"];case Xo:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function Vt(t,e){var i=Ht(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function kt(t,e){var i=Ht(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function jt(t,e){var i;switch(e){case ka:i="Linear";break;case ja:i="Reinhard";break;case Wa:i="Uncharted2";break;case Xa:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Wt(t,e,i){return t=t||{},[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Yt).join("\n")}function Xt(t){var e=[];for(var i in t){var n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}function qt(t,e,i){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),a=0;a<r;a++){var o=t.getActiveAttrib(e,a),s=o.name;n[s]=t.getAttribLocation(e,s)}return n}function Yt(t){return""!==t}function Zt(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function Jt(t){function e(t,e){var i=ss[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Jt(i)}var i=/#include +<([\w\d.]+)>/g;return t.replace(i,e)}function Qt(t){function e(t,e,i,n){for(var r="",a=parseInt(e);a<parseInt(i);a++)r+=n.replace(/\[ i \]/g,"[ "+a+" ]");return r}var i=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return t.replace(i,e)}function Kt(t,e,i,n){var r=t.context,a=i.extensions,o=i.defines,s=i.__webglShader.vertexShader,c=i.__webglShader.fragmentShader,h="SHADOWMAP_TYPE_BASIC";n.shadowMapType===$r?h="SHADOWMAP_TYPE_PCF":n.shadowMapType===ta&&(h="SHADOWMAP_TYPE_PCF_SOFT");var l="ENVMAP_TYPE_CUBE",u="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(n.envMap){switch(i.envMap.mapping){case qa:case Ya:l="ENVMAP_TYPE_CUBE";break;case Ka:case $a:l="ENVMAP_TYPE_CUBE_UV";break;case Za:case Ja:l="ENVMAP_TYPE_EQUIREC";break;case Qa:l="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case Ya:case Ja:u="ENVMAP_MODE_REFRACTION"}switch(i.combine){case za:p="ENVMAP_BLENDING_MULTIPLY";break;case Ga:p="ENVMAP_BLENDING_MIX";break;case Ha:p="ENVMAP_BLENDING_ADD"}}var d,f,m=t.gammaFactor>0?t.gammaFactor:1,g=Wt(a,n,t.extensions),v=Xt(o),y=r.createProgram();i.isRawShaderMaterial?(d=[v,"\n"].filter(Yt).join("\n"),f=[g,v,"\n"].filter(Yt).join("\n")):(d=["precision "+n.precision+" float;","precision "+n.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,v,n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+n.numClippingPlanes,n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Yt).join("\n"),f=[g,"precision "+n.precision+" float;","precision "+n.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,v,n.alphaTest?"#define ALPHATEST "+n.alphaTest:"","#define GAMMA_FACTOR "+m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+u:"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+n.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(n.numClippingPlanes-n.numClipIntersection),n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",n.envMap&&t.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",n.toneMapping!==Va?"#define TONE_MAPPING":"",n.toneMapping!==Va?ss.tonemapping_pars_fragment:"",n.toneMapping!==Va?jt("toneMapping",n.toneMapping):"",n.outputEncoding||n.mapEncoding||n.envMapEncoding||n.emissiveMapEncoding?ss.encodings_pars_fragment:"",n.mapEncoding?Vt("mapTexelToLinear",n.mapEncoding):"",n.envMapEncoding?Vt("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Vt("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.outputEncoding?kt("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Yt).join("\n")),s=Jt(s,n),s=Zt(s,n),c=Jt(c,n),c=Zt(c,n),i.isShaderMaterial||(s=Qt(s),c=Qt(c));var x=d+s,_=f+c,b=Gt(r,r.VERTEX_SHADER,x),w=Gt(r,r.FRAGMENT_SHADER,_);r.attachShader(y,b),r.attachShader(y,w),void 0!==i.index0AttributeName?r.bindAttribLocation(y,0,i.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y);var M=r.getProgramInfoLog(y),E=r.getShaderInfoLog(b),T=r.getShaderInfoLog(w),S=!0,A=!0;!1===r.getProgramParameter(y,r.LINK_STATUS)?(S=!1,console.error("THREE.WebGLProgram: shader error: ",r.getError(),"gl.VALIDATE_STATUS",r.getProgramParameter(y,r.VALIDATE_STATUS),"gl.getProgramInfoLog",M,E,T)):""!==M?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",M):""!==E&&""!==T||(A=!1),A&&(this.diagnostics={runnable:S,material:i,programLog:M,vertexShader:{log:E,prefix:d},fragmentShader:{log:T,prefix:f}}),r.deleteShader(b),r.deleteShader(w);var L;this.getUniforms=function(){return void 0===L&&(L=new j(r,y,t)),L};var R;return this.getAttributes=function(){return void 0===R&&(R=qt(r,y)),R},this.destroy=function(){r.deleteProgram(y),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=fs++,this.code=e,this.usedTimes=1,this.program=y,this.vertexShader=b,this.fragmentShader=w,this}function $t(t,e){function i(t){if(e.floatVertexTextures&&t&&t.skeleton&&t.skeleton.useVertexTexture)return 1024;var i=e.maxVertexUniforms,n=Math.floor((i-20)/4),r=n;return void 0!==t&&t&&t.isSkinnedMesh&&(r=Math.min(t.skeleton.bones.length,r))<t.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+t.skeleton.bones.length+", this GPU supports just "+r+" (try OpenGL instead of ANGLE)"),r}function n(t,e){var i;return t?t.isTexture?i=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=t.texture.encoding):i=jo,i===jo&&e&&(i=Xo),i}var r=[],a={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},o=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking"];this.getParameters=function(r,o,s,c,h,l){var u=a[r.type],p=i(l),d=t.getPrecision();null!==r.precision&&(d=e.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",d,"instead.");var f=t.getCurrentRenderTarget();return{shaderID:u,precision:d,supportsVertexTextures:e.vertexTextures,outputEncoding:n(f?f.texture:null,t.gammaOutput),map:!!r.map,mapEncoding:n(r.map,t.gammaInput),envMap:!!r.envMap,envMapMode:r.envMap&&r.envMap.mapping,envMapEncoding:n(r.envMap,t.gammaInput),envMapCubeUV:!!r.envMap&&(r.envMap.mapping===Ka||r.envMap.mapping===$a),lightMap:!!r.lightMap,aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:n(r.emissiveMap,t.gammaInput),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,combine:r.combine,vertexColors:r.vertexColors,fog:!!s,useFog:r.fog,fogExp:s&&s.isFogExp2,flatShading:r.shading===ra,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:r.skinning,maxBones:p,useVertexTexture:e.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numClippingPlanes:c,numClipIntersection:h,shadowMapEnabled:t.shadowMap.enabled&&l.receiveShadow&&o.shadows.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===na,flipSided:r.side===ia,depthPacking:void 0!==r.depthPacking&&r.depthPacking}},this.getProgramCode=function(t,e){var i=[];if(e.shaderID?i.push(e.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)i.push(n),i.push(t.defines[n]);for(var r=0;r<o.length;r++)i.push(e[o[r]]);return i.join()},this.acquireProgram=function(e,i,n){for(var a,o=0,s=r.length;o<s;o++){var c=r[o];if(c.code===n){a=c,++a.usedTimes;break}}return void 0===a&&(a=new Kt(t,n,e,i),r.push(a)),a},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r}function te(t,e,i){function n(t){var r=t.target,s=c[r.id];null!==s.index&&a(s.index),o(s.attributes),r.removeEventListener("dispose",n),delete c[r.id];var h=e.get(r);h.wireframe&&a(h.wireframe),e.delete(r);var l=e.get(s);l.wireframe&&a(l.wireframe),e.delete(s),i.memory.geometries--}function r(t){return t.isInterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function a(e){var i=r(e);void 0!==i&&(t.deleteBuffer(i),s(e))}function o(t){for(var e in t)a(t[e])}function s(t){t.isInterleavedBufferAttribute?e.delete(t.data):e.delete(t)}var c={};return{get:function(t){var e=t.geometry;if(void 0!==c[e.id])return c[e.id];e.addEventListener("dispose",n);var r;return e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new At).setFromObject(t)),r=e._bufferGeometry),c[e.id]=r,i.memory.geometries++,r}}}function ee(t,e,i){function n(e){var i=l.get(e);e.geometry.isGeometry&&i.updateFromObject(e);var n=i.index,a=i.attributes;null!==n&&r(n,t.ELEMENT_ARRAY_BUFFER);for(var o in a)r(a[o],t.ARRAY_BUFFER);var s=i.morphAttributes;for(var o in s)for(var c=s[o],h=0,u=c.length;h<u;h++)r(c[h],t.ARRAY_BUFFER);return i}function r(t,i){var n=t.isInterleavedBufferAttribute?t.data:t,r=e.get(n);void 0===r.__webglBuffer?a(r,n,i):r.version!==n.version&&o(r,n,i)}function a(e,i,n){e.__webglBuffer=t.createBuffer(),t.bindBuffer(n,e.__webglBuffer);var r=i.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW;t.bufferData(n,i.array,r);var a=t.FLOAT,o=i.array;o instanceof Float32Array?a=t.FLOAT:o instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):o instanceof Uint16Array?a=t.UNSIGNED_SHORT:o instanceof Int16Array?a=t.SHORT:o instanceof Uint32Array?a=t.UNSIGNED_INT:o instanceof Int32Array?a=t.INT:o instanceof Int8Array?a=t.BYTE:o instanceof Uint8Array&&(a=t.UNSIGNED_BYTE),e.bytesPerElement=o.BYTES_PER_ELEMENT,e.type=a,e.version=i.version,i.onUploadCallback()}function o(e,i,n){t.bindBuffer(n,e.__webglBuffer),!1===i.dynamic?t.bufferData(n,i.array,t.STATIC_DRAW):-1===i.updateRange.count?t.bufferSubData(n,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(n,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),e.version=i.version}function s(t){return t.isInterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function c(t){return t.isInterleavedBufferAttribute?e.get(t.data):e.get(t)}function h(i){var n=e.get(i);if(void 0!==n.wireframe)return n.wireframe;var a=[],o=i.index,s=i.attributes;if(null!==o)for(var c=o.array,h=0,l=c.length;h<l;h+=3){var u=c[h+0],p=c[h+1],d=c[h+2];a.push(u,p,p,d,d,u)}else for(var c=s.position.array,h=0,l=c.length/3-1;h<l;h+=3){var u=h+0,p=h+1,d=h+2;a.push(u,p,p,d,d,u)}var f=new(Et(a)>65535?_t:yt)(a,1);return r(f,t.ELEMENT_ARRAY_BUFFER),n.wireframe=f,f}var l=new te(t,e,i);return{getAttributeBuffer:s,getAttributeProperties:c,getWireframeAttribute:h,update:n}}function ie(t,e,i,n,r,a,o){function s(t,e){if(t.width>e||t.height>e){var i=e/Math.max(t.width,t.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");n.width=Math.floor(t.width*i),n.height=Math.floor(t.height*i);return n.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+n.width+"x"+n.height,t),n}return t}function c(t){return $o.isPowerOfTwo(t.width)&&$o.isPowerOfTwo(t.height)}function h(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");e.width=$o.nearestPowerOfTwo(t.width),e.height=$o.nearestPowerOfTwo(t.height);return e.getContext("2d").drawImage(t,0,0,e.width,e.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+e.width+"x"+e.height,t),e}return t}function l(t){return t.wrapS!==eo||t.wrapT!==eo||t.minFilter!==no&&t.minFilter!==oo}function u(e){return e===no||e===ro||e===ao?t.NEAREST:t.LINEAR}function p(t){var e=t.target;e.removeEventListener("dispose",p),f(e),A.textures--}function d(t){var e=t.target;e.removeEventListener("dispose",d),m(e),A.textures--}function f(e){var i=n.get(e);if(e.image&&i.__image__webglTextureCube)t.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture)}n.delete(e)}function m(e){var i=n.get(e),r=n.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLRenderTargetCube)for(var a=0;a<6;a++)t.deleteFramebuffer(i.__webglFramebuffer[a]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[a]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer);n.delete(e.texture),n.delete(e)}}function g(e,r){var a=n.get(e);if(e.version>0&&a.__version!==e.version){var o=e.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);else{if(!1!==o.complete)return void _(a,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e)}}i.activeTexture(t.TEXTURE0+r),i.bindTexture(t.TEXTURE_2D,a.__webglTexture)}function v(e,o){var h=n.get(e);if(6===e.image.length)if(e.version>0&&h.__version!==e.version){h.__image__webglTextureCube||(e.addEventListener("dispose",p),h.__image__webglTextureCube=t.createTexture(),A.textures++),i.activeTexture(t.TEXTURE0+o),i.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var l=e&&e.isCompressedTexture,u=e.image[0]&&e.image[0].isDataTexture,d=[],f=0;f<6;f++)d[f]=l||u?u?e.image[f].image:e.image[f]:s(e.image[f],r.maxCubemapSize);var m=d[0],g=c(m),v=a(e.format),y=a(e.type);x(t.TEXTURE_CUBE_MAP,e,g);for(var f=0;f<6;f++)if(l)for(var _,b=d[f].mipmaps,w=0,M=b.length;w<M;w++)_=b[w],e.format!==Eo&&e.format!==Mo?i.getCompressedTextureFormats().indexOf(v)>-1?i.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+f,w,v,_.width,_.height,0,_.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+f,w,v,_.width,_.height,0,v,y,_.data);else u?i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,v,d[f].width,d[f].height,0,v,y,d[f].data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,v,v,y,d[f]);e.generateMipmaps&&g&&t.generateMipmap(t.TEXTURE_CUBE_MAP),h.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(t.TEXTURE0+o),i.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube)}function y(e,r){i.activeTexture(t.TEXTURE0+r),i.bindTexture(t.TEXTURE_CUBE_MAP,n.get(e).__webglTexture)}function x(i,o,s){var c;if(s?(t.texParameteri(i,t.TEXTURE_WRAP_S,a(o.wrapS)),t.texParameteri(i,t.TEXTURE_WRAP_T,a(o.wrapT)),t.texParameteri(i,t.TEXTURE_MAG_FILTER,a(o.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,a(o.minFilter))):(t.texParameteri(i,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(i,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),o.wrapS===eo&&o.wrapT===eo||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),t.texParameteri(i,t.TEXTURE_MAG_FILTER,u(o.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,u(o.minFilter)),o.minFilter!==no&&o.minFilter!==oo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),c=e.get("EXT_texture_filter_anisotropic")){if(o.type===go&&null===e.get("OES_texture_float_linear"))return;if(o.type===vo&&null===e.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(t.texParameterf(i,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function _(e,n,o){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",p),e.__webglTexture=t.createTexture(),A.textures++),i.activeTexture(t.TEXTURE0+o),i.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment);var u=s(n.image,r.maxTextureSize);l(n)&&!1===c(u)&&(u=h(u));var d=c(u),f=a(n.format),m=a(n.type);x(t.TEXTURE_2D,n,d);var g,v=n.mipmaps;if(n.isDepthTexture){var y=t.DEPTH_COMPONENT;if(n.type===go){if(!L)throw new Error("Float Depth Texture only supported in WebGL2.0");y=t.DEPTH_COMPONENT32F}else L&&(y=t.DEPTH_COMPONENT16);n.format===Lo&&y===t.DEPTH_COMPONENT&&n.type!==po&&n.type!==mo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=po,m=a(n.type)),n.format===Ro&&(y=t.DEPTH_STENCIL,n.type!==bo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=bo,m=a(n.type))),i.texImage2D(t.TEXTURE_2D,0,y,u.width,u.height,0,f,m,null)}else if(n.isDataTexture)if(v.length>0&&d){for(var _=0,b=v.length;_<b;_++)g=v[_],i.texImage2D(t.TEXTURE_2D,_,f,g.width,g.height,0,f,m,g.data);n.generateMipmaps=!1}else i.texImage2D(t.TEXTURE_2D,0,f,u.width,u.height,0,f,m,u.data);else if(n.isCompressedTexture)for(var _=0,b=v.length;_<b;_++)g=v[_],n.format!==Eo&&n.format!==Mo?i.getCompressedTextureFormats().indexOf(f)>-1?i.compressedTexImage2D(t.TEXTURE_2D,_,f,g.width,g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(t.TEXTURE_2D,_,f,g.width,g.height,0,f,m,g.data);else if(v.length>0&&d){for(var _=0,b=v.length;_<b;_++)g=v[_],i.texImage2D(t.TEXTURE_2D,_,f,f,m,g);n.generateMipmaps=!1}else i.texImage2D(t.TEXTURE_2D,0,f,f,m,u);n.generateMipmaps&&d&&t.generateMipmap(t.TEXTURE_2D),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function b(e,r,o,s){var c=a(r.texture.format),h=a(r.texture.type);i.texImage2D(s,0,c,r.width,r.height,0,c,h,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,o,s,n.get(r.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function w(e,i){t.bindRenderbuffer(t.RENDERBUFFER,e),i.depthBuffer&&!i.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,i.width,i.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):i.depthBuffer&&i.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,i.width,i.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,i.width,i.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function M(e,i){if(i&&i.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported!");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),g(i.depthTexture,0);var r=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Lo)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,r,0);else{if(i.depthTexture.format!==Ro)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,r,0)}}function E(e){var i=n.get(e),r=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");M(i.__webglFramebuffer,e)}else if(r){i.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer[a]),i.__webglDepthbuffer[a]=t.createRenderbuffer(),w(i.__webglDepthbuffer[a],e)}else t.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),w(i.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}function T(e){var r=n.get(e),a=n.get(e.texture);e.addEventListener("dispose",d),a.__webglTexture=t.createTexture(),A.textures++;var o=!0===e.isWebGLRenderTargetCube,s=c(e);if(o){r.__webglFramebuffer=[];for(var h=0;h<6;h++)r.__webglFramebuffer[h]=t.createFramebuffer()}else r.__webglFramebuffer=t.createFramebuffer();if(o){i.bindTexture(t.TEXTURE_CUBE_MAP,a.__webglTexture),x(t.TEXTURE_CUBE_MAP,e.texture,s);for(var h=0;h<6;h++)b(r.__webglFramebuffer[h],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+h);e.texture.generateMipmaps&&s&&t.generateMipmap(t.TEXTURE_CUBE_MAP),i.bindTexture(t.TEXTURE_CUBE_MAP,null)}else i.bindTexture(t.TEXTURE_2D,a.__webglTexture),x(t.TEXTURE_2D,e.texture,s),b(r.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),e.texture.generateMipmaps&&s&&t.generateMipmap(t.TEXTURE_2D),i.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&E(e)}function S(e){var r=e.texture;if(r.generateMipmaps&&c(e)&&r.minFilter!==no&&r.minFilter!==oo){var a=e&&e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,o=n.get(r).__webglTexture;i.bindTexture(a,o),t.generateMipmap(a),i.bindTexture(a,null)}}var A=o.memory,L="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext;this.setTexture2D=g,this.setTextureCube=v,this.setTextureCubeDynamic=y,this.setupRenderTarget=T,this.updateRenderTargetMipmap=S}function ne(){var t={};return{get:function(e){var i=e.uuid,n=t[i];return void 0===n&&(n={},t[i]=n),n},delete:function(e){delete t[e.uuid]},clear:function(){t={}}}}function re(t,e,i){function n(){var e=!1,i=new r,n=null,a=new r;return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,r,o,s){!0===s&&(e*=o,n*=o,r*=o),i.set(e,n,r,o),!1===a.equals(i)&&(t.clearColor(e,n,r,o),a.copy(i))},reset:function(){e=!1,n=null,a.set(0,0,0,1)}}}function a(){var e=!1,i=null,n=null,r=null;return{setTest:function(e){e?d(t.DEPTH_TEST):f(t.DEPTH_TEST)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case Ca:t.depthFunc(t.NEVER);break;case Ia:t.depthFunc(t.ALWAYS);break;case Ua:t.depthFunc(t.LESS);break;case Na:t.depthFunc(t.LEQUAL);break;case Da:t.depthFunc(t.EQUAL);break;case Oa:t.depthFunc(t.GEQUAL);break;case Ba:t.depthFunc(t.GREATER);break;case Fa:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}}function o(){var e=!1,i=null,n=null,r=null,a=null,o=null,s=null,c=null,h=null;return{setTest:function(e){e?d(t.STENCIL_TEST):f(t.STENCIL_TEST)},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,o){n===e&&r===i&&a===o||(t.stencilFunc(e,i,o),n=e,r=i,a=o)},setOp:function(e,i,n){o===e&&s===i&&c===n||(t.stencilOp(e,i,n),o=e,s=i,c=n)},setLocked:function(t){e=t},setClear:function(e){h!==e&&(t.clearStencil(e),h=e)},reset:function(){e=!1,i=null,n=null,r=null,a=null,o=null,s=null,c=null,h=null}}}function s(e,i,n){var r=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var o=0;o<n;o++)t.texImage2D(i+o,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);return a}function c(){F.setClear(0,0,0,1),z.setClear(1),G.setClear(0),d(t.DEPTH_TEST),_(Na),T(!1),S(Jr),d(t.CULL_FACE),d(t.BLEND),g(la)}function h(){for(var t=0,e=V.length;t<e;t++)V[t]=0}function l(i){if(V[i]=1,0===k[i]&&(t.enableVertexAttribArray(i),k[i]=1),0!==j[i]){e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(i,0),j[i]=0}}function u(e,i,n){V[e]=1,0===k[e]&&(t.enableVertexAttribArray(e),k[e]=1),j[e]!==i&&(n.vertexAttribDivisorANGLE(e,i),j[e]=i)}function p(){for(var e=0,i=k.length;e!==i;++e)k[e]!==V[e]&&(t.disableVertexAttribArray(e),k[e]=0)}function d(e){!0!==W[e]&&(t.enable(e),W[e]=!0)}function f(e){!1!==W[e]&&(t.disable(e),W[e]=!1)}function m(){if(null===X&&(X=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var i=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),n=0;n<i.length;n++)X.push(i[n]);return X}function g(e,n,r,a,o,s,c,h){e!==ha?d(t.BLEND):f(t.BLEND),e===q&&h===tt||(e===ua?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)):e===pa?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR)):e===da?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR)):h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)),q=e,tt=h),e===fa?(o=o||n,s=s||r,c=c||a,n===Y&&o===Q||(t.blendEquationSeparate(i(n),i(o)),Y=n,Q=o),r===Z&&a===J&&s===K&&c===$||(t.blendFuncSeparate(i(r),i(a),i(s),i(c)),Z=r,J=a,K=s,$=c)):(Y=null,Z=null,J=null,Q=null,K=null,$=null)}function v(t){F.setMask(t)}function y(t){z.setTest(t)}function x(t){z.setMask(t)}function _(t){z.setFunc(t)}function b(t){G.setTest(t)}function w(t){G.setMask(t)}function M(t,e,i){G.setFunc(t,e,i)}function E(t,e,i){G.setOp(t,e,i)}function T(e){et!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),et=e)}function S(e){
105
+ e!==Zr?(d(t.CULL_FACE),e!==it&&(e===Jr?t.cullFace(t.BACK):e===Qr?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):f(t.CULL_FACE),it=e}function A(e){e!==nt&&(ht&&t.lineWidth(e),nt=e)}function L(e,i,n){e?(d(t.POLYGON_OFFSET_FILL),rt===i&&at===n||(t.polygonOffset(i,n),rt=i,at=n)):f(t.POLYGON_OFFSET_FILL)}function R(){return ot}function P(e){ot=e,e?d(t.SCISSOR_TEST):f(t.SCISSOR_TEST)}function C(e){void 0===e&&(e=t.TEXTURE0+st-1),lt!==e&&(t.activeTexture(e),lt=e)}function I(e,i){null===lt&&C();var n=ut[lt];void 0===n&&(n={type:void 0,texture:void 0},ut[lt]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||ft[e]),n.type=e,n.texture=i)}function U(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error(t)}}function N(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error(t)}}function D(e){!1===pt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),pt.copy(e))}function O(e){!1===dt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),dt.copy(e))}function B(){for(var e=0;e<k.length;e++)1===k[e]&&(t.disableVertexAttribArray(e),k[e]=0);W={},X=null,lt=null,ut={},q=null,et=null,it=null,F.reset(),z.reset(),G.reset()}var F=new n,z=new a,G=new o,H=t.getParameter(t.MAX_VERTEX_ATTRIBS),V=new Uint8Array(H),k=new Uint8Array(H),j=new Uint8Array(H),W={},X=null,q=null,Y=null,Z=null,J=null,Q=null,K=null,$=null,tt=!1,et=null,it=null,nt=null,rt=null,at=null,ot=null,st=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),ct=parseFloat(/^WebGL\ ([0-9])/.exec(t.getParameter(t.VERSION))[1]),ht=parseFloat(ct)>=1,lt=null,ut={},pt=new r,dt=new r,ft={};return ft[t.TEXTURE_2D]=s(t.TEXTURE_2D,t.TEXTURE_2D,1),ft[t.TEXTURE_CUBE_MAP]=s(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:F,depth:z,stencil:G},init:c,initAttributes:h,enableAttribute:l,enableAttributeAndDivisor:u,disableUnusedAttributes:p,enable:d,disable:f,getCompressedTextureFormats:m,setBlending:g,setColorWrite:v,setDepthTest:y,setDepthWrite:x,setDepthFunc:_,setStencilTest:b,setStencilWrite:w,setStencilFunc:M,setStencilOp:E,setFlipSided:T,setCullFace:S,setLineWidth:A,setPolygonOffset:L,getScissorTest:R,setScissorTest:P,activeTexture:C,bindTexture:I,compressedTexImage2D:U,texImage2D:N,scissor:D,viewport:O,reset:B}}function ae(t,e,i){function n(){if(void 0!==a)return a;var i=e.get("EXT_texture_filter_anisotropic");return a=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a,o=void 0!==i.precision?i.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===i.logarithmicDepthBuffer&&!!e.get("EXT_frag_depth"),h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=l>0,y=!!e.get("OES_texture_float");return{getMaxAnisotropy:n,getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y}}function oe(t){var e={};return{get:function(i){if(void 0!==e[i])return e[i];var n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":n=t.getExtension("WEBGL_compressed_texture_etc1");break;default:n=t.getExtension(i)}return null===n&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),e[i]=n,n}}}function se(){function t(){h.value!==n&&(h.value=n,h.needsUpdate=r>0),i.numPlanes=r,i.numIntersection=0}function e(t,e,n,r){var a=null!==t?t.length:0,o=null;if(0!==a){if(o=h.value,!0!==r||null===o){var l=n+4*a,u=e.matrixWorldInverse;c.getNormalMatrix(u),(null===o||o.length<l)&&(o=new Float32Array(l));for(var p=0,d=n;p!==a;++p,d+=4)s.copy(t[p]).applyMatrix4(u,c),s.normal.toArray(o,d),o[d+3]=s.constant}h.value=o,h.needsUpdate=!0}return i.numPlanes=a,o}var i=this,n=null,r=0,a=!1,o=!1,s=new it,c=new et,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(t,i,o){var s=0!==t.length||i||0!==r||a;return a=i,n=e(t,o,0),r=t.length,s},this.beginShadows=function(){o=!0,e(null)},this.endShadows=function(){o=!1,t()},this.setState=function(i,s,c,l,u,p){if(!a||null===i||0===i.length||o&&!c)o?e(null):t();else{var d=o?0:r,f=4*d,m=u.clippingState||null;h.value=m,m=e(i,l,f,p);for(var g=0;g!==f;++g)m[g]=n[g];u.clippingState=m,this.numIntersection=s?this.numPlanes:0,this.numPlanes+=d}}}function ce(t){function e(){return null===dt?St:1}function i(){ce.init(),ce.scissor(yt.copy(Rt).multiplyScalar(St)),ce.viewport(_t.copy(Ut).multiplyScalar(St)),ce.buffers.color.setClear(wt.r,wt.g,wt.b,Mt,J)}function n(){ut=null,vt=null,gt="",mt=-1,ce.reset()}function a(t){t.preventDefault(),n(),i(),he.clear()}function o(t){var e=t.target;e.removeEventListener("dispose",o),s(e)}function s(t){l(t),he.delete(t)}function l(t){var e=he.get(t).program;t.program=void 0,void 0!==e&&pe.releaseProgram(e)}function u(t,e,i,n){var r;if(i&&i.isInstancedBufferGeometry&&null===(r=Kt.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===n&&(n=0),ce.initAttributes();var a=i.attributes,o=e.getAttributes(),s=t.defaultAttributeValues;for(var c in o){var h=o[c];if(h>=0){var l=a[c];if(void 0!==l){var u=l.normalized,p=l.itemSize,d=ue.getAttributeProperties(l),f=d.__webglBuffer,m=d.type,g=d.bytesPerElement;if(l.isInterleavedBufferAttribute){var v=l.data,y=v.stride,x=l.offset;v&&v.isInstancedInterleavedBuffer?(ce.enableAttributeAndDivisor(h,v.meshPerAttribute,r),void 0===i.maxInstancedCount&&(i.maxInstancedCount=v.meshPerAttribute*v.count)):ce.enableAttribute(h),Jt.bindBuffer(Jt.ARRAY_BUFFER,f),Jt.vertexAttribPointer(h,p,m,u,y*g,(n*y+x)*g)}else l.isInstancedBufferAttribute?(ce.enableAttributeAndDivisor(h,l.meshPerAttribute,r),void 0===i.maxInstancedCount&&(i.maxInstancedCount=l.meshPerAttribute*l.count)):ce.enableAttribute(h),Jt.bindBuffer(Jt.ARRAY_BUFFER,f),Jt.vertexAttribPointer(h,p,m,u,0,n*p*g)}else if(void 0!==s){var _=s[c];if(void 0!==_)switch(_.length){case 2:Jt.vertexAttrib2fv(h,_);break;case 3:Jt.vertexAttrib3fv(h,_);break;case 4:Jt.vertexAttrib4fv(h,_);break;default:Jt.vertexAttrib1fv(h,_)}}}}ce.disableUnusedAttributes()}function p(t,e){return Math.abs(e[0])-Math.abs(t[0])}function d(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.program&&e.material.program&&t.material.program!==e.material.program?t.material.program.id-e.material.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function f(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function m(t,e,i,n,r){var a,o;i.transparent?(a=at,o=++ot):(a=et,o=++it);var s=a[o];void 0!==s?(s.id=t.id,s.object=t,s.geometry=e,s.material=i,s.z=Wt.z,s.group=r):(s={id:t.id,object:t,geometry:e,material:i,z:Wt.z,group:r},a.push(s))}function g(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),kt.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),y(kt)}function v(t){return kt.center.set(0,0,0),kt.radius=.7071067811865476,kt.applyMatrix4(t.matrixWorld),y(kt)}function y(t){if(!zt.intersectsSphere(t))return!1;var e=Gt.numPlanes;if(0===e)return!0;var i=lt.clippingPlanes,n=t.center,r=-t.radius,a=0;do{if(i[a].distanceToPoint(n)<r)return!1}while(++a!==e);return!0}function x(t,e){if(!1!==t.visible){if(0!=(t.layers.mask&e.layers.mask))if(t.isLight)$.push(t);else if(t.isSprite)!1!==t.frustumCulled&&!0!==v(t)||ct.push(t);else if(t.isLensFlare)ht.push(t);else if(t.isImmediateRenderObject)!0===lt.sortObjects&&(Wt.setFromMatrixPosition(t.matrixWorld),Wt.applyMatrix4(jt)),m(t,null,t.material,Wt.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!1===t.frustumCulled||!0===g(t))){var i=t.material;if(!0===i.visible){!0===lt.sortObjects&&(Wt.setFromMatrixPosition(t.matrixWorld),Wt.applyMatrix4(jt));var n=ue.update(t);if(i.isMultiMaterial)for(var r=n.groups,a=i.materials,o=0,s=r.length;o<s;o++){var c=r[o],h=a[c.materialIndex];!0===h.visible&&m(t,n,h,Wt.z,c)}else m(t,n,i,Wt.z,null)}}for(var l=t.children,o=0,s=l.length;o<s;o++)x(l[o],e)}}function _(t,e,i,n){for(var r=0,a=t.length;r<a;r++){var o=t[r],s=o.object,c=o.geometry,h=void 0===n?o.material:n,l=o.group;if(s.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,s.matrixWorld),s.normalMatrix.getNormalMatrix(s.modelViewMatrix),s.onBeforeRender(lt,e,i,c,h,l),s.isImmediateRenderObject){w(h);var u=M(i,e.fog,h,s);gt="",s.render(function(t){lt.renderBufferImmediate(t,u,h)})}else lt.renderBufferDirect(i,e.fog,c,h,s,l);s.onAfterRender(lt,e,i,c,h,l)}}function b(t,e,i){var n=he.get(t),r=pe.getParameters(t,Yt,e,Gt.numPlanes,Gt.numIntersection,i),a=pe.getProgramCode(t,r),s=n.program,c=!0;if(void 0===s)t.addEventListener("dispose",o);else if(s.code!==a)l(t);else{if(void 0!==r.shaderID)return;c=!1}if(c){if(r.shaderID){var h=ls[r.shaderID];n.__webglShader={name:t.type,uniforms:os.clone(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}else n.__webglShader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.__webglShader=n.__webglShader,s=pe.acquireProgram(t,r,a),n.program=s,t.program=s}var u=s.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var p=0;p<lt.maxMorphTargets;p++)u["morphTarget"+p]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(var p=0;p<lt.maxMorphNormals;p++)u["morphNormal"+p]>=0&&t.numSupportedMorphNormals++}var d=n.__webglShader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=Gt.numPlanes,n.numIntersection=Gt.numIntersection,d.clippingPlanes=Gt.uniform),n.fog=e,n.lightsHash=Yt.hash,t.lights&&(d.ambientLightColor.value=Yt.ambient,d.directionalLights.value=Yt.directional,d.spotLights.value=Yt.spot,d.rectAreaLights.value=Yt.rectArea,d.pointLights.value=Yt.point,d.hemisphereLights.value=Yt.hemi,d.directionalShadowMap.value=Yt.directionalShadowMap,d.directionalShadowMatrix.value=Yt.directionalShadowMatrix,d.spotShadowMap.value=Yt.spotShadowMap,d.spotShadowMatrix.value=Yt.spotShadowMatrix,d.pointShadowMap.value=Yt.pointShadowMap,d.pointShadowMatrix.value=Yt.pointShadowMatrix);var f=n.program.getUniforms(),m=j.seqWithValue(f.seq,d);n.uniformsList=m}function w(t){t.side===na?ce.disable(Jt.CULL_FACE):ce.enable(Jt.CULL_FACE),ce.setFlipSided(t.side===ia),!0===t.transparent?ce.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):ce.setBlending(ha),ce.setDepthFunc(t.depthFunc),ce.setDepthTest(t.depthTest),ce.setDepthWrite(t.depthWrite),ce.setColorWrite(t.colorWrite),ce.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function M(t,e,i,n){bt=0;var r=he.get(i);if(Ht&&(Vt||t!==vt)){var a=t===vt&&i.id===mt;Gt.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,r,a)}!1===i.needsUpdate&&(void 0===r.program?i.needsUpdate=!0:i.fog&&r.fog!==e?i.needsUpdate=!0:i.lights&&r.lightsHash!==Yt.hash?i.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===Gt.numPlanes&&r.numIntersection===Gt.numIntersection||(i.needsUpdate=!0)),i.needsUpdate&&(b(i,e,n),i.needsUpdate=!1);var o=!1,s=!1,c=!1,h=r.program,l=h.getUniforms(),u=r.__webglShader.uniforms;if(h.id!==ut&&(Jt.useProgram(h.program),ut=h.id,o=!0,s=!0,c=!0),i.id!==mt&&(mt=i.id,s=!0),o||t!==vt){if(l.set(Jt,t,"projectionMatrix"),te.logarithmicDepthBuffer&&l.setValue(Jt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),t!==vt&&(vt=t,s=!0,c=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var p=l.map.cameraPosition;void 0!==p&&p.setValue(Jt,Wt.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&l.setValue(Jt,"viewMatrix",t.matrixWorldInverse),l.set(Jt,lt,"toneMappingExposure"),l.set(Jt,lt,"toneMappingWhitePoint")}if(i.skinning){l.setOptional(Jt,n,"bindMatrix"),l.setOptional(Jt,n,"bindMatrixInverse");var d=n.skeleton;d&&(te.floatVertexTextures&&d.useVertexTexture?(l.set(Jt,d,"boneTexture"),l.set(Jt,d,"boneTextureWidth"),l.set(Jt,d,"boneTextureHeight")):l.setOptional(Jt,d,"boneMatrices"))}return s&&(i.lights&&D(u,c),e&&i.fog&&L(u,e),(i.isMeshBasicMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshNormalMaterial||i.isMeshDepthMaterial)&&E(u,i),i.isLineBasicMaterial?T(u,i):i.isLineDashedMaterial?(T(u,i),S(u,i)):i.isPointsMaterial?A(u,i):i.isMeshLambertMaterial?R(u,i):i.isMeshToonMaterial?C(u,i):i.isMeshPhongMaterial?P(u,i):i.isMeshPhysicalMaterial?U(u,i):i.isMeshStandardMaterial?I(u,i):i.isMeshDepthMaterial?i.displacementMap&&(u.displacementMap.value=i.displacementMap,u.displacementScale.value=i.displacementScale,u.displacementBias.value=i.displacementBias):i.isMeshNormalMaterial&&N(u,i),void 0!==u.ltcMat&&(u.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),void 0!==u.ltcMag&&(u.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),j.upload(Jt,r.uniformsList,u,lt)),l.set(Jt,n,"modelViewMatrix"),l.set(Jt,n,"normalMatrix"),l.setValue(Jt,"modelMatrix",n.matrixWorld),h}function E(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),t.map.value=e.map,t.specularMap.value=e.specularMap,t.alphaMap.value=e.alphaMap,e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var i;if(e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i){i.isWebGLRenderTarget&&(i=i.texture);var n=i.offset,r=i.repeat;t.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio}function T(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function S(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function A(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*St,t.scale.value=.5*Tt,t.map.value=e.map,null!==e.map){var i=e.map.offset,n=e.map.repeat;t.offsetRepeat.value.set(i.x,i.y,n.x,n.y)}}function L(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function R(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function P(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function C(t,e){P(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}function I(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function U(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,I(t,e)}function N(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function D(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function O(t){for(var e=0,i=0,n=t.length;i<n;i++){var r=t[i];r.castShadow&&(Yt.shadows[e++]=r)}Yt.shadows.length=e}function B(t,e){var i,n,r,a,o,s,c,l=0,u=0,p=0,d=e.matrixWorldInverse,f=0,m=0,g=0,v=0,y=0;for(i=0,n=t.length;i<n;i++)if(r=t[i],a=r.color,o=r.intensity,s=r.distance,c=r.shadow&&r.shadow.map?r.shadow.map.texture:null,r.isAmbientLight)l+=a.r*o,u+=a.g*o,p+=a.b*o;else if(r.isDirectionalLight){var x=de.get(r);x.color.copy(r.color).multiplyScalar(r.intensity),x.direction.setFromMatrixPosition(r.matrixWorld),Wt.setFromMatrixPosition(r.target.matrixWorld),x.direction.sub(Wt),x.direction.transformDirection(d),x.shadow=r.castShadow,r.castShadow&&(x.shadowBias=r.shadow.bias,x.shadowRadius=r.shadow.radius,x.shadowMapSize=r.shadow.mapSize),Yt.directionalShadowMap[f]=c,Yt.directionalShadowMatrix[f]=r.shadow.matrix,Yt.directional[f++]=x}else if(r.isSpotLight){var x=de.get(r);x.position.setFromMatrixPosition(r.matrixWorld),x.position.applyMatrix4(d),x.color.copy(a).multiplyScalar(o),x.distance=s,x.direction.setFromMatrixPosition(r.matrixWorld),Wt.setFromMatrixPosition(r.target.matrixWorld),x.direction.sub(Wt),x.direction.transformDirection(d),x.coneCos=Math.cos(r.angle),x.penumbraCos=Math.cos(r.angle*(1-r.penumbra)),x.decay=0===r.distance?0:r.decay,x.shadow=r.castShadow,r.castShadow&&(x.shadowBias=r.shadow.bias,x.shadowRadius=r.shadow.radius,x.shadowMapSize=r.shadow.mapSize),Yt.spotShadowMap[g]=c,Yt.spotShadowMatrix[g]=r.shadow.matrix,Yt.spot[g++]=x}else if(r.isRectAreaLight){var x=de.get(r);x.color.copy(a).multiplyScalar(o/(r.width*r.height)),x.position.setFromMatrixPosition(r.matrixWorld),x.position.applyMatrix4(d),qt.identity(),Xt.copy(r.matrixWorld),Xt.premultiply(d),qt.extractRotation(Xt),x.halfWidth.set(.5*r.width,0,0),x.halfHeight.set(0,.5*r.height,0),x.halfWidth.applyMatrix4(qt),x.halfHeight.applyMatrix4(qt),Yt.rectArea[v++]=x}else if(r.isPointLight){var x=de.get(r);x.position.setFromMatrixPosition(r.matrixWorld),x.position.applyMatrix4(d),x.color.copy(r.color).multiplyScalar(r.intensity),x.distance=r.distance,x.decay=0===r.distance?0:r.decay,x.shadow=r.castShadow,r.castShadow&&(x.shadowBias=r.shadow.bias,x.shadowRadius=r.shadow.radius,x.shadowMapSize=r.shadow.mapSize),Yt.pointShadowMap[m]=c,void 0===Yt.pointShadowMatrix[m]&&(Yt.pointShadowMatrix[m]=new h),Wt.setFromMatrixPosition(r.matrixWorld).negate(),Yt.pointShadowMatrix[m].identity().setPosition(Wt),Yt.point[m++]=x}else if(r.isHemisphereLight){var x=de.get(r);x.direction.setFromMatrixPosition(r.matrixWorld),x.direction.transformDirection(d),x.direction.normalize(),x.skyColor.copy(r.color).multiplyScalar(o),x.groundColor.copy(r.groundColor).multiplyScalar(o),Yt.hemi[y++]=x}Yt.ambient[0]=l,Yt.ambient[1]=u,Yt.ambient[2]=p,Yt.directional.length=f,Yt.spot.length=g,Yt.rectArea.length=v,Yt.point.length=m,Yt.hemi.length=y,Yt.hash=f+","+m+","+g+","+v+","+y+","+Yt.shadows.length}function F(){var t=bt;return t>=te.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+te.maxTextures),bt+=1,t}function z(t){var e;if(t===to)return Jt.REPEAT;if(t===eo)return Jt.CLAMP_TO_EDGE;if(t===io)return Jt.MIRRORED_REPEAT;if(t===no)return Jt.NEAREST;if(t===ro)return Jt.NEAREST_MIPMAP_NEAREST;if(t===ao)return Jt.NEAREST_MIPMAP_LINEAR;if(t===oo)return Jt.LINEAR;if(t===so)return Jt.LINEAR_MIPMAP_NEAREST;if(t===co)return Jt.LINEAR_MIPMAP_LINEAR;if(t===ho)return Jt.UNSIGNED_BYTE;if(t===yo)return Jt.UNSIGNED_SHORT_4_4_4_4;if(t===xo)return Jt.UNSIGNED_SHORT_5_5_5_1;if(t===_o)return Jt.UNSIGNED_SHORT_5_6_5;if(t===lo)return Jt.BYTE;if(t===uo)return Jt.SHORT;if(t===po)return Jt.UNSIGNED_SHORT;if(t===fo)return Jt.INT;if(t===mo)return Jt.UNSIGNED_INT;if(t===go)return Jt.FLOAT;if(t===vo&&null!==(e=Kt.get("OES_texture_half_float")))return e.HALF_FLOAT_OES;if(t===wo)return Jt.ALPHA;if(t===Mo)return Jt.RGB;if(t===Eo)return Jt.RGBA;if(t===To)return Jt.LUMINANCE;if(t===So)return Jt.LUMINANCE_ALPHA;if(t===Lo)return Jt.DEPTH_COMPONENT;if(t===Ro)return Jt.DEPTH_STENCIL;if(t===ma)return Jt.FUNC_ADD;if(t===ga)return Jt.FUNC_SUBTRACT;if(t===va)return Jt.FUNC_REVERSE_SUBTRACT;if(t===_a)return Jt.ZERO;if(t===ba)return Jt.ONE;if(t===wa)return Jt.SRC_COLOR;if(t===Ma)return Jt.ONE_MINUS_SRC_COLOR;if(t===Ea)return Jt.SRC_ALPHA;if(t===Ta)return Jt.ONE_MINUS_SRC_ALPHA;if(t===Sa)return Jt.DST_ALPHA;if(t===Aa)return Jt.ONE_MINUS_DST_ALPHA;if(t===La)return Jt.DST_COLOR;if(t===Ra)return Jt.ONE_MINUS_DST_COLOR;if(t===Pa)return Jt.SRC_ALPHA_SATURATE;if((t===Po||t===Co||t===Io||t===Uo)&&null!==(e=Kt.get("WEBGL_compressed_texture_s3tc"))){if(t===Po)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Co)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Io)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Uo)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===No||t===Do||t===Oo||t===Bo)&&null!==(e=Kt.get("WEBGL_compressed_texture_pvrtc"))){if(t===No)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===Do)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Oo)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Bo)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===Fo&&null!==(e=Kt.get("WEBGL_compressed_texture_etc1")))return e.COMPRESSED_RGB_ETC1_WEBGL;if((t===ya||t===xa)&&null!==(e=Kt.get("EXT_blend_minmax"))){if(t===ya)return e.MIN_EXT;if(t===xa)return e.MAX_EXT}return t===bo&&null!==(e=Kt.get("WEBGL_depth_texture"))?e.UNSIGNED_INT_24_8_WEBGL:0}console.log("THREE.WebGLRenderer",qr),t=t||{};var G=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),H=void 0!==t.context?t.context:null,V=void 0!==t.alpha&&t.alpha,k=void 0===t.depth||t.depth,X=void 0===t.stencil||t.stencil,q=void 0!==t.antialias&&t.antialias,J=void 0===t.premultipliedAlpha||t.premultipliedAlpha,K=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,$=[],et=[],it=-1,at=[],ot=-1,st=new Float32Array(8),ct=[],ht=[];this.domElement=G,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=ka,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var lt=this,ut=null,dt=null,ft=null,mt=-1,gt="",vt=null,yt=new r,xt=null,_t=new r,bt=0,wt=new W(0),Mt=0,Et=G.width,Tt=G.height,St=1,Rt=new r(0,0,Et,Tt),Ct=!1,Ut=new r(0,0,Et,Tt),zt=new nt,Gt=new se,Ht=!1,Vt=!1,kt=new tt,jt=new h,Wt=new c,Xt=new h,qt=new h,Yt={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},Zt={calls:0,vertices:0,faces:0,points:0};this.info={render:Zt,memory:{geometries:0,textures:0},programs:null};var Jt;try{var Qt={alpha:V,depth:k,stencil:X,antialias:q,premultipliedAlpha:J,preserveDrawingBuffer:K};if(null===(Jt=H||G.getContext("webgl",Qt)||G.getContext("experimental-webgl",Qt)))throw null!==G.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===Jt.getShaderPrecisionFormat&&(Jt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),G.addEventListener("webglcontextlost",a,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var Kt=new oe(Jt);Kt.get("WEBGL_depth_texture"),Kt.get("OES_texture_float"),Kt.get("OES_texture_float_linear"),Kt.get("OES_texture_half_float"),Kt.get("OES_texture_half_float_linear"),Kt.get("OES_standard_derivatives"),Kt.get("ANGLE_instanced_arrays"),Kt.get("OES_element_index_uint")&&(At.MaxIndex=4294967296);var te=new ae(Jt,Kt,t),ce=new re(Jt,Kt,z),he=new ne,le=new ie(Jt,Kt,ce,he,te,z,this.info),ue=new ee(Jt,he,this.info),pe=new $t(this,te),de=new Ft;this.info.programs=pe.programs;var fe,me,ge,ve,ye=new Bt(Jt,Kt,Zt),xe=new Ot(Jt,Kt,Zt);i(),this.context=Jt,this.capabilities=te,this.extensions=Kt,this.properties=he,this.state=ce;var _e=new rt(this,Yt,ue,te);this.shadowMap=_e;var be=new Z(this,ct),we=new Y(this,ht);this.getContext=function(){return Jt},this.getContextAttributes=function(){return Jt.getContextAttributes()},this.forceContextLoss=function(){Kt.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){return te.getMaxAnisotropy()},this.getPrecision=function(){return te.precision},this.getPixelRatio=function(){return St},this.setPixelRatio=function(t){void 0!==t&&(St=t,this.setSize(Ut.z,Ut.w,!1))},this.getSize=function(){return{width:Et,height:Tt}},this.setSize=function(t,e,i){Et=t,Tt=e,G.width=t*St,G.height=e*St,!1!==i&&(G.style.width=t+"px",G.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,i,n){ce.viewport(Ut.set(t,e,i,n))},this.setScissor=function(t,e,i,n){ce.scissor(Rt.set(t,e,i,n))},this.setScissorTest=function(t){ce.setScissorTest(Ct=t)},this.getClearColor=function(){return wt},this.setClearColor=function(t,e){wt.set(t),Mt=void 0!==e?e:1,ce.buffers.color.setClear(wt.r,wt.g,wt.b,Mt,J)},this.getClearAlpha=function(){return Mt},this.setClearAlpha=function(t){Mt=t,ce.buffers.color.setClear(wt.r,wt.g,wt.b,Mt,J)},this.clear=function(t,e,i){var n=0;(void 0===t||t)&&(n|=Jt.COLOR_BUFFER_BIT),(void 0===e||e)&&(n|=Jt.DEPTH_BUFFER_BIT),(void 0===i||i)&&(n|=Jt.STENCIL_BUFFER_BIT),Jt.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,i,n){this.setRenderTarget(t),this.clear(e,i,n)},this.resetGLState=n,this.dispose=function(){at=[],ot=-1,et=[],it=-1,G.removeEventListener("webglcontextlost",a,!1)},this.renderBufferImmediate=function(t,e,i){ce.initAttributes();var n=he.get(t);t.hasPositions&&!n.position&&(n.position=Jt.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=Jt.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=Jt.createBuffer()),t.hasColors&&!n.color&&(n.color=Jt.createBuffer());var r=e.getAttributes();if(t.hasPositions&&(Jt.bindBuffer(Jt.ARRAY_BUFFER,n.position),Jt.bufferData(Jt.ARRAY_BUFFER,t.positionArray,Jt.DYNAMIC_DRAW),ce.enableAttribute(r.position),Jt.vertexAttribPointer(r.position,3,Jt.FLOAT,!1,0,0)),t.hasNormals){if(Jt.bindBuffer(Jt.ARRAY_BUFFER,n.normal),!i.isMeshPhongMaterial&&!i.isMeshStandardMaterial&&!i.isMeshNormalMaterial&&i.shading===ra)for(var a=0,o=3*t.count;a<o;a+=9){var s=t.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,h=(s[a+1]+s[a+4]+s[a+7])/3,l=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=h,s[a+2]=l,s[a+3]=c,s[a+4]=h,s[a+5]=l,s[a+6]=c,s[a+7]=h,s[a+8]=l}Jt.bufferData(Jt.ARRAY_BUFFER,t.normalArray,Jt.DYNAMIC_DRAW),ce.enableAttribute(r.normal),Jt.vertexAttribPointer(r.normal,3,Jt.FLOAT,!1,0,0)}t.hasUvs&&i.map&&(Jt.bindBuffer(Jt.ARRAY_BUFFER,n.uv),Jt.bufferData(Jt.ARRAY_BUFFER,t.uvArray,Jt.DYNAMIC_DRAW),ce.enableAttribute(r.uv),Jt.vertexAttribPointer(r.uv,2,Jt.FLOAT,!1,0,0)),t.hasColors&&i.vertexColors!==oa&&(Jt.bindBuffer(Jt.ARRAY_BUFFER,n.color),Jt.bufferData(Jt.ARRAY_BUFFER,t.colorArray,Jt.DYNAMIC_DRAW),ce.enableAttribute(r.color),Jt.vertexAttribPointer(r.color,3,Jt.FLOAT,!1,0,0)),ce.disableUnusedAttributes(),Jt.drawArrays(Jt.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,i,n,r,a,o){w(r);var s=M(t,i,r,a),c=!1,h=n.id+"_"+s.id+"_"+r.wireframe;h!==gt&&(gt=h,c=!0);var l=a.morphTargetInfluences;if(void 0!==l){for(var d=[],f=0,m=l.length;f<m;f++){var g=l[f];d.push([g,f])}d.sort(p),d.length>8&&(d.length=8);for(var v=n.morphAttributes,f=0,m=d.length;f<m;f++){var g=d[f];if(st[f]=g[0],0!==g[0]){var y=g[1];!0===r.morphTargets&&v.position&&n.addAttribute("morphTarget"+f,v.position[y]),!0===r.morphNormals&&v.normal&&n.addAttribute("morphNormal"+f,v.normal[y])}else!0===r.morphTargets&&n.removeAttribute("morphTarget"+f),!0===r.morphNormals&&n.removeAttribute("morphNormal"+f)}for(var f=d.length,x=st.length;f<x;f++)st[f]=0;s.getUniforms().setValue(Jt,"morphTargetInfluences",st),c=!0}var y=n.index,_=n.attributes.position,b=1;!0===r.wireframe&&(y=ue.getWireframeAttribute(n),b=2);var E;null!==y?(E=xe,E.setIndex(y)):E=ye,c&&(u(r,s,n),null!==y&&Jt.bindBuffer(Jt.ELEMENT_ARRAY_BUFFER,ue.getAttributeBuffer(y)));var T=0;null!==y?T=y.count:void 0!==_&&(T=_.count);var S=n.drawRange.start*b,A=n.drawRange.count*b,L=null!==o?o.start*b:0,R=null!==o?o.count*b:1/0,P=Math.max(S,L),C=Math.min(T,S+A,L+R)-1,I=Math.max(0,C-P+1);if(0!==I){if(a.isMesh)if(!0===r.wireframe)ce.setLineWidth(r.wireframeLinewidth*e()),E.setMode(Jt.LINES);else switch(a.drawMode){case Ho:E.setMode(Jt.TRIANGLES);break;case Vo:E.setMode(Jt.TRIANGLE_STRIP);break;case ko:E.setMode(Jt.TRIANGLE_FAN)}else if(a.isLine){var U=r.linewidth;void 0===U&&(U=1),ce.setLineWidth(U*e()),a.isLineSegments?E.setMode(Jt.LINES):E.setMode(Jt.LINE_STRIP)}else a.isPoints&&E.setMode(Jt.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&E.renderInstances(n,P,I):E.render(P,I)}},this.render=function(t,e,i,n){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");gt="",mt=-1,vt=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),jt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),zt.setFromMatrix(jt),$.length=0,it=-1,ot=-1,ct.length=0,ht.length=0,Vt=this.localClippingEnabled,Ht=Gt.init(this.clippingPlanes,Vt,e),x(t,e),et.length=it+1,at.length=ot+1,!0===lt.sortObjects&&(et.sort(d),at.sort(f)),Ht&&Gt.beginShadows(),O($),_e.render(t,e),B($,e),Ht&&Gt.endShadows(),Zt.calls=0,Zt.vertices=0,Zt.faces=0,Zt.points=0,void 0===i&&(i=null),this.setRenderTarget(i);var r=t.background;if(null===r?ce.buffers.color.setClear(wt.r,wt.g,wt.b,Mt,J):r&&r.isColor&&(ce.buffers.color.setClear(r.r,r.g,r.b,1,J),n=!0),(this.autoClear||n)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),r&&r.isCubeTexture?(void 0===ge&&(ge=new Nt,ve=new Lt(new Pt(5,5,5),new Q({uniforms:ls.cube.uniforms,vertexShader:ls.cube.vertexShader,fragmentShader:ls.cube.fragmentShader,side:ia,depthTest:!1,depthWrite:!1,fog:!1}))),
106
+ ge.projectionMatrix.copy(e.projectionMatrix),ge.matrixWorld.extractRotation(e.matrixWorld),ge.matrixWorldInverse.getInverse(ge.matrixWorld),ve.material.uniforms.tCube.value=r,ve.modelViewMatrix.multiplyMatrices(ge.matrixWorldInverse,ve.matrixWorld),ue.update(ve),lt.renderBufferDirect(ge,null,ve.geometry,ve.material,ve,null)):r&&r.isTexture&&(void 0===fe&&(fe=new Dt(-1,1,1,-1,0,1),me=new Lt(new It(2,2),new pt({depthTest:!1,depthWrite:!1,fog:!1}))),me.material.map=r,ue.update(me),lt.renderBufferDirect(fe,null,me.geometry,me.material,me,null)),t.overrideMaterial){var a=t.overrideMaterial;_(et,t,e,a),_(at,t,e,a)}else ce.setBlending(ha),_(et,t,e),_(at,t,e);be.render(t,e),we.render(t,e,_t),i&&le.updateRenderTargetMipmap(i),ce.setDepthTest(!0),ce.setDepthWrite(!0),ce.setColorWrite(!0)},this.setFaceCulling=function(t,e){ce.setCullFace(t),ce.setFlipSided(e===Kr)},this.allocTextureUnit=F,this.setTexture2D=function(){var t=!1;return function(e,i){e&&e.isWebGLRenderTarget&&(t||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),le.setTexture2D(e,i)}}(),this.setTexture=function(){var t=!1;return function(e,i){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),le.setTexture2D(e,i)}}(),this.setTextureCube=function(){var t=!1;return function(e,i){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?le.setTextureCube(e,i):le.setTextureCubeDynamic(e,i)}}(),this.getCurrentRenderTarget=function(){return dt},this.setRenderTarget=function(t){dt=t,t&&void 0===he.get(t).__webglFramebuffer&&le.setupRenderTarget(t);var e,i=t&&t.isWebGLRenderTargetCube;if(t){var n=he.get(t);e=i?n.__webglFramebuffer[t.activeCubeFace]:n.__webglFramebuffer,yt.copy(t.scissor),xt=t.scissorTest,_t.copy(t.viewport)}else e=null,yt.copy(Rt).multiplyScalar(St),xt=Ct,_t.copy(Ut).multiplyScalar(St);if(ft!==e&&(Jt.bindFramebuffer(Jt.FRAMEBUFFER,e),ft=e),ce.scissor(yt),ce.setScissorTest(xt),ce.viewport(_t),i){var r=he.get(t.texture);Jt.framebufferTexture2D(Jt.FRAMEBUFFER,Jt.COLOR_ATTACHMENT0,Jt.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,r.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,i,n,r,a){if(!1===(t&&t.isWebGLRenderTarget))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var o=he.get(t).__webglFramebuffer;if(o){var s=!1;o!==ft&&(Jt.bindFramebuffer(Jt.FRAMEBUFFER,o),s=!0);try{var c=t.texture,h=c.format,l=c.type;if(h!==Eo&&z(h)!==Jt.getParameter(Jt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===ho||z(l)===Jt.getParameter(Jt.IMPLEMENTATION_COLOR_READ_TYPE)||l===go&&(Kt.get("OES_texture_float")||Kt.get("WEBGL_color_buffer_float"))||l===vo&&Kt.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Jt.checkFramebufferStatus(Jt.FRAMEBUFFER)===Jt.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&Jt.readPixels(e,i,n,r,z(h),z(l),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&Jt.bindFramebuffer(Jt.FRAMEBUFFER,ft)}}}}function he(t,e){this.name="",this.color=new W(t),this.density=void 0!==e?e:25e-5}function le(t,e,i){this.name="",this.color=new W(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function ue(){ct.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function pe(t,e,i,n,r){ct.call(this),this.lensFlares=[],this.positionScreen=new c,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,i,n,r)}function de(t){J.call(this),this.type="SpriteMaterial",this.color=new W(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(t)}function fe(t){ct.call(this),this.type="Sprite",this.material=void 0!==t?t:new de}function me(){ct.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function ge(t,e,i){if(this.useVertexTexture=void 0===i||i,this.identityMatrix=new h,t=t||[],this.bones=t.slice(0),this.useVertexTexture){var n=Math.sqrt(4*this.bones.length);n=$o.nextPowerOfTwo(Math.ceil(n)),n=Math.max(n,4),this.boneTextureWidth=n,this.boneTextureHeight=n,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new X(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Eo,go)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var r=0,a=this.bones.length;r<a;r++)this.boneInverses.push(new h)}}function ve(){ct.call(this),this.type="Bone"}function ye(t,e,i){Lt.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new h,this.bindMatrixInverse=new h;var n=[];if(this.geometry&&void 0!==this.geometry.bones){for(var r,a,o=0,s=this.geometry.bones.length;o<s;++o)a=this.geometry.bones[o],r=new ve,n.push(r),r.name=a.name,r.position.fromArray(a.pos),r.quaternion.fromArray(a.rotq),void 0!==a.scl&&r.scale.fromArray(a.scl);for(var o=0,s=this.geometry.bones.length;o<s;++o)a=this.geometry.bones[o],-1!==a.parent&&null!==a.parent&&void 0!==n[a.parent]?n[a.parent].add(n[o]):this.add(n[o])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new ge(n,void 0,i),this.matrixWorld)}function xe(t){J.call(this),this.type="LineBasicMaterial",this.color=new W(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function _e(t,e,i){if(1===i)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new be(t,e);ct.call(this),this.type="Line",this.geometry=void 0!==t?t:new At,this.material=void 0!==e?e:new xe({color:16777215*Math.random()})}function be(t,e){_e.call(this,t,e),this.type="LineSegments"}function we(t){J.call(this),this.type="PointsMaterial",this.color=new W(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(t)}function Me(t,e){ct.call(this),this.type="Points",this.geometry=void 0!==t?t:new At,this.material=void 0!==e?e:new we({color:16777215*Math.random()})}function Ee(){ct.call(this),this.type="Group"}function Te(t,e,i,r,a,o,s,c,h){function l(){requestAnimationFrame(l),t.readyState>=t.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}n.call(this,t,e,i,r,a,o,s,c,h),this.generateMipmaps=!1;var u=this;l()}function Se(t,e,i,r,a,o,s,c,h,l,u,p){n.call(this,null,o,s,c,h,l,r,a,u,p),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Ae(t,e,i,r,a,o,s,c,h){n.call(this,t,e,i,r,a,o,s,c,h),this.needsUpdate=!0}function Le(t,e,i,r,a,o,s,c,h,l){if((l=void 0!==l?l:Lo)!==Lo&&l!==Ro)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&l===Lo&&(i=po),void 0===i&&l===Ro&&(i=bo),n.call(this,null,r,a,o,s,c,l,i,h),this.image={width:t,height:e},this.magFilter=void 0!==s?s:no,this.minFilter=void 0!==c?c:no,this.flipY=!1,this.generateMipmaps=!1}function Re(t){function e(t,e){return t-e}At.call(this),this.type="WireframeGeometry";var i,n,r,a,o,s,h,l,u=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(i=0,r=m.length;i<r;i++){var g=m[i];for(n=0;n<3;n++)p[0]=g[f[n]],p[1]=g[f[(n+1)%3]],p.sort(e),h=p.toString(),void 0===d[h]&&(d[h]={index1:p[0],index2:p[1]})}for(h in d)s=d[h],l=t.vertices[s.index1],u.push(l.x,l.y,l.z),l=t.vertices[s.index2],u.push(l.x,l.y,l.z)}else if(t&&t.isBufferGeometry){var v,y,x,_,b,w,M,E;if(l=new c,null!==t.index){for(v=t.attributes.position,y=t.index,x=t.groups,0===x.length&&t.addGroup(0,y.count),a=0,o=x.length;a<o;++a)for(_=x[a],b=_.start,w=_.count,i=b,r=b+w;i<r;i+=3)for(n=0;n<3;n++)p[0]=y.getX(i+n),p[1]=y.getX(i+(n+1)%3),p.sort(e),h=p.toString(),void 0===d[h]&&(d[h]={index1:p[0],index2:p[1]});for(h in d)s=d[h],l.fromBufferAttribute(v,s.index1),u.push(l.x,l.y,l.z),l.fromBufferAttribute(v,s.index2),u.push(l.x,l.y,l.z)}else for(v=t.attributes.position,i=0,r=v.count/3;i<r;i++)for(n=0;n<3;n++)M=3*i+n,l.fromBufferAttribute(v,M),u.push(l.x,l.y,l.z),E=3*i+(n+1)%3,l.fromBufferAttribute(v,E),u.push(l.x,l.y,l.z)}this.addAttribute("position",new bt(u,3))}function Pe(t,e,i){St.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i},this.fromBufferGeometry(new Ce(t,e,i)),this.mergeVertices()}function Ce(t,e,i){At.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:i};var n,r,a=[],o=[],s=[],c=e+1;for(n=0;n<=i;n++){var h=n/i;for(r=0;r<=e;r++){var l=r/e,u=t(l,h);o.push(u.x,u.y,u.z),s.push(l,h)}}for(n=0;n<i;n++)for(r=0;r<e;r++){var p=n*c+r,d=n*c+r+1,f=(n+1)*c+r+1,m=(n+1)*c+r;a.push(p,d,m),a.push(d,f,m)}this.setIndex(a),this.addAttribute("position",new bt(o,3)),this.addAttribute("uv",new bt(s,2)),this.computeVertexNormals()}function Ie(t,e,i,n){St.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},this.fromBufferGeometry(new Ue(t,e,i,n)),this.mergeVertices()}function Ue(t,e,n,r){function a(t,e,i,n){var r,a,o=Math.pow(2,n),c=[];for(r=0;r<=o;r++){c[r]=[];var h=t.clone().lerp(i,r/o),l=e.clone().lerp(i,r/o),u=o-r;for(a=0;a<=u;a++)c[r][a]=0===a&&r===o?h:h.clone().lerp(l,a/u)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var p=Math.floor(a/2);a%2==0?(s(c[r][p+1]),s(c[r+1][p]),s(c[r][p])):(s(c[r][p+1]),s(c[r+1][p+1]),s(c[r+1][p]))}}function o(){for(var t=0;t<m.length;t+=6){var e=m[t+0],i=m[t+2],n=m[t+4],r=Math.max(e,i,n),a=Math.min(e,i,n);r>.9&&a<.1&&(e<.2&&(m[t+0]+=1),i<.2&&(m[t+2]+=1),n<.2&&(m[t+4]+=1))}}function s(t){f.push(t.x,t.y,t.z)}function h(e,i){var n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function l(){for(var t=new c,e=new c,n=new c,r=new c,a=new i,o=new i,s=new i,h=0,l=0;h<f.length;h+=9,l+=6){t.set(f[h+0],f[h+1],f[h+2]),e.set(f[h+3],f[h+4],f[h+5]),n.set(f[h+6],f[h+7],f[h+8]),a.set(m[l+0],m[l+1]),o.set(m[l+2],m[l+3]),s.set(m[l+4],m[l+5]),r.copy(t).add(e).add(n).divideScalar(3);var d=p(r);u(a,l+0,t,d),u(o,l+2,e,d),u(s,l+4,n,d)}}function u(t,e,i,n){n<0&&1===t.x&&(m[e]=t.x-1),0===i.x&&0===i.z&&(m[e]=n/2/Math.PI+.5)}function p(t){return Math.atan2(t.z,-t.x)}function d(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}At.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1,r=r||0;var f=[],m=[];!function(t){for(var i=new c,n=new c,r=new c,o=0;o<e.length;o+=3)h(e[o+0],i),h(e[o+1],n),h(e[o+2],r),a(i,n,r,t)}(r),function(t){for(var e=new c,i=0;i<f.length;i+=3)e.x=f[i+0],e.y=f[i+1],e.z=f[i+2],e.normalize().multiplyScalar(t),f[i+0]=e.x,f[i+1]=e.y,f[i+2]=e.z}(n),function(){for(var t=new c,e=0;e<f.length;e+=3){t.x=f[e+0],t.y=f[e+1],t.z=f[e+2];var i=p(t)/2/Math.PI+.5,n=d(t)/Math.PI+.5;m.push(i,1-n)}l(),o()}(),this.addAttribute("position",new bt(f,3)),this.addAttribute("normal",new bt(f.slice(),3)),this.addAttribute("uv",new bt(m,2)),this.normalizeNormals()}function Ne(t,e){St.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new De(t,e)),this.mergeVertices()}function De(t,e){var i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],n=[2,1,0,0,3,2,1,3,0,2,3,1];Ue.call(this,i,n,t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Oe(t,e){St.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Be(t,e)),this.mergeVertices()}function Be(t,e){var i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],n=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Ue.call(this,i,n,t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Fe(t,e){St.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ze(t,e)),this.mergeVertices()}function ze(t,e){var i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];Ue.call(this,n,r,t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ge(t,e){St.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new He(t,e)),this.mergeVertices()}function He(t,e){var i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];Ue.call(this,r,a,t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ve(t,e,i,n,r,a){St.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new ke(t,e,i,n,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function ke(t,e,n,r,a){function o(i){var a=t.getPointAt(i/e),o=l.normals[i],s=l.binormals[i];for(p=0;p<=r;p++){var c=p/r*Math.PI*2,h=Math.sin(c),u=-Math.cos(c);f.x=u*o.x+h*s.x,f.y=u*o.y+h*s.y,f.z=u*o.z+h*s.z,f.normalize(),v.push(f.x,f.y,f.z),d.x=a.x+n*f.x,d.y=a.y+n*f.y,d.z=a.z+n*f.z,g.push(d.x,d.y,d.z)}}function s(){for(p=1;p<=e;p++)for(u=1;u<=r;u++){var t=(r+1)*(p-1)+(u-1),i=(r+1)*p+(u-1),n=(r+1)*p+u,a=(r+1)*(p-1)+u;x.push(t,i,a),x.push(i,n,a)}}function h(){for(u=0;u<=e;u++)for(p=0;p<=r;p++)m.x=u/e,m.y=p/r,y.push(m.x,m.y)}At.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:a},e=e||64,n=n||1,r=r||8,a=a||!1;var l=t.computeFrenetFrames(e,a);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;var u,p,d=new c,f=new c,m=new i,g=[],v=[],y=[],x=[];!function(){for(u=0;u<e;u++)o(u);o(!1===a?e:0),h(),s()}(),this.setIndex(x),this.addAttribute("position",new bt(g,3)),this.addAttribute("normal",new bt(v,3)),this.addAttribute("uv",new bt(y,2))}function je(t,e,i,n,r,a,o){St.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new We(t,e,i,n,r,a)),this.mergeVertices()}function We(t,e,n,r,a,o){function s(t,e,i,n,r){var a=Math.cos(t),o=Math.sin(t),s=i/e*t,c=Math.cos(s);r.x=n*(2+c)*.5*a,r.y=n*(2+c)*o*.5,r.z=n*Math.sin(s)*.5}At.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:a,q:o},t=t||100,e=e||40,n=Math.floor(n)||64,r=Math.floor(r)||8,a=a||2,o=o||3;var h,l,u=[],p=[],d=[],f=[],m=new c,g=new c,v=(new i,new c),y=new c,x=new c,_=new c,b=new c;for(h=0;h<=n;++h){var w=h/n*a*Math.PI*2;for(s(w,a,o,t,v),s(w+.01,a,o,t,y),_.subVectors(y,v),b.addVectors(y,v),x.crossVectors(_,b),b.crossVectors(x,_),x.normalize(),b.normalize(),l=0;l<=r;++l){var M=l/r*Math.PI*2,E=-e*Math.cos(M),T=e*Math.sin(M);m.x=v.x+(E*b.x+T*x.x),m.y=v.y+(E*b.y+T*x.y),m.z=v.z+(E*b.z+T*x.z),p.push(m.x,m.y,m.z),g.subVectors(m,v).normalize(),d.push(g.x,g.y,g.z),f.push(h/n),f.push(l/r)}}for(l=1;l<=n;l++)for(h=1;h<=r;h++){var S=(r+1)*(l-1)+(h-1),A=(r+1)*l+(h-1),L=(r+1)*l+h,R=(r+1)*(l-1)+h;u.push(S,A,R),u.push(A,L,R)}this.setIndex(u),this.addAttribute("position",new bt(p,3)),this.addAttribute("normal",new bt(d,3)),this.addAttribute("uv",new bt(f,2))}function Xe(t,e,i,n,r){St.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new qe(t,e,i,n,r))}function qe(t,e,i,n,r){At.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},t=t||100,e=e||40,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;var a,o,s=[],h=[],l=[],u=[],p=new c,d=new c,f=new c;for(a=0;a<=i;a++)for(o=0;o<=n;o++){var m=o/n*r,g=a/i*Math.PI*2;d.x=(t+e*Math.cos(g))*Math.cos(m),d.y=(t+e*Math.cos(g))*Math.sin(m),d.z=e*Math.sin(g),h.push(d.x,d.y,d.z),p.x=t*Math.cos(m),p.y=t*Math.sin(m),f.subVectors(d,p).normalize(),l.push(f.x,f.y,f.z),u.push(o/n),u.push(a/i)}for(a=1;a<=i;a++)for(o=1;o<=n;o++){var v=(n+1)*a+o-1,y=(n+1)*(a-1)+o-1,x=(n+1)*(a-1)+o,_=(n+1)*a+o;s.push(v,y,_),s.push(y,x,_)}this.setIndex(s),this.addAttribute("position",new bt(h,3)),this.addAttribute("normal",new bt(l,3)),this.addAttribute("uv",new bt(u,2))}function Ye(t,e){if(void 0===t)return void(t=[]);St.call(this),this.type="ExtrudeGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeFaceNormals()}function Ze(t,e){e=e||{};var i=e.font;if(!1===(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new St;var n=i.generateShapes(t,e.size,e.curveSegments);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Ye.call(this,n,e),this.type="TextGeometry"}function Je(t,e,i,n,r,a,o){St.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Qe(t,e,i,n,r,a,o))}function Qe(t,e,i,n,r,a,o){At.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},t=t||50,e=Math.max(3,Math.floor(e)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,h,l=a+o,u=0,p=[],d=new c,f=new c,m=[],g=[],v=[],y=[];for(h=0;h<=i;h++){var x=[],_=h/i;for(s=0;s<=e;s++){var b=s/e;d.x=-t*Math.cos(n+b*r)*Math.sin(a+_*o),d.y=t*Math.cos(a+_*o),d.z=t*Math.sin(n+b*r)*Math.sin(a+_*o),g.push(d.x,d.y,d.z),f.set(d.x,d.y,d.z).normalize(),v.push(f.x,f.y,f.z),y.push(b,1-_),x.push(u++)}p.push(x)}for(h=0;h<i;h++)for(s=0;s<e;s++){var w=p[h][s+1],M=p[h][s],E=p[h+1][s],T=p[h+1][s+1];(0!==h||a>0)&&m.push(w,M,T),(h!==i-1||l<Math.PI)&&m.push(M,E,T)}this.setIndex(m),this.addAttribute("position",new bt(g,3)),this.addAttribute("normal",new bt(v,3)),this.addAttribute("uv",new bt(y,2))}function Ke(t,e,i,n,r,a){St.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new $e(t,e,i,n,r,a))}function $e(t,e,n,r,a,o){At.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:a,thetaLength:o},t=t||20,e=e||50,a=void 0!==a?a:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?Math.max(1,r):1;var s,h,l,u=[],p=[],d=[],f=[],m=t,g=(e-t)/r,v=new c,y=new i;for(h=0;h<=r;h++){for(l=0;l<=n;l++)s=a+l/n*o,v.x=m*Math.cos(s),v.y=m*Math.sin(s),p.push(v.x,v.y,v.z),d.push(0,0,1),y.x=(v.x/e+1)/2,y.y=(v.y/e+1)/2,f.push(y.x,y.y);m+=g}for(h=0;h<r;h++){var x=h*(n+1);for(l=0;l<n;l++){s=l+x;var _=s,b=s+n+1,w=s+n+2,M=s+1;u.push(_,b,M),u.push(b,w,M)}}this.setIndex(u),this.addAttribute("position",new bt(p,3)),this.addAttribute("normal",new bt(d,3)),this.addAttribute("uv",new bt(f,2))}function ti(t,e,i,n){St.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},this.fromBufferGeometry(new ei(t,e,i,n)),this.mergeVertices()}function ei(t,e,n,r){At.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=$o.clamp(r,0,2*Math.PI);var a,o,s,h=[],l=[],u=[],p=1/e,d=new c,f=new i;for(o=0;o<=e;o++){var m=n+o*p*r,g=Math.sin(m),v=Math.cos(m);for(s=0;s<=t.length-1;s++)d.x=t[s].x*g,d.y=t[s].y,d.z=t[s].x*v,l.push(d.x,d.y,d.z),f.x=o/e,f.y=s/(t.length-1),u.push(f.x,f.y)}for(o=0;o<e;o++)for(s=0;s<t.length-1;s++){a=s+o*t.length;var y=a,x=a+t.length,_=a+t.length+1,b=a+1;h.push(y,x,b),h.push(x,_,b)}if(this.setIndex(h),this.addAttribute("position",new bt(l,3)),this.addAttribute("uv",new bt(u,2)),this.computeVertexNormals(),r===2*Math.PI){var w=this.attributes.normal.array,M=new c,E=new c,T=new c;for(a=e*t.length*3,o=0,s=0;o<t.length;o++,s+=3)M.x=w[s+0],M.y=w[s+1],M.z=w[s+2],E.x=w[a+s+0],E.y=w[a+s+1],E.z=w[a+s+2],T.addVectors(M,E).normalize(),w[s+0]=w[a+s+0]=T.x,w[s+1]=w[a+s+1]=T.y,w[s+2]=w[a+s+2]=T.z}}function ii(t,e){St.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new ni(t,e)),this.mergeVertices()}function ni(t,e){function i(t){var i,s,h,l=r.length/3,u=t.extractPoints(e),p=u.shape,d=u.holes;if(!1===ms.isClockWise(p))for(p=p.reverse(),i=0,s=d.length;i<s;i++)h=d[i],!0===ms.isClockWise(h)&&(d[i]=h.reverse());var f=ms.triangulateShape(p,d);for(i=0,s=d.length;i<s;i++)h=d[i],p=p.concat(h);for(i=0,s=p.length;i<s;i++){var m=p[i];r.push(m.x,m.y,0),a.push(0,0,1),o.push(m.x,m.y)}for(i=0,s=f.length;i<s;i++){var g=f[i],v=g[0]+l,y=g[1]+l,x=g[2]+l;n.push(v,y,x),c+=3}}At.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],r=[],a=[],o=[],s=0,c=0;if(!1===Array.isArray(t))i(t);else for(var h=0;h<t.length;h++)i(t[h]),this.addGroup(s,c,h),s+=c,c=0;this.setIndex(n),this.addAttribute("position",new bt(r,3)),this.addAttribute("normal",new bt(a,3)),this.addAttribute("uv",new bt(o,2))}function ri(t,e){function i(t,e){return t-e}At.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,a=[],o=Math.cos($o.DEG2RAD*e),s=[0,0],c={},h=["a","b","c"];t.isBufferGeometry?(r=new St,r.fromBufferGeometry(t)):r=t.clone(),r.mergeVertices(),r.computeFaceNormals();for(var l=r.vertices,u=r.faces,p=0,d=u.length;p<d;p++)for(var f=u[p],m=0;m<3;m++)s[0]=f[h[m]],s[1]=f[h[(m+1)%3]],s.sort(i),n=s.toString(),void 0===c[n]?c[n]={index1:s[0],index2:s[1],face1:p,face2:void 0}:c[n].face2=p;for(n in c){var g=c[n];if(void 0===g.face2||u[g.face1].normal.dot(u[g.face2].normal)<=o){var v=l[g.index1];a.push(v.x,v.y,v.z),v=l[g.index2],a.push(v.x,v.y,v.z)}}this.addAttribute("position",new bt(a,3))}function ai(t,e,i,n,r,a,o,s){St.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new oi(t,e,i,n,r,a,o,s)),this.mergeVertices()}function oi(t,e,n,r,a,o,s,h){function l(n){var a,o,l,v=new i,_=new c,b=0,w=!0===n?t:e,M=!0===n?1:-1;for(o=g,a=1;a<=r;a++)d.push(0,y*M,0),f.push(0,M,0),m.push(.5,.5),g++;for(l=g,a=0;a<=r;a++){var E=a/r,T=E*h+s,S=Math.cos(T),A=Math.sin(T);_.x=w*A,_.y=y*M,_.z=w*S,d.push(_.x,_.y,_.z),f.push(0,M,0),v.x=.5*S+.5,v.y=.5*A*M+.5,m.push(v.x,v.y),g++}for(a=0;a<r;a++){var L=o+a,R=l+a;!0===n?p.push(R,R+1,L):p.push(R+1,R,L),b+=3}u.addGroup(x,b,!0===n?1:2),x+=b}At.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:h};var u=this;t=void 0!==t?t:20,e=void 0!==e?e:20,n=void 0!==n?n:100,r=Math.floor(r)||8,a=Math.floor(a)||1,o=void 0!==o&&o,s=void 0!==s?s:0,h=void 0!==h?h:2*Math.PI;var p=[],d=[],f=[],m=[],g=0,v=[],y=n/2,x=0;!function(){var i,o,l=new c,_=new c,b=0,w=(e-t)/n;for(o=0;o<=a;o++){var M=[],E=o/a,T=E*(e-t)+t;for(i=0;i<=r;i++){var S=i/r,A=S*h+s,L=Math.sin(A),R=Math.cos(A);_.x=T*L,_.y=-E*n+y,_.z=T*R,d.push(_.x,_.y,_.z),l.set(L,w,R).normalize(),f.push(l.x,l.y,l.z),m.push(S,1-E),M.push(g++)}v.push(M)}for(i=0;i<r;i++)for(o=0;o<a;o++){var P=v[o][i],C=v[o+1][i],I=v[o+1][i+1],U=v[o][i+1];p.push(P,C,U),p.push(C,I,U),b+=6}u.addGroup(x,b,0),x+=b}(),!1===o&&(t>0&&l(!0),e>0&&l(!1)),this.setIndex(p),this.addAttribute("position",new bt(d,3)),this.addAttribute("normal",new bt(f,3)),this.addAttribute("uv",new bt(m,2))}function si(t,e,i,n,r,a,o){ai.call(this,0,t,e,i,n,r,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function ci(t,e,i,n,r,a,o){oi.call(this,0,t,e,i,n,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function hi(t,e,i,n){St.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new li(t,e,i,n))}function li(t,e,n,r){At.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||50,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var a,o,s=[],h=[],l=[],u=[],p=new c,d=new i;for(h.push(0,0,0),l.push(0,0,1),u.push(.5,.5),o=0,a=3;o<=e;o++,a+=3){var f=n+o/e*r;p.x=t*Math.cos(f),p.y=t*Math.sin(f),h.push(p.x,p.y,p.z),l.push(0,0,1),d.x=(h[a]/t+1)/2,d.y=(h[a+1]/t+1)/2,u.push(d.x,d.y)}for(a=1;a<=e;a++)s.push(a,a+1,0);this.setIndex(s),this.addAttribute("position",new bt(h,3)),this.addAttribute("normal",new bt(l,3)),this.addAttribute("uv",new bt(u,2))}function ui(){Q.call(this,{uniforms:os.merge([hs.lights,{opacity:{value:1}}]),vertexShader:ss.shadow_vert,fragmentShader:ss.shadow_frag}),this.lights=!0,this.transparent=!0,Object.defineProperties(this,{opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}}})}function pi(t){Q.call(this,t),this.type="RawShaderMaterial"}function di(t){this.uuid=$o.generateUUID(),this.type="MultiMaterial",this.materials=Array.isArray(t)?t:[],this.visible=!0}function fi(t){J.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new W(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new W(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function mi(t){fi.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function gi(t){J.call(this),this.type="MeshPhongMaterial",this.color=new W(16777215),this.specular=new W(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new W(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=za,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function vi(t){gi.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function yi(t){J.call(this,t),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function xi(t){J.call(this),this.type="MeshLambertMaterial",this.color=new W(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new W(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=za,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function _i(t){J.call(this),this.type="LineDashedMaterial",this.color=new W(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(t)}function bi(t,e,i){var n=this,r=!1,a=0,o=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===r&&void 0!==n.onStart&&n.onStart(t,a,o),r=!0},this.itemEnd=function(t){a++,void 0!==n.onProgress&&n.onProgress(t,a,o),a===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)}}function wi(t){this.manager=void 0!==t?t:xs}function Mi(t){this.manager=void 0!==t?t:xs,this._parser=null}function Ei(t){this.manager=void 0!==t?t:xs,this._parser=null}function Ti(t){this.manager=void 0!==t?t:xs}function Si(t){this.manager=void 0!==t?t:xs}function Ai(t){this.manager=void 0!==t?t:xs}function Li(t,e){ct.call(this),this.type="Light",this.color=new W(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Ri(t,e,i){Li.call(this,t,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(ct.DefaultUp),this.updateMatrix(),this.groundColor=new W(e)}function Pi(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new h}function Ci(){Pi.call(this,new Nt(50,1,.5,500))}function Ii(t,e,i,n,r,a){Li.call(this,t,e),this.type="SpotLight",this.position.copy(ct.DefaultUp),this.updateMatrix(),this.target=new ct,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new Ci}function Ui(t,e,i,n){Li.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new Pi(new Nt(90,1,.5,500))}function Ni(){Pi.call(this,new Dt(-5,5,5,-5,.5,500))}function Di(t,e){Li.call(this,t,e),this.type="DirectionalLight",this.position.copy(ct.DefaultUp),this.updateMatrix(),this.target=new ct,this.shadow=new Ni}function Oi(t,e){Li.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Bi(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function Fi(t,e,i,n){Bi.call(this,t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function zi(t,e,i,n){Bi.call(this,t,e,i,n)}function Gi(t,e,i,n){Bi.call(this,t,e,i,n)}function Hi(t,e,i,n){if(void 0===t)throw new Error("track name is undefined");if(void 0===e||0===e.length)throw new Error("no keyframes in track named "+t);this.name=t,this.times=_s.convertArray(e,this.TimeBufferType),
107
+ this.values=_s.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation),this.validate(),this.optimize()}function Vi(t,e,i,n){Hi.call(this,t,e,i,n)}function ki(t,e,i,n){Bi.call(this,t,e,i,n)}function ji(t,e,i,n){Hi.call(this,t,e,i,n)}function Wi(t,e,i,n){Hi.call(this,t,e,i,n)}function Xi(t,e,i,n){Hi.call(this,t,e,i,n)}function qi(t,e,i){Hi.call(this,t,e,i)}function Yi(t,e,i,n){Hi.call(this,t,e,i,n)}function Zi(t,e,i,n){Hi.apply(this,arguments)}function Ji(t,e,i){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.uuid=$o.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function Qi(t){this.manager=void 0!==t?t:xs,this.textures={}}function Ki(t){this.manager=void 0!==t?t:xs}function $i(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function tn(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:xs,this.withCredentials=!1}function en(t){this.manager=void 0!==t?t:xs,this.texturePath=""}function nn(t,e,i,n,r){var a=.5*(n-e),o=.5*(r-i),s=t*t;return(2*i-2*n+a+o)*(t*s)+(-3*i+3*n-2*a-o)*s+a*t+i}function rn(t,e){var i=1-t;return i*i*e}function an(t,e){return 2*(1-t)*t*e}function on(t,e){return t*t*e}function sn(t,e,i,n){return rn(t,e)+an(t,i)+on(t,n)}function cn(t,e){var i=1-t;return i*i*i*e}function hn(t,e){var i=1-t;return 3*i*i*t*e}function ln(t,e){return 3*(1-t)*t*t*e}function un(t,e){return t*t*t*e}function pn(t,e,i,n,r){return cn(t,e)+hn(t,i)+ln(t,n)+un(t,r)}function dn(){}function fn(t,e){this.v1=t,this.v2=e}function mn(){this.curves=[],this.autoClose=!1}function gn(t,e,i,n,r,a,o,s){this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0}function vn(t){this.points=void 0===t?[]:t}function yn(t,e,i,n){this.v0=t,this.v1=e,this.v2=i,this.v3=n}function xn(t,e,i){this.v0=t,this.v1=e,this.v2=i}function _n(t){mn.call(this),this.currentPoint=new i,t&&this.fromPoints(t)}function bn(){_n.apply(this,arguments),this.holes=[]}function wn(){this.subPaths=[],this.currentPath=null}function Mn(t){this.data=t}function En(t){this.manager=void 0!==t?t:xs}function Tn(t){this.manager=void 0!==t?t:xs}function Sn(t,e,i,n){Li.call(this,t,e),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function An(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Nt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Nt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Ln(t,e,i){ct.call(this),this.type="CubeCamera";var n=new Nt(90,1,t,e);n.up.set(0,-1,0),n.lookAt(new c(1,0,0)),this.add(n);var r=new Nt(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new c(-1,0,0)),this.add(r);var a=new Nt(90,1,t,e);a.up.set(0,0,1),a.lookAt(new c(0,1,0)),this.add(a);var s=new Nt(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new c(0,-1,0)),this.add(s);var h=new Nt(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new c(0,0,1)),this.add(h);var l=new Nt(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new c(0,0,-1)),this.add(l);var u={format:Mo,magFilter:oo,minFilter:oo};this.renderTarget=new o(i,i,u),this.updateCubeMap=function(t,e){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,o=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,t.render(e,n,i),i.activeCubeFace=1,t.render(e,r,i),i.activeCubeFace=2,t.render(e,a,i),i.activeCubeFace=3,t.render(e,s,i),i.activeCubeFace=4,t.render(e,h,i),i.texture.generateMipmaps=o,i.activeCubeFace=5,t.render(e,l,i),t.setRenderTarget(null)}}function Rn(){ct.call(this),this.type="AudioListener",this.context=Es.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Pn(t){ct.call(this),this.type="Audio",this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Cn(t){Pn.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function In(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Un(t,e,i){this.binding=t,this.valueSize=i;var n,r=Float64Array;switch(e){case"quaternion":n=this._slerp;break;case"string":case"bool":r=Array,n=this._select;break;default:n=this._lerp}this.buffer=new r(4*i),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Nn(t,e,i){this.path=e,this.parsedPath=i||Nn.parseTrackName(e),this.node=Nn.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Dn(t){this.uuid=$o.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var i=0,n=arguments.length;i!==n;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function On(t,e,i){this._mixer=t,this._clip=e,this._localRoot=i||null;for(var n=e.tracks,r=n.length,a=new Array(r),o={endingStart:Go,endingEnd:Go},s=0;s!==r;++s){var c=n[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=zo,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Bn(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Fn(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function zn(){At.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Gn(t,e,i,n){this.uuid=$o.generateUUID(),this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}function Hn(t,e){this.uuid=$o.generateUUID(),this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function Vn(t,e,i){Hn.call(this,t,e),this.meshPerAttribute=i||1}function kn(t,e,i){dt.call(this,t,e),this.meshPerAttribute=i||1}function jn(t,e,i,n){this.ray=new at(t,e),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Wn(t,e){return t.distance-e.distance}function Xn(t,e,i,n){if(!1!==t.visible&&(t.raycast(e,i),!0===n))for(var r=t.children,a=0,o=r.length;a<o;a++)Xn(r[a],e,i,!0)}function qn(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Yn(t,e,i){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==i?i:0,this}function Zn(t,e,i){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==i?i:0,this}function Jn(t,e){Lt.call(this,t,e),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length,n=i-1,r=i/1;this.createAnimation("__default",0,n,r),this.setAnimationWeight("__default",1)}function Qn(t){ct.call(this),this.material=t,this.render=function(t){}}function Kn(t,e,i,n){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==i?i:16711680,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new At,h=new bt(2*o*3,3);c.addAttribute("position",h),be.call(this,c,new xe({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function $n(t){ct.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;for(var e=new At,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],n=0,r=1;n<32;n++,r++){var a=n/32*Math.PI*2,o=r/32*Math.PI*2;i.push(Math.cos(a),Math.sin(a),1,Math.cos(o),Math.sin(o),1)}e.addAttribute("position",new bt(i,3));var s=new xe({fog:!1});this.cone=new be(e,s),this.add(this.cone),this.update()}function tr(t){this.bones=this.getBoneList(t);for(var e=new At,i=[],n=[],r=new W(0,0,1),a=new W(0,1,0),o=0;o<this.bones.length;o++){var s=this.bones[o];s.parent&&s.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),n.push(r.r,r.g,r.b),n.push(a.r,a.g,a.b))}e.addAttribute("position",new bt(i,3)),e.addAttribute("color",new bt(n,3));var c=new xe({vertexColors:ca,depthTest:!1,depthWrite:!1,transparent:!0});be.call(this,e,c),this.root=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function er(t,e){this.light=t,this.light.updateMatrixWorld();var i=new Qe(e,4,2),n=new pt({wireframe:!0,fog:!1});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),Lt.call(this,i,n),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1}function ir(t){ct.call(this),this.light=t,this.light.updateMatrixWorld();var e=new pt({color:t.color,fog:!1}),i=new pt({color:t.color,fog:!1,wireframe:!0}),n=new At;n.addAttribute("position",new dt(new Float32Array(18),3)),this.add(new Lt(n,e)),this.add(new Lt(n,i)),this.update()}function nr(t,e){ct.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;var i=new Be(e);i.rotateY(.5*Math.PI);var n=new pt({vertexColors:ca,wireframe:!0}),r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.addAttribute("color",new dt(a,3)),this.add(new Lt(i,n)),this.update()}function rr(t,e,i,n){t=t||10,e=e||10,i=new W(void 0!==i?i:4473924),n=new W(void 0!==n?n:8947848);for(var r=e/2,a=t/e,o=t/2,s=[],c=[],h=0,l=0,u=-o;h<=e;h++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var p=h===r?i:n;p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3}var d=new At;d.addAttribute("position",new bt(s,3)),d.addAttribute("color",new bt(c,3));var f=new xe({vertexColors:ca});be.call(this,d,f)}function ar(t,e,i,n,r,a){t=t||10,e=e||16,i=i||8,n=n||64,r=new W(void 0!==r?r:4473924),a=new W(void 0!==a?a:8947848);var o,s,c,h,l,u,p,d=[],f=[];for(h=0;h<=e;h++)c=h/e*(2*Math.PI),o=Math.sin(c)*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(o,0,s),p=1&h?r:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(h=0;h<=i;h++)for(p=1&h?r:a,u=t-t/i*h,l=0;l<n;l++)c=l/n*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,d.push(o,0,s),f.push(p.r,p.g,p.b),c=(l+1)/n*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,d.push(o,0,s),f.push(p.r,p.g,p.b);var m=new At;m.addAttribute("position",new bt(d,3)),m.addAttribute("color",new bt(f,3));var g=new xe({vertexColors:ca});be.call(this,m,g)}function or(t,e,i,n){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==i?i:16776960,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new At,h=new bt(2*o*3,3);c.addAttribute("position",h),be.call(this,c,new xe({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function sr(t,e){ct.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,void 0===e&&(e=1);var i=new At;i.addAttribute("position",new bt([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var n=new xe({fog:!1});this.add(new _e(i,n)),i=new At,i.addAttribute("position",new bt([0,0,0,0,0,1],3)),this.add(new _e(i,n)),this.update()}function cr(t){function e(t,e,n){i(t,n),i(e,n)}function i(t,e){a.push(0,0,0),o.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(a.length/3-1)}var n=new At,r=new xe({color:16777215,vertexColors:sa}),a=[],o=[],s={},c=new W(16755200),h=new W(16711680),l=new W(43775),u=new W(16777215),p=new W(3355443);e("n1","n2",c),e("n2","n4",c),e("n4","n3",c),e("n3","n1",c),e("f1","f2",c),e("f2","f4",c),e("f4","f3",c),e("f3","f1",c),e("n1","f1",c),e("n2","f2",c),e("n3","f3",c),e("n4","f4",c),e("p","n1",h),e("p","n2",h),e("p","n3",h),e("p","n4",h),e("u1","u2",l),e("u2","u3",l),e("u3","u1",l),e("c","t",u),e("p","c",p),e("cn1","cn2",p),e("cn3","cn4",p),e("cf1","cf2",p),e("cf3","cf4",p),n.addAttribute("position",new bt(a,3)),n.addAttribute("color",new bt(o,3)),be.call(this,n,r),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function hr(t,e){void 0===e&&(e=16776960);var i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new At;r.setIndex(new dt(i,1)),r.addAttribute("position",new dt(n,3)),be.call(this,r,new xe({color:e})),void 0!==t&&this.update(t)}function lr(t,e,i,n,r,a){ct.call(this),void 0===n&&(n=16776960),void 0===i&&(i=1),void 0===r&&(r=.2*i),void 0===a&&(a=.2*r),void 0===Ts&&(Ts=new At,Ts.addAttribute("position",new bt([0,0,0,0,1,0],3)),Ss=new oi(0,.5,1,5,1),Ss.translate(0,-.5,0)),this.position.copy(e),this.line=new _e(Ts,new xe({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Lt(Ss,new pt({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,a)}function ur(t){t=t||1;var e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new At;n.addAttribute("position",new bt(e,3)),n.addAttribute("color",new bt(i,3));var r=new xe({vertexColors:ca});be.call(this,n,r)}function pr(){function t(t,a,o,s){e=t,i=o,n=-3*t+3*a-2*o-s,r=2*t-2*a+o+s}var e=0,i=0,n=0,r=0;return{initCatmullRom:function(e,i,n,r,a){t(i,n,a*(n-e),a*(r-i))},initNonuniformCatmullRom:function(e,i,n,r,a,o,s){var c=(i-e)/a-(n-e)/(a+o)+(n-i)/o,h=(n-i)/o-(r-i)/(o+s)+(r-n)/s;c*=o,h*=o,t(i,n,c,h)},calc:function(t){var a=t*t;return e+i*t+n*a+r*(a*t)}}}function dr(t){this.points=t||[],this.closed=!1}function fr(t,e,i,n){this.v0=t,this.v1=e,this.v2=i,this.v3=n}function mr(t,e,i){this.v0=t,this.v1=e,this.v2=i}function gr(t,e){this.v1=t,this.v2=e}function vr(t,e,i,n,r,a){gn.call(this,t,e,i,i,n,r,a)}function yr(t,e,i,n,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new ut(t,e,i,r,a,o)}function xr(t){return console.warn("THREE.MeshFaceMaterial has been renamed to THREE.MultiMaterial."),new di(t)}function _r(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Me(t,e)}function br(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new fe(t)}function wr(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Me(t,e)}function Mr(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new we(t)}function Er(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new we(t)}function Tr(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new we(t)}function Sr(t,e,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new c(t,e,i)}function Ar(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new dt(t,e).setDynamic(!0)}function Lr(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new ft(t,e)}function Rr(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new mt(t,e)}function Pr(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new gt(t,e)}function Cr(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new vt(t,e)}function Ir(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new yt(t,e)}function Ur(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new xt(t,e)}function Nr(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new _t(t,e)}function Dr(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new bt(t,e)}function Or(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new wt(t,e)}function Br(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),dr.call(this,t),this.type="catmullrom",this.closed=!0}function Fr(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),dr.call(this,t),this.type="catmullrom"}function zr(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),dr.call(this,t),this.type="catmullrom"}function Gr(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new hr(t,e)}function Hr(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new be(new ri(t.geometry),new xe({color:void 0!==e?e:16777215}))}function Vr(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new be(new Re(t.geometry),new xe({color:void 0!==e?e:16777215}))}function kr(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new wi(t)}function jr(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Ei(t)}function Wr(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function Xr(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(void 0!==n&&null!==n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}}(),e.prototype={addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var i=this._listeners,n=i[t];if(void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners,i=e[t.type];if(void 0!==i){t.target=this;var n=[],r=0,a=i.length;for(r=0;r<a;r++)n[r]=i[r];for(r=0;r<a;r++)n[r].call(this,t)}}}};var qr="84",Yr={LEFT:0,MIDDLE:1,RIGHT:2},Zr=0,Jr=1,Qr=2,Kr=0,$r=1,ta=2,ea=0,ia=1,na=2,ra=1,aa=2,oa=0,sa=1,ca=2,ha=0,la=1,ua=2,pa=3,da=4,fa=5,ma=100,ga=101,va=102,ya=103,xa=104,_a=200,ba=201,wa=202,Ma=203,Ea=204,Ta=205,Sa=206,Aa=207,La=208,Ra=209,Pa=210,Ca=0,Ia=1,Ua=2,Na=3,Da=4,Oa=5,Ba=6,Fa=7,za=0,Ga=1,Ha=2,Va=0,ka=1,ja=2,Wa=3,Xa=4,qa=301,Ya=302,Za=303,Ja=304,Qa=305,Ka=306,$a=307,to=1e3,eo=1001,io=1002,no=1003,ro=1004,ao=1005,oo=1006,so=1007,co=1008,ho=1009,lo=1010,uo=1011,po=1012,fo=1013,mo=1014,go=1015,vo=1016,yo=1017,xo=1018,_o=1019,bo=1020,wo=1021,Mo=1022,Eo=1023,To=1024,So=1025,Ao=Eo,Lo=1026,Ro=1027,Po=2001,Co=2002,Io=2003,Uo=2004,No=2100,Do=2101,Oo=2102,Bo=2103,Fo=2151,zo=2201,Go=2400,Ho=0,Vo=1,ko=2,jo=3e3,Wo=3001,Xo=3007,qo=3002,Yo=3004,Zo=3005,Jo=3006,Qo=3200,Ko=3201,$o={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),n=0;return function(){for(var r=0;r<36;r++)8===r||13===r||18===r||23===r?i[r]="-":14===r?i[r]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),t=15&n,n>>=4,i[r]=e[19===r?3&t|8:t]);return i.join("")}}(),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*$o.DEG2RAD},radToDeg:function(t){return t*$o.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};i.prototype={constructor:i,isVector2:!0,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t,e;return function(n,r){return void 0===t&&(t=new i,e=new i),t.set(n,n),e.set(r,r),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*n+t.x,this.y=r*n+a*i+t.y,this}};var ts=0;n.DEFAULT_IMAGE=void 0,n.DEFAULT_MAPPING=300,n.prototype={constructor:n,isTexture:!0,set needsUpdate(t){!0===t&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var e={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var i=this.image;void 0===i.uuid&&(i.uuid=$o.generateUUID()),void 0===t.images[i.uuid]&&(t.images[i.uuid]={uuid:i.uuid,url:function(t){var e;return void 0!==t.toDataURL?e=t:(e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0,t.width,t.height)),e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}(i)}),e.image=i.uuid}return t.textures[this.uuid]=e,e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300===this.mapping){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case to:t.x=t.x-Math.floor(t.x);break;case eo:t.x=t.x<0?0:1;break;case io:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case to:t.y=t.y-Math.floor(t.y);break;case eo:t.y=t.y<0?0:1;break;case io:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}},Object.assign(n.prototype,e.prototype),r.prototype={constructor:r,isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*n+a[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,n,r,a=t.elements,o=a[0],s=a[4],c=a[8],h=a[1],l=a[5],u=a[9],p=a[2],d=a[6],f=a[10];if(Math.abs(s-h)<.01&&Math.abs(c-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(s+h)<.1&&Math.abs(c+p)<.1&&Math.abs(u+d)<.1&&Math.abs(o+l+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,g=(l+1)/2,v=(f+1)/2,y=(s+h)/4,x=(c+p)/4,_=(u+d)/4;return m>g&&m>v?m<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(m),n=y/i,r=x/i):g>v?g<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(g),i=y/n,r=_/n):v<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(v),i=x/r,n=_/r),this.set(i,n,r,e),this}var b=Math.sqrt((d-u)*(d-u)+(c-p)*(c-p)+(h-s)*(h-s));return Math.abs(b)<.001&&(b=1),this.x=(d-u)/b,this.y=(c-p)/b,this.z=(h-s)/b,this.w=Math.acos((o+l+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),
108
+ this},clampScalar:function(){var t,e;return function(i,n){return void 0===t&&(t=new r,e=new r),t.set(i,i,i,i),e.set(n,n,n,n),this.clamp(t,e)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}},a.prototype={constructor:a,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},Object.assign(a.prototype,e.prototype),o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.prototype.isWebGLRenderTargetCube=!0,s.prototype={constructor:s,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get w(){return this._w},set w(t){this._w=t,this.onChangeCallback()},set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!1===(t&&t.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=Math.cos(t._x/2),n=Math.cos(t._y/2),r=Math.cos(t._z/2),a=Math.sin(t._x/2),o=Math.sin(t._y/2),s=Math.sin(t._z/2),c=t.order;return"XYZ"===c?(this._x=a*n*r+i*o*s,this._y=i*o*r-a*n*s,this._z=i*n*s+a*o*r,this._w=i*n*r-a*o*s):"YXZ"===c?(this._x=a*n*r+i*o*s,this._y=i*o*r-a*n*s,this._z=i*n*s-a*o*r,this._w=i*n*r+a*o*s):"ZXY"===c?(this._x=a*n*r-i*o*s,this._y=i*o*r+a*n*s,this._z=i*n*s+a*o*r,this._w=i*n*r-a*o*s):"ZYX"===c?(this._x=a*n*r-i*o*s,this._y=i*o*r+a*n*s,this._z=i*n*s-a*o*r,this._w=i*n*r+a*o*s):"YZX"===c?(this._x=a*n*r+i*o*s,this._y=i*o*r+a*n*s,this._z=i*n*s-a*o*r,this._w=i*n*r-a*o*s):"XZY"===c&&(this._x=a*n*r-i*o*s,this._y=i*o*r-a*n*s,this._z=i*n*s+a*o*r,this._w=i*n*r+a*o*s),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,i=t.elements,n=i[0],r=i[4],a=i[8],o=i[1],s=i[5],c=i[9],h=i[2],l=i[6],u=i[10],p=n+s+u;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(l-c)*e,this._y=(a-h)*e,this._z=(o-r)*e):n>s&&n>u?(e=2*Math.sqrt(1+n-s-u),this._w=(l-c)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(a+h)/e):s>u?(e=2*Math.sqrt(1+s-n-u),this._w=(a-h)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+u-n-s),this._w=(o-r)/e,this._x=(a+h)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e;return function(i,n){return void 0===t&&(t=new c),e=i.dot(n)+1,e<1e-6?(e=0,Math.abs(i.x)>Math.abs(i.z)?t.set(-i.y,i.x,0):t.set(0,-i.z,i.y)):t.crossVectors(i,n),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,a=t._w,o=e._x,s=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+n*c-r*s,this._y=n*h+a*s+r*o-i*c,this._z=r*h+a*c+i*s-n*o,this._w=a*h-i*o-n*s-r*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,a=this._w,o=a*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(i+this._x),this._y=.5*(n+this._y),this._z=.5*(r+this._z),this;var c=Math.atan2(s,o),h=Math.sin((1-e)*c)/s,l=Math.sin(e*c)/s;return this._w=a*h+this._w*l,this._x=i*h+this._x*l,this._y=n*h+this._y*l,this._z=r*h+this._z*l,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},Object.assign(s,{slerp:function(t,e,i,n){return i.copy(t).slerp(e,n)},slerpFlat:function(t,e,i,n,r,a,o){var s=i[n+0],c=i[n+1],h=i[n+2],l=i[n+3],u=r[a+0],p=r[a+1],d=r[a+2],f=r[a+3];if(l!==f||s!==u||c!==p||h!==d){var m=1-o,g=s*u+c*p+h*d+l*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*v;if(s=s*m+u*b,c=c*m+p*b,h=h*m+d*b,l=l*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+c*c+h*h+l*l);s*=w,c*=w,h*=w,l*=w}}t[e]=s,t[e+1]=c,t[e+2]=h,t[e+3]=l}}),c.prototype={constructor:c,isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t;return function(e){return!1===(e&&e.isEuler)&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===t&&(t=new s),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t;return function(e,i){return void 0===t&&(t=new s),this.applyQuaternion(t.setFromAxisAngle(e,i))}}(),applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14];var a=r[3]*e+r[7]*i+r[11]*n+r[15];return this.divideScalar(a)},applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*n-o*i,h=s*i+o*e-r*n,l=s*n+r*i-a*e,u=-r*e-a*i-o*n;return this.x=c*s+u*-r+h*-o-l*-a,this.y=h*s+u*-a+l*-r-c*-o,this.z=l*s+u*-o+c*-a-h*-r,this},project:function(){var t;return function(e){return void 0===t&&(t=new h),t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyMatrix4(t)}}(),unproject:function(){var t;return function(e){return void 0===t&&(t=new h),t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyMatrix4(t)}}(),transformDirection:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t,e;return function(i,n){return void 0===t&&(t=new c,e=new c),t.set(i,i,i),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var i=this.x,n=this.y,r=this.z;return this.x=n*t.z-r*t.y,this.y=r*t.x-i*t.z,this.z=i*t.y-n*t.x,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=n*s-r*o,this.y=r*a-i*s,this.z=i*o-n*a,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t;return function(e){return void 0===t&&(t=new c),t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t;return function(e){return void 0===t&&(t=new c),this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos($o.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromCylindrical:function(t){return this.x=t.radius*Math.sin(t.theta),this.y=t.y,this.z=t.radius*Math.cos(t.theta),this},setFromMatrixPosition:function(t){return this.setFromMatrixColumn(t,3)},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this},setFromMatrixColumn:function(t,e){if("number"==typeof t){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var i=t;t=e,e=i}return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}},h.prototype={constructor:h,isMatrix4:!0,set:function(t,e,i,n,r,a,o,s,c,h,l,u,p,d,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=h,g[10]=l,g[14]=u,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new h).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},copyPosition:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(){var t;return function(e){void 0===t&&(t=new c);var i=this.elements,n=e.elements,r=1/t.setFromMatrixColumn(e,0).length(),a=1/t.setFromMatrixColumn(e,1).length(),o=1/t.setFromMatrixColumn(e,2).length();return i[0]=n[0]*r,i[1]=n[1]*r,i[2]=n[2]*r,i[4]=n[4]*a,i[5]=n[5]*a,i[6]=n[6]*a,i[8]=n[8]*o,i[9]=n[9]*o,i[10]=n[10]*o,this}}(),makeRotationFromEuler:function(t){!1===(t&&t.isEuler)&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,i=t.x,n=t.y,r=t.z,a=Math.cos(i),o=Math.sin(i),s=Math.cos(n),c=Math.sin(n),h=Math.cos(r),l=Math.sin(r);if("XYZ"===t.order){var u=a*h,p=a*l,d=o*h,f=o*l;e[0]=s*h,e[4]=-s*l,e[8]=c,e[1]=p+d*c,e[5]=u-f*c,e[9]=-o*s,e[2]=f-u*c,e[6]=d+p*c,e[10]=a*s}else if("YXZ"===t.order){var m=s*h,g=s*l,v=c*h,y=c*l;e[0]=m+y*o,e[4]=v*o-g,e[8]=a*c,e[1]=a*l,e[5]=a*h,e[9]=-o,e[2]=g*o-v,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){var m=s*h,g=s*l,v=c*h,y=c*l;e[0]=m-y*o,e[4]=-a*l,e[8]=v+g*o,e[1]=g+v*o,e[5]=a*h,e[9]=y-m*o,e[2]=-a*c,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){var u=a*h,p=a*l,d=o*h,f=o*l;e[0]=s*h,e[4]=d*c-p,e[8]=u*c+f,e[1]=s*l,e[5]=f*c+u,e[9]=p*c-d,e[2]=-c,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var x=a*s,_=a*c,b=o*s,w=o*c;e[0]=s*h,e[4]=w-x*l,e[8]=b*l+_,e[1]=l,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=_*l+b,e[10]=x-w*l}else if("XZY"===t.order){var x=a*s,_=a*c,b=o*s,w=o*c;e[0]=s*h,e[4]=-l,e[8]=c*h,e[1]=x*l+w,e[5]=a*h,e[9]=_*l-b,e[2]=b*l-_,e[6]=o*h,e[10]=w*l+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,i=t.x,n=t.y,r=t.z,a=t.w,o=i+i,s=n+n,c=r+r,h=i*o,l=i*s,u=i*c,p=n*s,d=n*c,f=r*c,m=a*o,g=a*s,v=a*c;return e[0]=1-(p+f),e[4]=l-v,e[8]=u+g,e[1]=l+v,e[5]=1-(h+f),e[9]=d-m,e[2]=u-g,e[6]=d+m,e[10]=1-(h+p),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t,e,i;return function(n,r,a){void 0===t&&(t=new c,e=new c,i=new c);var o=this.elements;return i.subVectors(n,r).normalize(),0===i.lengthSq()&&(i.z=1),t.crossVectors(a,i).normalize(),0===t.lengthSq()&&(i.z+=1e-4,t.crossVectors(a,i).normalize()),e.crossVectors(i,t),o[0]=t.x,o[4]=e.x,o[8]=i.x,o[1]=t.y,o[5]=e.y,o[9]=i.y,o[2]=t.z,o[6]=e.z,o[10]=i.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,a=i[0],o=i[4],s=i[8],c=i[12],h=i[1],l=i[5],u=i[9],p=i[13],d=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],_=i[15],b=n[0],w=n[4],M=n[8],E=n[12],T=n[1],S=n[5],A=n[9],L=n[13],R=n[2],P=n[6],C=n[10],I=n[14],U=n[3],N=n[7],D=n[11],O=n[15];return r[0]=a*b+o*T+s*R+c*U,r[4]=a*w+o*S+s*P+c*N,r[8]=a*M+o*A+s*C+c*D,r[12]=a*E+o*L+s*I+c*O,r[1]=h*b+l*T+u*R+p*U,r[5]=h*w+l*S+u*P+p*N,r[9]=h*M+l*A+u*C+p*D,r[13]=h*E+l*L+u*I+p*O,r[2]=d*b+f*T+m*R+g*U,r[6]=d*w+f*S+m*P+g*N,r[10]=d*M+f*A+m*C+g*D,r[14]=d*E+f*L+m*I+g*O,r[3]=v*b+y*T+x*R+_*U,r[7]=v*w+y*S+x*P+_*N,r[11]=v*M+y*A+x*C+_*D,r[15]=v*E+y*L+x*I+_*O,this},multiplyToArray:function(t,e,i){var n=this.elements;return this.multiplyMatrices(t,e),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[7]=n[7],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[11]=n[11],i[12]=n[12],i[13]=n[13],i[14]=n[14],i[15]=n[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t;return function(e){void 0===t&&(t=new c);for(var i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.applyMatrix4(this),e.setXYZ(i,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],a=t[1],o=t[5],s=t[9],c=t[13],h=t[2],l=t[6],u=t[10],p=t[14];return t[3]*(+r*s*l-n*c*l-r*o*u+i*c*u+n*o*p-i*s*p)+t[7]*(+e*s*p-e*c*u+r*a*u-n*a*p+n*c*h-r*s*h)+t[11]*(+e*c*l-e*o*p-r*a*l+i*a*p+r*o*h-i*c*h)+t[15]*(-n*o*h-e*s*l+e*o*u+n*a*l-i*a*u+i*s*h)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var i=this.elements,n=t.elements,r=n[0],a=n[1],o=n[2],s=n[3],c=n[4],h=n[5],l=n[6],u=n[7],p=n[8],d=n[9],f=n[10],m=n[11],g=n[12],v=n[13],y=n[14],x=n[15],_=d*y*u-v*f*u+v*l*m-h*y*m-d*l*x+h*f*x,b=g*f*u-p*y*u-g*l*m+c*y*m+p*l*x-c*f*x,w=p*v*u-g*d*u+g*h*m-c*v*m-p*h*x+c*d*x,M=g*d*l-p*v*l-g*h*f+c*v*f+p*h*y-c*d*y,E=r*_+a*b+o*w+s*M;if(0===E){var T="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(!0===e)throw new Error(T);return console.warn(T),this.identity()}var S=1/E;return i[0]=_*S,i[1]=(v*f*s-d*y*s-v*o*m+a*y*m+d*o*x-a*f*x)*S,i[2]=(h*y*s-v*l*s+v*o*u-a*y*u-h*o*x+a*l*x)*S,i[3]=(d*l*s-h*f*s-d*o*u+a*f*u+h*o*m-a*l*m)*S,i[4]=b*S,i[5]=(p*y*s-g*f*s+g*o*m-r*y*m-p*o*x+r*f*x)*S,i[6]=(g*l*s-c*y*s-g*o*u+r*y*u+c*o*x-r*l*x)*S,i[7]=(c*f*s-p*l*s+p*o*u-r*f*u-c*o*m+r*l*m)*S,i[8]=w*S,i[9]=(g*d*s-p*v*s-g*a*m+r*v*m+p*a*x-r*d*x)*S,i[10]=(c*v*s-g*h*s+g*a*u-r*v*u-c*a*x+r*h*x)*S,i[11]=(p*h*s-c*d*s-p*a*u+r*d*u+c*a*m-r*h*m)*S,i[12]=M*S,i[13]=(p*v*o-g*d*o+g*a*f-r*v*f-p*a*y+r*d*y)*S,i[14]=(g*h*o-c*v*o-g*a*l+r*v*l+c*a*y-r*h*y)*S,i[15]=(c*d*o-p*h*o+p*a*l-r*d*l-c*a*f+r*h*f)*S,this},scale:function(t){var e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,a=t.x,o=t.y,s=t.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-n*s,c*s+n*o,0,c*o+n*s,h*o+i,h*s-n*a,0,c*s-n*o,h*s+n*a,r*s*s+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,i){return this.makeRotationFromQuaternion(e),this.scale(i),this.setPosition(t),this},decompose:function(){var t,e;return function(i,n,r){void 0===t&&(t=new c,e=new h);var a=this.elements,o=t.set(a[0],a[1],a[2]).length(),s=t.set(a[4],a[5],a[6]).length(),l=t.set(a[8],a[9],a[10]).length();this.determinant()<0&&(o=-o),i.x=a[12],i.y=a[13],i.z=a[14],e.elements.set(this.elements);var u=1/o,p=1/s,d=1/l;return e.elements[0]*=u,e.elements[1]*=u,e.elements[2]*=u,e.elements[4]*=p,e.elements[5]*=p,e.elements[6]*=p,e.elements[8]*=d,e.elements[9]*=d,e.elements[10]*=d,n.setFromRotationMatrix(e),r.x=o,r.y=s,r.z=l,this}}(),makePerspective:function(t,e,i,n,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*r/(e-t),c=2*r/(i-n),h=(e+t)/(e-t),l=(i+n)/(i-n),u=-(a+r)/(a-r),p=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(t,e,i,n,r,a){var o=this.elements,s=1/(e-t),c=1/(i-n),h=1/(a-r),l=(e+t)*s,u=(i+n)*c,p=(a+r)*h;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,i=t.elements,n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}},l.prototype=Object.create(n.prototype),l.prototype.constructor=l,l.prototype.isCubeTexture=!0,Object.defineProperty(l.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var es=new n,is=new l,ns=[],rs=[];H.prototype.setValue=function(t,e){for(var i=this.seq,n=0,r=i.length;n!==r;++n){var a=i[n];a.setValue(t,e[a.id])}};var as=/([\w\d_]+)(\])?(\[|\.)?/g;j.prototype.setValue=function(t,e,i){var n=this.map[e];void 0!==n&&n.setValue(t,i,this.renderer)},j.prototype.set=function(t,e,i){var n=this.map[i];void 0!==n&&n.setValue(t,e[i],this.renderer)},j.prototype.setOptional=function(t,e,i){var n=e[i];void 0!==n&&this.setValue(t,i,n)},j.upload=function(t,e,i,n){for(var r=0,a=e.length;r!==a;++r){var o=e[r],s=i[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,n)}},j.seqWithValue=function(t,e){for(var i=[],n=0,r=t.length;n!==r;++n){var a=t[n];a.id in e&&i.push(a)}return i};var os={merge:function(t){for(var e={},i=0;i<t.length;i++){var n=this.clone(t[i]);for(var r in n)e[r]=n[r]}return e},clone:function(t){var e={};for(var i in t){e[i]={};for(var n in t[i]){var r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}},ss={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",
109
+ bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 ltcTextureCoords( const in GeometricContext geometry, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = (LUT_SIZE - 1.0)/LUT_SIZE;\n\tconst float LUT_BIAS = 0.5/LUT_SIZE;\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nvoid clipQuadToHorizon( inout vec3 L[5], out int n ) {\n\tint config = 0;\n\tif ( L[0].z > 0.0 ) config += 1;\n\tif ( L[1].z > 0.0 ) config += 2;\n\tif ( L[2].z > 0.0 ) config += 4;\n\tif ( L[3].z > 0.0 ) config += 8;\n\tn = 0;\n\tif ( config == 0 ) {\n\t} else if ( config == 1 ) {\n\t\tn = 3;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 2 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 3 ) {\n\t\tn = 4;\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t\tL[3] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 4 ) {\n\t\tn = 3;\n\t\tL[0] = -L[3].z * L[2] + L[2].z * L[3];\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t} else if ( config == 5 ) {\n\t\tn = 0;\n\t} else if ( config == 6 ) {\n\t\tn = 4;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 7 ) {\n\t\tn = 5;\n\t\tL[4] = -L[3].z * L[0] + L[0].z * L[3];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 8 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[1] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = L[3];\n\t} else if ( config == 9 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[2].z * L[3] + L[3].z * L[2];\n\t} else if ( config == 10 ) {\n\t\tn = 0;\n\t} else if ( config == 11 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 12 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t} else if ( config == 13 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = L[2];\n\t\tL[2] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t} else if ( config == 14 ) {\n\t\tn = 5;\n\t\tL[4] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t} else if ( config == 15 ) {\n\t\tn = 4;\n\t}\n\tif ( n == 3 )\n\t\tL[3] = L[0];\n\tif ( n == 4 )\n\t\tL[4] = L[0];\n}\nfloat integrateLtcBrdfOverRectEdge( vec3 v1, vec3 v2 ) {\n\tfloat cosTheta = dot( v1, v2 );\n\tfloat theta = acos( cosTheta );\n\tfloat res = cross( v1, v2 ).z * ( ( theta > 0.001 ) ? theta / sin( theta ) : 1.0 );\n\treturn res;\n}\nvoid initRectPoints( const in vec3 pos, const in vec3 halfWidth, const in vec3 halfHeight, out vec3 rectPoints[4] ) {\n\trectPoints[0] = pos - halfWidth - halfHeight;\n\trectPoints[1] = pos + halfWidth - halfHeight;\n\trectPoints[2] = pos + halfWidth + halfHeight;\n\trectPoints[3] = pos - halfWidth + halfHeight;\n}\nvec3 integrateLtcBrdfOverRect( const in GeometricContext geometry, const in mat3 brdfMat, const in vec3 rectPoints[4] ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot( V, N ));\n\tT2 = - cross( N, T1 );\n\tmat3 brdfWrtSurface = brdfMat * transpose( mat3( T1, T2, N ) );\n\tvec3 clippedRect[5];\n\tclippedRect[0] = brdfWrtSurface * ( rectPoints[0] - P );\n\tclippedRect[1] = brdfWrtSurface * ( rectPoints[1] - P );\n\tclippedRect[2] = brdfWrtSurface * ( rectPoints[2] - P );\n\tclippedRect[3] = brdfWrtSurface * ( rectPoints[3] - P );\n\tint n;\n\tclipQuadToHorizon(clippedRect, n);\n\tif ( n == 0 )\n\t\treturn vec3( 0, 0, 0 );\n\tclippedRect[0] = normalize( clippedRect[0] );\n\tclippedRect[1] = normalize( clippedRect[1] );\n\tclippedRect[2] = normalize( clippedRect[2] );\n\tclippedRect[3] = normalize( clippedRect[3] );\n\tclippedRect[4] = normalize( clippedRect[4] );\n\tfloat sum = 0.0;\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[0], clippedRect[1] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[1], clippedRect[2] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[2], clippedRect[3] );\n\tif (n >= 4)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[3], clippedRect[4] );\n\tif (n == 5)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[4], clippedRect[0] );\n\tsum = max( 0.0, sum );\n\tvec3 Lo_i = vec3( sum, sum, sum );\n\treturn Lo_i;\n}\nvec3 Rect_Area_Light_Specular_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight,\n\t\tconst in float roughness,\n\t\tconst in sampler2D ltcMat, const in sampler2D ltcMag ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tvec2 uv = ltcTextureCoords( geometry, roughness );\n\tvec4 brdfLtcApproxParams, t;\n\tbrdfLtcApproxParams = texture2D( ltcMat, uv );\n\tt = texture2D( ltcMat, uv );\n\tfloat brdfLtcScalar = texture2D( ltcMag, uv ).a;\n\tmat3 brdfLtcApproxMat = mat3(\n\t\tvec3( 1, 0, t.y ),\n\t\tvec3( 0, t.z, 0 ),\n\t\tvec3( t.w, 0, t.x )\n\t);\n\tvec3 specularReflectance = integrateLtcBrdfOverRect( geometry, brdfLtcApproxMat, rectPoints );\n\tspecularReflectance *= brdfLtcScalar;\n\treturn specularReflectance;\n}\nvec3 Rect_Area_Light_Diffuse_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tmat3 diffuseBrdfMat = mat3(1);\n\tvec3 diffuseReflectance = integrateLtcBrdfOverRect( geometry, diffuseBrdfMat, rectPoints );\n\treturn diffuseReflectance;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
110
+ lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 matDiffColor = material.diffuseColor;\n\t\tvec3 matSpecColor = material.specularColor;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = BlinnExponentToGGXRoughness( material.specularShininess );\n\t\tvec3 spec = Rect_Area_Light_Specular_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n\t\t\t\troughness,\n\t\t\t\tltcMat, ltcMag );\n\t\tvec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n\t\treflectedLight.directSpecular += lightColor * matSpecColor * spec / PI2;\n\t\treflectedLight.directDiffuse += lightColor * matDiffColor * diff / PI2;\n\t}\n#endif\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 matDiffColor = material.diffuseColor;\n\t\tvec3 matSpecColor = material.specularColor;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 spec = Rect_Area_Light_Specular_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n\t\t\t\troughness,\n\t\t\t\tltcMat, ltcMag );\n\t\tvec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n\t\t\t\tgeometry,\n\t\t\t\trectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n\t\treflectedLight.directSpecular += lightColor * matSpecColor * spec;\n\t\treflectedLight.directDiffuse += lightColor * matDiffColor * diff;\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_flip:"#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
111
+ shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",distanceRGBA_vert:"varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n",shadow_vert:"#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n"};W.prototype={constructor:W,isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(){function t(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}return function(e,i,n){if(e=$o.euclideanModulo(e,1),i=$o.clamp(i,0,1),n=$o.clamp(n,0,1),0===i)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+i):n+i-n*i,a=2*n-r;this.r=t(a,r,e+1/3),this.g=t(a,r,e),this.b=t(a,r,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,r=i[1],a=i[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,c=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(o,s,c)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){var h=i[1],l=h.length;if(3===l)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}if(t&&t.length>0){var h=cs[t];void 0!==h?this.setHex(h):console.warn("THREE.Color: Unknown color "+t)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(){var t=this.r,e=this.g,i=this.b;return this.r=t*t,this.g=e*e,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){var e,i,n=t||{h:0,s:0,l:0},r=this.r,a=this.g,o=this.b,s=Math.max(r,a,o),c=Math.min(r,a,o),h=(c+s)/2;if(c===s)e=0,i=0;else{var l=s-c;switch(i=h<=.5?l/(s+c):l/(2-s-c),s){case r:e=(a-o)/l+(a<o?6:0);break;case a:e=(o-r)/l+2;break;case o:e=(r-a)/l+4}e/=6}return n.h=e,n.s=i,n.l=h,n},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,i){var n=this.getHSL();return n.h+=t,n.s+=e,n.l+=i,this.setHSL(n.h,n.s,n.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}};var cs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,
112
+ gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};X.prototype=Object.create(n.prototype),X.prototype.constructor=X,X.prototype.isDataTexture=!0;var hs={common:{diffuse:{value:new W(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new r(0,0,1,1)},specularMap:{value:null},alphaMap:{value:null},envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new i(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new W(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new W(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new r(0,0,1,1)}}},ls={basic:{uniforms:os.merge([hs.common,hs.aomap,hs.lightmap,hs.fog]),vertexShader:ss.meshbasic_vert,fragmentShader:ss.meshbasic_frag},lambert:{uniforms:os.merge([hs.common,hs.aomap,hs.lightmap,hs.emissivemap,hs.fog,hs.lights,{emissive:{value:new W(0)}}]),vertexShader:ss.meshlambert_vert,fragmentShader:ss.meshlambert_frag},phong:{uniforms:os.merge([hs.common,hs.aomap,hs.lightmap,hs.emissivemap,hs.bumpmap,hs.normalmap,hs.displacementmap,hs.gradientmap,hs.fog,hs.lights,{emissive:{value:new W(0)},specular:{value:new W(1118481)},shininess:{value:30}}]),vertexShader:ss.meshphong_vert,fragmentShader:ss.meshphong_frag},standard:{uniforms:os.merge([hs.common,hs.aomap,hs.lightmap,hs.emissivemap,hs.bumpmap,hs.normalmap,hs.displacementmap,hs.roughnessmap,hs.metalnessmap,hs.fog,hs.lights,{emissive:{value:new W(0)},roughness:{value:.5},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ss.meshphysical_vert,fragmentShader:ss.meshphysical_frag},points:{uniforms:os.merge([hs.points,hs.fog]),vertexShader:ss.points_vert,fragmentShader:ss.points_frag},dashed:{uniforms:os.merge([hs.common,hs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ss.linedashed_vert,fragmentShader:ss.linedashed_frag},depth:{uniforms:os.merge([hs.common,hs.displacementmap]),vertexShader:ss.depth_vert,fragmentShader:ss.depth_frag},normal:{uniforms:os.merge([hs.common,hs.bumpmap,hs.normalmap,hs.displacementmap,{opacity:{value:1}}]),vertexShader:ss.normal_vert,fragmentShader:ss.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ss.cube_vert,fragmentShader:ss.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:ss.equirect_vert,fragmentShader:ss.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new c}},vertexShader:ss.distanceRGBA_vert,fragmentShader:ss.distanceRGBA_frag}};ls.physical={uniforms:os.merge([ls.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ss.meshphysical_vert,fragmentShader:ss.meshphysical_frag},q.prototype={constructor:q,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new i;return function(e,i){var n=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){var e=t||new i;return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new i;return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new i).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return(e||new i).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new i;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}};var us=0;J.prototype={constructor:J,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){!0===t&&this.update(),this._needsUpdate=t},setValues:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0!==i){var n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]="overdraw"===e?Number(i):i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){function e(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}var i=void 0===t;i&&(t={textures:{},images:{}});var n={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==la&&(n.blending=this.blending),this.shading!==aa&&(n.shading=this.shading),this.side!==ea&&(n.side=this.side),this.vertexColors!==oa&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),n.skinning=this.skinning,n.morphTargets=this.morphTargets,i){var r=e(t.textures),a=e(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.shading=t.shading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var r=0;r!==n;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},Object.assign(J.prototype,e.prototype),Q.prototype=Object.create(J.prototype),Q.prototype.constructor=Q,Q.prototype.isShaderMaterial=!0,Q.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=os.clone(t.uniforms),this.defines=t.defines,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},Q.prototype.toJSON=function(t){var e=J.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},K.prototype=Object.create(J.prototype),K.prototype.constructor=K,K.prototype.isMeshDepthMaterial=!0,K.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},$.prototype={constructor:$,isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.length;s<c;s+=3){var h=t[s],l=t[s+1],u=t[s+2];h<e&&(e=h),l<i&&(i=l),u<n&&(n=u),h>r&&(r=h),l>a&&(a=l),u>o&&(o=u)}return this.min.set(e,i,n),this.max.set(r,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.count;s<c;s++){var h=t.getX(s),l=t.getY(s),u=t.getZ(s);h<e&&(e=h),l<i&&(i=l),u<n&&(n=u),h>r&&(r=h),l>a&&(a=l),u>o&&(o=u)}return this.min.set(e,i,n),this.max.set(r,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new c;return function(e,i){var n=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){var e=t||new c;return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new c;return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var t=new c;return function(e){var i=this;return e.updateMatrixWorld(!0),e.traverse(function(e){var n,r,a=e.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(n=0,r=o.length;n<r;n++)t.copy(o[n]),t.applyMatrix4(e.matrixWorld),i.expandByPoint(t)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(n=0,r=s.count;n<r;n++)t.fromBufferAttribute(s,n).applyMatrix4(e.matrixWorld),i.expandByPoint(t)}}),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new c).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t;return function(e){return void 0===t&&(t=new c),this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=t.constant&&i>=t.constant},clampPoint:function(t,e){return(e||new c).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new c;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new c;return function(e){var i=e||new tt;return this.getCenter(i.center),i.radius=.5*this.getSize(t).length(),i}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new c,new c,new c,new c,new c,new c,new c,new c];return function(e){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},tt.prototype={constructor:tt,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t;return function(e,i){void 0===t&&(t=new $);var n=this.center;void 0!==i?n.copy(i):t.setFromPoints(e).getCenter(n);for(var r=0,a=0,o=e.length;a<o;a++)r=Math.max(r,n.distanceToSquared(e[a]));return this.radius=Math.sqrt(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(this.center.dot(t.normal)-t.constant)<=this.radius},clampPoint:function(t,e){var i=this.center.distanceToSquared(t),n=e||new c;return n.copy(t),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){var e=t||new $;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},et.prototype={constructor:et,isMatrix3:!0,set:function(t,e,i,n,r,a,o,s,c){var h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=r,h[5]=s,h[6]=i,h[7]=a,h[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t;return function(e){void 0===t&&(t=new c);for(var i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.applyMatrix3(this),e.setXYZ(i,t.x,t.y,t.z);return e}}(),multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],a=t[4],o=t[5],s=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-i*r*h+i*o*s+n*r*c-n*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var i=t.elements,n=this.elements,r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],h=i[5],l=i[6],u=i[7],p=i[8],d=p*c-h*u,f=h*l-p*s,m=u*s-c*l,g=r*d+a*f+o*m;if(0===g){var v="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return n[0]=d*y,n[1]=(o*u-p*a)*y,n[2]=(h*a-o*c)*y,n[3]=f*y,n[4]=(p*r-o*l)*y,n[5]=(o*s-h*r)*y,n[6]=m*y,n[7]=(a*l-u*r)*y,n[8]=(c*r-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return 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],this},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}},it.prototype={constructor:it,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new c,e=new c;return function(i,n,r){var a=t.subVectors(r,n).cross(e.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(a,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var i=this.distanceToPoint(t);return(e||new c).copy(this.normal).multiplyScalar(i)},intersectLine:function(){var t=new c;return function(e,i){var n=i||new c,r=e.delta(t),a=this.normal.dot(r);if(0!==a){var o=-(e.start.dot(this.normal)+this.constant)/a;if(!(o<0||o>1))return n.copy(r).multiplyScalar(o).add(e.start)}else if(0===this.distanceToPoint(e.start))return n.copy(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return(t||new c).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new c,e=new et;return function(i,n){var r=this.coplanarPoint(t).applyMatrix4(i),a=n||e.getNormalMatrix(i),o=this.normal.applyMatrix3(a).normalize();return this.constant=-r.dot(o),this}}(),translate:function(t){return this.constant=this.constant-t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},nt.prototype={constructor:nt,set:function(t,e,i,n,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,i=t.elements,n=i[0],r=i[1],a=i[2],o=i[3],s=i[4],c=i[5],h=i[6],l=i[7],u=i[8],p=i[9],d=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,l-s,f-u,y-m).normalize(),e[1].setComponents(o+n,l+s,f+u,y+m).normalize(),e[2].setComponents(o+r,l+c,f+p,y+g).normalize(),e[3].setComponents(o-r,l-c,f-p,y-g).normalize(),e[4].setComponents(o-a,l-h,f-d,y-v).normalize(),e[5].setComponents(o+a,l+h,f+d,y+v).normalize(),this},intersectsObject:function(){var t=new tt;return function(e){var i=e.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),t.copy(i.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new tt;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,i=t.center,n=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(i)<n)return!1}return!0},intersectsBox:function(){var t=new c,e=new c;return function(i){for(var n=this.planes,r=0;r<6;r++){var a=n[r];t.x=a.normal.x>0?i.min.x:i.max.x,e.x=a.normal.x>0?i.max.x:i.min.x,t.y=a.normal.y>0?i.min.y:i.max.y,e.y=a.normal.y>0?i.max.y:i.min.y,t.z=a.normal.z>0?i.min.z:i.max.z,e.z=a.normal.z>0?i.max.z:i.min.z;var o=a.distanceToPoint(t),s=a.distanceToPoint(e);if(o<0&&s<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}},at.prototype={constructor:at,set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return(e||new c).copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new c;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var i=e||new c;i.subVectors(t,this.origin);var n=i.dot(this.direction);return n<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new c;return function(e){var i=t.subVectors(e,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(i).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new c,e=new c,i=new c;return function(n,r,a,o){t.copy(n).add(r).multiplyScalar(.5),e.copy(r).sub(n).normalize(),i.copy(this.origin).sub(t);var s,c,h,l,u=.5*n.distanceTo(r),p=-this.direction.dot(e),d=i.dot(this.direction),f=-i.dot(e),m=i.lengthSq(),g=Math.abs(1-p*p);if(g>0)if(s=p*f-d,c=p*d-f,l=u*g,s>=0)if(c>=-l)if(c<=l){var v=1/g;s*=v,c*=v,h=s*(s+p*c+2*d)+c*(p*s+c+2*f)+m}else c=u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*f)+m;else c=-u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*f)+m;else c<=-l?(s=Math.max(0,-(-p*u+d)),c=s>0?-u:Math.min(Math.max(-u,-f),u),h=-s*s+c*(c+2*f)+m):c<=l?(s=0,c=Math.min(Math.max(-u,-f),u),h=c*(c+2*f)+m):(s=Math.max(0,-(p*u+d)),c=s>0?u:Math.min(Math.max(-u,-f),u),h=-s*s+c*(c+2*f)+m);else c=p>0?-u:u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*f)+m;return a&&a.copy(this.direction).multiplyScalar(s).add(this.origin),o&&o.copy(e).multiplyScalar(c).add(t),h}}(),intersectSphere:function(){var t=new c;return function(e,i){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),r=t.dot(t)-n*n,a=e.radius*e.radius;if(r>a)return null;var o=Math.sqrt(a-r),s=n-o,c=n+o;return s<0&&c<0?null:s<0?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var i,n,r,a,o,s,c=1/this.direction.x,h=1/this.direction.y,l=1/this.direction.z,u=this.origin;return c>=0?(i=(t.min.x-u.x)*c,n=(t.max.x-u.x)*c):(i=(t.max.x-u.x)*c,n=(t.min.x-u.x)*c),h>=0?(r=(t.min.y-u.y)*h,a=(t.max.y-u.y)*h):(r=(t.max.y-u.y)*h,a=(t.min.y-u.y)*h),i>a||r>n?null:((r>i||i!==i)&&(i=r),(a<n||n!==n)&&(n=a),l>=0?(o=(t.min.z-u.z)*l,s=(t.max.z-u.z)*l):(o=(t.max.z-u.z)*l,s=(t.min.z-u.z)*l),i>s||o>n?null:((o>i||i!==i)&&(i=o),(s<n||n!==n)&&(n=s),n<0?null:this.at(i>=0?i:n,e)))},intersectsBox:function(){var t=new c;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new c,e=new c,i=new c,n=new c;return function(r,a,o,s,c){e.subVectors(a,r),i.subVectors(o,r),n.crossVectors(e,i);var h,l=this.direction.dot(n);if(l>0){if(s)return null;h=1}else{if(!(l<0))return null;h=-1,l=-l}t.subVectors(this.origin,r);var u=h*this.direction.dot(i.crossVectors(t,i));if(u<0)return null;var p=h*this.direction.dot(e.cross(t));if(p<0)return null;if(u+p>l)return null;var d=-h*t.dot(n);return d<0?null:this.at(d/l,c)}}(),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},ot.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ot.DefaultOrder="XYZ",ot.prototype={constructor:ot,isEuler:!0,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var n=$o.clamp,r=t.elements,a=r[0],o=r[4],s=r[8],c=r[1],h=r[5],l=r[9],u=r[2],p=r[6],d=r[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,h),this._z=0)):"YXZ"===e?(this._x=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===e?(this._x=Math.asin(n(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===e?(this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,h))):"YZX"===e?(this._z=Math.asin(n(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(p,h),
113
+ this._y=Math.atan2(s,a)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(){var t;return function(e,i,n){return void 0===t&&(t=new h),t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,i,n)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new s;return function(e){return t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new c(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},st.prototype={constructor:st,set:function(t){this.mask=1<<t},enable:function(t){this.mask|=1<<t},toggle:function(t){this.mask^=1<<t},disable:function(t){this.mask&=~(1<<t)},test:function(t){return 0!=(this.mask&t.mask)}};var ps=0;ct.DefaultUp=new c(0,1,0),ct.DefaultMatrixAutoUpdate=!0,ct.prototype={constructor:ct,isObject3D:!0,applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new s;return function(e,i){return t.setFromAxisAngle(e,i),this.quaternion.multiply(t),this}}(),rotateX:function(){var t=new c(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new c(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new c(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new c;return function(e,i){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(i)),this}}(),translateX:function(){var t=new c(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new c(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new c(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new h;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new h;return function(e){t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1)for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);var i=this.children.indexOf(t);-1!==i&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(i,1))},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var i=0,n=this.children.length;i<n;i++){var r=this.children[i],a=r.getObjectByProperty(t,e);if(void 0!==a)return a}},getWorldPosition:function(t){var e=t||new c;return this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new c,e=new c;return function(i){var n=i||new s;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,n,e),n}}(),getWorldRotation:function(){var t=new s;return function(e){var i=e||new ot;return this.getWorldQuaternion(t),i.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new c,e=new s;return function(i){var n=i||new c;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,n),n}}(),getWorldDirection:function(){var t=new s;return function(e){var i=e||new c;return this.getWorldQuaternion(t),i.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==t||(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)},toJSON:function(t){function e(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}var i=void 0===t||""===t,n={};i&&(t={geometries:{},materials:{},textures:{},images:{}},n.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var r={};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),r.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===t.geometries[this.geometry.uuid]&&(t.geometries[this.geometry.uuid]=this.geometry.toJSON(t)),r.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===t.materials[this.material.uuid]&&(t.materials[this.material.uuid]=this.material.toJSON(t)),r.material=this.material.uuid),this.children.length>0){r.children=[];for(var a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(t).object)}if(i){var o=e(t.geometries),s=e(t.materials),c=e(t.textures),h=e(t.images);o.length>0&&(n.geometries=o),s.length>0&&(n.materials=s),c.length>0&&(n.textures=c),h.length>0&&(n.images=h)}return n.object=r,n},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var i=0;i<t.children.length;i++){var n=t.children[i];this.add(n.clone())}return this}},Object.assign(ct.prototype,e.prototype),ht.prototype={constructor:ht,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return(t||new c).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new c).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var i=e||new c;return this.delta(i).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new c,e=new c;return function(i,n){t.subVectors(i,this.start),e.subVectors(this.end,this.start);var r=e.dot(e),a=e.dot(t),o=a/r;return n&&(o=$o.clamp(o,0,1)),o}}(),closestPointToPoint:function(t,e,i){var n=this.closestPointToPointParameter(t,e),r=i||new c;return this.delta(r).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}},lt.normal=function(){var t=new c;return function(e,i,n,r){var a=r||new c;a.subVectors(n,i),t.subVectors(e,i),a.cross(t);var o=a.lengthSq();return o>0?a.multiplyScalar(1/Math.sqrt(o)):a.set(0,0,0)}}(),lt.barycoordFromPoint=function(){var t=new c,e=new c,i=new c;return function(n,r,a,o,s){t.subVectors(o,r),e.subVectors(a,r),i.subVectors(n,r);var h=t.dot(t),l=t.dot(e),u=t.dot(i),p=e.dot(e),d=e.dot(i),f=h*p-l*l,m=s||new c;if(0===f)return m.set(-2,-1,-1);var g=1/f,v=(p*u-l*d)*g,y=(h*d-l*u)*g;return m.set(1-v-y,y,v)}}(),lt.containsPoint=function(){var t=new c;return function(e,i,n,r){var a=lt.barycoordFromPoint(e,i,n,r,t);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}(),lt.prototype={constructor:lt,set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new c,e=new c;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){return(t||new c).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return lt.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new it).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return lt.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return lt.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t,e,i,n;return function(r,a){void 0===t&&(t=new it,e=[new ht,new ht,new ht],i=new c,n=new c);var o=a||new c,s=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(r,i),!0===this.containsPoint(i))o.copy(i);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var h=0;h<e.length;h++){e[h].closestPointToPoint(i,!0,n);var l=i.distanceToSquared(n);l<s&&(s=l,o.copy(n))}}return o}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},ut.prototype={constructor:ut,clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(var e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}},pt.prototype=Object.create(J.prototype),pt.prototype.constructor=pt,pt.prototype.isMeshBasicMaterial=!0,pt.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},dt.prototype={constructor:dt,isBufferAttribute:!0,set needsUpdate(t){!0===t&&this.version++},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.itemSize:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),a=new W),e[i++]=a.r,e[i++]=a.g,e[i++]=a.b}return this},copyIndicesArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];e[i++]=a.a,e[i++]=a.b,e[i++]=a.c}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,a=t.length;r<a;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new i),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),a=new c),e[i++]=a.x,e[i++]=a.y,e[i++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,i=0,n=0,a=t.length;n<a;n++){var o=t[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),o=new r),e[i++]=o.x,e[i++]=o.y,e[i++]=o.z,e[i++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},ft.prototype=Object.create(dt.prototype),ft.prototype.constructor=ft,mt.prototype=Object.create(dt.prototype),mt.prototype.constructor=mt,gt.prototype=Object.create(dt.prototype),gt.prototype.constructor=gt,vt.prototype=Object.create(dt.prototype),vt.prototype.constructor=vt,yt.prototype=Object.create(dt.prototype),yt.prototype.constructor=yt,xt.prototype=Object.create(dt.prototype),xt.prototype.constructor=xt,_t.prototype=Object.create(dt.prototype),_t.prototype.constructor=_t,bt.prototype=Object.create(dt.prototype),bt.prototype.constructor=bt,wt.prototype=Object.create(dt.prototype),wt.prototype.constructor=wt,Object.assign(Mt.prototype,{computeGroups:function(t){for(var e,i=[],n=void 0,r=t.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==n&&(n=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,i.push(e)),e={start:3*a,materialIndex:n})}void 0!==e&&(e.count=3*a-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,a=t.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,c=t.morphTargets,h=c.length;if(h>0){e=[];for(var l=0;l<h;l++)e[l]=[];this.morphTargets.position=e}var u,p=t.morphNormals,d=p.length;if(d>0){u=[];for(var l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}for(var f=t.skinIndices,m=t.skinWeights,g=f.length===r.length,v=m.length===r.length,l=0;l<n.length;l++){var y=n[l];this.vertices.push(r[y.a],r[y.b],r[y.c]);var x=y.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var _=y.normal;this.normals.push(_,_,_)}var b=y.vertexColors;if(3===b.length)this.colors.push(b[0],b[1],b[2]);else{var w=y.color;this.colors.push(w,w,w)}if(!0===o){var M=a[0][l];void 0!==M?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new i,new i,new i))}if(!0===s){var M=a[1][l];void 0!==M?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new i,new i,new i))}for(var E=0;E<h;E++){var T=c[E].vertices;e[E].push(T[y.a],T[y.b],T[y.c])}for(var E=0;E<d;E++){var S=p[E].vertexNormals[l];u[E].push(S.a,S.b,S.c)}g&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),v&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var ds=0;St.prototype={constructor:St,isGeometry:!0,applyMatrix:function(t){for(var e=(new et).getNormalMatrix(t),i=0,n=this.vertices.length;i<n;i++){this.vertices[i].applyMatrix4(t)}for(var i=0,n=this.faces.length;i<n;i++){var r=this.faces[i];r.normal.applyMatrix3(e).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t;return function(e){return void 0===t&&(t=new h),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new h),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new h),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,i,n){return void 0===t&&(t=new h),t.makeTranslation(e,i,n),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,i,n){return void 0===t&&(t=new h),t.makeScale(e,i,n),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new ct),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,i,r){var a=void 0!==s?[p[t].clone(),p[e].clone(),p[i].clone()]:[],o=void 0!==h?[n.colors[t].clone(),n.colors[e].clone(),n.colors[i].clone()]:[],c=new ut(t,e,i,a,o,r);n.faces.push(c),void 0!==l&&n.faceVertexUvs[0].push([d[t].clone(),d[e].clone(),d[i].clone()]),void 0!==u&&n.faceVertexUvs[1].push([f[t].clone(),f[e].clone(),f[i].clone()])}var n=this,r=null!==t.index?t.index.array:void 0,a=t.attributes,o=a.position.array,s=void 0!==a.normal?a.normal.array:void 0,h=void 0!==a.color?a.color.array:void 0,l=void 0!==a.uv?a.uv.array:void 0,u=void 0!==a.uv2?a.uv2.array:void 0;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var p=[],d=[],f=[],m=0,g=0;m<o.length;m+=3,g+=2)n.vertices.push(new c(o[m],o[m+1],o[m+2])),void 0!==s&&p.push(new c(s[m],s[m+1],s[m+2])),void 0!==h&&n.colors.push(new W(h[m],h[m+1],h[m+2])),void 0!==l&&d.push(new i(l[g],l[g+1])),void 0!==u&&f.push(new i(u[g],u[g+1]));if(void 0!==r){var v=t.groups;if(v.length>0)for(var m=0;m<v.length;m++)for(var y=v[m],x=y.start,_=y.count,g=x,b=x+_;g<b;g+=3)e(r[g],r[g+1],r[g+2],y.materialIndex);else for(var m=0;m<r.length;m+=3)e(r[m],r[m+1],r[m+2])}else for(var m=0;m<o.length/3;m+=3)e(m,m+1,m+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,n=new h;return n.set(i,0,0,-i*t.x,0,i,0,-i*t.y,0,0,i,-i*t.z,0,0,0,1),this.applyMatrix(n),this},computeFaceNormals:function(){for(var t=new c,e=new c,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);var e,i,n,r,a,o;for(o=new Array(this.vertices.length),e=0,i=this.vertices.length;e<i;e++)o[e]=new c;if(t){var s,h,l,u=new c,p=new c;for(n=0,r=this.faces.length;n<r;n++)a=this.faces[n],s=this.vertices[a.a],h=this.vertices[a.b],l=this.vertices[a.c],u.subVectors(l,h),p.subVectors(s,h),u.cross(p),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),n=0,r=this.faces.length;n<r;n++)a=this.faces[n],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,i=this.vertices.length;e<i;e++)o[e].normalize();for(n=0,r=this.faces.length;n<r;n++){a=this.faces[n];var d=a.vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,i;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){i=this.faces[t];var n=i.vertexNormals;3===n.length?(n[0].copy(i.normal),n[1].copy(i.normal),n[2].copy(i.normal)):(n[0]=i.normal.clone(),n[1]=i.normal.clone(),n[2]=i.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,n,r;for(i=0,n=this.faces.length;i<n;i++)for(r=this.faces[i],r.__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var a=new St;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o,s,h=this.morphNormals[t].faceNormals,l=this.morphNormals[t].vertexNormals;for(i=0,n=this.faces.length;i<n;i++)o=new c,s={a:new c,b:new c,c:new c},h.push(o),l.push(s)}var u=this.morphNormals[t];a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals();var o,s;for(i=0,n=this.faces.length;i<n;i++)r=this.faces[i],o=u.faceNormals[i],s=u.vertexNormals[i],o.copy(r.normal),s.a.copy(r.vertexNormals[0]),s.b.copy(r.vertexNormals[1]),s.c.copy(r.vertexNormals[2])}for(i=0,n=this.faces.length;i<n;i++)r=this.faces[i],r.normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeLineDistances:function(){for(var t=0,e=this.vertices,i=0,n=e.length;i<n;i++)i>0&&(t+=e[i].distanceTo(e[i-1])),this.lineDistances[i]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new $),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new tt),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(!1===(t&&t.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var n,r=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,c=t.faces,h=this.faceVertexUvs[0],l=t.faceVertexUvs[0],u=this.colors,p=t.colors;void 0===i&&(i=0),void 0!==e&&(n=(new et).getNormalMatrix(e));for(var d=0,f=o.length;d<f;d++){var m=o[d],g=m.clone();void 0!==e&&g.applyMatrix4(e),a.push(g)}for(var d=0,f=p.length;d<f;d++)u.push(p[d].clone());for(d=0,f=c.length;d<f;d++){var v,y,x,_=c[d],b=_.vertexNormals,w=_.vertexColors;v=new ut(_.a+r,_.b+r,_.c+r),v.normal.copy(_.normal),void 0!==n&&v.normal.applyMatrix3(n).normalize();for(var M=0,E=b.length;M<E;M++)y=b[M].clone(),void 0!==n&&y.applyMatrix3(n).normalize(),v.vertexNormals.push(y);v.color.copy(_.color);for(var M=0,E=w.length;M<E;M++)x=w[M],v.vertexColors.push(x.clone());v.materialIndex=_.materialIndex+i,s.push(v)}for(d=0,f=l.length;d<f;d++){var T=l[d],S=[];if(void 0!==T){for(var M=0,E=T.length;M<E;M++)S.push(T[M].clone());h.push(S)}}},mergeMesh:function(t){if(!1===(t&&t.isMesh))return void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t);t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)},mergeVertices:function(){var t,e,i,n,r,a,o,s,c={},h=[],l=[],u=Math.pow(10,4);for(i=0,n=this.vertices.length;i<n;i++)t=this.vertices[i],e=Math.round(t.x*u)+"_"+Math.round(t.y*u)+"_"+Math.round(t.z*u),void 0===c[e]?(c[e]=i,h.push(this.vertices[i]),l[i]=h.length-1):l[i]=l[c[e]];var p=[];for(i=0,n=this.faces.length;i<n;i++){r=this.faces[i],r.a=l[r.a],r.b=l[r.b],r.c=l[r.c],a=[r.a,r.b,r.c];for(var d=0;d<3;d++)if(a[d]===a[(d+1)%3]){p.push(i);break}}for(i=p.length-1;i>=0;i--){var f=p[i];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-h.length;return this.vertices=h,m},sortFacesByMaterialIndex:function(){function t(t,e){return t.materialIndex-e.materialIndex}for(var e=this.faces,i=e.length,n=0;n<i;n++)e[n]._id=n;e.sort(t);var r,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===i&&(r=[]),s&&s.length===i&&(a=[]);for(var n=0;n<i;n++){var c=e[n]._id;r&&r.push(o[c]),a&&a.push(s[c])}r&&(this.faceVertexUvs[0]=r),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){function t(t,e,i){return i?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==p[e]?p[e]:(p[e]=u.length/3,u.push(t.x,t.y,t.z),p[e])}function i(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==f[e]?f[e]:(f[e]=d.length,d.push(t.getHex()),f[e])}function n(t){var e=t.x.toString()+t.y.toString();return void 0!==g[e]?g[e]:(g[e]=m.length/2,m.push(t.x,t.y),g[e])}var r={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(r[o]=a[o]);return r}for(var s=[],c=0;c<this.vertices.length;c++){var h=this.vertices[c];s.push(h.x,h.y,h.z)}for(var l=[],u=[],p={},d=[],f={},m=[],g={},c=0;c<this.faces.length;c++){var v=this.faces[c],y=void 0!==this.faceVertexUvs[0][c],x=v.normal.length()>0,_=v.vertexNormals.length>0,b=1!==v.color.r||1!==v.color.g||1!==v.color.b,w=v.vertexColors.length>0,M=0;if(M=t(M,0,0),M=t(M,1,!0),M=t(M,2,!1),M=t(M,3,y),M=t(M,4,x),M=t(M,5,_),M=t(M,6,b),M=t(M,7,w),l.push(M),l.push(v.a,v.b,v.c),l.push(v.materialIndex),y){var E=this.faceVertexUvs[0][c];l.push(n(E[0]),n(E[1]),n(E[2]))}if(x&&l.push(e(v.normal)),_){var T=v.vertexNormals;l.push(e(T[0]),e(T[1]),e(T[2]))}if(b&&l.push(i(v.color)),w){var S=v.vertexColors;l.push(i(S[0]),i(S[1]),i(S[2]))}}return r.data={},r.data.vertices=s,r.data.normals=u,d.length>0&&(r.data.colors=d),m.length>0&&(r.data.uvs=[m]),r.data.faces=l,r},clone:function(){return(new St).copy(this)},copy:function(t){var e,i,n,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,i=s.length;e<i;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,i=c.length;e<i;e++)this.colors.push(c[e].clone());var h=t.faces;for(e=0,i=h.length;e<i;e++)this.faces.push(h[e].clone());for(e=0,i=t.faceVertexUvs.length;e<i;e++){var l=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),n=0,r=l.length;n<r;n++){var u=l[n],p=[];for(a=0,o=u.length;a<o;a++){var d=u[a];p.push(d.clone())}this.faceVertexUvs[e].push(p)}}var f=t.morphTargets;for(e=0,i=f.length;e<i;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],n=0,r=f[e].vertices.length;n<r;n++)m.vertices.push(f[e].vertices[n].clone());if(void 0!==f[e].normals)for(m.normals=[],n=0,r=f[e].normals.length;n<r;n++)m.normals.push(f[e].normals[n].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,i=g.length;e<i;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],n=0,r=g[e].vertexNormals.length;n<r;n++){var y=g[e].vertexNormals[n],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],n=0,r=g[e].faceNormals.length;n<r;n++)v.faceNormals.push(g[e].faceNormals[n].clone());this.morphNormals.push(v)}var _=t.skinWeights;for(e=0,i=_.length;e<i;e++)this.skinWeights.push(_[e].clone());var b=t.skinIndices;for(e=0,i=b.length;e<i;e++)this.skinIndices.push(b[e].clone());var w=t.lineDistances;for(e=0,i=w.length;e<i;e++)this.lineDistances.push(w[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=t.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},Object.assign(St.prototype,e.prototype),At.prototype={constructor:At,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Et(t)>65535?_t:yt)(t,1):this.index=t},addAttribute:function(t,e){return!1===(e&&e.isBufferAttribute)&&!1===(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new dt(arguments[1],arguments[2]))):"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(e)):(this.attributes[t]=e,this)},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){(new et).getNormalMatrix(t).applyToBufferAttribute(i),i.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t;return function(e){return void 0===t&&(t=new h),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new h),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new h),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,i,n){return void 0===t&&(t=new h),t.makeTranslation(e,i,n),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,i,n){return void 0===t&&(t=new h),t.makeScale(e,i,n),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new ct),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var i=new bt(3*e.vertices.length,3),n=new bt(3*e.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(e.vertices)),this.addAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new bt(e.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),
114
+ null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e=t.geometry;if(t.isMesh){var i=e.__directGeometry;if(!0===e.elementsNeedUpdate&&(i=void 0,e.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(e);i.verticesNeedUpdate=e.verticesNeedUpdate,i.normalsNeedUpdate=e.normalsNeedUpdate,i.colorsNeedUpdate=e.colorsNeedUpdate,i.uvsNeedUpdate=e.uvsNeedUpdate,i.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=i}var n;return!0===e.verticesNeedUpdate&&(n=this.attributes.position,void 0!==n&&(n.copyVector3sArray(e.vertices),n.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(n=this.attributes.normal,void 0!==n&&(n.copyVector3sArray(e.normals),n.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(n=this.attributes.color,void 0!==n&&(n.copyColorsArray(e.colors),n.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(n=this.attributes.uv,void 0!==n&&(n.copyVector2sArray(e.uvs),n.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(n=this.attributes.lineDistance,void 0!==n&&(n.copyArray(e.lineDistances),n.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Mt).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new dt(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var i=new Float32Array(3*t.normals.length);this.addAttribute("normal",new dt(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new dt(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new dt(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new dt(a,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var o=Et(t.indices)>65535?Uint32Array:Uint16Array,s=new o(3*t.indices.length);this.setIndex(new dt(s,1).copyIndicesArray(t.indices))}this.groups=t.groups;for(var c in t.morphTargets){for(var h=[],l=t.morphTargets[c],u=0,p=l.length;u<p;u++){var d=l[u],f=new bt(3*d.length,3);h.push(f.copyVector3sArray(d))}this.morphAttributes[c]=h}if(t.skinIndices.length>0){var m=new bt(4*t.skinIndices.length,4);this.addAttribute("skinIndex",m.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var g=new bt(4*t.skinWeights.length,4);this.addAttribute("skinWeight",g.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new $);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new $,e=new c;return function(){null===this.boundingSphere&&(this.boundingSphere=new tt);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;t.setFromBufferAttribute(i),t.getCenter(n);for(var r=0,a=0,o=i.count;a<o;a++)e.x=i.getX(a),e.y=i.getY(a),e.z=i.getZ(a),r=Math.max(r,n.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,i=this.groups;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new dt(new Float32Array(n.length),3));else for(var r=e.normal.array,a=0,o=r.length;a<o;a++)r[a]=0;var s,h,l,u=e.normal.array,p=new c,d=new c,f=new c,m=new c,g=new c;if(t){var v=t.array;0===i.length&&this.addGroup(0,v.length);for(var y=0,x=i.length;y<x;++y)for(var _=i[y],b=_.start,w=_.count,a=b,o=b+w;a<o;a+=3)s=3*v[a+0],h=3*v[a+1],l=3*v[a+2],p.fromArray(n,s),d.fromArray(n,h),f.fromArray(n,l),m.subVectors(f,d),g.subVectors(p,d),m.cross(g),u[s]+=m.x,u[s+1]+=m.y,u[s+2]+=m.z,u[h]+=m.x,u[h+1]+=m.y,u[h+2]+=m.z,u[l]+=m.x,u[l+1]+=m.y,u[l+2]+=m.z}else for(var a=0,o=n.length;a<o;a+=9)p.fromArray(n,a),d.fromArray(n,a+3),f.fromArray(n,a+6),m.subVectors(f,d),g.subVectors(p,d),m.cross(g),u[a]=m.x,u[a+1]=m.y,u[a+2]=m.z,u[a+3]=m.x,u[a+4]=m.y,u[a+5]=m.z,u[a+6]=m.x,u[a+7]=m.y,u[a+8]=m.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(!1===(t&&t.isBufferGeometry))return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0);var i=this.attributes;for(var n in i)if(void 0!==t.attributes[n])for(var r=i[n],a=r.array,o=t.attributes[n],s=o.array,c=o.itemSize,h=0,l=c*e;h<s.length;h++,l++)a[l]=s[h];return this},normalizeNormals:function(){for(var t,e,i,n,r=this.attributes.normal.array,a=0,o=r.length;a<o;a+=3)t=r[a],e=r[a+1],i=r[a+2],n=1/Math.sqrt(t*t+e*e+i*i),r[a]*=n,r[a+1]*=n,r[a+2]*=n},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new At,e=this.index.array,i=this.attributes;for(var n in i){for(var r=i[n],a=r.array,o=r.itemSize,s=new a.constructor(e.length*o),c=0,h=0,l=0,u=e.length;l<u;l++){c=e[l]*o;for(var p=0;p<o;p++)s[h++]=a[c++]}t.addAttribute(n,new dt(s,o))}return t},toJSON:function(){var t={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;if(null!==n){var r=Array.prototype.slice.call(n.array);t.data.index={type:n.array.constructor.name,array:r}}var a=this.attributes;for(var i in a){var o=a[i],r=Array.prototype.slice.call(o.array);t.data.attributes[i]={itemSize:o.itemSize,type:o.array.constructor.name,array:r,normalized:o.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new At).copy(this)},copy:function(t){var e,i,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var a=t.attributes;for(e in a){var o=a[e];this.addAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var c=[],h=s[e];for(i=0,n=h.length;i<n;i++)c.push(h[i].clone());this.morphAttributes[e]=c}var l=t.groups;for(i=0,n=l.length;i<n;i++){var u=l[i];this.addGroup(u.start,u.count,u.materialIndex)}var p=t.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},At.MaxIndex=65535,Object.assign(At.prototype,e.prototype),Lt.prototype=Object.assign(Object.create(ct.prototype),{constructor:Lt,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return ct.prototype.copy.call(this,t),this.drawMode=t.drawMode,this},updateMorphTargets:function(){var t=this.geometry.morphTargets;if(void 0!==t&&t.length>0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,i=t.length;e<i;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[t[e].name]=e}},raycast:function(){function t(t,e,i,n,r,a,o){return lt.barycoordFromPoint(t,e,i,n,y),r.multiplyScalar(y.x),a.multiplyScalar(y.y),o.multiplyScalar(y.z),r.add(a).add(o),r.clone()}function e(t,e,i,n,r,a,o){var s=t.material;if(null===(s.side===ia?i.intersectTriangle(a,r,n,!0,o):i.intersectTriangle(n,r,a,s.side!==na,o)))return null;_.copy(o),_.applyMatrix4(t.matrixWorld);var c=e.ray.origin.distanceTo(_);return c<e.near||c>e.far?null:{distance:c,point:_.clone(),object:t}}function n(i,n,r,a,o,c,h,p){s.fromBufferAttribute(a,c),l.fromBufferAttribute(a,h),u.fromBufferAttribute(a,p);var d=e(i,n,r,s,l,u,x);return d&&(o&&(m.fromBufferAttribute(o,c),g.fromBufferAttribute(o,h),v.fromBufferAttribute(o,p),d.uv=t(x,s,l,u,m,g,v)),d.face=new ut(c,h,p,lt.normal(s,l,u)),d.faceIndex=c),d}var r=new h,a=new at,o=new tt,s=new c,l=new c,u=new c,p=new c,d=new c,f=new c,m=new i,g=new i,v=new i,y=new c,x=new c,_=new c;return function(i,c){var h=this.geometry,y=this.material,_=this.matrixWorld;if(void 0!==y&&(null===h.boundingSphere&&h.computeBoundingSphere(),o.copy(h.boundingSphere),o.applyMatrix4(_),!1!==i.ray.intersectsSphere(o)&&(r.getInverse(_),a.copy(i.ray).applyMatrix4(r),null===h.boundingBox||!1!==a.intersectsBox(h.boundingBox)))){var b;if(h.isBufferGeometry){var w,M,E,T,S,A=h.index,L=h.attributes.position,R=h.attributes.uv;if(null!==A)for(T=0,S=A.count;T<S;T+=3)w=A.getX(T),M=A.getX(T+1),E=A.getX(T+2),(b=n(this,i,a,L,R,w,M,E))&&(b.faceIndex=Math.floor(T/3),c.push(b));else for(T=0,S=L.count;T<S;T+=3)w=T,M=T+1,E=T+2,(b=n(this,i,a,L,R,w,M,E))&&(b.index=w,c.push(b))}else if(h.isGeometry){var P,C,I,U,N=y&&y.isMultiMaterial,D=!0===N?y.materials:null,O=h.vertices,B=h.faces,F=h.faceVertexUvs[0];F.length>0&&(U=F);for(var z=0,G=B.length;z<G;z++){var H=B[z],V=!0===N?D[H.materialIndex]:y;if(void 0!==V){if(P=O[H.a],C=O[H.b],I=O[H.c],!0===V.morphTargets){var k=h.morphTargets,j=this.morphTargetInfluences;s.set(0,0,0),l.set(0,0,0),u.set(0,0,0);for(var W=0,X=k.length;W<X;W++){var q=j[W];if(0!==q){var Y=k[W].vertices;s.addScaledVector(p.subVectors(Y[H.a],P),q),l.addScaledVector(d.subVectors(Y[H.b],C),q),u.addScaledVector(f.subVectors(Y[H.c],I),q)}}s.add(P),l.add(C),u.add(I),P=s,C=l,I=u}if(b=e(this,i,a,P,C,I,x)){if(U){var Z=U[z];m.copy(Z[0]),g.copy(Z[1]),v.copy(Z[2]),b.uv=t(x,P,C,I,m,g,v)}b.face=H,b.faceIndex=z,c.push(b)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Rt.prototype=Object.create(St.prototype),Rt.prototype.constructor=Rt,Pt.prototype=Object.create(At.prototype),Pt.prototype.constructor=Pt,Ct.prototype=Object.create(St.prototype),Ct.prototype.constructor=Ct,It.prototype=Object.create(At.prototype),It.prototype.constructor=It,Ut.prototype=Object.create(ct.prototype),Ut.prototype.constructor=Ut,Ut.prototype.isCamera=!0,Ut.prototype.getWorldDirection=function(){var t=new s;return function(e){var i=e||new c;return this.getWorldQuaternion(t),i.set(0,0,-1).applyQuaternion(t)}}(),Ut.prototype.lookAt=function(){var t=new h;return function(e){t.lookAt(this.position,e,this.up),this.quaternion.setFromRotationMatrix(t)}}(),Ut.prototype.clone=function(){return(new this.constructor).copy(this)},Ut.prototype.copy=function(t){return ct.prototype.copy.call(this,t),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},Nt.prototype=Object.assign(Object.create(Ut.prototype),{constructor:Nt,isPerspectiveCamera:!0,copy:function(t){return Ut.prototype.copy.call(this,t),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*$o.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*$o.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*$o.RAD2DEG*Math.atan(Math.tan(.5*$o.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,a){this.aspect=t/e,this.view={fullWidth:t,fullHeight:e,offsetX:i,offsetY:n,width:r,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*$o.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,a=this.view;if(null!==a){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*n/o,e-=a.offsetY*i/s,n*=a.width/o,i*=a.height/s}var c=this.filmOffset;0!==c&&(r+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far)},toJSON:function(t){var e=ct.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),Dt.prototype=Object.assign(Object.create(Ut.prototype),{constructor:Dt,isOrthographicCamera:!0,copy:function(t){return Ut.prototype.copy.call(this,t),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,n,r,a){this.view={fullWidth:t,fullHeight:e,offsetX:i,offsetY:n,width:r,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-t,a=i+t,o=n+e,s=n-e;if(null!==this.view){var c=this.zoom/(this.view.width/this.view.fullWidth),h=this.zoom/(this.view.height/this.view.fullHeight),l=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;r+=l*(this.view.offsetX/c),a=r+l*(this.view.width/c),o-=u*(this.view.offsetY/h),s=o-u*(this.view.height/h)}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far)},toJSON:function(t){var e=ct.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}});var fs=0;he.prototype.isFogExp2=!0,he.prototype.clone=function(){return new he(this.color.getHex(),this.density)},he.prototype.toJSON=function(t){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},le.prototype.isFog=!0,le.prototype.clone=function(){return new le(this.color.getHex(),this.near,this.far)},le.prototype.toJSON=function(t){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},ue.prototype=Object.create(ct.prototype),ue.prototype.constructor=ue,ue.prototype.copy=function(t,e){return ct.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},ue.prototype.toJSON=function(t){var e=ct.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},pe.prototype=Object.assign(Object.create(ct.prototype),{constructor:pe,isLensFlare:!0,copy:function(t){ct.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,i=t.lensFlares.length;e<i;e++)this.lensFlares.push(t.lensFlares[e]);return this},add:function(t,e,i,n,r,a){void 0===e&&(e=-1),void 0===i&&(i=0),void 0===a&&(a=1),void 0===r&&(r=new W(16777215)),void 0===n&&(n=la),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:t,size:e,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:r,blending:n})},updateLensFlares:function(){var t,e,i=this.lensFlares.length,n=2*-this.positionScreen.x,r=2*-this.positionScreen.y;for(t=0;t<i;t++)e=this.lensFlares[t],e.x=this.positionScreen.x+n*e.distance,e.y=this.positionScreen.y+r*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)}}),de.prototype=Object.create(J.prototype),de.prototype.constructor=de,de.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this},fe.prototype=Object.assign(Object.create(ct.prototype),{constructor:fe,isSprite:!0,raycast:function(){var t=new c;return function(e,i){t.setFromMatrixPosition(this.matrixWorld);var n=e.ray.distanceSqToPoint(t);n>this.scale.x*this.scale.y/4||i.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),me.prototype=Object.assign(Object.create(ct.prototype),{constructor:me,copy:function(t){ct.prototype.copy.call(this,t,!1);for(var e=t.levels,i=0,n=e.length;i<n;i++){var r=e[i];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var i=this.levels,n=0;n<i.length&&!(e<i[n].distance);n++);i.splice(n,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object},raycast:function(){var t=new c;return function(e,i){t.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(t);this.getObjectForDistance(n).raycast(e,i)}}(),update:function(){var t=new c,e=new c;return function(i){var n=this.levels;if(n.length>1){t.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);n[0].object.visible=!0;for(var a=1,o=n.length;a<o&&r>=n[a].distance;a++)n[a-1].object.visible=!1,n[a].object.visible=!0;for(;a<o;a++)n[a].object.visible=!1}}}(),toJSON:function(t){var e=ct.prototype.toJSON.call(this,t);e.object.levels=[];for(var i=this.levels,n=0,r=i.length;n<r;n++){var a=i[n];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),Object.assign(ge.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var i=new h;this.bones[t]&&i.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(i)}},pose:function(){for(var t,e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(var e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){var t=new h;return function(){for(var e=0,i=this.bones.length;e<i;e++){var n=this.bones[e]?this.bones[e].matrixWorld:this.identityMatrix;t.multiplyMatrices(n,this.boneInverses[e]),t.toArray(this.boneMatrices,16*e)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),clone:function(){return new ge(this.bones,this.boneInverses,this.useVertexTexture)}}),ve.prototype=Object.assign(Object.create(ct.prototype),{constructor:ve,isBone:!0}),ye.prototype=Object.assign(Object.create(Lt.prototype),{constructor:ye,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){if(this.geometry&&this.geometry.isGeometry)for(var t=0;t<this.geometry.skinWeights.length;t++){var e=this.geometry.skinWeights[t],i=1/e.lengthManhattan();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry)for(var n=new r,a=this.geometry.attributes.skinWeight,t=0;t<a.count;t++){n.x=a.getX(t),n.y=a.getY(t),n.z=a.getZ(t),n.w=a.getW(t);var i=1/n.lengthManhattan();i!==1/0?n.multiplyScalar(i):n.set(1,0,0,0),a.setXYZW(t,n.x,n.y,n.z,n.w)}},updateMatrixWorld:function(t){Lt.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material,this.skeleton.useVertexTexture).copy(this)}}),xe.prototype=Object.create(J.prototype),xe.prototype.constructor=xe,xe.prototype.isLineBasicMaterial=!0,xe.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},_e.prototype=Object.assign(Object.create(ct.prototype),{constructor:_e,isLine:!0,raycast:function(){var t=new h,e=new at,i=new tt;return function(n,r){var a=n.linePrecision,o=a*a,s=this.geometry,h=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(h),!1!==n.ray.intersectsSphere(i)){t.getInverse(h),e.copy(n.ray).applyMatrix4(t);var l=new c,u=new c,p=new c,d=new c,f=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var m=s.index,g=s.attributes,v=g.position.array;if(null!==m)for(var y=m.array,x=0,_=y.length-1;x<_;x+=f){var b=y[x],w=y[x+1];l.fromArray(v,3*b),u.fromArray(v,3*w);var M=e.distanceSqToSegment(l,u,d,p);if(!(M>o)){d.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(d);E<n.near||E>n.far||r.push({distance:E,point:p.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else for(var x=0,_=v.length/3-1;x<_;x+=f){l.fromArray(v,3*x),u.fromArray(v,3*x+3);var M=e.distanceSqToSegment(l,u,d,p);if(!(M>o)){d.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(d);E<n.near||E>n.far||r.push({distance:E,point:p.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else if(s.isGeometry)for(var T=s.vertices,S=T.length,x=0;x<S-1;x+=f){var M=e.distanceSqToSegment(T[x],T[x+1],d,p);if(!(M>o)){d.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(d);E<n.near||E>n.far||r.push({distance:E,point:p.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),be.prototype=Object.assign(Object.create(_e.prototype),{constructor:be,isLineSegments:!0}),we.prototype=Object.create(J.prototype),we.prototype.constructor=we,we.prototype.isPointsMaterial=!0,we.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},Me.prototype=Object.assign(Object.create(ct.prototype),{constructor:Me,isPoints:!0,raycast:function(){var t=new h,e=new at,i=new tt;return function(n,r){function a(t,i){var a=e.distanceSqToPoint(t);if(a<p){var s=e.closestPointToPoint(t);s.applyMatrix4(h);var c=n.ray.origin.distanceTo(s);if(c<n.near||c>n.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:s.clone(),index:i,face:null,object:o})}}var o=this,s=this.geometry,h=this.matrixWorld,l=n.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(h),!1!==n.ray.intersectsSphere(i)){t.getInverse(h),e.copy(n.ray).applyMatrix4(t);var u=l/((this.scale.x+this.scale.y+this.scale.z)/3),p=u*u,d=new c;if(s.isBufferGeometry){var f=s.index,m=s.attributes,g=m.position.array;if(null!==f)for(var v=f.array,y=0,x=v.length;y<x;y++){var _=v[y];d.fromArray(g,3*_),a(d,_)}else for(var y=0,b=g.length/3;y<b;y++)d.fromArray(g,3*y),a(d,y)}else for(var w=s.vertices,y=0,b=w.length;y<b;y++)a(w[y],y)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ee.prototype=Object.assign(Object.create(ct.prototype),{constructor:Ee}),Te.prototype=Object.create(n.prototype),Te.prototype.constructor=Te,Se.prototype=Object.create(n.prototype),Se.prototype.constructor=Se,Se.prototype.isCompressedTexture=!0,Ae.prototype=Object.create(n.prototype),Ae.prototype.constructor=Ae,Le.prototype=Object.create(n.prototype),Le.prototype.constructor=Le,Le.prototype.isDepthTexture=!0,Re.prototype=Object.create(At.prototype),Re.prototype.constructor=Re,Pe.prototype=Object.create(St.prototype),Pe.prototype.constructor=Pe,Ce.prototype=Object.create(At.prototype),Ce.prototype.constructor=Ce,Ie.prototype=Object.create(St.prototype),Ie.prototype.constructor=Ie,Ue.prototype=Object.create(At.prototype),Ue.prototype.constructor=Ue,Ne.prototype=Object.create(St.prototype),Ne.prototype.constructor=Ne,De.prototype=Object.create(Ue.prototype),De.prototype.constructor=De,Oe.prototype=Object.create(St.prototype),Oe.prototype.constructor=Oe,Be.prototype=Object.create(Ue.prototype),Be.prototype.constructor=Be,Fe.prototype=Object.create(St.prototype),Fe.prototype.constructor=Fe,ze.prototype=Object.create(Ue.prototype),ze.prototype.constructor=ze,Ge.prototype=Object.create(St.prototype),Ge.prototype.constructor=Ge,He.prototype=Object.create(Ue.prototype),He.prototype.constructor=He,Ve.prototype=Object.create(St.prototype),Ve.prototype.constructor=Ve,ke.prototype=Object.create(At.prototype),ke.prototype.constructor=ke,je.prototype=Object.create(St.prototype),je.prototype.constructor=je,We.prototype=Object.create(At.prototype),We.prototype.constructor=We,Xe.prototype=Object.create(St.prototype),Xe.prototype.constructor=Xe,qe.prototype=Object.create(At.prototype),qe.prototype.constructor=qe;var ms={area:function(t){for(var e=t.length,i=0,n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},triangulate:function(){function t(t,e,i,n,r,a){var o,s,c,h,l,u,p,d,f;if(s=t[a[e]].x,c=t[a[e]].y,h=t[a[i]].x,l=t[a[i]].y,u=t[a[n]].x,p=t[a[n]].y,(h-s)*(p-c)-(l-c)*(u-s)<=0)return!1;var m,g,v,y,x,_,b,w,M,E,T,S,A,L,R;for(m=u-h,g=p-l,v=s-u,y=c-p,x=h-s,_=l-c,o=0;o<r;o++)if(d=t[a[o]].x,f=t[a[o]].y,!(d===s&&f===c||d===h&&f===l||d===u&&f===p)&&(b=d-s,w=f-c,M=d-h,E=f-l,T=d-u,S=f-p,R=m*E-g*M,A=x*w-_*b,L=v*S-y*T,R>=-Number.EPSILON&&L>=-Number.EPSILON&&A>=-Number.EPSILON))return!1;return!0}return function(e,i){var n=e.length;if(n<3)return null;var r,a,o,s=[],c=[],h=[];if(ms.area(e)>0)for(a=0;a<n;a++)c[a]=a;else for(a=0;a<n;a++)c[a]=n-1-a;var l=n,u=2*l;for(a=l-1;l>2;){if(u--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?h:s;if(r=a,l<=r&&(r=0),a=r+1,l<=a&&(a=0),o=a+1,l<=o&&(o=0),t(e,r,a,o,l,c)){var p,d,f,m,g;for(p=c[r],d=c[a],f=c[o],s.push([e[p],e[d],e[f]]),h.push([c[r],c[a],c[o]]),m=a,g=a+1;g<l;m++,g++)c[m]=c[g];l--,u=2*l}}return i?h:s}}(),triangulateShape:function(t,e){function i(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function n(t,e,i){return t.x!==e.x?t.x<e.x?t.x<=i.x&&i.x<=e.x:e.x<=i.x&&i.x<=t.x:t.y<e.y?t.y<=i.y&&i.y<=e.y:e.y<=i.y&&i.y<=t.y}function r(t,e,i,r,a){var o=e.x-t.x,s=e.y-t.y,c=r.x-i.x,h=r.y-i.y,l=t.x-i.x,u=t.y-i.y,p=s*c-o*h,d=s*l-o*u;if(Math.abs(p)>Number.EPSILON){var f;if(p>0){if(d<0||d>p)return[];if((f=h*l-c*u)<0||f>p)return[]}else{if(d>0||d<p)return[];if((f=h*l-c*u)>0||f<p)return[]}if(0===f)return!a||0!==d&&d!==p?[t]:[];if(f===p)return!a||0!==d&&d!==p?[e]:[];if(0===d)return[i];if(d===p)return[r];var m=f/p;return[{x:t.x+m*o,y:t.y+m*s}]}if(0!==d||h*l!=c*u)return[];var g=0===o&&0===s,v=0===c&&0===h;if(g&&v)return t.x!==i.x||t.y!==i.y?[]:[t];if(g)return n(i,r,t)?[t]:[];if(v)return n(t,e,i)?[i]:[];var y,x,_,b,w,M,E,T;return 0!==o?(t.x<e.x?(y=t,_=t.x,x=e,b=e.x):(y=e,_=e.x,x=t,b=t.x),i.x<r.x?(w=i,E=i.x,M=r,T=r.x):(w=r,E=r.x,M=i,T=i.x)):(t.y<e.y?(y=t,_=t.y,x=e,b=e.y):(y=e,_=e.y,x=t,b=t.y),i.y<r.y?(w=i,E=i.y,M=r,T=r.y):(w=r,E=r.y,M=i,T=i.y)),_<=E?b<E?[]:b===E?a?[]:[w]:b<=T?[w,x]:[w,M]:_>T?[]:_===T?a?[]:[y]:b<=T?[y,x]:[y,M]}function a(t,e,i,n){var r=e.x-t.x,a=e.y-t.y,o=i.x-t.x,s=i.y-t.y,c=n.x-t.x,h=n.y-t.y,l=r*s-a*o,u=r*h-a*c;if(Math.abs(l)>Number.EPSILON){var p=c*s-h*o;return l>0?u>=0&&p>=0:u>=0||p>=0}return u>0}i(t),e.forEach(i);for(var o,s,c,h,l,u,p={},d=t.concat(),f=0,m=e.length;f<m;f++)Array.prototype.push.apply(d,e[f]);for(o=0,s=d.length;o<s;o++)l=d[o].x+":"+d[o].y,void 0!==p[l]&&console.warn("THREE.ShapeUtils: Duplicate point",l,o),p[l]=o;var g=function(t,e){for(var i,n,o,s,c,h,l,u,p,d,f,m=t.concat(),g=[],v=[],y=0,x=e.length;y<x;y++)g.push(y);for(var _=0,b=2*g.length;g.length>0;){if(--b<0){console.log("Infinite Loop! Holes left:"+g.length+", Probably Hole outside Shape!");break}for(o=_;o<m.length;o++){s=m[o],n=-1;for(var y=0;y<g.length;y++)if(h=g[y],l=s.x+":"+s.y+":"+h,void 0===v[l]){i=e[h];for(var w=0;w<i.length;w++)if(c=i[w],function(t,e){var n=m.length-1,r=t-1;r<0&&(r=n);var o=t+1;o>n&&(o=0);var s=a(m[t],m[r],m[o],i[e]);if(!s)return!1;var c=i.length-1,h=e-1;h<0&&(h=c);var l=e+1;return l>c&&(l=0),!!(s=a(i[e],i[h],i[l],m[t]))}(o,w)&&!function(t,e){var i,n,a;for(i=0;i<m.length;i++)if(n=i+1,n%=m.length,a=r(t,e,m[i],m[n],!0),a.length>0)return!0;return!1}(s,c)&&!function(t,i){var n,a,o,s,c;for(n=0;n<g.length;n++)for(a=e[g[n]],o=0;o<a.length;o++)if(s=o+1,s%=a.length,c=r(t,i,a[o],a[s],!0),c.length>0)return!0;return!1}(s,c)){n=w,g.splice(y,1),u=m.slice(0,o+1),p=m.slice(o),d=i.slice(n),f=i.slice(0,n+1),m=u.concat(d).concat(f).concat(p),_=o;break}if(n>=0)break;v[l]=!0}if(n>=0)break}}return m}(t,e),v=ms.triangulate(g,!1);for(o=0,s=v.length;o<s;o++)for(h=v[o],c=0;c<3;c++)l=h[c].x+":"+h[c].y,void 0!==(u=p[l])&&(h[c]=u);return v.concat()},isClockWise:function(t){return ms.area(t)<0}};Ye.prototype=Object.create(St.prototype),Ye.prototype.constructor=Ye,Ye.prototype.addShapeList=function(t,e){for(var i=t.length,n=0;n<i;n++){var r=t[n];this.addShape(r,e)}},Ye.prototype.addShape=function(t,e){function n(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}function r(t,e,n){var r,a,o=1,s=t.x-e.x,c=t.y-e.y,h=n.x-t.x,l=n.y-t.y,u=s*s+c*c,p=s*l-c*h;if(Math.abs(p)>Number.EPSILON){var d=Math.sqrt(u),f=Math.sqrt(h*h+l*l),m=e.x-c/d,g=e.y+s/d,v=n.x-l/f,y=n.y+h/f,x=((v-m)*l-(y-g)*h)/(s*l-c*h);r=m+s*x-t.x,a=g+c*x-t.y;var _=r*r+a*a;if(_<=2)return new i(r,a);o=Math.sqrt(_/2)}else{var b=!1;s>Number.EPSILON?h>Number.EPSILON&&(b=!0):s<-Number.EPSILON?h<-Number.EPSILON&&(b=!0):Math.sign(c)===Math.sign(l)&&(b=!0),b?(r=-c,a=s,o=Math.sqrt(u)):(r=s,a=c,o=Math.sqrt(u/2))}return new i(r/o,a/o)}function a(t,e){var i,n;for(W=t.length;--W>=0;){i=W,n=W-1,n<0&&(n=t.length-1);var r=0,a=b+2*y;for(r=0;r<a;r++){var o=V*r,s=V*(r+1);h(e+i+o,e+n+o,e+n+s,e+i+s,t,r,a,i,n)}}}function o(t,e,i){L.vertices.push(new c(t,e,i))}function s(t,e,i){t+=R,e+=R,i+=R,L.faces.push(new ut(t,e,i,null,null,0));var n=E.generateTopUV(L,t,e,i);L.faceVertexUvs[0].push(n)}function h(t,e,i,n,r,a,o,s,c){t+=R,e+=R,i+=R,n+=R,L.faces.push(new ut(t,e,n,null,null,1)),L.faces.push(new ut(e,i,n,null,null,1));var h=E.generateSideWallUV(L,t,e,i,n);L.faceVertexUvs[0].push([h[0],h[1],h[3]]),L.faceVertexUvs[0].push([h[1],h[2],h[3]])}var l,u,p,d,f,m=void 0!==e.amount?e.amount:100,g=void 0!==e.bevelThickness?e.bevelThickness:6,v=void 0!==e.bevelSize?e.bevelSize:g-2,y=void 0!==e.bevelSegments?e.bevelSegments:3,x=void 0===e.bevelEnabled||e.bevelEnabled,_=void 0!==e.curveSegments?e.curveSegments:12,b=void 0!==e.steps?e.steps:1,w=e.extrudePath,M=!1,E=void 0!==e.UVGenerator?e.UVGenerator:Ye.WorldUVGenerator;w&&(l=w.getSpacedPoints(b),M=!0,x=!1,u=void 0!==e.frames?e.frames:w.computeFrenetFrames(b,!1),p=new c,d=new c,f=new c),x||(y=0,g=0,v=0);var T,S,A,L=this,R=this.vertices.length,P=t.extractPoints(_),C=P.shape,I=P.holes,U=!ms.isClockWise(C);if(U){for(C=C.reverse(),S=0,A=I.length;S<A;S++)T=I[S],ms.isClockWise(T)&&(I[S]=T.reverse());U=!1}var N=ms.triangulateShape(C,I),D=C;for(S=0,A=I.length;S<A;S++)T=I[S],C=C.concat(T)
115
+ ;for(var O,B,F,z,G,H,V=C.length,k=N.length,j=[],W=0,X=D.length,q=X-1,Y=W+1;W<X;W++,q++,Y++)q===X&&(q=0),Y===X&&(Y=0),j[W]=r(D[W],D[q],D[Y]);var Z,J=[],Q=j.concat();for(S=0,A=I.length;S<A;S++){for(T=I[S],Z=[],W=0,X=T.length,q=X-1,Y=W+1;W<X;W++,q++,Y++)q===X&&(q=0),Y===X&&(Y=0),Z[W]=r(T[W],T[q],T[Y]);J.push(Z),Q=Q.concat(Z)}for(O=0;O<y;O++){for(F=O/y,z=g*Math.cos(F*Math.PI/2),B=v*Math.sin(F*Math.PI/2),W=0,X=D.length;W<X;W++)G=n(D[W],j[W],B),o(G.x,G.y,-z);for(S=0,A=I.length;S<A;S++)for(T=I[S],Z=J[S],W=0,X=T.length;W<X;W++)G=n(T[W],Z[W],B),o(G.x,G.y,-z)}for(B=v,W=0;W<V;W++)G=x?n(C[W],Q[W],B):C[W],M?(d.copy(u.normals[0]).multiplyScalar(G.x),p.copy(u.binormals[0]).multiplyScalar(G.y),f.copy(l[0]).add(d).add(p),o(f.x,f.y,f.z)):o(G.x,G.y,0);var K;for(K=1;K<=b;K++)for(W=0;W<V;W++)G=x?n(C[W],Q[W],B):C[W],M?(d.copy(u.normals[K]).multiplyScalar(G.x),p.copy(u.binormals[K]).multiplyScalar(G.y),f.copy(l[K]).add(d).add(p),o(f.x,f.y,f.z)):o(G.x,G.y,m/b*K);for(O=y-1;O>=0;O--){for(F=O/y,z=g*Math.cos(F*Math.PI/2),B=v*Math.sin(F*Math.PI/2),W=0,X=D.length;W<X;W++)G=n(D[W],j[W],B),o(G.x,G.y,m+z);for(S=0,A=I.length;S<A;S++)for(T=I[S],Z=J[S],W=0,X=T.length;W<X;W++)G=n(T[W],Z[W],B),M?o(G.x,G.y+l[b-1].y,l[b-1].x+z):o(G.x,G.y,m+z)}!function(){if(x){var t=0,e=V*t;for(W=0;W<k;W++)H=N[W],s(H[2]+e,H[1]+e,H[0]+e);for(t=b+2*y,e=V*t,W=0;W<k;W++)H=N[W],s(H[0]+e,H[1]+e,H[2]+e)}else{for(W=0;W<k;W++)H=N[W],s(H[2],H[1],H[0]);for(W=0;W<k;W++)H=N[W],s(H[0]+V*b,H[1]+V*b,H[2]+V*b)}}(),function(){var t=0;for(a(D,t),t+=D.length,S=0,A=I.length;S<A;S++)T=I[S],a(T,t),t+=T.length}()},Ye.WorldUVGenerator={generateTopUV:function(t,e,n,r){var a=t.vertices,o=a[e],s=a[n],c=a[r];return[new i(o.x,o.y),new i(s.x,s.y),new i(c.x,c.y)]},generateSideWallUV:function(t,e,n,r,a){var o=t.vertices,s=o[e],c=o[n],h=o[r],l=o[a];return Math.abs(s.y-c.y)<.01?[new i(s.x,1-s.z),new i(c.x,1-c.z),new i(h.x,1-h.z),new i(l.x,1-l.z)]:[new i(s.y,1-s.z),new i(c.y,1-c.z),new i(h.y,1-h.z),new i(l.y,1-l.z)]}},Ze.prototype=Object.create(Ye.prototype),Ze.prototype.constructor=Ze,Je.prototype=Object.create(St.prototype),Je.prototype.constructor=Je,Qe.prototype=Object.create(At.prototype),Qe.prototype.constructor=Qe,Ke.prototype=Object.create(St.prototype),Ke.prototype.constructor=Ke,$e.prototype=Object.create(At.prototype),$e.prototype.constructor=$e,ti.prototype=Object.create(St.prototype),ti.prototype.constructor=ti,ei.prototype=Object.create(At.prototype),ei.prototype.constructor=ei,ii.prototype=Object.create(St.prototype),ii.prototype.constructor=ii,ni.prototype=Object.create(At.prototype),ni.prototype.constructor=ni,ri.prototype=Object.create(At.prototype),ri.prototype.constructor=ri,ai.prototype=Object.create(St.prototype),ai.prototype.constructor=ai,oi.prototype=Object.create(At.prototype),oi.prototype.constructor=oi,si.prototype=Object.create(ai.prototype),si.prototype.constructor=si,ci.prototype=Object.create(oi.prototype),ci.prototype.constructor=ci,hi.prototype=Object.create(St.prototype),hi.prototype.constructor=hi,li.prototype=Object.create(At.prototype),li.prototype.constructor=li;var gs=Object.freeze({WireframeGeometry:Re,ParametricGeometry:Pe,ParametricBufferGeometry:Ce,TetrahedronGeometry:Ne,TetrahedronBufferGeometry:De,OctahedronGeometry:Oe,OctahedronBufferGeometry:Be,IcosahedronGeometry:Fe,IcosahedronBufferGeometry:ze,DodecahedronGeometry:Ge,DodecahedronBufferGeometry:He,PolyhedronGeometry:Ie,PolyhedronBufferGeometry:Ue,TubeGeometry:Ve,TubeBufferGeometry:ke,TorusKnotGeometry:je,TorusKnotBufferGeometry:We,TorusGeometry:Xe,TorusBufferGeometry:qe,TextGeometry:Ze,SphereGeometry:Je,SphereBufferGeometry:Qe,RingGeometry:Ke,RingBufferGeometry:$e,PlaneGeometry:Ct,PlaneBufferGeometry:It,LatheGeometry:ti,LatheBufferGeometry:ei,ShapeGeometry:ii,ShapeBufferGeometry:ni,ExtrudeGeometry:Ye,EdgesGeometry:ri,ConeGeometry:si,ConeBufferGeometry:ci,CylinderGeometry:ai,CylinderBufferGeometry:oi,CircleGeometry:hi,CircleBufferGeometry:li,BoxGeometry:Rt,BoxBufferGeometry:Pt});ui.prototype=Object.create(Q.prototype),ui.prototype.constructor=ui,ui.prototype.isShadowMaterial=!0,pi.prototype=Object.create(Q.prototype),pi.prototype.constructor=pi,pi.prototype.isRawShaderMaterial=!0,di.prototype={constructor:di,isMultiMaterial:!0,toJSON:function(t){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},i=this.materials,n=0,r=i.length;n<r;n++){var a=i[n].toJSON(t);delete a.metadata,e.materials.push(a)}return e.visible=this.visible,e},clone:function(){for(var t=new this.constructor,e=0;e<this.materials.length;e++)t.materials.push(this.materials[e].clone());return t.visible=this.visible,t}},fi.prototype=Object.create(J.prototype),fi.prototype.constructor=fi,fi.prototype.isMeshStandardMaterial=!0,fi.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},mi.prototype=Object.create(fi.prototype),mi.prototype.constructor=mi,mi.prototype.isMeshPhysicalMaterial=!0,mi.prototype.copy=function(t){return fi.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},gi.prototype=Object.create(J.prototype),gi.prototype.constructor=gi,gi.prototype.isMeshPhongMaterial=!0,gi.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},vi.prototype=Object.create(gi.prototype),vi.prototype.constructor=vi,vi.prototype.isMeshToonMaterial=!0,vi.prototype.copy=function(t){return gi.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},yi.prototype=Object.create(J.prototype),yi.prototype.constructor=yi,yi.prototype.isMeshNormalMaterial=!0,yi.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},xi.prototype=Object.create(J.prototype),xi.prototype.constructor=xi,xi.prototype.isMeshLambertMaterial=!0,xi.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},_i.prototype=Object.create(J.prototype),_i.prototype.constructor=_i,_i.prototype.isLineDashedMaterial=!0,_i.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var vs=Object.freeze({ShadowMaterial:ui,SpriteMaterial:de,RawShaderMaterial:pi,ShaderMaterial:Q,PointsMaterial:we,MultiMaterial:di,MeshPhysicalMaterial:mi,MeshStandardMaterial:fi,MeshPhongMaterial:gi,MeshToonMaterial:vi,MeshNormalMaterial:yi,MeshLambertMaterial:xi,MeshDepthMaterial:K,MeshBasicMaterial:pt,LineDashedMaterial:_i,LineBasicMaterial:xe,Material:J}),ys={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},xs=new bi;Object.assign(wi.prototype,{load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var r=this,a=ys.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0),a;var o=/^data:(.*?)(;base64)?,(.*)$/,s=t.match(o);if(s){var c=s[1],h=!!s[2],l=s[3];l=window.decodeURIComponent(l),h&&(l=window.atob(l));try{var u,p=(this.responseType||"").toLowerCase();switch(p){case"arraybuffer":case"blob":u=new ArrayBuffer(l.length);for(var d=new Uint8Array(u),f=0;f<l.length;f++)d[f]=l.charCodeAt(f);"blob"===p&&(u=new Blob([u],{type:c}));break;case"document":var m=new DOMParser;u=m.parseFromString(l,c);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout(function(){e&&e(u),r.manager.itemEnd(t)},0)}catch(e){window.setTimeout(function(){n&&n(e),r.manager.itemError(t)},0)}}else{var g=new XMLHttpRequest;g.open("GET",t,!0),g.addEventListener("load",function(i){var a=i.target.response;ys.add(t,a),200===this.status?(e&&e(a),r.manager.itemEnd(t)):0===this.status?(console.warn("THREE.FileLoader: HTTP Status 0 received."),e&&e(a),r.manager.itemEnd(t)):(n&&n(i),r.manager.itemError(t))},!1),void 0!==i&&g.addEventListener("progress",function(t){i(t)},!1),g.addEventListener("error",function(e){n&&n(e),r.manager.itemError(t)},!1),void 0!==this.responseType&&(g.responseType=this.responseType),void 0!==this.withCredentials&&(g.withCredentials=this.withCredentials),g.overrideMimeType&&g.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),g.send(null)}return r.manager.itemStart(t),g},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this}}),Object.assign(Mi.prototype,{load:function(t,e,i,n){var r=this,a=[],o=new Se;o.image=a;var s=new wi(this.manager);if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var c=0,h=0,l=t.length;h<l;++h)!function(h){s.load(t[h],function(t){var i=r._parser(t,!0);a[h]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},6===(c+=1)&&(1===i.mipmapCount&&(o.minFilter=oo),o.format=i.format,o.needsUpdate=!0,e&&e(o))},i,n)}(h);else s.load(t,function(t){var i=r._parser(t,!0);if(i.isCubemap)for(var n=i.mipmaps.length/i.mipmapCount,s=0;s<n;s++){a[s]={mipmaps:[]};for(var c=0;c<i.mipmapCount;c++)a[s].mipmaps.push(i.mipmaps[s*i.mipmapCount+c]),a[s].format=i.format,a[s].width=i.width,a[s].height=i.height}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=oo),o.format=i.format,o.needsUpdate=!0,e&&e(o)},i,n);return o},setPath:function(t){return this.path=t,this}}),Object.assign(Ei.prototype,{load:function(t,e,i,n){var r=this,a=new X,o=new wi(this.manager);return o.setResponseType("arraybuffer"),o.load(t,function(t){var i=r._parser(t);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:eo,a.wrapT=void 0!==i.wrapT?i.wrapT:eo,a.magFilter=void 0!==i.magFilter?i.magFilter:oo,a.minFilter=void 0!==i.minFilter?i.minFilter:co,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps),1===i.mipmapCount&&(a.minFilter=oo),a.needsUpdate=!0,e&&e(a,i))},i,n),a}}),Object.assign(Ti.prototype,{load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var r=this,a=ys.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");return o.addEventListener("load",function(){ys.add(t,this),e&&e(this),r.manager.itemEnd(t)},!1),o.addEventListener("error",function(e){n&&n(e),r.manager.itemError(t)},!1),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Si.prototype,{load:function(t,e,i,n){var r=new l,a=new Ti(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);for(var o=0,s=0;s<t.length;++s)!function(i){a.load(t[i],function(t){r.images[i]=t,6==++o&&(r.needsUpdate=!0,e&&e(r))},void 0,n)}(s);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Ai.prototype,{load:function(t,e,i,r){var a=new n,o=new Ti(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(i){var n=t.search(/\.(jpg|jpeg)$/)>0||0===t.search(/^data\:image\/jpeg/);a.format=n?Mo:Eo,a.image=i,a.needsUpdate=!0,void 0!==e&&e(a)},i,r),a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Li.prototype=Object.assign(Object.create(ct.prototype),{constructor:Li,isLight:!0,copy:function(t){return ct.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=ct.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Ri.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ri,isHemisphereLight:!0,copy:function(t){return Li.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Pi.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Ci.prototype=Object.assign(Object.create(Pi.prototype),{constructor:Ci,isSpotLightShadow:!0,update:function(t){var e=2*$o.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,n=t.distance||500,r=this.camera;e===r.fov&&i===r.aspect&&n===r.far||(r.fov=e,r.aspect=i,r.far=n,r.updateProjectionMatrix())}}),Ii.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ii,isSpotLight:!0,copy:function(t){return Li.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Ui.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ui,isPointLight:!0,copy:function(t){return Li.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Ni.prototype=Object.assign(Object.create(Pi.prototype),{constructor:Ni}),Di.prototype=Object.assign(Object.create(Li.prototype),{constructor:Di,isDirectionalLight:!0,copy:function(t){return Li.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Oi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Oi,isAmbientLight:!0});var _s={arraySlice:function(t,e,i){return _s.isTypedArray(t)?new t.constructor(t.subarray(e,i)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,i){return t[e]-t[i]}for(var i=t.length,n=new Array(i),r=0;r!==i;++r)n[r]=r;return n.sort(e),n},sortedArray:function(t,e,i){for(var n=t.length,r=new t.constructor(n),a=0,o=0;o!==n;++a)for(var s=i[a]*e,c=0;c!==e;++c)r[o++]=t[s+c];return r},flattenJSON:function(t,e,i,n){for(var r=1,a=t[0];void 0!==a&&void 0===a[n];)a=t[r++];if(void 0!==a){var o=a[n];if(void 0!==o)if(Array.isArray(o))do{o=a[n],void 0!==o&&(e.push(a.time),i.push.apply(i,o)),a=t[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[n],void 0!==o&&(e.push(a.time),o.toArray(i,i.length)),a=t[r++]}while(void 0!==a);else do{o=a[n],void 0!==o&&(e.push(a.time),i.push(o)),a=t[r++]}while(void 0!==a)}}};Bi.prototype={constructor:Bi,evaluate:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{var a;i:{n:if(!(t<n)){for(var o=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===o)break;if(r=n,n=e[++i],t<n)break e}a=e.length;break i}{if(t>=r)break t;var s=e[1];t<s&&(i=2,r=s);for(var o=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===o)break;if(n=r,r=e[--i-1],t>=r)break e}a=i,i=0}}for(;i<a;){var c=i+a>>>1;t<e[c]?a=c:i=c+1}if(n=e[i],void 0===(r=e[i-1]))return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n,a=0;a!==n;++a)e[a]=i[r+a];return e},interpolate_:function(t,e,i,n){throw new Error("call to abstract method")},intervalChanged_:function(t,e,i){}},Object.assign(Bi.prototype,{beforeStart_:Bi.prototype.copySampleValue_,afterEnd_:Bi.prototype.copySampleValue_}),Fi.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Fi,DefaultSettings_:{endingStart:Go,endingEnd:Go},intervalChanged_:function(t,e,i){var n=this.parameterPositions,r=t-2,a=t+1,o=n[r],s=n[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=t,o=2*e-i;break;case 2402:r=n.length-2,o=e+n[r]-n[r+1];break;default:r=t,o=i}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=t,s=2*i-e;break;case 2402:a=1,s=i+n[1]-n[0];break;default:a=t-1,s=e}var c=.5*(i-e),h=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(s-i),this._offsetPrev=r*h,this._offsetNext=a*h},interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,h=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(i-e)/(n-e),f=d*d,m=f*d,g=-u*m+2*u*f-u*d,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,_=0;_!==o;++_)r[_]=g*a[h+_]+v*a[c+_]+y*a[s+_]+x*a[l+_];return r}}),zi.prototype=Object.assign(Object.create(Bi.prototype),{constructor:zi,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,h=(i-e)/(n-e),l=1-h,u=0;u!==o;++u)r[u]=a[c+u]*l+a[s+u]*h;return r}}),Gi.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Gi,interpolate_:function(t,e,i,n){return this.copySampleValue_(t-1)}});var bs;bs={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new Gi(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new zi(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Fi(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return void console.warn(i)}this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]*=t;return this},trim:function(t,e){for(var i=this.times,n=i.length,r=0,a=n-1;r!==n&&i[r]<t;)++r;for(;-1!==a&&i[a]>e;)--a;if(++a,0!==r||a!==n){r>=a&&(a=Math.max(a,1),r=a-1);var o=this.getValueSize();this.times=_s.arraySlice(i,r,a),this.values=_s.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("invalid value size in track",this),t=!1);var i=this.times,n=this.values,r=i.length;0===r&&(console.error("track is empty",this),t=!1);for(var a=null,o=0;o!==r;o++){var s=i[o];if("number"==typeof s&&isNaN(s)){console.error("time is not a valid number",this,o,s),t=!1;break}if(null!==a&&a>s){console.error("out of order keys",this,o,s,a),t=!1;break}a=s}if(void 0!==n&&_s.isTypedArray(n))for(var o=0,c=n.length;o!==c;++o){var h=n[o];if(isNaN(h)){console.error("value is not a valid number",this,o,h),t=!1;break}}return t},optimize:function(){for(var t=this.times,e=this.values,i=this.getValueSize(),n=2302===this.getInterpolation(),r=1,a=t.length-1,o=1;o<a;++o){var s=!1,c=t[o];if(c!==t[o+1]&&(1!==o||c!==c[0]))if(n)s=!0;else for(var h=o*i,l=h-i,u=h+i,p=0;p!==i;++p){var d=e[h+p];if(d!==e[l+p]||d!==e[u+p]){s=!0;break}}if(s){if(o!==r){t[r]=t[o];for(var f=o*i,m=r*i,p=0;p!==i;++p)e[m+p]=e[f+p]}++r}}if(a>0){t[r]=t[a];for(var f=a*i,m=r*i,p=0;p!==i;++p)e[m+p]=e[f+p];++r}return r!==t.length&&(this.times=_s.arraySlice(t,0,r),this.values=_s.arraySlice(e,0,r*i)),this}},Vi.prototype=Object.assign(Object.create(bs),{constructor:Vi,ValueTypeName:"vector"}),ki.prototype=Object.assign(Object.create(Bi.prototype),{constructor:ki,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=t*o,h=(i-e)/(n-e),l=c+o;c!==l;c+=4)s.slerpFlat(r,0,a,c-o,a,c,h);return r}}),ji.prototype=Object.assign(Object.create(bs),{constructor:ji,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new ki(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Wi.prototype=Object.assign(Object.create(bs),{constructor:Wi,ValueTypeName:"number"}),Xi.prototype=Object.assign(Object.create(bs),{constructor:Xi,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),qi.prototype=Object.assign(Object.create(bs),{constructor:qi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Yi.prototype=Object.assign(Object.create(bs),{constructor:Yi,ValueTypeName:"color"}),Zi.prototype=bs,bs.constructor=Zi,Object.assign(Zi,{parse:function(t){if(void 0===t.type)throw new Error("track type undefined, can not parse");var e=Zi._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var i=[],n=[];_s.flattenJSON(t.keys,i,n,"value"),t.times=i,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,i=t.constructor;if(void 0!==i.toJSON)e=i.toJSON(t);else{e={name:t.name,times:_s.convertArray(t.times,Array),values:_s.convertArray(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Wi;case"vector":case"vector2":case"vector3":case"vector4":return Vi;case"color":return Yi;case"quaternion":return ji;case"bool":case"boolean":return qi;case"string":return Xi}throw new Error("Unsupported typeName: "+t)}}),Ji.prototype={constructor:Ji,resetDuration:function(){for(var t=this.tracks,e=0,i=0,n=t.length;i!==n;++i){var r=this.tracks[i];e=Math.max(e,r.times[r.times.length-1])}this.duration=e},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}},Object.assign(Ji,{parse:function(t){for(var e=[],i=t.tracks,n=1/(t.fps||1),r=0,a=i.length;r!==a;++r)e.push(Zi.parse(i[r]).scale(n));return new Ji(t.name,t.duration,e)},toJSON:function(t){for(var e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e},r=0,a=i.length;r!==a;++r)e.push(Zi.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){for(var r=e.length,a=[],o=0;o<r;o++){var s=[],c=[];s.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);var h=_s.getKeyframeOrder(s);s=_s.sortedArray(s,1,h),c=_s.sortedArray(c,1,h),n||0!==s[0]||(s.push(r),c.push(c[0])),a.push(new Wi(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/i))}return new Ji(t,-1,a)},findByName:function(t,e){var i=t;if(!Array.isArray(t)){var n=t;i=n.geometry&&n.geometry.animations||n.animations}for(var r=0;r<i.length;r++)if(i[r].name===e)return i[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){for(var n={},r=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(r);if(c&&c.length>1){var h=c[1],l=n[h];l||(n[h]=l=[]),l.push(s)}}var u=[];for(var h in n)u.push(Ji.CreateFromMorphTargetSequence(h,n[h],e,i));return u},parseAnimation:function(t,e){if(!t)return console.error(" no animation in JSONLoader data"),null;for(var i=function(t,e,i,n,r){if(0!==i.length){var a=[],o=[];_s.flattenJSON(i,a,o,n),0!==a.length&&r.push(new t(e,a,o))}},n=[],r=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.hierarchy||[],c=0;c<s.length;c++){var h=s[c].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var l={},u=0;u<h.length;u++)if(h[u].morphTargets)for(var p=0;p<h[u].morphTargets.length;p++)l[h[u].morphTargets[p]]=-1;for(var d in l){for(var f=[],m=[],p=0;p!==h[u].morphTargets.length;++p){var g=h[u];f.push(g.time),m.push(g.morphTarget===d?1:0)}n.push(new Wi(".morphTargetInfluence["+d+"]",f,m))}a=l.length*(o||1)}else{var v=".bones["+e[c].name+"]";i(Vi,v+".position",h,"pos",n),i(ji,v+".quaternion",h,"rot",n),i(Vi,v+".scale",h,"scl",n)}}return 0===n.length?null:new Ji(r,a,n)}}),Object.assign(Qi.prototype,{load:function(t,e,i,n){var r=this;new wi(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},setTextures:function(t){this.textures=t},parse:function(t){function e(t){return void 0===n[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),n[t]}var n=this.textures,r=new vs[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearCoat&&(r.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(r.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.uniforms&&(r.uniforms=t.uniforms),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(r.vertexColors=t.vertexColors),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.shading&&(r.shading=t.shading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=e(t.map)),void 0!==t.alphaMap&&(r.alphaMap=e(t.alphaMap),r.transparent=!0),void 0!==t.bumpMap&&(r.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=e(t.normalMap)),void 0!==t.normalScale){var a=t.normalScale;!1===Array.isArray(a)&&(a=[a,a]),r.normalScale=(new i).fromArray(a)}if(void 0!==t.displacementMap&&(r.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=e(t.specularMap)),void 0!==t.envMap&&(r.envMap=e(t.envMap)),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.lightMap&&(r.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=e(t.gradientMap)),void 0!==t.materials)for(var o=0,s=t.materials.length;o<s;o++)r.materials.push(this.parse(t.materials[o]));return r}}),Object.assign(Ki.prototype,{load:function(t,e,i,n){var r=this;new wi(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},parse:function(t){var e=new At,i=t.data.index,n={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,
116
+ Float32Array:Float32Array,Float64Array:Float64Array};if(void 0!==i){var r=new n[i.type](i.array);e.setIndex(new dt(r,1))}var a=t.data.attributes;for(var o in a){var s=a[o],r=new n[s.type](s.array);e.addAttribute(o,new dt(r,s.itemSize,s.normalized))}var h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(var l=0,u=h.length;l!==u;++l){var p=h[l];e.addGroup(p.start,p.count,p.materialIndex)}var d=t.data.boundingSphere;if(void 0!==d){var f=new c;void 0!==d.center&&f.fromArray(d.center),e.boundingSphere=new tt(f,d.radius)}return e}}),$i.prototype={constructor:$i,crossOrigin:void 0,extractUrlBase:function(t){var e=t.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")},initMaterials:function(t,e,i){for(var n=[],r=0;r<t.length;++r)n[r]=this.createMaterial(t[r],e,i);return n},createMaterial:function(){var t,e,i,n={NoBlending:ha,NormalBlending:la,AdditiveBlending:ua,SubtractiveBlending:pa,MultiplyBlending:da,CustomBlending:fa};return function(r,a,o){function s(t,i,n,r,s){var h,l=a+t,u=$i.Handlers.get(l);null!==u?h=u.load(l):(e.setCrossOrigin(o),h=e.load(l)),void 0!==i&&(h.repeat.fromArray(i),1!==i[0]&&(h.wrapS=to),1!==i[1]&&(h.wrapT=to)),void 0!==n&&h.offset.fromArray(n),void 0!==r&&("repeat"===r[0]&&(h.wrapS=to),"mirror"===r[0]&&(h.wrapS=io),"repeat"===r[1]&&(h.wrapT=to),"mirror"===r[1]&&(h.wrapT=io)),void 0!==s&&(h.anisotropy=s);var p=$o.generateUUID();return c[p]=h,p}void 0===t&&(t=new W),void 0===e&&(e=new Ai),void 0===i&&(i=new Qi);var c={},h={uuid:$o.generateUUID(),type:"MeshLambertMaterial"};for(var l in r){var u=r[l];switch(l){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":h.name=u;break;case"blending":h.blending=n[u];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",l,"is no longer supported.");break;case"colorDiffuse":h.color=t.fromArray(u).getHex();break;case"colorSpecular":h.specular=t.fromArray(u).getHex();break;case"colorEmissive":h.emissive=t.fromArray(u).getHex();break;case"specularCoef":h.shininess=u;break;case"shading":"basic"===u.toLowerCase()&&(h.type="MeshBasicMaterial"),"phong"===u.toLowerCase()&&(h.type="MeshPhongMaterial"),"standard"===u.toLowerCase()&&(h.type="MeshStandardMaterial");break;case"mapDiffuse":h.map=s(u,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":h.emissiveMap=s(u,r.mapEmissiveRepeat,r.mapEmissiveOffset,r.mapEmissiveWrap,r.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":h.lightMap=s(u,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":h.aoMap=s(u,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":h.bumpMap=s(u,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":h.bumpScale=u;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":h.normalMap=s(u,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":h.normalScale=[u,u];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":h.specularMap=s(u,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":h.metalnessMap=s(u,r.mapMetalnessRepeat,r.mapMetalnessOffset,r.mapMetalnessWrap,r.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":h.roughnessMap=s(u,r.mapRoughnessRepeat,r.mapRoughnessOffset,r.mapRoughnessWrap,r.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":h.alphaMap=s(u,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":h.side=ia;break;case"doubleSided":h.side=na;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),h.opacity=u;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":h[l]=u;break;case"vertexColors":!0===u&&(h.vertexColors=ca),"face"===u&&(h.vertexColors=sa);break;default:console.error("THREE.Loader.createMaterial: Unsupported",l,u)}}return"MeshBasicMaterial"===h.type&&delete h.emissive,"MeshPhongMaterial"!==h.type&&delete h.specular,h.opacity<1&&(h.transparent=!0),i.setTextures(c),i.parse(h)}}()},$i.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,i=0,n=e.length;i<n;i+=2){var r=e[i],a=e[i+1];if(r.test(t))return a}return null}},Object.assign(tn.prototype,{load:function(t,e,i,n){var r=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:$i.prototype.extractUrlBase(t),o=new wi(this.manager);o.setWithCredentials(this.withCredentials),o.load(t,function(i){var n=JSON.parse(i),o=n.metadata;if(void 0!==o){var s=o.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}}var c=r.parse(n,a);e(c.geometry,c.materials)},i,n)},setTexturePath:function(t){this.texturePath=t},parse:function(t,e){var n=new St,a=void 0!==t.scale?1/t.scale:1;if(function(e){function r(t,e){return t&1<<e}var a,o,s,h,l,u,p,d,f,m,g,v,y,x,_,b,w,M,E,T,S,A,L,R,P,C,I,U=t.faces,N=t.vertices,D=t.normals,O=t.colors,B=0;if(void 0!==t.uvs){for(a=0;a<t.uvs.length;a++)t.uvs[a].length&&B++;for(a=0;a<B;a++)n.faceVertexUvs[a]=[]}for(h=0,l=N.length;h<l;)M=new c,M.x=N[h++]*e,M.y=N[h++]*e,M.z=N[h++]*e,n.vertices.push(M);for(h=0,l=U.length;h<l;)if(m=U[h++],g=r(m,0),v=r(m,1),y=r(m,3),x=r(m,4),_=r(m,5),b=r(m,6),w=r(m,7),g){if(T=new ut,T.a=U[h],T.b=U[h+1],T.c=U[h+3],S=new ut,S.a=U[h+1],S.b=U[h+2],S.c=U[h+3],h+=4,v&&(f=U[h++],T.materialIndex=f,S.materialIndex=f),s=n.faces.length,y)for(a=0;a<B;a++)for(R=t.uvs[a],n.faceVertexUvs[a][s]=[],n.faceVertexUvs[a][s+1]=[],o=0;o<4;o++)d=U[h++],C=R[2*d],I=R[2*d+1],P=new i(C,I),2!==o&&n.faceVertexUvs[a][s].push(P),0!==o&&n.faceVertexUvs[a][s+1].push(P);if(x&&(p=3*U[h++],T.normal.set(D[p++],D[p++],D[p]),S.normal.copy(T.normal)),_)for(a=0;a<4;a++)p=3*U[h++],L=new c(D[p++],D[p++],D[p]),2!==a&&T.vertexNormals.push(L),0!==a&&S.vertexNormals.push(L);if(b&&(u=U[h++],A=O[u],T.color.setHex(A),S.color.setHex(A)),w)for(a=0;a<4;a++)u=U[h++],A=O[u],2!==a&&T.vertexColors.push(new W(A)),0!==a&&S.vertexColors.push(new W(A));n.faces.push(T),n.faces.push(S)}else{if(E=new ut,E.a=U[h++],E.b=U[h++],E.c=U[h++],v&&(f=U[h++],E.materialIndex=f),s=n.faces.length,y)for(a=0;a<B;a++)for(R=t.uvs[a],n.faceVertexUvs[a][s]=[],o=0;o<3;o++)d=U[h++],C=R[2*d],I=R[2*d+1],P=new i(C,I),n.faceVertexUvs[a][s].push(P);if(x&&(p=3*U[h++],E.normal.set(D[p++],D[p++],D[p])),_)for(a=0;a<3;a++)p=3*U[h++],L=new c(D[p++],D[p++],D[p]),E.vertexNormals.push(L);if(b&&(u=U[h++],E.color.setHex(O[u])),w)for(a=0;a<3;a++)u=U[h++],E.vertexColors.push(new W(O[u]));n.faces.push(E)}}(a),function(){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,a=t.skinWeights.length;i<a;i+=e){var o=t.skinWeights[i],s=e>1?t.skinWeights[i+1]:0,c=e>2?t.skinWeights[i+2]:0,h=e>3?t.skinWeights[i+3]:0;n.skinWeights.push(new r(o,s,c,h))}if(t.skinIndices)for(var i=0,a=t.skinIndices.length;i<a;i+=e){var l=t.skinIndices[i],u=e>1?t.skinIndices[i+1]:0,p=e>2?t.skinIndices[i+2]:0,d=e>3?t.skinIndices[i+3]:0;n.skinIndices.push(new r(l,u,p,d))}n.bones=t.bones,n.bones&&n.bones.length>0&&(n.skinWeights.length!==n.skinIndices.length||n.skinIndices.length!==n.vertices.length)&&console.warn("When skinning, number of vertices ("+n.vertices.length+"), skinIndices ("+n.skinIndices.length+"), and skinWeights ("+n.skinWeights.length+") should match.")}(),function(e){if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i<r;i++){n.morphTargets[i]={},n.morphTargets[i].name=t.morphTargets[i].name,n.morphTargets[i].vertices=[];for(var a=n.morphTargets[i].vertices,o=t.morphTargets[i].vertices,s=0,h=o.length;s<h;s+=3){var l=new c;l.x=o[s]*e,l.y=o[s+1]*e,l.z=o[s+2]*e,a.push(l)}}if(void 0!==t.morphColors&&t.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var u=n.faces,p=t.morphColors[0].colors,i=0,r=u.length;i<r;i++)u[i].color.fromArray(p,3*i)}}(a),function(){var e=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var a=Ji.parseAnimation(i[r],n.bones);a&&e.push(a)}if(n.morphTargets){var o=Ji.CreateClipsFromMorphTargetSequences(n.morphTargets,10);e=e.concat(o)}e.length>0&&(n.animations=e)}(),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===t.materials||0===t.materials.length)return{geometry:n};var o=$i.prototype.initMaterials(t.materials,e,this.crossOrigin);return{geometry:n,materials:o}}}),Object.assign(en.prototype,{load:function(t,e,i,n){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var r=this;new wi(r.manager).load(t,function(i){var a=null;try{a=JSON.parse(i)}catch(e){return void 0!==n&&n(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var o=a.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())return void console.error("THREE.ObjectLoader: Can't load "+t+". Use THREE.JSONLoader instead.");r.parse(a,e)},i,n)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var i=this.parseGeometries(t.geometries),n=this.parseImages(t.images,function(){void 0!==e&&e(o)}),r=this.parseTextures(t.textures,n),a=this.parseMaterials(t.materials,r),o=this.parseObject(t.object,i,a);return t.animations&&(o.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(o),o},parseGeometries:function(t){var e={};if(void 0!==t)for(var i=new tn,n=new Ki,r=0,a=t.length;r<a;r++){var o,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new gs[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new gs[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new gs[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new gs[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new gs[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new gs[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":o=new gs[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new gs[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new gs[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new gs[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new gs[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":o=n.parse(s);break;case"Geometry":o=i.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),e[s.uuid]=o}return e},parseMaterials:function(t,e){var i={};if(void 0!==t){var n=new Qi;n.setTextures(e);for(var r=0,a=t.length;r<a;r++){var o=n.parse(t[r]);i[o.uuid]=o}}return i},parseAnimations:function(t){for(var e=[],i=0;i<t.length;i++){var n=Ji.parse(t[i]);e.push(n)}return e},parseImages:function(t,e){var i=this,n={};if(void 0!==t&&t.length>0){var r=new bi(e),a=new Ti(r);a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var c=t[o],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:i.texturePath+c.url;n[c.uuid]=function(t){return i.manager.itemStart(t),a.load(t,function(){i.manager.itemEnd(t)},void 0,function(){i.manager.itemError(t)})}(h)}}return n},parseTextures:function(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var r={UVMapping:300,CubeReflectionMapping:qa,CubeRefractionMapping:Ya,EquirectangularReflectionMapping:Za,EquirectangularRefractionMapping:Ja,SphericalReflectionMapping:Qa,CubeUVReflectionMapping:Ka,CubeUVRefractionMapping:$a},a={RepeatWrapping:to,ClampToEdgeWrapping:eo,MirroredRepeatWrapping:io},o={NearestFilter:no,NearestMipMapNearestFilter:ro,NearestMipMapLinearFilter:ao,LinearFilter:oo,LinearMipMapNearestFilter:so,LinearMipMapLinearFilter:co},s={};if(void 0!==t)for(var c=0,h=t.length;c<h;c++){var l=t[c];void 0===l.image&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),void 0===e[l.image]&&console.warn("THREE.ObjectLoader: Undefined image",l.image);var u=new n(e[l.image]);u.needsUpdate=!0,u.uuid=l.uuid,void 0!==l.name&&(u.name=l.name),void 0!==l.mapping&&(u.mapping=i(l.mapping,r)),void 0!==l.offset&&u.offset.fromArray(l.offset),void 0!==l.repeat&&u.repeat.fromArray(l.repeat),void 0!==l.wrap&&(u.wrapS=i(l.wrap[0],a),u.wrapT=i(l.wrap[1],a)),void 0!==l.minFilter&&(u.minFilter=i(l.minFilter,o)),void 0!==l.magFilter&&(u.magFilter=i(l.magFilter,o)),void 0!==l.anisotropy&&(u.anisotropy=l.anisotropy),void 0!==l.flipY&&(u.flipY=l.flipY),s[l.uuid]=u}return s},parseObject:function(){var t=new h;return function(e,i,n){function r(t){return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),i[t]}function a(t){if(void 0!==t)return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}var o;switch(e.type){case"Scene":o=new ue,void 0!==e.background&&Number.isInteger(e.background)&&(o.background=new W(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?o.fog=new le(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(o.fog=new he(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Nt(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(o.focus=e.focus),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.filmGauge&&(o.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(o.filmOffset=e.filmOffset),void 0!==e.view&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new Dt(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":o=new Oi(e.color,e.intensity);break;case"DirectionalLight":o=new Di(e.color,e.intensity);break;case"PointLight":o=new Ui(e.color,e.intensity,e.distance,e.decay);break;case"SpotLight":o=new Ii(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Ri(e.color,e.groundColor,e.intensity);break;case"Mesh":var s=r(e.geometry),c=a(e.material);o=s.bones&&s.bones.length>0?new ye(s,c):new Lt(s,c);break;case"LOD":o=new me;break;case"Line":o=new _e(r(e.geometry),a(e.material),e.mode);break;case"LineSegments":o=new be(r(e.geometry),a(e.material));break;case"PointCloud":case"Points":o=new Me(r(e.geometry),a(e.material));break;case"Sprite":o=new fe(a(e.material));break;case"Group":o=new Ee;break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh type. Instantiates Object3D instead.");default:o=new ct}if(o.uuid=e.uuid,void 0!==e.name&&(o.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(o.position,o.quaternion,o.scale)):(void 0!==e.position&&o.position.fromArray(e.position),void 0!==e.rotation&&o.rotation.fromArray(e.rotation),void 0!==e.quaternion&&o.quaternion.fromArray(e.quaternion),void 0!==e.scale&&o.scale.fromArray(e.scale)),void 0!==e.castShadow&&(o.castShadow=e.castShadow),void 0!==e.receiveShadow&&(o.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(o.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(o.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&o.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(o.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.children)for(var h in e.children)o.add(this.parseObject(e.children[h],i,n));if("LOD"===e.type)for(var l=e.levels,u=0;u<l.length;u++){var p=l[u],h=o.getObjectByProperty("uuid",p.object);void 0!==h&&o.addLevel(h,p.distance)}return o}}()}),dn.prototype={constructor:dn,getPoint:function(t){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(t){var e=this.getUtoTmapping(t);return this.getPoint(e)},getPoints:function(t){isNaN(t)&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){isNaN(t)&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(isNaN(t)&&(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i,n=[],r=this.getPoint(0),a=0;for(n.push(0),i=1;i<=t;i++)e=this.getPoint(i/t),a+=e.distanceTo(r),n.push(a),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var i,n=this.getLengths(),r=0,a=n.length;i=e||t*n[a-1];for(var o,s=0,c=a-1;s<=c;)if(r=Math.floor(s+(c-s)/2),(o=n[r]-i)<0)s=r+1;else{if(!(o>0)){c=r;break}c=r-1}if(r=c,n[r]===i){var h=r/(a-1);return h}var l=n[r],u=n[r+1],p=u-l,d=(i-l)/p,h=(r+d)/(a-1);return h},getTangent:function(t){var e=t-1e-4,i=t+1e-4;e<0&&(e=0),i>1&&(i=1);var n=this.getPoint(e);return this.getPoint(i).clone().sub(n).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var i,n,r,a=new c,o=[],s=[],l=[],u=new c,p=new h;for(i=0;i<=t;i++)n=i/t,o[i]=this.getTangentAt(n),o[i].normalize();s[0]=new c,l[0]=new c;var d=Number.MAX_VALUE,f=Math.abs(o[0].x),m=Math.abs(o[0].y),g=Math.abs(o[0].z);for(f<=d&&(d=f,a.set(1,0,0)),m<=d&&(d=m,a.set(0,1,0)),g<=d&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),l[0].crossVectors(o[0],s[0]),i=1;i<=t;i++)s[i]=s[i-1].clone(),l[i]=l[i-1].clone(),u.crossVectors(o[i-1],o[i]),u.length()>Number.EPSILON&&(u.normalize(),r=Math.acos($o.clamp(o[i-1].dot(o[i]),-1,1)),s[i].applyMatrix4(p.makeRotationAxis(u,r))),l[i].crossVectors(o[i],s[i]);if(!0===e)for(r=Math.acos($o.clamp(s[0].dot(s[t]),-1,1)),r/=t,o[0].dot(u.crossVectors(s[0],s[t]))>0&&(r=-r),i=1;i<=t;i++)s[i].applyMatrix4(p.makeRotationAxis(o[i],r*i)),l[i].crossVectors(o[i],s[i]);return{tangents:o,normals:s,binormals:l}}},fn.prototype=Object.create(dn.prototype),fn.prototype.constructor=fn,fn.prototype.isLineCurve=!0,fn.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},fn.prototype.getPointAt=function(t){return this.getPoint(t)},fn.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},mn.prototype=Object.assign(Object.create(dn.prototype),{constructor:mn,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new fn(e,t))},getPoint:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),n=0;n<i.length;){if(i[n]>=e){var r=i[n]-e,a=this.curves[n],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){isNaN(t)&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,i=[],n=0,r=this.curves;n<r.length;n++)for(var a=r[n],o=a&&a.isEllipseCurve?2*t:a&&a.isLineCurve?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),c=0;c<s.length;c++){var h=s[c];e&&e.equals(h)||(i.push(h),e=h)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new St,i=0,n=t.length;i<n;i++){var r=t[i];e.vertices.push(new c(r.x,r.y,r.z||0))}return e}}),gn.prototype=Object.create(dn.prototype),gn.prototype.constructor=gn,gn.prototype.isEllipseCurve=!0,gn.prototype.getPoint=function(t){for(var e=2*Math.PI,n=this.aEndAngle-this.aStartAngle,r=Math.abs(n)<Number.EPSILON;n<0;)n+=e;for(;n>e;)n-=e;n<Number.EPSILON&&(n=r?0:e),!0!==this.aClockwise||r||(n===e?n=-e:n-=e);var a=this.aStartAngle+t*n,o=this.aX+this.xRadius*Math.cos(a),s=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),h=Math.sin(this.aRotation),l=o-this.aX,u=s-this.aY;o=l*c-u*h+this.aX,s=l*h+u*c+this.aY}return new i(o,s)},vn.prototype=Object.create(dn.prototype),vn.prototype.constructor=vn,vn.prototype.isSplineCurve=!0,vn.prototype.getPoint=function(t){var e=this.points,n=(e.length-1)*t,r=Math.floor(n),a=n-r,o=e[0===r?r:r-1],s=e[r],c=e[r>e.length-2?e.length-1:r+1],h=e[r>e.length-3?e.length-1:r+2];return new i(nn(a,o.x,s.x,c.x,h.x),nn(a,o.y,s.y,c.y,h.y))},yn.prototype=Object.create(dn.prototype),yn.prototype.constructor=yn,yn.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2,a=this.v3;return new i(pn(t,e.x,n.x,r.x,a.x),pn(t,e.y,n.y,r.y,a.y))},xn.prototype=Object.create(dn.prototype),xn.prototype.constructor=xn,xn.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2;return new i(sn(t,e.x,n.x,r.x),sn(t,e.y,n.y,r.y))};var ws=Object.assign(Object.create(mn.prototype),{fromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new fn(this.currentPoint.clone(),new i(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,r){var a=new xn(this.currentPoint.clone(),new i(t,e),new i(n,r));this.curves.push(a),this.currentPoint.set(n,r)},bezierCurveTo:function(t,e,n,r,a,o){var s=new yn(this.currentPoint.clone(),new i(t,e),new i(n,r),new i(a,o));this.curves.push(s),this.currentPoint.set(a,o)},splineThru:function(t){var e=[this.currentPoint.clone()].concat(t),i=new vn(e);this.curves.push(i),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,i,n,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+o,e+s,i,n,r,a)},absarc:function(t,e,i,n,r,a){this.absellipse(t,e,i,i,n,r,a)},ellipse:function(t,e,i,n,r,a,o,s){var c=this.currentPoint.x,h=this.currentPoint.y;this.absellipse(t+c,e+h,i,n,r,a,o,s)},absellipse:function(t,e,i,n,r,a,o,s){var c=new gn(t,e,i,n,r,a,o,s);if(this.curves.length>0){var h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);var l=c.getPoint(1);this.currentPoint.copy(l)}});_n.prototype=ws,ws.constructor=_n,bn.prototype=Object.assign(Object.create(ws),{constructor:bn,getPointsHoles:function(t){for(var e=[],i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e},extractAllPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},extractPoints:function(t){return this.extractAllPoints(t)}}),wn.prototype={moveTo:function(t,e){this.currentPath=new _n,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,i,n){this.currentPath.quadraticCurveTo(t,e,i,n)},bezierCurveTo:function(t,e,i,n,r,a){this.currentPath.bezierCurveTo(t,e,i,n,r,a)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function i(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],a=new bn;a.curves=r.curves,e.push(a)}return e}var n=ms.isClockWise,r=this.subPaths;if(0===r.length)return[];if(!0===e)return i(r);var a,o,s,c=[];if(1===r.length)return o=r[0],s=new bn,s.curves=o.curves,c.push(s),c;var h=!n(r[0].getPoints());h=t?!h:h;var l,u=[],p=[],d=[],f=0;p[f]=void 0,d[f]=[];for(var m=0,g=r.length;m<g;m++)o=r[m],l=o.getPoints(),a=n(l),a=t?!a:a,a?(!h&&p[f]&&f++,p[f]={s:new bn,p:l},p[f].s.curves=o.curves,h&&f++,d[f]=[]):d[f].push({h:o,p:l[0]});if(!p[0])return i(r);if(p.length>1){for(var v=!1,y=[],x=0,_=p.length;x<_;x++)u[x]=[];for(var x=0,_=p.length;x<_;x++)for(var b=d[x],w=0;w<b.length;w++){for(var M=b[w],E=!0,T=0;T<p.length;T++)(function(t,e){for(var i=e.length,n=!1,r=i-1,a=0;a<i;r=a++){var o=e[r],s=e[a],c=s.x-o.x,h=s.y-o.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(o=e[a],c=-c,s=e[r],h=-h),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var l=h*(t.x-o.x)-c*(t.y-o.y);if(0===l)return!0;if(l<0)continue;n=!n}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return n})(M.p,p[T].p)&&(x!==T&&y.push({froms:x,tos:T,hole:w}),E?(E=!1,u[T].push(M)):v=!0);E&&u[x].push(M)}y.length>0&&(v||(d=u))}for(var S,m=0,A=p.length;m<A;m++){s=p[m].s,c.push(s),S=d[m];for(var L=0,R=S.length;L<R;L++)s.holes.push(S[L].h)}return c}},Object.assign(Mn.prototype,{isFont:!0,generateShapes:function(t,e,i){function n(t,e,n,a){var o=r.glyphs[t]||r.glyphs["?"];if(o){var s,c,h,l,u,p,d,f,m,g,v,y=new wn,x=[];if(o.o)for(var _=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),b=0,w=_.length;b<w;){var M=_[b++];switch(M){case"m":s=_[b++]*e+n,c=_[b++]*e+a,y.moveTo(s,c);break;case"l":s=_[b++]*e+n,c=_[b++]*e+a,y.lineTo(s,c);break;case"q":if(h=_[b++]*e+n,l=_[b++]*e+a,d=_[b++]*e+n,f=_[b++]*e+a,y.quadraticCurveTo(d,f,h,l),v=x[x.length-1]){u=v.x,p=v.y;for(var E=1;E<=i;E++){var T=E/i;sn(T,u,d,h),sn(T,p,f,l)}}break;case"b":if(h=_[b++]*e+n,l=_[b++]*e+a,d=_[b++]*e+n,f=_[b++]*e+a,m=_[b++]*e+n,g=_[b++]*e+a,y.bezierCurveTo(d,f,m,g,h,l),v=x[x.length-1]){u=v.x,p=v.y;for(var E=1;E<=i;E++){var T=E/i;pn(T,u,d,m,h),pn(T,p,f,g,l)}}}}return{offsetX:o.ha*e,path:y}}}void 0===e&&(e=100),void 0===i&&(i=4);for(var r=this.data,a=function(t){for(var i=String(t).split(""),a=e/r.resolution,o=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,s=0,c=0,h=[],l=0;l<i.length;l++){var u=i[l];if("\n"===u)s=0,c-=o;else{var p=n(u,a,s,c);s+=p.offsetX,h.push(p.path)}}return h}(t),o=[],s=0,c=a.length;s<c;s++)Array.prototype.push.apply(o,a[s].toShapes());return o}}),Object.assign(En.prototype,{load:function(t,e,i,n){var r=this;new wi(this.manager).load(t,function(t){var i;try{i=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(t.substring(65,t.length-2))}var n=r.parse(i);e&&e(n)},i,n)},parse:function(t){return new Mn(t)}});var Ms,Es={getContext:function(){return void 0===Ms&&(Ms=new(window.AudioContext||window.webkitAudioContext)),Ms},setContext:function(t){Ms=t}};Object.assign(Tn.prototype,{load:function(t,e,i,n){var r=new wi(this.manager);r.setResponseType("arraybuffer"),r.load(t,function(t){Es.getContext().decodeAudioData(t,function(t){e(t)})},i,n)}}),Sn.prototype=Object.assign(Object.create(Li.prototype),{constructor:Sn,isRectAreaLight:!0,copy:function(t){return Li.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this}}),Object.assign(An.prototype,{update:function(){var t,e,i,n,r,a,o,s=new h,c=new h;return function(h){if(t!==this||e!==h.focus||i!==h.fov||n!==h.aspect*this.aspect||r!==h.near||a!==h.far||o!==h.zoom){t=this,e=h.focus,i=h.fov,n=h.aspect*this.aspect,r=h.near,a=h.far,o=h.zoom;var l,u,p=h.projectionMatrix.clone(),d=this.eyeSep/2,f=d*r/e,m=r*Math.tan($o.DEG2RAD*i*.5)/o;c.elements[12]=-d,s.elements[12]=d,l=-m*n+f,u=m*n+f,p.elements[0]=2*r/(u-l),p.elements[8]=(u+l)/(u-l),this.cameraL.projectionMatrix.copy(p),l=-m*n-f,u=m*n-f,p.elements[0]=2*r/(u-l),p.elements[8]=(u+l)/(u-l),this.cameraR.projectionMatrix.copy(p)}this.cameraL.matrixWorld.copy(h.matrixWorld).multiply(c),this.cameraR.matrixWorld.copy(h.matrixWorld).multiply(s)}}()}),Ln.prototype=Object.create(ct.prototype),Ln.prototype.constructor=Ln,Rn.prototype=Object.assign(Object.create(ct.prototype),{constructor:Rn,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){this.gain.gain.value=t},updateMatrixWorld:function(){var t=new c,e=new s,i=new c,n=new c;return function(r){ct.prototype.updateMatrixWorld.call(this,r);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(t,e,i),n.set(0,0,-1).applyQuaternion(e),a.positionX?(a.positionX.setValueAtTime(t.x,this.context.currentTime),a.positionY.setValueAtTime(t.y,this.context.currentTime),a.positionZ.setValueAtTime(t.z,this.context.currentTime),a.forwardX.setValueAtTime(n.x,this.context.currentTime),a.forwardY.setValueAtTime(n.y,this.context.currentTime),a.forwardZ.setValueAtTime(n.z,this.context.currentTime),a.upX.setValueAtTime(o.x,this.context.currentTime),a.upY.setValueAtTime(o.y,this.context.currentTime),a.upZ.setValueAtTime(o.z,this.context.currentTime)):(a.setPosition(t.x,t.y,t.z),a.setOrientation(n.x,n.y,n.z,o.x,o.y,o.z))}}()}),Pn.prototype=Object.assign(Object.create(ct.prototype),{constructor:Pn,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),t.start(0,this.startTime),this.isPlaying=!0,this.source=t,this.connect()},pause:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),
117
+ this.startTime=this.context.currentTime,this.isPlaying=!1,this)},stop:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=0,this.isPlaying=!1,this)},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this)},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.value=t,this}}),Cn.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Cn,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){this.panner.refDistance=t},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){this.panner.rolloffFactor=t},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){this.panner.distanceModel=t},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){this.panner.maxDistance=t},updateMatrixWorld:function(){var t=new c;return function(e){ct.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}()}),Object.assign(In.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),i=0;i<e.length;i++)t+=e[i];return t/e.length}}),Un.prototype={constructor:Un,accumulate:function(t,e){var i=this.buffer,n=this.valueSize,r=t*n+n,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==n;++o)i[r+o]=i[o];a=e}else{a+=e;var s=e/a;this._mixBufferRegion(i,r,0,s,n)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*e;this._mixBufferRegion(i,n,o,1-r,e)}for(var s=e,c=e+e;s!==c;++s)if(i[s]!==i[s+e]){a.setValue(i,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,i=this.valueSize,n=3*i;t.getValue(e,n);for(var r=i,a=n;r!==a;++r)e[r]=e[n+r%i];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,i,n,r){if(n>=.5)for(var a=0;a!==r;++a)t[e+a]=t[i+a]},_slerp:function(t,e,i,n,r){s.slerpFlat(t,e,t,e,t,i,n)},_lerp:function(t,e,i,n,r){for(var a=1-n,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[i+o]*n}}},Nn.prototype={constructor:Nn,getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(t=Nn.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error(" trying to update node for track: "+this.path+" but it wasn't found.");if(i){var a=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error(" can not bind to material as node does not have a material",this);if(!t.material.materials)return void console.error(" can not bind to material.materials as node.material does not have a materials array",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error(" can not bind to bones as node does not have a skeleton",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[i])return void console.error(" can not bind to objectName of node, undefined",this);t=t[i]}if(void 0!==a){if(void 0===t[a])return void console.error(" trying to bind to objectIndex of objectName, but is undefined:",this,t);t=t[a]}}var s=t[n];if(void 0===s){var c=e.nodeName;return void console.error(" trying to update property for track: "+c+"."+n+" but it wasn't found.",t)}var h=this.Versioning.None;void 0!==t.needsUpdate?(h=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t);var l=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!t.geometry.morphTargets)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(var o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===r){r=o;break}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):void 0!==s.length?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][h]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(Nn.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:Nn.prototype.getValue,_setValue_unbound:Nn.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)t[e++]=i[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),Nn.Composite=function(t,e,i){var n=i||Nn.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)},Nn.Composite.prototype={constructor:Nn.Composite,getValue:function(t,e){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Nn.create=function(t,e,i){return t&&t.isAnimationObjectGroup?new Nn.Composite(t,e,i):new Nn(t,e,i)},Nn.parseTrackName=function(t){var e=/^((?:[\w-]+[\/:])*)([\w-]+)?(?:\.([\w-]+)(?:\[(.+)\])?)?\.([\w-]+)(?:\[(.+)\])?$/,i=e.exec(t);if(!i)throw new Error("cannot parse trackName at all: "+t);var n={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]};if(null===n.propertyName||0===n.propertyName.length)throw new Error("can not parse propertyName from trackName: "+t);return n},Nn.findNode=function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=function(t){for(var i=0;i<t.bones.length;i++){var n=t.bones[i];if(n.name===e)return n}return null}(t.skeleton);if(i)return i}if(t.children){var n=function(t){for(var i=0;i<t.length;i++){var r=t[i];if(r.name===e||r.uuid===e)return r;var a=n(r.children);if(a)return a}return null},r=n(t.children);if(r)return r}return null},Dn.prototype={constructor:Dn,isAnimationObjectGroup:!0,add:function(t){for(var e=this._objects,i=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,a=this._paths,o=this._parsedPaths,s=this._bindings,c=s.length,h=0,l=arguments.length;h!==l;++h){var u=arguments[h],p=u.uuid,d=r[p],f=void 0;if(void 0===d){d=i++,r[p]=d,e.push(u);for(var m=0,g=c;m!==g;++m)s[m].push(new Nn(u,a[m],o[m]))}else if(d<n){f=e[d];var v=--n,y=e[v];r[y.uuid]=d,e[d]=y,r[p]=v,e[v]=u;for(var m=0,g=c;m!==g;++m){var x=s[m],_=x[v],b=x[d];x[d]=_,void 0===b&&(b=new Nn(u,a[m],o[m])),x[v]=b}}else e[d]!==f&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=n},remove:function(t){for(var e=this._objects,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],h=c.uuid,l=n[h];if(void 0!==l&&l>=i){var u=i++,p=e[u];n[p.uuid]=l,e[l]=p,n[h]=u,e[u]=c;for(var d=0,f=a;d!==f;++d){var m=r[d],g=m[u],v=m[l];m[l]=g,m[u]=v}}}this.nCachedObjects_=i},uncache:function(t){for(var e=this._objects,i=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,a=this._bindings,o=a.length,s=0,c=arguments.length;s!==c;++s){var h=arguments[s],l=h.uuid,u=r[l];if(void 0!==u)if(delete r[l],u<n){var p=--n,d=e[p],f=--i,m=e[f];r[d.uuid]=u,e[u]=d,r[m.uuid]=p,e[p]=m,e.pop();for(var g=0,v=o;g!==v;++g){var y=a[g],x=y[p],_=y[f];y[u]=x,y[p]=_,y.pop()}}else{var f=--i,m=e[f];r[m.uuid]=u,e[u]=m,e.pop();for(var g=0,v=o;g!==v;++g){var y=a[g];y[u]=y[f],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var i=this._bindingsIndicesByPath,n=i[t],r=this._bindings;if(void 0!==n)return r[n];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,h=this.nCachedObjects_,l=new Array(c);n=r.length,i[t]=n,a.push(t),o.push(e),r.push(l);for(var u=h,p=s.length;u!==p;++u){var d=s[u];l[u]=new Nn(d,t,e)}return l},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){var n=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];e[t[o]]=i,a[i]=s,a.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}},On.prototype={constructor:On,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){var n=this._clip.duration,r=t._clip.duration,a=r/n,o=n/r;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,i){return t.crossFadeFrom(this,e,i)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,i){var n=this._mixer,r=n.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=r,s[1]=r+i,c[0]=t/o,c[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,i,n){var r=this._startTime;if(null!==r){var a=(t-r)*i;if(a<0||0===i)return;this._startTime=null,e=i*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var c=this._interpolants,h=this._propertyBindings,l=0,u=c.length;l!==u;++l)c[l].evaluate(o),h[l].accumulate(n,s)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var i=this._clip.duration,n=this.loop,r=this._loopCount;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=i)e=i;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{var a=2202===n;if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),e>=i||e<0){var o=Math.floor(e/i);e-=i*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(0===s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1==(1&r))return this.time=e,i-e}return this.time=e,e},_setEndings:function(t,e,i){var n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:Go:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:Go:2402)},_scheduleFading:function(t,e,i){var n=this._mixer,r=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=e,o[1]=r+t,s[1]=i,this}},Bn.prototype={constructor:Bn,clipAction:function(t,e){var i=e||this._root,n=i.uuid,r="string"==typeof t?Ji.findByName(i,t):t,a=null!==r?r.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[n];if(void 0!==c)return c;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var h=new On(this,r,e);return this._bindAction(h,s),this._addInactiveAction(h,a,n),h},existingAction:function(t,e){var i=e||this._root,n=i.uuid,r="string"==typeof t?Ji.findByName(i,t):t,a=r?r.uuid:t,o=this._actionsByClip[a];return void 0!==o?o.actionByRoot[n]||null:null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,i=this._bindings,n=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(var r=0;r!==n;++r)i[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1,o=0;o!==i;++o){var s=e[o];s.enabled&&s._update(n,t,r,a)}for(var c=this._bindings,h=this._nActiveBindings,o=0;o!==h;++o)c[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var h=c._cacheIndex,l=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=h,e[h]=l,e.pop(),this._removeInactiveBindingsForAction(c)}delete n[i]}},uncacheRoot:function(t){var e=t.uuid,i=this._actionsByClip;for(var n in i){var r=i[n].actionByRoot,a=r[e];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[e];if(void 0!==s)for(var c in s){var h=s[c];h.restoreOriginalState(),this._removeInactiveBinding(h)}},uncacheAction:function(t,e){var i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}},Object.assign(Bn.prototype,{_bindAction:function(t,e){var i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,a=t._propertyBindings,o=t._interpolants,s=i.uuid,c=this._bindingsByRootAndName,h=c[s];void 0===h&&(h={},c[s]=h);for(var l=0;l!==r;++l){var u=n[l],p=u.name,d=h[p];if(void 0!==d)a[l]=d;else{if(void 0!==(d=a[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[l].binding.parsedPath;d=new Un(Nn.create(i,p,f),u.ValueTypeName,u.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,p),a[l]=d}o[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}for(var r=t._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,i){var n=this._actions,r=this._actionsByClip,a=r[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=n.length,n.push(t),a.actionByRoot[i]=t},_removeInactiveAction:function(t){var e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,c=s[s.length-1],h=t._byClipCacheIndex;c._byClipCacheIndex=h,s[h]=c,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackAction:function(t){var e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_addInactiveBinding:function(t,e,i){var n=this._bindingsByRootAndName,r=n[e],a=this._bindings;void 0===r&&(r={},n[e]=r),r[i]=t,t._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,a=this._bindingsByRootAndName,o=a[n],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete o[r];t:{for(var h in o)break t;delete a[n]}},_lendBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&(i=new zi(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r},_controlInterpolantsResultBuffer:new Float32Array(1)}),Object.assign(Bn.prototype,e.prototype),Fn.prototype.clone=function(){return new Fn(void 0===this.value.clone?this.value:this.value.clone())},zn.prototype=Object.create(At.prototype),zn.prototype.constructor=zn,zn.prototype.isInstancedBufferGeometry=!0,zn.prototype.addGroup=function(t,e,i){this.groups.push({start:t,count:e,materialIndex:i})},zn.prototype.copy=function(t){var e=t.index;null!==e&&this.setIndex(e.clone());var i=t.attributes;for(var n in i){var r=i[n];this.addAttribute(n,r.clone())}for(var a=t.groups,o=0,s=a.length;o<s;o++){var c=a[o];this.addGroup(c.start,c.count,c.materialIndex)}return this},Gn.prototype={constructor:Gn,isInterleavedBufferAttribute:!0,get count(){return this.data.count},get array(){return this.data.array},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this}},Hn.prototype={constructor:Hn,isInterleavedBuffer:!0,set needsUpdate(t){!0===t&&this.version++},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.stride:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(var n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}},Vn.prototype=Object.create(Hn.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isInstancedInterleavedBuffer=!0,Vn.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},kn.prototype=Object.create(dt.prototype),kn.prototype.constructor=kn,kn.prototype.isInstancedBufferAttribute=!0,kn.prototype.copy=function(t){return dt.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},jn.prototype={constructor:jn,linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e){var i=[];return Xn(t,this,i,e),i.sort(Wn),i},intersectObjects:function(t,e){var i=[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var n=0,r=t.length;n<r;n++)Xn(t[n],this,i,e);return i.sort(Wn),i}},qn.prototype={constructor:qn,start:function(){this.startTime=(performance||Date).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running&&this.start(),this.running){var e=(performance||Date).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}},Yn.prototype={constructor:Yn,set:function(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.radius=t.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos($o.clamp(t.y/this.radius,-1,1))),this}},Zn.prototype={constructor:Zn,set:function(t,e,i){return this.radius=t,this.theta=e,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.radius=Math.sqrt(t.x*t.x+t.z*t.z),this.theta=Math.atan2(t.x,t.z),this.y=t.y,this}},Jn.prototype=Object.create(Lt.prototype),Jn.prototype.constructor=Jn,Jn.prototype.createAnimation=function(t,e,i,n){var r={start:e,end:i,length:i-e+1,fps:n,duration:(i-e)/n,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[t]=r,this.animationsList.push(r)},Jn.prototype.autoCreateAnimations=function(t){for(var e,i=/([a-z]+)_?(\d+)/i,n={},r=this.geometry,a=0,o=r.morphTargets.length;a<o;a++){var s=r.morphTargets[a],c=s.name.match(i);if(c&&c.length>1){var h=c[1];n[h]||(n[h]={start:1/0,end:-1/0});var l=n[h];a<l.start&&(l.start=a),a>l.end&&(l.end=a),e||(e=h)}}for(var h in n){var l=n[h];this.createAnimation(h,l.start,l.end,t)}this.firstAnimation=e},Jn.prototype.setAnimationDirectionForward=function(t){var e=this.animationsMap[t];e&&(e.direction=1,e.directionBackwards=!1)},Jn.prototype.setAnimationDirectionBackward=function(t){var e=this.animationsMap[t];e&&(e.direction=-1,e.directionBackwards=!0)},Jn.prototype.setAnimationFPS=function(t,e){var i=this.animationsMap[t];i&&(i.fps=e,i.duration=(i.end-i.start)/i.fps)},Jn.prototype.setAnimationDuration=function(t,e){var i=this.animationsMap[t];i&&(i.duration=e,i.fps=(i.end-i.start)/i.duration)},Jn.prototype.setAnimationWeight=function(t,e){var i=this.animationsMap[t];i&&(i.weight=e)},Jn.prototype.setAnimationTime=function(t,e){var i=this.animationsMap[t];i&&(i.time=e)},Jn.prototype.getAnimationTime=function(t){var e=0,i=this.animationsMap[t];return i&&(e=i.time),e},Jn.prototype.getAnimationDuration=function(t){var e=-1,i=this.animationsMap[t];return i&&(e=i.duration),e},Jn.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},Jn.prototype.stopAnimation=function(t){var e=this.animationsMap[t];e&&(e.active=!1)},Jn.prototype.update=function(t){for(var e=0,i=this.animationsList.length;e<i;e++){var n=this.animationsList[e];if(n.active){var r=n.duration/n.length;n.time+=n.direction*t,n.mirroredLoop?(n.time>n.duration||n.time<0)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),n.time<0&&(n.time=0,n.directionBackwards=!1)):(n.time=n.time%n.duration,n.time<0&&(n.time+=n.duration));var a=n.start+$o.clamp(Math.floor(n.time/r),0,n.length-1),o=n.weight;a!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*o,this.morphTargetInfluences[a]=0,n.lastFrame=n.currentFrame,n.currentFrame=a);var s=n.time%r/r;n.directionBackwards&&(s=1-s),n.currentFrame!==n.lastFrame?(this.morphTargetInfluences[n.currentFrame]=s*o,this.morphTargetInfluences[n.lastFrame]=(1-s)*o):this.morphTargetInfluences[n.currentFrame]=o}}},Qn.prototype=Object.create(ct.prototype),Qn.prototype.constructor=Qn,Qn.prototype.isImmediateRenderObject=!0,Kn.prototype=Object.create(be.prototype),Kn.prototype.constructor=Kn,Kn.prototype.update=function(){var t=new c,e=new c,i=new et;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o&&o.isGeometry)for(var s=o.vertices,c=o.faces,h=0,l=0,u=c.length;l<u;l++)for(var p=c[l],d=0,f=p.vertexNormals.length;d<f;d++){var m=s[p[n[d]]],g=p.vertexNormals[d];t.copy(m).applyMatrix4(r),e.copy(g).applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1}else if(o&&o.isBufferGeometry)for(var v=o.attributes.position,y=o.attributes.normal,h=0,d=0,f=v.count;d<f;d++)t.set(v.getX(d),v.getY(d),v.getZ(d)).applyMatrix4(r),e.set(y.getX(d),y.getY(d),y.getZ(d)),e.applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1;return a.needsUpdate=!0,this}}(),$n.prototype=Object.create(ct.prototype),$n.prototype.constructor=$n,$n.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},$n.prototype.update=function(){var t=new c,e=new c;return function(){var i=this.light.distance?this.light.distance:1e3,n=i*Math.tan(this.light.angle);this.cone.scale.set(n,n,i),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),
118
+ this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),tr.prototype=Object.create(be.prototype),tr.prototype.constructor=tr,tr.prototype.getBoneList=function(t){var e=[];t&&t.isBone&&e.push(t);for(var i=0;i<t.children.length;i++)e.push.apply(e,this.getBoneList(t.children[i]));return e},tr.prototype.update=function(){var t=new c,e=new h,i=new h;return function(){var n=this.geometry,r=n.getAttribute("position");i.getInverse(this.root.matrixWorld);for(var a=0,o=0;a<this.bones.length;a++){var s=this.bones[a];s.parent&&s.parent.isBone&&(e.multiplyMatrices(i,s.matrixWorld),t.setFromMatrixPosition(e),r.setXYZ(o,t.x,t.y,t.z),e.multiplyMatrices(i,s.parent.matrixWorld),t.setFromMatrixPosition(e),r.setXYZ(o+1,t.x,t.y,t.z),o+=2)}n.getAttribute("position").needsUpdate=!0}}(),er.prototype=Object.create(Lt.prototype),er.prototype.constructor=er,er.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},er.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},ir.prototype=Object.create(ct.prototype),ir.prototype.constructor=ir,ir.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose(),this.children[1].geometry.dispose(),this.children[1].material.dispose()},ir.prototype.update=function(){var t=new c,e=new c;return function(){var i=this.children[0],n=this.children[1];if(this.light.target){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld);var r=e.clone().sub(t);i.lookAt(r),n.lookAt(r)}i.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),n.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var a=.5*this.light.width,o=.5*this.light.height,s=i.geometry.getAttribute("position"),c=s.array;c[0]=a,c[1]=-o,c[2]=0,c[3]=a,c[4]=o,c[5]=0,c[6]=-a,c[7]=o,c[8]=0,c[9]=-a,c[10]=o,c[11]=0,c[12]=-a,c[13]=-o,c[14]=0,c[15]=a,c[16]=-o,c[17]=0,s.needsUpdate=!0}}(),nr.prototype=Object.create(ct.prototype),nr.prototype.constructor=nr,nr.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},nr.prototype.update=function(){var t=new c,e=new W,i=new W;return function(){var n=this.children[0],r=n.geometry.getAttribute("color");e.copy(this.light.color).multiplyScalar(this.light.intensity),i.copy(this.light.groundColor).multiplyScalar(this.light.intensity);for(var a=0,o=r.count;a<o;a++){var s=a<o/2?e:i;r.setXYZ(a,s.r,s.g,s.b)}n.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate()),r.needsUpdate=!0}}(),rr.prototype=Object.create(be.prototype),rr.prototype.constructor=rr,ar.prototype=Object.create(be.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(be.prototype),or.prototype.constructor=or,or.prototype.update=function(){var t=new c,e=new c,i=new et;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,r=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,c=0,h=0,l=s.length;h<l;h++){var u=s[h],p=u.normal;t.copy(o[u.a]).add(o[u.b]).add(o[u.c]).divideScalar(3).applyMatrix4(n),e.copy(p).applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),r.setXYZ(c,t.x,t.y,t.z),c+=1,r.setXYZ(c,e.x,e.y,e.z),c+=1}return r.needsUpdate=!0,this}}(),sr.prototype=Object.create(ct.prototype),sr.prototype.constructor=sr,sr.prototype.dispose=function(){var t=this.children[0],e=this.children[1];t.geometry.dispose(),t.material.dispose(),e.geometry.dispose(),e.material.dispose()},sr.prototype.update=function(){var t=new c,e=new c,i=new c;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(e,t);var n=this.children[0],r=this.children[1];n.lookAt(i),n.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),r.lookAt(i),r.scale.z=i.length()}}(),cr.prototype=Object.create(be.prototype),cr.prototype.constructor=cr,cr.prototype.update=function(){function t(t,a,o,s){n.set(a,o,s).unproject(r);var c=i[t];if(void 0!==c)for(var h=e.getAttribute("position"),l=0,u=c.length;l<u;l++)h.setXYZ(c[l],n.x,n.y,n.z)}var e,i,n=new c,r=new Ut;return function(){e=this.geometry,i=this.pointMap;r.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-1,-1,-1),t("n2",1,-1,-1),t("n3",-1,1,-1),t("n4",1,1,-1),t("f1",-1,-1,1),t("f2",1,-1,1),t("f3",-1,1,1),t("f4",1,1,1),t("u1",.7,1.1,-1),t("u2",-.7,1.1,-1),t("u3",0,2,-1),t("cf1",-1,0,1),t("cf2",1,0,1),t("cf3",0,-1,1),t("cf4",0,1,1),t("cn1",-1,0,-1),t("cn2",1,0,-1),t("cn3",0,-1,-1),t("cn4",0,1,-1),e.getAttribute("position").needsUpdate=!0}}(),hr.prototype=Object.create(be.prototype),hr.prototype.constructor=hr,hr.prototype.update=function(){var t=new $;return function(e){if(e&&e.isBox3?t.copy(e):t.setFromObject(e),!t.isEmpty()){var i=t.min,n=t.max,r=this.geometry.attributes.position,a=r.array;a[0]=n.x,a[1]=n.y,a[2]=n.z,a[3]=i.x,a[4]=n.y,a[5]=n.z,a[6]=i.x,a[7]=i.y,a[8]=n.z,a[9]=n.x,a[10]=i.y,a[11]=n.z,a[12]=n.x,a[13]=n.y,a[14]=i.z,a[15]=i.x,a[16]=n.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=n.x,a[22]=i.y,a[23]=i.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}();var Ts,Ss;lr.prototype=Object.create(ct.prototype),lr.prototype.constructor=lr,lr.prototype.setDirection=function(){var t,e=new c;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(i.z,0,-i.x).normalize(),t=Math.acos(i.y),this.quaternion.setFromAxisAngle(e,t))}}(),lr.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},lr.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},ur.prototype=Object.create(be.prototype),ur.prototype.constructor=ur;var As=new c,Ls=new pr,Rs=new pr,Ps=new pr;dr.prototype=Object.create(dn.prototype),dr.prototype.constructor=dr,dr.prototype.getPoint=function(t){var e=this.points,i=e.length;i<2&&console.log("duh, you need at least 2 points");var n=(i-(this.closed?0:1))*t,r=Math.floor(n),a=n-r;this.closed?r+=r>0?0:(Math.floor(Math.abs(r)/e.length)+1)*e.length:0===a&&r===i-1&&(r=i-2,a=1);var o,s,h,l;if(this.closed||r>0?o=e[(r-1)%i]:(As.subVectors(e[0],e[1]).add(e[0]),o=As),s=e[r%i],h=e[(r+1)%i],this.closed||r+2<i?l=e[(r+2)%i]:(As.subVectors(e[i-1],e[i-2]).add(e[i-1]),l=As),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var u="chordal"===this.type?.5:.25,p=Math.pow(o.distanceToSquared(s),u),d=Math.pow(s.distanceToSquared(h),u),f=Math.pow(h.distanceToSquared(l),u);d<1e-4&&(d=1),p<1e-4&&(p=d),f<1e-4&&(f=d),Ls.initNonuniformCatmullRom(o.x,s.x,h.x,l.x,p,d,f),Rs.initNonuniformCatmullRom(o.y,s.y,h.y,l.y,p,d,f),Ps.initNonuniformCatmullRom(o.z,s.z,h.z,l.z,p,d,f)}else if("catmullrom"===this.type){var m=void 0!==this.tension?this.tension:.5;Ls.initCatmullRom(o.x,s.x,h.x,l.x,m),Rs.initCatmullRom(o.y,s.y,h.y,l.y,m),Ps.initCatmullRom(o.z,s.z,h.z,l.z,m)}return new c(Ls.calc(a),Rs.calc(a),Ps.calc(a))},fr.prototype=Object.create(dn.prototype),fr.prototype.constructor=fr,fr.prototype.getPoint=function(t){var e=this.v0,i=this.v1,n=this.v2,r=this.v3;return new c(pn(t,e.x,i.x,n.x,r.x),pn(t,e.y,i.y,n.y,r.y),pn(t,e.z,i.z,n.z,r.z))},mr.prototype=Object.create(dn.prototype),mr.prototype.constructor=mr,mr.prototype.getPoint=function(t){var e=this.v0,i=this.v1,n=this.v2;return new c(sn(t,e.x,i.x,n.x),sn(t,e.y,i.y,n.y),sn(t,e.z,i.z,n.z))},gr.prototype=Object.create(dn.prototype),gr.prototype.constructor=gr,gr.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=new c;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e},vr.prototype=Object.create(gn.prototype),vr.prototype.constructor=vr;var Cs={createMultiMaterialObject:function(t,e){for(var i=new Ee,n=0,r=e.length;n<r;n++)i.add(new Lt(t,e[n]));return i},detach:function(t,e,i){t.applyMatrix(e.matrixWorld),e.remove(t),i.add(t)},attach:function(t,e,i){var n=new h;n.getInverse(i.matrixWorld),t.applyMatrix(n),e.remove(t),i.add(t)}};dn.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(dn.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Br.prototype=Object.create(dr.prototype),Fr.prototype=Object.create(dr.prototype),zr.prototype=Object.create(dr.prototype),Object.assign(zr.prototype,{initFromArray:function(t){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(t){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(t){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),rr.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Object.assign(q.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign($.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),ht.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},$o.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},Object.assign(et.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(t){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},applyToBuffer:function(t,e,i){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(t,e,i){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(h.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new c),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(t){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t,e,i){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(t,e,i){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,i,n,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,a)}}),it.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},s.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(at.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(bn.prototype,{extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ye(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ii(this,t)}}),Object.assign(i.prototype,{fromAttribute:function(t,e,i){return console.error("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)}}),Object.assign(c.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,i){return console.error("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)}}),Object.assign(r.prototype,{fromAttribute:function(t,e,i){return console.error("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)}}),St.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(ct.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)}}),Object.defineProperties(ct.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(me.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Nt.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Li.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(dt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(At.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(At.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Fn.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(J.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new W}}}),Object.defineProperties(gi.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Q.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(ce.prototype,{supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}),Object.defineProperties(ce.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(rt.prototype,{cullFace:{get:function(){return this.renderReverseSided?Qr:Jr},set:function(t){var e=t!==Jr;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+e+"."),this.renderReverseSided=e}}}),Object.defineProperties(a.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Pn.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Tn).load(t,function(t){e.setBuffer(t)}),this},In.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};var Is={merge:function(t,e,i){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var n;e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,i)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},Us={crossOrigin:void 0,loadTexture:function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Ai;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,i,void 0,n);return e&&(a.mapping=e),a},loadTextureCube:function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Si;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,i,void 0,n);return e&&(a.mapping=e),a},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}};t.WebGLRenderTargetCube=o,t.WebGLRenderTarget=a,t.WebGLRenderer=ce,t.ShaderLib=ls,t.UniformsLib=hs,t.UniformsUtils=os,t.ShaderChunk=ss,t.FogExp2=he,t.Fog=le,t.Scene=ue,t.LensFlare=pe,t.Sprite=fe,t.LOD=me,t.SkinnedMesh=ye,t.Skeleton=ge,t.Bone=ve,t.Mesh=Lt,t.LineSegments=be,t.Line=_e,t.Points=Me,t.Group=Ee,t.VideoTexture=Te,t.DataTexture=X,t.CompressedTexture=Se,t.CubeTexture=l,t.CanvasTexture=Ae,t.DepthTexture=Le,t.Texture=n,t.CompressedTextureLoader=Mi,t.DataTextureLoader=Ei,t.CubeTextureLoader=Si,t.TextureLoader=Ai,t.ObjectLoader=en,t.MaterialLoader=Qi,t.BufferGeometryLoader=Ki,t.DefaultLoadingManager=xs,t.LoadingManager=bi,t.JSONLoader=tn,t.ImageLoader=Ti,t.FontLoader=En,t.FileLoader=wi,t.Loader=$i,t.Cache=ys,t.AudioLoader=Tn,t.SpotLightShadow=Ci,t.SpotLight=Ii,t.PointLight=Ui,t.RectAreaLight=Sn,t.HemisphereLight=Ri,t.DirectionalLightShadow=Ni,t.DirectionalLight=Di,t.AmbientLight=Oi,t.LightShadow=Pi,t.Light=Li,t.StereoCamera=An,t.PerspectiveCamera=Nt,t.OrthographicCamera=Dt,t.CubeCamera=Ln,t.Camera=Ut,t.AudioListener=Rn,t.PositionalAudio=Cn,t.AudioContext=Es,t.AudioAnalyser=In,t.Audio=Pn,t.VectorKeyframeTrack=Vi,t.StringKeyframeTrack=Xi,t.QuaternionKeyframeTrack=ji,t.NumberKeyframeTrack=Wi,t.ColorKeyframeTrack=Yi,t.BooleanKeyframeTrack=qi,t.PropertyMixer=Un,t.PropertyBinding=Nn,t.KeyframeTrack=Zi,t.AnimationUtils=_s,t.AnimationObjectGroup=Dn,t.AnimationMixer=Bn,t.AnimationClip=Ji,t.Uniform=Fn,t.InstancedBufferGeometry=zn,t.BufferGeometry=At,t.GeometryIdCount=Tt,t.Geometry=St,t.InterleavedBufferAttribute=Gn,t.InstancedInterleavedBuffer=Vn,t.InterleavedBuffer=Hn,t.InstancedBufferAttribute=kn,t.Face3=ut,t.Object3D=ct,t.Raycaster=jn,t.Layers=st,t.EventDispatcher=e,t.Clock=qn,t.QuaternionLinearInterpolant=ki,t.LinearInterpolant=zi,t.DiscreteInterpolant=Gi,t.CubicInterpolant=Fi,t.Interpolant=Bi,t.Triangle=lt,t.Math=$o,t.Spherical=Yn,t.Cylindrical=Zn,t.Plane=it,t.Frustum=nt,t.Sphere=tt,t.Ray=at,t.Matrix4=h,t.Matrix3=et,t.Box3=$,t.Box2=q,t.Line3=ht,t.Euler=ot,t.Vector4=r,t.Vector3=c,t.Vector2=i,t.Quaternion=s,t.Color=W,t.MorphBlendMesh=Jn,t.ImmediateRenderObject=Qn,t.VertexNormalsHelper=Kn,t.SpotLightHelper=$n,t.SkeletonHelper=tr,t.PointLightHelper=er,t.RectAreaLightHelper=ir,t.HemisphereLightHelper=nr,t.GridHelper=rr,t.PolarGridHelper=ar,t.FaceNormalsHelper=or,t.DirectionalLightHelper=sr,t.CameraHelper=cr,t.BoxHelper=hr,t.ArrowHelper=lr,t.AxisHelper=ur,t.CatmullRomCurve3=dr,t.CubicBezierCurve3=fr,t.QuadraticBezierCurve3=mr,t.LineCurve3=gr,t.ArcCurve=vr,t.EllipseCurve=gn,t.SplineCurve=vn,t.CubicBezierCurve=yn,t.QuadraticBezierCurve=xn,t.LineCurve=fn,t.Shape=bn,t.Path=_n,t.ShapePath=wn,t.Font=Mn,t.CurvePath=mn,t.Curve=dn,t.ShapeUtils=ms,t.SceneUtils=Cs,
119
+ t.WireframeGeometry=Re,t.ParametricGeometry=Pe,t.ParametricBufferGeometry=Ce,t.TetrahedronGeometry=Ne,t.TetrahedronBufferGeometry=De,t.OctahedronGeometry=Oe,t.OctahedronBufferGeometry=Be,t.IcosahedronGeometry=Fe,t.IcosahedronBufferGeometry=ze,t.DodecahedronGeometry=Ge,t.DodecahedronBufferGeometry=He,t.PolyhedronGeometry=Ie,t.PolyhedronBufferGeometry=Ue,t.TubeGeometry=Ve,t.TubeBufferGeometry=ke,t.TorusKnotGeometry=je,t.TorusKnotBufferGeometry=We,t.TorusGeometry=Xe,t.TorusBufferGeometry=qe,t.TextGeometry=Ze,t.SphereGeometry=Je,t.SphereBufferGeometry=Qe,t.RingGeometry=Ke,t.RingBufferGeometry=$e,t.PlaneGeometry=Ct,t.PlaneBufferGeometry=It,t.LatheGeometry=ti,t.LatheBufferGeometry=ei,t.ShapeGeometry=ii,t.ShapeBufferGeometry=ni,t.ExtrudeGeometry=Ye,t.EdgesGeometry=ri,t.ConeGeometry=si,t.ConeBufferGeometry=ci,t.CylinderGeometry=ai,t.CylinderBufferGeometry=oi,t.CircleGeometry=hi,t.CircleBufferGeometry=li,t.BoxGeometry=Rt,t.BoxBufferGeometry=Pt,t.ShadowMaterial=ui,t.SpriteMaterial=de,t.RawShaderMaterial=pi,t.ShaderMaterial=Q,t.PointsMaterial=we,t.MultiMaterial=di,t.MeshPhysicalMaterial=mi,t.MeshStandardMaterial=fi,t.MeshPhongMaterial=gi,t.MeshToonMaterial=vi;t.MeshNormalMaterial=yi,t.MeshLambertMaterial=xi,t.MeshDepthMaterial=K,t.MeshBasicMaterial=pt,t.LineDashedMaterial=_i,t.LineBasicMaterial=xe,t.Material=J,t.Float64BufferAttribute=wt,t.Float32BufferAttribute=bt,t.Uint32BufferAttribute=_t,t.Int32BufferAttribute=xt,t.Uint16BufferAttribute=yt,t.Int16BufferAttribute=vt,t.Uint8ClampedBufferAttribute=gt,t.Uint8BufferAttribute=mt,t.Int8BufferAttribute=ft,t.BufferAttribute=dt,t.REVISION=qr,t.MOUSE=Yr,t.CullFaceNone=Zr,t.CullFaceBack=Jr,t.CullFaceFront=Qr,t.CullFaceFrontBack=3,t.FrontFaceDirectionCW=Kr,t.FrontFaceDirectionCCW=1,t.BasicShadowMap=0,t.PCFShadowMap=$r,t.PCFSoftShadowMap=ta,t.FrontSide=ea,t.BackSide=ia,t.DoubleSide=na,t.FlatShading=ra,t.SmoothShading=aa,t.NoColors=oa,t.FaceColors=sa,t.VertexColors=ca,t.NoBlending=ha,t.NormalBlending=la,t.AdditiveBlending=ua,t.SubtractiveBlending=pa,t.MultiplyBlending=da,t.CustomBlending=fa,t.AddEquation=ma,t.SubtractEquation=ga,t.ReverseSubtractEquation=va,t.MinEquation=ya,t.MaxEquation=xa,t.ZeroFactor=_a,t.OneFactor=ba,t.SrcColorFactor=wa,t.OneMinusSrcColorFactor=Ma,t.SrcAlphaFactor=Ea,t.OneMinusSrcAlphaFactor=Ta,t.DstAlphaFactor=Sa,t.OneMinusDstAlphaFactor=Aa,t.DstColorFactor=La,t.OneMinusDstColorFactor=Ra,t.SrcAlphaSaturateFactor=Pa,t.NeverDepth=Ca,t.AlwaysDepth=Ia,t.LessDepth=Ua,t.LessEqualDepth=Na,t.EqualDepth=Da,t.GreaterEqualDepth=Oa,t.GreaterDepth=Ba,t.NotEqualDepth=Fa,t.MultiplyOperation=za,t.MixOperation=Ga,t.AddOperation=Ha,t.NoToneMapping=Va,t.LinearToneMapping=ka,t.ReinhardToneMapping=ja,t.Uncharted2ToneMapping=Wa,t.CineonToneMapping=Xa,t.UVMapping=300,t.CubeReflectionMapping=qa,t.CubeRefractionMapping=Ya,t.EquirectangularReflectionMapping=Za,t.EquirectangularRefractionMapping=Ja,t.SphericalReflectionMapping=Qa,t.CubeUVReflectionMapping=Ka,t.CubeUVRefractionMapping=$a,t.RepeatWrapping=to,t.ClampToEdgeWrapping=eo,t.MirroredRepeatWrapping=io,t.NearestFilter=no,t.NearestMipMapNearestFilter=ro,t.NearestMipMapLinearFilter=ao,t.LinearFilter=oo,t.LinearMipMapNearestFilter=so,t.LinearMipMapLinearFilter=co,t.UnsignedByteType=ho,t.ByteType=lo,t.ShortType=uo,t.UnsignedShortType=po,t.IntType=fo,t.UnsignedIntType=mo,t.FloatType=go,t.HalfFloatType=vo,t.UnsignedShort4444Type=yo,t.UnsignedShort5551Type=xo,t.UnsignedShort565Type=_o,t.UnsignedInt248Type=bo,t.AlphaFormat=wo,t.RGBFormat=Mo,t.RGBAFormat=Eo,t.LuminanceFormat=To,t.LuminanceAlphaFormat=So,t.RGBEFormat=Ao,t.DepthFormat=Lo,t.DepthStencilFormat=Ro,t.RGB_S3TC_DXT1_Format=Po,t.RGBA_S3TC_DXT1_Format=Co,t.RGBA_S3TC_DXT3_Format=Io,t.RGBA_S3TC_DXT5_Format=Uo,t.RGB_PVRTC_4BPPV1_Format=No,t.RGB_PVRTC_2BPPV1_Format=Do,t.RGBA_PVRTC_4BPPV1_Format=Oo,t.RGBA_PVRTC_2BPPV1_Format=Bo,t.RGB_ETC1_Format=Fo,t.LoopOnce=2200,t.LoopRepeat=zo,t.LoopPingPong=2202,t.InterpolateDiscrete=2300,t.InterpolateLinear=2301,t.InterpolateSmooth=2302,t.ZeroCurvatureEnding=Go,t.ZeroSlopeEnding=2401,t.WrapAroundEnding=2402,t.TrianglesDrawMode=Ho,t.TriangleStripDrawMode=Vo,t.TriangleFanDrawMode=ko,t.LinearEncoding=jo,t.sRGBEncoding=Wo,t.GammaEncoding=Xo,t.RGBEEncoding=qo,t.LogLuvEncoding=3003,t.RGBM7Encoding=Yo,t.RGBM16Encoding=Zo,t.RGBDEncoding=Jo,t.BasicDepthPacking=Qo,t.RGBADepthPacking=Ko,t.CubeGeometry=Rt,t.Face4=yr,t.LineStrip=0,t.LinePieces=1,t.MeshFaceMaterial=xr,t.PointCloud=_r,t.Particle=br,t.ParticleSystem=wr,t.PointCloudMaterial=Mr,t.ParticleBasicMaterial=Er,t.ParticleSystemMaterial=Tr,t.Vertex=Sr,t.DynamicBufferAttribute=Ar,t.Int8Attribute=Lr,t.Uint8Attribute=Rr,t.Uint8ClampedAttribute=Pr,t.Int16Attribute=Cr,t.Uint16Attribute=Ir,t.Int32Attribute=Ur,t.Uint32Attribute=Nr,t.Float32Attribute=Dr,t.Float64Attribute=Or,t.ClosedSplineCurve3=Br,t.SplineCurve3=Fr,t.Spline=zr,t.BoundingBoxHelper=Gr,t.EdgesHelper=Hr,t.WireframeHelper=Vr,t.XHRLoader=kr,t.BinaryTextureLoader=jr,t.GeometryUtils=Is,t.ImageUtils=Us,t.Projector=Wr,t.CanvasRenderer=Xr,Object.defineProperty(t,"__esModule",{value:!0})});
120
+ },{}],42:[function(_dereq_,module,exports){
121
+ THREE.ColladaLoader=function(){function e(e,i,s,r){var a=0;if(document.implementation&&document.implementation.createDocument){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState?0===n.status||200===n.status?n.response?(Xe=i,t(n.response,void 0,e)):r?r({type:"error",url:e}):console.error("ColladaLoader: Empty or non-existing file ("+e+")"):r?r({type:"error",url:e}):console.error("ColladaLoader: Couldn't load \""+e+'" ('+n.status+")"):3===n.readyState&&s&&(0===a&&(a=n.getResponseHeader("Content-Length")),s({total:a,loaded:n.responseText.length}))},n.open("GET",e,!0),n.send(null)}else alert("Don't know how to parse XML!")}function t(e,t,i){if(qe=(new DOMParser).parseFromString(e,"text/xml"),t=t||Xe,void 0!==i){var h=i.split("/");h.pop(),Oe=(h.length<1?".":h.join("/"))+"/"}s(),we(),Ye=r("library_images image",R,"image"),Be=r("library_materials material",P,"material"),De=r("library_effects effect",Q,"effect"),Fe=r("library_geometries geometry",q,"geometry"),Pe=r("library_cameras camera",se,"camera"),Ue=r("library_lights light",ae,"light"),ze=r("library_controllers controller",_,"controller"),Ze=r("library_animations animation",K,"animation"),Me=r("library_visual_scenes visual_scene",H,"visual_scene"),je=r("library_kinematics_models kinematics_model",oe,"kinematics_model"),Se=[],Ie=[],_e=a(),Ve=new THREE.Group;for(var l=0;l<_e.nodes.length;l++)Ve.add(v(_e.nodes[l]));Ve.scale.multiplyScalar(We),o(),Ae=n(),g();var c={scene:Ve,morphs:Se,skins:Ie,animations:Ce,kinematics:He,dae:{images:Ye,materials:Be,cameras:Pe,lights:Ue,effects:De,geometries:Fe,controllers:ze,animations:Ze,visualScenes:Me,visualScene:_e,scene:_e,kinematicsModels:je,kinematicsModel:Ae}};return t&&t(c),c}function i(e){Ge=e}function s(){var e=qe.querySelectorAll("asset"),t=e[0];if(t&&t.childNodes)for(var i=0;i<t.childNodes.length;i++){var s=t.childNodes[i];switch(s.nodeName){case"unit":var r=s.getAttribute("meter");r&&(We=parseFloat(r));break;case"up_axis":Qe=s.textContent.charAt(0)}}}function r(e,t,i){for(var s=qe.querySelectorAll(e),r={},a=0,n=s.length,o=0;o<n;o++){var h=s[o],l=(new t).parse(h);l.id&&0!==l.id.length||(l.id=i+a++),r[l.id]=l}return r}function a(){var e=qe.querySelectorAll("scene instance_visual_scene")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return Me[t.length>0?t:"visual_scene0"]}return null}function n(){var e=qe.querySelectorAll("instance_kinematics_model")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return je[t.length>0?t:"kinematics_model0"]}return null}function o(){Ce=[],h(Ve)}function h(e){var t=_e.getChildById(e.colladaId,!0),i=null;if(t&&t.keys){i={fps:60,hierarchy:[{node:t,keys:t.keys,sids:t.sids}],node:e,name:"animation_"+e.name,length:0},Ce.push(i);for(var s=0,r=t.keys.length;s<r;s++)i.length=Math.max(i.length,t.keys[s].time)}else i={hierarchy:[{keys:[],sids:[]}]};for(var s=0,r=e.children.length;s<r;s++)for(var a=h(e.children[s]),n=0,o=a.hierarchy.length;n<o;n++)i.hierarchy.push({keys:[],sids:[]});return i}function l(){var e,t=1e6,i=-t,s=0;for(var r in Ze){var a=Ze[r];e=e||a.id;for(var n=0;n<a.sampler.length;n++){var o=a.sampler[n];o.create(),t=Math.min(t,o.startTime),i=Math.max(i,o.endTime),s=Math.max(s,o.input.length)}}return{start:t,end:i,frames:s,ID:e}}function c(e,t){var i=t instanceof O?ze[t.url]:t;if(!i||!i.morph)return void console.log("could not find morph controller!");for(var s=i.morph,r=0;r<s.targets.length;r++){var a=s.targets[r],n=Fe[a];if(n.mesh&&n.mesh.primitives&&n.mesh.primitives.length){var o=n.mesh.primitives[0].geometry;o.vertices.length===e.vertices.length&&e.morphTargets.push({name:"target_1",vertices:o.vertices})}}e.morphTargets.push({name:"target_Z",vertices:e.vertices})}function p(e,t,i,s){if(e.world=e.world||new THREE.Matrix4,e.localworld=e.localworld||new THREE.Matrix4,e.world.copy(e.matrix),e.localworld.copy(e.matrix),e.channels&&e.channels.length){var r=e.channels[0],a=r.sampler.output[i];a instanceof THREE.Matrix4&&(e.world.copy(a),e.localworld.copy(a),0===i&&e.matrix.copy(a))}s&&e.world.multiplyMatrices(s,e.world),t.push(e);for(var n=0;n<e.nodes.length;n++)p(e.nodes[n],t,i,e.world)}function d(e,t){for(var i=0;i<e.length;i++){var s=e[i],r=-1;if("JOINT"==s.type){for(var a=0;a<t.joints.length;a++)if(s.sid===t.joints[a]){r=a;break}if(r>=0){var n=t.invBindMatrices[r];s.invBindMatrix=n,s.skinningMatrix=new THREE.Matrix4,s.skinningMatrix.multiplyMatrices(s.world,n),s.animatrix=new THREE.Matrix4,s.animatrix.copy(s.localworld),s.weights=[];for(var a=0;a<t.weights.length;a++)for(var o=0;o<t.weights[a].length;o++){var h=t.weights[a][o];h.joint===r&&s.weights.push(h)}}else console.warn("ColladaLoader: Could not find joint '"+s.sid+"'."),s.skinningMatrix=new THREE.Matrix4,s.weights=[]}}}function u(e){var t=[],i=function(e,t,s){var r={};r.name=t.sid,r.parent=e,r.matrix=t.matrix;var a=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];r.matrix.decompose(a[0],a[1],a[2]),r.pos=[a[0].x,a[0].y,a[0].z],r.scl=[a[2].x,a[2].y,a[2].z],r.rotq=[a[1].x,a[1].y,a[1].z,a[1].w],s.push(r);for(var n in t.nodes)i(t.sid,t.nodes[n],s)};return i(-1,e,t),t}function f(e,t,i){var s=[];p(t,s,-1),d(s,i.skin);for(var r=new THREE.Vector3,a=[],n=0;n<e.vertices.length;n++)a.push(new THREE.Vector3);for(n=0;n<s.length;n++)if("JOINT"==s[n].type)for(var o=0;o<s[n].weights.length;o++){var h=s[n].weights[o],l=h.index,c=h.weight,u=e.vertices[l],f=a[l];r.x=u.x,r.y=u.y,r.z=u.z,r.applyMatrix4(s[n].skinningMatrix),f.x+=r.x*c,f.y+=r.y*c,f.z+=r.z*c}for(var n=0;n<e.vertices.length;n++)e.vertices[n]=a[n]}function m(e,t,i){var s=ze[t.url];if(i=void 0!==i?i:40,!s||!s.skin)return void console.log("ColladaLoader: Could not find skin controller.");if(!t.skeleton||!t.skeleton.length)return void console.log("ColladaLoader: Could not find the skeleton for the skin. ");for(var r=l(),a=_e.getChildById(t.skeleton[0],!0)||_e.getChildBySid(t.skeleton[0],!0),n=u(a),o=s.skin.joints,h=[],c=0;c<o.length;c++)for(var m=0;m<n.length;m++)n[m].name===o[c]&&(h[c]=n[m]);for(var c=0;c<h.length;c++)for(var m=0;m<h.length;m++)h[c].parent===h[m].name&&(h[c].parent=m);var c,m,g;new THREE.Vector3;for(c=0;c<e.vertices.length;c++)e.vertices[c].applyMatrix4(s.skin.bindShapeMatrix);for(var v=[],y=[],b=s.skin.weights,c=0;c<b.length;c++){var w=new THREE.Vector4(b[c][0]?b[c][0].joint:0,b[c][1]?b[c][1].joint:0,b[c][2]?b[c][2].joint:0,b[c][3]?b[c][3].joint:0),g=new THREE.Vector4(b[c][0]?b[c][0].weight:0,b[c][1]?b[c][1].weight:0,b[c][2]?b[c][2].weight:0,b[c][3]?b[c][3].weight:0);v.push(w),y.push(g)}e.skinIndices=v,e.skinWeights=y,e.bones=h;for(var x={name:r.ID,fps:30,length:r.frames/30,hierarchy:[]},m=0;m<h.length;m++)x.hierarchy.push({parent:h[m].parent,name:h[m].name,keys:[]});for(console.log("ColladaLoader:",r.ID+" has "+h.length+" bones."),f(e,a,s),i=0;i<r.frames;i++){var N=[];p(a,N,i),d(N,s.skin);for(var c=0;c<N.length;c++)for(var m=0;m<x.hierarchy.length;m++)if(x.hierarchy[m].name===N[c].sid){var k={};k.time=i/30,k.matrix=N[c].animatrix,0===i&&(N[c].matrix=k.matrix);var T=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];k.matrix.decompose(T[0],T[1],T[2]),k.pos=[T[0].x,T[0].y,T[0].z],k.scl=[T[2].x,T[2].y,T[2].z],k.rot=T[1],x.hierarchy[m].keys.push(k)}e.animation=x}}function g(){if(Ae&&0===Ae.joints.length)return void(He=void 0);var e={};He={joints:Ae&&Ae.joints,getJointValue:function(t){var i=e[t];if(i)return i.position;console.log("getJointValue: joint "+t+" doesn't exist")},setJointValue:function(t,s){var r=e[t];if(r){var a=r.joint;if(s>a.limits.max||s<a.limits.min)console.log("setJointValue: joint "+t+" value "+s+" outside of limits (min: "+a.limits.min+", max: "+a.limits.max+")");else if(a.static)console.log("setJointValue: joint "+t+" is static");else{var n=r.node,o=a.axis,h=r.transforms,l=new THREE.Matrix4;for(i=0;i<h.length;i++){var c=h[i];if(c.sid&&-1!==c.sid.indexOf("joint"+t))switch(a.type){case"revolute":l.multiply(p.makeRotationAxis(o,THREE.Math.degToRad(s)));break;case"prismatic":l.multiply(p.makeTranslation(o.x*s,o.y*s,o.z*s));break;default:console.warn("setJointValue: unknown joint type: "+a.type)}else{var p=new THREE.Matrix4;switch(c.type){case"matrix":l.multiply(c.obj);break;case"translate":l.multiply(p.makeTranslation(c.obj.x,c.obj.y,c.obj.z));break;case"rotate":l.multiply(p.makeRotationAxis(c.obj,c.angle))}}}var d=l.elements,u=Array.prototype.slice.call(d),f=[u[0],u[4],u[8],u[12],u[1],u[5],u[9],u[13],u[2],u[6],u[10],u[14],u[3],u[7],u[11],u[15]];n.matrix.set.apply(n.matrix,f),n.matrix.decompose(n.position,n.quaternion,n.scale)}}else console.log("setJointValue: joint "+t+" doesn't exist")}};var t=qe.querySelector("scene instance_kinematics_scene");if(t)for(var i=0;i<t.childNodes.length;i++){var s=t.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"bind_joint_axis":var r=s.getAttribute("target").split("/").pop(),a=s.querySelector("axis param").textContent,n=parseInt(a.split("joint").pop().split(".")[0]),o=qe.querySelector('[sid="'+r+'"]');if(o){var h=o.parentElement;!function(t,i){var s=i.getAttribute("id"),r=_e.getChildById(s,!0),a=Ae.joints[t];Ve.traverse(function(i){i.colladaId==s&&(e[t]={node:i,transforms:r.transforms,joint:a,position:a.zeroPosition})})}(n,h)}}}}function v(e,t){var i,s,r,a,n=new THREE.Object3D;for(r=0;r<e.controllers.length;r++){var o=ze[e.controllers[r].url];switch(o.type){case"skin":if(Fe[o.skin.source]){var h=new I;h.url=o.skin.source,h.instance_material=e.controllers[r].instance_material,e.geometries.push(h),!0,i=e.controllers[r]}else if(ze[o.skin.source]){var l=ze[o.skin.source];if(s=l,l.morph&&Fe[l.morph.source]){var h=new I;h.url=l.morph.source,h.instance_material=e.controllers[r].instance_material,e.geometries.push(h)}}break;case"morph":if(Fe[o.morph.source]){var h=new I;h.url=o.morph.source,h.instance_material=e.controllers[r].instance_material,e.geometries.push(h),s=e.controllers[r]}console.log("ColladaLoader: Morph-controller partially supported.")}}var p={};for(r=0;r<e.geometries.length;r++){var d,u=e.geometries[r],f=u.instance_material,g=Fe[u.url],y={},b=[],w=0;if(g){if(!g.mesh||!g.mesh.primitives)continue;if(0===n.name.length&&(n.name=g.id),f)for(a=0;a<f.length;a++){var x=f[a],N=Be[x.target],k=N.instance_effect.url,T=De[k].shader,E=T.material;if(g.doubleSided){if(!(x.symbol in p)){var R=E.clone();R.side=THREE.DoubleSide,p[x.symbol]=R}E=p[x.symbol]}E.opacity=E.opacity?E.opacity:1,y[x.symbol]=w,b.push(E),d=E,d.name=null===N.name||""===N.name?N.id:N.name,w++}var _,A=d||new THREE.MeshLambertMaterial({color:14540253,side:g.doubleSided?THREE.DoubleSide:THREE.FrontSide}),C=g.mesh.geometry3js;if(w>1)for(A=new THREE.MultiMaterial(b),a=0;a<C.faces.length;a++){var H=C.faces[a];H.materialIndex=y[H.daeMaterial]}void 0!==i?(m(C,i),C.morphTargets.length>0?(A.morphTargets=!0,A.skinning=!1):(A.morphTargets=!1,A.skinning=!0),_=new THREE.SkinnedMesh(C,A,!1),_.name="skin_"+Ie.length,Ie.push(_)):void 0!==s?(c(C,s),A.morphTargets=!0,_=new THREE.Mesh(C,A),_.name="morph_"+Se.length,Se.push(_)):_=!0===C.isLineStrip?new THREE.Line(C):new THREE.Mesh(C,A),n.add(_)}}for(r=0;r<e.cameras.length;r++){var M=e.cameras[r],j=Pe[M.url],O=new THREE.PerspectiveCamera(j.yfov,parseFloat(j.aspect_ratio),parseFloat(j.znear),parseFloat(j.zfar));n.add(O)}for(r=0;r<e.lights.length;r++){var S=null,q=e.lights[r],V=Ue[q.url];if(V&&V.technique){var X=V.color.getHex(),L=V.intensity,Y=V.distance,Z=V.falloff_angle;switch(V.technique){case"directional":S=new THREE.DirectionalLight(X,L,Y),S.position.set(0,0,1);break;case"point":S=new THREE.PointLight(X,L,Y);break;case"spot":S=new THREE.SpotLight(X,L,Y,Z),S.position.set(0,0,1);break;case"ambient":S=new THREE.AmbientLight(X)}}S&&n.add(S)}if(n.name=e.name||e.id||"",n.colladaId=e.id||"",n.layer=e.layer||"",n.matrix=e.matrix,n.matrix.decompose(n.position,n.quaternion,n.scale),Je.centerGeometry&&n.geometry){var z=n.geometry.center();z.multiply(n.scale),z.applyQuaternion(n.quaternion),n.position.sub(z)}for(r=0;r<e.nodes.length;r++)n.add(v(e.nodes[r],e));return n}function y(e){for(var t=qe.querySelectorAll("library_nodes node"),i=0;i<t.length;i++){var s=t[i].attributes.getNamedItem("id");if(s&&s.value===e)return t[i]}}function b(e){var t=[],i=1e6,s=-1e6;for(var r in Ze)for(var a=Ze[r],n=0;n<a.channel.length;n++){var o=a.channel[n],h=a.sampler[n],r=o.target.split("/")[0];r==e.id&&(h.create(),o.sampler=h,i=Math.min(i,h.startTime),s=Math.max(s,h.endTime),t.push(o))}return t.length&&(e.startTime=i,e.endTime=s),t}function w(e){if(e.channels&&e.channels.length){for(var t=[],i=[],s=0,r=e.channels.length;s<r;s++){var a,n=e.channels[s],o=n.fullSid,h=n.sampler,l=h.input,c=e.getTransformBySid(n.sid);if(n.arrIndices){a=[];for(var p=0,d=n.arrIndices.length;p<d;p++)a[p]=Ee(n.arrIndices[p])}else a=Re(n.member);if(c){-1===i.indexOf(o)&&i.push(o);for(var p=0,d=l.length;p<d;p++){var u=l[p],f=h.getData(c.type,p,a),m=x(t,u);if(!m){m=new ie(u);var g=N(t,u);t.splice(-1===g?t.length:g,0,m)}m.addTarget(o,c,a,f)}}else console.log('Could not find transform "'+n.sid+'" in node '+e.id)}for(var s=0;s<i.length;s++)for(var v=i[s],p=0;p<t.length;p++){var m=t[p];m.hasTarget(v)||k(t,m,p,v)}e.keys=t,e.sids=i}}function x(e,t){for(var i=null,s=0,r=e.length;s<r&&null===i;s++){var a=e[s];if(a.time===t)i=a;else if(a.time>t)break}return i}function N(e,t){for(var i=-1,s=0,r=e.length;s<r&&-1===i;s++){e[s].time>=t&&(i=s)}return i}function k(e,t,i,s){var r=E(e,s,i?i-1:0),a=T(e,s,i+1);if(r&&a){var n,o=(t.time-r.time)/(a.time-r.time),h=r.getTarget(s),l=a.getTarget(s).data,c=h.data;if("matrix"===h.type)n=c;else if(c.length){n=[];for(var p=0;p<c.length;++p)n[p]=c[p]+(l[p]-c[p])*o}else n=c+(l-c)*o;t.addTarget(s,h.transform,h.member,n)}}function T(e,t,i){for(;i<e.length;i++){var s=e[i];if(s.hasTarget(t))return s}return null}function E(e,t,i){for(i=i>=0?i:i+e.length;i>=0;i--){var s=e[i];if(s.hasTarget(t))return s}return null}function R(){this.id="",this.init_from=""}function _(){this.id="",this.name="",this.type="",this.skin=null,this.morph=null}function A(){this.method=null,this.source=null,this.targets=null,this.weights=null}function C(){this.source="",this.bindShapeMatrix=null,this.invBindMatrices=[],this.joints=[],this.weights=[]}function H(){this.id="",this.name="",this.nodes=[],this.scene=new THREE.Group}function M(){this.id="",this.name="",this.sid="",this.nodes=[],this.controllers=[],this.transforms=[],this.geometries=[],this.channels=[],this.matrix=new THREE.Matrix4}function j(){this.sid="",this.type="",this.data=[],this.obj=null}function O(){this.url="",this.skeleton=[],this.instance_material=[]}function S(){this.symbol="",this.target=""}function I(){this.url="",this.instance_material=[]}function q(){this.id="",this.mesh=null}function V(e){this.geometry=e.id,this.primitives=[],this.vertices=null,this.geometry3js=null}function X(){this.material="",this.count=0,this.inputs=[],this.vcount=null,this.p=[],this.geometry=new THREE.Geometry}function L(){X.call(this),this.vcount=[]}function Y(){X.call(this),this.vcount=1}function Z(){X.call(this),this.vcount=3}function z(){this.source="",this.count=0,this.stride=0,this.params=[]}function F(){this.input={}}function B(){this.semantic="",this.offset=0,this.source="",this.set=0}function D(e){this.id=e,this.type=null}function P(){this.id="",this.name="",this.instance_effect=null}function U(){this.color=new THREE.Color,this.color.setRGB(Math.random(),Math.random(),Math.random()),this.color.a=1,this.texture=null,this.texcoord=null,this.texOpts=null}function G(e,t){this.type=e,this.effect=t,this.material=null}function J(e){this.effect=e,this.init_from=null,this.format=null}function W(e){this.effect=e,this.source=null,this.wrap_s=null,this.wrap_t=null,this.minfilter=null,this.magfilter=null,this.mipfilter=null}function Q(){this.id="",this.name="",this.shader=null,this.surface={},this.sampler={}}function $(){this.url=""}function K(){this.id="",this.name="",this.source={},this.sampler=[],this.channel=[]}function ee(e){this.animation=e,this.source="",this.target="",this.fullSid=null,this.sid=null,this.dotSyntax=null,this.arrSyntax=null,this.arrIndices=null,this.member=null}function te(e){this.id="",this.animation=e,this.inputs=[],this.input=null,this.output=null,this.strideOut=null,this.interpolation=null,this.startTime=null,this.endTime=null,this.duration=0}function ie(e){this.targets=[],this.time=e}function se(){this.id="",this.name="",this.technique=""}function re(){this.url=""}function ae(){this.id="",this.name="",this.technique=""}function ne(){this.url=""}function oe(){this.id="",this.name="",this.joints=[],this.links=[]}function he(){this.sid="",this.name="",this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this.static=!1,this.zeroPosition=0,this.middlePosition=0}function le(){this.sid="",this.name="",this.transforms=[],this.attachments=[]}function ce(){this.joint="",this.transforms=[],this.links=[]}function pe(e){var t=e.getAttribute("id");return void 0!=Le[t]?Le[t]:(Le[t]=new D(t).parse(e),Le[t])}function de(e){for(var t=me(e),i=[],s=0,r=t.length;s<r;s++)i.push("true"===t[s]||"1"===t[s]);return i}function ue(e){for(var t=me(e),i=[],s=0,r=t.length;s<r;s++)i.push(parseFloat(t[s]));return i}function fe(e){for(var t=me(e),i=[],s=0,r=t.length;s<r;s++)i.push(parseInt(t[s],10));return i}function me(e){return e.length>0?ge(e).split(/\s+/):[]}function ge(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function ve(e,t,i){return e.hasAttribute(t)?parseInt(e.getAttribute(t),10):i}function ye(e,t){(new THREE.ImageLoader).load(t,function(t){e.image=t,e.needsUpdate=!0})}function be(e,t){e.doubleSided=!1;var i=t.querySelectorAll("extra double_sided")[0];i&&i&&1===parseInt(i.textContent,10)&&(e.doubleSided=!0)}function we(){if(!0!==Je.convertUpAxis||Qe===Je.upAxis)$e=null;else switch(Qe){case"X":$e="Y"===Je.upAxis?"XtoY":"XtoZ";break;case"Y":$e="X"===Je.upAxis?"YtoX":"YtoZ";break;case"Z":$e="X"===Je.upAxis?"ZtoX":"ZtoY"}}function xe(e,t){if(!0===Je.convertUpAxis&&Qe!==Je.upAxis)switch($e){case"XtoY":var i=e[0];e[0]=t*e[1],e[1]=i;break;case"XtoZ":var i=e[2];e[2]=e[1],e[1]=e[0],e[0]=i;break;case"YtoX":var i=e[0];e[0]=e[1],e[1]=t*i;break;case"YtoZ":var i=e[1];e[1]=t*e[2],e[2]=i;break;case"ZtoX":var i=e[0];e[0]=e[1],e[1]=e[2],e[2]=i;break;case"ZtoY":var i=e[1];e[1]=e[2],e[2]=t*i}}function Ne(e,t){if(!0!==Je.convertUpAxis||Qe===Je.upAxis)return t;switch(e){case"X":t="XtoY"===$e?-1*t:t;break;case"Y":t="YtoZ"===$e||"YtoX"===$e?-1*t:t;break;case"Z":t="ZtoY"===$e?-1*t:t}return t}function ke(e,t){var i=[e[t],e[t+1],e[t+2]];return xe(i,-1),new THREE.Vector3(i[0],i[1],i[2])}function Te(e){if(Je.convertUpAxis){var t=[e[0],e[4],e[8]];xe(t,-1),e[0]=t[0],e[4]=t[1],e[8]=t[2],t=[e[1],e[5],e[9]],xe(t,-1),e[1]=t[0],e[5]=t[1],e[9]=t[2],t=[e[2],e[6],e[10]],xe(t,-1),e[2]=t[0],e[6]=t[1],e[10]=t[2],t=[e[0],e[1],e[2]],xe(t,-1),e[0]=t[0],e[1]=t[1],e[2]=t[2],t=[e[4],e[5],e[6]],xe(t,-1),e[4]=t[0],e[5]=t[1],e[6]=t[2],t=[e[8],e[9],e[10]],xe(t,-1),e[8]=t[0],e[9]=t[1],e[10]=t[2],t=[e[3],e[7],e[11]],xe(t,-1),e[3]=t[0],e[7]=t[1],e[11]=t[2]}return(new THREE.Matrix4).set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Ee(e){if(e>-1&&e<3){var t=["X","Y","Z"],i={X:0,Y:1,Z:2};e=Re(t[e]),e=i[e]}return e}function Re(e){if(Je.convertUpAxis)switch(e){case"X":switch($e){case"XtoY":case"XtoZ":case"YtoX":e="Y";break;case"ZtoX":e="Z"}break;case"Y":switch($e){case"XtoY":case"YtoX":case"ZtoX":e="X";break;case"XtoZ":case"YtoZ":case"ZtoY":e="Z"}break;case"Z":switch($e){case"XtoZ":e="X";break;case"YtoZ":case"ZtoX":case"ZtoY":e="Y"}}return e}var _e,Ae,Ce,He,Me,je,Oe,Se,Ie,qe=null,Ve=null,Xe=null,Le={},Ye={},Ze={},ze={},Fe={},Be={},De={},Pe={},Ue={},Ge=THREE.SmoothShading,Je={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y",defaultEnvMap:null},We=1,Qe="Y",$e=null;return R.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];"init_from"===i.nodeName&&(this.init_from=i.textContent)}return this},_.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.type="none";for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"skin":this.skin=(new C).parse(i),this.type=i.nodeName;break;case"morph":this.morph=(new A).parse(i),this.type=i.nodeName}}return this},A.prototype.parse=function(e){var t,i={},s=[];for(this.method=e.getAttribute("method"),this.source=e.getAttribute("source").replace(/^#/,""),t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(1==r.nodeType)switch(r.nodeName){case"source":var a=(new D).parse(r);i[a.id]=a;break;case"targets":s=this.parseInputs(r);break;default:console.log(r.nodeName)}}for(t=0;t<s.length;t++){var n=s[t],a=i[n.source];switch(n.semantic){case"MORPH_TARGET":this.targets=a.read();break;case"MORPH_WEIGHT":this.weights=a.read()}}return this},A.prototype.parseInputs=function(e){for(var t=[],i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"input":t.push((new B).parse(s))}}return t},C.prototype.parse=function(e){var t,i,s={};this.source=e.getAttribute("source").replace(/^#/,""),this.invBindMatrices=[],this.joints=[],this.weights=[];for(var r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1==a.nodeType)switch(a.nodeName){case"bind_shape_matrix":var n=ue(a.textContent);this.bindShapeMatrix=Te(n);break;case"source":var o=(new D).parse(a);s[o.id]=o;break;case"joints":t=a;break;case"vertex_weights":i=a;break;default:console.log(a.nodeName)}}return this.parseJoints(t,s),this.parseWeights(i,s),this},C.prototype.parseJoints=function(e,t){for(var i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"input":var r=(new B).parse(s),a=t[r.source];"JOINT"===r.semantic?this.joints=a.read():"INV_BIND_MATRIX"===r.semantic&&(this.invBindMatrices=a.read())}}},C.prototype.parseWeights=function(e,t){for(var i,s,r=[],a=0;a<e.childNodes.length;a++){var n=e.childNodes[a];if(1==n.nodeType)switch(n.nodeName){case"input":r.push((new B).parse(n));break;case"v":i=fe(n.textContent);break;case"vcount":s=fe(n.textContent)}}for(var o=0,a=0;a<s.length;a++){for(var h=s[a],l=[],c=0;c<h;c++){for(var p={},d=0;d<r.length;d++){var u=r[d],f=i[o+u.offset];switch(u.semantic){case"JOINT":p.joint=f;break;case"WEIGHT":p.weight=t[u.source].data[f]}}l.push(p),o+=r.length}for(var c=0;c<l.length;c++)l[c].index=a;this.weights.push(l)}},H.prototype.getChildById=function(e,t){for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildById(e,t);if(s)return s}return null},H.prototype.getChildBySid=function(e,t){for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildBySid(e,t);if(s)return s}return null},H.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.nodes=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"node":this.nodes.push((new M).parse(i))}}return this},M.prototype.getChannelForTransform=function(e){for(var t=0;t<this.channels.length;t++){var i,s=this.channels[t],r=s.target.split("/"),a=(r.shift(),r.shift()),n=a.indexOf(".")>=0,o=a.indexOf("(")>=0;if(n)r=a.split("."),a=r.shift(),r.shift();else if(o){i=a.split("("),a=i.shift();for(var h=0;h<i.length;h++)i[h]=parseInt(i[h].replace(/\)/,""))}if(a===e)return s.info={sid:a,dotSyntax:n,arrSyntax:o,arrIndices:i},s}return null},M.prototype.getChildById=function(e,t){if(this.id===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildById(e,t);if(s)return s}return null},M.prototype.getChildBySid=function(e,t){if(this.sid===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildBySid(e,t);if(s)return s}return null},M.prototype.getTransformBySid=function(e){for(var t=0;t<this.transforms.length;t++)if(this.transforms[t].sid===e)return this.transforms[t];return null},M.prototype.parse=function(e){var t;this.id=e.getAttribute("id"),this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.type=e.getAttribute("type"),this.layer=e.getAttribute("layer"),this.type="JOINT"===this.type?this.type:"NODE",this.nodes=[],this.transforms=[],this.geometries=[],this.cameras=[],this.lights=[],this.controllers=[],this.matrix=new THREE.Matrix4;for(var i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"node":this.nodes.push((new M).parse(s));break;case"instance_camera":this.cameras.push((new re).parse(s));break;case"instance_controller":this.controllers.push((new O).parse(s));break;case"instance_geometry":this.geometries.push((new I).parse(s));break;case"instance_light":this.lights.push((new ne).parse(s));break;case"instance_node":t=s.getAttribute("url").replace(/^#/,"");var r=y(t);r&&this.nodes.push((new M).parse(r));break;case"rotate":case"translate":case"scale":case"matrix":case"lookat":case"skew":this.transforms.push((new j).parse(s));break;case"extra":break;default:console.log(s.nodeName)}}return this.channels=b(this),w(this),this.updateMatrix(),this},M.prototype.updateMatrix=function(){this.matrix.identity();for(var e=0;e<this.transforms.length;e++)this.transforms[e].apply(this.matrix)},j.prototype.parse=function(e){return this.sid=e.getAttribute("sid"),this.type=e.nodeName,this.data=ue(e.textContent),this.convert(),this},j.prototype.convert=function(){switch(this.type){case"matrix":this.obj=Te(this.data);break;case"rotate":this.angle=THREE.Math.degToRad(this.data[3]);case"translate":xe(this.data,-1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;case"scale":xe(this.data,1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;default:console.log("Can not convert Transform of type "+this.type)}},j.prototype.apply=function(){var e=new THREE.Matrix4;return function(t){switch(this.type){case"matrix":t.multiply(this.obj);break;case"translate":t.multiply(e.makeTranslation(this.obj.x,this.obj.y,this.obj.z));break;case"rotate":t.multiply(e.makeRotationAxis(this.obj,this.angle));break;case"scale":t.scale(this.obj)}}}(),j.prototype.update=function(e,t){var i=["X","Y","Z","ANGLE"];switch(this.type){case"matrix":if(t)if(1===t.length)switch(t[0]){case 0:this.obj.n11=e[0],this.obj.n21=e[1],this.obj.n31=e[2],this.obj.n41=e[3];break;case 1:this.obj.n12=e[0],this.obj.n22=e[1],this.obj.n32=e[2],this.obj.n42=e[3];break;case 2:this.obj.n13=e[0],this.obj.n23=e[1],this.obj.n33=e[2],this.obj.n43=e[3];break;case 3:this.obj.n14=e[0],this.obj.n24=e[1],this.obj.n34=e[2],this.obj.n44=e[3]}else if(2===t.length){var s="n"+(t[0]+1)+(t[1]+1);this.obj[s]=e}else console.log("Incorrect addressing of matrix in transform.");else this.obj.copy(e);break;case"translate":case"scale":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2]}break;case"rotate":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;case"ANGLE":this.angle=THREE.Math.degToRad(e);break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2],this.angle=THREE.Math.degToRad(e[3])}}},O.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.skeleton=[],this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1===i.nodeType)switch(i.nodeName){case"skeleton":this.skeleton.push(i.textContent.replace(/^#/,""));break;case"bind_material":for(var s=i.querySelectorAll("instance_material"),r=0;r<s.length;r++){var a=s[r];this.instance_material.push((new S).parse(a))}}}return this},S.prototype.parse=function(e){return this.symbol=e.getAttribute("symbol"),this.target=e.getAttribute("target").replace(/^#/,""),this},I.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType&&"bind_material"===i.nodeName){for(var s=i.querySelectorAll("instance_material"),r=0;r<s.length;r++){var a=s[r];this.instance_material.push((new S).parse(a))}break}}return this},q.prototype.parse=function(e){this.id=e.getAttribute("id"),be(this,e);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"mesh":this.mesh=new V(this).parse(i)}}return this},V.prototype.parse=function(e){this.primitives=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"source":pe(i);break;case"vertices":this.vertices=(new F).parse(i);break;case"linestrips":this.primitives.push((new Y).parse(i));break;case"triangles":this.primitives.push((new Z).parse(i));break;case"polygons":this.primitives.push((new X).parse(i));break;case"polylist":this.primitives.push((new L).parse(i))}}if(this.geometry3js=new THREE.Geometry,null===this.vertices)return this;for(var s=Le[this.vertices.input.POSITION.source].data,t=0;t<s.length;t+=3)this.geometry3js.vertices.push(ke(s,t).clone());for(var t=0;t<this.primitives.length;t++){var r=this.primitives[t];r.setVertices(this.vertices),this.handlePrimitive(r,this.geometry3js)}return this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals),this},V.prototype.handlePrimitive=function(e,t){if(e instanceof Y)return void(t.isLineStrip=!0);var i,s,r,a,n,o,h,l=e.p,c=e.inputs,p=0,d=3,u=0,f=[];for(i=0;i<c.length;i++){r=c[i];var m=r.offset+1;switch(u=u<m?m:u,r.semantic){case"TEXCOORD":f.push(r.set)}}for(var g=0;g<l.length;++g)for(var v=l[g],y=0;y<v.length;){var b=[],w=[],x=null,N=[];for(d=e.vcount?e.vcount.length?e.vcount[p++]:e.vcount:v.length/u,i=0;i<d;i++)for(s=0;s<c.length;s++)switch(r=c[s],o=Le[r.source],a=v[y+i*u+r.offset],h=o.accessor.params.length,n=a*h,r.semantic){case"VERTEX":b.push(a);break;case"NORMAL":w.push(ke(o.data,n));break;case"TEXCOORD":x=x||{},void 0===x[r.set]&&(x[r.set]=[]),x[r.set].push(new THREE.Vector2(o.data[n],o.data[n+1]));break;case"COLOR":N.push((new THREE.Color).setRGB(o.data[n],o.data[n+1],o.data[n+2]))}if(0===w.length)if(r=this.vertices.input.NORMAL){o=Le[r.source],h=o.accessor.params.length;for(var k=0,T=b.length;k<T;k++)w.push(ke(o.data,b[k]*h))}else t.calcNormals=!0;if(!x&&(x={},r=this.vertices.input.TEXCOORD)){f.push(r.set),o=Le[r.source],h=o.accessor.params.length;for(var k=0,T=b.length;k<T;k++)n=b[k]*h,void 0===x[r.set]&&(x[r.set]=[]),x[r.set].push(new THREE.Vector2(o.data[n],1-o.data[n+1]))}if(0===N.length&&(r=this.vertices.input.COLOR)){o=Le[r.source],h=o.accessor.params.length;for(var k=0,T=b.length;k<T;k++)n=b[k]*h,N.push((new THREE.Color).setRGB(o.data[n],o.data[n+1],o.data[n+2]))}var E,R,_=null,A=[];if(3===d)A.push(new THREE.Face3(b[0],b[1],b[2],w,N.length?N:new THREE.Color));else if(4===d)A.push(new THREE.Face3(b[0],b[1],b[3],w.length?[w[0].clone(),w[1].clone(),w[3].clone()]:[],N.length?[N[0],N[1],N[3]]:new THREE.Color)),A.push(new THREE.Face3(b[1],b[2],b[3],w.length?[w[1].clone(),w[2].clone(),w[3].clone()]:[],N.length?[N[1],N[2],N[3]]:new THREE.Color));else if(d>4&&Je.subdivideFaces){var C=N.length?N:new THREE.Color;for(s=1;s<d-1;)A.push(new THREE.Face3(b[0],b[s],b[s+1],w.length?[w[0].clone(),w[s++].clone(),w[s].clone()]:[],C))}if(A.length)for(var k=0,T=A.length;k<T;k++)for(_=A[k],_.daeMaterial=e.material,t.faces.push(_),s=0;s<f.length;s++)E=x[f[s]],R=d>4?[E[0],E[k+1],E[k+2]]:4===d?0===k?[E[0],E[1],E[3]]:[E[1].clone(),E[2],E[3].clone()]:[E[0],E[1],E[2]],void 0===t.faceVertexUvs[s]&&(t.faceVertexUvs[s]=[]),t.faceVertexUvs[s].push(R);else console.log("dropped face with vcount "+d+" for geometry with id: "+t.id);y+=u*d}},X.prototype.setVertices=function(e){for(var t=0;t<this.inputs.length;t++)this.inputs[t].source===e.id&&(this.inputs[t].source=e.input.POSITION.source)},X.prototype.parse=function(e){this.material=e.getAttribute("material"),this.count=ve(e,"count",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"input":this.inputs.push((new B).parse(e.childNodes[t]));break;case"vcount":this.vcount=fe(i.textContent);break;case"p":
122
+ this.p.push(fe(i.textContent));break;case"ph":console.warn("polygon holes not yet supported!")}}return this},L.prototype=Object.create(X.prototype),L.prototype.constructor=L,Y.prototype=Object.create(X.prototype),Y.prototype.constructor=Y,Z.prototype=Object.create(X.prototype),Z.prototype.constructor=Z,z.prototype.parse=function(e){this.params=[],this.source=e.getAttribute("source"),this.count=ve(e,"count",0),this.stride=ve(e,"stride",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if("param"===i.nodeName){var s={};s.name=i.getAttribute("name"),s.type=i.getAttribute("type"),this.params.push(s)}}return this},F.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++)if("input"===e.childNodes[t].nodeName){var i=(new B).parse(e.childNodes[t]);this.input[i.semantic]=i}return this},B.prototype.parse=function(e){return this.semantic=e.getAttribute("semantic"),this.source=e.getAttribute("source").replace(/^#/,""),this.set=ve(e,"set",-1),this.offset=ve(e,"offset",0),"TEXCOORD"===this.semantic&&this.set<0&&(this.set=0),this},D.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"bool_array":this.data=de(i.textContent),this.type=i.nodeName;break;case"float_array":this.data=ue(i.textContent),this.type=i.nodeName;break;case"int_array":this.data=fe(i.textContent),this.type=i.nodeName;break;case"IDREF_array":case"Name_array":this.data=me(i.textContent),this.type=i.nodeName;break;case"technique_common":for(var s=0;s<i.childNodes.length;s++)if("accessor"===i.childNodes[s].nodeName){this.accessor=(new z).parse(i.childNodes[s]);break}}}return this},D.prototype.read=function(){var e=[],t=this.accessor.params[0];switch(t.type){case"IDREF":case"Name":case"name":case"float":return this.data;case"float4x4":for(var i=0;i<this.data.length;i+=16){var s=this.data.slice(i,i+16),r=Te(s);e.push(r)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+t.type+".")}return e},P.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++)if("instance_effect"===e.childNodes[t].nodeName){this.instance_effect=(new $).parse(e.childNodes[t]);break}return this},U.prototype.isColor=function(){return null===this.texture},U.prototype.isTexture=function(){return null!=this.texture},U.prototype.parse=function(e){"transparent"===e.nodeName&&(this.opaque=e.getAttribute("opaque"));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"color":var s=ue(i.textContent);this.color=new THREE.Color,this.color.setRGB(s[0],s[1],s[2]),this.color.a=s[3];break;case"texture":this.texture=i.getAttribute("texture"),this.texcoord=i.getAttribute("texcoord"),this.texOpts={offsetU:0,offsetV:0,repeatU:1,repeatV:1,wrapU:1,wrapV:1},this.parseTexture(i)}}return this},U.prototype.parseTexture=function(e){if(!e.childNodes)return this;e.childNodes[1]&&"extra"===e.childNodes[1].nodeName&&(e=e.childNodes[1],e.childNodes[1]&&"technique"===e.childNodes[1].nodeName&&(e=e.childNodes[1]));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"offsetU":case"offsetV":case"repeatU":case"repeatV":this.texOpts[i.nodeName]=parseFloat(i.textContent);break;case"wrapU":case"wrapV":"TRUE"===i.textContent.toUpperCase()?this.texOpts[i.nodeName]=1:this.texOpts[i.nodeName]=parseInt(i.textContent);break;default:this.texOpts[i.nodeName]=i.textContent}}return this},G.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"emission":case"diffuse":case"specular":case"transparent":this[i.nodeName]=(new U).parse(i);break;case"bump":var s=i.getAttribute("bumptype");s?"heightfield"===s.toLowerCase()?this.bump=(new U).parse(i):"normalmap"===s.toLowerCase()?this.normal=(new U).parse(i):(console.error("Shader.prototype.parse: Invalid value for attribute 'bumptype' ("+s+") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'"),this.bump=(new U).parse(i)):(console.warn("Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'"),this.bump=(new U).parse(i));break;case"shininess":case"reflectivity":case"index_of_refraction":case"transparency":var r=i.querySelectorAll("float");r.length>0&&(this[i.nodeName]=parseFloat(r[0].textContent))}}return this.create(),this},G.prototype.create=function(){var e={},t=!1;if(void 0!==this.transparency&&void 0!==this.transparent){var i=(this.transparent,(this.transparent.color.r+this.transparent.color.g+this.transparent.color.b)/3*this.transparency);i>0&&(t=!0,e.transparent=!0,e.opacity=1-i)}var s={diffuse:"map",ambient:"lightMap",specular:"specularMap",emission:"emissionMap",bump:"bumpMap",normal:"normalMap"};for(var r in this)switch(r){case"ambient":case"emission":case"diffuse":case"specular":case"bump":case"normal":var a=this[r];if(a instanceof U)if(a.isTexture()){var n=a.texture,o=this.effect.sampler[n];if(void 0!==o&&void 0!==o.source){var h=this.effect.surface[o.source];if(void 0!==h){var l=Ye[h.init_from];if(l){var c,p=Oe+l.init_from,d=THREE.Loader.Handlers.get(p);null!==d?c=d.load(p):(c=new THREE.Texture,ye(c,p)),"MIRROR"===o.wrap_s?c.wrapS=THREE.MirroredRepeatWrapping:"WRAP"===o.wrap_s||a.texOpts.wrapU?c.wrapS=THREE.RepeatWrapping:c.wrapS=THREE.ClampToEdgeWrapping,"MIRROR"===o.wrap_t?c.wrapT=THREE.MirroredRepeatWrapping:"WRAP"===o.wrap_t||a.texOpts.wrapV?c.wrapT=THREE.RepeatWrapping:c.wrapT=THREE.ClampToEdgeWrapping,c.offset.x=a.texOpts.offsetU,c.offset.y=a.texOpts.offsetV,c.repeat.x=a.texOpts.repeatU,c.repeat.y=a.texOpts.repeatV,e[s[r]]=c,"emission"===r&&(e.emissive=16777215)}}}}else"diffuse"!==r&&t||("emission"===r?e.emissive=a.color.getHex():e[r]=a.color.getHex());break;case"shininess":e[r]=this[r];break;case"reflectivity":e[r]=this[r],e[r]>0&&(e.envMap=Je.defaultEnvMap),e.combine=THREE.MixOperation;break;case"index_of_refraction":e.refractionRatio=this[r],1!==this[r]&&(e.envMap=Je.defaultEnvMap)}switch(e.shading=Ge,e.side=this.effect.doubleSided?THREE.DoubleSide:THREE.FrontSide,void 0!==e.diffuse&&(e.color=e.diffuse,delete e.diffuse),this.type){case"constant":void 0!=e.emissive&&(e.color=e.emissive),this.material=new THREE.MeshBasicMaterial(e);break;case"phong":case"blinn":this.material=new THREE.MeshPhongMaterial(e);break;case"lambert":default:this.material=new THREE.MeshLambertMaterial(e)}return this.material},J.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"init_from":this.init_from=i.textContent;break;case"format":this.format=i.textContent;break;default:console.log("unhandled Surface prop: "+i.nodeName)}}return this},W.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"source":this.source=i.textContent;break;case"minfilter":this.minfilter=i.textContent;break;case"magfilter":this.magfilter=i.textContent;break;case"mipfilter":this.mipfilter=i.textContent;break;case"wrap_s":this.wrap_s=i.textContent;break;case"wrap_t":this.wrap_t=i.textContent;break;default:console.log("unhandled Sampler2D prop: "+i.nodeName)}}return this},Q.prototype.create=function(){if(null===this.shader)return null},Q.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),be(this,e),this.shader=null;for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(i))}}return this},Q.prototype.parseNewparam=function(e){for(var t=e.getAttribute("sid"),i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"surface":this.surface[t]=new J(this).parse(s);break;case"sampler2D":this.sampler[t]=new W(this).parse(s);break;case"extra":break;default:console.log(s.nodeName)}}},Q.prototype.parseProfileCOMMON=function(e){for(var t,i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"profile_COMMON":this.parseProfileCOMMON(s);break;case"technique":t=s;break;case"newparam":this.parseNewparam(s);break;case"image":var r=(new R).parse(s);Ye[r.id]=r;break;case"extra":break;default:console.log(s.nodeName)}}return t},Q.prototype.parseTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"constant":case"lambert":case"blinn":case"phong":this.shader=new G(i.nodeName,this).parse(i);break;case"extra":this.parseExtra(i)}}},Q.prototype.parseExtra=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique":this.parseExtraTechnique(i)}}},Q.prototype.parseExtraTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"bump":this.shader.parse(e)}}},$.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},K.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.source={};for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"animation":var s=(new K).parse(i);for(var r in s.source)this.source[r]=s.source[r];for(var a=0;a<s.channel.length;a++)this.channel.push(s.channel[a]),this.sampler.push(s.sampler[a]);break;case"source":var r=(new D).parse(i);this.source[r.id]=r;break;case"sampler":this.sampler.push(new te(this).parse(i));break;case"channel":this.channel.push(new ee(this).parse(i))}}return this},ee.prototype.parse=function(e){this.source=e.getAttribute("source").replace(/^#/,""),this.target=e.getAttribute("target");var t=this.target.split("/"),i=(t.shift(),t.shift()),s=i.indexOf(".")>=0,r=i.indexOf("(")>=0;if(s)t=i.split("."),this.sid=t.shift(),this.member=t.shift();else if(r){var a=i.split("(");this.sid=a.shift();for(var n=0;n<a.length;n++)a[n]=parseInt(a[n].replace(/\)/,""));this.arrIndices=a}else this.sid=i;return this.fullSid=i,this.dotSyntax=s,this.arrSyntax=r,this},te.prototype.parse=function(e){this.id=e.getAttribute("id"),this.inputs=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"input":this.inputs.push((new B).parse(i))}}return this},te.prototype.create=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e],i=this.animation.source[t.source];switch(t.semantic){case"INPUT":this.input=i.read();break;case"OUTPUT":this.output=i.read(),this.strideOut=i.accessor.stride;break;case"INTERPOLATION":this.interpolation=i.read();break;case"IN_TANGENT":case"OUT_TANGENT":break;default:console.log(t.semantic)}}if(this.startTime=0,this.endTime=0,this.duration=0,this.input.length){this.startTime=1e8,this.endTime=-1e8;for(var e=0;e<this.input.length;e++)this.startTime=Math.min(this.startTime,this.input[e]),this.endTime=Math.max(this.endTime,this.input[e]);this.duration=this.endTime-this.startTime}},te.prototype.getData=function(e,t,i){var s;if("matrix"===e&&16===this.strideOut)s=this.output[t];else if(this.strideOut>1){s=[],t*=this.strideOut;for(var r=0;r<this.strideOut;++r)s[r]=this.output[t+r];if(3===this.strideOut)switch(e){case"rotate":case"translate":xe(s,-1);break;case"scale":xe(s,1)}else 4===this.strideOut&&"matrix"===e&&xe(s,-1)}else s=this.output[t],i&&"translate"===e&&(s=Ne(i,s));return s},ie.prototype.addTarget=function(e,t,i,s){this.targets.push({sid:e,member:i,transform:t,data:s})},ie.prototype.apply=function(e){for(var t=0;t<this.targets.length;++t){var i=this.targets[t];e&&i.sid!==e||i.transform.update(i.data,i.member)}},ie.prototype.getTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return this.targets[t];return null},ie.prototype.hasTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return!0;return!1},ie.prototype.interpolate=function(e,t){for(var i=0,s=this.targets.length;i<s;i++){var r,a=this.targets[i],n=e.getTarget(a.sid);if("matrix"!==a.transform.type&&n){var o=(t-this.time)/(e.time-this.time),h=n.data,l=a.data;if(o<0&&(o=0),o>1&&(o=1),l.length){r=[];for(var c=0;c<l.length;++c)r[c]=l[c]+(h[c]-l[c])*o}else r=l+(h-l)*o}else r=a.data;a.transform.update(r,a.member)}},se.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"optics":this.parseOptics(i)}}return this},se.prototype.parseOptics=function(e){for(var t=0;t<e.childNodes.length;t++)if("technique_common"===e.childNodes[t].nodeName)for(var i=e.childNodes[t],s=0;s<i.childNodes.length;s++)if(this.technique=i.childNodes[s].nodeName,"perspective"===this.technique)for(var r=i.childNodes[s],a=0;a<r.childNodes.length;a++){var n=r.childNodes[a];switch(n.nodeName){case"yfov":this.yfov=n.textContent;break;case"xfov":this.xfov=n.textContent;break;case"znear":this.znear=n.textContent;break;case"zfar":this.zfar=n.textContent;break;case"aspect_ratio":this.aspect_ratio=n.textContent}}else if("orthographic"===this.technique)for(var o=i.childNodes[s],a=0;a<o.childNodes.length;a++){var n=o.childNodes[a];switch(n.nodeName){case"xmag":this.xmag=n.textContent;break;case"ymag":this.ymag=n.textContent;break;case"znear":this.znear=n.textContent;break;case"zfar":this.zfar=n.textContent;break;case"aspect_ratio":this.aspect_ratio=n.textContent}}return this},re.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},ae.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i);break;case"technique":this.parseTechnique(i)}}return this},ae.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++)switch(e.childNodes[t].nodeName){case"directional":case"point":case"spot":case"ambient":this.technique=e.childNodes[t].nodeName;for(var i=e.childNodes[t],s=0;s<i.childNodes.length;s++){var r=i.childNodes[s];switch(r.nodeName){case"color":var a=ue(r.textContent);this.color=new THREE.Color(0),this.color.setRGB(a[0],a[1],a[2]),this.color.a=a[3];break;case"falloff_angle":this.falloff_angle=parseFloat(r.textContent);break;case"quadratic_attenuation":var n=parseFloat(r.textContent);this.distance=n?Math.sqrt(1/n):0}}}return this},ae.prototype.parseTechnique=function(e){this.profile=e.getAttribute("profile");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"intensity":this.intensity=parseFloat(i.textContent)}}return this},ne.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},oe.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.joints=[],this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i)}}return this},oe.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(e.childNodes[t].nodeName){case"joint":this.joints.push((new he).parse(i));break;case"link":this.links.push((new le).parse(i))}}return this},he.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this.static=!1,this.zeroPosition=0,this.middlePosition=0;var t=e.querySelector("axis"),i=ue(t.textContent);this.axis=ke(i,0);var s=e.querySelector("limits min")?parseFloat(e.querySelector("limits min").textContent):-360,r=e.querySelector("limits max")?parseFloat(e.querySelector("limits max").textContent):360;this.limits={min:s,max:r};for(var a=["prismatic","revolute"],n=0;n<a.length;n++){var o=a[n];e.querySelector(o)&&(this.type=o)}return this.limits.min>=this.limits.max&&(this.static=!0),this.middlePosition=(this.limits.min+this.limits.max)/2,this},le.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.transforms=[],this.attachments=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"attachment_full":this.attachments.push((new ce).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new j).parse(i))}}return this},ce.prototype.parse=function(e){this.joint=e.getAttribute("joint").split("/").pop(),this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"link":this.links.push((new le).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new j).parse(i))}}return this},{load:e,parse:t,setPreferredShading:i,applySkin:m,geometries:Fe,options:Je}};
123
+ },{}],43:[function(_dereq_,module,exports){
124
+ THREE.GLTFLoader=function(){function e(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager}function r(){var e={};return{get:function(r){return e[r]},add:function(r,t){e[r]=t},remove:function(r){delete e[r]},removeAll:function(){e={}},update:function(r,t){r.updateMatrixWorld(),t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld);for(var a in e){var n=e[a];n.update&&n.update(r,t)}}}}function t(e,r){var t={},a=e.material.uniforms;for(var n in a){var i=a[n];if(i.semantic){var s=i.node,o=e;s&&(o=r[s]),t[n]={semantic:i.semantic,sourceNode:o,targetNode:e,uniform:i}}}this.boundUniforms=t,this._m4=new THREE.Matrix4}function a(e){this.name=l.KHR_MATERIALS_COMMON,this.lights={};var r=e.extensions&&e.extensions[l.KHR_MATERIALS_COMMON].lights;for(var t in r){var a,n=r[t],i=n[n.type],s=(new THREE.Color).fromArray(i.color);switch(n.type){case"directional":a=new THREE.DirectionalLight(s),a.position.set(0,0,1);break;case"point":a=new THREE.PointLight(s);break;case"spot":a=new THREE.SpotLight(s),a.position.set(0,0,1);break;case"ambient":a=new THREE.AmbientLight(s)}a&&(this.lights[t]=a)}}function n(e){this.name=l.KHR_BINARY_GLTF;var r=new DataView(e,0,f),t={magic:o(new Uint8Array(e.slice(0,4))),version:r.getUint32(4,!0),length:r.getUint32(8,!0),contentLength:r.getUint32(12,!0),contentFormat:r.getUint32(16,!0)};for(var a in p){var n=p[a];if(t[a]!==n)throw new Error('Unsupported glTF-Binary header: Expected "%s" to be "%s".',a,n)}var i=new Uint8Array(e,f,t.contentLength);this.header=t,this.content=o(i),this.body=e.slice(f+t.contentLength,t.length)}function i(e,r,t){if(!e)return Promise.resolve();var a,n=[];if("[object Array]"===Object.prototype.toString.call(e)){a=[];for(var i=e.length,s=0;s<i;s++){var o=r.call(t||this,e[s],s);o&&(n.push(o),o instanceof Promise?o.then(function(e,r){a[s]=r}.bind(this,c)):a[s]=o)}}else{a={};for(var c in e)if(e.hasOwnProperty(c)){var o=r.call(t||this,e[c],c);o&&(n.push(o),o instanceof Promise?o.then(function(e,r){a[e]=r}.bind(this,c)):a[c]=o)}}return Promise.all(n).then(function(){return a})}function s(e,r){return"string"!=typeof e||""===e?"":/^https?:\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:(r||"")+e}function o(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return r}function c(e,r){var t={};for(var a in r.attributes){var n=r.attributes[a],i=r.parameters[n],s=i.type,o=i.semantic;t[a]={type:s,semantic:o}}var c=r.parameters,u=r.attributes,E={};for(var a in t){var n=u[a],d=c[n],o=d.semantic;o&&(E[a]=d)}for(var n in E){var i=E[n],o=i.semantic,l=new RegExp("\\b"+n+"\\b","g");switch(o){case"POSITION":e=e.replace(l,"position");break;case"NORMAL":e=e.replace(l,"normal");break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":e=e.replace(l,"uv");break;case"COLOR_0":case"COLOR0":case"COLOR":e=e.replace(l,"color");break;case"WEIGHT":e=e.replace(l,"skinWeight");break;case"JOINT":e=e.replace(l,"skinIndex")}}return e}function u(){return new THREE.MeshPhongMaterial({color:0,emissive:8947848,specular:0,shininess:0,transparent:!1,depthTest:!0,side:THREE.FrontSide})}function E(e){this.isDeferredShaderMaterial=!0,this.params=e}function d(e,t,a){this.json=e||{},this.extensions=t||{},this.options=a||{},this.cache=new r}e.prototype={constructor:e,load:function(e,r,t,a){var n=this,i=this.path&&"string"==typeof this.path?this.path:THREE.Loader.prototype.extractUrlBase(e),s=new THREE.FileLoader(n.manager);s.setResponseType("arraybuffer"),s.load(e,function(e){n.parse(e,r,i)},t,a)},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e},parse:function(e,r,t){var i,s={};o(new Uint8Array(e,0,4))===p.magic?(s[l.KHR_BINARY_GLTF]=new n(e),i=s[l.KHR_BINARY_GLTF].content):i=o(new Uint8Array(e));var c=JSON.parse(i);c.extensionsUsed&&c.extensionsUsed.indexOf(l.KHR_MATERIALS_COMMON)>=0&&(s[l.KHR_MATERIALS_COMMON]=new a(c)),console.time("GLTFLoader"),new d(c,s,{path:t||this.path,crossOrigin:this.crossOrigin}).parse(function(e,t,a,n){console.timeEnd("GLTFLoader"),r({scene:e,scenes:t,cameras:a,animations:n})})}},e.Shaders=new r,t.prototype.update=function(e,r){var t=this.boundUniforms;for(var a in t){var n=t[a];switch(n.semantic){case"MODELVIEW":var i=n.uniform.value;i.multiplyMatrices(r.matrixWorldInverse,n.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var s=n.uniform.value;this._m4.multiplyMatrices(r.matrixWorldInverse,n.sourceNode.matrixWorld),s.getNormalMatrix(this._m4);break;case"PROJECTION":var i=n.uniform.value;i.copy(r.projectionMatrix);break;case"JOINTMATRIX":for(var o=n.uniform.value,c=0;c<o.length;c++)o[c].getInverse(n.sourceNode.matrixWorld).multiply(n.targetNode.skeleton.bones[c].matrixWorld).multiply(n.targetNode.skeleton.boneInverses[c]).multiply(n.targetNode.bindMatrix);break;default:console.warn("Unhandled shader semantic: "+n.semantic)}}},e.Animations={update:function(){console.warn("THREE.GLTFLoader.Animation has been deprecated. Use THREE.AnimationMixer instead.")}};var l={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_MATERIALS_COMMON:"KHR_materials_common"},p={magic:"glTF",version:1,contentFormat:0},f=20;n.prototype.loadShader=function(e,r){var t=r[e.extensions[l.KHR_BINARY_GLTF].bufferView];return o(new Uint8Array(t))},n.prototype.loadTextureSourceUri=function(e,r){var t=e.extensions[l.KHR_BINARY_GLTF],a=r[t.bufferView],n=o(new Uint8Array(a));return"data:"+t.mimeType+";base64,"+btoa(n)};var h={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,TRIANGLES:4,LINES:1,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,VERTEX_SHADER:35633,FRAGMENT_SHADER:35632},m={5126:Number,35675:THREE.Matrix3,35676:THREE.Matrix4,35664:THREE.Vector2,35665:THREE.Vector3,35666:THREE.Vector4,35678:THREE.Texture},T={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},v={9728:THREE.NearestFilter,9729:THREE.LinearFilter,9984:THREE.NearestMipMapNearestFilter,9985:THREE.LinearMipMapNearestFilter,9986:THREE.NearestMipMapLinearFilter,9987:THREE.LinearMipMapLinearFilter},R={33071:THREE.ClampToEdgeWrapping,33648:THREE.MirroredRepeatWrapping,10497:THREE.RepeatWrapping},A={6406:THREE.AlphaFormat,6407:THREE.RGBFormat,6408:THREE.RGBAFormat,6409:THREE.LuminanceFormat,6410:THREE.LuminanceAlphaFormat},H={5121:THREE.UnsignedByteType,32819:THREE.UnsignedShort4444Type,32820:THREE.UnsignedShort5551Type,33635:THREE.UnsignedShort565Type},y={1028:THREE.BackSide,1029:THREE.FrontSide},w={512:THREE.NeverDepth,513:THREE.LessDepth,514:THREE.EqualDepth,515:THREE.LessEqualDepth,516:THREE.GreaterEqualDepth,517:THREE.NotEqualDepth,518:THREE.GreaterEqualDepth,519:THREE.AlwaysDepth},b={32774:THREE.AddEquation,32778:THREE.SubtractEquation,32779:THREE.ReverseSubtractEquation},O={0:THREE.ZeroFactor,1:THREE.OneFactor,768:THREE.SrcColorFactor,769:THREE.OneMinusSrcColorFactor,770:THREE.SrcAlphaFactor,771:THREE.OneMinusSrcAlphaFactor,772:THREE.DstAlphaFactor,773:THREE.OneMinusDstAlphaFactor,774:THREE.DstColorFactor,775:THREE.OneMinusDstColorFactor,776:THREE.SrcAlphaSaturateFactor},M={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},L={scale:"scale",translation:"position",rotation:"quaternion"},g={LINEAR:THREE.InterpolateLinear,STEP:THREE.InterpolateDiscrete},S={2884:"CULL_FACE",2929:"DEPTH_TEST",3042:"BLEND",3089:"SCISSOR_TEST",32823:"POLYGON_OFFSET_FILL",32926:"SAMPLE_ALPHA_TO_COVERAGE"};return E.prototype.create=function(){var e=THREE.UniformsUtils.clone(this.params.uniforms);for(var r in this.params.uniforms){var t=this.params.uniforms[r];t.value instanceof THREE.Texture&&(e[r].value=t.value,e[r].value.needsUpdate=!0),e[r].semantic=t.semantic,e[r].node=t.node}return this.params.uniforms=e,new THREE.RawShaderMaterial(this.params)},d.prototype._withDependencies=function(e){for(var r={},t=0;t<e.length;t++){var a=e[t],n="load"+a.charAt(0).toUpperCase()+a.slice(1),s=this.cache.get(a);if(void 0!==s)r[a]=s;else if(this[n]){var o=this[n]();this.cache.add(a,o),r[a]=o}}return i(r,function(e){return e})},d.prototype.parse=function(e){var r=this.json;this.cache.removeAll(),this._withDependencies(["scenes","cameras","animations"]).then(function(t){var a=t.scenes[r.scene],n=[];for(var i in t.scenes)n.push(t.scenes[i]);var s=[];for(var i in t.cameras){var o=t.cameras[i];s.push(o)}var c=[];for(var i in t.animations)c.push(t.animations[i]);e(a,n,s,c)})},d.prototype.loadShaders=function(){var e=this.json,r=this.extensions,t=this.options;return this._withDependencies(["bufferViews"]).then(function(a){return i(e.shaders,function(e){return e.extensions&&e.extensions[l.KHR_BINARY_GLTF]?r[l.KHR_BINARY_GLTF].loadShader(e,a.bufferViews):new Promise(function(r){var a=new THREE.FileLoader;a.setResponseType("text"),a.load(s(e.uri,t.path),function(e){r(e)})})})})},d.prototype.loadBuffers=function(){var e=this.json,r=this.extensions,t=this.options;return i(e.buffers,function(e,a){return"binary_glTF"===a?r[l.KHR_BINARY_GLTF].body:"arraybuffer"===e.type||void 0===e.type?new Promise(function(r){var a=new THREE.FileLoader;a.setResponseType("arraybuffer"),a.load(s(e.uri,t.path),function(e){r(e)})}):void console.warn("THREE.GLTFLoader: "+e.type+" buffer type is not supported")})},d.prototype.loadBufferViews=function(){var e=this.json;return this._withDependencies(["buffers"]).then(function(r){return i(e.bufferViews,function(e){return r.buffers[e.buffer].slice(e.byteOffset,e.byteOffset+e.byteLength)})})},d.prototype.loadAccessors=function(){var e=this.json;return this._withDependencies(["bufferViews"]).then(function(r){return i(e.accessors,function(e){var t=r.bufferViews[e.bufferView],a=M[e.type],n=T[e.componentType],i=n.BYTES_PER_ELEMENT,s=i*a;if(e.byteStride&&e.byteStride!==s){var o=new n(t),c=new THREE.InterleavedBuffer(o,e.byteStride/i);return new THREE.InterleavedBufferAttribute(c,a,e.byteOffset/i)}return o=new n(t,e.byteOffset,e.count*a),new THREE.BufferAttribute(o,a)})})},d.prototype.loadTextures=function(){var e=this.json,r=this.extensions,t=this.options;return this._withDependencies(["bufferViews"]).then(function(a){return i(e.textures,function(n){if(n.source)return new Promise(function(i){var o=e.images[n.source],c=o.uri;o.extensions&&o.extensions[l.KHR_BINARY_GLTF]&&(c=r[l.KHR_BINARY_GLTF].loadTextureSourceUri(o,a.bufferViews));var u=THREE.Loader.Handlers.get(c);null===u&&(u=new THREE.TextureLoader),u.setCrossOrigin(t.crossOrigin),u.load(s(c,t.path),function(r){if(r.flipY=!1,void 0!==n.name&&(r.name=n.name),r.format=void 0!==n.format?A[n.format]:THREE.RGBAFormat,void 0!==n.internalFormat&&r.format!==A[n.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js doesn't support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),r.type=void 0!==n.type?H[n.type]:THREE.UnsignedByteType,n.sampler){var t=e.samplers[n.sampler];r.magFilter=v[t.magFilter],r.minFilter=v[t.minFilter],r.wrapS=R[t.wrapS],r.wrapT=R[t.wrapT]}i(r)},void 0,function(){i()})})})})},d.prototype.loadMaterials=function(){var e=this.json;return this._withDependencies(["shaders","textures"]).then(function(r){return i(e.materials,function(t){var a,n,i={},s={};if(t.extensions&&t.extensions[l.KHR_MATERIALS_COMMON]&&(n=t.extensions[l.KHR_MATERIALS_COMMON]),n){switch(n.technique){case"BLINN":case"PHONG":a=THREE.MeshPhongMaterial;break;case"LAMBERT":a=THREE.MeshLambertMaterial;break;case"CONSTANT":default:a=THREE.MeshBasicMaterial}Object.assign(i,n.values),(n.doubleSided||i.doubleSided)&&(s.side=THREE.DoubleSide),(n.transparent||i.transparent)&&(s.transparent=!0,s.opacity=void 0!==i.transparency?i.transparency:1)}else if(void 0===t.technique)a=THREE.MeshPhongMaterial,Object.assign(i,t.values);else{a=E;var o=e.techniques[t.technique];s.uniforms={};var u=e.programs[o.program];if(u){s.fragmentShader=r.shaders[u.fragmentShader],s.fragmentShader||(console.warn("ERROR: Missing fragment shader definition:",u.fragmentShader),a=THREE.MeshPhongMaterial);var d=r.shaders[u.vertexShader];d||(console.warn("ERROR: Missing vertex shader definition:",u.vertexShader),a=THREE.MeshPhongMaterial),s.vertexShader=c(d,o);var p=o.uniforms;for(var f in p){var T=p[f],v=o.parameters[T],R=v.type;if(!m[R])throw new Error("Unknown shader uniform param type: "+R);var A,H=v.count;void 0!==t.values&&(A=t.values[T]);var M=new m[R],L=v.semantic,g=v.node;switch(R){case h.FLOAT:M=v.value,"transparency"==T&&(s.transparent=!0),void 0!==A&&(M=A);break;case h.FLOAT_VEC2:case h.FLOAT_VEC3:case h.FLOAT_VEC4:case h.FLOAT_MAT3:v&&v.value&&M.fromArray(v.value),A&&M.fromArray(A);break;case h.FLOAT_MAT2:console.warn("FLOAT_MAT2 is not a supported uniform type");break;case h.FLOAT_MAT4:if(H){M=new Array(H);for(var _=0;_<H;_++)M[_]=new m[R];if(v&&v.value){var x=v.value;M.fromArray(x)}A&&M.fromArray(A)}else{if(v&&v.value){var F=v.value;M.fromArray(F)}A&&M.fromArray(A)}break;case h.SAMPLER_2D:M=void 0!==A?r.textures[A]:void 0!==v.value?r.textures[v.value]:null}s.uniforms[f]={value:M,semantic:L,node:g}}for(var N=o.states||{},D=N.enable||[],I=N.functions||{},C=!1,k=!1,B=!1,U=0,G=D.length;U<G;U++){var P=D[U];switch(S[P]){case"CULL_FACE":C=!0;break;case"DEPTH_TEST":k=!0;break;case"BLEND":B=!0;break;case"SCISSOR_TEST":case"POLYGON_OFFSET_FILL":case"SAMPLE_ALPHA_TO_COVERAGE":break;default:throw new Error("Unknown technique.states.enable: "+P)}}s.side=C?void 0!==I.cullFace?y[I.cullFace]:THREE.FrontSide:THREE.DoubleSide,s.depthTest=k,s.depthFunc=void 0!==I.depthFunc?w[I.depthFunc]:THREE.LessDepth,s.depthWrite=void 0===I.depthMask||I.depthMask[0],s.blending=B?THREE.CustomBlending:THREE.NoBlending,s.transparent=B;var j=I.blendEquationSeparate;void 0!==j?(s.blendEquation=b[j[0]],s.blendEquationAlpha=b[j[1]]):(s.blendEquation=THREE.AddEquation,s.blendEquationAlpha=THREE.AddEquation);var V=I.blendFuncSeparate;void 0!==V?(s.blendSrc=O[V[0]],s.blendDst=O[V[1]],s.blendSrcAlpha=O[V[2]],s.blendDstAlpha=O[V[3]]):(s.blendSrc=THREE.OneFactor,s.blendDst=THREE.ZeroFactor,s.blendSrcAlpha=THREE.OneFactor,s.blendDstAlpha=THREE.ZeroFactor)}}Array.isArray(i.diffuse)?s.color=(new THREE.Color).fromArray(i.diffuse):"string"==typeof i.diffuse&&(s.map=r.textures[i.diffuse]),delete s.diffuse,"string"==typeof i.reflective&&(s.envMap=r.textures[i.reflective]),"string"==typeof i.bump&&(s.bumpMap=r.textures[i.bump]),Array.isArray(i.emission)?a===THREE.MeshBasicMaterial?s.color=(new THREE.Color).fromArray(i.emission):s.emissive=(new THREE.Color).fromArray(i.emission):"string"==typeof i.emission&&(a===THREE.MeshBasicMaterial?s.map=r.textures[i.emission]:s.emissiveMap=r.textures[i.emission]),Array.isArray(i.specular)?s.specular=(new THREE.Color).fromArray(i.specular):"string"==typeof i.specular&&(s.specularMap=r.textures[i.specular]),void 0!==i.shininess&&(s.shininess=i.shininess);var K=new a(s);return void 0!==t.name&&(K.name=t.name),K})})},d.prototype.loadMeshes=function(){var e=this.json;return this._withDependencies(["accessors","materials"]).then(function(r){return i(e.meshes,function(e){var t=new THREE.Object3D;void 0!==e.name&&(t.name=e.name),e.extras&&(t.userData=e.extras);var a=e.primitives;for(var n in a){var i=a[n];if(i.mode===h.TRIANGLES||void 0===i.mode){var s=new THREE.BufferGeometry,o=i.attributes;for(var c in o){var E=o[c];if(!E)return;var d=r.accessors[E];switch(c){case"POSITION":s.addAttribute("position",d);break;case"NORMAL":s.addAttribute("normal",d);break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":s.addAttribute("uv",d);break;case"COLOR_0":case"COLOR0":case"COLOR":s.addAttribute("color",d);break;case"WEIGHT":s.addAttribute("skinWeight",d);break;case"JOINT":s.addAttribute("skinIndex",d)}}i.indices&&s.setIndex(r.accessors[i.indices]);var l=void 0!==r.materials?r.materials[i.material]:u(),p=new THREE.Mesh(s,l);p.castShadow=!0,p.name="0"===n?t.name:t.name+n,i.extras&&(p.userData=i.extras),t.add(p)}else if(i.mode===h.LINES){var s=new THREE.BufferGeometry,o=i.attributes;for(var c in o){var E=o[c];if(!E)return;var d=r.accessors[E];switch(c){case"POSITION":s.addAttribute("position",d);break;case"COLOR_0":case"COLOR0":case"COLOR":s.addAttribute("color",d)}}var p,l=r.materials[i.material];i.indices?(s.setIndex(r.accessors[i.indices]),p=new THREE.LineSegments(s,l)):p=new THREE.Line(s,l),p.name="0"===n?t.name:t.name+n,i.extras&&(p.userData=i.extras),t.add(p)}else console.warn("Only triangular and line primitives are supported")}return t})})},d.prototype.loadCameras=function(){return i(this.json.cameras,function(e){if("perspective"==e.type&&e.perspective){var r=e.perspective.yfov,t=e.perspective.xfov,a=e.perspective.aspect_ratio||1;t=void 0===t&&r?r*a:t;var n=new THREE.PerspectiveCamera(THREE.Math.radToDeg(t),a,e.perspective.znear||1,e.perspective.zfar||2e6);return void 0!==e.name&&(n.name=e.name),e.extras&&(n.userData=e.extras),n}if("orthographic"==e.type&&e.orthographic){var n=new THREE.OrthographicCamera(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,e.orthographic.znear,e.orthographic.zfar);return void 0!==e.name&&(n.name=e.name),e.extras&&(n.userData=e.extras),n}})},d.prototype.loadSkins=function(){var e=this.json;return this._withDependencies(["accessors"]).then(function(r){return i(e.skins,function(e){return{bindShapeMatrix:(new THREE.Matrix4).fromArray(e.bindShapeMatrix),jointNames:e.jointNames,inverseBindMatrices:r.accessors[e.inverseBindMatrices]}})})},d.prototype.loadAnimations=function(){var e=this.json;return this._withDependencies(["accessors","nodes"]).then(function(r){return i(e.animations,function(e,t){var a=[];for(var n in e.channels){var i=e.channels[n],s=e.samplers[i.sampler];if(s){var o=i.target,c=o.id,u=void 0!==e.parameters?e.parameters[s.input]:s.input,E=void 0!==e.parameters?e.parameters[s.output]:s.output,d=r.accessors[u],l=r.accessors[E],p=r.nodes[c];if(p){p.updateMatrix(),p.matrixAutoUpdate=!0;var f=L[o.path]===L.rotation?THREE.QuaternionKeyframeTrack:THREE.VectorKeyframeTrack,h=p.name?p.name:p.uuid;a.push(new f(h+"."+L[o.path],THREE.AnimationUtils.arraySlice(d.array,0),THREE.AnimationUtils.arraySlice(l.array,0),g[s.interpolation]))}}}return new THREE.AnimationClip("animation_"+t,void 0,a)})})},d.prototype.loadNodes=function(){var e=this.json,r=this.extensions,t=this;return i(e.nodes,function(e){var r,t=new THREE.Matrix4;return e.jointName?(r=new THREE.Bone,r.name=void 0!==e.name?e.name:e.jointName,r.jointName=e.jointName):(r=new THREE.Object3D,void 0!==e.name&&(r.name=e.name)),e.extras&&(r.userData=e.extras),void 0!==e.matrix?(t.fromArray(e.matrix),r.applyMatrix(t)):(void 0!==e.translation&&r.position.fromArray(e.translation),void 0!==e.rotation&&r.quaternion.fromArray(e.rotation),void 0!==e.scale&&r.scale.fromArray(e.scale)),r}).then(function(a){return t._withDependencies(["meshes","skins","cameras"]).then(function(t){return i(a,function(n,i){var s=e.nodes[i];if(void 0!==s.meshes)for(var o in s.meshes){var c=s.meshes[o],u=t.meshes[c];if(void 0!==u)for(var E in u.children){var d,p=u.children[E],f=p.material,h=p.geometry,m=p.userData,T=p.name;switch(f.isDeferredShaderMaterial?f=d=f.create():d=f,p.type){case"LineSegments":p=new THREE.LineSegments(h,d);break;case"Line":p=new THREE.Line(h,d);break;default:p=new THREE.Mesh(h,d)}p.castShadow=!0,p.userData=m,p.name=T;var v;if(s.skin&&(v=t.skins[s.skin]),v){var R=h,d=f;d.skinning=!0,p=new THREE.SkinnedMesh(R,d,!1),p.castShadow=!0,p.userData=m,p.name=T;for(var A=[],H=[],y=0,w=v.jointNames.length;y<w;y++){var b=v.jointNames[y],O=function(e){for(var r=Object.keys(a),t=0,n=r.length;t<n;t++){var i=a[r[t]];if(i.jointName===e)return i}return null}(b);if(O){A.push(O);var M=v.inverseBindMatrices.array,L=(new THREE.Matrix4).fromArray(M,16*y);H.push(L)}else console.warn("WARNING: joint: ''"+b+"' could not be found")}p.bind(new THREE.Skeleton(A,H,!1),v.bindShapeMatrix);var g=function(r,t,n){var i=r[n];if(void 0!==i)for(var s=0,o=i.length;s<o;s++){var c=i[s],u=a[c],E=e.nodes[c];void 0!==u&&!0===u.isBone&&void 0!==E&&(t.add(u),g(E,u,"children"))}};g(s,p,"skeletons")}n.add(p)}else console.warn("GLTFLoader: Couldn't find node \""+c+'".')}if(void 0!==s.camera){var S=t.cameras[s.camera];n.add(S)}if(s.extensions&&s.extensions[l.KHR_MATERIALS_COMMON]&&s.extensions[l.KHR_MATERIALS_COMMON].light){var _=r[l.KHR_MATERIALS_COMMON].lights,x=_[s.extensions[l.KHR_MATERIALS_COMMON].light];n.add(x)}return n})})})},d.prototype.loadScenes=function(){function r(e,t,n){var i=n[e];t.add(i);var s=a.nodes[e];if(s.children)for(var o=s.children,c=0,u=o.length;c<u;c++){var E=o[c];r(E,i,n)}}var a=this.json;return this._withDependencies(["nodes"]).then(function(n){return i(a.scenes,function(a){var i=new THREE.Scene;void 0!==a.name&&(i.name=a.name),a.extras&&(i.userData=a.extras);for(var s=a.nodes,o=0,c=s.length;o<c;o++){r(s[o],i,n.nodes)}return i.traverse(function(r){if(r.material&&r.material.isRawShaderMaterial){var a=new t(r,n.nodes);e.Shaders.add(r.uuid,a)}}),i})})},e}();
125
+ },{}],44:[function(_dereq_,module,exports){
126
+ THREE.MTLLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.MTLLoader.prototype={constructor:THREE.MTLLoader,load:function(t,a,e,r){var s=this,i=new THREE.FileLoader(this.manager);i.setPath(this.path),i.load(t,function(t){a(s.parse(t))},e,r)},setPath:function(t){this.path=t},setTexturePath:function(t){this.texturePath=t},setBaseUrl:function(t){console.warn("THREE.MTLLoader: .setBaseUrl() is deprecated. Use .setTexturePath( path ) for texture path or .setPath( path ) for general base path instead."),this.setTexturePath(t)},setCrossOrigin:function(t){this.crossOrigin=t},setMaterialOptions:function(t){this.materialOptions=t},parse:function(t){for(var a=t.split("\n"),e={},r=/\s+/,s={},i=0;i<a.length;i++){var o=a[i];if(o=o.trim(),0!==o.length&&"#"!==o.charAt(0)){var n=o.indexOf(" "),h=n>=0?o.substring(0,n):o;h=h.toLowerCase();var p=n>=0?o.substring(n+1):"";if(p=p.trim(),"newmtl"===h)e={name:p},s[p]=e;else if(e)if("ka"===h||"kd"===h||"ks"===h){var l=p.split(r,3);e[h]=[parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[2])]}else e[h]=p}}var c=new THREE.MTLLoader.MaterialCreator(this.texturePath||this.path,this.materialOptions);return c.setCrossOrigin(this.crossOrigin),c.setManager(this.manager),c.setMaterials(s),c}},THREE.MTLLoader.MaterialCreator=function(t,a){this.baseUrl=t||"",this.options=a,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,setCrossOrigin:function(t){this.crossOrigin=t},setManager:function(t){this.manager=t},setMaterials:function(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(t){if(!this.options)return t;var a={};for(var e in t){var r=t[e],s={};a[e]=s;for(var i in r){var o=!0,n=r[i],h=i.toLowerCase();switch(h){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(n=[n[0]/255,n[1]/255,n[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===n[0]&&0===n[1]&&0===n[2]&&(o=!1)}o&&(s[h]=n)}}return a},preload:function(){for(var t in this.materialsInfo)this.create(t)},getIndex:function(t){return this.nameLookup[t]},getAsArray:function(){var t=0;for(var a in this.materialsInfo)this.materialsArray[t]=this.create(a),this.nameLookup[a]=t,t++;return this.materialsArray},create:function(t){return void 0===this.materials[t]&&this.createMaterial_(t),this.materials[t]},createMaterial_:function(t){function a(t,a){return"string"!=typeof a||""===a?"":/^https?:\/\//i.test(a)?a:t+a}function e(t,e){if(!i[t]){var s=r.getTextureParams(e,i),o=r.loadTexture(a(r.baseUrl,s.url));o.repeat.copy(s.scale),o.offset.copy(s.offset),o.wrapS=r.wrap,o.wrapT=r.wrap,i[t]=o}}var r=this,s=this.materialsInfo[t],i={name:t,side:this.side};for(var o in s){var n=s[o];if(""!==n)switch(o.toLowerCase()){case"kd":i.color=(new THREE.Color).fromArray(n);break;case"ks":i.specular=(new THREE.Color).fromArray(n);break;case"map_kd":e("map",n);break;case"map_ks":e("specularMap",n);break;case"map_bump":case"bump":e("bumpMap",n);break;case"ns":i.shininess=parseFloat(n);break;case"d":n<1&&(i.opacity=n,i.transparent=!0);break;case"Tr":n>0&&(i.opacity=1-n,i.transparent=!0)}}return this.materials[t]=new THREE.MeshPhongMaterial(i),this.materials[t]},getTextureParams:function(t,a){var e,r={scale:new THREE.Vector2(1,1),offset:new THREE.Vector2(0,0)},s=t.split(/\s+/);return e=s.indexOf("-bm"),e>=0&&(a.bumpScale=parseFloat(s[e+1]),s.splice(e,2)),e=s.indexOf("-s"),e>=0&&(r.scale.set(parseFloat(s[e+1]),parseFloat(s[e+2])),s.splice(e,4)),e=s.indexOf("-o"),e>=0&&(r.offset.set(parseFloat(s[e+1]),parseFloat(s[e+2])),s.splice(e,4)),r.url=s.join(" ").trim(),r},loadTexture:function(t,a,e,r,s){var i,o=THREE.Loader.Handlers.get(t),n=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager;return null===o&&(o=new THREE.TextureLoader(n)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin),i=o.load(t,e,r,s),void 0!==a&&(i.mapping=a),i}};
127
+ },{}],45:[function(_dereq_,module,exports){
128
+ THREE.OBJLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager,this.materials=null,this.regexp={vertex_pattern:/^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,normal_pattern:/^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,uv_pattern:/^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,face_vertex:/^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,face_vertex_uv:/^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,face_vertex_uv_normal:/^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,face_vertex_normal:/^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,object_pattern:/^[og]\s*(.+)?/,smoothing_pattern:/^s\s+(\d+|on|off)/,material_library_pattern:/^mtllib /,material_use_pattern:/^usemtl /}},THREE.OBJLoader.prototype={constructor:THREE.OBJLoader,load:function(e,t,r,a){var i=this,s=new THREE.FileLoader(i.manager);s.setPath(this.path),s.load(e,function(e){t(i.parse(e))},r,a)},setPath:function(e){this.path=e},setMaterials:function(e){this.materials=e},_createParserState:function(){var e={objects:[],object:{},vertices:[],normals:[],uvs:[],materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],uvs:[]},materials:[],smooth:!0,startMaterial:function(e,t){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var a={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,i=this.object.geometry.vertices;i.push(a[e+0]),i.push(a[e+1]),i.push(a[e+2]),i.push(a[t+0]),i.push(a[t+1]),i.push(a[t+2]),i.push(a[r+0]),i.push(a[r+1]),i.push(a[r+2])},addVertexLine:function(e){var t=this.vertices,r=this.object.geometry.vertices;r.push(t[e+0]),r.push(t[e+1]),r.push(t[e+2])},addNormal:function(e,t,r){var a=this.normals,i=this.object.geometry.normals;i.push(a[e+0]),i.push(a[e+1]),i.push(a[e+2]),i.push(a[t+0]),i.push(a[t+1]),i.push(a[t+2]),i.push(a[r+0]),i.push(a[r+1]),i.push(a[r+2])},addUV:function(e,t,r){var a=this.uvs,i=this.object.geometry.uvs;i.push(a[e+0]),i.push(a[e+1]),i.push(a[t+0]),i.push(a[t+1]),i.push(a[r+0]),i.push(a[r+1])},addUVLine:function(e){var t=this.uvs,r=this.object.geometry.uvs;r.push(t[e+0]),r.push(t[e+1])},addFace:function(e,t,r,a,i,s,n,o,h,l,d,u){var p,c=this.vertices.length,m=this.parseVertexIndex(e,c),f=this.parseVertexIndex(t,c),v=this.parseVertexIndex(r,c);if(void 0===a?this.addVertex(m,f,v):(p=this.parseVertexIndex(a,c),this.addVertex(m,f,p),this.addVertex(f,v,p)),void 0!==i){var g=this.uvs.length;m=this.parseUVIndex(i,g),f=this.parseUVIndex(s,g),v=this.parseUVIndex(n,g),void 0===a?this.addUV(m,f,v):(p=this.parseUVIndex(o,g),this.addUV(m,f,p),this.addUV(f,v,p))}if(void 0!==h){var x=this.normals.length;m=this.parseNormalIndex(h,x),f=h===l?m:this.parseNormalIndex(l,x),v=h===d?m:this.parseNormalIndex(d,x),void 0===a?this.addNormal(m,f,v):(p=this.parseNormalIndex(u,x),this.addNormal(m,f,p),this.addNormal(f,v,p))}},addLineGeometry:function(e,t){this.object.geometry.type="Line";for(var r=this.vertices.length,a=this.uvs.length,i=0,s=e.length;i<s;i++)this.addVertexLine(this.parseVertexIndex(e[i],r));for(var n=0,s=t.length;n<s;n++)this.addUVLine(this.parseUVIndex(t[n],a))}};return e.startObject("",!1),e},parse:function(e){console.time("OBJLoader");var t=this._createParserState();-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));for(var r=e.split("\n"),a="",i="",s="",n=[],o="function"==typeof"".trimLeft,h=0,l=r.length;h<l;h++)if(a=r[h],a=o?a.trimLeft():a.trim(),0!==a.length&&"#"!==(i=a.charAt(0)))if("v"===i)if(" "===(s=a.charAt(1))&&null!==(n=this.regexp.vertex_pattern.exec(a)))t.vertices.push(parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]));else if("n"===s&&null!==(n=this.regexp.normal_pattern.exec(a)))t.normals.push(parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]));else{if("t"!==s||null===(n=this.regexp.uv_pattern.exec(a)))throw new Error("Unexpected vertex/normal/uv line: '"+a+"'");t.uvs.push(parseFloat(n[1]),parseFloat(n[2]))}else if("f"===i)if(null!==(n=this.regexp.face_vertex_uv_normal.exec(a)))t.addFace(n[1],n[4],n[7],n[10],n[2],n[5],n[8],n[11],n[3],n[6],n[9],n[12]);else if(null!==(n=this.regexp.face_vertex_uv.exec(a)))t.addFace(n[1],n[3],n[5],n[7],n[2],n[4],n[6],n[8]);else if(null!==(n=this.regexp.face_vertex_normal.exec(a)))t.addFace(n[1],n[3],n[5],n[7],void 0,void 0,void 0,void 0,n[2],n[4],n[6],n[8]);else{if(null===(n=this.regexp.face_vertex.exec(a)))throw new Error("Unexpected face line: '"+a+"'");t.addFace(n[1],n[2],n[3],n[4])}else if("l"===i){var d=a.substring(1).trim().split(" "),u=[],p=[];if(-1===a.indexOf("/"))u=d;else for(var c=0,m=d.length;c<m;c++){var f=d[c].split("/");""!==f[0]&&u.push(f[0]),""!==f[1]&&p.push(f[1])}t.addLineGeometry(u,p)}else if(null!==(n=this.regexp.object_pattern.exec(a))){var v=(" "+n[0].substr(1).trim()).substr(1);t.startObject(v)}else if(this.regexp.material_use_pattern.test(a))t.object.startMaterial(a.substring(7).trim(),t.materialLibraries);else if(this.regexp.material_library_pattern.test(a))t.materialLibraries.push(a.substring(7).trim());else{if(null===(n=this.regexp.smoothing_pattern.exec(a))){if("\0"===a)continue;throw new Error("Unexpected line: '"+a+"'")}var g=n[1].trim().toLowerCase();t.object.smooth="1"===g||"on"===g;var x=t.object.currentMaterial();x&&(x.smooth=t.object.smooth)}t.finalize();var b=new THREE.Group;b.materialLibraries=[].concat(t.materialLibraries);for(var h=0,l=t.objects.length;h<l;h++){var E=t.objects[h],_=E.geometry,j=E.materials,y="Line"===_.type;if(0!==_.vertices.length){var L=new THREE.BufferGeometry;L.addAttribute("position",new THREE.BufferAttribute(new Float32Array(_.vertices),3)),_.normals.length>0?L.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(_.normals),3)):L.computeVertexNormals(),_.uvs.length>0&&L.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(_.uvs),2));for(var V=[],w=0,H=j.length;w<H;w++){var R=j[w],x=void 0;if(null!==this.materials&&(x=this.materials.create(R.name),y&&x&&!(x instanceof THREE.LineBasicMaterial))){var T=new THREE.LineBasicMaterial;T.copy(x),x=T}x||(x=y?new THREE.LineBasicMaterial:new THREE.MeshPhongMaterial,x.name=R.name),x.shading=R.smooth?THREE.SmoothShading:THREE.FlatShading,V.push(x)}var I;if(V.length>1){for(var w=0,H=j.length;w<H;w++){var R=j[w];L.addGroup(R.groupStart,R.groupCount,w)}var F=new THREE.MultiMaterial(V);I=y?new THREE.LineSegments(L,F):new THREE.Mesh(L,F)}else I=y?new THREE.LineSegments(L,V[0]):new THREE.Mesh(L,V[0]);I.name=E.name,b.add(I)}}return console.timeEnd("OBJLoader"),b}};
129
+ },{}],46:[function(_dereq_,module,exports){
130
+ function trim(r){return r.replace(/^\s*|\s*$/g,"")}exports=module.exports=trim,exports.left=function(r){return r.replace(/^\s*/,"")},exports.right=function(r){return r.replace(/\s*$/,"")};
131
+ },{}],47:[function(_dereq_,module,exports){
132
+ module.exports={"_args":[[{"raw":"webvr-polyfill@^0.9.36","scope":null,"escapedName":"webvr-polyfill","name":"webvr-polyfill","rawSpec":"^0.9.36","spec":">=0.9.36 <0.10.0","type":"range"},"X:\\Development\\aframe"]],"_from":"webvr-polyfill@>=0.9.36 <0.10.0","_id":"webvr-polyfill@0.9.36","_inCache":true,"_location":"/webvr-polyfill","_nodeVersion":"4.8.4","_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webvr-polyfill-0.9.36.tgz_1499892972378_0.10267087002284825"},"_npmUser":{"name":"jsantell","email":"jsantell@gmail.com"},"_npmVersion":"2.15.11","_phantomChildren":{},"_requested":{"raw":"webvr-polyfill@^0.9.36","scope":null,"escapedName":"webvr-polyfill","name":"webvr-polyfill","rawSpec":"^0.9.36","spec":">=0.9.36 <0.10.0","type":"range"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/webvr-polyfill/-/webvr-polyfill-0.9.36.tgz","_shasum":"4b1e1556667e804beb0c8c2e67fdfcba3371e8c6","_shrinkwrap":null,"_spec":"webvr-polyfill@^0.9.36","_where":"X:\\Development\\aframe","authors":["Boris Smus <boris@smus.com>","Brandon Jones <tojiro@gmail.com>","Jordan Santell <jordan@jsantell.com>"],"bugs":{"url":"https://github.com/googlevr/webvr-polyfill/issues"},"dependencies":{},"description":"Use WebVR today, on mobile or desktop, without requiring a special browser build.","devDependencies":{"chai":"^3.5.0","jsdom":"^9.12.0","mocha":"^3.2.0","semver":"^5.3.0","webpack":"^2.6.1","webpack-dev-server":"^2.4.5"},"directories":{},"dist":{"shasum":"4b1e1556667e804beb0c8c2e67fdfcba3371e8c6","tarball":"https://registry.npmjs.org/webvr-polyfill/-/webvr-polyfill-0.9.36.tgz"},"gitHead":"5f8693a9053ee1dea425e96d14cd1f2bef7a284c","homepage":"https://github.com/googlevr/webvr-polyfill","keywords":["vr","webvr"],"license":"Apache-2.0","main":"src/node-entry","maintainers":[{"name":"jsantell","email":"jsantell@gmail.com"},{"name":"toji","email":"tojiro@gmail.com"},{"name":"smus","email":"boris@smus.com"}],"name":"webvr-polyfill","optionalDependencies":{},"readme":"ERROR: No README data found!","repository":{"type":"git","url":"git+https://github.com/googlevr/webvr-polyfill.git"},"scripts":{"build":"webpack","start":"npm run watch","test":"mocha","watch":"webpack-dev-server"},"version":"0.9.36"}
133
+ },{}],48:[function(_dereq_,module,exports){
134
+ function VRFrameData(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function VRDisplay(){this.isPolyfilled=!0,this.displayId=nextDisplayId++,this.displayName="webvr-polyfill displayName",this.depthNear=.01,this.depthFar=1e4,this.isConnected=!0,this.isPresenting=!1,this.capabilities={hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1},this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,this.wakelock_=new WakeLock}function VRDevice(){this.isPolyfilled=!0,this.hardwareUnitId="webvr-polyfill hardwareUnitId",this.deviceId="webvr-polyfill deviceId",this.deviceName="webvr-polyfill deviceName"}function HMDVRDevice(){}function PositionSensorVRDevice(){}var Util=_dereq_("./util.js"),WakeLock=_dereq_("./wakelock.js"),nextDisplayId=1e3,hasShowDeprecationWarning=!1,defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1];VRDisplay.prototype.getFrameData=function(e){return Util.frameDataFromPose(e,this.getPose(),this)},VRDisplay.prototype.getPose=function(){return this.getImmediatePose()},VRDisplay.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},VRDisplay.prototype.cancelAnimationFrame=function(e){return window.cancelAnimationFrame(e)},VRDisplay.prototype.wrapForFullscreen=function(e){if(Util.isIOS())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var r=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",r.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;this.removeFullscreenWrapper(),this.fullscreenElement_=e;var t=this.fullscreenElement_.parentElement;t.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),t.removeChild(this.fullscreenElement_),this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;return function(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}(),this.fullscreenWrapper_},VRDisplay.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var r=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),r.insertBefore(e,this.fullscreenWrapper_),r.removeChild(this.fullscreenWrapper_),e}},VRDisplay.prototype.requestPresent=function(e){var r=this.isPresenting,t=this;return e instanceof Array||(hasShowDeprecationWarning||(console.warn("Using a deprecated form of requestPresent. Should pass in an array of VRLayers."),hasShowDeprecationWarning=!0),e=[e]),new Promise(function(n,i){if(!t.capabilities.canPresent)return void i(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>t.capabilities.maxLayers)return void i(new Error("Invalid number of layers."));var s=e[0];if(!s.source)return void n();var l=s.leftBounds||defaultLeftBounds,a=s.rightBounds||defaultRightBounds;if(r){var o=t.layer_;o.source!==s.source&&(o.source=s.source);for(var c=0;c<4;c++)o.leftBounds[c]=l[c],o.rightBounds[c]=a[c];return void n()}if(t.layer_={predistorted:s.predistorted,source:s.source,leftBounds:l.slice(0),rightBounds:a.slice(0)},t.waitingForPresent_=!1,t.layer_&&t.layer_.source){var u=t.wrapForFullscreen(t.layer_.source),p=function(){var e=Util.getFullscreenElement();t.isPresenting=u===e,t.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch(function(e){console.error("screen.orientation.lock() failed due to",e.message)}),t.waitingForPresent_=!1,t.beginPresent_(),n()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),t.removeFullscreenWrapper(),t.wakelock_.release(),t.endPresent_(),t.removeFullscreenListeners_()),t.fireVRDisplayPresentChange_()},h=function(){t.waitingForPresent_&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.wakelock_.release(),t.waitingForPresent_=!1,t.isPresenting=!1,i(new Error("Unable to present.")))};t.addFullscreenListeners_(u,p,h),Util.requestFullscreen(u)?(t.wakelock_.request(),t.waitingForPresent_=!0):(Util.isIOS()||Util.isWebViewAndroid())&&(t.wakelock_.request(),t.isPresenting=!0,t.beginPresent_(),t.fireVRDisplayPresentChange_(),n())}t.waitingForPresent_||Util.isIOS()||(Util.exitFullscreen(),i(new Error("Unable to present.")))})},VRDisplay.prototype.exitPresent=function(){var e=this.isPresenting,r=this;return this.isPresenting=!1,this.layer_=null,this.wakelock_.release(),new Promise(function(t,n){e?(!Util.exitFullscreen()&&Util.isIOS()&&(r.endPresent_(),r.fireVRDisplayPresentChange_()),Util.isWebViewAndroid()&&(r.removeFullscreenWrapper(),r.removeFullscreenListeners_(),r.endPresent_(),r.fireVRDisplayPresentChange_()),t()):n(new Error("Was not presenting to VRDisplay."))})},VRDisplay.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},VRDisplay.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},VRDisplay.prototype.fireVRDisplayConnect_=function(){var e=new CustomEvent("vrdisplayconnect",{detail:{display:this}});window.dispatchEvent(e)},VRDisplay.prototype.addFullscreenListeners_=function(e,r,t){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=r,this.fullscreenErrorHandler_=t,r&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",r,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",r,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",r,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",r,!1)),t&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",t,!1))},VRDisplay.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var r=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",r,!1),e.removeEventListener("webkitfullscreenchange",r,!1),document.removeEventListener("mozfullscreenchange",r,!1),e.removeEventListener("msfullscreenchange",r,!1)}if(this.fullscreenErrorHandler_){var t=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",t,!1),e.removeEventListener("webkitfullscreenerror",t,!1),document.removeEventListener("mozfullscreenerror",t,!1),e.removeEventListener("msfullscreenerror",t,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},VRDisplay.prototype.beginPresent_=function(){},VRDisplay.prototype.endPresent_=function(){},VRDisplay.prototype.submitFrame=function(e){},VRDisplay.prototype.getEyeParameters=function(e){return null},HMDVRDevice.prototype=new VRDevice,PositionSensorVRDevice.prototype=new VRDevice,module.exports.VRFrameData=VRFrameData,module.exports.VRDisplay=VRDisplay,module.exports.VRDevice=VRDevice,module.exports.HMDVRDevice=HMDVRDevice,module.exports.PositionSensorVRDevice=PositionSensorVRDevice;
135
+ },{"./util.js":68,"./wakelock.js":70}],49:[function(_dereq_,module,exports){
136
+ function CardboardDistorter(e){this.gl=e,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,this.bufferScale=window.WebVRConfig.BUFFER_SCALE,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,Util.isIOS()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=Util.linkProgram(e,distortionVS,distortionFS,this.attribs),this.uniforms=Util.getProgramUniforms(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize(),window.WebVRConfig.CARDBOARD_UI_DISABLED||(this.cardboardUI=new CardboardUI(e))}var CardboardUI=_dereq_("./cardboard-ui.js"),Util=_dereq_("./util.js"),WGLUPreserveGLState=_dereq_("./deps/wglu-preserve-state.js"),distortionVS=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),distortionFS=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");CardboardDistorter.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},CardboardDistorter.prototype.onResize=function(){var e=this.gl,r=this,t=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];WGLUPreserveGLState(e,t,function(e){r.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),r.scissorTest&&r.realDisable.call(e,e.SCISSOR_TEST),r.realColorMask.call(e,!0,!0,!0,!0),r.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),r.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),r.realBindFramebuffer.call(e,e.FRAMEBUFFER,r.framebuffer),e.bindTexture(e.TEXTURE_2D,r.renderTarget),e.texImage2D(e.TEXTURE_2D,0,r.ctxAttribs.alpha?e.RGBA:e.RGB,r.bufferWidth,r.bufferHeight,0,r.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r.renderTarget,0),r.ctxAttribs.depth&&r.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,r.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,r.bufferWidth,r.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.depthStencilBuffer)):r.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,r.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.bufferWidth,r.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,r.depthBuffer)):r.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,r.bufferWidth,r.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),r.realBindFramebuffer.call(e,e.FRAMEBUFFER,r.lastBoundFramebuffer),r.scissorTest&&r.realEnable.call(e,e.SCISSOR_TEST),r.realColorMask.apply(e,r.colorMask),r.realViewport.apply(e,r.viewport),r.realClearColor.apply(e,r.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},CardboardDistorter.prototype.patch=function(){if(!this.isPatched){var e=this,r=this.gl.canvas,t=this.gl;Util.isIOS()||(r.width=Util.getScreenWidth()*this.bufferScale,r.height=Util.getScreenHeight()*this.bufferScale,Object.defineProperty(r,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(t){e.bufferWidth=t,e.realCanvasWidth.set.call(r,t),e.onResize()}}),Object.defineProperty(r,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(t){e.bufferHeight=t,e.realCanvasHeight.set.call(r,t),e.onResize()}})),this.lastBoundFramebuffer=t.getParameter(t.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(r,i){e.lastBoundFramebuffer=i||e.framebuffer,e.realBindFramebuffer.call(t,r,e.lastBoundFramebuffer)},this.cullFace=t.getParameter(t.CULL_FACE),this.depthTest=t.getParameter(t.DEPTH_TEST),this.blend=t.getParameter(t.BLEND),this.scissorTest=t.getParameter(t.SCISSOR_TEST),this.stencilTest=t.getParameter(t.STENCIL_TEST),t.enable=function(r){switch(r){case t.CULL_FACE:e.cullFace=!0;break;case t.DEPTH_TEST:e.depthTest=!0;break;case t.BLEND:e.blend=!0;break;case t.SCISSOR_TEST:e.scissorTest=!0;break;case t.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(t,r)},t.disable=function(r){switch(r){case t.CULL_FACE:e.cullFace=!1;break;case t.DEPTH_TEST:e.depthTest=!1;break;case t.BLEND:e.blend=!1;break;case t.SCISSOR_TEST:e.scissorTest=!1;break;case t.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(t,r)},this.colorMask=t.getParameter(t.COLOR_WRITEMASK),t.colorMask=function(r,i,a,s){e.colorMask[0]=r,e.colorMask[1]=i,e.colorMask[2]=a,e.colorMask[3]=s,e.realColorMask.call(t,r,i,a,s)},this.clearColor=t.getParameter(t.COLOR_CLEAR_VALUE),t.clearColor=function(r,i,a,s){e.clearColor[0]=r,e.clearColor[1]=i,e.clearColor[2]=a,e.clearColor[3]=s,e.realClearColor.call(t,r,i,a,s)},this.viewport=t.getParameter(t.VIEWPORT),t.viewport=function(r,i,a,s){e.viewport[0]=r,e.viewport[1]=i,e.viewport[2]=a,e.viewport[3]=s,e.realViewport.call(t,r,i,a,s)},this.isPatched=!0,Util.safariCssSizeWorkaround(r)}},CardboardDistorter.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,r=this.gl.canvas;Util.isIOS()||(Object.defineProperty(r,"width",this.realCanvasWidth),Object.defineProperty(r,"height",this.realCanvasHeight)),r.width=this.bufferWidth,r.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout(function(){Util.safariCssSizeWorkaround(r)},1)}},CardboardDistorter.prototype.setTextureBounds=function(e,r){e||(e=[0,0,.5,1]),r||(r=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=r[0],this.viewportOffsetScale[5]=r[1],this.viewportOffsetScale[6]=r[2],this.viewportOffsetScale[7]=r[3]},CardboardDistorter.prototype.submitFrame=function(){var e=this.gl,r=this,t=[];if(window.WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||t.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),WGLUPreserveGLState(e,t,function(e){r.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),r.cullFace&&r.realDisable.call(e,e.CULL_FACE),r.depthTest&&r.realDisable.call(e,e.DEPTH_TEST),r.blend&&r.realDisable.call(e,e.BLEND),r.scissorTest&&r.realDisable.call(e,e.SCISSOR_TEST),r.stencilTest&&r.realDisable.call(e,e.STENCIL_TEST),r.realColorMask.call(e,!0,!0,!0,!0),r.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(r.ctxAttribs.alpha||Util.isIOS())&&(r.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(r.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,r.vertexBuffer),e.enableVertexAttribArray(r.attribs.position),e.enableVertexAttribArray(r.attribs.texCoord),e.vertexAttribPointer(r.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(r.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(r.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,r.renderTarget),e.uniform4fv(r.uniforms.viewportOffsetScale,r.viewportOffsetScale),e.drawElements(e.TRIANGLES,r.indexCount,e.UNSIGNED_SHORT,0),r.cardboardUI&&r.cardboardUI.renderNoState(),r.realBindFramebuffer.call(r.gl,e.FRAMEBUFFER,r.framebuffer),r.ctxAttribs.preserveDrawingBuffer||(r.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),window.WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||r.realBindFramebuffer.call(e,e.FRAMEBUFFER,r.lastBoundFramebuffer),r.cullFace&&r.realEnable.call(e,e.CULL_FACE),r.depthTest&&r.realEnable.call(e,e.DEPTH_TEST),r.blend&&r.realEnable.call(e,e.BLEND),r.scissorTest&&r.realEnable.call(e,e.SCISSOR_TEST),r.stencilTest&&r.realEnable.call(e,e.STENCIL_TEST),r.realColorMask.apply(e,r.colorMask),r.realViewport.apply(e,r.viewport),!r.ctxAttribs.alpha&&r.ctxAttribs.preserveDrawingBuffer||r.realClearColor.apply(e,r.clearColor)}),Util.isIOS()){var i=e.canvas;i.width==r.bufferWidth&&i.height==r.bufferHeight||(r.bufferWidth=i.width,r.bufferHeight=i.height,r.onResize())}},CardboardDistorter.prototype.updateDeviceInfo=function(e){var r=this.gl,t=this,i=[r.ARRAY_BUFFER_BINDING,r.ELEMENT_ARRAY_BUFFER_BINDING];WGLUPreserveGLState(r,i,function(r){var i=t.computeMeshVertices_(t.meshWidth,t.meshHeight,e);if(r.bindBuffer(r.ARRAY_BUFFER,t.vertexBuffer),r.bufferData(r.ARRAY_BUFFER,i,r.STATIC_DRAW),!t.indexCount){var a=t.computeMeshIndices_(t.meshWidth,t.meshHeight);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),t.indexCount=a.length}})},CardboardDistorter.prototype.computeMeshVertices_=function(e,r,t){for(var i=new Float32Array(2*e*r*5),a=t.getLeftEyeVisibleTanAngles(),s=t.getLeftEyeNoLensTanAngles(),l=t.getLeftEyeVisibleScreenRect(s),f=0,o=0;o<2;o++){for(var n=0;n<r;n++)for(var c=0;c<e;c++,f++){var h=c/(e-1),u=n/(r-1),d=h,E=u,b=Util.lerp(a[0],a[2],h),R=Util.lerp(a[3],a[1],u),T=Math.sqrt(b*b+R*R),F=t.distortion.distortInverse(T),p=b*F/T,B=R*F/T;h=(p-s[0])/(s[2]-s[0]),u=(B-s[3])/(s[1]-s[3]);t.device.widthMeters,t.device.heightMeters;h=2*(l.x+h*l.width-.5),u=2*(l.y+u*l.height-.5),i[5*f+0]=h,i[5*f+1]=u,i[5*f+2]=d,i[5*f+3]=E,i[5*f+4]=o}var C=a[2]-a[0];a[0]=-(C+a[0]),a[2]=C-a[2],C=s[2]-s[0],s[0]=-(C+s[0]),s[2]=C-s[2],l.x=1-(l.x+l.width)}return i},CardboardDistorter.prototype.computeMeshIndices_=function(e,r){for(var t=new Uint16Array(2*(e-1)*(r-1)*6),i=e/2,a=r/2,s=0,l=0,f=0;f<2;f++)for(var o=0;o<r;o++)for(var n=0;n<e;n++,s++)0!=n&&0!=o&&(n<=i==o<=a?(t[l++]=s,t[l++]=s-e-1,t[l++]=s-e,t[l++]=s-e-1,t[l++]=s,t[l++]=s-1):(t[l++]=s-1,t[l++]=s-e,t[l++]=s,t[l++]=s-e,t[l++]=s-1,t[l++]=s-e-1));return t},CardboardDistorter.prototype.getOwnPropertyDescriptor_=function(e,r){var t=Object.getOwnPropertyDescriptor(e,r);return void 0!==t.get&&void 0!==t.set||(t.configurable=!0,t.enumerable=!0,t.get=function(){return this.getAttribute(r)},t.set=function(e){this.setAttribute(r,e)}),t},module.exports=CardboardDistorter;
137
+ },{"./cardboard-ui.js":50,"./deps/wglu-preserve-state.js":52,"./util.js":68}],50:[function(_dereq_,module,exports){
138
+ function CardboardUI(e){this.gl=e,this.attribs={position:0},this.program=Util.linkProgram(e,uiVS,uiFS,this.attribs),this.uniforms=Util.getProgramUniforms(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}var Util=_dereq_("./util.js"),WGLUPreserveGLState=_dereq_("./deps/wglu-preserve-state.js"),uiVS=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),uiFS=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),DEG2RAD=Math.PI/180,kAnglePerGearSection=60,kOuterRimEndAngle=12,kInnerRimBeginAngle=20,kOuterRadius=1,kMiddleRadius=.75,kInnerRadius=.3125,kCenterLineThicknessDp=4,kButtonWidthDp=28,kTouchSlopFactor=1.5,Angles=[0,kOuterRimEndAngle,kInnerRimBeginAngle,kAnglePerGearSection-kInnerRimBeginAngle,kAnglePerGearSection-kOuterRimEndAngle];CardboardUI.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},CardboardUI.prototype.listen=function(e,t){var r=this.gl.canvas;this.listener=function(i){var n=r.clientWidth/2,o=kButtonWidthDp*kTouchSlopFactor;i.clientX>n-o&&i.clientX<n+o&&i.clientY>r.clientHeight-o?e(i):i.clientX<o&&i.clientY<o&&t(i)},r.addEventListener("click",this.listener,!1)},CardboardUI.prototype.onResize=function(){var e=this.gl,t=this,r=[e.ARRAY_BUFFER_BINDING];WGLUPreserveGLState(e,r,function(e){function r(e,t){var r=(90-e)*DEG2RAD,i=Math.cos(r),a=Math.sin(r);n.push(kInnerRadius*i*l+o,kInnerRadius*a*l+l),n.push(t*i*l+o,t*a*l+l)}function i(t,r){n.push(f+t,e.drawingBufferHeight-f-r)}var n=[],o=e.drawingBufferWidth/2,a=Math.max(screen.width,screen.height)*window.devicePixelRatio,s=e.drawingBufferWidth/a,u=s*window.devicePixelRatio,d=kCenterLineThicknessDp*u/2,h=kButtonWidthDp*kTouchSlopFactor*u,l=kButtonWidthDp*u/2,f=(kButtonWidthDp*kTouchSlopFactor-kButtonWidthDp)*u;n.push(o-d,h),n.push(o-d,e.drawingBufferHeight),n.push(o+d,h),n.push(o+d,e.drawingBufferHeight),t.gearOffset=n.length/2;for(var g=0;g<=6;g++){var R=g*kAnglePerGearSection;r(R,kOuterRadius),r(R+kOuterRimEndAngle,kOuterRadius),r(R+kInnerRimBeginAngle,kMiddleRadius),r(R+(kAnglePerGearSection-kInnerRimBeginAngle),kMiddleRadius),r(R+(kAnglePerGearSection-kOuterRimEndAngle),kOuterRadius)}t.gearVertexCount=n.length/2-t.gearOffset,t.arrowOffset=n.length/2;var c=d/Math.sin(45*DEG2RAD);i(0,l),i(l,0),i(l+c,c),i(c,l+c),i(c,l-c),i(0,l),i(l,2*l),i(l+c,2*l-c),i(c,l-c),i(0,l),i(c,l-d),i(kButtonWidthDp*u,l-d),i(c,l+d),i(kButtonWidthDp*u,l+d),t.arrowVertexCount=n.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW)})},CardboardUI.prototype.render=function(){var e=this.gl,t=this,r=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];WGLUPreserveGLState(e,r,function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()})},CardboardUI.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),Util.orthoMatrix(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},module.exports=CardboardUI;
139
+ },{"./deps/wglu-preserve-state.js":52,"./util.js":68}],51:[function(_dereq_,module,exports){
140
+ function CardboardVRDisplay(){this.displayName="Cardboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,this.capabilities.canPresent=!0,this.bufferScale_=window.WebVRConfig.BUFFER_SCALE,this.poseSensor_=new FusionPoseSensor,this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new Dpdb(!0,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new DeviceInfo(this.dpdb_.getDeviceParams()),this.viewerSelector_=new ViewerSelector,this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),window.WebVRConfig.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new RotateInstructions),Util.isIOS()&&window.addEventListener("resize",this.onResize_.bind(this))}var CardboardDistorter=_dereq_("./cardboard-distorter.js"),CardboardUI=_dereq_("./cardboard-ui.js"),DeviceInfo=_dereq_("./device-info.js"),Dpdb=_dereq_("./dpdb/dpdb.js"),FusionPoseSensor=_dereq_("./sensor-fusion/fusion-pose-sensor.js"),RotateInstructions=_dereq_("./rotate-instructions.js"),ViewerSelector=_dereq_("./viewer-selector.js"),VRDisplay=_dereq_("./base.js").VRDisplay,Util=_dereq_("./util.js"),Eye={LEFT:"left",RIGHT:"right"};CardboardVRDisplay.prototype=new VRDisplay,CardboardVRDisplay.prototype.getImmediatePose=function(){return{position:this.poseSensor_.getPosition(),orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},CardboardVRDisplay.prototype.resetPose=function(){this.poseSensor_.resetPose()},CardboardVRDisplay.prototype.getEyeParameters=function(e){var t,i=[.5*this.deviceInfo_.viewer.interLensDistance,0,0];if(e==Eye.LEFT)i[0]*=-1,t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=Eye.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return{fieldOfView:t,offset:i,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_}},CardboardVRDisplay.prototype.onDeviceParamsUpdated_=function(e){Util.isDebug()&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},CardboardVRDisplay.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},CardboardVRDisplay.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?window.WebVRConfig.CARDBOARD_UI_DISABLED||(e.canvas.width=Util.getScreenWidth()*this.bufferScale_,e.canvas.height=Util.getScreenHeight()*this.bufferScale_,this.cardboardUI_=new CardboardUI(e)):(this.distorter_=new CardboardDistorter(e),this.distorter_.updateDeviceInfo(this.deviceInfo_),this.cardboardUI_=this.distorter_.cardboardUI),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(Util.isLandscapeMode()&&Util.isMobile()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),window.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},CardboardVRDisplay.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler),window.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},CardboardVRDisplay.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl").canvas;t.width==this.lastWidth&&t.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=t.width,this.lastHeight=t.height,this.cardboardUI_.render()}},CardboardVRDisplay.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},CardboardVRDisplay.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl"),i=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0 10px 10px 0","box-sizing: content-box"];t.canvas.setAttribute("style",i.join("; ")+";"),Util.safariCssSizeWorkaround(t.canvas)}},CardboardVRDisplay.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},CardboardVRDisplay.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},module.exports=CardboardVRDisplay;
141
+ },{"./base.js":48,"./cardboard-distorter.js":49,"./cardboard-ui.js":50,"./device-info.js":53,"./dpdb/dpdb.js":57,"./rotate-instructions.js":62,"./sensor-fusion/fusion-pose-sensor.js":64,"./util.js":68,"./viewer-selector.js":69}],52:[function(_dereq_,module,exports){
142
+ function WGLUPreserveGLState(e,E,r){if(!E)return void r(e);for(var a=[],T=null,R=0;R<E.length;++R){var _=E[R];switch(_){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:var t=E[++R];if(t<e.TEXTURE0||t>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),a.push(null,null);break}T||(T=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(t),a.push(e.getParameter(_),null);break;case e.ACTIVE_TEXTURE:T=e.getParameter(e.ACTIVE_TEXTURE),a.push(null);break;default:a.push(e.getParameter(_))}}r(e);for(var R=0;R<E.length;++R){var _=E[R],s=a[R];switch(_){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,s);break;case e.COLOR_CLEAR_VALUE:e.clearColor(s[0],s[1],s[2],s[3]);break;case e.COLOR_WRITEMASK:e.colorMask(s[0],s[1],s[2],s[3]);break;case e.CURRENT_PROGRAM:e.useProgram(s);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,s);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,s);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,s);break;case e.TEXTURE_BINDING_2D:var t=E[++R];if(t<e.TEXTURE0||t>e.TEXTURE31)break;e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,s);break;case e.TEXTURE_BINDING_CUBE_MAP:var t=E[++R];if(t<e.TEXTURE0||t>e.TEXTURE31)break;e.activeTexture(t),e.bindTexture(e.TEXTURE_CUBE_MAP,s);break;case e.VIEWPORT:e.viewport(s[0],s[1],s[2],s[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:s?e.enable(_):e.disable(_);break;default:console.log("No GL restore behavior for 0x"+_.toString(16))}T&&e.activeTexture(T)}}module.exports=WGLUPreserveGLState;
143
+ },{}],53:[function(_dereq_,module,exports){
144
+ function Device(e){this.width=e.width||Util.getScreenWidth(),this.height=e.height||Util.getScreenHeight(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}function DeviceInfo(e){this.viewer=Viewers.CardboardV2,this.updateDeviceParams(e),this.distortion=new Distortion(this.viewer.distortionCoefficients)}function CardboardViewer(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}var Distortion=_dereq_("./distortion/distortion.js"),MathUtil=_dereq_("./math-util.js"),Util=_dereq_("./util.js"),DEFAULT_ANDROID=new Device({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),DEFAULT_IOS=new Device({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),Viewers={CardboardV1:new CardboardViewer({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new CardboardViewer({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})},DEFAULT_LEFT_CENTER={x:.5,y:.5},DEFAULT_RIGHT_CENTER={x:.5,y:.5};DeviceInfo.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},DeviceInfo.prototype.getDevice=function(){return this.device},DeviceInfo.prototype.setViewer=function(e){this.viewer=e,this.distortion=new Distortion(this.viewer.distortionCoefficients)},DeviceInfo.prototype.determineDevice_=function(e){if(!e)return Util.isIOS()?(console.warn("Using fallback iOS device measurements."),DEFAULT_IOS):(console.warn("Using fallback Android device measurements."),DEFAULT_ANDROID);var t=.0254/e.xdpi,i=.0254/e.ydpi;return new Device({widthMeters:t*Util.getScreenWidth(),heightMeters:i*Util.getScreenHeight(),bevelMeters:.001*e.bevelMm})},DeviceInfo.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,s=e.screenLensDistance,n=(t.widthMeters-e.interLensDistance)/2,r=e.interLensDistance/2,o=e.baselineLensDistance-t.bevelMeters,a=t.heightMeters-o,h=MathUtil.radToDeg*Math.atan(i.distort(n/s)),d=MathUtil.radToDeg*Math.atan(i.distort(r/s)),c=MathUtil.radToDeg*Math.atan(i.distort(o/s)),D=MathUtil.radToDeg*Math.atan(i.distort(a/s));return{leftDegrees:Math.min(h,e.fov),rightDegrees:Math.min(d,e.fov),downDegrees:Math.min(c,e.fov),upDegrees:Math.min(D,e.fov)}},DeviceInfo.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,s=Math.tan(-MathUtil.degToRad*e.fov),n=Math.tan(MathUtil.degToRad*e.fov),r=Math.tan(MathUtil.degToRad*e.fov),o=Math.tan(-MathUtil.degToRad*e.fov),a=t.widthMeters/4,h=t.heightMeters/2,d=e.baselineLensDistance-t.bevelMeters-h,c=e.interLensDistance/2-a,D=-d,f=e.screenLensDistance,v=i.distort((c-a)/f),M=i.distort((D+h)/f),g=i.distort((c+a)/f),l=i.distort((D-h)/f),w=new Float32Array(4);return w[0]=Math.max(s,v),w[1]=Math.min(n,M),w[2]=Math.min(r,g),w[3]=Math.max(o,l),w},DeviceInfo.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,s=new Float32Array(4),n=i.distortInverse(Math.tan(-MathUtil.degToRad*e.fov)),r=i.distortInverse(Math.tan(MathUtil.degToRad*e.fov)),o=i.distortInverse(Math.tan(MathUtil.degToRad*e.fov)),a=i.distortInverse(Math.tan(-MathUtil.degToRad*e.fov)),h=t.widthMeters/4,d=t.heightMeters/2,c=e.baselineLensDistance-t.bevelMeters-d,D=e.interLensDistance/2-h,f=-c,v=e.screenLensDistance,M=(D-h)/v,g=(f+d)/v,l=(D+h)/v,w=(f-d)/v;return s[0]=Math.max(n,M),s[1]=Math.min(r,g),s[2]=Math.min(o,l),s[3]=Math.max(a,w),s},DeviceInfo.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,s=t.screenLensDistance,n=(i.widthMeters-t.interLensDistance)/2,r=t.baselineLensDistance-i.bevelMeters,o=(e[0]*s+n)/i.widthMeters,a=(e[1]*s+r)/i.heightMeters,h=(e[2]*s+n)/i.widthMeters,d=(e[3]*s+r)/i.heightMeters;return{x:o,y:d,width:h-o,height:a-d}},DeviceInfo.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},DeviceInfo.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},DeviceInfo.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:MathUtil.radToDeg*Math.atan(e.outerDist),rightDegrees:MathUtil.radToDeg*Math.atan(e.innerDist),downDegrees:MathUtil.radToDeg*Math.atan(e.bottomDist),upDegrees:MathUtil.radToDeg*Math.atan(e.topDist)}},DeviceInfo.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,s=t.screenLensDistance,n=i.widthMeters/s,r=i.heightMeters/s,o=i.width/n,a=i.height/r,h=Math.round((e.eyePosX-e.outerDist)*o),d=Math.round((e.eyePosY-e.bottomDist)*a);return{x:h,y:d,width:Math.round((e.eyePosX+e.innerDist)*o)-h,height:Math.round((e.eyePosY+e.topDist)*a)-d}},DeviceInfo.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,s=e.screenLensDistance,n=e.interLensDistance/2/s,r=t.widthMeters/s,o=t.heightMeters/s,a=r/2-n,h=(e.baselineLensDistance-t.bevelMeters)/s,d=e.fov,c=i.distortInverse(Math.tan(MathUtil.degToRad*d)),D=Math.min(a,c),f=Math.min(n,c),v=Math.min(h,c);return{outerDist:D,innerDist:f,topDist:Math.min(o-h,c),bottomDist:v,eyePosX:a,eyePosY:h}},DeviceInfo.Viewers=Viewers,module.exports=DeviceInfo;
145
+ },{"./distortion/distortion.js":55,"./math-util.js":59,"./util.js":68}],54:[function(_dereq_,module,exports){
146
+ function VRDisplayHMDDevice(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:HMD:"+e.displayId,this.deviceName=e.displayName+" (HMD)"}function VRDisplayPositionSensorDevice(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:PositionSensor: "+e.displayId,this.deviceName=e.displayName+" (PositionSensor)"}var VRDisplay=_dereq_("./base.js").VRDisplay,HMDVRDevice=_dereq_("./base.js").HMDVRDevice,PositionSensorVRDevice=_dereq_("./base.js").PositionSensorVRDevice;VRDisplayHMDDevice.prototype=new HMDVRDevice,VRDisplayHMDDevice.prototype.getEyeParameters=function(e){var i=this.display.getEyeParameters(e);return{currentFieldOfView:i.fieldOfView,maximumFieldOfView:i.fieldOfView,minimumFieldOfView:i.fieldOfView,recommendedFieldOfView:i.fieldOfView,eyeTranslation:{x:i.offset[0],y:i.offset[1],z:i.offset[2]},renderRect:{x:"right"==e?i.renderWidth:0,y:0,width:i.renderWidth,height:i.renderHeight}}},VRDisplayHMDDevice.prototype.setFieldOfView=function(e,i,t,o){},VRDisplayPositionSensorDevice.prototype=new PositionSensorVRDevice,VRDisplayPositionSensorDevice.prototype.getState=function(){var e=this.display.getPose();return{position:e.position?{x:e.position[0],y:e.position[1],z:e.position[2]}:null,orientation:e.orientation?{x:e.orientation[0],y:e.orientation[1],z:e.orientation[2],w:e.orientation[3]}:null,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},VRDisplayPositionSensorDevice.prototype.resetState=function(){return this.positionDevice.resetPose()},module.exports.VRDisplayHMDDevice=VRDisplayHMDDevice,module.exports.VRDisplayPositionSensorDevice=VRDisplayPositionSensorDevice;
147
+ },{"./base.js":48}],55:[function(_dereq_,module,exports){
148
+ function Distortion(t){this.coefficients=t}Distortion.prototype.distortInverse=function(t){for(var i=0,o=1,r=t-this.distort(i);Math.abs(o-i)>1e-4;){var s=t-this.distort(o),n=o-s*((o-i)/(s-r));i=o,o=n,r=s}return o},Distortion.prototype.distort=function(t){for(var i=t*t,o=0,r=0;r<this.coefficients.length;r++)o=i*(o+this.coefficients[r]);return(o+1)*t},module.exports=Distortion;
149
+ },{}],56:[function(_dereq_,module,exports){
150
+ module.exports={"format":1,"last_updated":"2017-06-01T22:33:42Z","devices":[{"type":"android","rules":[{"mdmh":"asus/*/Nexus 7/*"},{"ua":"Nexus 7"}],"dpi":[320.8,323],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"asus/*/ASUS_Z00AD/*"},{"ua":"ASUS_Z00AD"}],"dpi":[403,404.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Google/*/Pixel XL/*"},{"ua":"Pixel XL"}],"dpi":[537.9,533],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Google/*/Pixel/*"},{"ua":"Pixel"}],"dpi":[432.6,436.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"HTC/*/HTC6435LVW/*"},{"ua":"HTC6435LVW"}],"dpi":[449.7,443.3],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One XL/*"},{"ua":"HTC One XL"}],"dpi":[315.3,314.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"htc/*/Nexus 9/*"},{"ua":"Nexus 9"}],"dpi":289,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One M9/*"},{"ua":"HTC One M9"}],"dpi":[442.5,443.3],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One_M8/*"},{"ua":"HTC One_M8"}],"dpi":[449.7,447.4],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One/*"},{"ua":"HTC One"}],"dpi":472.8,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Huawei/*/Nexus 6P/*"},{"ua":"Nexus 6P"}],"dpi":[515.1,518],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/Nexus 5X/*"},{"ua":"Nexus 5X"}],"dpi":[422,419.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LGMS345/*"},{"ua":"LGMS345"}],"dpi":[221.7,219.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"LGE/*/LG-D800/*"},{"ua":"LG-D800"}],"dpi":[422,424.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"LGE/*/LG-D850/*"},{"ua":"LG-D850"}],"dpi":[537.9,541.9],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"LGE/*/VS985 4G/*"},{"ua":"VS985 4G"}],"dpi":[537.9,535.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/Nexus 5/*"},{"ua":"Nexus 5 B"}],"dpi":[442.4,444.8],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/Nexus 4/*"},{"ua":"Nexus 4"}],"dpi":[319.8,318.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LG-P769/*"},{"ua":"LG-P769"}],"dpi":[240.6,247.5],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LGMS323/*"},{"ua":"LGMS323"}],"dpi":[206.6,204.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LGLS996/*"},{"ua":"LGLS996"}],"dpi":[403.4,401.5],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Micromax/*/4560MMX/*"},{"ua":"4560MMX"}],"dpi":[240,219.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Micromax/*/A250/*"},{"ua":"Micromax A250"}],"dpi":[480,446.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Micromax/*/Micromax AQ4501/*"},{"ua":"Micromax AQ4501"}],"dpi":240,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/DROID RAZR/*"},{"ua":"DROID RAZR"}],"dpi":[368.1,256.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT830C/*"},{"ua":"XT830C"}],"dpi":[254,255.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1021/*"},{"ua":"XT1021"}],"dpi":[254,256.7],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1023/*"},{"ua":"XT1023"}],"dpi":[254,256.7],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1028/*"},{"ua":"XT1028"}],"dpi":[326.6,327.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1034/*"},{"ua":"XT1034"}],"dpi":[326.6,328.4],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1053/*"},{"ua":"XT1053"}],"dpi":[315.3,316.1],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1562/*"},{"ua":"XT1562"}],"dpi":[403.4,402.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/Nexus 6/*"},{"ua":"Nexus 6 B"}],"dpi":[494.3,489.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1063/*"},{"ua":"XT1063"}],"dpi":[295,296.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1064/*"},{"ua":"XT1064"}],"dpi":[295,295.6],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1092/*"},{"ua":"XT1092"}],"dpi":[422,424.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1095/*"},{"ua":"XT1095"}],"dpi":[422,423.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/G4/*"},{"ua":"Moto G (4)"}],"dpi":401,"bw":4,"ac":1000},{"type":"android","rules":[{"mdmh":"OnePlus/*/A0001/*"},{"ua":"A0001"}],"dpi":[403.4,401],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"OnePlus/*/ONE E1005/*"},{"ua":"ONE E1005"}],"dpi":[442.4,441.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"OnePlus/*/ONE A2005/*"},{"ua":"ONE A2005"}],"dpi":[391.9,405.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"OPPO/*/X909/*"},{"ua":"X909"}],"dpi":[442.4,444.1],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9082/*"},{"ua":"GT-I9082"}],"dpi":[184.7,185.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G360P/*"},{"ua":"SM-G360P"}],"dpi":[196.7,205.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/Nexus S/*"},{"ua":"Nexus S"}],"dpi":[234.5,229.8],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9300/*"},{"ua":"GT-I9300"}],"dpi":[304.8,303.9],"bw":5,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-T230NU/*"},{"ua":"SM-T230NU"}],"dpi":216,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SGH-T399/*"},{"ua":"SGH-T399"}],"dpi":[217.7,231.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SGH-M919/*"},{"ua":"SGH-M919"}],"dpi":[440.8,437.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N9005/*"},{"ua":"SM-N9005"}],"dpi":[386.4,387],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SAMSUNG-SM-N900A/*"},{"ua":"SAMSUNG-SM-N900A"}],"dpi":[386.4,387.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9500/*"},{"ua":"GT-I9500"}],"dpi":[442.5,443.3],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9505/*"},{"ua":"GT-I9505"}],"dpi":439.4,"bw":4,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G900F/*"},{"ua":"SM-G900F"}],"dpi":[415.6,431.6],"bw":5,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G900M/*"},{"ua":"SM-G900M"}],"dpi":[415.6,431.6],"bw":5,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G800F/*"},{"ua":"SM-G800F"}],"dpi":326.8,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G906S/*"},{"ua":"SM-G906S"}],"dpi":[562.7,572.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9300/*"},{"ua":"GT-I9300"}],"dpi":[306.7,304.8],"bw":5,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-T535/*"},{"ua":"SM-T535"}],"dpi":[142.6,136.4],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N920C/*"},{"ua":"SM-N920C"}],"dpi":[515.1,518.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N920W8/*"},{"ua":"SM-N920W8"}],"dpi":[515.1,518.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9300I/*"},{"ua":"GT-I9300I"}],"dpi":[304.8,305.8],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9195/*"},{"ua":"GT-I9195"}],"dpi":[249.4,256.7],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SPH-L520/*"},{"ua":"SPH-L520"}],"dpi":[249.4,255.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SAMSUNG-SGH-I717/*"},{"ua":"SAMSUNG-SGH-I717"}],"dpi":285.8,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SPH-D710/*"},{"ua":"SPH-D710"}],"dpi":[217.7,204.2],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-N7100/*"},{"ua":"GT-N7100"}],"dpi":265.1,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SCH-I605/*"},{"ua":"SCH-I605"}],"dpi":265.1,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/Galaxy Nexus/*"},{"ua":"Galaxy Nexus"}],"dpi":[315.3,314.2],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N910H/*"},{"ua":"SM-N910H"}],"dpi":[515.1,518],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N910C/*"},{"ua":"SM-N910C"}],"dpi":[515.2,520.2],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G130M/*"},{"ua":"SM-G130M"}],"dpi":[165.9,164.8],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G928I/*"},{"ua":"SM-G928I"}],"dpi":[515.1,518.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G920F/*"},{"ua":"SM-G920F"}],"dpi":580.6,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G920P/*"},{"ua":"SM-G920P"}],"dpi":[522.5,577],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G925F/*"},{"ua":"SM-G925F"}],"dpi":580.6,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G925V/*"},{"ua":"SM-G925V"}],"dpi":[522.5,576.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G930F/*"},{"ua":"SM-G930F"}],"dpi":576.6,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G935F/*"},{"ua":"SM-G935F"}],"dpi":533,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"Sony/*/C6903/*"},{"ua":"C6903"}],"dpi":[442.5,443.3],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"Sony/*/D6653/*"},{"ua":"D6653"}],"dpi":[428.6,427.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Sony/*/E6653/*"},{"ua":"E6653"}],"dpi":[428.6,425.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Sony/*/E6853/*"},{"ua":"E6853"}],"dpi":[403.4,401.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Sony/*/SGP321/*"},{"ua":"SGP321"}],"dpi":[224.7,224.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{"ua":"ALCATEL ONE TOUCH Fierce"}],"dpi":[240,247.5],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"THL/*/thl 5000/*"},{"ua":"thl 5000"}],"dpi":[480,443.3],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"ZTE/*/ZTE Blade L2/*"},{"ua":"ZTE Blade L2"}],"dpi":240,"bw":3,"ac":500},{"type":"ios","rules":[{"res":[640,960]}],"dpi":[325.1,328.4],"bw":4,"ac":1000},{"type":"ios","rules":[{"res":[640,1136]}],"dpi":[317.1,320.2],"bw":3,"ac":1000},{"type":"ios","rules":[{"res":[750,1334]}],"dpi":326.4,"bw":4,"ac":1000},{"type":"ios","rules":[{"res":[1242,2208]}],"dpi":[453.6,458.4],"bw":4,"ac":1000},{"type":"ios","rules":[{"res":[1125,2001]}],"dpi":[410.9,415.4],"bw":4,"ac":1000}]}
151
+ },{}],57:[function(_dereq_,module,exports){
152
+ function Dpdb(e,r){if(this.dpdb=DPDB_CACHE,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=r;var i=new XMLHttpRequest,t=this;i.open("GET",ONLINE_DPDB_URL,!0),i.addEventListener("load",function(){t.loading=!1,i.status>=200&&i.status<=299?(t.dpdb=JSON.parse(i.response),t.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function DeviceParams(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}var DPDB_CACHE=_dereq_("./dpdb.json"),Util=_dereq_("../util.js"),ONLINE_DPDB_URL="https://dpdb.webvr.rocks/dpdb.json";Dpdb.prototype.getDeviceParams=function(){return this.deviceParams},Dpdb.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},Dpdb.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var r=navigator.userAgent||navigator.vendor||window.opera,i=Util.getScreenWidth(),t=Util.getScreenHeight();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var a=0;a<e.devices.length;a++){var s=e.devices[a];if(s.rules)if("ios"==s.type||"android"==s.type){if(Util.isIOS()==("ios"==s.type)){for(var n=!1,o=0;o<s.rules.length;o++){var c=s.rules[o];if(this.matchRule_(c,r,i,t)){n=!0;break}}if(n){var d=s.dpi[0]||s.dpi,l=s.dpi[1]||s.dpi;return new DeviceParams({xdpi:d,ydpi:l,bevelMm:s.bw})}}}else console.warn("Device["+a+"] has invalid type.");else console.warn("Device["+a+"] has no rules section.")}return console.warn("No DPDB device match."),null},Dpdb.prototype.matchRule_=function(e,r,i,t){if(!e.ua&&!e.res)return!1;if(e.ua&&r.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var a=e.res[0],s=e.res[1];if(Math.min(i,t)!=Math.min(a,s)||Math.max(i,t)!=Math.max(a,s))return!1}return!0},module.exports=Dpdb;
153
+ },{"../util.js":68,"./dpdb.json":56}],58:[function(_dereq_,module,exports){
154
+ var Util=_dereq_("./util.js"),WebVRPolyfill=_dereq_("./webvr-polyfill.js").WebVRPolyfill;window.WebVRConfig=Util.extend({FORCE_ENABLE_VR:!1,K_FILTER:.98,PREDICTION_TIME_S:.04,TOUCH_PANNER_DISABLED:!0,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,MOUSE_KEYBOARD_CONTROLS_DISABLED:!1,DEFER_INITIALIZATION:!1,ENABLE_DEPRECATED_API:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1,ALWAYS_APPEND_POLYFILL_DISPLAY:!1,GET_VR_DISPLAYS_TIMEOUT:1e3},window.WebVRConfig),window.WebVRConfig.DEFER_INITIALIZATION?window.InitializeWebVRPolyfill=function(){new WebVRPolyfill}:new WebVRPolyfill,window.WebVRPolyfill=WebVRPolyfill;
155
+ },{"./util.js":68,"./webvr-polyfill.js":71}],59:[function(_dereq_,module,exports){
156
+ var MathUtil=window.MathUtil||{};MathUtil.degToRad=Math.PI/180,MathUtil.radToDeg=180/Math.PI,MathUtil.Vector2=function(t,i){this.x=t||0,this.y=i||0},MathUtil.Vector2.prototype={constructor:MathUtil.Vector2,set:function(t,i){return this.x=t,this.y=i,this},copy:function(t){return this.x=t.x,this.y=t.y,this},subVectors:function(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}},MathUtil.Vector3=function(t,i,s){this.x=t||0,this.y=i||0,this.z=s||0},MathUtil.Vector3.prototype={constructor:MathUtil.Vector3,set:function(t,i,s){return this.x=t,this.y=i,this.z=s,this},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var t=this.length();if(0!==t){var i=1/t;this.multiplyScalar(i)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(t){this.x*=t,this.y*=t,this.z*=t},applyQuaternion:function(t){var i=this.x,s=this.y,h=this.z,n=t.x,r=t.y,o=t.z,a=t.w,e=a*i+r*h-o*s,u=a*s+o*i-n*h,y=a*h+n*s-r*i,c=-n*i-r*s-o*h;return this.x=e*a+c*-n+u*-o-y*-r,this.y=u*a+c*-r+y*-n-e*-o,this.z=y*a+c*-o+e*-r-u*-n,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},crossVectors:function(t,i){var s=t.x,h=t.y,n=t.z,r=i.x,o=i.y,a=i.z;return this.x=h*a-n*o,this.y=n*r-s*a,this.z=s*o-h*r,this}},MathUtil.Quaternion=function(t,i,s,h){this.x=t||0,this.y=i||0,this.z=s||0,this.w=void 0!==h?h:1},MathUtil.Quaternion.prototype={constructor:MathUtil.Quaternion,set:function(t,i,s,h){return this.x=t,this.y=i,this.z=s,this.w=h,this},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},setFromEulerXYZ:function(t,i,s){var h=Math.cos(t/2),n=Math.cos(i/2),r=Math.cos(s/2),o=Math.sin(t/2),a=Math.sin(i/2),e=Math.sin(s/2);return this.x=o*n*r+h*a*e,this.y=h*a*r-o*n*e,this.z=h*n*e+o*a*r,this.w=h*n*r-o*a*e,this},setFromEulerYXZ:function(t,i,s){var h=Math.cos(t/2),n=Math.cos(i/2),r=Math.cos(s/2),o=Math.sin(t/2),a=Math.sin(i/2),e=Math.sin(s/2);return this.x=o*n*r+h*a*e,this.y=h*a*r-o*n*e,this.z=h*n*e-o*a*r,this.w=h*n*r+o*a*e,this},setFromAxisAngle:function(t,i){var s=i/2,h=Math.sin(s);return this.x=t.x*h,this.y=t.y*h,this.z=t.z*h,this.w=Math.cos(s),this},multiply:function(t){return this.multiplyQuaternions(this,t)},multiplyQuaternions:function(t,i){var s=t.x,h=t.y,n=t.z,r=t.w,o=i.x,a=i.y,e=i.z,u=i.w;return this.x=s*u+r*o+h*e-n*a,this.y=h*u+r*a+n*o-s*e,this.z=n*u+r*e+s*a-h*o,this.w=r*u-s*o-h*a-n*e,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t),this},slerp:function(t,i){if(0===i)return this;if(1===i)return this.copy(t);var s=this.x,h=this.y,n=this.z,r=this.w,o=r*t.w+s*t.x+h*t.y+n*t.z;if(o<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,o=-o):this.copy(t),o>=1)return this.w=r,this.x=s,this.y=h,this.z=n,this;var a=Math.acos(o),e=Math.sqrt(1-o*o);if(Math.abs(e)<.001)return this.w=.5*(r+this.w),this.x=.5*(s+this.x),this.y=.5*(h+this.y),this.z=.5*(n+this.z),this;var u=Math.sin((1-i)*a)/e,y=Math.sin(i*a)/e;return this.w=r*u+this.w*y,this.x=s*u+this.x*y,this.y=h*u+this.y*y,this.z=n*u+this.z*y,this},setFromUnitVectors:function(){var t,i;return function(s,h){return void 0===t&&(t=new MathUtil.Vector3),i=s.dot(h)+1,i<1e-6?(i=0,Math.abs(s.x)>Math.abs(s.z)?t.set(-s.y,s.x,0):t.set(0,-s.z,s.y)):t.crossVectors(s,h),this.x=t.x,this.y=t.y,this.z=t.z,this.w=i,this.normalize(),this}}()},module.exports=MathUtil;
157
+ },{}],60:[function(_dereq_,module,exports){
158
+ function MouseKeyboardVRDisplay(){this.displayName="Mouse and Keyboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,window.addEventListener("keydown",this.onKeyDown_.bind(this)),window.addEventListener("mousemove",this.onMouseMove_.bind(this)),window.addEventListener("mousedown",this.onMouseDown_.bind(this)),window.addEventListener("mouseup",this.onMouseUp_.bind(this)),this.phi_=0,this.theta_=0,this.targetAngle_=null,this.angleAnimation_=null,this.orientation_=new MathUtil.Quaternion,this.rotateStart_=new MathUtil.Vector2,this.rotateEnd_=new MathUtil.Vector2,this.rotateDelta_=new MathUtil.Vector2,this.isDragging_=!1,this.orientationOut_=new Float32Array(4)}var VRDisplay=_dereq_("./base.js").VRDisplay,MathUtil=_dereq_("./math-util.js"),Util=_dereq_("./util.js"),KEY_SPEED=.15,KEY_ANIMATION_DURATION=80,MOUSE_SPEED_X=.5,MOUSE_SPEED_Y=.3;MouseKeyboardVRDisplay.prototype=new VRDisplay,MouseKeyboardVRDisplay.prototype.getImmediatePose=function(){return this.orientation_.setFromEulerYXZ(this.phi_,this.theta_,0),this.orientationOut_[0]=this.orientation_.x,this.orientationOut_[1]=this.orientation_.y,this.orientationOut_[2]=this.orientation_.z,this.orientationOut_[3]=this.orientation_.w,{position:null,orientation:this.orientationOut_,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},MouseKeyboardVRDisplay.prototype.onKeyDown_=function(t){38==t.keyCode?this.animatePhi_(this.phi_+KEY_SPEED):39==t.keyCode?this.animateTheta_(this.theta_-KEY_SPEED):40==t.keyCode?this.animatePhi_(this.phi_-KEY_SPEED):37==t.keyCode&&this.animateTheta_(this.theta_+KEY_SPEED)},MouseKeyboardVRDisplay.prototype.animateTheta_=function(t){this.animateKeyTransitions_("theta_",t)},MouseKeyboardVRDisplay.prototype.animatePhi_=function(t){t=Util.clamp(t,-Math.PI/2,Math.PI/2),this.animateKeyTransitions_("phi_",t)},MouseKeyboardVRDisplay.prototype.animateKeyTransitions_=function(t,i){this.angleAnimation_&&cancelAnimationFrame(this.angleAnimation_);var e=this[t],o=new Date;this.angleAnimation_=requestAnimationFrame(function n(){var a=new Date-o;if(a>=KEY_ANIMATION_DURATION)return this[t]=i,void cancelAnimationFrame(this.angleAnimation_);this.angleAnimation_=requestAnimationFrame(n.bind(this));var s=a/KEY_ANIMATION_DURATION;this[t]=e+(i-e)*s}.bind(this))},MouseKeyboardVRDisplay.prototype.onMouseDown_=function(t){this.rotateStart_.set(t.clientX,t.clientY),this.isDragging_=!0},MouseKeyboardVRDisplay.prototype.onMouseMove_=function(t){if(this.isDragging_||this.isPointerLocked_()){if(this.isPointerLocked_()){var i=t.movementX||t.mozMovementX||0,e=t.movementY||t.mozMovementY||0;this.rotateEnd_.set(this.rotateStart_.x-i,this.rotateStart_.y-e)}else this.rotateEnd_.set(t.clientX,t.clientY);this.rotateDelta_.subVectors(this.rotateEnd_,this.rotateStart_),this.rotateStart_.copy(this.rotateEnd_),this.phi_+=2*Math.PI*this.rotateDelta_.y/screen.height*MOUSE_SPEED_Y,this.theta_+=2*Math.PI*this.rotateDelta_.x/screen.width*MOUSE_SPEED_X,this.phi_=Util.clamp(this.phi_,-Math.PI/2,Math.PI/2)}},MouseKeyboardVRDisplay.prototype.onMouseUp_=function(t){this.isDragging_=!1},MouseKeyboardVRDisplay.prototype.isPointerLocked_=function(){return void 0!==(document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement)},MouseKeyboardVRDisplay.prototype.resetPose=function(){this.phi_=0,this.theta_=0},module.exports=MouseKeyboardVRDisplay;
159
+ },{"./base.js":48,"./math-util.js":59,"./util.js":68}],61:[function(_dereq_,module,exports){
160
+ (function (global){
161
+ "undefined"!=typeof global&&global.window&&(global.document=global.window.document,global.navigator=global.window.navigator),_dereq_("./main");
162
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
163
+
164
+ },{"./main":58}],62:[function(_dereq_,module,exports){
165
+ function RotateInstructions(){this.loadIcon_();var M=document.createElement("div"),N=M.style;N.position="fixed",N.top=0,N.right=0,N.bottom=0,N.left=0,N.backgroundColor="gray",N.fontFamily="sans-serif",N.zIndex=1e6;var D=document.createElement("img");D.src=this.icon;var N=D.style;N.marginLeft="25%",N.marginTop="25%",N.width="50%",M.appendChild(D);var j=document.createElement("div"),N=j.style;N.textAlign="center",N.fontSize="16px",N.lineHeight="24px",N.margin="24px 25%",N.width="50%",j.innerHTML="Place your phone into your Cardboard viewer.",M.appendChild(j);var L=document.createElement("div"),N=L.style;N.backgroundColor="#CFD8DC",N.position="fixed",N.bottom=0,N.width="100%",N.height="48px",N.padding="14px 24px",N.boxSizing="border-box",N.color="#656A6B",M.appendChild(L);var I=document.createElement("div");I.style.float="left",I.innerHTML="No Cardboard viewer?";var g=document.createElement("a");g.href="https://www.google.com/get/cardboard/get-cardboard/",g.innerHTML="get one",g.target="_blank";var N=g.style;N.float="right",N.fontWeight=600,N.textTransform="uppercase",N.borderLeft="1px solid gray",N.paddingLeft="24px",N.textDecoration="none",N.color="#656A6B",L.appendChild(I),L.appendChild(g),this.overlay=M,this.text=j,this.hide()}var Util=_dereq_("./util.js");RotateInstructions.prototype.show=function(M){M||this.overlay.parentElement?M&&(this.overlay.parentElement&&this.overlay.parentElement!=M&&this.overlay.parentElement.removeChild(this.overlay),M.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var N=this.overlay.querySelector("img"),D=N.style;Util.isLandscapeMode()?(D.width="20%",D.marginLeft="40%",D.marginTop="3%"):(D.width="50%",D.marginLeft="25%",D.marginTop="25%")},RotateInstructions.prototype.hide=function(){this.overlay.style.display="none"},RotateInstructions.prototype.showTemporarily=function(M,N){this.show(N),this.timer=setTimeout(this.hide.bind(this),M)},RotateInstructions.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},RotateInstructions.prototype.update=function(){this.disableShowTemporarily(),!Util.isLandscapeMode()&&Util.isMobile()?this.show():this.hide()},RotateInstructions.prototype.loadIcon_=function(){
166
+ this.icon=Util.base64("image/svg+xml","PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjE5OHB4IiBoZWlnaHQ9IjI0MHB4IiB2aWV3Qm94PSIwIDAgMTk4IDI0MCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpza2V0Y2g9Imh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaC9ucyI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDMuMy4zICgxMjA4MSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+dHJhbnNpdGlvbjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHNrZXRjaDp0eXBlPSJNU1BhZ2UiPgogICAgICAgIDxnIGlkPSJ0cmFuc2l0aW9uIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIj4KICAgICAgICAgICAgPGcgaWQ9IkltcG9ydGVkLUxheWVycy1Db3B5LTQtKy1JbXBvcnRlZC1MYXllcnMtQ29weS0rLUltcG9ydGVkLUxheWVycy1Db3B5LTItQ29weSIgc2tldGNoOnR5cGU9Ik1TTGF5ZXJHcm91cCI+CiAgICAgICAgICAgICAgICA8ZyBpZD0iSW1wb3J0ZWQtTGF5ZXJzLUNvcHktNCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsIDEwNy4wMDAwMDApIiBza2V0Y2g6dHlwZT0iTVNTaGFwZUdyb3VwIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ5LjYyNSwyLjUyNyBDMTQ5LjYyNSwyLjUyNyAxNTUuODA1LDYuMDk2IDE1Ni4zNjIsNi40MTggTDE1Ni4zNjIsNy4zMDQgQzE1Ni4zNjIsNy40ODEgMTU2LjM3NSw3LjY2NCAxNTYuNCw3Ljg1MyBDMTU2LjQxLDcuOTM0IDE1Ni40Miw4LjAxNSAxNTYuNDI3LDguMDk1IEMxNTYuNTY3LDkuNTEgMTU3LjQwMSwxMS4wOTMgMTU4LjUzMiwxMi4wOTQgTDE2NC4yNTIsMTcuMTU2IEwxNjQuMzMzLDE3LjA2NiBDMTY0LjMzMywxNy4wNjYgMTY4LjcxNSwxNC41MzYgMTY5LjU2OCwxNC4wNDIgQzE3MS4wMjUsMTQuODgzIDE5NS41MzgsMjkuMDM1IDE5NS41MzgsMjkuMDM1IEwxOTUuNTM4LDgzLjAzNiBDMTk1LjUzOCw4My44MDcgMTk1LjE1Miw4NC4yNTMgMTk0LjU5LDg0LjI1MyBDMTk0LjM1Nyw4NC4yNTMgMTk0LjA5NSw4NC4xNzcgMTkzLjgxOCw4NC4wMTcgTDE2OS44NTEsNzAuMTc5IEwxNjkuODM3LDcwLjIwMyBMMTQyLjUxNSw4NS45NzggTDE0MS42NjUsODQuNjU1IEMxMzYuOTM0LDgzLjEyNiAxMzEuOTE3LDgxLjkxNSAxMjYuNzE0LDgxLjA0NSBDMTI2LjcwOSw4MS4wNiAxMjYuNzA3LDgxLjA2OSAxMjYuNzA3LDgxLjA2OSBMMTIxLjY0LDk4LjAzIEwxMTMuNzQ5LDEwMi41ODYgTDExMy43MTIsMTAyLjUyMyBMMTEzLjcxMiwxMzAuMTEzIEMxMTMuNzEyLDEzMC44ODUgMTEzLjMyNiwxMzEuMzMgMTEyLjc2NCwxMzEuMzMgQzExMi41MzIsMTMxLjMzIDExMi4yNjksMTMxLjI1NCAxMTEuOTkyLDEzMS4wOTQgTDY5LjUxOSwxMDYuNTcyIEM2OC41NjksMTA2LjAyMyA2Ny43OTksMTA0LjY5NSA2Ny43OTksMTAzLjYwNSBMNjcuNzk5LDEwMi41NyBMNjcuNzc4LDEwMi42MTcgQzY3LjI3LDEwMi4zOTMgNjYuNjQ4LDEwMi4yNDkgNjUuOTYyLDEwMi4yMTggQzY1Ljg3NSwxMDIuMjE0IDY1Ljc4OCwxMDIuMjEyIDY1LjcwMSwxMDIuMjEyIEM2NS42MDYsMTAyLjIxMiA2NS41MTEsMTAyLjIxNSA2NS40MTYsMTAyLjIxOSBDNjUuMTk1LDEwMi4yMjkgNjQuOTc0LDEwMi4yMzUgNjQuNzU0LDEwMi4yMzUgQzY0LjMzMSwxMDIuMjM1IDYzLjkxMSwxMDIuMjE2IDYzLjQ5OCwxMDIuMTc4IEM2MS44NDMsMTAyLjAyNSA2MC4yOTgsMTAxLjU3OCA1OS4wOTQsMTAwLjg4MiBMMTIuNTE4LDczLjk5MiBMMTIuNTIzLDc0LjAwNCBMMi4yNDUsNTUuMjU0IEMxLjI0NCw1My40MjcgMi4wMDQsNTEuMDM4IDMuOTQzLDQ5LjkxOCBMNTkuOTU0LDE3LjU3MyBDNjAuNjI2LDE3LjE4NSA2MS4zNSwxNy4wMDEgNjIuMDUzLDE3LjAwMSBDNjMuMzc5LDE3LjAwMSA2NC42MjUsMTcuNjYgNjUuMjgsMTguODU0IEw2NS4yODUsMTguODUxIEw2NS41MTIsMTkuMjY0IEw2NS41MDYsMTkuMjY4IEM2NS45MDksMjAuMDAzIDY2LjQwNSwyMC42OCA2Ni45ODMsMjEuMjg2IEw2Ny4yNiwyMS41NTYgQzY5LjE3NCwyMy40MDYgNzEuNzI4LDI0LjM1NyA3NC4zNzMsMjQuMzU3IEM3Ni4zMjIsMjQuMzU3IDc4LjMyMSwyMy44NCA4MC4xNDgsMjIuNzg1IEM4MC4xNjEsMjIuNzg1IDg3LjQ2NywxOC41NjYgODcuNDY3LDE4LjU2NiBDODguMTM5LDE4LjE3OCA4OC44NjMsMTcuOTk0IDg5LjU2NiwxNy45OTQgQzkwLjg5MiwxNy45OTQgOTIuMTM4LDE4LjY1MiA5Mi43OTIsMTkuODQ3IEw5Ni4wNDIsMjUuNzc1IEw5Ni4wNjQsMjUuNzU3IEwxMDIuODQ5LDI5LjY3NCBMMTAyLjc0NCwyOS40OTIgTDE0OS42MjUsMi41MjcgTTE0OS42MjUsMC44OTIgQzE0OS4zNDMsMC44OTIgMTQ5LjA2MiwwLjk2NSAxNDguODEsMS4xMSBMMTAyLjY0MSwyNy42NjYgTDk3LjIzMSwyNC41NDIgTDk0LjIyNiwxOS4wNjEgQzkzLjMxMywxNy4zOTQgOTEuNTI3LDE2LjM1OSA4OS41NjYsMTYuMzU4IEM4OC41NTUsMTYuMzU4IDg3LjU0NiwxNi42MzIgODYuNjQ5LDE3LjE1IEM4My44NzgsMTguNzUgNzkuNjg3LDIxLjE2OSA3OS4zNzQsMjEuMzQ1IEM3OS4zNTksMjEuMzUzIDc5LjM0NSwyMS4zNjEgNzkuMzMsMjEuMzY5IEM3Ny43OTgsMjIuMjU0IDc2LjA4NCwyMi43MjIgNzQuMzczLDIyLjcyMiBDNzIuMDgxLDIyLjcyMiA2OS45NTksMjEuODkgNjguMzk3LDIwLjM4IEw2OC4xNDUsMjAuMTM1IEM2Ny43MDYsMTkuNjcyIDY3LjMyMywxOS4xNTYgNjcuMDA2LDE4LjYwMSBDNjYuOTg4LDE4LjU1OSA2Ni45NjgsMTguNTE5IDY2Ljk0NiwxOC40NzkgTDY2LjcxOSwxOC4wNjUgQzY2LjY5LDE4LjAxMiA2Ni42NTgsMTcuOTYgNjYuNjI0LDE3LjkxMSBDNjUuNjg2LDE2LjMzNyA2My45NTEsMTUuMzY2IDYyLjA1MywxNS4zNjYgQzYxLjA0MiwxNS4zNjYgNjAuMDMzLDE1LjY0IDU5LjEzNiwxNi4xNTggTDMuMTI1LDQ4LjUwMiBDMC40MjYsNTAuMDYxIC0wLjYxMyw1My40NDIgMC44MTEsNTYuMDQgTDExLjA4OSw3NC43OSBDMTEuMjY2LDc1LjExMyAxMS41MzcsNzUuMzUzIDExLjg1LDc1LjQ5NCBMNTguMjc2LDEwMi4yOTggQzU5LjY3OSwxMDMuMTA4IDYxLjQzMywxMDMuNjMgNjMuMzQ4LDEwMy44MDYgQzYzLjgxMiwxMDMuODQ4IDY0LjI4NSwxMDMuODcgNjQuNzU0LDEwMy44NyBDNjUsMTAzLjg3IDY1LjI0OSwxMDMuODY0IDY1LjQ5NCwxMDMuODUyIEM2NS41NjMsMTAzLjg0OSA2NS42MzIsMTAzLjg0NyA2NS43MDEsMTAzLjg0NyBDNjUuNzY0LDEwMy44NDcgNjUuODI4LDEwMy44NDkgNjUuODksMTAzLjg1MiBDNjUuOTg2LDEwMy44NTYgNjYuMDgsMTAzLjg2MyA2Ni4xNzMsMTAzLjg3NCBDNjYuMjgyLDEwNS40NjcgNjcuMzMyLDEwNy4xOTcgNjguNzAyLDEwNy45ODggTDExMS4xNzQsMTMyLjUxIEMxMTEuNjk4LDEzMi44MTIgMTEyLjIzMiwxMzIuOTY1IDExMi43NjQsMTMyLjk2NSBDMTE0LjI2MSwxMzIuOTY1IDExNS4zNDcsMTMxLjc2NSAxMTUuMzQ3LDEzMC4xMTMgTDExNS4zNDcsMTAzLjU1MSBMMTIyLjQ1OCw5OS40NDYgQzEyMi44MTksOTkuMjM3IDEyMy4wODcsOTguODk4IDEyMy4yMDcsOTguNDk4IEwxMjcuODY1LDgyLjkwNSBDMTMyLjI3OSw4My43MDIgMTM2LjU1Nyw4NC43NTMgMTQwLjYwNyw4Ni4wMzMgTDE0MS4xNCw4Ni44NjIgQzE0MS40NTEsODcuMzQ2IDE0MS45NzcsODcuNjEzIDE0Mi41MTYsODcuNjEzIEMxNDIuNzk0LDg3LjYxMyAxNDMuMDc2LDg3LjU0MiAxNDMuMzMzLDg3LjM5MyBMMTY5Ljg2NSw3Mi4wNzYgTDE5Myw4NS40MzMgQzE5My41MjMsODUuNzM1IDE5NC4wNTgsODUuODg4IDE5NC41OSw4NS44ODggQzE5Ni4wODcsODUuODg4IDE5Ny4xNzMsODQuNjg5IDE5Ny4xNzMsODMuMDM2IEwxOTcuMTczLDI5LjAzNSBDMTk3LjE3MywyOC40NTEgMTk2Ljg2MSwyNy45MTEgMTk2LjM1NSwyNy42MTkgQzE5Ni4zNTUsMjcuNjE5IDE3MS44NDMsMTMuNDY3IDE3MC4zODUsMTIuNjI2IEMxNzAuMTMyLDEyLjQ4IDE2OS44NSwxMi40MDcgMTY5LjU2OCwxMi40MDcgQzE2OS4yODUsMTIuNDA3IDE2OS4wMDIsMTIuNDgxIDE2OC43NDksMTIuNjI3IEMxNjguMTQzLDEyLjk3OCAxNjUuNzU2LDE0LjM1NyAxNjQuNDI0LDE1LjEyNSBMMTU5LjYxNSwxMC44NyBDMTU4Ljc5NiwxMC4xNDUgMTU4LjE1NCw4LjkzNyAxNTguMDU0LDcuOTM0IEMxNTguMDQ1LDcuODM3IDE1OC4wMzQsNy43MzkgMTU4LjAyMSw3LjY0IEMxNTguMDA1LDcuNTIzIDE1Ny45OTgsNy40MSAxNTcuOTk4LDcuMzA0IEwxNTcuOTk4LDYuNDE4IEMxNTcuOTk4LDUuODM0IDE1Ny42ODYsNS4yOTUgMTU3LjE4MSw1LjAwMiBDMTU2LjYyNCw0LjY4IDE1MC40NDIsMS4xMTEgMTUwLjQ0MiwxLjExMSBDMTUwLjE4OSwwLjk2NSAxNDkuOTA3LDAuODkyIDE0OS42MjUsMC44OTIiIGlkPSJGaWxsLTEiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTYuMDI3LDI1LjYzNiBMMTQyLjYwMyw1Mi41MjcgQzE0My44MDcsNTMuMjIyIDE0NC41ODIsNTQuMTE0IDE0NC44NDUsNTUuMDY4IEwxNDQuODM1LDU1LjA3NSBMNjMuNDYxLDEwMi4wNTcgTDYzLjQ2LDEwMi4wNTcgQzYxLjgwNiwxMDEuOTA1IDYwLjI2MSwxMDEuNDU3IDU5LjA1NywxMDAuNzYyIEwxMi40ODEsNzMuODcxIEw5Ni4wMjcsMjUuNjM2IiBpZD0iRmlsbC0yIiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYzLjQ2MSwxMDIuMTc0IEM2My40NTMsMTAyLjE3NCA2My40NDYsMTAyLjE3NCA2My40MzksMTAyLjE3MiBDNjEuNzQ2LDEwMi4wMTYgNjAuMjExLDEwMS41NjMgNTguOTk4LDEwMC44NjMgTDEyLjQyMiw3My45NzMgQzEyLjM4Niw3My45NTIgMTIuMzY0LDczLjkxNCAxMi4zNjQsNzMuODcxIEMxMi4zNjQsNzMuODMgMTIuMzg2LDczLjc5MSAxMi40MjIsNzMuNzcgTDk1Ljk2OCwyNS41MzUgQzk2LjAwNCwyNS41MTQgOTYuMDQ5LDI1LjUxNCA5Ni4wODUsMjUuNTM1IEwxNDIuNjYxLDUyLjQyNiBDMTQzLjg4OCw1My4xMzQgMTQ0LjY4Miw1NC4wMzggMTQ0Ljk1Nyw1NS4wMzcgQzE0NC45Nyw1NS4wODMgMTQ0Ljk1Myw1NS4xMzMgMTQ0LjkxNSw1NS4xNjEgQzE0NC45MTEsNTUuMTY1IDE0NC44OTgsNTUuMTc0IDE0NC44OTQsNTUuMTc3IEw2My41MTksMTAyLjE1OCBDNjMuNTAxLDEwMi4xNjkgNjMuNDgxLDEwMi4xNzQgNjMuNDYxLDEwMi4xNzQgTDYzLjQ2MSwxMDIuMTc0IFogTTEyLjcxNCw3My44NzEgTDU5LjExNSwxMDAuNjYxIEM2MC4yOTMsMTAxLjM0MSA2MS43ODYsMTAxLjc4MiA2My40MzUsMTAxLjkzNyBMMTQ0LjcwNyw1NS4wMTUgQzE0NC40MjgsNTQuMTA4IDE0My42ODIsNTMuMjg1IDE0Mi41NDQsNTIuNjI4IEw5Ni4wMjcsMjUuNzcxIEwxMi43MTQsNzMuODcxIEwxMi43MTQsNzMuODcxIFoiIGlkPSJGaWxsLTMiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ4LjMyNyw1OC40NzEgQzE0OC4xNDUsNTguNDggMTQ3Ljk2Miw1OC40OCAxNDcuNzgxLDU4LjQ3MiBDMTQ1Ljg4Nyw1OC4zODkgMTQ0LjQ3OSw1Ny40MzQgMTQ0LjYzNiw1Ni4zNCBDMTQ0LjY4OSw1NS45NjcgMTQ0LjY2NCw1NS41OTcgMTQ0LjU2NCw1NS4yMzUgTDYzLjQ2MSwxMDIuMDU3IEM2NC4wODksMTAyLjExNSA2NC43MzMsMTAyLjEzIDY1LjM3OSwxMDIuMDk5IEM2NS41NjEsMTAyLjA5IDY1Ljc0MywxMDIuMDkgNjUuOTI1LDEwMi4wOTggQzY3LjgxOSwxMDIuMTgxIDY5LjIyNywxMDMuMTM2IDY5LjA3LDEwNC4yMyBMMTQ4LjMyNyw1OC40NzEiIGlkPSJGaWxsLTQiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNjkuMDcsMTA0LjM0NyBDNjkuMDQ4LDEwNC4zNDcgNjkuMDI1LDEwNC4zNCA2OS4wMDUsMTA0LjMyNyBDNjguOTY4LDEwNC4zMDEgNjguOTQ4LDEwNC4yNTcgNjguOTU1LDEwNC4yMTMgQzY5LDEwMy44OTYgNjguODk4LDEwMy41NzYgNjguNjU4LDEwMy4yODggQzY4LjE1MywxMDIuNjc4IDY3LjEwMywxMDIuMjY2IDY1LjkyLDEwMi4yMTQgQzY1Ljc0MiwxMDIuMjA2IDY1LjU2MywxMDIuMjA3IDY1LjM4NSwxMDIuMjE1IEM2NC43NDIsMTAyLjI0NiA2NC4wODcsMTAyLjIzMiA2My40NSwxMDIuMTc0IEM2My4zOTksMTAyLjE2OSA2My4zNTgsMTAyLjEzMiA2My4zNDcsMTAyLjA4MiBDNjMuMzM2LDEwMi4wMzMgNjMuMzU4LDEwMS45ODEgNjMuNDAyLDEwMS45NTYgTDE0NC41MDYsNTUuMTM0IEMxNDQuNTM3LDU1LjExNiAxNDQuNTc1LDU1LjExMyAxNDQuNjA5LDU1LjEyNyBDMTQ0LjY0Miw1NS4xNDEgMTQ0LjY2OCw1NS4xNyAxNDQuNjc3LDU1LjIwNCBDMTQ0Ljc4MSw1NS41ODUgMTQ0LjgwNiw1NS45NzIgMTQ0Ljc1MSw1Ni4zNTcgQzE0NC43MDYsNTYuNjczIDE0NC44MDgsNTYuOTk0IDE0NS4wNDcsNTcuMjgyIEMxNDUuNTUzLDU3Ljg5MiAxNDYuNjAyLDU4LjMwMyAxNDcuNzg2LDU4LjM1NSBDMTQ3Ljk2NCw1OC4zNjMgMTQ4LjE0Myw1OC4zNjMgMTQ4LjMyMSw1OC4zNTQgQzE0OC4zNzcsNTguMzUyIDE0OC40MjQsNTguMzg3IDE0OC40MzksNTguNDM4IEMxNDguNDU0LDU4LjQ5IDE0OC40MzIsNTguNTQ1IDE0OC4zODUsNTguNTcyIEw2OS4xMjksMTA0LjMzMSBDNjkuMTExLDEwNC4zNDIgNjkuMDksMTA0LjM0NyA2OS4wNywxMDQuMzQ3IEw2OS4wNywxMDQuMzQ3IFogTTY1LjY2NSwxMDEuOTc1IEM2NS43NTQsMTAxLjk3NSA2NS44NDIsMTAxLjk3NyA2NS45MywxMDEuOTgxIEM2Ny4xOTYsMTAyLjAzNyA2OC4yODMsMTAyLjQ2OSA2OC44MzgsMTAzLjEzOSBDNjkuMDY1LDEwMy40MTMgNjkuMTg4LDEwMy43MTQgNjkuMTk4LDEwNC4wMjEgTDE0Ny44ODMsNTguNTkyIEMxNDcuODQ3LDU4LjU5MiAxNDcuODExLDU4LjU5MSAxNDcuNzc2LDU4LjU4OSBDMTQ2LjUwOSw1OC41MzMgMTQ1LjQyMiw1OC4xIDE0NC44NjcsNTcuNDMxIEMxNDQuNTg1LDU3LjA5MSAxNDQuNDY1LDU2LjcwNyAxNDQuNTIsNTYuMzI0IEMxNDQuNTYzLDU2LjAyMSAxNDQuNTUyLDU1LjcxNiAxNDQuNDg4LDU1LjQxNCBMNjMuODQ2LDEwMS45NyBDNjQuMzUzLDEwMi4wMDIgNjQuODY3LDEwMi4wMDYgNjUuMzc0LDEwMS45ODIgQzY1LjQ3MSwxMDEuOTc3IDY1LjU2OCwxMDEuOTc1IDY1LjY2NSwxMDEuOTc1IEw2NS42NjUsMTAxLjk3NSBaIiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTIuMjA4LDU1LjEzNCBDMS4yMDcsNTMuMzA3IDEuOTY3LDUwLjkxNyAzLjkwNiw0OS43OTcgTDU5LjkxNywxNy40NTMgQzYxLjg1NiwxNi4zMzMgNjQuMjQxLDE2LjkwNyA2NS4yNDMsMTguNzM0IEw2NS40NzUsMTkuMTQ0IEM2NS44NzIsMTkuODgyIDY2LjM2OCwyMC41NiA2Ni45NDUsMjEuMTY1IEw2Ny4yMjMsMjEuNDM1IEM3MC41NDgsMjQuNjQ5IDc1LjgwNiwyNS4xNTEgODAuMTExLDIyLjY2NSBMODcuNDMsMTguNDQ1IEM4OS4zNywxNy4zMjYgOTEuNzU0LDE3Ljg5OSA5Mi43NTUsMTkuNzI3IEw5Ni4wMDUsMjUuNjU1IEwxMi40ODYsNzMuODg0IEwyLjIwOCw1NS4xMzQgWiIgaWQ9IkZpbGwtNiIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMi40ODYsNzQuMDAxIEMxMi40NzYsNzQuMDAxIDEyLjQ2NSw3My45OTkgMTIuNDU1LDczLjk5NiBDMTIuNDI0LDczLjk4OCAxMi4zOTksNzMuOTY3IDEyLjM4NCw3My45NCBMMi4xMDYsNTUuMTkgQzEuMDc1LDUzLjMxIDEuODU3LDUwLjg0NSAzLjg0OCw0OS42OTYgTDU5Ljg1OCwxNy4zNTIgQzYwLjUyNSwxNi45NjcgNjEuMjcxLDE2Ljc2NCA2Mi4wMTYsMTYuNzY0IEM2My40MzEsMTYuNzY0IDY0LjY2NiwxNy40NjYgNjUuMzI3LDE4LjY0NiBDNjUuMzM3LDE4LjY1NCA2NS4zNDUsMTguNjYzIDY1LjM1MSwxOC42NzQgTDY1LjU3OCwxOS4wODggQzY1LjU4NCwxOS4xIDY1LjU4OSwxOS4xMTIgNjUuNTkxLDE5LjEyNiBDNjUuOTg1LDE5LjgzOCA2Ni40NjksMjAuNDk3IDY3LjAzLDIxLjA4NSBMNjcuMzA1LDIxLjM1MSBDNjkuMTUxLDIzLjEzNyA3MS42NDksMjQuMTIgNzQuMzM2LDI0LjEyIEM3Ni4zMTMsMjQuMTIgNzguMjksMjMuNTgyIDgwLjA1MywyMi41NjMgQzgwLjA2NCwyMi41NTcgODAuMDc2LDIyLjU1MyA4MC4wODgsMjIuNTUgTDg3LjM3MiwxOC4zNDQgQzg4LjAzOCwxNy45NTkgODguNzg0LDE3Ljc1NiA4OS41MjksMTcuNzU2IEM5MC45NTYsMTcuNzU2IDkyLjIwMSwxOC40NzIgOTIuODU4LDE5LjY3IEw5Ni4xMDcsMjUuNTk5IEM5Ni4xMzgsMjUuNjU0IDk2LjExOCwyNS43MjQgOTYuMDYzLDI1Ljc1NiBMMTIuNTQ1LDczLjk4NSBDMTIuNTI2LDczLjk5NiAxMi41MDYsNzQuMDAxIDEyLjQ4Niw3NC4wMDEgTDEyLjQ4Niw3NC4wMDEgWiBNNjIuMDE2LDE2Ljk5NyBDNjEuMzEyLDE2Ljk5NyA2MC42MDYsMTcuMTkgNTkuOTc1LDE3LjU1NCBMMy45NjUsNDkuODk5IEMyLjA4Myw1MC45ODUgMS4zNDEsNTMuMzA4IDIuMzEsNTUuMDc4IEwxMi41MzEsNzMuNzIzIEw5NS44NDgsMjUuNjExIEw5Mi42NTMsMTkuNzgyIEM5Mi4wMzgsMTguNjYgOTAuODcsMTcuOTkgODkuNTI5LDE3Ljk5IEM4OC44MjUsMTcuOTkgODguMTE5LDE4LjE4MiA4Ny40ODksMTguNTQ3IEw4MC4xNzIsMjIuNzcyIEM4MC4xNjEsMjIuNzc4IDgwLjE0OSwyMi43ODIgODAuMTM3LDIyLjc4NSBDNzguMzQ2LDIzLjgxMSA3Ni4zNDEsMjQuMzU0IDc0LjMzNiwyNC4zNTQgQzcxLjU4OCwyNC4zNTQgNjkuMDMzLDIzLjM0NyA2Ny4xNDIsMjEuNTE5IEw2Ni44NjQsMjEuMjQ5IEM2Ni4yNzcsMjAuNjM0IDY1Ljc3NCwxOS45NDcgNjUuMzY3LDE5LjIwMyBDNjUuMzYsMTkuMTkyIDY1LjM1NiwxOS4xNzkgNjUuMzU0LDE5LjE2NiBMNjUuMTYzLDE4LjgxOSBDNjUuMTU0LDE4LjgxMSA2NS4xNDYsMTguODAxIDY1LjE0LDE4Ljc5IEM2NC41MjUsMTcuNjY3IDYzLjM1NywxNi45OTcgNjIuMDE2LDE2Ljk5NyBMNjIuMDE2LDE2Ljk5NyBaIiBpZD0iRmlsbC03IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTQyLjQzNCw0OC44MDggTDQyLjQzNCw0OC44MDggQzM5LjkyNCw0OC44MDcgMzcuNzM3LDQ3LjU1IDM2LjU4Miw0NS40NDMgQzM0Ljc3MSw0Mi4xMzkgMzYuMTQ0LDM3LjgwOSAzOS42NDEsMzUuNzg5IEw1MS45MzIsMjguNjkxIEM1My4xMDMsMjguMDE1IDU0LjQxMywyNy42NTggNTUuNzIxLDI3LjY1OCBDNTguMjMxLDI3LjY1OCA2MC40MTgsMjguOTE2IDYxLjU3MywzMS4wMjMgQzYzLjM4NCwzNC4zMjcgNjIuMDEyLDM4LjY1NyA1OC41MTQsNDAuNjc3IEw0Ni4yMjMsNDcuNzc1IEM0NS4wNTMsNDguNDUgNDMuNzQyLDQ4LjgwOCA0Mi40MzQsNDguODA4IEw0Mi40MzQsNDguODA4IFogTTU1LjcyMSwyOC4xMjUgQzU0LjQ5NSwyOC4xMjUgNTMuMjY1LDI4LjQ2MSA1Mi4xNjYsMjkuMDk2IEwzOS44NzUsMzYuMTk0IEMzNi41OTYsMzguMDg3IDM1LjMwMiw0Mi4xMzYgMzYuOTkyLDQ1LjIxOCBDMzguMDYzLDQ3LjE3MyA0MC4wOTgsNDguMzQgNDIuNDM0LDQ4LjM0IEM0My42NjEsNDguMzQgNDQuODksNDguMDA1IDQ1Ljk5LDQ3LjM3IEw1OC4yODEsNDAuMjcyIEM2MS41NiwzOC4zNzkgNjIuODUzLDM0LjMzIDYxLjE2NCwzMS4yNDggQzYwLjA5MiwyOS4yOTMgNTguMDU4LDI4LjEyNSA1NS43MjEsMjguMTI1IEw1NS43MjEsMjguMTI1IFoiIGlkPSJGaWxsLTgiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ5LjU4OCwyLjQwNyBDMTQ5LjU4OCwyLjQwNyAxNTUuNzY4LDUuOTc1IDE1Ni4zMjUsNi4yOTcgTDE1Ni4zMjUsNy4xODQgQzE1Ni4zMjUsNy4zNiAxNTYuMzM4LDcuNTQ0IDE1Ni4zNjIsNy43MzMgQzE1Ni4zNzMsNy44MTQgMTU2LjM4Miw3Ljg5NCAxNTYuMzksNy45NzUgQzE1Ni41Myw5LjM5IDE1Ny4zNjMsMTAuOTczIDE1OC40OTUsMTEuOTc0IEwxNjUuODkxLDE4LjUxOSBDMTY2LjA2OCwxOC42NzUgMTY2LjI0OSwxOC44MTQgMTY2LjQzMiwxOC45MzQgQzE2OC4wMTEsMTkuOTc0IDE2OS4zODIsMTkuNCAxNjkuNDk0LDE3LjY1MiBDMTY5LjU0MywxNi44NjggMTY5LjU1MSwxNi4wNTcgMTY5LjUxNywxNS4yMjMgTDE2OS41MTQsMTUuMDYzIEwxNjkuNTE0LDEzLjkxMiBDMTcwLjc4LDE0LjY0MiAxOTUuNTAxLDI4LjkxNSAxOTUuNTAxLDI4LjkxNSBMMTk1LjUwMSw4Mi45MTUgQzE5NS41MDEsODQuMDA1IDE5NC43MzEsODQuNDQ1IDE5My43ODEsODMuODk3IEwxNTEuMzA4LDU5LjM3NCBDMTUwLjM1OCw1OC44MjYgMTQ5LjU4OCw1Ny40OTcgMTQ5LjU4OCw1Ni40MDggTDE0OS41ODgsMjIuMzc1IiBpZD0iRmlsbC05IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE5NC41NTMsODQuMjUgQzE5NC4yOTYsODQuMjUgMTk0LjAxMyw4NC4xNjUgMTkzLjcyMiw4My45OTcgTDE1MS4yNSw1OS40NzYgQzE1MC4yNjksNTguOTA5IDE0OS40NzEsNTcuNTMzIDE0OS40NzEsNTYuNDA4IEwxNDkuNDcxLDIyLjM3NSBMMTQ5LjcwNSwyMi4zNzUgTDE0OS43MDUsNTYuNDA4IEMxNDkuNzA1LDU3LjQ1OSAxNTAuNDUsNTguNzQ0IDE1MS4zNjYsNTkuMjc0IEwxOTMuODM5LDgzLjc5NSBDMTk0LjI2Myw4NC4wNCAxOTQuNjU1LDg0LjA4MyAxOTQuOTQyLDgzLjkxNyBDMTk1LjIyNyw4My43NTMgMTk1LjM4NCw4My4zOTcgMTk1LjM4NCw4Mi45MTUgTDE5NS4zODQsMjguOTgyIEMxOTQuMTAyLDI4LjI0MiAxNzIuMTA0LDE1LjU0MiAxNjkuNjMxLDE0LjExNCBMMTY5LjYzNCwxNS4yMiBDMTY5LjY2OCwxNi4wNTIgMTY5LjY2LDE2Ljg3NCAxNjkuNjEsMTcuNjU5IEMxNjkuNTU2LDE4LjUwMyAxNjkuMjE0LDE5LjEyMyAxNjguNjQ3LDE5LjQwNSBDMTY4LjAyOCwxOS43MTQgMTY3LjE5NywxOS41NzggMTY2LjM2NywxOS4wMzIgQzE2Ni4xODEsMTguOTA5IDE2NS45OTUsMTguNzY2IDE2NS44MTQsMTguNjA2IEwxNTguNDE3LDEyLjA2MiBDMTU3LjI1OSwxMS4wMzYgMTU2LjQxOCw5LjQzNyAxNTYuMjc0LDcuOTg2IEMxNTYuMjY2LDcuOTA3IDE1Ni4yNTcsNy44MjcgMTU2LjI0Nyw3Ljc0OCBDMTU2LjIyMSw3LjU1NSAxNTYuMjA5LDcuMzY1IDE1Ni4yMDksNy4xODQgTDE1Ni4yMDksNi4zNjQgQzE1NS4zNzUsNS44ODMgMTQ5LjUyOSwyLjUwOCAxNDkuNTI5LDIuNTA4IEwxNDkuNjQ2LDIuMzA2IEMxNDkuNjQ2LDIuMzA2IDE1NS44MjcsNS44NzQgMTU2LjM4NCw2LjE5NiBMMTU2LjQ0Miw2LjIzIEwxNTYuNDQyLDcuMTg0IEMxNTYuNDQyLDcuMzU1IDE1Ni40NTQsNy41MzUgMTU2LjQ3OCw3LjcxNyBDMTU2LjQ4OSw3LjggMTU2LjQ5OSw3Ljg4MiAxNTYuNTA3LDcuOTYzIEMxNTYuNjQ1LDkuMzU4IDE1Ny40NTUsMTAuODk4IDE1OC41NzIsMTEuODg2IEwxNjUuOTY5LDE4LjQzMSBDMTY2LjE0MiwxOC41ODQgMTY2LjMxOSwxOC43MiAxNjYuNDk2LDE4LjgzNyBDMTY3LjI1NCwxOS4zMzYgMTY4LDE5LjQ2NyAxNjguNTQzLDE5LjE5NiBDMTY5LjAzMywxOC45NTMgMTY5LjMyOSwxOC40MDEgMTY5LjM3NywxNy42NDUgQzE2OS40MjcsMTYuODY3IDE2OS40MzQsMTYuMDU0IDE2OS40MDEsMTUuMjI4IEwxNjkuMzk3LDE1LjA2NSBMMTY5LjM5NywxMy43MSBMMTY5LjU3MiwxMy44MSBDMTcwLjgzOSwxNC41NDEgMTk1LjU1OSwyOC44MTQgMTk1LjU1OSwyOC44MTQgTDE5NS42MTgsMjguODQ3IEwxOTUuNjE4LDgyLjkxNSBDMTk1LjYxOCw4My40ODQgMTk1LjQyLDgzLjkxMSAxOTUuMDU5LDg0LjExOSBDMTk0LjkwOCw4NC4yMDYgMTk0LjczNyw4NC4yNSAxOTQuNTUzLDg0LjI1IiBpZD0iRmlsbC0xMCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNDUuNjg1LDU2LjE2MSBMMTY5LjgsNzAuMDgzIEwxNDMuODIyLDg1LjA4MSBMMTQyLjM2LDg0Ljc3NCBDMTM1LjgyNiw4Mi42MDQgMTI4LjczMiw4MS4wNDYgMTIxLjM0MSw4MC4xNTggQzExNi45NzYsNzkuNjM0IDExMi42NzgsODEuMjU0IDExMS43NDMsODMuNzc4IEMxMTEuNTA2LDg0LjQxNCAxMTEuNTAzLDg1LjA3MSAxMTEuNzMyLDg1LjcwNiBDMTEzLjI3LDg5Ljk3MyAxMTUuOTY4LDk0LjA2OSAxMTkuNzI3LDk3Ljg0MSBMMTIwLjI1OSw5OC42ODYgQzEyMC4yNiw5OC42ODUgOTQuMjgyLDExMy42ODMgOTQuMjgyLDExMy42ODMgTDcwLjE2Nyw5OS43NjEgTDE0NS42ODUsNTYuMTYxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik05NC4yODIsMTEzLjgxOCBMOTQuMjIzLDExMy43ODUgTDY5LjkzMyw5OS43NjEgTDcwLjEwOCw5OS42NiBMMTQ1LjY4NSw1Ni4wMjYgTDE0NS43NDMsNTYuMDU5IEwxNzAuMDMzLDcwLjA4MyBMMTQzLjg0Miw4NS4yMDUgTDE0My43OTcsODUuMTk1IEMxNDMuNzcyLDg1LjE5IDE0Mi4zMzYsODQuODg4IDE0Mi4zMzYsODQuODg4IEMxMzUuNzg3LDgyLjcxNCAxMjguNzIzLDgxLjE2MyAxMjEuMzI3LDgwLjI3NCBDMTIwLjc4OCw4MC4yMDkgMTIwLjIzNiw4MC4xNzcgMTE5LjY4OSw4MC4xNzcgQzExNS45MzEsODAuMTc3IDExMi42MzUsODEuNzA4IDExMS44NTIsODMuODE5IEMxMTEuNjI0LDg0LjQzMiAxMTEuNjIxLDg1LjA1MyAxMTEuODQyLDg1LjY2NyBDMTEzLjM3Nyw4OS45MjUgMTE2LjA1OCw5My45OTMgMTE5LjgxLDk3Ljc1OCBMMTE5LjgyNiw5Ny43NzkgTDEyMC4zNTIsOTguNjE0IEMxMjAuMzU0LDk4LjYxNyAxMjAuMzU2LDk4LjYyIDEyMC4zNTgsOTguNjI0IEwxMjAuNDIyLDk4LjcyNiBMMTIwLjMxNyw5OC43ODcgQzEyMC4yNjQsOTguODE4IDk0LjU5OSwxMTMuNjM1IDk0LjM0LDExMy43ODUgTDk0LjI4MiwxMTMuODE4IEw5NC4yODIsMTEzLjgxOCBaIE03MC40MDEsOTkuNzYxIEw5NC4yODIsMTEzLjU0OSBMMTE5LjA4NCw5OS4yMjkgQzExOS42Myw5OC45MTQgMTE5LjkzLDk4Ljc0IDEyMC4xMDEsOTguNjU0IEwxMTkuNjM1LDk3LjkxNCBDMTE1Ljg2NCw5NC4xMjcgMTEzLjE2OCw5MC4wMzMgMTExLjYyMiw4NS43NDYgQzExMS4zODIsODUuMDc5IDExMS4zODYsODQuNDA0IDExMS42MzMsODMuNzM4IEMxMTIuNDQ4LDgxLjUzOSAxMTUuODM2LDc5Ljk0MyAxMTkuNjg5LDc5Ljk0MyBDMTIwLjI0Niw3OS45NDMgMTIwLjgwNiw3OS45NzYgMTIxLjM1NSw4MC4wNDIgQzEyOC43NjcsODAuOTMzIDEzNS44NDYsODIuNDg3IDE0Mi4zOTYsODQuNjYzIEMxNDMuMjMyLDg0LjgzOCAxNDMuNjExLDg0LjkxNyAxNDMuNzg2LDg0Ljk2NyBMMTY5LjU2Niw3MC4wODMgTDE0NS42ODUsNTYuMjk1IEw3MC40MDEsOTkuNzYxIEw3MC40MDEsOTkuNzYxIFoiIGlkPSJGaWxsLTEyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2Ny4yMywxOC45NzkgTDE2Ny4yMyw2OS44NSBMMTM5LjkwOSw4NS42MjMgTDEzMy40NDgsNzEuNDU2IEMxMzIuNTM4LDY5LjQ2IDEzMC4wMiw2OS43MTggMTI3LjgyNCw3Mi4wMyBDMTI2Ljc2OSw3My4xNCAxMjUuOTMxLDc0LjU4NSAxMjUuNDk0LDc2LjA0OCBMMTE5LjAzNCw5Ny42NzYgTDkxLjcxMiwxMTMuNDUgTDkxLjcxMiw2Mi41NzkgTDE2Ny4yMywxOC45NzkiIGlkPSJGaWxsLTEzIiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTkxLjcxMiwxMTMuNTY3IEM5MS42OTIsMTEzLjU2NyA5MS42NzIsMTEzLjU2MSA5MS42NTMsMTEzLjU1MSBDOTEuNjE4LDExMy41MyA5MS41OTUsMTEzLjQ5MiA5MS41OTUsMTEzLjQ1IEw5MS41OTUsNjIuNTc5IEM5MS41OTUsNjIuNTM3IDkxLjYxOCw2Mi40OTkgOTEuNjUzLDYyLjQ3OCBMMTY3LjE3MiwxOC44NzggQzE2Ny4yMDgsMTguODU3IDE2Ny4yNTIsMTguODU3IDE2Ny4yODgsMTguODc4IEMxNjcuMzI0LDE4Ljg5OSAxNjcuMzQ3LDE4LjkzNyAxNjcuMzQ3LDE4Ljk3OSBMMTY3LjM0Nyw2OS44NSBDMTY3LjM0Nyw2OS44OTEgMTY3LjMyNCw2OS45MyAxNjcuMjg4LDY5Ljk1IEwxMzkuOTY3LDg1LjcyNSBDMTM5LjkzOSw4NS43NDEgMTM5LjkwNSw4NS43NDUgMTM5Ljg3Myw4NS43MzUgQzEzOS44NDIsODUuNzI1IDEzOS44MTYsODUuNzAyIDEzOS44MDIsODUuNjcyIEwxMzMuMzQyLDcxLjUwNCBDMTMyLjk2Nyw3MC42ODIgMTMyLjI4LDcwLjIyOSAxMzEuNDA4LDcwLjIyOSBDMTMwLjMxOSw3MC4yMjkgMTI5LjA0NCw3MC45MTUgMTI3LjkwOCw3Mi4xMSBDMTI2Ljg3NCw3My4yIDEyNi4wMzQsNzQuNjQ3IDEyNS42MDYsNzYuMDgyIEwxMTkuMTQ2LDk3LjcwOSBDMTE5LjEzNyw5Ny43MzggMTE5LjExOCw5Ny43NjIgMTE5LjA5Miw5Ny43NzcgTDkxLjc3LDExMy41NTEgQzkxLjc1MiwxMTMuNTYxIDkxLjczMiwxMTMuNTY3IDkxLjcxMiwxMTMuNTY3IEw5MS43MTIsMTEzLjU2NyBaIE05MS44MjksNjIuNjQ3IEw5MS44MjksMTEzLjI0OCBMMTE4LjkzNSw5Ny41OTggTDEyNS4zODIsNzYuMDE1IEMxMjUuODI3LDc0LjUyNSAxMjYuNjY0LDczLjA4MSAxMjcuNzM5LDcxLjk1IEMxMjguOTE5LDcwLjcwOCAxMzAuMjU2LDY5Ljk5NiAxMzEuNDA4LDY5Ljk5NiBDMTMyLjM3Nyw2OS45OTYgMTMzLjEzOSw3MC40OTcgMTMzLjU1NCw3MS40MDcgTDEzOS45NjEsODUuNDU4IEwxNjcuMTEzLDY5Ljc4MiBMMTY3LjExMywxOS4xODEgTDkxLjgyOSw2Mi42NDcgTDkxLjgyOSw2Mi42NDcgWiIgaWQ9IkZpbGwtMTQiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTY4LjU0MywxOS4yMTMgTDE2OC41NDMsNzAuMDgzIEwxNDEuMjIxLDg1Ljg1NyBMMTM0Ljc2MSw3MS42ODkgQzEzMy44NTEsNjkuNjk0IDEzMS4zMzMsNjkuOTUxIDEyOS4xMzcsNzIuMjYzIEMxMjguMDgyLDczLjM3NCAxMjcuMjQ0LDc0LjgxOSAxMjYuODA3LDc2LjI4MiBMMTIwLjM0Niw5Ny45MDkgTDkzLjAyNSwxMTMuNjgzIEw5My4wMjUsNjIuODEzIEwxNjguNTQzLDE5LjIxMyIgaWQ9IkZpbGwtMTUiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTMuMDI1LDExMy44IEM5My4wMDUsMTEzLjggOTIuOTg0LDExMy43OTUgOTIuOTY2LDExMy43ODUgQzkyLjkzMSwxMTMuNzY0IDkyLjkwOCwxMTMuNzI1IDkyLjkwOCwxMTMuNjg0IEw5Mi45MDgsNjIuODEzIEM5Mi45MDgsNjIuNzcxIDkyLjkzMSw2Mi43MzMgOTIuOTY2LDYyLjcxMiBMMTY4LjQ4NCwxOS4xMTIgQzE2OC41MiwxOS4wOSAxNjguNTY1LDE5LjA5IDE2OC42MDEsMTkuMTEyIEMxNjguNjM3LDE5LjEzMiAxNjguNjYsMTkuMTcxIDE2OC42NiwxOS4yMTIgTDE2OC42Niw3MC4wODMgQzE2OC42Niw3MC4xMjUgMTY4LjYzNyw3MC4xNjQgMTY4LjYwMSw3MC4xODQgTDE0MS4yOCw4NS45NTggQzE0MS4yNTEsODUuOTc1IDE0MS4yMTcsODUuOTc5IDE0MS4xODYsODUuOTY4IEMxNDEuMTU0LDg1Ljk1OCAxNDEuMTI5LDg1LjkzNiAxNDEuMTE1LDg1LjkwNiBMMTM0LjY1NSw3MS43MzggQzEzNC4yOCw3MC45MTUgMTMzLjU5Myw3MC40NjMgMTMyLjcyLDcwLjQ2MyBDMTMxLjYzMiw3MC40NjMgMTMwLjM1Nyw3MS4xNDggMTI5LjIyMSw3Mi4zNDQgQzEyOC4xODYsNzMuNDMzIDEyNy4zNDcsNzQuODgxIDEyNi45MTksNzYuMzE1IEwxMjAuNDU4LDk3Ljk0MyBDMTIwLjQ1LDk3Ljk3MiAxMjAuNDMxLDk3Ljk5NiAxMjAuNDA1LDk4LjAxIEw5My4wODMsMTEzLjc4NSBDOTMuMDY1LDExMy43OTUgOTMuMDQ1LDExMy44IDkzLjAyNSwxMTMuOCBMOTMuMDI1LDExMy44IFogTTkzLjE0Miw2Mi44ODEgTDkzLjE0MiwxMTMuNDgxIEwxMjAuMjQ4LDk3LjgzMiBMMTI2LjY5NSw3Ni4yNDggQzEyNy4xNCw3NC43NTggMTI3Ljk3Nyw3My4zMTUgMTI5LjA1Miw3Mi4xODMgQzEzMC4yMzEsNzAuOTQyIDEzMS41NjgsNzAuMjI5IDEzMi43Miw3MC4yMjkgQzEzMy42ODksNzAuMjI5IDEzNC40NTIsNzAuNzMxIDEzNC44NjcsNzEuNjQxIEwxNDEuMjc0LDg1LjY5MiBMMTY4LjQyNiw3MC4wMTYgTDE2OC40MjYsMTkuNDE1IEw5My4xNDIsNjIuODgxIEw5My4xNDIsNjIuODgxIFoiIGlkPSJGaWxsLTE2IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2OS44LDcwLjA4MyBMMTQyLjQ3OCw4NS44NTcgTDEzNi4wMTgsNzEuNjg5IEMxMzUuMTA4LDY5LjY5NCAxMzIuNTksNjkuOTUxIDEzMC4zOTMsNzIuMjYzIEMxMjkuMzM5LDczLjM3NCAxMjguNSw3NC44MTkgMTI4LjA2NCw3Ni4yODIgTDEyMS42MDMsOTcuOTA5IEw5NC4yODIsMTEzLjY4MyBMOTQuMjgyLDYyLjgxMyBMMTY5LjgsMTkuMjEzIEwxNjkuOCw3MC4wODMgWiIgaWQ9IkZpbGwtMTciIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTQuMjgyLDExMy45MTcgQzk0LjI0MSwxMTMuOTE3IDk0LjIwMSwxMTMuOTA3IDk0LjE2NSwxMTMuODg2IEM5NC4wOTMsMTEzLjg0NSA5NC4wNDgsMTEzLjc2NyA5NC4wNDgsMTEzLjY4NCBMOTQuMDQ4LDYyLjgxMyBDOTQuMDQ4LDYyLjczIDk0LjA5Myw2Mi42NTIgOTQuMTY1LDYyLjYxMSBMMTY5LjY4MywxOS4wMSBDMTY5Ljc1NSwxOC45NjkgMTY5Ljg0NCwxOC45NjkgMTY5LjkxNywxOS4wMSBDMTY5Ljk4OSwxOS4wNTIgMTcwLjAzMywxOS4xMjkgMTcwLjAzMywxOS4yMTIgTDE3MC4wMzMsNzAuMDgzIEMxNzAuMDMzLDcwLjE2NiAxNjkuOTg5LDcwLjI0NCAxNjkuOTE3LDcwLjI4NSBMMTQyLjU5NSw4Ni4wNiBDMTQyLjUzOCw4Ni4wOTIgMTQyLjQ2OSw4Ni4xIDE0Mi40MDcsODYuMDggQzE0Mi4zNDQsODYuMDYgMTQyLjI5Myw4Ni4wMTQgMTQyLjI2Niw4NS45NTQgTDEzNS44MDUsNzEuNzg2IEMxMzUuNDQ1LDcwLjk5NyAxMzQuODEzLDcwLjU4IDEzMy45NzcsNzAuNTggQzEzMi45MjEsNzAuNTggMTMxLjY3Niw3MS4yNTIgMTMwLjU2Miw3Mi40MjQgQzEyOS41NCw3My41MDEgMTI4LjcxMSw3NC45MzEgMTI4LjI4Nyw3Ni4zNDggTDEyMS44MjcsOTcuOTc2IEMxMjEuODEsOTguMDM0IDEyMS43NzEsOTguMDgyIDEyMS43Miw5OC4xMTIgTDk0LjM5OCwxMTMuODg2IEM5NC4zNjIsMTEzLjkwNyA5NC4zMjIsMTEzLjkxNyA5NC4yODIsMTEzLjkxNyBMOTQuMjgyLDExMy45MTcgWiBNOTQuNTE1LDYyLjk0OCBMOTQuNTE1LDExMy4yNzkgTDEyMS40MDYsOTcuNzU0IEwxMjcuODQsNzYuMjE1IEMxMjguMjksNzQuNzA4IDEyOS4xMzcsNzMuMjQ3IDEzMC4yMjQsNzIuMTAzIEMxMzEuNDI1LDcwLjgzOCAxMzIuNzkzLDcwLjExMiAxMzMuOTc3LDcwLjExMiBDMTM0Ljk5NSw3MC4xMTIgMTM1Ljc5NSw3MC42MzggMTM2LjIzLDcxLjU5MiBMMTQyLjU4NCw4NS41MjYgTDE2OS41NjYsNjkuOTQ4IEwxNjkuNTY2LDE5LjYxNyBMOTQuNTE1LDYyLjk0OCBMOTQuNTE1LDYyLjk0OCBaIiBpZD0iRmlsbC0xOCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMDkuODk0LDkyLjk0MyBMMTA5Ljg5NCw5Mi45NDMgQzEwOC4xMiw5Mi45NDMgMTA2LjY1Myw5Mi4yMTggMTA1LjY1LDkwLjgyMyBDMTA1LjU4Myw5MC43MzEgMTA1LjU5Myw5MC42MSAxMDUuNjczLDkwLjUyOSBDMTA1Ljc1Myw5MC40NDggMTA1Ljg4LDkwLjQ0IDEwNS45NzQsOTAuNTA2IEMxMDYuNzU0LDkxLjA1MyAxMDcuNjc5LDkxLjMzMyAxMDguNzI0LDkxLjMzMyBDMTEwLjA0Nyw5MS4zMzMgMTExLjQ3OCw5MC44OTQgMTEyLjk4LDkwLjAyNyBDMTE4LjI5MSw4Ni45NiAxMjIuNjExLDc5LjUwOSAxMjIuNjExLDczLjQxNiBDMTIyLjYxMSw3MS40ODkgMTIyLjE2OSw2OS44NTYgMTIxLjMzMyw2OC42OTIgQzEyMS4yNjYsNjguNiAxMjEuMjc2LDY4LjQ3MyAxMjEuMzU2LDY4LjM5MiBDMTIxLjQzNiw2OC4zMTEgMTIxLjU2Myw2OC4yOTkgMTIxLjY1Niw2OC4zNjUgQzEyMy4zMjcsNjkuNTM3IDEyNC4yNDcsNzEuNzQ2IDEyNC4yNDcsNzQuNTg0IEMxMjQuMjQ3LDgwLjgyNiAxMTkuODIxLDg4LjQ0NyAxMTQuMzgyLDkxLjU4NyBDMTEyLjgwOCw5Mi40OTUgMTExLjI5OCw5Mi45NDMgMTA5Ljg5NCw5Mi45NDMgTDEwOS44OTQsOTIuOTQzIFogTTEwNi45MjUsOTEuNDAxIEMxMDcuNzM4LDkyLjA1MiAxMDguNzQ1LDkyLjI3OCAxMDkuODkzLDkyLjI3OCBMMTA5Ljg5NCw5Mi4yNzggQzExMS4yMTUsOTIuMjc4IDExMi42NDcsOTEuOTUxIDExNC4xNDgsOTEuMDg0IEMxMTkuNDU5LDg4LjAxNyAxMjMuNzgsODAuNjIxIDEyMy43OCw3NC41MjggQzEyMy43OCw3Mi41NDkgMTIzLjMxNyw3MC45MjkgMTIyLjQ1NCw2OS43NjcgQzEyMi44NjUsNzAuODAyIDEyMy4wNzksNzIuMDQyIDEyMy4wNzksNzMuNDAyIEMxMjMuMDc5LDc5LjY0NSAxMTguNjUzLDg3LjI4NSAxMTMuMjE0LDkwLjQyNSBDMTExLjY0LDkxLjMzNCAxMTAuMTMsOTEuNzQyIDEwOC43MjQsOTEuNzQyIEMxMDguMDgzLDkxLjc0MiAxMDcuNDgxLDkxLjU5MyAxMDYuOTI1LDkxLjQwMSBMMTA2LjkyNSw5MS40MDEgWiIgaWQ9IkZpbGwtMTkiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjA5Nyw5MC4yMyBDMTE4LjQ4MSw4Ny4xMjIgMTIyLjg0NSw3OS41OTQgMTIyLjg0NSw3My40MTYgQzEyMi44NDUsNzEuMzY1IDEyMi4zNjIsNjkuNzI0IDEyMS41MjIsNjguNTU2IEMxMTkuNzM4LDY3LjMwNCAxMTcuMTQ4LDY3LjM2MiAxMTQuMjY1LDY5LjAyNiBDMTA4Ljg4MSw3Mi4xMzQgMTA0LjUxNyw3OS42NjIgMTA0LjUxNyw4NS44NCBDMTA0LjUxNyw4Ny44OTEgMTA1LDg5LjUzMiAxMDUuODQsOTAuNyBDMTA3LjYyNCw5MS45NTIgMTEwLjIxNCw5MS44OTQgMTEzLjA5Nyw5MC4yMyIgaWQ9IkZpbGwtMjAiIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTA4LjcyNCw5MS42MTQgTDEwOC43MjQsOTEuNjE0IEMxMDcuNTgyLDkxLjYxNCAxMDYuNTY2LDkxLjQwMSAxMDUuNzA1LDkwLjc5NyBDMTA1LjY4NCw5MC43ODMgMTA1LjY2NSw5MC44MTEgMTA1LjY1LDkwLjc5IEMxMDQuNzU2LDg5LjU0NiAxMDQuMjgzLDg3Ljg0MiAxMDQuMjgzLDg1LjgxNyBDMTA0LjI4Myw3OS41NzUgMTA4LjcwOSw3MS45NTMgMTE0LjE0OCw2OC44MTIgQzExNS43MjIsNjcuOTA0IDExNy4yMzIsNjcuNDQ5IDExOC42MzgsNjcuNDQ5IEMxMTkuNzgsNjcuNDQ5IDEyMC43OTYsNjcuNzU4IDEyMS42NTYsNjguMzYyIEMxMjEuNjc4LDY4LjM3NyAxMjEuNjk3LDY4LjM5NyAxMjEuNzEyLDY4LjQxOCBDMTIyLjYwNiw2OS42NjIgMTIzLjA3OSw3MS4zOSAxMjMuMDc5LDczLjQxNSBDMTIzLjA3OSw3OS42NTggMTE4LjY1Myw4Ny4xOTggMTEzLjIxNCw5MC4zMzggQzExMS42NCw5MS4yNDcgMTEwLjEzLDkxLjYxNCAxMDguNzI0LDkxLjYxNCBMMTA4LjcyNCw5MS42MTQgWiBNMTA2LjAwNiw5MC41MDUgQzEwNi43OCw5MS4wMzcgMTA3LjY5NCw5MS4yODEgMTA4LjcyNCw5MS4yODEgQzExMC4wNDcsOTEuMjgxIDExMS40NzgsOTAuODY4IDExMi45OCw5MC4wMDEgQzExOC4yOTEsODYuOTM1IDEyMi42MTEsNzkuNDk2IDEyMi42MTEsNzMuNDAzIEMxMjIuNjExLDcxLjQ5NCAxMjIuMTc3LDY5Ljg4IDEyMS4zNTYsNjguNzE4IEMxMjAuNTgyLDY4LjE4NSAxMTkuNjY4LDY3LjkxOSAxMTguNjM4LDY3LjkxOSBDMTE3LjMxNSw2Ny45MTkgMTE1Ljg4Myw2OC4zNiAxMTQuMzgyLDY5LjIyNyBDMTA5LjA3MSw3Mi4yOTMgMTA0Ljc1MSw3OS43MzMgMTA0Ljc1MSw4NS44MjYgQzEwNC43NTEsODcuNzM1IDEwNS4xODUsODkuMzQzIDEwNi4wMDYsOTAuNTA1IEwxMDYuMDA2LDkwLjUwNSBaIiBpZD0iRmlsbC0yMSIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNDkuMzE4LDcuMjYyIEwxMzkuMzM0LDE2LjE0IEwxNTUuMjI3LDI3LjE3MSBMMTYwLjgxNiwyMS4wNTkgTDE0OS4zMTgsNy4yNjIiIGlkPSJGaWxsLTIyIiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2OS42NzYsMTMuODQgTDE1OS45MjgsMTkuNDY3IEMxNTYuMjg2LDIxLjU3IDE1MC40LDIxLjU4IDE0Ni43ODEsMTkuNDkxIEMxNDMuMTYxLDE3LjQwMiAxNDMuMTgsMTQuMDAzIDE0Ni44MjIsMTEuOSBMMTU2LjMxNyw2LjI5MiBMMTQ5LjU4OCwyLjQwNyBMNjcuNzUyLDQ5LjQ3OCBMMTEzLjY3NSw3NS45OTIgTDExNi43NTYsNzQuMjEzIEMxMTcuMzg3LDczLjg0OCAxMTcuNjI1LDczLjMxNSAxMTcuMzc0LDcyLjgyMyBDMTE1LjAxNyw2OC4xOTEgMTE0Ljc4MSw2My4yNzcgMTE2LjY5MSw1OC41NjEgQzEyMi4zMjksNDQuNjQxIDE0MS4yLDMzLjc0NiAxNjUuMzA5LDMwLjQ5MSBDMTczLjQ3OCwyOS4zODggMTgxLjk4OSwyOS41MjQgMTkwLjAxMywzMC44ODUgQzE5MC44NjUsMzEuMDMgMTkxLjc4OSwzMC44OTMgMTkyLjQyLDMwLjUyOCBMMTk1LjUwMSwyOC43NSBMMTY5LjY3NiwxMy44NCIgaWQ9IkZpbGwtMjMiIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjY3NSw3Ni40NTkgQzExMy41OTQsNzYuNDU5IDExMy41MTQsNzYuNDM4IDExMy40NDIsNzYuMzk3IEw2Ny41MTgsNDkuODgyIEM2Ny4zNzQsNDkuNzk5IDY3LjI4NCw0OS42NDUgNjcuMjg1LDQ5LjQ3OCBDNjcuMjg1LDQ5LjMxMSA2Ny4zNzQsNDkuMTU3IDY3LjUxOSw0OS4wNzMgTDE0OS4zNTUsMi4wMDIgQzE0OS40OTksMS45MTkgMTQ5LjY3NywxLjkxOSAxNDkuODIxLDIuMDAyIEwxNTYuNTUsNS44ODcgQzE1Ni43NzQsNi4wMTcgMTU2Ljg1LDYuMzAyIDE1Ni43MjIsNi41MjYgQzE1Ni41OTIsNi43NDkgMTU2LjMwNyw2LjgyNiAxNTYuMDgzLDYuNjk2IEwxNDkuNTg3LDIuOTQ2IEw2OC42ODcsNDkuNDc5IEwxMTMuNjc1LDc1LjQ1MiBMMTE2LjUyMyw3My44MDggQzExNi43MTUsNzMuNjk3IDExNy4xNDMsNzMuMzk5IDExNi45NTgsNzMuMDM1IEMxMTQuNTQyLDY4LjI4NyAxMTQuMyw2My4yMjEgMTE2LjI1OCw1OC4zODUgQzExOS4wNjQsNTEuNDU4IDEyNS4xNDMsNDUuMTQzIDEzMy44NCw0MC4xMjIgQzE0Mi40OTcsMzUuMTI0IDE1My4zNTgsMzEuNjMzIDE2NS4yNDcsMzAuMDI4IEMxNzMuNDQ1LDI4LjkyMSAxODIuMDM3LDI5LjA1OCAxOTAuMDkxLDMwLjQyNSBDMTkwLjgzLDMwLjU1IDE5MS42NTIsMzAuNDMyIDE5Mi4xODYsMzAuMTI0IEwxOTQuNTY3LDI4Ljc1IEwxNjkuNDQyLDE0LjI0NCBDMTY5LjIxOSwxNC4xMTUgMTY5LjE0MiwxMy44MjkgMTY5LjI3MSwxMy42MDYgQzE2OS40LDEzLjM4MiAxNjkuNjg1LDEzLjMwNiAxNjkuOTA5LDEzLjQzNSBMMTk1LjczNCwyOC4zNDUgQzE5NS44NzksMjguNDI4IDE5NS45NjgsMjguNTgzIDE5NS45NjgsMjguNzUgQzE5NS45NjgsMjguOTE2IDE5NS44NzksMjkuMDcxIDE5NS43MzQsMjkuMTU0IEwxOTIuNjUzLDMwLjkzMyBDMTkxLjkzMiwzMS4zNSAxOTAuODksMzEuNTA4IDE4OS45MzUsMzEuMzQ2IEMxODEuOTcyLDI5Ljk5NSAxNzMuNDc4LDI5Ljg2IDE2NS4zNzIsMzAuOTU0IEMxNTMuNjAyLDMyLjU0MyAxNDIuODYsMzUuOTkzIDEzNC4zMDcsNDAuOTMxIEMxMjUuNzkzLDQ1Ljg0NyAxMTkuODUxLDUyLjAwNCAxMTcuMTI0LDU4LjczNiBDMTE1LjI3LDYzLjMxNCAxMTUuNTAxLDY4LjExMiAxMTcuNzksNzIuNjExIEMxMTguMTYsNzMuMzM2IDExNy44NDUsNzQuMTI0IDExNi45OSw3NC42MTcgTDExMy45MDksNzYuMzk3IEMxMTMuODM2LDc2LjQzOCAxMTMuNzU2LDc2LjQ1OSAxMTMuNjc1LDc2LjQ1OSIgaWQ9IkZpbGwtMjQiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTUzLjMxNiwyMS4yNzkgQzE1MC45MDMsMjEuMjc5IDE0OC40OTUsMjAuNzUxIDE0Ni42NjQsMTkuNjkzIEMxNDQuODQ2LDE4LjY0NCAxNDMuODQ0LDE3LjIzMiAxNDMuODQ0LDE1LjcxOCBDMTQzLjg0NCwxNC4xOTEgMTQ0Ljg2LDEyLjc2MyAxNDYuNzA1LDExLjY5OCBMMTU2LjE5OCw2LjA5MSBDMTU2LjMwOSw2LjAyNSAxNTYuNDUyLDYuMDYyIDE1Ni41MTgsNi4xNzMgQzE1Ni41ODMsNi4yODQgMTU2LjU0Nyw2LjQyNyAxNTYuNDM2LDYuNDkzIEwxNDYuOTQsMTIuMTAyIEMxNDUuMjQ0LDEzLjA4MSAxNDQuMzEyLDE0LjM2NSAxNDQuMzEyLDE1LjcxOCBDMTQ0LjMxMiwxNy4wNTggMTQ1LjIzLDE4LjMyNiAxNDYuODk3LDE5LjI4OSBDMTUwLjQ0NiwyMS4zMzggMTU2LjI0LDIxLjMyNyAxNTkuODExLDE5LjI2NSBMMTY5LjU1OSwxMy42MzcgQzE2OS42NywxMy41NzMgMTY5LjgxMywxMy42MTEgMTY5Ljg3OCwxMy43MjMgQzE2OS45NDMsMTMuODM0IDE2OS45MDQsMTMuOTc3IDE2OS43OTMsMTQuMDQyIEwxNjAuMDQ1LDE5LjY3IEMxNTguMTg3LDIwLjc0MiAxNTUuNzQ5LDIxLjI3OSAxNTMuMzE2LDIxLjI3OSIgaWQ9IkZpbGwtMjUiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjY3NSw3NS45OTIgTDY3Ljc2Miw0OS40ODQiIGlkPSJGaWxsLTI2IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTExMy42NzUsNzYuMzQyIEMxMTMuNjE1LDc2LjM0MiAxMTMuNTU1LDc2LjMyNyAxMTMuNSw3Ni4yOTUgTDY3LjU4Nyw0OS43ODcgQzY3LjQxOSw0OS42OSA2Ny4zNjIsNDkuNDc2IDY3LjQ1OSw0OS4zMDkgQzY3LjU1Niw0OS4xNDEgNjcuNzcsNDkuMDgzIDY3LjkzNyw0OS4xOCBMMTEzLjg1LDc1LjY4OCBDMTE0LjAxOCw3NS43ODUgMTE0LjA3NSw3NiAxMTMuOTc4LDc2LjE2NyBDMTEzLjkxNCw3Ni4yNzkgMTEzLjc5Niw3Ni4zNDIgMTEzLjY3NSw3Ni4zNDIiIGlkPSJGaWxsLTI3IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTY3Ljc2Miw0OS40ODQgTDY3Ljc2MiwxMDMuNDg1IEM2Ny43NjIsMTA0LjU3NSA2OC41MzIsMTA1LjkwMyA2OS40ODIsMTA2LjQ1MiBMMTExLjk1NSwxMzAuOTczIEMxMTIuOTA1LDEzMS41MjIgMTEzLjY3NSwxMzEuMDgzIDExMy42NzUsMTI5Ljk5MyBMMTEzLjY3NSw3NS45OTIiIGlkPSJGaWxsLTI4IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTExMi43MjcsMTMxLjU2MSBDMTEyLjQzLDEzMS41NjEgMTEyLjEwNywxMzEuNDY2IDExMS43OCwxMzEuMjc2IEw2OS4zMDcsMTA2Ljc1NSBDNjguMjQ0LDEwNi4xNDIgNjcuNDEyLDEwNC43MDUgNjcuNDEyLDEwMy40ODUgTDY3LjQxMiw0OS40ODQgQzY3LjQxMiw0OS4yOSA2Ny41NjksNDkuMTM0IDY3Ljc2Miw0OS4xMzQgQzY3Ljk1Niw0OS4xMzQgNjguMTEzLDQ5LjI5IDY4LjExMyw0OS40ODQgTDY4LjExMywxMDMuNDg1IEM2OC4xMTMsMTA0LjQ0NSA2OC44MiwxMDUuNjY1IDY5LjY1NywxMDYuMTQ4IEwxMTIuMTMsMTMwLjY3IEMxMTIuNDc0LDEzMC44NjggMTEyLjc5MSwxMzAuOTEzIDExMywxMzAuNzkyIEMxMTMuMjA2LDEzMC42NzMgMTEzLjMyNSwxMzAuMzgxIDExMy4zMjUsMTI5Ljk5MyBMMTEzLjMyNSw3NS45OTIgQzExMy4zMjUsNzUuNzk4IDExMy40ODIsNzUuNjQxIDExMy42NzUsNzUuNjQxIEMxMTMuODY5LDc1LjY0MSAxMTQuMDI1LDc1Ljc5OCAxMTQuMDI1LDc1Ljk5MiBMMTE0LjAyNSwxMjkuOTkzIEMxMTQuMDI1LDEzMC42NDggMTEzLjc4NiwxMzEuMTQ3IDExMy4zNSwxMzEuMzk5IEMxMTMuMTYyLDEzMS41MDcgMTEyLjk1MiwxMzEuNTYxIDExMi43MjcsMTMxLjU2MSIgaWQ9IkZpbGwtMjkiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEyLjg2LDQwLjUxMiBDMTEyLjg2LDQwLjUxMiAxMTIuODYsNDAuNTEyIDExMi44NTksNDAuNTEyIEMxMTAuNTQxLDQwLjUxMiAxMDguMzYsMzkuOTkgMTA2LjcxNywzOS4wNDEgQzEwNS4wMTIsMzguMDU3IDEwNC4wNzQsMzYuNzI2IDEwNC4wNzQsMzUuMjkyIEMxMDQuMDc0LDMzLjg0NyAxMDUuMDI2LDMyLjUwMSAxMDYuNzU0LDMxLjUwNCBMMTE4Ljc5NSwyNC41NTEgQzEyMC40NjMsMjMuNTg5IDEyMi42NjksMjMuMDU4IDEyNS4wMDcsMjMuMDU4IEMxMjcuMzI1LDIzLjA1OCAxMjkuNTA2LDIzLjU4MSAxMzEuMTUsMjQuNTMgQzEzMi44NTQsMjUuNTE0IDEzMy43OTMsMjYuODQ1IDEzMy43OTMsMjguMjc4IEMxMzMuNzkzLDI5LjcyNCAxMzIuODQxLDMxLjA2OSAxMzEuMTEzLDMyLjA2NyBMMTE5LjA3MSwzOS4wMTkgQzExNy40MDMsMzkuOTgyIDExNS4xOTcsNDAuNTEyIDExMi44Niw0MC41MTIgTDExMi44Niw0MC41MTIgWiBNMTI1LjAwNywyMy43NTkgQzEyMi43OSwyMy43NTkgMTIwLjcwOSwyNC4yNTYgMTE5LjE0NiwyNS4xNTggTDEwNy4xMDQsMzIuMTEgQzEwNS42MDIsMzIuOTc4IDEwNC43NzQsMzQuMTA4IDEwNC43NzQsMzUuMjkyIEMxMDQuNzc0LDM2LjQ2NSAxMDUuNTg5LDM3LjU4MSAxMDcuMDY3LDM4LjQzNCBDMTA4LjYwNSwzOS4zMjMgMTEwLjY2MywzOS44MTIgMTEyLjg1OSwzOS44MTIgTDExMi44NiwzOS44MTIgQzExNS4wNzYsMzkuODEyIDExNy4xNTgsMzkuMzE1IDExOC43MjEsMzguNDEzIEwxMzAuNzYyLDMxLjQ2IEMxMzIuMjY0LDMwLjU5MyAxMzMuMDkyLDI5LjQ2MyAxMzMuMDkyLDI4LjI3OCBDMTMzLjA5MiwyNy4xMDYgMTMyLjI3OCwyNS45OSAxMzAuOCwyNS4xMzYgQzEyOS4yNjEsMjQuMjQ4IDEyNy4yMDQsMjMuNzU5IDEyNS4wMDcsMjMuNzU5IEwxMjUuMDA3LDIzLjc1OSBaIiBpZD0iRmlsbC0zMCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNjUuNjMsMTYuMjE5IEwxNTkuODk2LDE5LjUzIEMxNTYuNzI5LDIxLjM1OCAxNTEuNjEsMjEuMzY3IDE0OC40NjMsMTkuNTUgQzE0NS4zMTYsMTcuNzMzIDE0NS4zMzIsMTQuNzc4IDE0OC40OTksMTIuOTQ5IEwxNTQuMjMzLDkuNjM5IEwxNjUuNjMsMTYuMjE5IiBpZD0iRmlsbC0zMSIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNTQuMjMzLDEwLjQ0OCBMMTY0LjIyOCwxNi4yMTkgTDE1OS41NDYsMTguOTIzIEMxNTguMTEyLDE5Ljc1IDE1Ni4xOTQsMjAuMjA2IDE1NC4xNDcsMjAuMjA2IEMxNTIuMTE4LDIwLjIwNiAxNTAuMjI0LDE5Ljc1NyAxNDguODE0LDE4Ljk0MyBDMTQ3LjUyNCwxOC4xOTkgMTQ2LjgxNCwxNy4yNDkgMTQ2LjgxNCwxNi4yNjkgQzE0Ni44MTQsMTUuMjc4IDE0Ny41MzcsMTQuMzE0IDE0OC44NSwxMy41NTYgTDE1NC4yMzMsMTAuNDQ4IE0xNTQuMjMzLDkuNjM5IEwxNDguNDk5LDEyLjk0OSBDMTQ1LjMzMiwxNC43NzggMTQ1LjMxNiwxNy43MzMgMTQ4LjQ2MywxOS41NSBDMTUwLjAzMSwyMC40NTUgMTUyLjA4NiwyMC45MDcgMTU0LjE0NywyMC45MDcgQzE1Ni4yMjQsMjAuOTA3IDE1OC4zMDYsMjAuNDQ3IDE1OS44OTYsMTkuNTMgTDE2NS42MywxNi4yMTkgTDE1NC4yMzMsOS42MzkiIGlkPSJGaWxsLTMyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0NS40NDUsNzIuNjY3IEwxNDUuNDQ1LDcyLjY2NyBDMTQzLjY3Miw3Mi42NjcgMTQyLjIwNCw3MS44MTcgMTQxLjIwMiw3MC40MjIgQzE0MS4xMzUsNzAuMzMgMTQxLjE0NSw3MC4xNDcgMTQxLjIyNSw3MC4wNjYgQzE0MS4zMDUsNjkuOTg1IDE0MS40MzIsNjkuOTQ2IDE0MS41MjUsNzAuMDExIEMxNDIuMzA2LDcwLjU1OSAxNDMuMjMxLDcwLjgyMyAxNDQuMjc2LDcwLjgyMiBDMTQ1LjU5OCw3MC44MjIgMTQ3LjAzLDcwLjM3NiAxNDguNTMyLDY5LjUwOSBDMTUzLjg0Miw2Ni40NDMgMTU4LjE2Myw1OC45ODcgMTU4LjE2Myw1Mi44OTQgQzE1OC4xNjMsNTAuOTY3IDE1Ny43MjEsNDkuMzMyIDE1Ni44ODQsNDguMTY4IEMxNTYuODE4LDQ4LjA3NiAxNTYuODI4LDQ3Ljk0OCAxNTYuOTA4LDQ3Ljg2NyBDMTU2Ljk4OCw0Ny43ODYgMTU3LjExNCw0Ny43NzQgMTU3LjIwOCw0Ny44NCBDMTU4Ljg3OCw0OS4wMTIgMTU5Ljc5OCw1MS4yMiAxNTkuNzk4LDU0LjA1OSBDMTU5Ljc5OCw2MC4zMDEgMTU1LjM3Myw2OC4wNDYgMTQ5LjkzMyw3MS4xODYgQzE0OC4zNiw3Mi4wOTQgMTQ2Ljg1LDcyLjY2NyAxNDUuNDQ1LDcyLjY2NyBMMTQ1LjQ0NSw3Mi42NjcgWiBNMTQyLjQ3Niw3MSBDMTQzLjI5LDcxLjY1MSAxNDQuMjk2LDcyLjAwMiAxNDUuNDQ1LDcyLjAwMiBDMTQ2Ljc2Nyw3Mi4wMDIgMTQ4LjE5OCw3MS41NSAxNDkuNyw3MC42ODIgQzE1NS4wMSw2Ny42MTcgMTU5LjMzMSw2MC4xNTkgMTU5LjMzMSw1NC4wNjUgQzE1OS4zMzEsNTIuMDg1IDE1OC44NjgsNTAuNDM1IDE1OC4wMDYsNDkuMjcyIEMxNTguNDE3LDUwLjMwNyAxNTguNjMsNTEuNTMyIDE1OC42Myw1Mi44OTIgQzE1OC42Myw1OS4xMzQgMTU0LjIwNSw2Ni43NjcgMTQ4Ljc2NSw2OS45MDcgQzE0Ny4xOTIsNzAuODE2IDE0NS42ODEsNzEuMjgzIDE0NC4yNzYsNzEuMjgzIEMxNDMuNjM0LDcxLjI4MyAxNDMuMDMzLDcxLjE5MiAxNDIuNDc2LDcxIEwxNDIuNDc2LDcxIFoiIGlkPSJGaWxsLTMzIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0OC42NDgsNjkuNzA0IEMxNTQuMDMyLDY2LjU5NiAxNTguMzk2LDU5LjA2OCAxNTguMzk2LDUyLjg5MSBDMTU4LjM5Niw1MC44MzkgMTU3LjkxMyw0OS4xOTggMTU3LjA3NCw0OC4wMyBDMTU1LjI4OSw0Ni43NzggMTUyLjY5OSw0Ni44MzYgMTQ5LjgxNiw0OC41MDEgQzE0NC40MzMsNTEuNjA5IDE0MC4wNjgsNTkuMTM3IDE0MC4wNjgsNjUuMzE0IEMxNDAuMDY4LDY3LjM2NSAxNDAuNTUyLDY5LjAwNiAxNDEuMzkxLDcwLjE3NCBDMTQzLjE3Niw3MS40MjcgMTQ1Ljc2NSw3MS4zNjkgMTQ4LjY0OCw2OS43MDQiIGlkPSJGaWxsLTM0IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0NC4yNzYsNzEuMjc2IEwxNDQuMjc2LDcxLjI3NiBDMTQzLjEzMyw3MS4yNzYgMTQyLjExOCw3MC45NjkgMTQxLjI1Nyw3MC4zNjUgQzE0MS4yMzYsNzAuMzUxIDE0MS4yMTcsNzAuMzMyIDE0MS4yMDIsNzAuMzExIEMxNDAuMzA3LDY5LjA2NyAxMzkuODM1LDY3LjMzOSAxMzkuODM1LDY1LjMxNCBDMTM5LjgzNSw1OS4wNzMgMTQ0LjI2LDUxLjQzOSAxNDkuNyw0OC4yOTggQzE1MS4yNzMsNDcuMzkgMTUyLjc4NCw0Ni45MjkgMTU0LjE4OSw0Ni45MjkgQzE1NS4zMzIsNDYuOTI5IDE1Ni4zNDcsNDcuMjM2IDE1Ny4yMDgsNDcuODM5IEMxNTcuMjI5LDQ3Ljg1NCAxNTcuMjQ4LDQ3Ljg3MyAxNTcuMjYzLDQ3Ljg5NCBDMTU4LjE1Nyw0OS4xMzggMTU4LjYzLDUwLjg2NSAxNTguNjMsNTIuODkxIEMxNTguNjMsNTkuMTMyIDE1NC4yMDUsNjYuNzY2IDE0OC43NjUsNjkuOTA3IEMxNDcuMTkyLDcwLjgxNSAxNDUuNjgxLDcxLjI3NiAxNDQuMjc2LDcxLjI3NiBMMTQ0LjI3Niw3MS4yNzYgWiBNMTQxLjU1OCw3MC4xMDQgQzE0Mi4zMzEsNzAuNjM3IDE0My4yNDUsNzEuMDA1IDE0NC4yNzYsNzEuMDA1IEMxNDUuNTk4LDcxLjAwNSAxNDcuMDMsNzAuNDY3IDE0OC41MzIsNjkuNiBDMTUzLjg0Miw2Ni41MzQgMTU4LjE2Myw1OS4wMzMgMTU4LjE2Myw1Mi45MzkgQzE1OC4xNjMsNTEuMDMxIDE1Ny43MjksNDkuMzg1IDE1Ni45MDcsNDguMjIzIEMxNTYuMTMzLDQ3LjY5MSAxNTUuMjE5LDQ3LjQwOSAxNTQuMTg5LDQ3LjQwOSBDMTUyLjg2Nyw0Ny40MDkgMTUxLjQzNSw0Ny44NDIgMTQ5LjkzMyw0OC43MDkgQzE0NC42MjMsNTEuNzc1IDE0MC4zMDIsNTkuMjczIDE0MC4zMDIsNjUuMzY2IEMxNDAuMzAyLDY3LjI3NiAxNDAuNzM2LDY4Ljk0MiAxNDEuNTU4LDcwLjEwNCBMMTQxLjU1OCw3MC4xMDQgWiIgaWQ9IkZpbGwtMzUiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTUwLjcyLDY1LjM2MSBMMTUwLjM1Nyw2NS4wNjYgQzE1MS4xNDcsNjQuMDkyIDE1MS44NjksNjMuMDQgMTUyLjUwNSw2MS45MzggQzE1My4zMTMsNjAuNTM5IDE1My45NzgsNTkuMDY3IDE1NC40ODIsNTcuNTYzIEwxNTQuOTI1LDU3LjcxMiBDMTU0LjQxMiw1OS4yNDUgMTUzLjczMyw2MC43NDUgMTUyLjkxLDYyLjE3MiBDMTUyLjI2Miw2My4yOTUgMTUxLjUyNSw2NC4zNjggMTUwLjcyLDY1LjM2MSIgaWQ9IkZpbGwtMzYiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTE1LjkxNyw4NC41MTQgTDExNS41NTQsODQuMjIgQzExNi4zNDQsODMuMjQ1IDExNy4wNjYsODIuMTk0IDExNy43MDIsODEuMDkyIEMxMTguNTEsNzkuNjkyIDExOS4xNzUsNzguMjIgMTE5LjY3OCw3Ni43MTcgTDEyMC4xMjEsNzYuODY1IEMxMTkuNjA4LDc4LjM5OCAxMTguOTMsNzkuODk5IDExOC4xMDYsODEuMzI2IEMxMTcuNDU4LDgyLjQ0OCAxMTYuNzIyLDgzLjUyMSAxMTUuOTE3LDg0LjUxNCIgaWQ9IkZpbGwtMzciIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTE0LDEzMC40NzYgTDExNCwxMzAuMDA4IEwxMTQsNzYuMDUyIEwxMTQsNzUuNTg0IEwxMTQsNzYuMDUyIEwxMTQsMTMwLjAwOCBMMTE0LDEzMC40NzYiIGlkPSJGaWxsLTM4IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8ZyBpZD0iSW1wb3J0ZWQtTGF5ZXJzLUNvcHkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYyLjAwMDAwMCwgMC4wMDAwMDApIiBza2V0Y2g6dHlwZT0iTVNTaGFwZUdyb3VwIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTkuODIyLDM3LjQ3NCBDMTkuODM5LDM3LjMzOSAxOS43NDcsMzcuMTk0IDE5LjU1NSwzNy4wODIgQzE5LjIyOCwzNi44OTQgMTguNzI5LDM2Ljg3MiAxOC40NDYsMzcuMDM3IEwxMi40MzQsNDAuNTA4IEMxMi4zMDMsNDAuNTg0IDEyLjI0LDQwLjY4NiAxMi4yNDMsNDAuNzkzIEMxMi4yNDUsNDAuOTI1IDEyLjI0NSw0MS4yNTQgMTIuMjQ1LDQxLjM3MSBMMTIuMjQ1LDQxLjQxNCBMMTIuMjM4LDQxLjU0MiBDOC4xNDgsNDMuODg3IDUuNjQ3LDQ1LjMyMSA1LjY0Nyw0NS4zMjEgQzUuNjQ2LDQ1LjMyMSAzLjU3LDQ2LjM2NyAyLjg2LDUwLjUxMyBDMi44Niw1MC41MTMgMS45NDgsNTcuNDc0IDEuOTYyLDcwLjI1OCBDMS45NzcsODIuODI4IDIuNTY4LDg3LjMyOCAzLjEyOSw5MS42MDkgQzMuMzQ5LDkzLjI5MyA2LjEzLDkzLjczNCA2LjEzLDkzLjczNCBDNi40NjEsOTMuNzc0IDYuODI4LDkzLjcwNyA3LjIxLDkzLjQ4NiBMODIuNDgzLDQ5LjkzNSBDODQuMjkxLDQ4Ljg2NiA4NS4xNSw0Ni4yMTYgODUuNTM5LDQzLjY1MSBDODYuNzUyLDM1LjY2MSA4Ny4yMTQsMTAuNjczIDg1LjI2NCwzLjc3MyBDODUuMDY4LDMuMDggODQuNzU0LDIuNjkgODQuMzk2LDIuNDkxIEw4Mi4zMSwxLjcwMSBDODEuNTgzLDEuNzI5IDgwLjg5NCwyLjE2OCA4MC43NzYsMi4yMzYgQzgwLjYzNiwyLjMxNyA0MS44MDcsMjQuNTg1IDIwLjAzMiwzNy4wNzIgTDE5LjgyMiwzNy40NzQiIGlkPSJGaWxsLTEiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNODIuMzExLDEuNzAxIEw4NC4zOTYsMi40OTEgQzg0Ljc1NCwyLjY5IDg1LjA2OCwzLjA4IDg1LjI2NCwzLjc3MyBDODcuMjEzLDEwLjY3MyA4Ni43NTEsMzUuNjYgODUuNTM5LDQzLjY1MSBDODUuMTQ5LDQ2LjIxNiA4NC4yOSw0OC44NjYgODIuNDgzLDQ5LjkzNSBMNy4yMSw5My40ODYgQzYuODk3LDkzLjY2NyA2LjU5NSw5My43NDQgNi4zMTQsOTMuNzQ0IEw2LjEzMSw5My43MzMgQzYuMTMxLDkzLjczNCAzLjM0OSw5My4yOTMgMy4xMjgsOTEuNjA5IEMyLjU2OCw4Ny4zMjcgMS45NzcsODIuODI4IDEuOTYzLDcwLjI1OCBDMS45NDgsNTcuNDc0IDIuODYsNTAuNTEzIDIuODYsNTAuNTEzIEMzLjU3LDQ2LjM2NyA1LjY0Nyw0NS4zMjEgNS42NDcsNDUuMzIxIEM1LjY0Nyw0NS4zMjEgOC4xNDgsNDMuODg3IDEyLjIzOCw0MS41NDIgTDEyLjI0NSw0MS40MTQgTDEyLjI0NSw0MS4zNzEgQzEyLjI0NSw0MS4yNTQgMTIuMjQ1LDQwLjkyNSAxMi4yNDMsNDAuNzkzIEMxMi4yNCw0MC42ODYgMTIuMzAyLDQwLjU4MyAxMi40MzQsNDAuNTA4IEwxOC40NDYsMzcuMDM2IEMxOC41NzQsMzYuOTYyIDE4Ljc0NiwzNi45MjYgMTguOTI3LDM2LjkyNiBDMTkuMTQ1LDM2LjkyNiAxOS4zNzYsMzYuOTc5IDE5LjU1NCwzNy4wODIgQzE5Ljc0NywzNy4xOTQgMTkuODM5LDM3LjM0IDE5LjgyMiwzNy40NzQgTDIwLjAzMywzNy4wNzIgQzQxLjgwNiwyNC41ODUgODAuNjM2LDIuMzE4IDgwLjc3NywyLjIzNiBDODAuODk0LDIuMTY4IDgxLjU4MywxLjcyOSA4Mi4zMTEsMS43MDEgTTgyLjMxMSwwLjcwNCBMODIuMjcyLDAuNzA1IEM4MS42NTQsMC43MjggODAuOTg5LDAuOTQ5IDgwLjI5OCwxLjM2MSBMODAuMjc3LDEuMzczIEM4MC4xMjksMS40NTggNTkuNzY4LDEzLjEzNSAxOS43NTgsMzYuMDc5IEMxOS41LDM1Ljk4MSAxOS4yMTQsMzUuOTI5IDE4LjkyNywzNS45MjkgQzE4LjU2MiwzNS45MjkgMTguMjIzLDM2LjAxMyAxNy45NDcsMzYuMTczIEwxMS45MzUsMzkuNjQ0IEMxMS40OTMsMzkuODk5IDExLjIzNiw0MC4zMzQgMTEuMjQ2LDQwLjgxIEwxMS4yNDcsNDAuOTYgTDUuMTY3LDQ0LjQ0NyBDNC43OTQsNDQuNjQ2IDIuNjI1LDQ1Ljk3OCAxLjg3Nyw1MC4zNDUgTDEuODcxLDUwLjM4NCBDMS44NjIsNTAuNDU0IDAuOTUxLDU3LjU1NyAwLjk2NSw3MC4yNTkgQzAuOTc5LDgyLjg3OSAxLjU2OCw4Ny4zNzUgMi4xMzcsOTEuNzI0IEwyLjEzOSw5MS43MzkgQzIuNDQ3LDk0LjA5NCA1LjYxNCw5NC42NjIgNS45NzUsOTQuNzE5IEw2LjAwOSw5NC43MjMgQzYuMTEsOTQuNzM2IDYuMjEzLDk0Ljc0MiA2LjMxNCw5NC43NDIgQzYuNzksOTQuNzQyIDcuMjYsOTQuNjEgNy43MSw5NC4zNSBMODIuOTgzLDUwLjc5OCBDODQuNzk0LDQ5LjcyNyA4NS45ODIsNDcuMzc1IDg2LjUyNSw0My44MDEgQzg3LjcxMSwzNS45ODcgODguMjU5LDEwLjcwNSA4Ni4yMjQsMy41MDIgQzg1Ljk3MSwyLjYwOSA4NS41MiwxLjk3NSA4NC44ODEsMS42MiBMODQuNzQ5LDEuNTU4IEw4Mi42NjQsMC43NjkgQzgyLjU1MSwwLjcyNSA4Mi40MzEsMC43MDQgODIuMzExLDAuNzA0IiBpZD0iRmlsbC0yIiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTY2LjI2NywxMS41NjUgTDY3Ljc2MiwxMS45OTkgTDExLjQyMyw0NC4zMjUiIGlkPSJGaWxsLTMiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTIuMjAyLDkwLjU0NSBDMTIuMDI5LDkwLjU0NSAxMS44NjIsOTAuNDU1IDExLjc2OSw5MC4yOTUgQzExLjYzMiw5MC4wNTcgMTEuNzEzLDg5Ljc1MiAxMS45NTIsODkuNjE0IEwzMC4zODksNzguOTY5IEMzMC42MjgsNzguODMxIDMwLjkzMyw3OC45MTMgMzEuMDcxLDc5LjE1MiBDMzEuMjA4LDc5LjM5IDMxLjEyNyw3OS42OTYgMzAuODg4LDc5LjgzMyBMMTIuNDUxLDkwLjQ3OCBMMTIuMjAyLDkwLjU0NSIgaWQ9IkZpbGwtNCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMy43NjQsNDIuNjU0IEwxMy42NTYsNDIuNTkyIEwxMy43MDIsNDIuNDIxIEwxOC44MzcsMzkuNDU3IEwxOS4wMDcsMzkuNTAyIEwxOC45NjIsMzkuNjczIEwxMy44MjcsNDIuNjM3IEwxMy43NjQsNDIuNjU0IiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTguNTIsOTAuMzc1IEw4LjUyLDQ2LjQyMSBMOC41ODMsNDYuMzg1IEw3NS44NCw3LjU1NCBMNzUuODQsNTEuNTA4IEw3NS43NzgsNTEuNTQ0IEw4LjUyLDkwLjM3NSBMOC41Miw5MC4zNzUgWiBNOC43Nyw0Ni41NjQgTDguNzcsODkuOTQ0IEw3NS41OTEsNTEuMzY1IEw3NS41OTEsNy45ODUgTDguNzcsNDYuNTY0IEw4Ljc3LDQ2LjU2NCBaIiBpZD0iRmlsbC02IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTI0Ljk4Niw4My4xODIgQzI0Ljc1Niw4My4zMzEgMjQuMzc0LDgzLjU2NiAyNC4xMzcsODMuNzA1IEwxMi42MzIsOTAuNDA2IEMxMi4zOTUsOTAuNTQ1IDEyLjQyNiw5MC42NTggMTIuNyw5MC42NTggTDEzLjI2NSw5MC42NTggQzEzLjU0LDkwLjY1OCAxMy45NTgsOTAuNTQ1IDE0LjE5NSw5MC40MDYgTDI1LjcsODMuNzA1IEMyNS45MzcsODMuNTY2IDI2LjEyOCw4My40NTIgMjYuMTI1LDgzLjQ0OSBDMjYuMTIyLDgzLjQ0NyAyNi4xMTksODMuMjIgMjYuMTE5LDgyLjk0NiBDMjYuMTE5LDgyLjY3MiAyNS45MzEsODIuNTY5IDI1LjcwMSw4Mi43MTkgTDI0Ljk4Niw4My4xODIiIGlkPSJGaWxsLTciIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTMuMjY2LDkwLjc4MiBMMTIuNyw5MC43ODIgQzEyLjUsOTAuNzgyIDEyLjM4NCw5MC43MjYgMTIuMzU0LDkwLjYxNiBDMTIuMzI0LDkwLjUwNiAxMi4zOTcsOTAuMzk5IDEyLjU2OSw5MC4yOTkgTDI0LjA3NCw4My41OTcgQzI0LjMxLDgzLjQ1OSAyNC42ODksODMuMjI2IDI0LjkxOCw4My4wNzggTDI1LjYzMyw4Mi42MTQgQzI1LjcyMyw4Mi41NTUgMjUuODEzLDgyLjUyNSAyNS44OTksODIuNTI1IEMyNi4wNzEsODIuNTI1IDI2LjI0NCw4Mi42NTUgMjYuMjQ0LDgyLjk0NiBDMjYuMjQ0LDgzLjE2IDI2LjI0NSw4My4zMDkgMjYuMjQ3LDgzLjM4MyBMMjYuMjUzLDgzLjM4NyBMMjYuMjQ5LDgzLjQ1NiBDMjYuMjQ2LDgzLjUzMSAyNi4yNDYsODMuNTMxIDI1Ljc2Myw4My44MTIgTDE0LjI1OCw5MC41MTQgQzE0LDkwLjY2NSAxMy41NjQsOTAuNzgyIDEzLjI2Niw5MC43ODIgTDEzLjI2Niw5MC43ODIgWiBNMTIuNjY2LDkwLjUzMiBMMTIuNyw5MC41MzMgTDEzLjI2Niw5MC41MzMgQzEzLjUxOCw5MC41MzMgMTMuOTE1LDkwLjQyNSAxNC4xMzIsOTAuMjk5IEwyNS42MzcsODMuNTk3IEMyNS44MDUsODMuNDk5IDI1LjkzMSw4My40MjQgMjUuOTk4LDgzLjM4MyBDMjUuOTk0LDgzLjI5OSAyNS45OTQsODMuMTY1IDI1Ljk5NCw4Mi45NDYgTDI1Ljg5OSw4Mi43NzUgTDI1Ljc2OCw4Mi44MjQgTDI1LjA1NCw4My4yODcgQzI0LjgyMiw4My40MzcgMjQuNDM4LDgzLjY3MyAyNC4yLDgzLjgxMiBMMTIuNjk1LDkwLjUxNCBMMTIuNjY2LDkwLjUzMiBMMTIuNjY2LDkwLjUzMiBaIiBpZD0iRmlsbC04IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEzLjI2Niw4OS44NzEgTDEyLjcsODkuODcxIEMxMi41LDg5Ljg3MSAxMi4zODQsODkuODE1IDEyLjM1NCw4OS43MDUgQzEyLjMyNCw4OS41OTUgMTIuMzk3LDg5LjQ4OCAxMi41NjksODkuMzg4IEwyNC4wNzQsODIuNjg2IEMyNC4zMzIsODIuNTM1IDI0Ljc2OCw4Mi40MTggMjUuMDY3LDgyLjQxOCBMMjUuNjMyLDgyLjQxOCBDMjUuODMyLDgyLjQxOCAyNS45NDgsODIuNDc0IDI1Ljk3OCw4Mi41ODQgQzI2LjAwOCw4Mi42OTQgMjUuOTM1LDgyLjgwMSAyNS43NjMsODIuOTAxIEwxNC4yNTgsODkuNjAzIEMxNCw4OS43NTQgMTMuNTY0LDg5Ljg3MSAxMy4yNjYsODkuODcxIEwxMy4yNjYsODkuODcxIFogTTEyLjY2Niw4OS42MjEgTDEyLjcsODkuNjIyIEwxMy4yNjYsODkuNjIyIEMxMy41MTgsODkuNjIyIDEzLjkxNSw4OS41MTUgMTQuMTMyLDg5LjM4OCBMMjUuNjM3LDgyLjY4NiBMMjUuNjY3LDgyLjY2OCBMMjUuNjMyLDgyLjY2NyBMMjUuMDY3LDgyLjY2NyBDMjQuODE1LDgyLjY2NyAyNC40MTgsODIuNzc1IDI0LjIsODIuOTAxIEwxMi42OTUsODkuNjAzIEwxMi42NjYsODkuNjIxIEwxMi42NjYsODkuNjIxIFoiIGlkPSJGaWxsLTkiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTIuMzcsOTAuODAxIEwxMi4zNyw4OS41NTQgTDEyLjM3LDkwLjgwMSIgaWQ9IkZpbGwtMTAiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNi4xMyw5My45MDEgQzUuMzc5LDkzLjgwOCA0LjgxNiw5My4xNjQgNC42OTEsOTIuNTI1IEMzLjg2LDg4LjI4NyAzLjU0LDgzLjc0MyAzLjUyNiw3MS4xNzMgQzMuNTExLDU4LjM4OSA0LjQyMyw1MS40MjggNC40MjMsNTEuNDI4IEM1LjEzNCw0Ny4yODIgNy4yMSw0Ni4yMzYgNy4yMSw0Ni4yMzYgQzcuMjEsNDYuMjM2IDgxLjY2NywzLjI1IDgyLjA2OSwzLjAxNyBDODIuMjkyLDIuODg4IDg0LjU1NiwxLjQzMyA4NS4yNjQsMy45NCBDODcuMjE0LDEwLjg0IDg2Ljc1MiwzNS44MjcgODUuNTM5LDQzLjgxOCBDODUuMTUsNDYuMzgzIDg0LjI5MSw0OS4wMzMgODIuNDgzLDUwLjEwMSBMNy4yMSw5My42NTMgQzYuODI4LDkzLjg3NCA2LjQ2MSw5My45NDEgNi4xMyw5My45MDEgQzYuMTMsOTMuOTAxIDMuMzQ5LDkzLjQ2IDMuMTI5LDkxLjc3NiBDMi41NjgsODcuNDk1IDEuOTc3LDgyLjk5NSAxLjk2Miw3MC40MjUgQzEuOTQ4LDU3LjY0MSAyLjg2LDUwLjY4IDIuODYsNTAuNjggQzMuNTcsNDYuNTM0IDUuNjQ3LDQ1LjQ4OSA1LjY0Nyw0NS40ODkgQzUuNjQ2LDQ1LjQ4OSA4LjA2NSw0NC4wOTIgMTIuMjQ1LDQxLjY3OSBMMTMuMTE2LDQxLjU2IEwxOS43MTUsMzcuNzMgTDE5Ljc2MSwzNy4yNjkgTDYuMTMsOTMuOTAxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik02LjMxNyw5NC4xNjEgTDYuMTAyLDk0LjE0OCBMNi4xMDEsOTQuMTQ4IEw1Ljg1Nyw5NC4xMDEgQzUuMTM4LDkzLjk0NSAzLjA4NSw5My4zNjUgMi44ODEsOTEuODA5IEMyLjMxMyw4Ny40NjkgMS43MjcsODIuOTk2IDEuNzEzLDcwLjQyNSBDMS42OTksNTcuNzcxIDIuNjA0LDUwLjcxOCAyLjYxMyw1MC42NDggQzMuMzM4LDQ2LjQxNyA1LjQ0NSw0NS4zMSA1LjUzNSw0NS4yNjYgTDEyLjE2Myw0MS40MzkgTDEzLjAzMyw0MS4zMiBMMTkuNDc5LDM3LjU3OCBMMTkuNTEzLDM3LjI0NCBDMTkuNTI2LDM3LjEwNyAxOS42NDcsMzcuMDA4IDE5Ljc4NiwzNy4wMjEgQzE5LjkyMiwzNy4wMzQgMjAuMDIzLDM3LjE1NiAyMC4wMDksMzcuMjkzIEwxOS45NSwzNy44ODIgTDEzLjE5OCw0MS44MDEgTDEyLjMyOCw0MS45MTkgTDUuNzcyLDQ1LjcwNCBDNS43NDEsNDUuNzIgMy43ODIsNDYuNzcyIDMuMTA2LDUwLjcyMiBDMy4wOTksNTAuNzgyIDIuMTk4LDU3LjgwOCAyLjIxMiw3MC40MjQgQzIuMjI2LDgyLjk2MyAyLjgwOSw4Ny40MiAzLjM3Myw5MS43MjkgQzMuNDY0LDkyLjQyIDQuMDYyLDkyLjg4MyA0LjY4Miw5My4xODEgQzQuNTY2LDkyLjk4NCA0LjQ4Niw5Mi43NzYgNC40NDYsOTIuNTcyIEMzLjY2NSw4OC41ODggMy4yOTEsODQuMzcgMy4yNzYsNzEuMTczIEMzLjI2Miw1OC41MiA0LjE2Nyw1MS40NjYgNC4xNzYsNTEuMzk2IEM0LjkwMSw0Ny4xNjUgNy4wMDgsNDYuMDU5IDcuMDk4LDQ2LjAxNCBDNy4wOTQsNDYuMDE1IDgxLjU0MiwzLjAzNCA4MS45NDQsMi44MDIgTDgxLjk3MiwyLjc4NSBDODIuODc2LDIuMjQ3IDgzLjY5MiwyLjA5NyA4NC4zMzIsMi4zNTIgQzg0Ljg4NywyLjU3MyA4NS4yODEsMy4wODUgODUuNTA0LDMuODcyIEM4Ny41MTgsMTEgODYuOTY0LDM2LjA5MSA4NS43ODUsNDMuODU1IEM4NS4yNzgsNDcuMTk2IDg0LjIxLDQ5LjM3IDgyLjYxLDUwLjMxNyBMNy4zMzUsOTMuODY5IEM2Ljk5OSw5NC4wNjMgNi42NTgsOTQuMTYxIDYuMzE3LDk0LjE2MSBMNi4zMTcsOTQuMTYxIFogTTYuMTcsOTMuNjU0IEM2LjQ2Myw5My42OSA2Ljc3NCw5My42MTcgNy4wODUsOTMuNDM3IEw4Mi4zNTgsNDkuODg2IEM4NC4xODEsNDguODA4IDg0Ljk2LDQ1Ljk3MSA4NS4yOTIsNDMuNzggQzg2LjQ2NiwzNi4wNDkgODcuMDIzLDExLjA4NSA4NS4wMjQsNC4wMDggQzg0Ljg0NiwzLjM3NyA4NC41NTEsMi45NzYgODQuMTQ4LDIuODE2IEM4My42NjQsMi42MjMgODIuOTgyLDIuNzY0IDgyLjIyNywzLjIxMyBMODIuMTkzLDMuMjM0IEM4MS43OTEsMy40NjYgNy4zMzUsNDYuNDUyIDcuMzM1LDQ2LjQ1MiBDNy4zMDQsNDYuNDY5IDUuMzQ2LDQ3LjUyMSA0LjY2OSw1MS40NzEgQzQuNjYyLDUxLjUzIDMuNzYxLDU4LjU1NiAzLjc3NSw3MS4xNzMgQzMuNzksODQuMzI4IDQuMTYxLDg4LjUyNCA0LjkzNiw5Mi40NzYgQzUuMDI2LDkyLjkzNyA1LjQxMiw5My40NTkgNS45NzMsOTMuNjE1IEM2LjA4Nyw5My42NCA2LjE1OCw5My42NTIgNi4xNjksOTMuNjU0IEw2LjE3LDkzLjY1NCBMNi4xNyw5My42NTQgWiIgaWQ9IkZpbGwtMTIiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy4zMTcsNjguOTgyIEM3LjgwNiw2OC43MDEgOC4yMDIsNjguOTI2IDguMjAyLDY5LjQ4NyBDOC4yMDIsNzAuMDQ3IDcuODA2LDcwLjczIDcuMzE3LDcxLjAxMiBDNi44MjksNzEuMjk0IDYuNDMzLDcxLjA2OSA2LjQzMyw3MC41MDggQzYuNDMzLDY5Ljk0OCA2LjgyOSw2OS4yNjUgNy4zMTcsNjguOTgyIiBpZD0iRmlsbC0xMyIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik02LjkyLDcxLjEzMyBDNi42MzEsNzEuMTMzIDYuNDMzLDcwLjkwNSA2LjQzMyw3MC41MDggQzYuNDMzLDY5Ljk0OCA2LjgyOSw2OS4yNjUgNy4zMTcsNjguOTgyIEM3LjQ2LDY4LjkgNy41OTUsNjguODYxIDcuNzE0LDY4Ljg2MSBDOC4wMDMsNjguODYxIDguMjAyLDY5LjA5IDguMjAyLDY5LjQ4NyBDOC4yMDIsNzAuMDQ3IDcuODA2LDcwLjczIDcuMzE3LDcxLjAxMiBDNy4xNzQsNzEuMDk0IDcuMDM5LDcxLjEzMyA2LjkyLDcxLjEzMyBNNy43MTQsNjguNjc0IEM3LjU1Nyw2OC42NzQgNy4zOTIsNjguNzIzIDcuMjI0LDY4LjgyMSBDNi42NzYsNjkuMTM4IDYuMjQ2LDY5Ljg3OSA2LjI0Niw3MC41MDggQzYuMjQ2LDcwLjk5NCA2LjUxNyw3MS4zMiA2LjkyLDcxLjMyIEM3LjA3OCw3MS4zMiA3LjI0Myw3MS4yNzEgNy40MTEsNzEuMTc0IEM3Ljk1OSw3MC44NTcgOC4zODksNzAuMTE3IDguMzg5LDY5LjQ4NyBDOC4zODksNjkuMDAxIDguMTE3LDY4LjY3NCA3LjcxNCw2OC42NzQiIGlkPSJGaWxsLTE0IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYuOTIsNzAuOTQ3IEM2LjY0OSw3MC45NDcgNi42MjEsNzAuNjQgNi42MjEsNzAuNTA4IEM2LjYyMSw3MC4wMTcgNi45ODIsNjkuMzkyIDcuNDExLDY5LjE0NSBDNy41MjEsNjkuMDgyIDcuNjI1LDY5LjA0OSA3LjcxNCw2OS4wNDkgQzcuOTg2LDY5LjA0OSA4LjAxNSw2OS4zNTUgOC4wMTUsNjkuNDg3IEM4LjAxNSw2OS45NzggNy42NTIsNzAuNjAzIDcuMjI0LDcwLjg1MSBDNy4xMTUsNzAuOTE0IDcuMDEsNzAuOTQ3IDYuOTIsNzAuOTQ3IE03LjcxNCw2OC44NjEgQzcuNTk1LDY4Ljg2MSA3LjQ2LDY4LjkgNy4zMTcsNjguOTgyIEM2LjgyOSw2OS4yNjUgNi40MzMsNjkuOTQ4IDYuNDMzLDcwLjUwOCBDNi40MzMsNzAuOTA1IDYuNjMxLDcxLjEzMyA2LjkyLDcxLjEzMyBDNy4wMzksNzEuMTMzIDcuMTc0LDcxLjA5NCA3LjMxNyw3MS4wMTIgQzcuODA2LDcwLjczIDguMjAyLDcwLjA0NyA4LjIwMiw2OS40ODcgQzguMjAyLDY5LjA5IDguMDAzLDY4Ljg2MSA3LjcxNCw2OC44NjEiIGlkPSJGaWxsLTE1IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuNDQ0LDg1LjM1IEM3LjcwOCw4NS4xOTggNy45MjEsODUuMzE5IDcuOTIxLDg1LjYyMiBDNy45MjEsODUuOTI1IDcuNzA4LDg2LjI5MiA3LjQ0NCw4Ni40NDQgQzcuMTgxLDg2LjU5NyA2Ljk2Nyw4Ni40NzUgNi45NjcsODYuMTczIEM2Ljk2Nyw4NS44NzEgNy4xODEsODUuNTAyIDcuNDQ0LDg1LjM1IiBpZD0iRmlsbC0xNiIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik03LjIzLDg2LjUxIEM3LjA3NCw4Ni41MSA2Ljk2Nyw4Ni4zODcgNi45NjcsODYuMTczIEM2Ljk2Nyw4NS44NzEgNy4xODEsODUuNTAyIDcuNDQ0LDg1LjM1IEM3LjUyMSw4NS4zMDUgNy41OTQsODUuMjg0IDcuNjU4LDg1LjI4NCBDNy44MTQsODUuMjg0IDcuOTIxLDg1LjQwOCA3LjkyMSw4NS42MjIgQzcuOTIxLDg1LjkyNSA3LjcwOCw4Ni4yOTIgNy40NDQsODYuNDQ0IEM3LjM2Nyw4Ni40ODkgNy4yOTQsODYuNTEgNy4yMyw4Ni41MSBNNy42NTgsODUuMDk4IEM3LjU1OCw4NS4wOTggNy40NTUsODUuMTI3IDcuMzUxLDg1LjE4OCBDNy4wMzEsODUuMzczIDYuNzgxLDg1LjgwNiA2Ljc4MSw4Ni4xNzMgQzYuNzgxLDg2LjQ4MiA2Ljk2Niw4Ni42OTcgNy4yMyw4Ni42OTcgQzcuMzMsODYuNjk3IDcuNDMzLDg2LjY2NiA3LjUzOCw4Ni42MDcgQzcuODU4LDg2LjQyMiA4LjEwOCw4NS45ODkgOC4xMDgsODUuNjIyIEM4LjEwOCw4NS4zMTMgNy45MjMsODUuMDk4IDcuNjU4LDg1LjA5OCIgaWQ9IkZpbGwtMTciIGZpbGw9IiM4MDk3QTIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy4yMyw4Ni4zMjIgTDcuMTU0LDg2LjE3MyBDNy4xNTQsODUuOTM4IDcuMzMzLDg1LjYyOSA3LjUzOCw4NS41MTIgTDcuNjU4LDg1LjQ3MSBMNy43MzQsODUuNjIyIEM3LjczNCw4NS44NTYgNy41NTUsODYuMTY0IDcuMzUxLDg2LjI4MiBMNy4yMyw4Ni4zMjIgTTcuNjU4LDg1LjI4NCBDNy41OTQsODUuMjg0IDcuNTIxLDg1LjMwNSA3LjQ0NCw4NS4zNSBDNy4xODEsODUuNTAyIDYuOTY3LDg1Ljg3MSA2Ljk2Nyw4Ni4xNzMgQzYuOTY3LDg2LjM4NyA3LjA3NCw4Ni41MSA3LjIzLDg2LjUxIEM3LjI5NCw4Ni41MSA3LjM2Nyw4Ni40ODkgNy40NDQsODYuNDQ0IEM3LjcwOCw4Ni4yOTIgNy45MjEsODUuOTI1IDcuOTIxLDg1LjYyMiBDNy45MjEsODUuNDA4IDcuODE0LDg1LjI4NCA3LjY1OCw4NS4yODQiIGlkPSJGaWxsLTE4IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTc3LjI3OCw3Ljc2OSBMNzcuMjc4LDUxLjQzNiBMMTAuMjA4LDkwLjE2IEwxMC4yMDgsNDYuNDkzIEw3Ny4yNzgsNy43NjkiIGlkPSJGaWxsLTE5IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEwLjA4Myw5MC4zNzUgTDEwLjA4Myw0Ni40MjEgTDEwLjE0Niw0Ni4zODUgTDc3LjQwMyw3LjU1NCBMNzcuNDAzLDUxLjUwOCBMNzcuMzQxLDUxLjU0NCBMMTAuMDgzLDkwLjM3NSBMMTAuMDgzLDkwLjM3NSBaIE0xMC4zMzMsNDYuNTY0IEwxMC4zMzMsODkuOTQ0IEw3Ny4xNTQsNTEuMzY1IEw3Ny4xNTQsNy45ODUgTDEwLjMzMyw0Ni41NjQgTDEwLjMzMyw0Ni41NjQgWiIgaWQ9IkZpbGwtMjAiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMjUuNzM3LDg4LjY0NyBMMTE4LjA5OCw5MS45ODEgTDExOC4wOTgsODQgTDEwNi42MzksODguNzEzIEwxMDYuNjM5LDk2Ljk4MiBMOTksMTAwLjMxNSBMMTEyLjM2OSwxMDMuOTYxIEwxMjUuNzM3LDg4LjY0NyIgaWQ9IkltcG9ydGVkLUxheWVycy1Db3B5LTIiIGZpbGw9IiM0NTVBNjQiIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+")
167
+ },module.exports=RotateInstructions;
168
+ },{"./util.js":68}],63:[function(_dereq_,module,exports){
169
+ function ComplementaryFilter(t){this.kFilter=t,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,Util.isIOS()?this.filterQ=new MathUtil.Quaternion(-1,0,0,1):this.filterQ=new MathUtil.Quaternion(1,0,0,1),this.previousFilterQ=new MathUtil.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new MathUtil.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new MathUtil.Vector3,this.measuredGravity=new MathUtil.Vector3,this.gyroIntegralQ=new MathUtil.Quaternion}var SensorSample=_dereq_("./sensor-sample.js"),MathUtil=_dereq_("../math-util.js"),Util=_dereq_("../util.js");ComplementaryFilter.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},ComplementaryFilter.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var i=e-this.previousGyroMeasurement.timestampS;Util.isTimestampDeltaValid(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},ComplementaryFilter.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var i=new MathUtil.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r=new MathUtil.Quaternion;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),Util.isDebug()&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",MathUtil.radToDeg*Util.getQuaternionAngle(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new MathUtil.Quaternion;s.copy(this.filterQ),s.multiply(r),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},ComplementaryFilter.prototype.getOrientation=function(){return this.filterQ},ComplementaryFilter.prototype.accelToQuaternion_=function(t){var e=new MathUtil.Vector3;e.copy(t),e.normalize();var i=new MathUtil.Quaternion;return i.setFromUnitVectors(new MathUtil.Vector3(0,0,-1),e),i.inverse(),i},ComplementaryFilter.prototype.gyroToQuaternionDelta_=function(t,e){var i=new MathUtil.Quaternion,r=new MathUtil.Vector3;return r.copy(t),r.normalize(),i.setFromAxisAngle(r,t.length()*e),i},module.exports=ComplementaryFilter;
170
+ },{"../math-util.js":59,"../util.js":68,"./sensor-sample.js":66}],64:[function(_dereq_,module,exports){
171
+ function FusionPoseSensor(){this.deviceId="webvr-polyfill:fused",this.deviceName="VR Position Device (webvr-polyfill:fused)",this.accelerometer=new MathUtil.Vector3,this.gyroscope=new MathUtil.Vector3,this.start(),this.filter=new ComplementaryFilter(window.WebVRConfig.K_FILTER),this.posePredictor=new PosePredictor(window.WebVRConfig.PREDICTION_TIME_S),this.touchPanner=new TouchPanner,this.filterToWorldQ=new MathUtil.Quaternion,Util.isIOS()?this.filterToWorldQ.setFromAxisAngle(new MathUtil.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new MathUtil.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new MathUtil.Quaternion,this.worldToScreenQ=new MathUtil.Quaternion,this.originalPoseAdjustQ=new MathUtil.Quaternion,this.originalPoseAdjustQ.setFromAxisAngle(new MathUtil.Vector3(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),Util.isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new MathUtil.Quaternion,this.isFirefoxAndroid=Util.isFirefoxAndroid(),this.isIOS=Util.isIOS(),this.orientationOut_=new Float32Array(4)}var ComplementaryFilter=_dereq_("./complementary-filter.js"),PosePredictor=_dereq_("./pose-predictor.js"),TouchPanner=_dereq_("../touch-panner.js"),MathUtil=_dereq_("../math-util.js"),Util=_dereq_("../util.js");FusionPoseSensor.prototype.getPosition=function(){return null},FusionPoseSensor.prototype.getOrientation=function(){var e=this.filter.getOrientation();this.predictedQ=this.posePredictor.getPrediction(e,this.gyroscope,this.previousTimestampS);var t=new MathUtil.Quaternion;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),window.WebVRConfig.TOUCH_PANNER_DISABLED||t.multiply(this.touchPanner.getOrientation()),t.multiply(this.predictedQ),t.multiply(this.worldToScreenQ),window.WebVRConfig.YAW_ONLY&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_},FusionPoseSensor.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),Util.isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ),window.WebVRConfig.TOUCH_PANNER_DISABLED||this.touchPanner.resetSensor()},FusionPoseSensor.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},FusionPoseSensor.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,o=e.timeStamp/1e3,n=o-this.previousTimestampS;if(n<=Util.MIN_TIMESTEP||n>Util.MAX_TIMESTEP)return console.warn("Invalid timestamps detected. Time step between successive gyroscope sensor samples is very small or not monotonic"),void(this.previousTimestampS=o);this.accelerometer.set(-t.x,-t.y,-t.z),this.gyroscope.set(i.alpha,i.beta,i.gamma),(this.isIOS||this.isFirefoxAndroid)&&this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,o),this.filter.addGyroMeasurement(this.gyroscope,o),this.previousTimestampS=o},FusionPoseSensor.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},FusionPoseSensor.prototype.onMessage_=function(e){var t=e.data;if(t&&t.type){"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)}},FusionPoseSensor.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new MathUtil.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new MathUtil.Vector3(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},FusionPoseSensor.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),Util.isIOS()&&Util.isInsideCrossDomainIFrame()&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},FusionPoseSensor.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)},module.exports=FusionPoseSensor;
172
+ },{"../math-util.js":59,"../touch-panner.js":67,"../util.js":68,"./complementary-filter.js":63,"./pose-predictor.js":65}],65:[function(_dereq_,module,exports){
173
+ function PosePredictor(t){this.predictionTimeS=t,this.previousQ=new MathUtil.Quaternion,this.previousTimestampS=null,this.deltaQ=new MathUtil.Quaternion,this.outQ=new MathUtil.Quaternion}var MathUtil=_dereq_("../math-util"),Util=_dereq_("../util");PosePredictor.prototype.getPrediction=function(t,i,e){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=e,t;var o=new MathUtil.Vector3;o.copy(i),o.normalize();var s=i.length();if(s<20*MathUtil.degToRad)return Util.isDebug()&&console.log("Moving slowly, at %s deg/s: no prediction",(MathUtil.radToDeg*s).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var r=(this.previousTimestampS,s*this.predictionTimeS);return this.deltaQ.setFromAxisAngle(o,r),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=e,this.outQ},module.exports=PosePredictor;
174
+ },{"../math-util":59,"../util":68}],66:[function(_dereq_,module,exports){
175
+ function SensorSample(e,t){this.set(e,t)}SensorSample.prototype.set=function(e,t){this.sample=e,this.timestampS=t},SensorSample.prototype.copy=function(e){this.set(e.sample,e.timestampS)},module.exports=SensorSample;
176
+ },{}],67:[function(_dereq_,module,exports){
177
+ function TouchPanner(){window.addEventListener("touchstart",this.onTouchStart_.bind(this)),window.addEventListener("touchmove",this.onTouchMove_.bind(this)),window.addEventListener("touchend",this.onTouchEnd_.bind(this)),this.isTouching=!1,this.rotateStart=new MathUtil.Vector2,this.rotateEnd=new MathUtil.Vector2,this.rotateDelta=new MathUtil.Vector2,this.theta=0,this.orientation=new MathUtil.Quaternion}var MathUtil=_dereq_("./math-util.js"),Util=_dereq_("./util.js"),ROTATE_SPEED=.5;TouchPanner.prototype.getOrientation=function(){return this.orientation.setFromEulerXYZ(0,0,this.theta),this.orientation},TouchPanner.prototype.resetSensor=function(){this.theta=0},TouchPanner.prototype.onTouchStart_=function(t){t.touches&&1==t.touches.length&&(this.rotateStart.set(t.touches[0].pageX,t.touches[0].pageY),this.isTouching=!0)},TouchPanner.prototype.onTouchMove_=function(t){if(this.isTouching){this.rotateEnd.set(t.touches[0].pageX,t.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd),Util.isIOS()&&(this.rotateDelta.x*=-1);var e=document.body;this.theta+=2*Math.PI*this.rotateDelta.x/e.clientWidth*ROTATE_SPEED}},TouchPanner.prototype.onTouchEnd_=function(t){this.isTouching=!1},module.exports=TouchPanner;
178
+ },{"./math-util.js":59,"./util.js":68}],68:[function(_dereq_,module,exports){
179
+ var Util=window.Util||{};Util.MIN_TIMESTEP=.001,Util.MAX_TIMESTEP=1,Util.base64=function(e,t){return"data:"+e+";base64,"+t},Util.clamp=function(e,t,i){return Math.min(Math.max(t,e),i)},Util.lerp=function(e,t,i){return e+(t-e)*i},Util.race=function(e){return Promise.race?Promise.race(e):new Promise(function(t,i){for(var r=0;r<e.length;r++)e[r].then(t,i)})},Util.isIOS=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),Util.isWebViewAndroid=function(){var e=-1!==navigator.userAgent.indexOf("Version")&&-1!==navigator.userAgent.indexOf("Android")&&-1!==navigator.userAgent.indexOf("Chrome");return function(){return e}}(),Util.isSafari=function(){var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),Util.isFirefoxAndroid=function(){var e=-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),Util.isLandscapeMode=function(){return 90==window.orientation||-90==window.orientation},Util.isTimestampDeltaValid=function(e){return!isNaN(e)&&(!(e<=Util.MIN_TIMESTEP)&&!(e>Util.MAX_TIMESTEP))},Util.getScreenWidth=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},Util.getScreenHeight=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},Util.requestFullscreen=function(e){if(Util.isWebViewAndroid())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},Util.exitFullscreen=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},Util.getFullscreenElement=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Util.linkProgram=function(e,t,i,r){var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,o);for(var l in r)e.bindAttribLocation(a,r[l],l);return e.linkProgram(a),e.deleteShader(n),e.deleteShader(o),a},Util.getProgramUniforms=function(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n="",o=0;o<r;o++){n=e.getActiveUniform(t,o).name.replace("[0]",""),i[n]=e.getUniformLocation(t,n)}return i},Util.orthoMatrix=function(e,t,i,r,n,o,a){var l=1/(t-i),c=1/(r-n),u=1/(o-a);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*l,e[13]=(n+r)*c,e[14]=(a+o)*u,e[15]=1,e},Util.copyArray=function(e,t){for(var i=0,r=e.length;i<r;i++)t[i]=e[i]},Util.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},Util.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},Util.safariCssSizeWorkaround=function(e){if(Util.isIOS()){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t)+1+"px",e.style.height=parseInt(i)+"px",setTimeout(function(){e.style.width=t,e.style.height=i},100)}window.Util=Util,window.canvas=e},Util.isDebug=function(){return Util.getQueryParameter("debug")},Util.getQueryParameter=function(e){var e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},Util.frameDataFromPose=function(){function e(e,t,i,r){var n=Math.tan(t?t.upDegrees*o:a),l=Math.tan(t?t.downDegrees*o:a),c=Math.tan(t?t.leftDegrees*o:a),u=Math.tan(t?t.rightDegrees*o:a),s=2/(c+u),m=2/(n+l);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=m,e[6]=0,e[7]=0,e[8]=-(c-u)*s*.5,e[9]=(n-l)*m*.5,e[10]=r/(i-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*i/(i-r),e[15]=0,e}function t(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],l=r+r,c=n+n,u=o+o,s=r*l,m=r*c,d=r*u,f=n*c,g=n*u,w=o*u,p=a*l,h=a*c,v=a*u;return e[0]=1-(f+w),e[1]=m+v,e[2]=d-h,e[3]=0,e[4]=m-v,e[5]=1-(s+w),e[6]=g+p,e[7]=0,e[8]=d+h,e[9]=g-p,e[10]=1-(s+f),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function i(e,t,i){var r,n,o,a,l,c,u,s,m,d,f,g,w=i[0],p=i[1],h=i[2];return t===e?(e[12]=t[0]*w+t[4]*p+t[8]*h+t[12],e[13]=t[1]*w+t[5]*p+t[9]*h+t[13],e[14]=t[2]*w+t[6]*p+t[10]*h+t[14],e[15]=t[3]*w+t[7]*p+t[11]*h+t[15]):(r=t[0],n=t[1],o=t[2],a=t[3],l=t[4],c=t[5],u=t[6],s=t[7],m=t[8],d=t[9],f=t[10],g=t[11],e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=l,e[5]=c,e[6]=u,e[7]=s,e[8]=m,e[9]=d,e[10]=f,e[11]=g,e[12]=r*w+l*p+m*h+t[12],e[13]=n*w+c*p+d*h+t[13],e[14]=o*w+u*p+f*h+t[14],e[15]=a*w+s*p+g*h+t[15]),e}function r(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],c=t[6],u=t[7],s=t[8],m=t[9],d=t[10],f=t[11],g=t[12],w=t[13],p=t[14],h=t[15],v=i*l-r*a,U=i*c-n*a,b=i*u-o*a,x=r*c-n*l,k=r*u-o*l,F=n*u-o*c,y=s*w-m*g,P=s*p-d*g,S=s*h-f*g,M=m*p-d*w,E=m*h-f*w,A=d*h-f*p,I=v*A-U*E+b*M+x*S-k*P+F*y;return I?(I=1/I,e[0]=(l*A-c*E+u*M)*I,e[1]=(n*E-r*A-o*M)*I,e[2]=(w*F-p*k+h*x)*I,e[3]=(d*k-m*F-f*x)*I,e[4]=(c*S-a*A-u*P)*I,e[5]=(i*A-n*S+o*P)*I,e[6]=(p*b-g*F-h*U)*I,e[7]=(s*F-d*b+f*U)*I,e[8]=(a*E-l*S+u*y)*I,e[9]=(r*S-i*E-o*y)*I,e[10]=(g*k-w*b+h*v)*I,e[11]=(m*b-s*k-f*v)*I,e[12]=(l*P-a*M-c*y)*I,e[13]=(i*M-r*P+n*y)*I,e[14]=(w*U-g*x-p*v)*I,e[15]=(s*x-m*U+d*v)*I,e):null}function n(n,o,a,u,s){e(n,u?u.fieldOfView:null,s.depthNear,s.depthFar),t(o,a.orientation||l,a.position||c),u&&i(o,o,u.offset),r(o,o)}var o=Math.PI/180,a=.25*Math.PI,l=new Float32Array([0,0,0,1]),c=new Float32Array([0,0,0]);return function(e,t,i){return!(!e||!t)&&(e.pose=t,e.timestamp=t.timestamp,n(e.leftProjectionMatrix,e.leftViewMatrix,t,i.getEyeParameters("left"),i),n(e.rightProjectionMatrix,e.rightViewMatrix,t,i.getEyeParameters("right"),i),!0)}}(),Util.isInsideCrossDomainIFrame=function(){var e=window.self!==window.top,t=Util.getDomainFromUrl(document.referrer),i=Util.getDomainFromUrl(window.location.href);return e&&t!==i},Util.getDomainFromUrl=function(e){var t;return t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0]},module.exports=Util;
180
+ },{}],69:[function(_dereq_,module,exports){
181
+ function ViewerSelector(){try{this.selectedKey=localStorage.getItem(VIEWER_KEY)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=DEFAULT_VIEWER),this.dialog=this.createDialog_(DeviceInfo.Viewers),this.root=null,this.onChangeCallbacks_=[]}var DeviceInfo=_dereq_("./device-info.js"),Util=_dereq_("./util.js"),DEFAULT_VIEWER="CardboardV1",VIEWER_KEY="WEBVR_CARDBOARD_VIEWER",CLASS_NAME="webvr-polyfill-viewer-selector";ViewerSelector.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},ViewerSelector.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},ViewerSelector.prototype.getCurrentViewer=function(){return DeviceInfo.Viewers[this.selectedKey]},ViewerSelector.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},ViewerSelector.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},ViewerSelector.prototype.fireOnChange_=function(e){for(var t=0;t<this.onChangeCallbacks_.length;t++)this.onChangeCallbacks_[t](e)},ViewerSelector.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),!this.selectedKey||!DeviceInfo.Viewers[this.selectedKey])return void console.error("ViewerSelector.onSave_: this should never happen!");this.fireOnChange_(DeviceInfo.Viewers[this.selectedKey]);try{localStorage.setItem(VIEWER_KEY,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()},ViewerSelector.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(CLASS_NAME),t.style.display="none";var i=document.createElement("div"),o=i.style;o.position="fixed",o.left=0,o.top=0,o.width="100%",o.height="100%",o.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var r=document.createElement("div"),o=r.style;o.boxSizing="border-box",o.position="fixed",o.top="24px",o.left="50%",o.marginLeft="-140px",o.width="280px",o.padding="24px",o.overflow="hidden",o.background="#fafafa",o.fontFamily="'Roboto', sans-serif",o.boxShadow="0px 5px 20px #666",r.appendChild(this.createH1_("Select your viewer"));for(var n in e)r.appendChild(this.createChoice_(n,e[n].label));return r.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(r),t},ViewerSelector.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},ViewerSelector.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var o=document.createElement("input");o.style.fontSize="30px",o.setAttribute("id",e),o.setAttribute("type","radio"),o.setAttribute("value",e),o.setAttribute("name","field");var r=document.createElement("label");return r.style.marginLeft="4px",r.setAttribute("for",e),r.innerHTML=t,i.appendChild(o),i.appendChild(r),i},ViewerSelector.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var o=i.style;return o.float="right",o.textTransform="uppercase",o.color="#1094f7",o.fontSize="14px",o.letterSpacing=0,o.border=0,o.background="none",o.marginTop="16px",i.addEventListener("click",t),i},module.exports=ViewerSelector;
182
+ },{"./device-info.js":53,"./util.js":68}],70:[function(_dereq_,module,exports){
183
+ function AndroidWakeLock(){function A(A,e,o){var t=document.createElement("source");t.src=o,t.type="video/"+e,A.appendChild(t)}var e=document.createElement("video");e.setAttribute("loop",""),A(e,"webm",Util.base64("video/webm","GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=")),A(e,"mp4",Util.base64("video/mp4","AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw==")),this.request=function(){e.paused&&e.play()},this.release=function(){e.pause()}}function iOSWakeLock(){var A=null;this.request=function(){A||(A=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){A&&(clearInterval(A),A=null)}}function getWakeLock(){var A=navigator.userAgent||navigator.vendor||window.opera;return A.match(/iPhone/i)||A.match(/iPod/i)?iOSWakeLock:AndroidWakeLock}var Util=_dereq_("./util.js");module.exports=getWakeLock();
184
+ },{"./util.js":68}],71:[function(_dereq_,module,exports){
185
+ function WebVRPolyfill(){this.displays=[],this.devices=[],this.devicesPopulated=!1,this.nativeWebVRAvailable=this.isWebVRAvailable(),this.nativeLegacyWebVRAvailable=this.isDeprecatedWebVRAvailable(),this.nativeGetVRDisplaysFunc=this.nativeWebVRAvailable?navigator.getVRDisplays:null,this.nativeLegacyWebVRAvailable||(this.enablePolyfill(),window.WebVRConfig.ENABLE_DEPRECATED_API&&this.enableDeprecatedPolyfill()),InstallWebVRSpecShim()}function InstallWebVRSpecShim(){"VRDisplay"in window&&!("VRFrameData"in window)&&(window.VRFrameData=VRFrameData,"depthNear"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthNear=.01),"depthFar"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthFar=1e4),window.VRDisplay.prototype.getFrameData=function(e){return Util.frameDataFromPose(e,this.getPose(),this)})}var Util=_dereq_("./util.js"),CardboardVRDisplay=_dereq_("./cardboard-vr-display.js"),MouseKeyboardVRDisplay=_dereq_("./mouse-keyboard-vr-display.js"),VRDisplay=_dereq_("./base.js").VRDisplay,VRFrameData=_dereq_("./base.js").VRFrameData,HMDVRDevice=_dereq_("./base.js").HMDVRDevice,PositionSensorVRDevice=_dereq_("./base.js").PositionSensorVRDevice,VRDisplayHMDDevice=_dereq_("./display-wrappers.js").VRDisplayHMDDevice,VRDisplayPositionSensorDevice=_dereq_("./display-wrappers.js").VRDisplayPositionSensorDevice,version=_dereq_("../package.json").version;WebVRPolyfill.prototype.isWebVRAvailable=function(){return"getVRDisplays"in navigator},WebVRPolyfill.prototype.isDeprecatedWebVRAvailable=function(){return"getVRDevices"in navigator||"mozGetVRDevices"in navigator},WebVRPolyfill.prototype.connectDisplay=function(e){e.fireVRDisplayConnect_(),this.displays.push(e)},WebVRPolyfill.prototype.populateDevices=function(){if(!this.devicesPopulated){var e=null;this.isCardboardCompatible()&&(e=new CardboardVRDisplay,this.connectDisplay(e),window.WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new VRDisplayHMDDevice(e)),this.devices.push(new VRDisplayPositionSensorDevice(e)))),this.isMobile()||window.WebVRConfig.MOUSE_KEYBOARD_CONTROLS_DISABLED||(e=new MouseKeyboardVRDisplay,this.connectDisplay(e),window.WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new VRDisplayHMDDevice(e)),this.devices.push(new VRDisplayPositionSensorDevice(e)))),this.devicesPopulated=!0}},WebVRPolyfill.prototype.enablePolyfill=function(){if(navigator.getVRDisplays=this.getVRDisplays.bind(this),this.nativeWebVRAvailable&&window.VRFrameData){var e=window.VRFrameData,i=new window.VRFrameData,t=window.VRDisplay.prototype.getFrameData;window.VRFrameData=VRFrameData,window.VRDisplay.prototype.getFrameData=function(a){if(a instanceof e)return void t.call(this,a);t.call(this,i),a.pose=i.pose,Util.copyArray(i.leftProjectionMatrix,a.leftProjectionMatrix),Util.copyArray(i.rightProjectionMatrix,a.rightProjectionMatrix),Util.copyArray(i.leftViewMatrix,a.leftViewMatrix),Util.copyArray(i.rightViewMatrix,a.rightViewMatrix)}}if(window.VRDisplay=VRDisplay,navigator&&!navigator.vrEnabled){var a=this;Object.defineProperty(navigator,"vrEnabled",{get:function(){return a.isCardboardCompatible()&&(a.isFullScreenAvailable()||Util.isIOS())}})}"VRFrameData"in window||(window.VRFrameData=VRFrameData)},WebVRPolyfill.prototype.enableDeprecatedPolyfill=function(){navigator.getVRDevices=this.getVRDevices.bind(this),window.HMDVRDevice=HMDVRDevice,window.PositionSensorVRDevice=PositionSensorVRDevice},WebVRPolyfill.prototype.getVRDisplays=function(){this.populateDevices();var e=this.displays;if(!this.nativeWebVRAvailable)return Promise.resolve(e);var i,t=this.nativeGetVRDisplaysFunc.call(navigator),a=new Promise(function(e){i=setTimeout(function(){console.warn("Native WebVR implementation detected, but `getVRDisplays()` failed to resolve. Falling back to polyfill."),e([])},window.WebVRConfig.GET_VR_DISPLAYS_TIMEOUT)});return Util.race([t,a]).then(function(t){return clearTimeout(i),window.WebVRConfig.ALWAYS_APPEND_POLYFILL_DISPLAY?t.concat(e):t.length>0?t:e})},WebVRPolyfill.prototype.getVRDevices=function(){console.warn("getVRDevices is deprecated. Please update your code to use getVRDisplays instead.");var e=this;return new Promise(function(i,t){try{if(!e.devicesPopulated){if(e.nativeWebVRAvailable)return navigator.getVRDisplays(function(t){for(var a=0;a<t.length;++a)e.devices.push(new VRDisplayHMDDevice(t[a])),e.devices.push(new VRDisplayPositionSensorDevice(t[a]));e.devicesPopulated=!0,i(e.devices)},t);if(e.nativeLegacyWebVRAvailable)return(navigator.getVRDDevices||navigator.mozGetVRDevices)(function(t){for(var a=0;a<t.length;++a)t[a]instanceof HMDVRDevice&&e.devices.push(t[a]),t[a]instanceof PositionSensorVRDevice&&e.devices.push(t[a]);e.devicesPopulated=!0,i(e.devices)},t)}e.populateDevices(),i(e.devices)}catch(e){t(e)}})},WebVRPolyfill.prototype.NativeVRFrameData=window.VRFrameData,WebVRPolyfill.prototype.isMobile=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},WebVRPolyfill.prototype.isCardboardCompatible=function(){return this.isMobile()||window.WebVRConfig.FORCE_ENABLE_VR},WebVRPolyfill.prototype.isFullScreenAvailable=function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||!1},WebVRPolyfill.InstallWebVRSpecShim=InstallWebVRSpecShim,WebVRPolyfill.version=version,module.exports.WebVRPolyfill=WebVRPolyfill;
186
+ },{"../package.json":47,"./base.js":48,"./cardboard-vr-display.js":51,"./display-wrappers.js":54,"./mouse-keyboard-vr-display.js":60,"./util.js":68}],72:[function(_dereq_,module,exports){
187
+ function idxOf(e,n,r,t){var i=e.indexOf(n,r);return-1===i||i>t?t:i}function isWhitespace(e){return whitespace.test(e)}function pre(e,n,r,t,i){for(var a=[],o=r,s=r;s<t&&s<n.length;s++){var h=n.charAt(s),u=newline.test(h);if(u||s===t-1){var f=u?s:s+1,p=e(n,o,f,i);a.push(p),o=s+1}}return a}function greedy(e,n,r,t,i,a){var o=[],s=i;for("nowrap"===a&&(s=Number.MAX_VALUE);r<t&&r<n.length;){for(var h=idxOf(n,newlineChar,r,t);r<h&&isWhitespace(n.charAt(r));)r++;var u=e(n,r,h,s),f=r+(u.end-u.start),p=f+newlineChar.length;if(f<h){for(;f>r&&!isWhitespace(n.charAt(f));)f--;if(f===r)p>r+newlineChar.length&&p--,f=p;else for(p=f;f>r&&isWhitespace(n.charAt(f-newlineChar.length));)f--}if(f>=r){var c=e(n,r,f,s);o.push(c)}r=p}return o}function monospace(e,n,r,t){return{start:n,end:n+Math.min(t,r-n)}}var newline=/\n/,newlineChar="\n",whitespace=/\s/;module.exports=function(e,n){return module.exports.lines(e,n).map(function(n){return e.substring(n.start,n.end)}).join("\n")},module.exports.lines=function(e,n){if(n=n||{},0===n.width&&"nowrap"!==n.mode)return[];e=e||"";var r="number"==typeof n.width?n.width:Number.MAX_VALUE,t=Math.max(0,n.start||0),i="number"==typeof n.end?n.end:e.length,a=n.mode,o=n.measure||monospace;return"pre"===a?pre(o,e,t,i,r):greedy(o,e,t,i,r,a)};
188
+ },{}],73:[function(_dereq_,module,exports){
189
+ "use strict";function forEachArray(e,t){for(var r=0;r<e.length;r++)t(e[r])}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function initParams(e,t,r){var n=e;return isFunction(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=xtend(t,{uri:e}),n.callback=r,n}function createXHR(e,t,r){return t=initParams(e,t,r),_createXHR(t)}function _createXHR(e){function t(){4===i.readyState&&setTimeout(o,0)}function r(){var e=void 0;if(e=i.response?i.response:i.responseText||getXml(i),X)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(d),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,h)}function o(){if(!c){var t;clearTimeout(d),t=e.useXDR&&void 0===i.status?200:1223===i.status?204:i.status;var n=h,o=null;return 0!==t?(n={body:r(),statusCode:t,method:l,headers:{},url:p,rawRequest:i},i.getAllResponseHeaders&&(n.headers=parseHeaders(i.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),a(o,n,n.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var s=!1,a=function(t,r,n){s||(s=!0,e.callback(t,r,n))},i=e.xhr||null;i||(i=e.cors||e.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var u,c,d,p=i.url=e.uri||e.url,l=i.method=e.method||"GET",f=e.body||e.data,m=i.headers=e.headers||{},R=!!e.sync,X=!1,h={body:void 0,headers:{},statusCode:0,method:l,url:p,rawRequest:i};if("json"in e&&!1!==e.json&&(X=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==l&&"HEAD"!==l&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),i.onreadystatechange=t,i.onload=o,i.onerror=n,i.onprogress=function(){},i.onabort=function(){c=!0},i.ontimeout=n,i.open(l,p,!R,e.username,e.password),R||(i.withCredentials=!!e.withCredentials),!R&&e.timeout>0&&(d=setTimeout(function(){if(!c){c=!0,i.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}},e.timeout)),i.setRequestHeader)for(u in m)m.hasOwnProperty(u)&&i.setRequestHeader(u,m[u]);else if(e.headers&&!isEmpty(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(i.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(i),i.send(f||null),i}function getXml(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function noop(){}var window=_dereq_("global/window"),isFunction=_dereq_("is-function"),parseHeaders=_dereq_("parse-headers"),xtend=_dereq_("xtend");module.exports=createXHR,createXHR.XMLHttpRequest=window.XMLHttpRequest||noop,createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:window.XDomainRequest,forEachArray(["get","put","post","patch","head","delete"],function(e){createXHR["delete"===e?"del":e]=function(t,r,n){return r=initParams(t,r,n),r.method=e.toUpperCase(),_createXHR(r)}});
190
+ },{"global/window":17,"is-function":21,"parse-headers":31,"xtend":75}],74:[function(_dereq_,module,exports){
191
+ module.exports=function(){return void 0!==self.DOMParser?function(e){return(new self.DOMParser).parseFromString(e,"application/xml")}:void 0!==self.ActiveXObject&&new self.ActiveXObject("Microsoft.XMLDOM")?function(e){var n=new self.ActiveXObject("Microsoft.XMLDOM");return n.async="false",n.loadXML(e),n}:function(e){var n=document.createElement("div");return n.innerHTML=e,n}}();
192
+ },{}],75:[function(_dereq_,module,exports){
193
+ function extend(){for(var r={},e=0;e<arguments.length;e++){var t=arguments[e];for(var n in t)hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;
194
+ },{}],76:[function(_dereq_,module,exports){
195
+ module.exports={"name":"aframe","version":"0.6.1","description":"A web framework for building virtual reality experiences.","homepage":"https://aframe.io/","main":"dist/aframe-master.js","scripts":{"browserify":"browserify src/index.js -s 'AFRAME' -p browserify-derequire","build":"shx mkdir -p build/ && npm run browserify -- --debug -t [envify --INSPECTOR_VERSION dev] -o build/aframe.js","codecov":"codecov","dev":"npm run build && cross-env INSPECTOR_VERSION=dev node ./scripts/budo -t envify","dist":"node scripts/updateVersionLog.js && npm run dist:min && npm run dist:max","dist:max":"npm run browserify -s -- --debug | exorcist dist/aframe.js.map > dist/aframe.js","dist:min":"npm run browserify -s -- --debug -p [minifyify --map aframe.min.js.map --output dist/aframe.min.js.map] -o dist/aframe.min.js","docs":"markserv --dir docs --port 9001","preghpages":"node ./scripts/preghpages.js","ghpages":"ghpages -p gh-pages/","lint":"semistandard -v | snazzy","lint:fix":"semistandard --fix","precommit":"npm run lint","prerelease":"node scripts/release.js 0.6.0 0.6.1","start":"npm run dev","test":"karma start ./tests/karma.conf.js","test:docs":"node scripts/docsLint.js","test:firefox":"npm test -- --browsers Firefox","test:chrome":"npm test -- --browsers Chrome","test:node":"mocha --ui tdd tests/node"},"repository":"aframevr/aframe","license":"MIT","dependencies":{"@tweenjs/tween.js":"^16.8.0","browserify-css":"^0.8.2","debug":"ngokevin/debug#noTimestamp","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7","envify":"^3.4.1","load-bmfont":"^1.2.3","object-assign":"^4.0.1","present":"0.0.6","promise-polyfill":"^3.1.0","style-attr":"^1.0.2","three":"^0.84.0","three-bmfont-text":"^2.1.0","webvr-polyfill":"^0.9.36"},"devDependencies":{"browserify":"^13.1.0","browserify-derequire":"^0.9.4","browserify-istanbul":"^2.0.0","budo":"^9.2.0","chai":"^3.5.0","chai-shallow-deep-equal":"^1.4.0","chalk":"^1.1.3","codecov":"^1.0.1","cross-env":"^5.0.1","exorcist":"^0.4.0","ghpages":"0.0.8","git-rev":"^0.2.1","glob":"^7.1.1","husky":"^0.11.7","istanbul":"^0.4.5","jsdom":"^9.11.0","karma":"1.4.1","karma-browserify":"^5.1.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^2.0.0","karma-coverage":"^1.1.1","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.0.0","karma-mocha":"^1.1.1","karma-mocha-reporter":"^2.1.0","karma-sinon-chai":"1.2.4","lolex":"^1.5.1","markserv":"0.0.20","minifyify":"^7.3.3","mocha":"^3.0.2","mozilla-download":"^1.1.1","replace-in-file":"^2.5.3","semistandard":"^9.0.0","shelljs":"^0.7.7","shx":"^0.2.2","sinon":"^1.17.5","sinon-chai":"2.8.0","snazzy":"^5.0.0","too-wordy":"ngokevin/too-wordy","uglifyjs":"^2.4.10","write-good":"^0.9.1"},"link":true,"browserify":{"transform":["browserify-css","envify"]},"semistandard":{"ignore":["build/**","dist/**","examples/**/shaders/*.js","**/vendor/**"]},"keywords":["3d","aframe","cardboard","components","oculus","three","three.js","rift","vive","vr","web-components","webvr"],"browserify-css":{"minify":true},"engines":{"node":">= 4.6.0","npm":"^2.15.9"}}
196
+ },{}],77:[function(_dereq_,module,exports){
197
+ var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,checkHasPositionalTracking=utils.device.checkHasPositionalTracking;module.exports.Component=registerComponent("camera",{schema:{active:{default:!0},far:{default:1e4},fov:{default:80,min:0},near:{default:.005,min:0},userHeight:{default:0,min:0},zoom:{default:1,min:0}},init:function(){var t,e=this.el,i=e.sceneEl;this.savedPose=null,t=this.camera=new THREE.PerspectiveCamera,e.setObject3D("camera",t),this.onEnterVR=bind(this.onEnterVR,this),this.onExitVR=bind(this.onExitVR,this),i.addEventListener("enter-vr",this.onEnterVR),i.addEventListener("exit-vr",this.onExitVR)},update:function(t){var e=this.el,i=this.data,s=this.camera,a=this.system;this.addHeightOffset(t.userHeight),s.aspect=i.aspect||window.innerWidth/window.innerHeight,s.far=i.far,s.fov=i.fov,s.near=i.near,s.zoom=i.zoom,s.updateProjectionMatrix(),t&&t.active===i.active||(i.active&&a.activeCameraEl!==e?a.setActiveCamera(e):i.active||a.activeCameraEl!==e||a.disableActiveCamera())},remove:function(){var t=this.el.sceneEl;this.el.removeObject3D("camera"),t.removeEventListener("enter-vr",this.onEnterVR),t.removeEventListener("exit-vr",this.onExitVR)},onEnterVR:function(){this.saveCameraPose(),this.removeHeightOffset()},onExitVR:function(){this.restoreCameraPose()},addHeightOffset:function(t){var e,i=this.el,s=this.data.userHeight;t=t||0,e=i.getAttribute("position")||{x:0,y:0,z:0},i.setAttribute("position",{x:e.x,y:e.y-t+s,z:e.z})},removeHeightOffset:function(){var t,e,i=this.el,s=this.data.userHeight;e=void 0!==this.hasPositionalTracking?this.hasPositionalTracking:checkHasPositionalTracking(),s&&e&&(t=i.getAttribute("position")||{x:0,y:0,z:0},i.setAttribute("position",{x:t.x,y:t.y-s,z:t.z}))},saveCameraPose:function(){var t=this.el,e=void 0!==this.hasPositionalTracking?this.hasPositionalTracking:checkHasPositionalTracking();!this.savedPose&&e&&(this.savedPose={position:t.getAttribute("position"),rotation:t.getAttribute("rotation")})},restoreCameraPose:function(){var t=this.el,e=this.savedPose,i=void 0!==this.hasPositionalTracking?this.hasPositionalTracking:checkHasPositionalTracking();e&&i&&(t.setAttribute("position",e.position),t.setAttribute("rotation",e.rotation),this.savedPose=null)}});
198
+ },{"../core/component":125,"../lib/three":173,"../utils/":196}],78:[function(_dereq_,module,exports){
199
+ var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("collada-model",{schema:{type:"asset"},init:function(){this.model=null,this.loader=new THREE.ColladaLoader,this.loader.options.convertUpAxis=!0},update:function(){var e=this,o=this.el,t=this.data;t&&(this.remove(),this.loader.load(t,function(t){e.model=t.scene,o.setObject3D("mesh",e.model),o.emit("model-loaded",{format:"collada",model:e.model})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}});
200
+ },{"../core/component":125,"../lib/three":173}],79:[function(_dereq_,module,exports){
201
+ var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/"),bind=utils.bind,EVENTS={CLICK:"click",FUSING:"fusing",MOUSEENTER:"mouseenter",MOUSEDOWN:"mousedown",MOUSELEAVE:"mouseleave",MOUSEUP:"mouseup"},STATES={FUSING:"cursor-fusing",HOVERING:"cursor-hovering",HOVERED:"cursor-hovered"};module.exports.Component=registerComponent("cursor",{dependencies:["raycaster"],schema:{downEvents:{default:[]},fuse:{default:utils.device.isMobile()},fuseTimeout:{default:1500,min:0},upEvents:{default:[]},rayOrigin:{default:"entity",oneOf:["mouse","entity"]}},init:function(){this.fuseTimeout=void 0,this.cursorDownEl=null,this.intersection=null,this.intersectedEl=null,this.onCursorDown=bind(this.onCursorDown,this),this.onCursorUp=bind(this.onCursorUp,this),this.onIntersection=bind(this.onIntersection,this),this.onIntersectionCleared=bind(this.onIntersectionCleared,this),this.onMouseMove=bind(this.onMouseMove,this)},update:function(e){this.data.rayOrigin!==e.rayOrigin&&this.updateMouseEventListeners()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){var e=this.el;e.removeState(STATES.HOVERING),e.removeState(STATES.FUSING),clearTimeout(this.fuseTimeout),this.intersectedEl&&this.intersectedEl.removeState(STATES.HOVERED),this.removeEventListeners()},addEventListeners:function(){var e,t=this.data,n=this.el,i=this;e=n.sceneEl.canvas,e?(e.addEventListener("mousedown",this.onCursorDown),e.addEventListener("mouseup",this.onCursorUp)):n.sceneEl.addEventListener("render-target-loaded",function(){e=n.sceneEl.canvas,e.addEventListener("mousedown",i.onCursorDown),e.addEventListener("mouseup",i.onCursorUp)}),t.downEvents.forEach(function(e){n.addEventListener(e,i.onCursorDown)}),t.upEvents.forEach(function(e){n.addEventListener(e,i.onCursorUp)}),n.addEventListener("raycaster-intersection",this.onIntersection),n.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared)},removeEventListeners:function(){var e,t=this.data,n=this.el,i=this;e=n.sceneEl.canvas,e&&(e.removeEventListener("mousedown",this.onCursorDown),e.removeEventListener("mouseup",this.onCursorUp)),t.downEvents.forEach(function(e){n.removeEventListener(e,i.onCursorDown)}),t.upEvents.forEach(function(e){n.removeEventListener(e,i.onCursorUp)}),n.removeEventListener("raycaster-intersection",this.onIntersection),n.removeEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),window.removeEventListener("mousemove",this.onMouseMove)},updateMouseEventListeners:function(){var e=this.el;window.removeEventListener("mousemove",this.onMouseMove),e.setAttribute("raycaster","useWorldCoordinates",!1),"mouse"===this.data.rayOrigin&&(window.addEventListener("mousemove",this.onMouseMove,!1),e.setAttribute("raycaster","useWorldCoordinates",!0))},onMouseMove:function(){var e=new THREE.Vector2,t=new THREE.Vector3,n=new THREE.Vector3,i={origin:t,direction:n};return function(s){var o=this.el.sceneEl.camera;o.parent.updateMatrixWorld(),o.updateMatrixWorld(),e.x=s.clientX/window.innerWidth*2-1,e.y=-s.clientY/window.innerHeight*2+1,t.setFromMatrixPosition(o.matrixWorld),n.set(e.x,e.y,.5).unproject(o).sub(t).normalize(),this.el.setAttribute("raycaster",i)}}(),onCursorDown:function(e){this.twoWayEmit(EVENTS.MOUSEDOWN),this.cursorDownEl=this.intersectedEl},onCursorUp:function(e){this.twoWayEmit(EVENTS.MOUSEUP),this.cursorDownEl&&this.cursorDownEl!==this.intersectedEl&&this.cursorDownEl.emit(EVENTS.MOUSEUP,{cursorEl:this.el,intersection:null}),!this.data.fuse&&this.intersectedEl&&this.cursorDownEl===this.intersectedEl&&this.twoWayEmit(EVENTS.CLICK),this.cursorDownEl=null},onIntersection:function(e){var t,n,i,s=this,o=this.el,r=this.data;if(t=e.detail.els[0]===o?1:0,i=e.detail.intersections[t],n=e.detail.els[t]){if(this.intersectedEl===n)return void(this.intersection=i);this.intersectedEl&&this.clearCurrentIntersection(),this.intersection=i,this.intersectedEl=n,o.addState(STATES.HOVERING),n.addState(STATES.HOVERED),s.twoWayEmit(EVENTS.MOUSEENTER),0!==r.fuseTimeout&&r.fuse&&(o.addState(STATES.FUSING),this.twoWayEmit(EVENTS.FUSING),this.fuseTimeout=setTimeout(function(){o.removeState(STATES.FUSING),s.twoWayEmit(EVENTS.CLICK)},r.fuseTimeout))}},onIntersectionCleared:function(e){var t=this.el,n=e.detail.el;t!==n&&n===this.intersectedEl&&this.clearCurrentIntersection()},clearCurrentIntersection:function(){var e=this.el;this.intersectedEl.removeState(STATES.HOVERED),e.removeState(STATES.HOVERING),e.removeState(STATES.FUSING),this.twoWayEmit(EVENTS.MOUSELEAVE),this.intersection=null,this.intersectedEl=null,clearTimeout(this.fuseTimeout)},twoWayEmit:function(e){var t=this.el,n=this.intersectedEl,i=this.intersection;t.emit(e,{intersectedEl:n,intersection:i}),n&&n.emit(e,{cursorEl:t,intersection:i})}});
202
+ },{"../core/component":125,"../utils/":196}],80:[function(_dereq_,module,exports){
203
+ var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),checkControllerPresentAndSetup=_dereq_("../utils/tracked-controls").checkControllerPresentAndSetup,emitIfAxesChanged=_dereq_("../utils/tracked-controls").emitIfAxesChanged,DAYDREAM_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/google/",DAYDREAM_CONTROLLER_MODEL_OBJ_URL=DAYDREAM_CONTROLLER_MODEL_BASE_URL+"vr_controller_daydream.obj",DAYDREAM_CONTROLLER_MODEL_OBJ_MTL=DAYDREAM_CONTROLLER_MODEL_BASE_URL+"vr_controller_daydream.mtl",GAMEPAD_ID_PREFIX="Daydream Controller";module.exports.Component=registerComponent("daydream-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#000000"},buttonTouchedColor:{type:"color",default:"#777777"},buttonHighlightColor:{type:"color",default:"#FFFFFF"},model:{default:!0},rotationOffset:{default:0},armModel:{default:!0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","menu","system"]},axisLabels:["x","y","z","w"],bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=bind(this.removeControllersUpdateListener,this),this.onAxisMoved=bind(this.onAxisMoved,this),this.onGamepadConnectionEvent=bind(this.onGamepadConnectionEvent,this)},init:function(){var t=this;this.animationActive="pointing",this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){t.onButtonEvent(e.detail.id,"down")},this.onButtonUp=function(e){t.onButtonEvent(e.detail.id,"up")},this.onButtonTouchStart=function(e){t.onButtonEvent(e.detail.id,"touchstart")},this.onButtonTouchEnd=function(e){t.onButtonEvent(e.detail.id,"touchend")},this.onAxisMoved=bind(this.onAxisMoved,this),this.controllerPresent=!1,this.everGotGamepadEvent=!1,this.lastControllerCheck=0,this.bindMethods(),this.checkControllerPresentAndSetup=checkControllerPresentAndSetup,this.emitIfAxesChanged=emitIfAxesChanged},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("model-loaded",this.onModelLoaded),t.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("model-loaded",this.onModelLoaded),t.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand})},onGamepadConnectionEvent:function(t){this.everGotGamepadEvent=!0,this.checkIfControllerPresent()},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener(),window.addEventListener("gamepadconnected",this.onGamepadConnectionEvent,!1),window.addEventListener("gamepaddisconnected",this.onGamepadConnectionEvent,!1)},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener(),window.removeEventListener("gamepadconnected",this.onGamepadConnectionEvent,!1),window.removeEventListener("gamepaddisconnected",this.onGamepadConnectionEvent,!1)},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,hand:e.hand,rotationOffset:e.rotationOffset,armModel:e.armModel}),this.data.model&&this.el.setAttribute("obj-model",{obj:DAYDREAM_CONTROLLER_MODEL_OBJ_URL,mtl:DAYDREAM_CONTROLLER_MODEL_OBJ_MTL})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.everGotGamepadEvent||this.checkIfControllerPresent()},onModelLoaded:function(t){var e,n=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.menu=n.getObjectByName("AppButton_AppButton_Cylinder.004"),e.system=n.getObjectByName("HomeButton_HomeButton_Cylinder.005"),e.trackpad=n.getObjectByName("TouchPad_TouchPad_Cylinder.003"),n.position.set(0,0,-.04))},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping.axes,t)},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},onButtonEvent:function(t,e){var n,o=this.mapping.buttons[t];if(Array.isArray(o))for(n=0;n<o.length;n++)this.el.emit(o[n]+e);else this.el.emit(o+e);this.updateModel(o,e)},updateModel:function(t,e){var n;if(this.data.model)if(Array.isArray(t))for(n=0;n<t.length;n++)this.updateButtonModel(t[n],e);else this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var n=this.buttonMeshes;if(n&&n[t]){var o;switch(e){case"down":o=this.data.buttonHighlightColor;break;case"touchstart":o=this.data.buttonTouchedColor;break;default:o=this.data.buttonColor}n[t].material.color.set(o)}}});
204
+ },{"../core/component":125,"../utils/bind":190,"../utils/tracked-controls":200}],81:[function(_dereq_,module,exports){
205
+ var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),checkControllerPresentAndSetup=_dereq_("../utils/tracked-controls").checkControllerPresentAndSetup,emitIfAxesChanged=_dereq_("../utils/tracked-controls").emitIfAxesChanged,GEARVR_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/samsung/",GEARVR_CONTROLLER_MODEL_OBJ_URL=GEARVR_CONTROLLER_MODEL_BASE_URL+"gear_vr_controller.obj",GEARVR_CONTROLLER_MODEL_OBJ_MTL=GEARVR_CONTROLLER_MODEL_BASE_URL+"gear_vr_controller.mtl",GAMEPAD_ID_PREFIX="Gear VR";module.exports.Component=registerComponent("gearvr-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#000000"},buttonTouchedColor:{type:"color",default:"#777777"},buttonHighlightColor:{type:"color",default:"#FFFFFF"},model:{default:!0},rotationOffset:{default:0},armModel:{default:!0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","trigger"]},axisLabels:["x","y","z","w"],bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=bind(this.removeControllersUpdateListener,this),this.onAxisMoved=bind(this.onAxisMoved,this),this.onGamepadConnectionEvent=bind(this.onGamepadConnectionEvent,this)},init:function(){var t=this;this.animationActive="pointing",this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){t.onButtonEvent(e.detail.id,"down")},this.onButtonUp=function(e){t.onButtonEvent(e.detail.id,"up")},this.onButtonTouchStart=function(e){t.onButtonEvent(e.detail.id,"touchstart")},this.onButtonTouchEnd=function(e){t.onButtonEvent(e.detail.id,"touchend")},this.onAxisMoved=bind(this.onAxisMoved,this),this.controllerPresent=!1,this.everGotGamepadEvent=!1,this.lastControllerCheck=0,this.bindMethods(),this.checkControllerPresentAndSetup=checkControllerPresentAndSetup,this.emitIfAxesChanged=emitIfAxesChanged},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("model-loaded",this.onModelLoaded),t.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0,this.addControllersUpdateListener()},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("model-loaded",this.onModelLoaded),t.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1,this.removeControllersUpdateListener()},checkIfControllerPresent:function(){this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,this.data.hand?{hand:this.data.hand}:{})},onGamepadConnectionEvent:function(t){this.checkIfControllerPresent()},play:function(){this.checkIfControllerPresent(),window.addEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener(),window.removeEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1)},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,rotationOffset:e.rotationOffset,armModel:e.armModel}),this.data.model&&this.el.setAttribute("obj-model",{obj:GEARVR_CONTROLLER_MODEL_OBJ_URL,mtl:GEARVR_CONTROLLER_MODEL_OBJ_MTL})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onModelLoaded:function(t){var e,n=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.trigger=n.getObjectByName("Trigger"),e.trackpad=n.getObjectByName("Touchpad"))},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},onButtonEvent:function(t,e){var n,o=this.mapping.buttons[t];if(Array.isArray(o))for(n=0;n<o.length;n++)this.el.emit(o[n]+e);else this.el.emit(o+e);this.updateModel(o,e)},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){var n;if(this.data.model)if(Array.isArray(t))for(n=0;n<t.length;n++)this.updateButtonModel(t[n],e);else this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var n=this.buttonMeshes;if(n&&n[t]){var o;switch(e){case"down":o=this.data.buttonHighlightColor;break;case"touchstart":o=this.data.buttonTouchedColor;break;default:o=this.data.buttonColor}n[t].material.color.set(o)}}});
206
+ },{"../core/component":125,"../utils/bind":190,"../utils/tracked-controls":200}],82:[function(_dereq_,module,exports){
207
+ var debug=_dereq_("../utils/debug"),geometries=_dereq_("../core/geometry").geometries,geometryNames=_dereq_("../core/geometry").geometryNames,registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),dummyGeometry=new THREE.Geometry,warn=debug("components:geometry:warn");module.exports.Component=registerComponent("geometry",{schema:{buffer:{default:!0},mergeTo:{type:"selector"},primitive:{default:"box",oneOf:geometryNames},skipCache:{default:!1}},init:function(){this.geometry=null},update:function(e){var t=this.data,r=this.el.getOrCreateObject3D("mesh",THREE.Mesh),o=this.system;this.geometry&&(o.unuseGeometry(e),this.geometry=null),this.geometry=r.geometry=o.getOrCreateGeometry(t),t.mergeTo&&this.mergeTo(t.mergeTo)},mergeTo:function(e){var t,r=this.el,o=r.getObject3D("mesh");return e&&e.isEntity?e===r?void warn("Source and target geometries cannot be the same for merge"):(t=e.getObject3D("mesh"))?t.geometry instanceof THREE.Geometry==!1||o.geometry instanceof THREE.Geometry==!1?void warn("Geometry merge is only available for `THREE.Geometry` types. Check that both of the merging geometry and the target geometry have `buffer` set to false"):!1===this.data.skipCache?void warn("Cached geometries are not allowed to merge. Set `skipCache` to true"):(o.parent.updateMatrixWorld(),t.geometry.merge(o.geometry,o.matrixWorld),r.emit("geometry-merged",{mergeTarget:e}),void r.parentNode.removeChild(r)):(t=e.getOrCreateObject3D("mesh",THREE.Mesh),void e.setAttribute("material",r.getAttribute("material"))):void warn("There is not a valid entity to merge the geometry to")},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=dummyGeometry,this.geometry=null},updateSchema:function(e){var t=e.primitive,r=this.data&&this.data.primitive,o=geometries[t]&&geometries[t].schema;if(!o)throw new Error("Unknown geometry schema `"+t+"`");r&&r===t||this.extendSchema(o)}});
208
+ },{"../core/component":125,"../core/geometry":126,"../lib/three":173,"../utils/debug":192}],83:[function(_dereq_,module,exports){
209
+ var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("gltf-model",{schema:{type:"model"},init:function(){this.model=null,this.loader=new THREE.GLTFLoader},update:function(){var e=this,o=this.el,t=this.data;t&&(this.remove(),this.loader.load(t,function(t){e.model=t.scene||t.scenes[0],e.model.animations=t.animations,e.system.registerModel(e.model),o.setObject3D("mesh",e.model),o.emit("model-loaded",{format:"gltf",model:e.model})}))},remove:function(){this.model&&(this.el.removeObject3D("mesh"),this.system.unregisterModel(this.model))}});
210
+ },{"../core/component":125,"../lib/three":173}],84:[function(_dereq_,module,exports){
211
+ function getGestureEventName(t,n){var e;if(t)return e=EVENTS[t],"grip"===e?e+(n?"close":"open"):"point"===e||"thumb"===e?e+(n?"up":"down"):"pointing"===e||"pistol"===e?e+(n?"start":"end"):void 0}function isOculusTouchController(t){var n=t&&t.controller&&t.controller.id;return n&&0===n.indexOf("Oculus Touch")}var registerComponent=_dereq_("../core/component").registerComponent,MODEL_URLS={left:"https://cdn.aframe.io/controllers/oculus-hands/v2/leftHand.json",right:"https://cdn.aframe.io/controllers/oculus-hands/v2/rightHand.json"},ANIMATIONS={open:"Open",point:"Point",pointThumb:"Point + Thumb",fist:"Fist",hold:"Hold",thumbUp:"Thumb Up"},EVENTS={};EVENTS[ANIMATIONS.fist]="grip",EVENTS[ANIMATIONS.thumbUp]="pistol",EVENTS[ANIMATIONS.point]="pointing",EVENTS[ANIMATIONS.thumb]="thumb",module.exports.Component=registerComponent("hand-controls",{schema:{default:"left"},init:function(){var t=this;this.gesture=ANIMATIONS.open,this.pressedButtons={},this.touchedButtons={},this.loader=new THREE.ObjectLoader,this.loader.setCrossOrigin("anonymous"),this.onGripDown=function(){t.handleButton("grip","down")},this.onGripUp=function(){t.handleButton("grip","up")},this.onTrackpadDown=function(){t.handleButton("trackpad","down")},this.onTrackpadUp=function(){t.handleButton("trackpad","up")},this.onTrackpadTouchStart=function(){t.handleButton("trackpad","touchstart")},this.onTrackpadTouchEnd=function(){t.handleButton("trackpad","touchend")},this.onTriggerDown=function(){t.handleButton("trigger","down")},this.onTriggerUp=function(){t.handleButton("trigger","up")},this.onTriggerTouchStart=function(){t.handleButton("trigger","touchstart")},this.onTriggerTouchEnd=function(){t.handleButton("trigger","touchend")},this.onGripTouchStart=function(){t.handleButton("grip","touchstart")},this.onGripTouchEnd=function(){t.handleButton("grip","touchend")},this.onThumbstickDown=function(){t.handleButton("thumbstick","down")},this.onThumbstickUp=function(){t.handleButton("thumbstick","up")},this.onAorXTouchStart=function(){t.handleButton("AorX","touchstart")},this.onAorXTouchEnd=function(){t.handleButton("AorX","touchend")},this.onBorYTouchStart=function(){t.handleButton("BorY","touchstart")},this.onBorYTouchEnd=function(){t.handleButton("BorY","touchend")},this.onSurfaceTouchStart=function(){t.handleButton("surface","touchstart")},this.onSurfaceTouchEnd=function(){t.handleButton("surface","touchend")}},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(t,n){var e=this.el.getObject3D("mesh");e&&e.mixer.update(n/1e3)},addEventListeners:function(){var t=this.el;t.addEventListener("gripdown",this.onGripDown),t.addEventListener("gripup",this.onGripUp),t.addEventListener("trackpaddown",this.onTrackpadDown),t.addEventListener("trackpadup",this.onTrackpadUp),t.addEventListener("trackpadtouchstart",this.onTrackpadTouchStart),t.addEventListener("trackpadtouchend",this.onTrackpadTouchEnd),t.addEventListener("triggerdown",this.onTriggerDown),t.addEventListener("triggerup",this.onTriggerUp),t.addEventListener("triggertouchstart",this.onTriggerTouchStart),t.addEventListener("triggertouchend",this.onTriggerTouchEnd),t.addEventListener("griptouchstart",this.onGripTouchStart),t.addEventListener("griptouchend",this.onGripTouchEnd),t.addEventListener("thumbstickdown",this.onThumbstickDown),t.addEventListener("thumbstickup",this.onThumbstickUp),t.addEventListener("abuttontouchstart",this.onAorXTouchStart),t.addEventListener("abuttontouchend",this.onAorXTouchEnd),t.addEventListener("bbuttontouchstart",this.onBorYTouchStart),t.addEventListener("bbuttontouchend",this.onBorYTouchEnd),t.addEventListener("xbuttontouchstart",this.onAorXTouchStart),t.addEventListener("xbuttontouchend",this.onAorXTouchEnd),t.addEventListener("ybuttontouchstart",this.onBorYTouchStart),t.addEventListener("ybuttontouchend",this.onBorYTouchEnd),t.addEventListener("surfacetouchstart",this.onSurfaceTouchStart),t.addEventListener("surfacetouchend",this.onSurfaceTouchEnd)},removeEventListeners:function(){var t=this.el;t.removeEventListener("gripdown",this.onGripDown),t.removeEventListener("gripup",this.onGripUp),t.removeEventListener("trackpaddown",this.onTrackpadDown),t.removeEventListener("trackpadup",this.onTrackpadUp),t.removeEventListener("trackpadtouchstart",this.onTrackpadTouchStart),t.removeEventListener("trackpadtouchend",this.onTrackpadTouchEnd),t.removeEventListener("triggerdown",this.onTriggerDown),t.removeEventListener("triggerup",this.onTriggerUp),t.removeEventListener("triggertouchstart",this.onTriggerTouchStart),t.removeEventListener("triggertouchend",this.onTriggerTouchEnd),t.removeEventListener("griptouchstart",this.onGripTouchStart),t.removeEventListener("griptouchend",this.onGripTouchEnd),t.removeEventListener("thumbstickdown",this.onThumbstickDown),t.removeEventListener("thumbstickup",this.onThumbstickUp),t.removeEventListener("abuttontouchstart",this.onAorXTouchStart),t.removeEventListener("abuttontouchend",this.onAorXTouchEnd),t.removeEventListener("bbuttontouchstart",this.onBorYTouchStart),t.removeEventListener("bbuttontouchend",this.onBorYTouchEnd),t.removeEventListener("xbuttontouchstart",this.onAorXTouchStart),t.removeEventListener("xbuttontouchend",this.onAorXTouchEnd),t.removeEventListener("ybuttontouchstart",this.onBorYTouchStart),t.removeEventListener("ybuttontouchend",this.onBorYTouchEnd),t.removeEventListener("surfacetouchstart",this.onSurfaceTouchStart),t.removeEventListener("surfacetouchend",this.onSurfaceTouchEnd)},update:function(t){var n,e=this.el,o=this.data;n={hand:o,model:!1,rotationOffset:"left"===o?90:-90},e.setAttribute("vive-controls",n),e.setAttribute("oculus-touch-controls",n),o!==t&&this.loader.load(MODEL_URLS[o],function(t){var n=t.getObjectByName("Hand");n.material.skinning=!0,n.mixer=new THREE.AnimationMixer(n),e.setObject3D("mesh",n)})},remove:function(){this.el.removeObject3D("mesh")},handleButton:function(t,n){var e,o="down"===n,r="touchstart"===n;if(0===n.indexOf("touch")){if(r===this.touchedButtons[t])return;this.touchedButtons[t]=r}else{if(o===this.pressedButtons[t])return;this.pressedButtons[t]=o}e=this.gesture,this.gesture=this.determineGesture(),this.gesture!==e&&(this.animateGesture(this.gesture,e),this.emitGestureEvents(this.gesture,e))},determineGesture:function(){var t,n=this.pressedButtons.grip,e=this.pressedButtons.surface||this.touchedButtons.surface,o=this.pressedButtons.trackpad||this.touchedButtons.trackpad,r=this.pressedButtons.trigger||this.touchedButtons.trigger,i=this.touchedButtons.AorX||this.touchedButtons.BorY,s=isOculusTouchController(this.el.components["tracked-controls"]);return n?t=s?e||i||o?r?ANIMATIONS.fist:ANIMATIONS.point:r?ANIMATIONS.thumbUp:ANIMATIONS.pointThumb:ANIMATIONS.fist:r?t=s?ANIMATIONS.hold:ANIMATIONS.fist:!s&&o&&(t=ANIMATIONS.point),t},animateGesture:function(t,n){if(t)return void this.playAnimation(t||ANIMATIONS.open,n,!1);this.playAnimation(n,n,!0)},emitGestureEvents:function(t,n){var e,o=this.el;n!==t&&(e=getGestureEventName(n,!1),e&&o.emit(e),(e=getGestureEventName(t,!0))&&o.emit(e))},playAnimation:function(t,n,e){var o,r,i=this.el.getObject3D("mesh");if(i){if(r=i.mixer.clipAction(t),r.clampWhenFinished=!0,r.loop=THREE.PingPong,r.repetitions=0,r.timeScale=e?-1:1,r.weight=1,!n||t===n)return i.mixer.stopAllAction(),void r.play();o=i.mixer.clipAction(n),i.mixer.stopAllAction(),o.weight=.15,o.play(),r.play(),o.crossFadeTo(r,.15,!0)}}});
212
+ },{"../core/component":125}],85:[function(_dereq_,module,exports){
213
+ _dereq_("./camera"),_dereq_("./collada-model"),_dereq_("./cursor"),_dereq_("./daydream-controls"),_dereq_("./gearvr-controls"),_dereq_("./geometry"),_dereq_("./gltf-model"),_dereq_("./hand-controls"),_dereq_("./laser-controls"),_dereq_("./light"),_dereq_("./line"),_dereq_("./link"),_dereq_("./look-controls"),_dereq_("./material"),_dereq_("./obj-model"),_dereq_("./oculus-touch-controls"),_dereq_("./position"),_dereq_("./raycaster"),_dereq_("./rotation"),_dereq_("./scale"),_dereq_("./shadow"),_dereq_("./sound"),_dereq_("./text"),_dereq_("./tracked-controls"),_dereq_("./visible"),_dereq_("./vive-controls"),_dereq_("./wasd-controls"),_dereq_("./scene/canvas"),_dereq_("./scene/debug"),_dereq_("./scene/embedded"),_dereq_("./scene/inspector"),_dereq_("./scene/fog"),_dereq_("./scene/keyboard-shortcuts"),_dereq_("./scene/pool"),_dereq_("./scene/screenshot"),_dereq_("./scene/stats"),_dereq_("./scene/vr-mode-ui");
214
+ },{"./camera":77,"./collada-model":78,"./cursor":79,"./daydream-controls":80,"./gearvr-controls":81,"./geometry":82,"./gltf-model":83,"./hand-controls":84,"./laser-controls":86,"./light":87,"./line":88,"./link":89,"./look-controls":90,"./material":91,"./obj-model":92,"./oculus-touch-controls":93,"./position":94,"./raycaster":95,"./rotation":96,"./scale":97,"./scene/canvas":98,"./scene/debug":99,"./scene/embedded":100,"./scene/fog":101,"./scene/inspector":102,"./scene/keyboard-shortcuts":103,"./scene/pool":104,"./scene/screenshot":105,"./scene/stats":106,"./scene/vr-mode-ui":107,"./shadow":108,"./sound":109,"./text":110,"./tracked-controls":111,"./visible":112,"./vive-controls":113,"./wasd-controls":114}],86:[function(_dereq_,module,exports){
215
+ var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/");registerComponent("laser-controls",{schema:{hand:{default:"right"}},init:function(){var t=this.config,r=this.data,e=this.el;e.setAttribute("daydream-controls",{hand:r.hand}),e.setAttribute("gearvr-controls",{hand:r.hand}),e.setAttribute("oculus-touch-controls",{hand:r.hand}),e.setAttribute("vive-controls",{hand:r.hand}),e.addEventListener("controllerconnected",function(r){var n=t[r.detail.name];n&&(e.setAttribute("raycaster",utils.extend({showLine:!0},n.raycaster||{})),e.setAttribute("cursor",utils.extend({fuse:!1},n.cursor)))})},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown"],upEvents:["trackpadup"]}},"gearvr-controls":{cursor:{downEvents:["trackpaddown"],upEvents:["trackpadup"]},raycaster:{origin:{x:0,y:5e-4,z:0}}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]},raycaster:{origin:{x:.001,y:0,z:.065},direction:{x:0,y:-.8,z:-1}}},"vive-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}}}});
216
+ },{"../core/component":125,"../utils/":196}],87:[function(_dereq_,module,exports){
217
+ var bind=_dereq_("../utils/bind"),diff=_dereq_("../utils").diff,debug=_dereq_("../utils/debug"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad,warn=debug("components:light:warn");module.exports.Component=registerComponent("light",{schema:{angle:{default:60,if:{type:["spot"]}},color:{type:"color"},groundColor:{type:"color",if:{type:["hemisphere"]}},decay:{default:1,if:{type:["point","spot"]}},distance:{default:0,min:0,if:{type:["point","spot"]}},intensity:{default:1,min:0,if:{type:["ambient","directional","hemisphere","point","spot"]}},penumbra:{default:0,min:0,max:1,if:{type:["spot"]}},type:{default:"directional",oneOf:["ambient","directional","hemisphere","point","spot"]},target:{type:"selector",if:{type:["spot","directional"]}},castShadow:{default:!1,if:{type:["point","spot","directional"]}},shadowBias:{default:0,if:{castShadow:!0}},shadowCameraFar:{default:500,if:{castShadow:!0}},shadowCameraFov:{default:90,if:{castShadow:!0}},shadowCameraNear:{default:.5,if:{castShadow:!0}},shadowCameraTop:{default:5,if:{castShadow:!0}},shadowCameraRight:{default:5,if:{castShadow:!0}},shadowCameraBottom:{default:-5,if:{castShadow:!0}},shadowCameraLeft:{default:-5,if:{castShadow:!0}},shadowCameraVisible:{default:!1,if:{castShadow:!0}},shadowMapHeight:{default:512,if:{castShadow:!0}},shadowMapWidth:{default:512,if:{castShadow:!0}}},init:function(){var e=this.el;this.light=null,this.defaultTarget=null,this.system.registerLight(e)},update:function(e){var a=this.data,t=diff(a,e),o=this.light,i=this;if(o&&!("type"in t)){var r=!1;return void Object.keys(t).forEach(function(e){var t=a[e];switch(e){case"color":o.color.set(t);break;case"groundColor":o.groundColor.set(t);break;case"angle":o.angle=degToRad(t);break;case"target":null===t?"spot"!==a.type&&"directional"!==a.type||(o.target=i.defaultTarget):t.hasLoaded?i.onSetTarget(t,o):t.addEventListener("loaded",bind(i.onSetTarget,i,t,o));break;case"castShadow":case"shadowBias":case"shadowCameraFar":case"shadowCameraFov":case"shadowCameraNear":case"shadowCameraTop":case"shadowCameraRight":case"shadowCameraBottom":case"shadowCameraLeft":case"shadowCameraVisible":case"shadowMapHeight":case"shadowMapWidth":r||(i.updateShadow(),r=!0);break;default:o[e]=t}})}this.setLight(this.data),this.updateShadow()},setLight:function(e){var a=this.el,t=this.getLight(e);t&&(this.light&&a.removeObject3D("light"),this.light=t,this.light.el=a,a.setObject3D("light",this.light),"spot"!==e.type&&"directional"!==e.type&&"hemisphere"!==e.type||a.getObject3D("light").translateY(-1),"spot"===e.type&&(a.setObject3D("light-target",this.defaultTarget),a.getObject3D("light-target").position.set(0,0,-1)))},updateShadow:function(){var e=this.el,a=this.data,t=this.light;t.castShadow=a.castShadow;var o=e.getObject3D("cameraHelper");if(a.shadowCameraVisible&&!o?e.setObject3D("cameraHelper",new THREE.CameraHelper(t.shadow.camera)):!a.shadowCameraVisible&&o&&e.removeObject3D("cameraHelper"),!a.castShadow)return t;t.shadow.bias=a.shadowBias,t.shadow.mapSize.height=a.shadowMapHeight,t.shadow.mapSize.width=a.shadowMapWidth,t.shadow.camera.near=a.shadowCameraNear,t.shadow.camera.far=a.shadowCameraFar,t.shadow.camera instanceof THREE.OrthographicCamera?(t.shadow.camera.top=a.shadowCameraTop,t.shadow.camera.right=a.shadowCameraRight,t.shadow.camera.bottom=a.shadowCameraBottom,t.shadow.camera.left=a.shadowCameraLeft):t.shadow.camera.fov=a.shadowCameraFov,t.shadow.camera.updateProjectionMatrix(),o&&o.update()},getLight:function(e){var a=e.angle,t=new THREE.Color(e.color).getHex(),o=e.decay,i=e.distance,r=new THREE.Color(e.groundColor).getHex(),s=e.intensity,d=e.type,h=e.target,n=null;switch(d.toLowerCase()){case"ambient":return new THREE.AmbientLight(t,s);case"directional":return n=new THREE.DirectionalLight(t,s),this.defaultTarget=n.target,h&&(h.hasLoaded?this.onSetTarget(h,n):h.addEventListener("loaded",bind(this.onSetTarget,this,h,n))),n;case"hemisphere":return new THREE.HemisphereLight(t,r,s);case"point":return new THREE.PointLight(t,s,i,o);case"spot":return n=new THREE.SpotLight(t,s,i,degToRad(a),e.penumbra,o),this.defaultTarget=n.target,h&&(h.hasLoaded?this.onSetTarget(h,n):h.addEventListener("loaded",bind(this.onSetTarget,this,h,n))),n;default:warn("%s is not a valid light type. Choose from ambient, directional, hemisphere, point, spot.",d)}},onSetTarget:function(e,a){a.target=e.object3D},remove:function(){var e=this.el;e.removeObject3D("light"),e.getObject3D("cameraHelper")&&e.removeObject3D("cameraHelper")}});
218
+ },{"../core/component":125,"../lib/three":173,"../utils":196,"../utils/bind":190,"../utils/debug":192}],88:[function(_dereq_,module,exports){
219
+ function isEqualVec3(t,e){return!(!t||!e)&&(t.x!==e.x||t.y!==e.y||t.z!==e.z)}var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("line",{schema:{start:{type:"vec3",default:{x:0,y:0,z:0}},end:{type:"vec3",default:{x:0,y:0,z:0}},color:{type:"color",default:"#74BEC1"},opacity:{type:"number",default:1},visible:{default:!0}},multiple:!0,init:function(){var t,e,i=this.data;e=this.material=new THREE.LineBasicMaterial({color:i.color,opacity:i.opacity,transparent:i.opacity<1,visible:i.visible}),t=this.geometry=new THREE.BufferGeometry,t.addAttribute("position",new THREE.BufferAttribute(new Float32Array(6),3)),this.line=new THREE.Line(t,e),this.el.setObject3D(this.attrName,this.line)},update:function(t){var e=this.data,i=this.geometry,r=!1,a=this.material,o=i.attributes.position.array;isEqualVec3(e.start,t.start)||(o[0]=e.start.x,o[1]=e.start.y,o[2]=e.start.z,r=!0),isEqualVec3(e.end,t.end)||(o[3]=e.end.x,o[4]=e.end.y,o[5]=e.end.z,r=!0),r&&(i.attributes.position.needsUpdate=!0,i.computeBoundingSphere()),a.color.setStyle(e.color),a.opacity=e.opacity,a.transparent=e.opacity<1,a.visible=e.visible},remove:function(){this.el.removeObject3D("line",this.line)}});
220
+ },{"../core/component":125}],89:[function(_dereq_,module,exports){
221
+ var registerComponent=_dereq_("../core/component").registerComponent,registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("link",{schema:{color:{default:"white",type:"color"},highlighted:{default:!1},highlightedColor:{default:"#24CAFF",type:"color"},href:{default:""},image:{type:"asset"},on:{default:"click"},peekMode:{default:!1},title:{default:""},visualAspectEnabled:{default:!0}},init:function(){this.navigate=this.navigate.bind(this),this.previousQuaternion=void 0,this.hiddenEls=[],this.initVisualAspect()},update:function(e){var t=this.data,i=this.el,r=t.highlighted?t.highlightedColor:t.color;i.setAttribute("material","strokeColor",r),t.on!==e.on&&this.updateEventListener(),t.peekMode!==e.peekMode&&this.updatePeekMode(),t.image&&e.image!==t.image&&i.setAttribute("material","pano","string"==typeof t.image?t.image:t.image.src)},updatePeekMode:function(){var e=this.el,t=this.sphereEl;this.data.peekMode?(this.hideAll(),e.getObject3D("mesh").visible=!1,t.setAttribute("visible",!0)):(this.showAll(),e.getObject3D("mesh").visible=!0,t.setAttribute("visible",!1))},play:function(){this.updateEventListener()},pause:function(){this.removeEventListener()},updateEventListener:function(){var e=this.el;e.isPlaying&&(this.removeEventListener(),e.addEventListener(this.data.on,this.navigate))},removeEventListener:function(){var e=this.data.on;e&&this.el.removeEventListener(e,this.navigate)},initVisualAspect:function(){var e,t,i,r=this.el;this.data.visualAspectEnabled&&(e=this.textEl=this.textEl||document.createElement("a-entity"),t=this.sphereEl=this.sphereEl||document.createElement("a-entity"),i=this.semiSphereEl=this.semiSphereEl||document.createElement("a-entity"),r.setAttribute("geometry",{primitive:"circle",radius:1,segments:64}),r.setAttribute("material",{shader:"portal",pano:this.data.image,side:"double"}),e.setAttribute("text",{color:"white",align:"center",font:"kelsonsans",value:this.data.title||this.data.href,width:4}),e.setAttribute("position","0 1.5 0"),r.appendChild(e),i.setAttribute("geometry",{primitive:"sphere",radius:1,phiStart:0,segmentsWidth:64,segmentsHeight:64,phiLength:180,thetaStart:0,thetaLength:360}),i.setAttribute("material",{shader:"portal",borderEnabled:0,pano:this.data.image,side:"back"}),i.setAttribute("rotation","0 180 0"),i.setAttribute("position","0 0 0"),i.setAttribute("visible",!1),r.appendChild(i),t.setAttribute("geometry",{primitive:"sphere",radius:10,segmentsWidth:64,segmentsHeight:64}),t.setAttribute("material",{shader:"portal",borderEnabled:0,pano:this.data.image,side:"back"}),t.setAttribute("visible",!1),r.appendChild(t))},navigate:function(){window.location=this.data.href},tick:function(){var e=new THREE.Vector3,t=new THREE.Vector3,i=new THREE.Vector3,r=new THREE.Quaternion;return function(){var o,a,s=this.el,n=s.object3D,l=s.sceneEl.camera,h=this.textEl;if(n.updateMatrixWorld(),l.parent.updateMatrixWorld(),l.updateMatrixWorld(),n.matrix.decompose(e,r,i),e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(l.matrixWorld),a=e.distanceTo(t),this.previousQuaternion=this.previousQuaternion||r.clone(),a>20)n.lookAt(t);else{if(o=this.calculateCameraPortalOrientation(),a<.5){if(!0===this.semiSphereEl.getAttribute("visible"))return;h.setAttribute("text","width",1.5),o<=0?(h.setAttribute("position","0 0 0.75"),h.setAttribute("rotation","0 180 0"),this.semiSphereEl.setAttribute("rotation","0 0 0")):(h.setAttribute("position","0 0 -0.75"),h.setAttribute("rotation","0 0 0"),this.semiSphereEl.setAttribute("rotation","0 180 0")),s.getObject3D("mesh").visible=!1,this.semiSphereEl.setAttribute("visible",!0),this.peekCameraPortalOrientation=o}else o<=0?h.setAttribute("rotation","0 180 0"):h.setAttribute("rotation","0 0 0"),h.setAttribute("text","width",5),h.setAttribute("position","0 1.5 0"),s.getObject3D("mesh").visible=!0,this.semiSphereEl.setAttribute("visible",!1),this.peekCameraPortalOrientation=void 0;this.previousQuaternion&&(n.quaternion.copy(this.previousQuaternion),this.previousQuaternion=void 0)}}}(),hideAll:function(){var e=this.el,t=this.hiddenEls,i=this;t.length>0||e.sceneEl.object3D.traverse(function(r){r&&r.el&&r.el.hasAttribute("link-controls")||r.el&&r!==e.sceneEl.object3D&&r.el!==e&&r.el!==i.sphereEl&&r.el!==e.sceneEl.cameraEl&&!1!==r.el.getAttribute("visible")&&r.el!==i.textEl&&r.el!==i.semiSphereEl&&(r.el.setAttribute("visible",!1),t.push(r.el))})},showAll:function(){this.hiddenEls.forEach(function(e){e.setAttribute("visible",!0)}),this.hiddenEls=[]},calculateCameraPortalOrientation:function(){var e=new THREE.Matrix4,t=new THREE.Vector3,i=new THREE.Vector3(0,0,1),r=new THREE.Vector3(0,0,0);return function(){var o=this.el,a=o.sceneEl.camera;return t.set(0,0,0),i.set(0,0,1),r.set(0,0,0),o.object3D.matrixWorld.extractRotation(e),i.applyMatrix4(e),o.object3D.updateMatrixWorld(),o.object3D.localToWorld(r),a.parent.parent.updateMatrixWorld(),a.parent.updateMatrixWorld(),a.updateMatrixWorld(),a.localToWorld(t),t.sub(r).normalize(),i.normalize(),Math.sign(i.dot(t))}}(),remove:function(){this.removeEventListener()}}),registerShader("portal",{schema:{pano:{type:"map",is:"uniform"},borderEnabled:{default:1,type:"int",is:"uniform"},strokeColor:{default:"white",type:"color",is:"uniform"}},vertexShader:["vec3 portalPosition;","varying vec3 vWorldPosition;","varying float vDistanceToCenter;","varying float vDistance;","void main() {","vDistanceToCenter = clamp(length(position - vec3(0.0, 0.0, 0.0)), 0.0, 1.0);","portalPosition = (modelMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz;","vDistance = length(portalPosition - cameraPosition);","vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI2 0.15915494","uniform sampler2D pano;","uniform vec3 strokeColor;","uniform float borderEnabled;","varying float vDistanceToCenter;","varying float vDistance;","varying vec3 vWorldPosition;","void main() {","vec3 direction = normalize(vWorldPosition - cameraPosition);","vec2 sampleUV;","float borderThickness = clamp(exp(-vDistance / 50.0), 0.6, 0.95);","sampleUV.y = saturate(direction.y * 0.5 + 0.5);","sampleUV.x = atan(direction.z, direction.x) * -RECIPROCAL_PI2 + 0.5;","if (vDistanceToCenter > borderThickness && borderEnabled == 1.0) {","gl_FragColor = vec4(strokeColor, 1.0);","} else {","gl_FragColor = mix(texture2D(pano, sampleUV), vec4(0.93, 0.17, 0.36, 1.0), clamp(pow((vDistance / 15.0), 2.0), 0.0, 1.0));","}","}"].join("\n")});
222
+ },{"../core/component":125,"../core/shader":134,"../lib/three":173}],90:[function(_dereq_,module,exports){
223
+ function isNullVector(t){return 0===t.x&&0===t.y&&0===t.z}var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),bind=_dereq_("../utils/bind"),GRABBING_CLASS="a-grabbing",PI_2=Math.PI/2,radToDeg=THREE.Math.radToDeg;module.exports.Component=registerComponent("look-controls",{dependencies:["position","rotation"],schema:{enabled:{default:!0},hmdEnabled:{default:!0},reverseMouseDrag:{default:!1},standing:{default:!0}},init:function(){var t=this.el.sceneEl;this.previousHMDPosition=new THREE.Vector3,this.hmdQuaternion=new THREE.Quaternion,this.hmdEuler=new THREE.Euler,this.setupMouseControls(),this.setupHMDControls(),this.bindMethods(),t.addEventListener("exit-vr",this.onExitVR)},update:function(t){var e=this.data;e.enabled!==t.enabled&&this.updateGrabCursor(e.enabled),!t||e.hmdEnabled||t.hmdEnabled||(this.pitchObject.rotation.set(0,0,0),this.yawObject.rotation.set(0,0,0))},tick:function(t){var e=this.data;e.enabled&&(this.controls.standing=e.standing,this.controls.update(),this.updateOrientation(),this.updatePosition())},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){this.removeEventListeners()},bindMethods:function(){this.onMouseDown=bind(this.onMouseDown,this),this.onMouseMove=bind(this.onMouseMove,this),this.onMouseUp=bind(this.onMouseUp,this),this.onTouchStart=bind(this.onTouchStart,this),this.onTouchMove=bind(this.onTouchMove,this),this.onTouchEnd=bind(this.onTouchEnd,this),this.onExitVR=bind(this.onExitVR,this)},setupMouseControls:function(){this.mouseDown=!1,this.pitchObject=new THREE.Object3D,this.yawObject=new THREE.Object3D,this.yawObject.position.y=10,this.yawObject.add(this.pitchObject)},setupHMDControls:function(){this.dolly=new THREE.Object3D,this.euler=new THREE.Euler,this.controls=new THREE.VRControls(this.dolly),this.controls.userHeight=0},addEventListeners:function(){var t=this.el.sceneEl,e=t.canvas;if(!e)return void t.addEventListener("render-target-loaded",bind(this.addEventListeners,this));e.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.onMouseUp,!1),e.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),window.addEventListener("touchend",this.onTouchEnd)},removeEventListeners:function(){var t=this.el.sceneEl,e=t&&t.canvas;e&&(e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mouseout",this.onMouseUp),e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd))},updateOrientation:function(){var t,e,o,n=this.hmdEuler,i=this.hmdQuaternion,s=this.pitchObject,r=this.yawObject,a=this.el.sceneEl;i=i.copy(this.dolly.quaternion),n.setFromQuaternion(i,"YXZ"),a.isMobile?o={x:radToDeg(n.x)+radToDeg(s.rotation.x),y:radToDeg(n.y)+radToDeg(r.rotation.y),z:radToDeg(n.z)}:a.is("vr-mode")&&!isNullVector(n)&&this.data.hmdEnabled?o={x:radToDeg(n.x),y:radToDeg(n.y),z:radToDeg(n.z)}:(t=this.el.getAttribute("rotation"),e=this.calculateDeltaRotation(),o=this.data.reverseMouseDrag?{x:t.x-e.x,y:t.y-e.y,z:t.z}:{x:t.x+e.x,y:t.y+e.y,z:t.z}),this.el.setAttribute("rotation",o)},calculateDeltaRotation:function(){var t,e=radToDeg(this.pitchObject.rotation.x),o=radToDeg(this.yawObject.rotation.y);return t={x:e-(this.previousRotationX||0),y:o-(this.previousRotationY||0)},this.previousRotationX=e,this.previousRotationY=o,t},updatePosition:function(){var t=new THREE.Vector3;return function(){var e,o=this.el,n=o.getAttribute("position"),i=this.previousHMDPosition;this.el.sceneEl.is("vr-mode")&&(e=this.calculateHMDPosition(),t.copy(e).sub(i),isNullVector(t)||(i.copy(e),o.setAttribute("position",{x:n.x+t.x,y:n.y+t.y,z:n.z+t.z})))}}(),calculateHMDPosition:function(){var t=new THREE.Vector3;return function(){return this.dolly.updateMatrix(),t.setFromMatrixPosition(this.dolly.matrix),t}}(),onMouseMove:function(t){var e,o,n=this.pitchObject,i=this.yawObject,s=this.previousMouseEvent;this.mouseDown&&this.data.enabled&&(e=t.movementX||t.mozMovementX,o=t.movementY||t.mozMovementY,void 0!==e&&void 0!==o||(e=t.screenX-s.screenX,o=t.screenY-s.screenY),this.previousMouseEvent=t,i.rotation.y-=.002*e,n.rotation.x-=.002*o,n.rotation.x=Math.max(-PI_2,Math.min(PI_2,n.rotation.x)))},onMouseDown:function(t){this.data.enabled&&0===t.button&&(this.mouseDown=!0,this.previousMouseEvent=t,document.body.classList.add(GRABBING_CLASS))},onMouseUp:function(){this.mouseDown=!1,document.body.classList.remove(GRABBING_CLASS)},onTouchStart:function(t){1===t.touches.length&&(this.touchStart={x:t.touches[0].pageX,y:t.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(t){var e,o=this.el.sceneEl.canvas,n=this.yawObject;this.touchStarted&&(e=2*Math.PI*(t.touches[0].pageX-this.touchStart.x)/o.clientWidth,n.rotation.y-=.5*e,this.touchStart={x:t.touches[0].pageX,y:t.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1},onExitVR:function(){this.previousHMDPosition.set(0,0,0)},updateGrabCursor:function(t){function e(){n.canvas.classList.add("a-grab-cursor")}function o(){n.canvas.classList.remove("a-grab-cursor")}var n=this.el.sceneEl;return n.canvas?t?void e():void o():void(t?n.addEventListener("render-target-loaded",e):n.addEventListener("render-target-loaded",o))}});
224
+ },{"../core/component":125,"../lib/three":173,"../utils/bind":190}],91:[function(_dereq_,module,exports){
225
+ function parseSide(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}function disposeMaterial(e,t){e.dispose(),t.unregisterMaterial(e)}var utils=_dereq_("../utils/"),component=_dereq_("../core/component"),THREE=_dereq_("../lib/three"),shader=_dereq_("../core/shader"),error=utils.debug("components:material:error"),registerComponent=component.registerComponent,shaders=shader.shaders,shaderNames=shader.shaderNames;module.exports.Component=registerComponent("material",{schema:{depthTest:{default:!0},depthWrite:{default:!0},alphaTest:{default:0,min:0,max:1},flatShading:{default:!1},opacity:{default:1,min:0,max:1},shader:{default:"standard",oneOf:shaderNames},side:{default:"front",oneOf:["front","back","double"]},transparent:{default:!1},visible:{default:!0},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},npot:{default:!1}},init:function(){this.material=null},update:function(e){var t=this.data;this.shader&&t.shader===e.shader||this.updateShader(t.shader),this.shader.update(this.data),this.updateMaterial()},updateSchema:function(e){var t=e.shader,a=this.data&&this.data.shader,i=t||a,s=shaders[i]&&shaders[i].schema;s||error("Unknown shader schema "+i),a&&t===a||(this.extendSchema(s),this.updateBehavior())},updateBehavior:function(){var e=this.schema,t=this,a=this.el.sceneEl,i={},s=function(e,a){Object.keys(i).forEach(function(t){i[t]=e}),t.shader.update(i)};this.tick=void 0,Object.keys(e).forEach(function(a){"time"===e[a].type&&(t.tick=s,i[a]=!0)}),a&&(this.tick?a.addBehavior(this):a.removeBehavior(this))},updateShader:function(e){var t,a=this.data,i=shaders[e]&&shaders[e].Shader;if(!i)throw new Error("Unknown shader "+e);t=this.shader=new i,t.el=this.el,t.init(a),this.setMaterial(t.material),this.updateSchema(a)},updateMaterial:function(){var e=this.data,t=this.material,a=!1,i=parseSide(e.side);(t.side===THREE.DoubleSide&&i!==THREE.DoubleSide||t.side!==THREE.DoubleSide&&i===THREE.DoubleSide)&&(a=!0),t.side=i,t.opacity=e.opacity,t.transparent=!1!==e.transparent||e.opacity<1,t.depthTest=!1!==e.depthTest,t.depthWrite=!1!==e.depthWrite,t.shading=e.flatShading?THREE.FlatShading:THREE.SmoothShading,t.visible=e.visible,e.alphaTest!==t.alphaTest&&(a=!0),t.alphaTest=e.alphaTest,a&&(t.needsUpdate=!0)},remove:function(){var e=new THREE.MeshBasicMaterial,t=this.material,a=this.el.getObject3D("mesh");a&&(a.material=e),disposeMaterial(t,this.system)},setMaterial:function(e){var t=this.el.getOrCreateObject3D("mesh",THREE.Mesh),a=this.system;this.material&&disposeMaterial(this.material,a),this.material=t.material=e,a.registerMaterial(e)}});
226
+ },{"../core/component":125,"../core/shader":134,"../lib/three":173,"../utils/":196}],92:[function(_dereq_,module,exports){
227
+ var debug=_dereq_("../utils/debug"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),warn=debug("components:obj-model:warn");module.exports.Component=registerComponent("obj-model",{schema:{mtl:{type:"model"},obj:{type:"model"}},init:function(){this.model=null,this.objLoader=new THREE.OBJLoader,this.mtlLoader=new THREE.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin=""},update:function(){var e=this.data;e.obj&&(this.remove(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.el.removeObject3D("mesh")},loadObj:function(e,o){var t=this,r=this.el,a=this.mtlLoader,i=this.objLoader;if(o)return r.hasAttribute("material")&&warn("Material component properties are ignored when a .MTL is provided"),a.setTexturePath(o.substr(0,o.lastIndexOf("/")+1)),void a.load(o,function(o){o.preload(),i.setMaterials(o),i.load(e,function(e){t.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})});i.load(e,function(e){var o=r.components.material;o&&e.traverse(function(e){e instanceof THREE.Mesh&&(e.material=o.material)}),t.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})}});
228
+ },{"../core/component":125,"../lib/three":173,"../utils/debug":192}],93:[function(_dereq_,module,exports){
229
+ var bind=_dereq_("../utils/bind"),registerComponent=_dereq_("../core/component").registerComponent,controllerUtils=_dereq_("../utils/tracked-controls"),TOUCH_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-",TOUCH_CONTROLLER_MODEL_OBJ_URL_L=TOUCH_CONTROLLER_MODEL_BASE_URL+"left.obj",TOUCH_CONTROLLER_MODEL_OBJ_MTL_L=TOUCH_CONTROLLER_MODEL_BASE_URL+"left.mtl",TOUCH_CONTROLLER_MODEL_OBJ_URL_R=TOUCH_CONTROLLER_MODEL_BASE_URL+"right.obj",TOUCH_CONTROLLER_MODEL_OBJ_MTL_R=TOUCH_CONTROLLER_MODEL_BASE_URL+"right.mtl",GAMEPAD_ID_PREFIX="Oculus Touch",PIVOT_OFFSET={x:0,y:-.015,z:.04};module.exports.Component=registerComponent("oculus-touch-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#999"},buttonTouchColor:{type:"color",default:"#8AB"},buttonHighlightColor:{type:"color",default:"#2DF"},model:{default:!0},rotationOffset:{default:0}},mapping:{left:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","xbutton","ybutton","surface"]},right:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","abutton","bbutton","surface"]}},axisLabels:["x","y","z","w"],bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.onAxisMoved=bind(this.onAxisMoved,this)},init:function(){var t=this;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){t.onButtonEvent(e.detail.id,"down")},this.onButtonUp=function(e){t.onButtonEvent(e.detail.id,"up")},this.onButtonTouchStart=function(e){t.onButtonEvent(e.detail.id,"touchstart")},this.onButtonTouchEnd=function(e){t.onButtonEvent(e.detail.id,"touchend")},this.controllerPresent=!1,this.lastControllerCheck=0,this.previousButtonValues={},this.bindMethods(),this.emitIfAxesChanged=controllerUtils.emitIfAxesChanged,this.checkControllerPresentAndSetup=controllerUtils.checkControllerPresentAndSetup},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("axismove",this.onAxisMoved),t.addEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!0},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("axismove",this.onAxisMoved),t.removeEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!1},checkIfControllerPresent:function(){this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener(),window.addEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1)},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener(),window.removeEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1)},updateControllerModel:function(){var t,e;this.data.model&&("right"===this.data.hand?(t="url("+TOUCH_CONTROLLER_MODEL_OBJ_URL_R+")",e="url("+TOUCH_CONTROLLER_MODEL_OBJ_MTL_R+")"):(t="url("+TOUCH_CONTROLLER_MODEL_OBJ_URL_L+")",e="url("+TOUCH_CONTROLLER_MODEL_OBJ_MTL_L+")"),this.el.setAttribute("obj-model",{obj:t,mtl:e}))},injectTrackedControls:function(){var t=this.data,e="right"===t.hand?-90:90;this.el.setAttribute("tracked-controls",{id:"right"===t.hand?"Oculus Touch (Right)":"Oculus Touch (Left)",controller:0,rotationOffset:-999!==t.rotationOffset?t.rotationOffset:e}),this.updateControllerModel()},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onButtonChanged:function(t){var e,o=this.mapping[this.data.hand].buttons[t.detail.id],n=this.buttonMeshes;o&&("trigger"!==o&&"grip"!==o||(e=t.detail.state.value),n&&("trigger"===o&&n.trigger&&(n.trigger.rotation.x=-e*(Math.PI/24)),"grip"===o&&n.grip&&(n.grip.rotation.y=("left"===this.data.hand?-1:1)*e*(Math.PI/60))),this.el.emit(o+"changed",t.detail.state))},onModelLoaded:function(t){var e,o=t.detail.model;if(this.data.model){var n="left"===this.data.hand;e=this.buttonMeshes={},e.grip=o.getObjectByName(n?"buttonHand_oculus-touch-controller-left.004":"buttonHand_oculus-touch-controller-right.005"),e.thumbstick=o.getObjectByName(n?"stick_oculus-touch-controller-left.007":"stick_oculus-touch-controller-right.004"),e.trigger=o.getObjectByName(n?"buttonTrigger_oculus-touch-controller-left.005":"buttonTrigger_oculus-touch-controller-right.006"),e.xbutton=o.getObjectByName("buttonX_oculus-touch-controller-left.002"),e.abutton=o.getObjectByName("buttonA_oculus-touch-controller-right.002"),e.ybutton=o.getObjectByName("buttonY_oculus-touch-controller-left.001"),e.bbutton=o.getObjectByName("buttonB_oculus-touch-controller-right.003"),o.position=PIVOT_OFFSET}},onButtonEvent:function(t,e){var o,n=this.mapping[this.data.hand].buttons[t];if(Array.isArray(n))for(o=0;o<n.length;o++)this.el.emit(n[o]+e);else this.el.emit(n+e);this.updateModel(n,e)},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping[this.data.hand].axes,t)},updateModel:function(t,e){var o;if(Array.isArray(t))for(o=0;o<t.length;o++)this.updateButtonModel(t[o],e);else this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var o="up"===e||"touchend"===e?this.data.buttonColor:"touchstart"===e?this.data.buttonTouchColor:this.data.buttonHighlightColor,n=this.buttonMeshes;this.data.model&&n&&n[t]&&n[t].material.color.set(o)}});
230
+ },{"../core/component":125,"../utils/bind":190,"../utils/tracked-controls":200}],94:[function(_dereq_,module,exports){
231
+ var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("position",{schema:{type:"vec3"},update:function(){var e=this.el.object3D,o=this.data;e.position.set(o.x,o.y,o.z)}});
232
+ },{"../core/component":125}],95:[function(_dereq_,module,exports){
233
+ function copyArray(e,t){var i;for(e.length=t.length,i=0;i<t.length;i++)e[i]=t[i]}var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,dummyVec=new THREE.Vector3;module.exports.Component=registerComponent("raycaster",{schema:{direction:{type:"vec3",default:{x:0,y:0,z:-1}},far:{default:1e3},interval:{default:100},near:{default:0},objects:{default:""},origin:{type:"vec3"},recursive:{default:!0},showLine:{default:!1},useWorldCoordinates:{default:!1}},init:function(){this.lineData={},this.lineEndVec3=new THREE.Vector3,this.unitLineEndVec3=new THREE.Vector3,this.intersectedEls=[],this.objects=null,this.prevCheckTime=void 0,this.prevIntersectedEls=[],this.raycaster=new THREE.Raycaster,this.updateOriginDirection(),this.refreshObjects=bind(this.refreshObjects,this),this.refreshOnceChildLoaded=bind(this.refreshOnceChildLoaded,this)},update:function(e){var t=this.data,i=this.el,r=this.raycaster;r.far=t.far,r.near=t.near,!t.showLine||t.far===e.far&&t.origin===e.origin&&t.direction===e.direction||(this.unitLineEndVec3.copy(t.origin).add(t.direction).normalize(),this.drawLine()),!t.showLine&&e.showLine&&i.removeAttribute("line"),this.refreshObjects()},play:function(){this.el.sceneEl.addEventListener("loaded",this.refreshObjects),this.el.sceneEl.addEventListener("child-attached",this.refreshOnceChildLoaded),this.el.sceneEl.addEventListener("child-detached",this.refreshObjects)},pause:function(){this.el.sceneEl.removeEventListener("loaded",this.refreshObjects),this.el.sceneEl.removeEventListener("child-attached",this.refreshOnceChildLoaded),this.el.sceneEl.removeEventListener("child-detached",this.refreshObjects)},remove:function(){this.data.showLine&&this.el.removeAttribute("line")},refreshOnceChildLoaded:function(e){var t=this,i=e.detail.el;i&&(i.hasLoaded?this.refreshObjects():i.addEventListener("loaded",function e(r){i.removeEventListener("loaded",e),t.refreshObjects()}))},refreshObjects:function(){var e,t,i,r=this.data,n=r.objects?this.el.sceneEl.querySelectorAll(r.objects):null;if(n)for(i=[],t=0;t<n.length;t++)i.push(n[t].object3D);else i=this.el.sceneEl.object3D.children;for(this.objects=[],t=0;t<i.length;t++)(e=i[t].children)&&this.objects.push.apply(this.objects,e)},tick:function(e){var t,i,r,n=this.el,s=this.data,c=this.intersectedEls,o=this.prevCheckTime,a=this.prevIntersectedEls;if(!(o&&e-o<s.interval)){for(this.prevCheckTime=e,copyArray(this.prevIntersectedEls,this.intersectedEls),this.updateOriginDirection(),i=this.raycaster.intersectObjects(this.objects,s.recursive),i=i.filter(function(e){return(!s.showLine||e.object!==n.getObject3D("line"))&&!!e.object.el}),c.length=i.length,t=0;t<i.length;t++)c[t]=i[t].object.el;i.forEach(function(e){e.object.el.emit("raycaster-intersected",{el:n,intersection:e})}),i.length&&n.emit("raycaster-intersection",{els:c,intersections:i}),a.forEach(function(e){-1===c.indexOf(e)&&(n.emit("raycaster-intersection-cleared",{el:e}),e.emit("raycaster-intersected-cleared",{el:n}))}),s.showLine&&(i.length&&(r=i[0].object.el===n&&i[1]?i[1].distance:i[0].distance),this.drawLine(r))}},updateOriginDirection:function(){var e=new THREE.Vector3,t=new THREE.Quaternion,i=new THREE.Vector3;return function(){var r=this.el,n=this.data;if(n.useWorldCoordinates)return void this.raycaster.set(n.origin,n.direction);r.object3D.updateMatrixWorld(),r.object3D.matrixWorld.decompose(i,t,dummyVec),0===n.origin.x&&0===n.origin.y&&0===n.origin.z||(i=r.object3D.localToWorld(i.copy(n.origin))),e.copy(n.direction).add(n.origin).applyQuaternion(t).normalize(),this.raycaster.set(i,e)}}(),drawLine:function(e){var t=new THREE.Vector3,i={};return function(e){var r=this.data,n=this.el;void 0===e&&(e=r.far===1/0?1e3:r.far),i.start=r.origin,i.end=t.copy(this.unitLineEndVec3).multiplyScalar(e),n.setAttribute("line",i)}}()});
234
+ },{"../core/component":125,"../lib/three":173,"../utils/":196}],96:[function(_dereq_,module,exports){
235
+ var degToRad=_dereq_("../lib/three").Math.degToRad,registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("rotation",{schema:{type:"vec3"},update:function(){var e=this.data,o=this.el.object3D;o.rotation.set(degToRad(e.x),degToRad(e.y),degToRad(e.z)),o.rotation.order="YXZ"}});
236
+ },{"../core/component":125,"../lib/three":173}],97:[function(_dereq_,module,exports){
237
+ var registerComponent=_dereq_("../core/component").registerComponent,zeroScale=1e-5;module.exports.Component=registerComponent("scale",{schema:{type:"vec3",default:{x:1,y:1,z:1}},update:function(){var e=this.data,o=this.el.object3D,t=0===e.x?zeroScale:e.x,r=0===e.y?zeroScale:e.y,a=0===e.z?zeroScale:e.z;o.scale.set(t,r,a)}});
238
+ },{"../core/component":125}],98:[function(_dereq_,module,exports){
239
+ var bind=_dereq_("../../utils/bind"),registerComponent=_dereq_("../../core/component").registerComponent;module.exports.Component=registerComponent("canvas",{init:function(){function e(){document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||t.exitVR(),document.activeElement.blur(),document.body.focus()}var n,t=this.el;n=document.createElement("canvas"),n.classList.add("a-canvas"),n.dataset.aframeCanvas=!0,t.appendChild(n),document.addEventListener("fullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),n.addEventListener("touchmove",function(e){e.preventDefault()}),t.canvas=n,t.emit("render-target-loaded",{target:n}),setTimeout(bind(t.resize,t),0)}});
240
+ },{"../../core/component":125,"../../utils/bind":190}],99:[function(_dereq_,module,exports){
241
+ var register=_dereq_("../../core/component").registerComponent;module.exports.Component=register("debug",{schema:{default:!0}});
242
+ },{"../../core/component":125}],100:[function(_dereq_,module,exports){
243
+ var registerComponent=_dereq_("../../core/component").registerComponent;module.exports.Component=registerComponent("embedded",{dependencies:["vr-mode-ui"],schema:{default:!0},update:function(){var e=this.el,r=e.querySelector(".a-enter-vr");!0===this.data?(r&&r.classList.add("embedded"),e.removeFullScreenStyles()):(r&&r.classList.remove("embedded"),e.addFullScreenStyles())}});
244
+ },{"../../core/component":125}],101:[function(_dereq_,module,exports){
245
+ function getFog(e){var o;return o="exponential"===e.type?new THREE.FogExp2(e.color,e.density):new THREE.Fog(e.color,e.near,e.far),o.name=e.type,o}var register=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),debug=_dereq_("../../utils/debug"),warn=debug("components:fog:warn");module.exports.Component=register("fog",{schema:{color:{type:"color",default:"#000"},density:{default:25e-5},far:{default:1e3,min:0},near:{default:1,min:0},type:{default:"linear",oneOf:["linear","exponential"]}},update:function(){var e=this.data,o=this.el,t=this.el.object3D.fog;return o.isScene?t&&e.type===t.name?void Object.keys(this.schema).forEach(function(o){var n=e[o];"color"===o&&(n=new THREE.Color(n)),t[o]=n}):(o.object3D.fog=getFog(e),void o.systems.material.updateMaterials()):void warn("Fog component can only be applied to <a-scene>")},remove:function(){var e=this.el.object3D.fog;e&&(e.far=0,e.near=.1)}});
246
+ },{"../../core/component":125,"../../lib/three":173,"../../utils/debug":192}],102:[function(_dereq_,module,exports){
247
+ (function (process){
248
+ function getFuzzyPatchVersion(e){var n=e.split(".");return n[2]="x",n.join(".")}var AFRAME_INJECTED=_dereq_("../../constants").AFRAME_INJECTED,bind=_dereq_("../../utils/bind"),pkg=_dereq_("../../../package"),registerComponent=_dereq_("../../core/component").registerComponent,INSPECTOR_DEV_URL="https://aframe.io/aframe-inspector/dist/aframe-inspector.js",INSPECTOR_RELEASE_URL="https://unpkg.com/aframe-inspector@"+getFuzzyPatchVersion(pkg.version)+"/dist/aframe-inspector.min.js",INSPECTOR_URL="dev"===process.env.INSPECTOR_VERSION?INSPECTOR_DEV_URL:INSPECTOR_RELEASE_URL,LOADING_MESSAGE="Loading Inspector",LOADING_ERROR_MESSAGE="Error loading Inspector";module.exports.Component=registerComponent("inspector",{schema:{url:{default:INSPECTOR_URL}},init:function(){this.onKeydown=bind(this.onKeydown,this),this.onMessage=bind(this.onMessage,this),this.initOverlay(),window.addEventListener("keydown",this.onKeydown),window.addEventListener("message",this.onMessage)},initOverlay:function(){this.loadingMessageEl=document.createElement("div"),this.loadingMessageEl.classList.add("a-inspector-loader"),this.loadingMessageEl.innerHTML=LOADING_MESSAGE+'<span class="dots"><span>.</span><span>.</span><span>.</span></span>'},remove:function(){this.removeEventListeners()},onKeydown:function(e){var n=73===e.keyCode&&e.ctrlKey&&e.altKey;this.data&&n&&this.injectInspector()},showLoader:function(){document.body.appendChild(this.loadingMessageEl)},hideLoader:function(){document.body.removeChild(this.loadingMessageEl)},onMessage:function(e){"INJECT_AFRAME_INSPECTOR"===e.data&&this.injectInspector()},injectInspector:function(){var e,n=this;AFRAME.INSPECTOR||AFRAME.inspectorInjected||(this.showLoader(),e=document.createElement("script"),e.src=this.data.url,e.setAttribute("data-name","aframe-inspector"),e.setAttribute(AFRAME_INJECTED,""),e.onload=function(){AFRAME.INSPECTOR.open(),n.hideLoader(),n.removeEventListeners()},e.onerror=function(){n.loadingMessageEl.innerHTML=LOADING_ERROR_MESSAGE},document.head.appendChild(e),AFRAME.inspectorInjected=!0)},removeEventListeners:function(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("message",this.onMessage)}});
249
+ }).call(this,_dereq_('_process'))
250
+
251
+ },{"../../../package":76,"../../constants":116,"../../core/component":125,"../../utils/bind":190,"_process":6}],103:[function(_dereq_,module,exports){
252
+ var registerComponent=_dereq_("../../core/component").registerComponent,shouldCaptureKeyEvent=_dereq_("../../utils/").shouldCaptureKeyEvent;module.exports.Component=registerComponent("keyboard-shortcuts",{schema:{enterVR:{default:!0},exitVR:{default:!0}},init:function(){var e=this,t=this.el;this.listener=window.addEventListener("keyup",function(n){shouldCaptureKeyEvent(n)&&(e.enterVREnabled&&70===n.keyCode&&t.enterVR(),e.enterVREnabled&&27===n.keyCode&&t.exitVR())},!1)},update:function(e){var t=this.data;this.enterVREnabled=t.enterVR},remove:function(){window.removeEventListener("keyup",this.listener)}});
253
+ },{"../../core/component":125,"../../utils/":196}],104:[function(_dereq_,module,exports){
254
+ var debug=_dereq_("../../utils/debug"),registerComponent=_dereq_("../../core/component").registerComponent,warn=debug("components:pool:warn");module.exports.Component=registerComponent("pool",{schema:{mixin:{default:""},size:{default:0},dynamic:{default:!1}},multiple:!0,initPool:function(){var t;if(this.data.mixin)for(this.availableEls=[],this.usedEls=[],t=0;t<this.data.size;++t)this.createEntity()},update:function(t){var i=this.data;t.mixin===i.mixin&&t.size===i.size||this.initPool()},createEntity:function(){var t=document.createElement("a-entity");t.play=this.wrapPlay(t.play),t.setAttribute("mixin",this.data.mixin),t.setAttribute("visible",!1),this.el.appendChild(t),this.availableEls.push(t)},wrapPlay:function(t){var i=this.usedEls;return function(){-1!==i.indexOf(this)&&t.call(this)}},requestEntity:function(){var t;if(0===this.availableEls.length){if(!1===this.data.dynamic)return void warn("Requested entity from empty pool "+this.name);warn("Requested entity from empty pool. This pool is dynamicand will resize automatically. You might want to increase its initial size"+this.name),this.createEntity()}return t=this.availableEls.shift(),this.usedEls.push(t),t.setAttribute("visible",!0),t},returnEntity:function(t){var i=this.usedEls.indexOf(t);if(-1===i)return void warn("The returned entity was not previously pooled from "+this.name);this.usedEls.splice(i,1),this.availableEls.push(t),t.setAttribute("visible",!1),t.pause()}});
255
+ },{"../../core/component":125,"../../utils/debug":192}],105:[function(_dereq_,module,exports){
256
+ var registerComponent=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),VERTEX_SHADER=["attribute vec3 position;","attribute vec2 uv;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUv;","void main() {"," vUv = vec2( 1.- uv.x, uv.y );"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),FRAGMENT_SHADER=["precision mediump float;","uniform samplerCube map;","varying vec2 vUv;","#define M_PI 3.141592653589793238462643383279","void main() {"," vec2 uv = vUv;"," float longitude = uv.x * 2. * M_PI - M_PI + M_PI / 2.;"," float latitude = uv.y * M_PI;"," vec3 dir = vec3("," - sin( longitude ) * sin( latitude ),"," cos( latitude ),"," - cos( longitude ) * sin( latitude )"," );"," normalize( dir );"," gl_FragColor = vec4( textureCube( map, dir ).rgb, 1.0 );","}"].join("\n");module.exports.Component=registerComponent("screenshot",{schema:{width:{default:4096},height:{default:2048}},init:function(){function e(){var e=t.renderer.getContext();a.cubeMapSize=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),a.material=new THREE.RawShaderMaterial({uniforms:{map:{type:"t",value:null}},vertexShader:VERTEX_SHADER,fragmentShader:FRAGMENT_SHADER,side:THREE.DoubleSide}),a.quad=new THREE.Mesh(new THREE.PlaneBufferGeometry(1,1),a.material),a.quad.visible=!1,a.camera=new THREE.OrthographicCamera(-.5,.5,.5,-.5,-1e4,1e4),a.canvas=document.createElement("canvas"),a.ctx=a.canvas.getContext("2d"),t.camera&&t.camera.add(a.quad),a.onKeyDown=a.onKeyDown.bind(a),a.onCameraActive=a.onCameraActive.bind(a),t.addEventListener("camera-set-active",a.onCameraActive)}var t=this.el,a=this;t.renderer?e():t.addEventListener("render-target-loaded",e)},getRenderTarget:function(e,t){return new THREE.WebGLRenderTarget(e,t,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,wrapS:THREE.ClampToEdgeWrapping,wrapT:THREE.ClampToEdgeWrapping,format:THREE.RGBAFormat,type:THREE.UnsignedByteType})},resize:function(e,t){this.quad.scale.set(e,t,1),this.camera.left=-1*e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-1*t/2,this.camera.updateProjectionMatrix(),this.canvas.width=e,this.canvas.height=t},play:function(){window.addEventListener("keydown",this.onKeyDown)},onCameraActive:function(e){var t=this.quad.parent;t&&t.remove(this.quad),e.detail.cameraEl.getObject3D("camera").add(this.quad)},onKeyDown:function(e){var t=83===e.keyCode&&e.ctrlKey&&e.altKey;if(this.data&&t){var a=e.shiftKey?"equirectangular":"perspective";this.capture(a)}},setCapture:function(e){var t,a,i,r=this.el;return"perspective"===e?(this.quad.visible=!1,a=r.camera,t={width:this.data.width,height:this.data.height}):(a=this.camera,a.position.copy(r.camera.getWorldPosition()),a.rotation.copy(r.camera.getWorldRotation()),i=new THREE.CubeCamera(r.camera.near,r.camera.far,Math.min(this.cubeMapSize,2048)),i.position.copy(r.camera.getWorldPosition()),i.rotation.copy(r.camera.getWorldRotation()),i.updateCubeMap(r.renderer,r.object3D),this.quad.material.uniforms.map.value=i.renderTarget.texture,t={width:this.data.width,height:this.data.height},this.quad.visible=!0),{camera:a,size:t,projection:e}},capture:function(e){var t=this.setCapture(e);this.renderCapture(t.camera,t.size,t.projection),this.saveCapture()},getCanvas:function(e){var t=this.setCapture(e);return this.renderCapture(t.camera,t.size,t.projection),this.canvas},renderCapture:function(e,t,a){var i,r,n,o=this.el.renderer.autoClear,d=this.el,s=this.el.renderer;r=this.getRenderTarget(t.width,t.height),n=new Uint8Array(4*t.width*t.height),this.resize(t.width,t.height),s.autoClear=!0,s.render(d.object3D,e,r,!0),s.autoClear=o,s.readRenderTargetPixels(r,0,0,t.width,t.height,n),"perspective"===a&&(n=this.flipPixelsVertically(n,t.width,t.height)),i=new ImageData(new Uint8ClampedArray(n),t.width,t.height),this.quad.visible=!1,this.ctx.putImageData(i,0,0)},flipPixelsVertically:function(e,t,a){for(var i=e.slice(0),r=0;r<t;++r)for(var n=0;n<a;++n)i[4*r+n*t*4]=e[4*r+(a-n)*t*4],i[4*r+1+n*t*4]=e[4*r+1+(a-n)*t*4],i[4*r+2+n*t*4]=e[4*r+2+(a-n)*t*4],i[4*r+3+n*t*4]=e[4*r+3+(a-n)*t*4];return i},saveCapture:function(){this.canvas.toBlob(function(e){var t="screenshot-"+document.title.toLowerCase()+"-"+Date.now()+".png",a=document.createElement("a"),i=URL.createObjectURL(e);a.href=i,a.setAttribute("download",t),a.innerHTML="downloading...",a.style.display="none",document.body.appendChild(a),setTimeout(function(){a.click(),document.body.removeChild(a)},1)},"image/png")}});
257
+ },{"../../core/component":125,"../../lib/three":173}],106:[function(_dereq_,module,exports){
258
+ function createStats(t){var e=new ThreeStats(t.renderer),s=new AFrameStats(t),i=t.isMobile?[]:[e,s];return new RStats({css:[],values:{fps:{caption:"fps",below:30}},groups:[{caption:"Framerate",values:["fps","raf"]}],plugins:i})}var registerComponent=_dereq_("../../core/component").registerComponent,RStats=_dereq_("../../../vendor/rStats"),utils=_dereq_("../../utils");_dereq_("../../../vendor/rStats.extras"),_dereq_("../../lib/rStatsAframe");var AFrameStats=window.aframeStats,bind=utils.bind,HIDDEN_CLASS="a-hidden",ThreeStats=window.threeStats;module.exports.Component=registerComponent("stats",{schema:{default:!0},init:function(){var t=this.el;"false"!==utils.getUrlParameter("stats")&&(this.stats=createStats(t),this.statsEl=document.querySelector(".rs-base"),this.hideBound=bind(this.hide,this),this.showBound=bind(this.show,this),t.addEventListener("enter-vr",this.hideBound),t.addEventListener("exit-vr",this.showBound))},update:function(){if(this.stats)return this.data?this.show():this.hide()},remove:function(){this.el.removeEventListener("enter-vr",this.hideBound),this.el.removeEventListener("exit-vr",this.showBound),this.statsEl&&this.statsEl.parentNode.removeChild(this.statsEl)},tick:function(){var t=this.stats;t&&(t("rAF").tick(),t("FPS").frame(),t().update())},hide:function(){this.statsEl.classList.add(HIDDEN_CLASS)},show:function(){this.statsEl.classList.remove(HIDDEN_CLASS)}});
259
+ },{"../../../vendor/rStats":204,"../../../vendor/rStats.extras":203,"../../core/component":125,"../../lib/rStatsAframe":172,"../../utils":196}],107:[function(_dereq_,module,exports){
260
+ function createEnterVRButton(e){var t,n;return n=document.createElement("div"),n.classList.add(ENTER_VR_CLASS),n.setAttribute(constants.AFRAME_INJECTED,""),t=document.createElement("button"),t.className=ENTER_VR_BTN_CLASS,t.setAttribute(constants.AFRAME_INJECTED,""),n.appendChild(t),t.addEventListener("click",function(t){e()}),n}function createOrientationModal(e){var t=document.createElement("div");t.className=ORIENTATION_MODAL_CLASS,t.classList.add(HIDDEN_CLASS),t.setAttribute(constants.AFRAME_INJECTED,"");var n=document.createElement("button");return n.setAttribute(constants.AFRAME_INJECTED,""),n.innerHTML="Exit VR",n.addEventListener("click",e),t.appendChild(n),t}var registerComponent=_dereq_("../../core/component").registerComponent,constants=_dereq_("../../constants/"),utils=_dereq_("../../utils/"),bind=utils.bind,ENTER_VR_CLASS="a-enter-vr",ENTER_VR_BTN_CLASS="a-enter-vr-button",HIDDEN_CLASS="a-hidden",ORIENTATION_MODAL_CLASS="a-orientation-modal";module.exports.Component=registerComponent("vr-mode-ui",{dependencies:["canvas"],schema:{enabled:{default:!0}},init:function(){var e=this,t=this.el;"false"!==utils.getUrlParameter("ui")&&(this.enterVR=bind(t.enterVR,t),this.exitVR=bind(t.exitVR,t),this.insideLoader=!1,this.enterVREl=null,this.orientationModalEl=null,t.addEventListener("enter-vr",bind(this.updateEnterVRInterface,this)),t.addEventListener("exit-vr",bind(this.updateEnterVRInterface,this)),window.addEventListener("message",function(t){"loaderReady"===t.data.type&&(e.insideLoader=!0,e.remove())}),window.addEventListener("orientationchange",bind(this.toggleOrientationModalIfNeeded,this)))},update:function(){var e=this.el;if(!this.data.enabled||this.insideLoader||"false"===utils.getUrlParameter("ui"))return this.remove();this.enterVREl||this.orientationModalEl||(this.enterVREl=createEnterVRButton(this.enterVR),e.appendChild(this.enterVREl),this.orientationModalEl=createOrientationModal(this.exitVR),e.appendChild(this.orientationModalEl),this.updateEnterVRInterface())},remove:function(){[this.enterVREl,this.orientationModalEl].forEach(function(e){e&&e.parentNode.removeChild(e)})},updateEnterVRInterface:function(){this.toggleEnterVRButtonIfNeeded(),this.toggleOrientationModalIfNeeded()},toggleEnterVRButtonIfNeeded:function(){var e=this.el;this.enterVREl&&(e.is("vr-mode")?this.enterVREl.classList.add(HIDDEN_CLASS):this.enterVREl.classList.remove(HIDDEN_CLASS))},toggleOrientationModalIfNeeded:function(){var e=this.el,t=this.orientationModalEl;t&&e.isMobile&&(!utils.device.isLandscape()&&e.is("vr-mode")?t.classList.remove(HIDDEN_CLASS):t.classList.add(HIDDEN_CLASS))}});
261
+ },{"../../constants/":116,"../../core/component":125,"../../utils/":196}],108:[function(_dereq_,module,exports){
262
+ var component=_dereq_("../core/component"),THREE=_dereq_("../lib/three"),bind=_dereq_("../utils/bind"),registerComponent=component.registerComponent;module.exports.Component=registerComponent("shadow",{schema:{cast:{default:!0},receive:{default:!0}},init:function(){this.onMeshChanged=bind(this.update,this),this.el.addEventListener("object3dset",this.onMeshChanged),this.system.setShadowMapEnabled(!0)},update:function(){var e=this.data;this.updateDescendants(e.cast,e.receive)},remove:function(){this.el.removeEventListener("object3dset",this.onMeshChanged),this.updateDescendants(!1,!1)},updateDescendants:function(e,t){var n=this.el.sceneEl;this.el.object3D.traverse(function(s){if(s instanceof THREE.Mesh&&(s.castShadow=e,s.receiveShadow=t,n.hasLoaded&&s.material))for(var a=s.material.materials||[s.material],i=0;i<a.length;i++)a[i].needsUpdate=!0})}});
263
+ },{"../core/component":125,"../lib/three":173,"../utils/bind":190}],109:[function(_dereq_,module,exports){
264
+ var registerComponent=_dereq_("../core/component").registerComponent,debug=_dereq_("../utils/debug"),bind=_dereq_("../utils/bind"),THREE=_dereq_("../lib/three"),warn=debug("components:sound:warn");module.exports.Component=registerComponent("sound",{schema:{autoplay:{default:!1},distanceModel:{default:"inverse",oneOf:["linear","inverse","exponential"]},loop:{default:!1},maxDistance:{default:1e4},on:{default:""},poolSize:{default:1},positional:{default:!0},refDistance:{default:1},rolloffFactor:{default:1},src:{type:"audio"},volume:{default:1}},multiple:!0,init:function(){this.listener=null,this.audioLoader=new THREE.AudioLoader,this.pool=new THREE.Group,this.loaded=!1,this.mustPlay=!1,this.playSound=bind(this.playSound,this)},update:function(e){var t=this.data,o=t.src!==e.src;if(o){if(!t.src)return void warn("Audio source was not specified with `src`");this.setupSound()}if(this.pool.children.forEach(function(e){t.positional&&(e.setDistanceModel(t.distanceModel),e.setMaxDistance(t.maxDistance),e.setRefDistance(t.refDistance),e.setRolloffFactor(t.rolloffFactor)),e.setLoop(t.loop),e.setVolume(t.volume),e.isPaused=!1}),t.on!==e.on&&this.updateEventListener(e.on),o){var i=this;this.loaded=!1,this.audioLoader.load(t.src,function(e){i.pool.children.forEach(function(t){t.setBuffer(e)}),i.loaded=!0,THREE.Cache.remove(t.src),(i.data.autoplay||i.mustPlay)&&i.playSound(),i.el.emit("sound-loaded")})}},pause:function(){this.stopSound(),this.removeEventListener()},play:function(){this.data.autoplay&&this.playSound(),this.updateEventListener()},remove:function(){this.removeEventListener(),this.el.removeObject3D(this.attrName);try{this.pool.children.forEach(function(e){e.disconnect()})}catch(e){warn("Audio source not properly disconnected")}},updateEventListener:function(e){var t=this.el;e&&t.removeEventListener(e,this.playSound),t.addEventListener(this.data.on,this.playSound)},removeEventListener:function(){this.el.removeEventListener(this.data.on,this.playSound)},setupSound:function(){var e=this.el,t=e.sceneEl;this.pool.children.length>0&&(this.stopSound(),e.removeObject3D("sound"));var o=this.listener=t.audioListener||new THREE.AudioListener;t.audioListener=o,t.camera&&t.camera.add(o),t.addEventListener("camera-set-active",function(e){e.detail.cameraEl.getObject3D("camera").add(o)}),this.pool=new THREE.Group;for(var i=0;i<this.data.poolSize;i++){var n=this.data.positional?new THREE.PositionalAudio(o):new THREE.Audio(o);this.pool.add(n)}e.setObject3D(this.attrName,this.pool),this.pool.children.forEach(function(t){t.onEnded=function(){t.isPlaying=!1,e.emit("sound-ended",{index:i})}})},pauseSound:function(){this.isPlaying=!1,this.pool.children.forEach(function(e){e.source&&e.source.buffer&&e.isPlaying&&!e.isPaused&&(e.isPaused=!0,e.pause())})},playSound:function(){if(!this.loaded)return warn("Sound not loaded yet. It will be played once it finished loading"),void(this.mustPlay=!0);var e=!1;if(this.isPlaying=!0,this.pool.children.forEach(function(t){if(!t.isPlaying&&t.buffer&&!e)return t.play(),t.isPaused=!1,void(e=!0)}),!e)return void warn("All the sounds are playing. If you need to play more sounds simultaneously consider increasing the size of pool with the `poolSize` attribute.",this.el);this.mustPlay=!1},stopSound:function(){this.isPlaying=!1,this.pool.children.forEach(function(e){e.source&&e.source.buffer&&e.stop()})}});
265
+ },{"../core/component":125,"../lib/three":173,"../utils/bind":190,"../utils/debug":192}],110:[function(_dereq_,module,exports){
266
+ function parseSide(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}function coerceData(e){return e=utils.clone(e),void 0!==e.lineHeight&&(e.lineHeight=parseFloat(e.lineHeight),isFinite(e.lineHeight)||(e.lineHeight=void 0)),void 0!==e.width&&(e.width=parseFloat(e.width),isFinite(e.width)||(e.width=void 0)),e}function loadFont(e,t){return new Promise(function(r,n){loadBMFont(e,function(o,i){if(o)return error("Error loading font",e),void n(o);e.indexOf("/Roboto-msdf.json")>=0&&(t=30),t&&i.chars.map(function(e){e.yoffset+=t}),r(i)})})}function loadTexture(e){return new Promise(function(t,r){(new THREE.ImageLoader).load(e,function(e){t(e)},void 0,function(){error("Error loading font image",e),r(null)})})}function createShader(e,t,r){var n,o;return o=new shaders[t].Shader,o.el=e,o.init(r),o.update(r),n=o.material,n.transparent=r.transparent,{material:n,shader:o}}function updateBaseMaterial(e,t){e.side=t.side}function computeWidth(e,t,r){return e||(.5+t)*r}function computeFontWidthFactor(e){var t=0,r=0,n=0;return e.chars.map(function(e){t+=e.xadvance,e.id>=48&&e.id<=57&&(n++,r+=e.xadvance)}),n?r/n:t/e.chars.length}function PromiseCache(){var e=this.cache={};this.get=function(t,r){return t in e?e[t]:(e[t]=r(),e[t])}}var createTextGeometry=_dereq_("three-bmfont-text"),loadBMFont=_dereq_("load-bmfont"),path=_dereq_("path"),registerComponent=_dereq_("../core/component").registerComponent,coreShader=_dereq_("../core/shader"),THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),error=utils.debug("components:text:error"),shaders=coreShader.shaders,warn=utils.debug("components:text:warn"),DEFAULT_WIDTH=1,MAX_ANISOTROPY=16,FONT_BASE_URL="https://cdn.aframe.io/fonts/",FONTS={aileronsemibold:FONT_BASE_URL+"Aileron-Semibold.fnt",dejavu:FONT_BASE_URL+"DejaVu-sdf.fnt",exo2bold:FONT_BASE_URL+"Exo2Bold.fnt",exo2semibold:FONT_BASE_URL+"Exo2SemiBold.fnt",kelsonsans:FONT_BASE_URL+"KelsonSans.fnt",monoid:FONT_BASE_URL+"Monoid.fnt",mozillavr:FONT_BASE_URL+"mozillavr.fnt",roboto:FONT_BASE_URL+"Roboto-msdf.json",sourcecodepro:FONT_BASE_URL+"SourceCodePro.fnt"},MSDF_FONTS=["roboto"],DEFAULT_FONT="roboto";module.exports.FONTS=FONTS;var cache=new PromiseCache,fontWidthFactors={};module.exports.Component=registerComponent("text",{multiple:!0,schema:{align:{type:"string",default:"left",oneOf:["left","right","center"]},alphaTest:{default:.5},anchor:{default:"center",oneOf:["left","right","center","align"]},baseline:{default:"center",oneOf:["top","center","bottom"]},color:{type:"color",default:"#FFF"},font:{type:"string",default:DEFAULT_FONT},fontImage:{type:"string"},height:{type:"number"},letterSpacing:{type:"number",default:0},lineHeight:{type:"number"},opacity:{type:"number",default:1},shader:{default:"sdf",oneOf:shaders},side:{default:"front",oneOf:["front","back","double"]},tabSize:{default:4},transparent:{default:!0},value:{type:"string"},whiteSpace:{default:"normal",oneOf:["normal","pre","nowrap"]},width:{type:"number"},wrapCount:{type:"number",default:40},wrapPixels:{type:"number"},yOffset:{type:"number",default:0},zOffset:{type:"number",default:.001}},init:function(){this.texture=new THREE.Texture,this.texture.anisotropy=MAX_ANISOTROPY,this.geometry=createTextGeometry(),this.createOrUpdateMaterial(),this.mesh=new THREE.Mesh(this.geometry,this.material),this.el.setObject3D(this.attrName,this.mesh)},update:function(e){var t=coerceData(this.data),r=this.currentFont;if(this.createOrUpdateMaterial(),e.font!==t.font)return void this.updateFont();r&&(this.updateGeometry(this.geometry,t,r),this.updateLayout(t))},remove:function(){this.geometry.dispose(),this.geometry=null,this.el.removeObject3D(this.attrName),this.material.dispose(),this.material=null,this.texture.dispose(),this.texture=null,this.shaderObject&&delete this.shaderObject},createOrUpdateMaterial:function(){var e,t,r,n,o=this.data,i=this.material;if(n=o.shader,-1!==MSDF_FONTS.indexOf(o.font)||o.font.indexOf("-msdf.")>=0?n="msdf":o.font in FONTS&&-1===MSDF_FONTS.indexOf(o.font)&&(n="sdf"),e=(this.shaderObject&&this.shaderObject.name)!==n,r={alphaTest:o.alphaTest,color:o.color,map:this.texture,opacity:o.opacity,side:parseSide(o.side),transparent:o.transparent},!e)return this.shaderObject.update(r),i.transparent=r.transparent,void updateBaseMaterial(i,r);t=createShader(this.el,n,r),this.material=t.material,this.shaderObject=t.shader,updateBaseMaterial(this.material,r),this.mesh&&(this.mesh.material=this.material)},updateFont:function(){var e,t=this.data,r=this.el,n=this.geometry,o=this;t.font||warn("No font specified. Using the default font."),this.mesh.visible=!1,e=this.lookupFont(t.font||DEFAULT_FONT)||t.font,cache.get(e,function(){return loadFont(e,t.yOffset)}).then(function(i){var a,s;if(1!==i.pages.length)throw new Error("Currently only single-page bitmap fonts are supported.");fontWidthFactors[e]||(i.widthFactor=fontWidthFactors[i]=computeFontWidthFactor(i)),a=coerceData(t),o.updateGeometry(n,o.data,i),o.currentFont=i,o.updateLayout(a),s=t.fontImage||e.replace(/(\.fnt)|(\.json)/,".png")||path.dirname(t.font)+"/"+i.pages[0],cache.get(s,function(){return loadTexture(s)}).then(function(e){o.mesh.visible=!0,o.texture.image=e,o.texture.needsUpdate=!0,r.emit("textfontset",{font:t.font,fontObj:i})}).catch(function(e){throw error(e),e})}).catch(function(e){throw error(e),e})},updateLayout:function(e){var t,r,n,o,i,a,s,h,d=this.el,u=this.geometry,l=d.getAttribute("geometry"),c=u.layout,f=this.mesh;if(l=d.getAttribute("geometry"),a=e.width||l&&l.width||DEFAULT_WIDTH,o=computeWidth(e.wrapPixels,e.wrapCount,this.currentFont.widthFactor),i=a/o,n=i*(c.height+c.descender),l&&(l.width||d.setAttribute("geometry","width",a),l.height||d.setAttribute("geometry","height",n)),"left"===(t="align"===e.anchor?e.align:e.anchor))s=0;else if("right"===t)s=-1*c.width;else{if("center"!==t)throw new TypeError("Invalid text.anchor property value",t);s=-1*c.width/2}if("bottom"===(r=e.baseline))h=0;else if("top"===r)h=-1*c.height+c.ascender;else{if("center"!==r)throw new TypeError("Invalid text.baseline property value",r);h=-1*c.height/2}f.position.x=s*i,f.position.y=h*i,f.position.z=e.zOffset,f.scale.set(i,-1*i,i),this.geometry.computeBoundingSphere()},lookupFont:function(e){return FONTS[e]},updateGeometry:function(e,t,r){e.update(utils.extend({},t,{font:r,width:computeWidth(t.wrapPixels,t.wrapCount,r.widthFactor),text:t.value.replace(/\\n/g,"\n").replace(/\\t/g,"\t"),lineHeight:t.lineHeight||r.common.lineHeight}))}});
267
+ },{"../core/component":125,"../core/shader":134,"../lib/three":173,"../utils/":196,"load-bmfont":24,"path":32,"three-bmfont-text":37}],111:[function(_dereq_,module,exports){
268
+ var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),DEFAULT_USER_HEIGHT=_dereq_("../constants").DEFAULT_USER_HEIGHT,DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,EYES_TO_ELBOW={x:.175,y:-.3,z:-.03},FOREARM={x:0,y:0,z:-.175};module.exports.Component=registerComponent("tracked-controls",{schema:{controller:{default:0},id:{type:"string",default:""},idPrefix:{type:"string",default:""},rotationOffset:{default:0},armModel:{default:!0},headElement:{type:"selector"}},init:function(){this.axis=[0,0,0],this.buttonStates={},this.dolly=new THREE.Object3D,this.controllerEuler=new THREE.Euler,this.controllerEuler.order="YXZ",this.controllerPosition=new THREE.Vector3,this.controllerQuaternion=new THREE.Quaternion,this.deltaControllerPosition=new THREE.Vector3,this.standingMatrix=new THREE.Matrix4,this.previousControllerPosition=new THREE.Vector3,this.updateGamepad()},tick:function(t,e){var o=this.el.getObject3D("mesh");o&&o.update&&o.update(e/1e3),this.updateGamepad(),this.updatePose(),this.updateButtons()},defaultUserHeight:function(){return DEFAULT_USER_HEIGHT},getHeadElement:function(){return this.data.headElement||this.el.sceneEl.camera.el},updateGamepad:function(){var t,e=this.system.controllers,o=this.data;t=e.filter(function(t){return o.idPrefix?0===t.id.indexOf(o.idPrefix):t.id===o.id}),this.controller=t[o.controller]},applyArmModel:function(t){var e=this.controller,o=e.pose,i=this.controllerQuaternion,r=this.controllerEuler,n=this.deltaControllerPosition,s=(e?e.hand:void 0)||DEFAULT_HANDEDNESS,a=this.getHeadElement(),l=a.object3D,u=a.components.camera,h=(u?u.data.userHeight:0)||this.defaultUserHeight();t.copy(l.position),n.set(EYES_TO_ELBOW.x*("left"===s?-1:"right"===s?1:0),EYES_TO_ELBOW.y,EYES_TO_ELBOW.z),n.multiplyScalar(h),n.applyAxisAngle(l.up,l.rotation.y),t.add(n),n.set(FOREARM.x,FOREARM.y,FOREARM.z),n.multiplyScalar(h),o.orientation?i.fromArray(o.orientation):i.copy(l.quaternion),r.setFromQuaternion(i),r.set(r.x,r.y,0),n.applyEuler(r),t.add(n)},updatePose:function(){var t,e,o=this.controller,i=this.controllerEuler,r=this.controllerPosition,n=this.deltaControllerPosition,s=this.dolly,a=this.el,l=this.standingMatrix,u=this.system.vrDisplay,h=this.getHeadElement(),d=h.object3D,c=h.components.camera,E=(c?c.data.userHeight:0)||this.defaultUserHeight();o&&(e=o.pose,e.orientation?s.quaternion.fromArray(e.orientation):s.quaternion.copy(d.quaternion),e.position?s.position.fromArray(e.position):(this.data.armModel&&this.applyArmModel(r),s.position.copy(r)),s.updateMatrix(),e.position&&u&&(u.stageParameters?(l.fromArray(u.stageParameters.sittingToStandingTransform),s.applyMatrix(l)):(s.position.y+=E,s.updateMatrix())),i.setFromRotationMatrix(s.matrix),r.setFromMatrixPosition(s.matrix),a.setAttribute("rotation",{x:THREE.Math.radToDeg(i.x),y:THREE.Math.radToDeg(i.y),z:THREE.Math.radToDeg(i.z)+this.data.rotationOffset}),n.copy(r).sub(this.previousControllerPosition),this.previousControllerPosition.copy(r),t=a.getAttribute("position"),a.setAttribute("position",{x:t.x+n.x,y:t.y+n.y,z:t.z+n.z}))},updateButtons:function(){var t,e,o=this.controller;if(o){for(e=0;e<o.buttons.length;++e)this.buttonStates[e]||(this.buttonStates[e]={pressed:!1,touched:!1,value:0}),t=o.buttons[e],this.handleButton(e,t);this.handleAxes()}},handleButton:function(t,e){return!!(this.handlePress(t,e)||this.handleTouch(t,e)||this.handleValue(t,e))&&(this.el.emit("buttonchanged",{id:t,state:e}),!0)},handleAxes:function(){var t,e=!1,o=this.controller.axes,i=this.axis,r=[];for(t=0;t<o.length;++t)r.push(i[t]!==o[t]),r[t]&&(e=!0);return!!e&&(this.axis=o.slice(),this.el.emit("axismove",{axis:this.axis,changed:r}),!0)},handlePress:function(t,e){var o,i=this.buttonStates[t];return e.pressed!==i.pressed&&(o=e.pressed?"down":"up",this.el.emit("button"+o,{id:t,state:e}),i.pressed=e.pressed,!0)},handleTouch:function(t,e){var o,i=this.buttonStates[t];return e.touched!==i.touched&&(o=e.touched?"start":"end",this.el.emit("touch"+o,{id:t,state:e},!0,{touches:[]}),i.touched=e.touched,!0)},handleValue:function(t,e){var o=this.buttonStates[t];return e.value!==o.value&&(o.value=e.value,!0)}});
269
+ },{"../constants":116,"../core/component":125,"../lib/three":173}],112:[function(_dereq_,module,exports){
270
+ var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("visible",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data}});
271
+ },{"../core/component":125}],113:[function(_dereq_,module,exports){
272
+ var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/"),bind=utils.bind,checkControllerPresentAndSetup=utils.trackedControls.checkControllerPresentAndSetup,emitIfAxesChanged=utils.trackedControls.emitIfAxesChanged,VIVE_CONTROLLER_MODEL_OBJ_URL="https://cdn.aframe.io/controllers/vive/vr_controller_vive.obj",VIVE_CONTROLLER_MODEL_OBJ_MTL="https://cdn.aframe.io/controllers/vive/vr_controller_vive.mtl",GAMEPAD_ID_PREFIX="OpenVR ";module.exports.Component=registerComponent("vive-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#FAFAFA"},buttonHighlightColor:{type:"color",default:"#22D1EE"},model:{default:!0},rotationOffset:{default:0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","trigger","grip","menu","system"]},axisLabels:["x","y","z","w"],init:function(){var t=this;this.animationActive="pointing",this.checkControllerPresentAndSetup=checkControllerPresentAndSetup,this.controllerPresent=!1,this.emitIfAxesChanged=emitIfAxesChanged,this.lastControllerCheck=0,this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){t.onButtonEvent(e.detail.id,"down")},this.onButtonUp=function(e){t.onButtonEvent(e.detail.id,"up")},this.onButtonTouchEnd=function(e){t.onButtonEvent(e.detail.id,"touchend")},this.onButtonTouchStart=function(e){t.onButtonEvent(e.detail.id,"touchstart")},this.onAxisMoved=bind(this.onAxisMoved,this),this.previousButtonValues={},this.bindMethods()},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener(),window.addEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1)},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener(),window.removeEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1)},bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=bind(this.removeControllersUpdateListener,this),this.onAxisMoved=bind(this.onAxisMoved,this)},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("model-loaded",this.onModelLoaded),t.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("model-loaded",this.onModelLoaded),t.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){var t=this.data,e="right"===t.hand?0:"left"===t.hand?1:2;this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{index:e})},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,controller:"right"===e.hand?0:"left"===e.hand?1:2,rotationOffset:e.rotationOffset}),this.data.model&&this.el.setAttribute("obj-model",{obj:VIVE_CONTROLLER_MODEL_OBJ_URL,mtl:VIVE_CONTROLLER_MODEL_OBJ_MTL})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onButtonChanged:function(t){var e,n=this.mapping.buttons[t.detail.id],o=this.buttonMeshes;n&&("trigger"===n&&(e=t.detail.state.value,o&&o.trigger&&(o.trigger.rotation.x=-e*(Math.PI/12))),this.el.emit(n+"changed",t.detail.state))},onModelLoaded:function(t){var e,n=t.detail.model,o=this;this.data.model&&(e=this.buttonMeshes={},e.grip={left:n.getObjectByName("leftgrip"),right:n.getObjectByName("rightgrip")},e.menu=n.getObjectByName("menubutton"),e.system=n.getObjectByName("systembutton"),e.trackpad=n.getObjectByName("touchpad"),e.trigger=n.getObjectByName("trigger"),Object.keys(e).forEach(function(t){o.setButtonColor(t,o.data.buttonColor)}),n.position.set(0,-.015,.04))},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping.axes,t)},onButtonEvent:function(t,e){var n,o,i=this.mapping.buttons[t],s=-1!==e.indexOf("touch");if(Array.isArray(i))for(o=0;o<i.length;o++)this.el.emit(i[o]+e);else this.el.emit(i+e);if(this.data.model&&!s)if(n="up"===e?this.data.buttonColor:this.data.buttonHighlightColor,Array.isArray(i))for(o=0;o<i.length;o++)this.setButtonColor(i[o],n);else this.setButtonColor(i,n)},setButtonColor:function(t,e){var n=this.buttonMeshes;if(n)return"grip"===t?(n.grip.left.material.color.set(e),void n.grip.right.material.color.set(e)):void n[t].material.color.set(e)}});
273
+ },{"../core/component":125,"../utils/":196}],114:[function(_dereq_,module,exports){
274
+ var KEYCODE_TO_CODE=_dereq_("../constants").keyboardevent.KEYCODE_TO_CODE,registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,shouldCaptureKeyEvent=utils.shouldCaptureKeyEvent,CLAMP_VELOCITY=1e-5,MAX_DELTA=.2;module.exports.Component=registerComponent("wasd-controls",{schema:{acceleration:{default:65},adAxis:{default:"x",oneOf:["x","y","z"]},adEnabled:{default:!0},adInverted:{default:!1},easing:{default:20},enabled:{default:!0},fly:{default:!1},wsAxis:{default:"z",oneOf:["x","y","z"]},wsEnabled:{default:!0},wsInverted:{default:!1}},init:function(){this.keys={},this.velocity=new THREE.Vector3,this.onBlur=bind(this.onBlur,this),this.onFocus=bind(this.onFocus,this),this.onKeyDown=bind(this.onKeyDown,this),this.onKeyUp=bind(this.onKeyUp,this),this.onVisibilityChange=bind(this.onVisibilityChange,this),this.attachVisibilityEventListeners()},tick:function(e,t){var i,n,s=this.data,o=this.el,r=this.velocity;t/=1e3,this.updateVelocity(t),(r[s.adAxis]||r[s.wsAxis])&&(i=this.getMovementVector(t),n=o.getAttribute("position"),o.setAttribute("position",{x:n.x+i.x,y:n.y+i.y,z:n.z+i.z}))},remove:function(){this.removeKeyEventListeners(),this.removeVisibilityEventListeners()},play:function(){this.attachKeyEventListeners()},pause:function(){this.keys={},this.removeKeyEventListeners()},updateVelocity:function(e){var t,i,n,s,o,r=this.data,a=this.keys,d=this.velocity;if(i=r.adAxis,s=r.wsAxis,e>MAX_DELTA)return d[i]=0,void(d[s]=0);0!==d[i]&&(d[i]-=d[i]*r.easing*e),0!==d[s]&&(d[s]-=d[s]*r.easing*e),Math.abs(d[i])<CLAMP_VELOCITY&&(d[i]=0),Math.abs(d[s])<CLAMP_VELOCITY&&(d[s]=0),r.enabled&&(t=r.acceleration,r.adEnabled&&(n=r.adInverted?-1:1,(a.KeyA||a.ArrowLeft)&&(d[i]-=n*t*e),(a.KeyD||a.ArrowRight)&&(d[i]+=n*t*e)),r.wsEnabled&&(o=r.wsInverted?-1:1,(a.KeyW||a.ArrowUp)&&(d[s]-=o*t*e),(a.KeyS||a.ArrowDown)&&(d[s]+=o*t*e)))},getMovementVector:function(){var e=new THREE.Vector3(0,0,0),t=new THREE.Euler(0,0,0,"YXZ");return function(i){var n,s=this.el.getAttribute("rotation"),o=this.velocity;return e.copy(o),e.multiplyScalar(i),s?(n=this.data.fly?s.x:0,t.set(THREE.Math.degToRad(n),THREE.Math.degToRad(s.y),0),e.applyEuler(t),e):e}}(),attachVisibilityEventListeners:function(){window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange)},removeVisibilityEventListeners:function(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange)},attachKeyEventListeners:function(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},removeKeyEventListeners:function(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},onBlur:function(){this.pause()},onFocus:function(){this.play()},onVisibilityChange:function(){document.hidden?this.onBlur():this.onFocus()},onKeyDown:function(e){var t;shouldCaptureKeyEvent(e)&&(t=e.code||KEYCODE_TO_CODE[e.keyCode],this.keys[t]=!0)},onKeyUp:function(e){var t;t=e.code||KEYCODE_TO_CODE[e.keyCode],this.keys[t]=!1}});
275
+ },{"../constants":116,"../core/component":125,"../lib/three":173,"../utils/":196}],115:[function(_dereq_,module,exports){
276
+ var TWEEN=_dereq_("@tweenjs/tween.js"),DIRECTIONS={alternate:"alternate",alternateReverse:"alternate-reverse",normal:"normal",reverse:"reverse"},EASING_FUNCTIONS={linear:TWEEN.Easing.Linear.None,ease:TWEEN.Easing.Cubic.InOut,"ease-in":TWEEN.Easing.Cubic.In,"ease-out":TWEEN.Easing.Cubic.Out,"ease-in-out":TWEEN.Easing.Cubic.InOut,"ease-cubic":TWEEN.Easing.Cubic.In,"ease-in-cubic":TWEEN.Easing.Cubic.In,"ease-out-cubic":TWEEN.Easing.Cubic.Out,"ease-in-out-cubic":TWEEN.Easing.Cubic.InOut,"ease-quad":TWEEN.Easing.Quadratic.InOut,"ease-in-quad":TWEEN.Easing.Quadratic.In,"ease-out-quad":TWEEN.Easing.Quadratic.Out,"ease-in-out-quad":TWEEN.Easing.Quadratic.InOut,"ease-quart":TWEEN.Easing.Quartic.InOut,"ease-in-quart":TWEEN.Easing.Quartic.In,"ease-out-quart":TWEEN.Easing.Quartic.Out,"ease-in-out-quart":TWEEN.Easing.Quartic.InOut,"ease-quint":TWEEN.Easing.Quintic.InOut,"ease-in-quint":TWEEN.Easing.Quintic.In,"ease-out-quint":TWEEN.Easing.Quintic.Out,"ease-in-out-quint":TWEEN.Easing.Quintic.InOut,"ease-sine":TWEEN.Easing.Sinusoidal.InOut,"ease-in-sine":TWEEN.Easing.Sinusoidal.In,"ease-out-sine":TWEEN.Easing.Sinusoidal.Out,"ease-in-out-sine":TWEEN.Easing.Sinusoidal.InOut,"ease-expo":TWEEN.Easing.Exponential.InOut,"ease-in-expo":TWEEN.Easing.Exponential.In,"ease-out-expo":TWEEN.Easing.Exponential.Out,"ease-in-out-expo":TWEEN.Easing.Exponential.InOut,"ease-circ":TWEEN.Easing.Circular.InOut,"ease-in-circ":TWEEN.Easing.Circular.In,"ease-out-circ":TWEEN.Easing.Circular.Out,"ease-in-out-circ":TWEEN.Easing.Circular.InOut,"ease-elastic":TWEEN.Easing.Elastic.InOut,"ease-in-elastic":TWEEN.Easing.Elastic.In,"ease-out-elastic":TWEEN.Easing.Elastic.Out,"ease-in-out-elastic":TWEEN.Easing.Elastic.InOut,"ease-back":TWEEN.Easing.Back.InOut,"ease-in-back":TWEEN.Easing.Back.In,"ease-out-back":TWEEN.Easing.Back.Out,"ease-in-out-back":TWEEN.Easing.Back.InOut,"ease-bounce":TWEEN.Easing.Bounce.InOut,"ease-in-bounce":TWEEN.Easing.Bounce.In,"ease-out-bounce":TWEEN.Easing.Bounce.Out,"ease-in-out-bounce":TWEEN.Easing.Bounce.InOut},FILLS={backwards:"backwards",both:"both",forwards:"forwards",none:"none"},REPEATS={indefinite:"indefinite"},DEFAULTS={attribute:"rotation",begin:"",end:"",delay:0,dur:1e3,easing:"ease",direction:DIRECTIONS.normal,fill:FILLS.forwards,from:void 0,repeat:0,to:void 0};module.exports.defaults=DEFAULTS,module.exports.directions=DIRECTIONS,module.exports.easingFunctions=EASING_FUNCTIONS,module.exports.fills=FILLS,module.exports.repeats=REPEATS;
277
+ },{"@tweenjs/tween.js":1}],116:[function(_dereq_,module,exports){
278
+ module.exports={AFRAME_INJECTED:"aframe-injected",DEFAULT_CAMERA_HEIGHT:1.6,DEFAULT_HANDEDNESS:"right",animation:_dereq_("./animation"),keyboardevent:_dereq_("./keyboardevent")};
279
+ },{"./animation":115,"./keyboardevent":117}],117:[function(_dereq_,module,exports){
280
+ module.exports={KEYCODE_TO_CODE:{38:"ArrowUp",37:"ArrowLeft",40:"ArrowDown",39:"ArrowRight",87:"KeyW",65:"KeyA",83:"KeyS",68:"KeyD"}};
281
+ },{}],118:[function(_dereq_,module,exports){
282
+ function cloneValue(t){return utils.extend({},t)}function getAnimationValues(t,e,i,n,a){function o(){c=new THREE.Color(i||t.getAttribute(e)),p=new THREE.Color(n),d=function(i){h.length>1&&t.setAttribute(h[0],h[1],rgbVectorToHex(i)),t.setAttribute(e,rgbVectorToHex(i))}}var s,r,u,l,d,h=e.split("."),c={},p={};return 2===h.length?function(){var e=h[0],i=h[1],n=t.components[e],a=n&&n.schema;return a&&a[i]&&"color"===a[i].type}()?o():function(){l=h[0],u=h[1],r=t.components[l],r||(t.setAttribute(l,""),r=t.components[l]),s=r.schema,c[e]=void 0===i?getComponentProperty(t,e):i,c[e]=parseProperty(c[e],s[u]),p[e]=parseProperty(n,s[u]),d=function(i){e in i&&t.setAttribute(l,u,i[e])}}():n&&isCoordinates(n)?function(){c=i?coordinates.parse(i):a,p=coordinates.parse(n),d=function(i){t.setAttribute(e,i)}}():-1!==["true","false"].indexOf(n)?function(){c[e]=void 0!==i&&strToBool(i),c[e]=boolToNum(c[e]),p[e]=boolToNum(strToBool(n)),d=function(i){t.setAttribute(e,!!i[e])}}():isNaN(n)?o():function(){c[e]=void 0===i?parseFloat(t.getAttribute(e)):parseFloat(i),p[e]=parseFloat(n),d=function(i){t.setAttribute(e,i[e])}}(),{from:c,partialSetAttribute:d,to:p}}function strToBool(t){return"true"===t}function boolToNum(t){return t?1:0}function componentToHex(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function convertToIntegerColor(t){return Math.floor(255*Math.min(Math.abs(t),1))}function rgbVectorToHex(t){return"#"+["r","g","b"].map(function(e){return componentToHex(convertToIntegerColor(t[e]))}).join("")}var ANode=_dereq_("./a-node"),animationConstants=_dereq_("../constants/animation"),coordinates=_dereq_("../utils/").coordinates,parseProperty=_dereq_("./schema").parseProperty,registerElement=_dereq_("./a-register-element").registerElement,TWEEN=_dereq_("@tweenjs/tween.js"),THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,getComponentProperty=utils.entity.getComponentProperty,DEFAULTS=animationConstants.defaults,DIRECTIONS=animationConstants.directions,EASING_FUNCTIONS=animationConstants.easingFunctions,FILLS=animationConstants.fills,REPEATS=animationConstants.repeats,isCoordinates=coordinates.isCoordinates;module.exports.AAnimation=registerElement("a-animation",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.bindMethods(),this.isRunning=!1,this.partialSetAttribute=function(){},this.tween=null}},attachedCallback:{value:function(){this.el=this.parentNode,this.handleMixinUpdate(),this.update(),this.load()}},attributeChangedCallback:{value:function(t,e,i){this.hasLoaded&&this.isRunning&&(this.stop(),this.handleMixinUpdate(),this.update())}},detachedCallback:{value:function(){this.isRunning&&this.stop()}},getTween:{value:function(){var t,e,i,n,a=this,o=a.data,s=a.el,r=o.attribute,u=parseInt(o.delay,10),l=getComponentProperty(s,r),d=a.getDirection(o.direction),h=EASING_FUNCTIONS[o.easing],c=o.fill,p=o.repeat===REPEATS.indefinite?1/0:0,v=!1;return t=getAnimationValues(s,r,o.from||a.initialValue,o.to,l),e=t.from,i=t.to,a.partialSetAttribute=t.partialSetAttribute,void 0===a.count&&(a.count=p===1/0?0:parseInt(o.repeat,10)),isNaN(u)&&(u=0),a.initialValue=a.initialValue||cloneValue(l),p===1/0&&c===FILLS.forwards&&-1!==[DIRECTIONS.alternate,DIRECTIONS.alternateReverse].indexOf(o.direction)&&(v=!0),d===DIRECTIONS.reverse&&(n=i,i=cloneValue(e),e=cloneValue(n)),-1!==[FILLS.backwards,FILLS.both].indexOf(c)&&a.partialSetAttribute(e),new TWEEN.Tween(cloneValue(e)).to(i,o.dur).delay(u).easing(h).repeat(p).yoyo(v).onUpdate(function(){a.partialSetAttribute(this)}).onComplete(bind(a.onCompleted,a))}},update:{value:function(){var t=this.data;"infinite"===t.repeat&&console.warn("Using 'infinite' as 'repeat' value is invalid. Use 'indefinite' instead."),""===t.begin||isNaN(t.begin)||(console.warn("Using 'begin' to specify a delay is deprecated. Use 'delay' instead."),t.delay=t.begin,t.begin="");var e=t.begin,i=t.end;this.evt&&this.removeEventListeners(this.evt),this.evt={begin:e,end:i},this.addEventListeners(this.evt),""===e&&(this.stop(),this.start())},writable:window.debug},onCompleted:{value:function(){var t=this.data;if(this.isRunning=!1,-1!==[FILLS.backwards,FILLS.none].indexOf(t.fill)&&this.partialSetAttribute(this.initialValue),0===this.count)return this.count=void 0,void this.emit("animationend");this.isRunning=!1,this.count--,this.start()}},start:{value:function(){var t=this;if(!this.el.hasLoaded)return void this.el.addEventListener("loaded",function(){t.start()});!this.isRunning&&this.el.isPlaying&&(this.tween=this.getTween(),this.isRunning=!0,this.tween.start(),this.emit("animationstart"))},writable:!0},stop:{value:function(){var t=this.tween;t&&(t.stop(),this.isRunning=!1,-1!==[FILLS.backwards,FILLS.none].indexOf(this.data.fill)&&this.partialSetAttribute(this.initialValue),this.emit("animationstop"))},writable:!0},getDirection:{value:function(t){return t===DIRECTIONS.alternate?(this.prevDirection=this.prevDirection===DIRECTIONS.normal?DIRECTIONS.reverse:DIRECTIONS.normal,this.prevDirection):t===DIRECTIONS.alternateReverse?(this.prevDirection=this.prevDirection===DIRECTIONS.reverse?DIRECTIONS.normal:DIRECTIONS.reverse,this.prevDirection):t}},bindMethods:{value:function(){this.start=bind(this.start,this),this.stop=bind(this.stop,this),this.onStateAdded=bind(this.onStateAdded,this),this.onStateRemoved=bind(this.onStateRemoved,this)}},addEventListeners:{value:function(t){var e=this.el,i=this;utils.splitString(t.begin).forEach(function(t){e.addEventListener(t,i.start)}),utils.splitString(t.end).forEach(function(t){e.addEventListener(t,i.stop)}),""===t.begin&&e.addEventListener("play",this.start),e.addEventListener("pause",this.stop),e.addEventListener("stateadded",this.onStateAdded),e.addEventListener("stateremoved",this.onStateRemoved)}},removeEventListeners:{value:function(t){var e=this.el,i=this.start,n=this.stop;utils.splitString(t.begin).forEach(function(t){e.removeEventListener(t,i)}),utils.splitString(t.end).forEach(function(t){e.removeEventListener(t,n)}),e.removeEventListener("stateadded",this.onStateAdded),e.removeEventListener("stateremoved",this.onStateRemoved)}},onStateAdded:{value:function(t){t.detail.state===this.data.begin&&this.start()},writable:!0},onStateRemoved:{value:function(t){t.detail.state===this.data.begin&&this.stop()},writable:!0},handleMixinUpdate:{value:function(){var t,e,i,n={};i=document.querySelector("#"+this.getAttribute("mixin")),e=i?utils.getElData(i,DEFAULTS):{},t=utils.getElData(this,DEFAULTS),utils.extend(n,DEFAULTS,e,t),this.data=n}}})}),module.exports.getAnimationValues=getAnimationValues;
283
+ },{"../constants/animation":115,"../lib/three":173,"../utils/":196,"./a-node":123,"./a-register-element":124,"./schema":133,"@tweenjs/tween.js":1}],119:[function(_dereq_,module,exports){
284
+ function mediaElementLoaded(e){if(e.hasAttribute("autoplay")||"auto"===e.getAttribute("preload"))return new Promise(function(t,r){function i(){for(var r=0,i=0;i<e.buffered.length;i++)r+=e.buffered.end(i)-e.buffered.start(i);r>=e.duration&&(THREE.Cache.files[e.getAttribute("src")]=e,t())}return 4===e.readyState?t():e.error?r():(e.addEventListener("loadeddata",i,!1),e.addEventListener("progress",i,!1),void e.addEventListener("error",r,!1))})}function fixUpMediaElement(e){var t=setCrossOrigin(e);return t.tagName&&"video"===t.tagName.toLowerCase()&&(t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline","")),t!==e&&(e.parentNode.appendChild(t),e.parentNode.removeChild(e)),t}function setCrossOrigin(e){var t;if(e.hasAttribute("crossorigin"))return e;if(null!==(t=e.getAttribute("src"))){if(-1===t.indexOf("://"))return e;if(extractDomain(t)===window.location.host)return e}return warn('Cross-origin element (e.g., <img>) was requested without `crossorigin` set. A-Frame will re-request the asset with `crossorigin` attribute set. Please set `crossorigin` on the element (e.g., <img crossorigin="anonymous">)',t),e.crossOrigin="anonymous",e.cloneNode(!0)}function extractDomain(e){return(e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0]).split(":")[0]}function inferResponseType(e){var t=e.lastIndexOf(".");if(t>=0){var r=e.slice(t,e.length);if(".gltf"===r||".glb"===r)return"arraybuffer"}return"text"}var ANode=_dereq_("./a-node"),bind=_dereq_("../utils/bind"),debug=_dereq_("../utils/debug"),registerElement=_dereq_("./a-register-element").registerElement,THREE=_dereq_("../lib/three"),fileLoader=new THREE.FileLoader,warn=debug("core:a-assets:warn");module.exports=registerElement("a-assets",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.isAssets=!0,this.fileLoader=fileLoader,this.timeout=null}},attachedCallback:{value:function(){var e,t,r,i,o,n,s=this,a=[];if(!this.parentNode.isScene)throw new Error("<a-assets> must be a child of a <a-scene>.");for(o=this.querySelectorAll("img"),e=0;e<o.length;e++)i=fixUpMediaElement(o[e]),a.push(new Promise(function(t,r){THREE.Cache.files[o[e].getAttribute("src")]=i,i.onload=t,i.onerror=r}));for(r=this.querySelectorAll("audio, video"),e=0;e<r.length;e++)t=fixUpMediaElement(r[e]),a.push(mediaElementLoaded(t));Promise.all(a).then(bind(this.load,this)),n=parseInt(this.getAttribute("timeout"),10)||3e3,this.timeout=setTimeout(function(){s.hasLoaded||(warn("Asset loading timed out in ",n,"ms"),s.emit("timeout"),s.load())},n)}},detachedCallback:{value:function(){this.timeout&&clearTimeout(this.timeout)}},load:{value:function(){ANode.prototype.load.call(this,null,function(e){return e.isAssetItem&&e.hasAttribute("src")})}}})}),registerElement("a-asset-item",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.data=null,this.isAssetItem=!0}},attachedCallback:{value:function(){var e=this,t=this.getAttribute("src");fileLoader.setResponseType(this.getAttribute("response-type")||inferResponseType(t)),fileLoader.load(t,function(t){e.data=t,setTimeout(function(){ANode.prototype.load.call(e)})},function(t){e.emit("progress",{loadedBytes:t.loaded,totalBytes:t.total,xhr:t})},function(t){e.emit("error",{xhr:t})})}}})}),module.exports.inferResponseType=inferResponseType;
285
+ },{"../lib/three":173,"../utils/bind":190,"../utils/debug":192,"./a-node":123,"./a-register-element":124}],120:[function(_dereq_,module,exports){
286
+ var debug=_dereq_("../utils/debug"),registerElement=_dereq_("./a-register-element").registerElement,warn=debug("core:cubemap:warn");module.exports=registerElement("a-cubemap",{prototype:Object.create(window.HTMLElement.prototype,{attachedCallback:{value:function(){this.srcs=this.validate()},writable:window.debug},validate:{value:function(){var e,t=this.querySelectorAll("[src]"),r=[];if(6===t.length){for(e=0;e<t.length;e++)r.push(t[e].getAttribute("src"));return r}warn("<a-cubemap> did not contain exactly six elements each with a `src` attribute.")},writable:window.debug}})});
287
+ },{"../utils/debug":192,"./a-register-element":124}],121:[function(_dereq_,module,exports){
288
+ function checkComponentDefined(t,e){return void 0!==t.defaultComponents[e]||(!(!t.components[e]||!t.components[e].attrValue)||isComponentMixedIn(e,t.mixinEls))}function getMixedInComponents(t){var e=[];return t.mixinEls.forEach(function(t){function i(t){e.push(t)}Object.keys(t.componentCache).forEach(i)}),e}function isComponentMixedIn(t,e){var i,n=!1;for(i=0;i<e.length&&!(n=e[i].hasAttribute(t));++i);return n}function mergeComponentData(t,e){return e?e.constructor===Object?utils.extend(e,utils.styleParser.parse(t||{})):t||e:t}var ANode=_dereq_("./a-node"),COMPONENTS=_dereq_("./component").components,registerElement=_dereq_("./a-register-element").registerElement,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),AEntity,bind=utils.bind,debug=utils.debug("core:a-entity:debug"),warn=utils.debug("core:a-entity:warn"),MULTIPLE_COMPONENT_DELIMITER="__",proto=Object.create(ANode.prototype,{defaultComponents:{value:{position:"",rotation:"",scale:"",visible:""}},createdCallback:{value:function(){this.components={},this.initializingComponents={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new THREE.Group,this.object3D.el=this,this.object3DMap={},this.parentEl=null,this.states=[]}},attributeChangedCallback:{value:function(t,e,i){var n=this.components[t];if(n&&n.justInitialized&&""===i)return void delete n.justInitialized;(n||null!==i)&&this.setEntityAttribute(t,e,i)}},attachedCallback:{value:function(){var t,e=this.sceneEl,i=this;if(this.addToParent(),!this.isScene){if(!e)return void this.load();if((t=e.querySelector("a-assets"))&&!t.hasLoaded)return void t.addEventListener("loaded",function(){i.load()});this.load()}}},detachedCallback:{value:function(){this.parentEl&&(Object.keys(this.components).forEach(bind(this.removeComponent,this)),this.isScene||(this.removeFromParent(),ANode.prototype.detachedCallback.call(this)))}},handleMixinUpdate:{value:function(t){if(!t)return void this.updateComponents();this.updateComponent(t,this.getDOMAttribute(t))}},mapStateMixins:{value:function(t,e){var i,n=this.getAttribute("mixin");n&&(i=n.split(" "),i.forEach(function(i){e(i+"-"+t)}),this.updateComponents())}},updateStateMixins:{value:function(t,e){var i,n=t.split(" "),o=e?e.split(" "):[],s=this;i=o.filter(function(t){return n.indexOf(t)<0}),i.forEach(function(t){var e=document.querySelectorAll("[id^="+t+"-]");Array.prototype.forEach.call(e,function(t){s.unregisterMixin(t.id)})}),this.states.forEach(function(t){n.forEach(function(e){var i=e+"-"+t;s.registerMixin(i)})})}},getObject3D:{value:function(t){return this.object3DMap[t]}},setObject3D:{value:function(t,e){var i,n=this;if(!(e instanceof THREE.Object3D))throw new Error("`Entity.setObject3D` was called with an object that was not an instance of THREE.Object3D.");i=this.getObject3D(t),i&&this.object3D.remove(i),e.el=this,e.children.length&&e.traverse(function(t){t.el=n}),this.object3D.add(e),this.object3DMap[t]=e,this.emit("object3dset",{object:e,type:t})}},removeObject3D:{value:function(t){var e=this.getObject3D(t);if(!e)return void warn("Tried to remove `Object3D` of type:",t,"which was not defined.");this.object3D.remove(e),delete this.object3DMap[t],this.emit("object3dremove",{type:t})}},getOrCreateObject3D:{value:function(t,e){var i=this.getObject3D(t);return!i&&e&&(i=new e,this.setObject3D(t,i)),i}},add:{value:function(t){if(!t.object3D)throw new Error("Trying to add an element that doesn't have an `object3D`");this.object3D.add(t.object3D),this.emit("child-attached",{el:t})}},addToParent:{value:function(){var t=this.parentEl=this.parentNode;t&&t.add&&!this.attachedToParent&&(t.add(this),this.attachedToParent=!0)}},removeFromParent:{value:function(){var t=this.parentEl;this.parentEl.remove(this),this.attachedToParent=!1,this.parentEl=this.parentNode=null,t.emit("child-detached",{el:this})}},load:{value:function(){var t=this;!this.hasLoaded&&this.parentEl&&ANode.prototype.load.call(this,function(){t.parentEl&&(t.updateComponents(),(t.isScene||t.parentEl.isPlaying)&&t.play())})},writable:window.debug},remove:{value:function(t){this.object3D.remove(t.object3D)}},getChildEntities:{value:function(){for(var t=this.children,e=[],i=0;i<t.length;i++){var n=t[i];n instanceof AEntity&&e.push(n)}return e}},initComponent:{value:function(t,e,i){var n,o=t.split(MULTIPLE_COMPONENT_DELIMITER),s=o[1],a=o[0],r=checkComponentDefined(this,t)||void 0!==e;if(COMPONENTS[a]&&(r||i)&&!(t in this.components)){if(this.initComponentDependencies(a),s&&!COMPONENTS[a].multiple)throw new Error("Trying to initialize multiple components of type `"+a+"`. There can only be one component of this type per entity.");n=new COMPONENTS[a].Component(this,e,s),this.isPlaying&&n.play(),this.hasAttribute(t)||(n.justInitialized=!0,window.HTMLElement.prototype.setAttribute.call(this,t,"")),debug("Component initialized: %s",t)}},writable:window.debug},initComponentDependencies:{value:function(t){var e,i=this,n=COMPONENTS[t];n&&(e=COMPONENTS[t].dependencies)&&e.forEach(function(t){i.initComponent(t,window.HTMLElement.prototype.getAttribute.call(i,t)||void 0,!0)})}},removeComponent:{value:function(t){var e,i,n;if(i=t in this.defaultComponents,n=isComponentMixedIn(t,this.mixinEls),!i&&!n&&(e=this.components[t])){if(!e.initialized)return void this.addEventListener("componentinitialized",function e(i){i.detail.name===t&&(this.removeComponent(t),this.removeEventListener("componentinitialized",e))});e.pause(),e.remove(),delete this.components[t],this.emit("componentremoved",{id:e.id,name:t})}},writable:window.debug},updateComponents:{value:function(){function t(t){var e=t.split(MULTIPLE_COMPONENT_DELIMITER)[0];COMPONENTS[e]&&(n[t]=!0)}function e(t){var e=mergeComponentData(s.getDOMAttribute(t),o[t]);delete n[t],s.updateComponent(t,e)}var i,n={},o={},s=this;if(this.hasLoaded){for(getMixedInComponents(this).forEach(t),this.getExtraComponents&&(o=this.getExtraComponents(),Object.keys(o).forEach(t)),i=0;i<this.attributes.length;++i)t(this.attributes[i].name);Object.keys(this.defaultComponents).forEach(e),Object.keys(n).forEach(e)}},writable:window.debug},updateComponent:{value:function(t,e,i){var n=this.components[t],o=t in this.defaultComponents;if(n)return null!==e||o?void n.updateProperties(e,i):void this.removeComponent(t);this.initComponent(t,e,!1)}},removeAttribute:{value:function(t,e){var i=this.components[t];if(!i||void 0!==e||(this.setEntityAttribute(t,void 0,null),!this.components[t])){if(i&&void 0!==e)return void i.resetProperty(e);"mixin"===t&&this.mixinUpdate(""),window.HTMLElement.prototype.removeAttribute.call(this,t)}}},play:{value:function(){var t=this.components,e=Object.keys(t);!this.isPlaying&&this.hasLoaded&&(this.isPlaying=!0,e.forEach(function(e){t[e].play()}),this.getChildEntities().forEach(function(t){t.play()}),this.emit("play"))},writable:!0},pause:{value:function(){var t=this.components,e=Object.keys(t);this.isPlaying&&(this.isPlaying=!1,e.forEach(function(e){t[e].pause()}),this.getChildEntities().forEach(function(t){t.pause()}),this.emit("pause"))},writable:!0},setEntityAttribute:{value:function(t,e,i){return COMPONENTS[t]||this.components[t]?void this.updateComponent(t,i):"mixin"===t?void this.mixinUpdate(i,e):void 0}},mixinUpdate:{value:function(t,e){e=e||this.getAttribute("mixin"),this.updateMixins(t,e),this.updateStateMixins(t,e),this.updateComponents()}},setAttribute:{value:function(t,e,i){var n,o,s,a,r;if(a=t.indexOf(MULTIPLE_COMPONENT_DELIMITER),s=a>0?t.substring(0,a):t,!COMPONENTS[s])return void function(t,e,i){ANode.prototype.setAttribute.call(t,e,i),"mixin"===e&&t.mixinUpdate(i)}(this,t,e);!this.components[t]&&this.hasAttribute(t)&&this.updateComponent(t,window.HTMLElement.prototype.getAttribute.call(this,t)),void 0!==i&&"string"==typeof e&&e.length>0&&"string"==typeof utils.styleParser.parse(e)?(n={},n[e]=i,o=!1):(n=e,o=!0===i),this.updateComponent(t,n,o),(r=this.sceneEl&&this.sceneEl.getAttribute("debug"))&&this.components[t].flushToDOM()},writable:window.debug},flushToDOM:{value:function(t){var e,i,n=this.components,o=this.defaultComponents,s=this.children;if(Object.keys(n).forEach(function(t){n[t].flushToDOM(t in o)}),t)for(i=0;i<s.length;++i)e=s[i],e.flushToDOM&&e.flushToDOM(t)}},getAttribute:{value:function(t){var e=this.components[t];return e?e.data:window.HTMLElement.prototype.getAttribute.call(this,t)},writable:window.debug},getComputedAttribute:{value:function(t){return warn("`getComputedAttribute` is deprecated. Use `getAttribute` instead."),this.getAttribute(t)}},getDOMAttribute:{value:function(t){var e=this.components[t];return e?e.attrValue:window.HTMLElement.prototype.getAttribute.call(this,t)},writable:window.debug},addState:{value:function(t){this.is(t)||(this.states.push(t),this.mapStateMixins(t,bind(this.registerMixin,this)),this.emit("stateadded",{state:t}))}},removeState:{value:function(t){var e=this.states.indexOf(t);-1!==e&&(this.states.splice(e,1),this.mapStateMixins(t,bind(this.unregisterMixin,this)),this.emit("stateremoved",{state:t}))}},is:{value:function(t){return-1!==this.states.indexOf(t)}}});AEntity=registerElement("a-entity",{prototype:proto}),module.exports=AEntity;
289
+ },{"../lib/three":173,"../utils/":196,"./a-node":123,"./a-register-element":124,"./component":125}],122:[function(_dereq_,module,exports){
290
+ var ANode=_dereq_("./a-node"),registerElement=_dereq_("./a-register-element").registerElement,components=_dereq_("./component").components,MULTIPLE_COMPONENT_DELIMITER="__";module.exports=registerElement("a-mixin",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.componentCache={},this.id=this.getAttribute("id")}},attributeChangedCallback:{value:function(t,e,i){this.cacheAttribute(t,i)}},attachedCallback:{value:function(){this.sceneEl=this.closestScene(),this.cacheAttributes(),this.updateEntities(),this.load()}},setAttribute:{value:function(t,e){this.cacheAttribute(t,e),window.HTMLElement.prototype.setAttribute.call(this,t,e)}},cacheAttribute:{value:function(t,e){var i=t.split(MULTIPLE_COMPONENT_DELIMITER)[0],n=components[i];n&&(void 0===e&&(e=window.HTMLElement.prototype.getAttribute.call(this,t)),this.componentCache[t]=n.parseAttrValueForCache(e))}},getAttribute:{value:function(t){return this.componentCache[t]||window.HTMLElement.prototype.getAttribute.call(this,t)}},cacheAttributes:{value:function(){var t,e,i=this.attributes;for(e=0;e<i.length;e++)t=i[e].name,this.cacheAttribute(t)}},updateEntities:{value:function(){if(this.sceneEl)for(var t=this.sceneEl.querySelectorAll("[mixin~="+this.id+"]"),e=0;e<t.length;e++){var i=t[e];i.hasLoaded&&(i.registerMixin(this.id),Object.keys(this.componentCache).forEach(function(t){i.updateComponent(t)}))}}}})});
291
+ },{"./a-node":123,"./a-register-element":124,"./component":125}],123:[function(_dereq_,module,exports){
292
+ var registerElement=_dereq_("./a-register-element").registerElement,isNode=_dereq_("./a-register-element").isNode,utils=_dereq_("../utils/"),bind=utils.bind,warn=utils.debug("core:a-node:warn");module.exports=registerElement("a-node",{prototype:Object.create(window.HTMLElement.prototype,{createdCallback:{value:function(){this.hasLoaded=!1,this.isNode=!0,this.mixinEls=[],this.mixinObservers={}},writable:window.debug},attachedCallback:{value:function(){var e;this.sceneEl=this.closestScene(),this.sceneEl||warn("You are attempting to attach <"+this.tagName+"> outside of an A-Frame scene. Append this element to `<a-scene>` instead."),this.hasLoaded=!1,this.emit("nodeready",{},!1),(e=this.getAttribute("mixin"))&&this.updateMixins(e)},writable:window.debug},attributeChangedCallback:{value:function(e,t,i){"mixin"===e&&this.updateMixins(i,t)}},closestScene:{value:function(){for(var e=this;e&&!e.isScene;)e=e.parentElement;return e}},closest:{value:function(e){for(var t=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,i=this;i&&!t.call(i,e);)i=i.parentElement;return i}},detachedCallback:{value:function(){this.hasLoaded=!1}},load:{value:function(e,t){var i,n,s=this;this.hasLoaded||(t=t||isNode,i=this.getChildren(),n=i.filter(t).map(function(e){return new Promise(function(t){if(e.hasLoaded)return t();e.addEventListener("loaded",t)})}),Promise.all(n).then(function(){s.hasLoaded=!0,e&&e(),s.emit("loaded",{},!1)}))},writable:!0},getChildren:{value:function(){return Array.prototype.slice.call(this.children,0)}},updateMixins:{value:function(e,t){var i=e?e.trim().split(/\s+/):[];(t?t.trim().split(/\s+/):[]).filter(function(e){return i.indexOf(e)<0}).forEach(bind(this.unregisterMixin,this)),this.mixinEls=[],i.forEach(bind(this.registerMixin,this))}},registerMixin:{value:function(e){if(this.sceneEl){var t=this.sceneEl.querySelector("a-mixin#"+e);t&&(this.attachMixinListener(t),this.mixinEls.push(t))}}},setAttribute:{value:function(e,t){"mixin"===e&&this.updateMixins(t),window.HTMLElement.prototype.setAttribute.call(this,e,t)}},unregisterMixin:{value:function(e){var t,i,n=this.mixinEls;for(i=0;i<n.length;++i)if(t=n[i],e===t.id){n.splice(i,1);break}this.removeMixinListener(e)}},removeMixinListener:{value:function(e){var t=this.mixinObservers[e];t&&(t.disconnect(),this.mixinObservers[e]=null)}},attachMixinListener:{value:function(e){var t=this,i=e.id,n=this.mixinObservers[i];if(e&&!n){var s=new MutationObserver(function(e){var i=e[0].attributeName;t.handleMixinUpdate(i)}),r={attributes:!0};s.observe(e,r),this.mixinObservers[i]=s}}},handleMixinUpdate:{value:function(){}},emit:{value:function(e,t,i,n){var s=this;t=t||{},void 0===i&&(i=!0);var r={bubbles:!!i,detail:t};return n&&utils.extend(r,n),e.split(" ").map(function(e){return utils.fireEvent(s,e,r)})},writable:window.debug},emitter:{value:function(e,t,i){var n=this;return function(){n.emit(e,t,i)}}}})});
293
+ },{"../utils/":196,"./a-register-element":124}],124:[function(_dereq_,module,exports){
294
+ function addTagName(e){knownTags[e.toLowerCase()]=!0}function wrapANodeMethods(e){var t={};return wrapMethods(t,["attachedCallback","attributeChangedCallback","createdCallback"],e,ANode.prototype),copyProperties(e,t),t}function wrapAEntityMethods(e){var t={},o=["attachedCallback","attributeChangedCallback","createdCallback"],a=["attachedCallback","attributeChangedCallback","createdCallback","detachedCallback"];return wrapMethods(t,o,e,ANode.prototype),wrapMethods(t,a,e,AEntity.prototype),copyProperties(e,t),t}function wrapMethods(e,t,o,a){t.forEach(function(t){wrapMethod(e,t,o,a)})}function wrapMethod(e,t,o,a){var r=o[t],n=a[t];r&&n&&r!==n&&(e[t]={value:function(){return n.apply(this,arguments),r.apply(this,arguments)},writable:window.debug})}function copyProperties(e,t){Object.getOwnPropertyNames(e).forEach(function(o){var a;t[o]||(a=Object.getOwnPropertyDescriptor(e,o),t[o]={value:e[o],writable:a.writable})})}_dereq_("document-register-element");var ANode,AEntity,knownTags=module.exports.knownTags={};module.exports.isNode=function(e){return e.tagName.toLowerCase()in knownTags||e.isNode},module.exports.registerElement=function(e,t){var o=Object.getPrototypeOf(t.prototype),a=t,r=ANode&&o===ANode.prototype,n=AEntity&&o===AEntity.prototype;return(r||n)&&addTagName(e),r&&(a=wrapANodeMethods(t.prototype),a={prototype:Object.create(o,a)}),n&&(a=wrapAEntityMethods(t.prototype),a={prototype:Object.create(o,a)}),document.registerElement(e,a)},module.exports.wrapMethods=wrapMethods,ANode=_dereq_("./a-node"),AEntity=_dereq_("./a-entity");
295
+ },{"./a-entity":121,"./a-node":123,"document-register-element":13}],125:[function(_dereq_,module,exports){
296
+ function extendProperties(e,t,i){return!i||null!==t&&"object"==typeof t?utils.extend(e,t):t}function hasBehavior(e){return e.tick||e.tock}function wrapPause(e){return function(){var t=this.el.sceneEl;this.isPlaying&&(e.call(this),this.isPlaying=!1,hasBehavior(this)&&t.removeBehavior(this))}}function wrapPlay(e){return function(){var t=this.el.sceneEl,i=this.el.isPlaying&&!this.isPlaying;this.initialized&&i&&(e.call(this),this.isPlaying=!0,hasBehavior(this)&&t.addBehavior(this))}}var schema=_dereq_("./schema"),scenes=_dereq_("./scene/scenes"),systems=_dereq_("./system"),utils=_dereq_("../utils/"),components=module.exports.components={},parseProperties=schema.parseProperties,parseProperty=schema.parseProperty,processSchema=schema.process,isSingleProp=schema.isSingleProperty,stringifyProperties=schema.stringifyProperties,stringifyProperty=schema.stringifyProperty,styleParser=utils.styleParser,warn=utils.debug("core:component:warn"),aframeScript=document.currentScript,upperCaseRegExp=new RegExp("[A-Z]+"),Component=module.exports.Component=function(e,t,i){var r=this;this.el=e,this.id=i,this.attrName=this.name+(i?"__"+i:""),this.initialized=!1,this.el.components[this.attrName]=this,this.oldData=void 0,this.previousAttrValue=void 0,this.throttledEmitComponentChanged=utils.throttle(function(t){e.emit("componentchanged",{id:r.id,name:r.name,newData:r.data,oldData:t},!1)},200),this.updateProperties(t)};if(Component.prototype={schema:{},init:function(){},update:function(e){},updateSchema:void 0,tick:void 0,tock:void 0,play:function(){},pause:function(){},remove:function(){},parse:function(e,t){var i=this.schema;return isSingleProp(i)?parseProperty(e,i):parseProperties(styleParser.parse(e),i,!0,this.name,t)},stringify:function(e){var t=this.schema;return"string"==typeof e?e:isSingleProp(t)?stringifyProperty(e,t):(e=stringifyProperties(e,t),styleParser.stringify(e))},getData:function(){var e=this.data;return"object"!=typeof e?e:utils.extend({},e)},updateCachedAttrValue:function(e,t){var i,r=this.parseAttrValueForCache(e),s=isSingleProp(this.schema);if(void 0!==e){if(!s&&!t&&this.attrValue)for(i in this.attrValue)i in r||(r[i]=this.attrValue[i]);this.attrValue=extendProperties({},r,s)}},parseAttrValueForCache:function(e){var t;return"string"!=typeof e?e:(isSingleProp(this.schema)?"string"==typeof(t=this.schema.parse(e))&&(t=e):t=styleParser.parse(e),t)},flushToDOM:function(e){var t=e?this.data:this.attrValue;t&&window.HTMLElement.prototype.setAttribute.call(this.el,this.attrName,this.stringify(t))},updateProperties:function(e,t){var i,r,s=this.el,a=this.oldData;if(!s.hasLoaded)return void this.updateCachedAttrValue(e);if(i=isSingleProp(this.schema),r=null!==e&&"object"==typeof this.previousAttrValue&&e===this.previousAttrValue,this.previousAttrValue=e,e=this.parseAttrValueForCache(e),this.updateSchema&&this.updateSchema(this.buildData(e,!1,!0)),this.data=this.buildData(e,t,!1,r),this.updateCachedAttrValue(e,t),this.initialized){if(!r&&utils.deepEqual(this.oldData,this.data))return;this.oldData=extendProperties({},this.data,i),this.update(a),this.throttledEmitComponentChanged(a)}else{if(s.initializingComponents[this.name])return;s.initializingComponents[this.name]=!0,this.init(),this.initialized=!0,delete s.initializingComponents[this.name],a=i&&"object"!=typeof parseProperty(void 0,this.schema)?void 0:{},this.oldData=extendProperties({},this.data,i),this.update(a),s.isPlaying&&this.play(),s.emit("componentinitialized",{id:this.id,name:this.name,data:this.getData()},!1)}},resetProperty:function(e){if(isSingleProp(this.schema))this.attrValue=void 0;else{if(!(e in this.attrValue))return;delete this.attrValue[e]}this.updateProperties(this.attrValue)},extendSchema:function(e){var t=utils.extend({},components[this.name].schema);utils.extend(t,e),this.schema=processSchema(t),this.el.emit("schemachanged",{component:this.name})},buildData:function(e,t,i,r){var s,a,o=this,n=void 0!==e&&null!==e,p=this.schema,h=isSingleProp(p),c=this.el.mixinEls;if(h?s="object"==typeof p.default?utils.extend({},p.default):p.default:(a=!t&&this.attrValue,s="object"==typeof a?utils.extend({},a):{},Object.keys(p).forEach(function(e){var t=p[e].default;void 0===s[e]&&(s[e]=t&&t.constructor===Object?utils.extend({},t):t)})),c.forEach(function(e){var t=e.getAttribute(o.attrName);t&&(s=extendProperties(s,t,h))}),n){if(h)return!0===r?e:parseProperty(e,p);s=extendProperties(s,e,h)}else{if(!0===r)return s;if(h)return parseProperty(s,p)}return!0===r?s:parseProperties(s,p,void 0,this.name,i)}},window.debug)var registrationOrderWarnings=module.exports.registrationOrderWarnings={};module.exports.registerComponent=function(e,t){var i,r={};if(document.currentScript&&document.currentScript!==aframeScript&&scenes.forEach(function(t){t.hasLoaded||document.currentScript.compareDocumentPosition(t)!==Node.DOCUMENT_POSITION_FOLLOWING&&(warn("The component `"+e+"` was registered in a <script> tag after the scene. Component <script> tags in an HTML file should be declared *before* the scene such that the component is available to entities during scene initialization."),window.debug&&(registrationOrderWarnings[e]=!0))}),!0===upperCaseRegExp.test(e)&&warn("The component name `"+e+"` contains uppercase characters, but HTML will ignore the capitalization of attribute names. Change the name to be lowercase: `"+e.toLowerCase()+"`"),-1!==e.indexOf("__"))throw new Error("The component name `"+e+"` is not allowed. The sequence __ (double underscore) is reserved to specify an id for multiple components of the same type");if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),components[e])throw new Error("The component `"+e+"` has been already registered. Check that you are not loading two versions of the same component or two different components of the same name.");return i=function(e,t,i){Component.call(this,e,t,i)},i.prototype=Object.create(Component.prototype,r),i.prototype.name=e,i.prototype.constructor=i,i.prototype.system=systems&&systems.systems[e],i.prototype.play=wrapPlay(i.prototype.play),i.prototype.pause=wrapPause(i.prototype.pause),components[e]={Component:i,dependencies:i.prototype.dependencies,isSingleProp:isSingleProp(i.prototype.schema),multiple:i.prototype.multiple,parse:i.prototype.parse,parseAttrValueForCache:i.prototype.parseAttrValueForCache,schema:utils.extend(processSchema(i.prototype.schema,i.prototype.name)),stringify:i.prototype.stringify,type:i.prototype.type},i};
297
+ },{"../utils/":196,"./scene/scenes":131,"./schema":133,"./system":135}],126:[function(_dereq_,module,exports){
298
+ var schema=_dereq_("./schema"),processSchema=schema.process,geometries=module.exports.geometries={},geometryNames=module.exports.geometryNames=[],THREE=_dereq_("../lib/three"),Geometry=module.exports.Geometry=function(){};Geometry.prototype={schema:{},init:function(e){return this.geometry=new THREE.Geometry,this.geometry},update:function(e){}},module.exports.registerGeometry=function(e,t){var r,o={};if(Object.keys(t).forEach(function(e){o[e]={value:t[e],writable:!0}}),geometries[e])throw new Error("The geometry `"+e+"` has been already registered");return r=function(){Geometry.call(this)},r.prototype=Object.create(Geometry.prototype,o),r.prototype.name=e,r.prototype.constructor=r,geometries[e]={Geometry:r,schema:processSchema(r.prototype.schema)},geometryNames.push(e),r};
299
+ },{"../lib/three":173,"./schema":133}],127:[function(_dereq_,module,exports){
300
+ function registerPropertyType(e,r,t,i){if("type"in propertyTypes)return void error("Property type "+e+" is already registered.");propertyTypes[e]={default:r,parse:t||defaultParse,stringify:i||defaultStringify}}function arrayParse(e){function r(e){return e.trim()}return Array.isArray(e)?e:e&&"string"==typeof e?e.split(",").map(r):[]}function arrayStringify(e){return e.join(", ")}function assetParse(e){var r,t;return"string"!=typeof e?e:(t=e.match(/\url\((.+)\)/),t?t[1]:"#"===e.charAt(0)?(r=document.getElementById(e.substring(1)))?"CANVAS"===r.tagName||"VIDEO"===r.tagName||"IMG"===r.tagName?r:r.getAttribute("src"):void warn('"'+e+'" asset not found.'):e)}function defaultParse(e){return e}function defaultStringify(e){return null===e?"null":e.toString()}function boolParse(e){return"false"!==e&&!1!==e}function intParse(e){return parseInt(e,10)}function numberParse(e){return parseFloat(e,10)}function selectorParse(e){return e?"string"!=typeof e?e:"#"!==e[0]||nonCharRegex.test(e)?document.querySelector(e):document.getElementById(e.substring(1)):null}function selectorAllParse(e){return e?"string"!=typeof e?e:Array.prototype.slice.call(document.querySelectorAll(e),0):null}function selectorStringify(e){return e.getAttribute?"#"+e.getAttribute("id"):defaultStringify(e)}function selectorAllStringify(e){return e instanceof Array?e.map(function(e){return"#"+e.getAttribute("id")}).join(", "):defaultStringify(e)}function srcParse(e){return warn("`src` property type is deprecated. Use `asset` instead."),assetParse(e)}function vecParse(e){return coordinates.parse(e,this.default)}function isValidDefaultValue(e,r){return("audio"!==e||"string"==typeof r)&&(!("array"===e&&!Array.isArray(r))&&(("asset"!==e||"string"==typeof r)&&(("boolean"!==e||"boolean"==typeof r)&&(("color"!==e||"string"==typeof r)&&(("int"!==e||"number"==typeof r)&&(("number"!==e||"number"==typeof r)&&(("map"!==e||"string"==typeof r)&&(("model"!==e||"string"==typeof r)&&(("selector"!==e||"string"==typeof r)&&(("selectorAll"!==e||"string"==typeof r)&&(("src"!==e||"string"==typeof r)&&(("string"!==e||"string"==typeof r)&&(("time"!==e||"number"==typeof r)&&("vec2"===e?isValidDefaultCoordinate(r,2):"vec3"===e?isValidDefaultCoordinate(r,3):"vec4"!==e||isValidDefaultCoordinate(r,4)))))))))))))))}function isValidDefaultCoordinate(e,r){if(null===e)return!0;if("object"!=typeof e)return!1;if(Object.keys(e).length!==r)return!1;var t=e.x,i=e.y,n=e.z,o=e.w;return"number"==typeof t&&"number"==typeof i&&(!(r>2&&"number"!=typeof n)&&!(r>3&&"number"!=typeof o))}var coordinates=_dereq_("../utils/coordinates"),debug=_dereq_("debug"),error=debug("core:propertyTypes:warn"),warn=debug("core:propertyTypes:warn"),propertyTypes=module.exports.propertyTypes={},nonCharRegex=/[,> .[\]:]/;registerPropertyType("audio","",assetParse),registerPropertyType("array",[],arrayParse,arrayStringify),registerPropertyType("asset","",assetParse),registerPropertyType("boolean",!1,boolParse),registerPropertyType("color","#FFF",defaultParse,defaultStringify),registerPropertyType("int",0,intParse),registerPropertyType("number",0,numberParse),registerPropertyType("map","",assetParse),registerPropertyType("model","",assetParse),registerPropertyType("selector","",selectorParse,selectorStringify),registerPropertyType("selectorAll","",selectorAllParse,selectorAllStringify),registerPropertyType("src","",srcParse),registerPropertyType("string","",defaultParse,defaultStringify),registerPropertyType("time",0,intParse),registerPropertyType("vec2",{x:0,y:0},vecParse,coordinates.stringify),registerPropertyType("vec3",{x:0,y:0,z:0},vecParse,coordinates.stringify),registerPropertyType("vec4",{x:0,y:0,z:0,w:0},vecParse,coordinates.stringify),module.exports.registerPropertyType=registerPropertyType,module.exports.isValidDefaultValue=isValidDefaultValue,module.exports.isValidDefaultCoordinate=isValidDefaultCoordinate;
301
+ },{"../utils/coordinates":191,"debug":10}],128:[function(_dereq_,module,exports){
302
+ function getCanvasSize(e,t){return t?{height:e.parentElement.offsetHeight,width:e.parentElement.offsetWidth}:{height:window.innerHeight,width:window.innerWidth}}function requestFullscreen(e){(e.requestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen).apply(e)}function exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}function shouldAntiAlias(e){return null!==e.getAttribute("antialias")?"true"===e.getAttribute("antialias"):!e.isMobile}var initMetaTags=_dereq_("./metaTags").inject,initWakelock=_dereq_("./wakelock"),re=_dereq_("../a-register-element"),scenes=_dereq_("./scenes"),systems=_dereq_("../system").systems,THREE=_dereq_("../../lib/three"),TWEEN=_dereq_("@tweenjs/tween.js"),utils=_dereq_("../../utils/"),AEntity=_dereq_("../a-entity"),ANode=_dereq_("../a-node"),initPostMessageAPI=_dereq_("./postMessage"),bind=utils.bind,isIOS=utils.device.isIOS(),isMobile=utils.device.isMobile(),registerElement=re.registerElement,warn=utils.debug("core:a-scene:warn");module.exports.AScene=registerElement("a-scene",{prototype:Object.create(AEntity.prototype,{defaultComponents:{value:{canvas:"",inspector:"","keyboard-shortcuts":"",screenshot:"","vr-mode-ui":""}},createdCallback:{value:function(){this.isIOS=isIOS,this.isMobile=isMobile,this.isScene=!0,this.object3D=new THREE.Scene,this.render=bind(this.render,this),this.systems={},this.time=0,this.init()}},init:{value:function(){this.behaviors={tick:[],tock:[]},this.hasLoaded=!1,this.isPlaying=!1,this.originalHTML=this.innerHTML,this.renderTarget=null,this.addEventListener("render-target-loaded",function(){this.setupRenderer(),this.resize()}),this.addFullScreenStyles(),initPostMessageAPI(this)},writable:!0},addFullScreenStyles:{value:function(){document.documentElement.classList.add("a-html"),document.body.classList.add("a-body"),this.classList.add("fullscreen")}},removeFullScreenStyles:{value:function(){document.documentElement.classList.remove("a-html"),document.body.classList.remove("a-body"),this.classList.remove("fullscreen")}},attachedCallback:{value:function(){var e,t=this;initMetaTags(this),initWakelock(this),this.initSystems(),e=bind(this.resize,this),window.addEventListener("load",e),window.addEventListener("resize",e),this.play(),scenes.push(this),this.onVRPresentChangeBound=bind(this.onVRPresentChange,this),window.addEventListener("vrdisplaypresentchange",this.onVRPresentChangeBound),window.addEventListener("vrdisplayactivate",function(){t.enterVR()}),window.addEventListener("vrdisplaydeactivate",function(){t.exitVR()})},writable:window.debug},initSystems:{value:function(){Object.keys(systems).forEach(bind(this.initSystem,this))}},initSystem:{value:function(e){this.systems[e]||(this.systems[e]=new systems[e](this))}},detachedCallback:{value:function(){var e;this.effect&&this.effect.cancelAnimationFrame?this.effect.cancelAnimationFrame(this.animationFrameID):window.cancelAnimationFrame(this.animationFrameID),this.animationFrameID=null,e=scenes.indexOf(this),scenes.splice(e,1),window.removeEventListener("vrdisplaypresentchange",this.onVRPresentChangeBound)}},addBehavior:{value:function(e){var t=this,i=this.behaviors;Object.keys(i).forEach(function(i){if(e[i]){var s=t.behaviors[i];-1===s.indexOf(e)&&s.push(e)}})}},checkHeadsetConnected:{value:utils.device.checkHeadsetConnected,writable:window.debug},enterVR:{value:function(e){function t(){s.addState("vr-mode"),s.emit("enter-vr",{target:s}),s.isMobile&&screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape"),s.addFullScreenStyles(),s.isMobile||s.checkHeadsetConnected()||requestFullscreen(s.canvas),s.resize()}function i(e){throw e&&e.message?new Error("Failed to enter VR mode (`requestPresent`): "+e.message):new Error("Failed to enter VR mode (`requestPresent`).")}var s=this;return this.is("vr-mode")?Promise.resolve("Already in VR."):e||!this.checkHeadsetConnected()&&!this.isMobile?(t(),Promise.resolve()):this.effect.requestPresent().then(t,i)}},exitVR:{value:function(e){function t(){s.removeState("vr-mode"),s.isMobile&&screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),s.hasAttribute("embedded")&&s.removeFullScreenStyles(),s.resize(),s.isIOS&&utils.forceCanvasResizeSafariMobile(this.canvas),s.emit("exit-vr",{target:s})}function i(e){throw e&&e.message?new Error("Failed to exit VR mode (`exitPresent`): "+e.message):new Error("Failed to exit VR mode (`exitPresent`).")}var s=this;return this.is("vr-mode")?(exitFullscreen(),e||!this.checkHeadsetConnected()&&!this.isMobile?(t(),Promise.resolve()):this.effect.exitPresent().then(t,i)):Promise.resolve("Not in VR.")}},onVRPresentChange:{value:function(e){if(e.display.isPresenting)return void this.enterVR(!0);this.exitVR(!0)}},getAttribute:{value:function(e){var t=this.systems[e];return t?t.data:AEntity.prototype.getAttribute.call(this,e)}},getComputedAttribute:{value:function(e){warn("`getComputedAttribute` is deprecated. Use `getAttribute` instead."),this.getAttribute(e)}},getDOMAttribute:{value:function(e){var t=this.systems[e];return t?t.data:AEntity.prototype.getDOMAttribute.call(this,e)}},setAttribute:{value:function(e,t,i){var s=this.systems[e];if(s)return ANode.prototype.setAttribute.call(this,e,t),void s.updateProperties(t);AEntity.prototype.setAttribute.call(this,e,t,i)}},removeBehavior:{value:function(e){var t=this,i=this.behaviors;Object.keys(i).forEach(function(i){if(e[i]){var s=t.behaviors[i],n=s.indexOf(e);-1!==n&&s.splice(n,1)}})}},resize:{value:function(){var e,t=this.camera,i=this.canvas,s=this.getAttribute("embedded")&&!this.is("vr-mode");!t||!i||this.is("vr-mode")&&isMobile||(e=getCanvasSize(i,s),t.aspect=e.width/e.height,t.updateProjectionMatrix(),this.renderer.setSize(e.width,e.height))},writable:window.debug},setupRenderer:{value:function(){var e=this.renderer=new THREE.WebGLRenderer({canvas:this.canvas,antialias:shouldAntiAlias(this),alpha:!0});e.setPixelRatio(window.devicePixelRatio),e.sortObjects=!1,this.effect=new THREE.VREffect(e),this.effect.autoSubmitFrame=!1},writable:window.debug},play:{value:function(){var e=this;if(this.renderStarted)return void AEntity.prototype.play.call(this);this.addEventListener("loaded",function(){function e(e){e.renderStarted||(e.resize(),e.renderer&&(window.performance&&window.performance.mark("render-started"),e.clock=new THREE.Clock,e.render(),e.renderStarted=!0,e.emit("renderstart")))}if(AEntity.prototype.play.call(this),this.camera)return void e(this);this.addEventListener("camera-set-active",function(){e(this)})}),setTimeout(function(){AEntity.prototype.load.call(e)})}},reload:{value:function(e){function t(){i.isPlaying&&AEntity.prototype.play.call(i)}var i=this;e&&this.pause(),this.innerHTML=this.originalHTML,this.init(),ANode.prototype.load.call(this,t)}},updateComponent:{value:function(e){e in systems||AEntity.prototype.updateComponent.apply(this,arguments)}},tick:{value:function(e,t){var i=this.systems;TWEEN.update(),this.behaviors.tick.forEach(function(i){i.el.isPlaying&&i.tick(e,t)}),Object.keys(i).forEach(function(s){i[s].tick&&i[s].tick(e,t)})}},tock:{value:function(e,t){var i=this.systems;this.behaviors.tock.forEach(function(i){i.el.isPlaying&&i.tock(e,t)}),Object.keys(i).forEach(function(s){i[s].tock&&i[s].tock(e,t)})}},render:{value:function(){var e=this.effect,t=1e3*this.clock.getDelta();this.time=1e3*this.clock.elapsedTime,this.isPlaying&&this.tick(this.time,t),this.animationFrameID=e.requestAnimationFrame(this.render),e.render(this.object3D,this.camera,this.renderTarget),this.isPlaying&&this.tock(this.time,t),this.effect.submitFrame()},writable:!0}})}),module.exports.shouldAntiAlias=shouldAntiAlias;
303
+ },{"../../lib/three":173,"../../utils/":196,"../a-entity":121,"../a-node":123,"../a-register-element":124,"../system":135,"./metaTags":129,"./postMessage":130,"./scenes":131,"./wakelock":132,"@tweenjs/tween.js":1}],129:[function(_dereq_,module,exports){
304
+ function Meta(e){return{tagName:"meta",attributes:e,exists:function(){return document.querySelector('meta[name="'+e.name+'"]')}}}function Link(e){return{tagName:"link",attributes:e,exists:function(){return document.querySelector('link[rel="'+e.rel+'"]')}}}function createTag(e){if(e&&e.tagName){var t=document.createElement(e.tagName);return t.setAttribute(constants.AFRAME_INJECTED,""),extend(t,e.attributes)}}var constants=_dereq_("../../constants/"),extend=_dereq_("../../utils").extend,MOBILE_HEAD_TAGS=module.exports.MOBILE_HEAD_TAGS=[Meta({name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui"}),Meta({name:"mobile-web-app-capable",content:"yes"}),Meta({name:"theme-color",content:"black"})],MOBILE_IOS_HEAD_TAGS=[Meta({name:"apple-mobile-web-app-capable",content:"yes"}),Meta({name:"apple-mobile-web-app-status-bar-style",content:"black"}),Link({rel:"apple-touch-icon",href:"https://aframe.io/images/aframe-logo-152.png"})];module.exports.inject=function(e){function t(e){e&&!e.exists()&&(a=createTag(e))&&(r?r.parentNode.insertBefore(a,r):n.appendChild(a),i.push(a))}var a,n=document.head,r=n.querySelector("script"),i=[];return MOBILE_HEAD_TAGS.forEach(t),e.isIOS&&MOBILE_IOS_HEAD_TAGS.forEach(t),i};
305
+ },{"../../constants/":116,"../../utils":196}],130:[function(_dereq_,module,exports){
306
+ function postMessageAPIHandler(e){var a=this;if(e.data)switch(e.data.type){case"vr":switch(e.data.data){case"enter":a.enterVR();break;case"exit":a.exitVR()}}}var bind=_dereq_("../../utils/bind"),isIframed=_dereq_("../../utils/").isIframed;module.exports=function(e){isIframed()&&window.addEventListener("message",bind(postMessageAPIHandler,e))};
307
+ },{"../../utils/":196,"../../utils/bind":190}],131:[function(_dereq_,module,exports){
308
+ module.exports=[];
309
+ },{}],132:[function(_dereq_,module,exports){
310
+ var Wakelock=_dereq_("../../../vendor/wakelock/wakelock");module.exports=function(e){if(e.isMobile){var n=e.wakelock=new Wakelock;e.addEventListener("enter-vr",function(){n.request()}),e.addEventListener("exit-vr",function(){n.release()})}};
311
+ },{"../../../vendor/wakelock/wakelock":206}],133:[function(_dereq_,module,exports){
312
+ function isSingleProperty(e){return"type"in e?"string"==typeof e.type:"default"in e}function processPropertyDefinition(e,r){var t,o=e.default,n=e.type;return e.type?"bool"===e.type?n="boolean":"float"===e.type&&(n="number"):n=void 0!==o&&-1!==["boolean","number"].indexOf(typeof o)?typeof o:Array.isArray(o)?"array":"string",t=propertyTypes[n],t||warn("Unknown property type for component `"+r+"`: "+n),e.parse=e.parse||t.parse,e.stringify=e.stringify||t.stringify,e.type=n,"default"in e?isValidDefaultValue(n,o)||warn("Default value `"+o+"` does not match type `"+n+"` in component `"+r+"`"):e.default=t.default,e}function parseProperty(e,r){return void 0!==e&&null!==e&&""!==e||(e=r.default,Array.isArray(e)&&(e=e.slice())),r.parse(e,r.default)}function stringifyProperty(e,r){return"object"!=typeof e?e:r&&null!==e?r.stringify(e):JSON.stringify(e)}var utils=_dereq_("../utils/"),PropertyTypes=_dereq_("./propertyTypes"),debug=utils.debug,isValidDefaultValue=PropertyTypes.isValidDefaultValue,propertyTypes=PropertyTypes.propertyTypes,warn=debug("core:schema:warn");module.exports.isSingleProperty=isSingleProperty,module.exports.process=function(e,r){return isSingleProperty(e)?processPropertyDefinition(e,r):(Object.keys(e).forEach(function(t){e[t]=processPropertyDefinition(e[t],r)}),e)},module.exports.processPropertyDefinition=processPropertyDefinition,module.exports.parseProperties=function(e,r,t,o,n){var p=Object.keys(t?e:r);return null===e||"object"!=typeof e?e:(Object.keys(e).forEach(function(e){r[e]||n||warn("Unknown property `"+e+"` for component/system `"+o+"`.")}),p.forEach(function(t){var o=r[t],n=e[t];r[t]&&(e[t]=parseProperty(n,o))}),e)},module.exports.parseProperty=parseProperty,module.exports.stringifyProperties=function(e,r){var t={};return Object.keys(e).forEach(function(o){var n=r[o],p=e[o],i=p;"object"==typeof i&&(i=stringifyProperty(p,n),n||warn("Unknown component property: "+o)),t[o]=i}),t},module.exports.stringifyProperty=stringifyProperty;
313
+ },{"../utils/":196,"./propertyTypes":127}],134:[function(_dereq_,module,exports){
314
+ var schema=_dereq_("./schema"),processSchema=schema.process,shaders=module.exports.shaders={},shaderNames=module.exports.shaderNames=[],THREE=_dereq_("../lib/three"),utils=_dereq_("../utils"),propertyToThreeMapping={array:"v3",color:"v3",int:"i",number:"f",map:"t",time:"f",vec2:"v2",vec3:"v3",vec4:"v4"},Shader=module.exports.Shader=function(){};Shader.prototype={schema:{},vertexShader:"void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);}",fragmentShader:"void main() {gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);}",init:function(e){return this.attributes=this.initVariables(e,"attribute"),this.uniforms=this.initVariables(e,"uniform"),this.material=new(this.raw?THREE.RawShaderMaterial:THREE.ShaderMaterial)({uniforms:this.uniforms,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader}),this.material},initVariables:function(e,r){var t={},a=this.schema;return Object.keys(a).forEach(function(e){if(a[e].is===r){var i=propertyToThreeMapping[a[e].type];t[e]={type:i,value:void 0}}}),t},update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform")},updateVariables:function(e,r){var t=this,a="uniform"===r?this.uniforms:this.attributes,i=this.schema;Object.keys(e).forEach(function(s){var o;if(i[s]&&i[s].is===r){if("map"===i[s].type){if(!a[s]||a[s].value===e[s])return;return o="_texture_"+s,t.el.addEventListener("materialtextureloaded",function(){a[s].value=t.material[o],a[s].needsUpdate=!0}),void utils.material.updateMapMaterialFromData(o,s,t,e)}a[s].value=t.parseValue(i[s].type,e[s]),a[s].needsUpdate=!0}})},parseValue:function(e,r){var t;switch(e){case"vec2":return new THREE.Vector2(r.x,r.y);case"vec3":return new THREE.Vector3(r.x,r.y,r.z);case"vec4":return new THREE.Vector4(r.x,r.y,r.z,r.w);case"color":return t=new THREE.Color(r),new THREE.Vector3(t.r,t.g,t.b);case"map":return THREE.ImageUtils.loadTexture(r);default:return r}}},module.exports.registerShader=function(e,r){var t,a={};if(Object.keys(r).forEach(function(e){a[e]={value:r[e],writable:!0}}),shaders[e])throw new Error("The shader "+e+" has been already registered");return t=function(){Shader.call(this)},t.prototype=Object.create(Shader.prototype,a),t.prototype.name=e,t.prototype.constructor=t,shaders[e]={Shader:t,schema:processSchema(t.prototype.schema)},shaderNames.push(e),t};
315
+ },{"../lib/three":173,"../utils":196,"./schema":133}],135:[function(_dereq_,module,exports){
316
+ var components=_dereq_("./component"),schema=_dereq_("./schema"),utils=_dereq_("../utils/"),parseProperties=schema.parseProperties,parseProperty=schema.parseProperty,processSchema=schema.process,isSingleProp=schema.isSingleProperty,styleParser=utils.styleParser,systems=module.exports.systems={},System=module.exports.System=function(e){var t=components&&components.components[this.name];this.el=e,this.sceneEl=e,t&&(t.Component.prototype.system=this),this.buildData(),this.init(),this.update({})};System.prototype={schema:{},init:function(){},update:function(e){},updateProperties:function(e){var t=this.data;Object.keys(schema).length&&(this.buildData(e),this.update(t))},buildData:function(e){var t=this.schema;Object.keys(t).length&&(e=e||window.HTMLElement.prototype.getAttribute.call(this.sceneEl,this.name),isSingleProp(t)?this.data=parseProperty(e,t):this.data=parseProperties(styleParser.parse(e)||{},t))},tick:void 0,tock:void 0,play:function(){},pause:function(){}},module.exports.registerSystem=function(e,t){var s,o,r={},i=utils.findAllScenes(document);if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),systems[e])throw new Error("The system `"+e+"` has been already registered. Check that you are not loading two versions of the same system or two different systems of the same name.");for(o=function(e){System.call(this,e)},o.prototype=Object.create(System.prototype,r),o.prototype.name=e,o.prototype.constructor=o,o.prototype.schema=utils.extend(processSchema(o.prototype.schema)),systems[e]=o,s=0;s<i.length;s++)i[s].initSystem(e)};
317
+ },{"../utils/":196,"./component":125,"./schema":133}],136:[function(_dereq_,module,exports){
318
+ _dereq_("./pivot");
319
+ },{"./pivot":137}],137:[function(_dereq_,module,exports){
320
+ var registerComponent=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),originalPosition=new THREE.Vector3,originalRotation=new THREE.Vector3;registerComponent("pivot",{dependencies:["position"],schema:{type:"vec3"},init:function(){var o=this.data,i=this.el,t=i.object3D.parent,e=i.object3D,n=new THREE.Group;originalPosition.copy(e.position),originalRotation.copy(e.rotation),t.remove(e),n.add(e),t.add(n),i.object3D=n,e.position.set(-1*o.x,-1*o.y,-1*o.z),n.position.set(o.x+originalPosition.x,o.y+originalPosition.y,o.z+originalPosition.z),n.rotation.copy(e.rotation),e.rotation.set(0,0,0)}});
321
+ },{"../../core/component":125,"../../lib/three":173}],138:[function(_dereq_,module,exports){
322
+ function addMapping(e){var a=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();"fog"===e&&(a="material-fog"),"visible"===e&&(a="material-visible"),materialMappings[a]="material."+e}var components=_dereq_("../../core/component").components,shaders=_dereq_("../../core/shader").shaders,utils=_dereq_("../../utils/"),materialMappings={};Object.keys(components.material.schema).forEach(addMapping),Object.keys(shaders.standard.schema).forEach(addMapping),module.exports=function(){return{defaultComponents:{material:{}},mappings:utils.extend({},materialMappings)}};
323
+ },{"../../core/component":125,"../../core/shader":134,"../../utils/":196}],139:[function(_dereq_,module,exports){
324
+ _dereq_("./primitives/a-camera"),_dereq_("./primitives/a-collada-model"),_dereq_("./primitives/a-cursor"),_dereq_("./primitives/a-curvedimage"),_dereq_("./primitives/a-gltf-model"),_dereq_("./primitives/a-image"),_dereq_("./primitives/a-light"),_dereq_("./primitives/a-link"),_dereq_("./primitives/a-obj-model"),_dereq_("./primitives/a-sky"),_dereq_("./primitives/a-sound"),_dereq_("./primitives/a-text"),_dereq_("./primitives/a-video"),_dereq_("./primitives/a-videosphere"),_dereq_("./primitives/meshPrimitives");
325
+ },{"./primitives/a-camera":141,"./primitives/a-collada-model":142,"./primitives/a-cursor":143,"./primitives/a-curvedimage":144,"./primitives/a-gltf-model":145,"./primitives/a-image":146,"./primitives/a-light":147,"./primitives/a-link":148,"./primitives/a-obj-model":149,"./primitives/a-sky":150,"./primitives/a-sound":151,"./primitives/a-text":152,"./primitives/a-video":153,"./primitives/a-videosphere":154,"./primitives/meshPrimitives":155}],140:[function(_dereq_,module,exports){
326
+ function addComponentMapping(e,t){var i=components[e].schema;Object.keys(i).map(function(i){var n=i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();void 0!==t[n]&&(n=e+"-"+i),t[n]=e+"."+i})}function definePrimitive(e,t,i){i=i||{},Object.keys(t).map(function(e){addComponentMapping(e,i)}),module.exports.registerPrimitive(e,utils.extendDeep({},null,{defaultComponents:t,mappings:i}))}var AEntity=_dereq_("../../core/a-entity"),components=_dereq_("../../core/component").components,registerElement=_dereq_("../../core/a-register-element").registerElement,utils=_dereq_("../../utils/"),debug=utils.debug,setComponentProperty=utils.entity.setComponentProperty,log=debug("extras:primitives:debug"),warn=debug("extras:primitives:warn"),primitives=module.exports.primitives={};module.exports.registerPrimitive=function(e,t){e=e.toLowerCase(),log("Registering <%s>",e),t.defaultAttributes&&warn("The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.");var i=registerElement(e,{prototype:Object.create(AEntity.prototype,{defaultComponentsFromPrimitive:{value:t.defaultComponents||t.defaultAttributes||{}},deprecated:{value:t.deprecated||null},deprecatedMappings:{value:t.deprecatedMappings||{}},mappings:{value:t.mappings||{}},createdCallback:{value:function(){t.deprecated&&console.warn(t.deprecated),this.resolveMappingCollisions()}},resolveMappingCollisions:{value:function(){var e=this.mappings,t=this;Object.keys(e).forEach(function(i){var n;i!==i.toLowerCase()&&warn("Mapping keys should be specified in lower case. The mapping key "+i+" may not be recognized"),components[i]&&(n=e[i].replace(".","-"),e[n]=e[i],delete e[i],console.warn("The primitive "+t.tagName.toLowerCase()+" has a mapping collision. The attribute "+i+" has the same name as a registered component and has been renamed to "+n))})}},getExtraComponents:{value:function(){function e(e,r){return t(e)?i(r):t(r)?i(e):n(e)&&n(r)?utils.extendDeep(e,r):i(r)}function t(e){return void 0===e}function i(e){return n(e)?utils.extendDeep({},e):e}function n(e){return null!==e&&e.constructor===Object}var r,o,a,s,p,u,l=this;for(o=utils.clone(this.defaultComponentsFromPrimitive),p=this.getAttribute("mixin"),p&&(p=p.trim().split(" "),p.forEach(function(t){var i=l.sceneEl.querySelector("#"+t).componentCache;Object.keys(i).forEach(function(t){o[t]=e(o[t],i[t])})})),a=0;a<this.attributes.length;a++)r=this.attributes[a],(s=this.mappings[r.name])&&(u=utils.entity.getComponentPropertyPath(s),u.constructor===Array?(o[u[0]]=o[u[0]]||{},o[u[0]][u[1]]=r.value):o[u]=r.value);return o}},attributeChangedCallback:{value:function(e,t,i){var n=this.mappings[e];e in this.deprecatedMappings&&console.warn(this.deprecatedMappings[e]),e&&n&&setComponentProperty(this,n,i)}}})});return primitives[e]=i,i},module.exports.definePrimitive=definePrimitive;
327
+ },{"../../core/a-entity":121,"../../core/a-register-element":124,"../../core/component":125,"../../utils/":196}],141:[function(_dereq_,module,exports){
328
+ var DEFAULT_CAMERA_HEIGHT=_dereq_("../../../constants/").DEFAULT_CAMERA_HEIGHT,registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-camera",{defaultComponents:{camera:{userHeight:DEFAULT_CAMERA_HEIGHT},"look-controls":{},"wasd-controls":{}},mappings:{active:"camera.active",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","wasd-controls-enabled":"wasd-controls.enabled","reverse-mouse-drag":"look-controls.reverseMouseDrag","user-height":"camera.userHeight",zoom:"camera.zoom"},deprecatedMappings:{"cursor-color":"a-camera[cursor-color] has been removed. Use a-cursor[color] instead.","cursor-maxdistance":"a-camera[cursor-maxdistance] has been removed. Use a-cursor[max-distance] instead.","cursor-offset":"a-camera[cursor-offset] has been removed. Use a-cursor[position] instead.","cursor-opacity":"a-camera[cursor-offset] has been removed. Use a-cursor[opacity] instead.","cursor-scale":"a-camera[cursor-scale] has been removed. Use a-cursor[scale] instead.","cursor-visible":"a-camera[cursor-visible] has been removed. Use a-cursor[visible] instead."}});
329
+ },{"../../../constants/":116,"../primitives":140}],142:[function(_dereq_,module,exports){
330
+ var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-collada-model",{mappings:{src:"collada-model"}});
331
+ },{"../primitives":140}],143:[function(_dereq_,module,exports){
332
+ var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-cursor",utils.extendDeep({},getMeshMixin(),{defaultComponents:{cursor:{},geometry:{primitive:"ring",radiusOuter:.016,radiusInner:.01,segmentsTheta:32},material:{color:"#000",shader:"flat",opacity:.8},position:{x:0,y:0,z:-1}},mappings:{far:"raycaster.far",fuse:"cursor.fuse","fuse-timeout":"cursor.fuseTimeout",interval:"raycaster.interval",objects:"raycaster.objects"}}));
333
+ },{"../../../utils/":196,"../getMeshMixin":138,"../primitives":140}],144:[function(_dereq_,module,exports){
334
+ var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-curvedimage",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{height:1,primitive:"cylinder",radius:2,segmentsRadial:48,thetaLength:270,openEnded:!0,thetaStart:0},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0,repeat:"-1 1"}},mappings:{height:"geometry.height","open-ended":"geometry.openEnded",radius:"geometry.radius",segments:"geometry.segmentsRadial",start:"geometry.thetaStart","theta-length":"geometry.thetaLength","theta-start":"geometry.thetaStart",width:"geometry.thetaLength"}}));
335
+ },{"../../../utils/":196,"../getMeshMixin":138,"../primitives":140}],145:[function(_dereq_,module,exports){
336
+ var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-gltf-model",{mappings:{src:"gltf-model"}});
337
+ },{"../primitives":140}],146:[function(_dereq_,module,exports){
338
+ var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-image",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}));
339
+ },{"../../../utils/":196,"../getMeshMixin":138,"../primitives":140}],147:[function(_dereq_,module,exports){
340
+ var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-light",{defaultComponents:{light:{}},mappings:{angle:"light.angle",color:"light.color","ground-color":"light.groundColor",decay:"light.decay",distance:"light.distance",intensity:"light.intensity",penumbra:"light.penumbra",type:"light.type",target:"light.target"}});
341
+ },{"../primitives":140}],148:[function(_dereq_,module,exports){
342
+ var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-link",{defaultComponents:{},mappings:{href:"link.href",image:"link.image",title:"link.title"}});
343
+ },{"../primitives":140}],149:[function(_dereq_,module,exports){
344
+ var meshMixin=_dereq_("../getMeshMixin")(),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-obj-model",utils.extendDeep({},meshMixin,{defaultComponents:{"obj-model":{}},mappings:{src:"obj-model.obj",mtl:"obj-model.mtl"}}));
345
+ },{"../../../utils/":196,"../getMeshMixin":138,"../primitives":140}],150:[function(_dereq_,module,exports){
346
+ var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/"),meshPrimitives=_dereq_("./meshPrimitives");registerPrimitive("a-sky",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:32},material:{color:"#FFF",shader:"flat",npot:!0},scale:"-1 1 1"},mappings:utils.extendDeep({},meshPrimitives["a-sphere"].prototype.mappings)}));
347
+ },{"../../../utils/":196,"../getMeshMixin":138,"../primitives":140,"./meshPrimitives":155}],151:[function(_dereq_,module,exports){
348
+ var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-sound",{defaultComponents:{sound:{}},mappings:{src:"sound.src",on:"sound.on",autoplay:"sound.autoplay",loop:"sound.loop",volume:"sound.volume"}});
349
+ },{"../primitives":140}],152:[function(_dereq_,module,exports){
350
+ var definePrimitive=_dereq_("../primitives").definePrimitive;definePrimitive("a-text",{text:{anchor:"align",width:5}});
351
+ },{"../primitives":140}],153:[function(_dereq_,module,exports){
352
+ var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-video",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}));
353
+ },{"../../../utils/":196,"../getMeshMixin":138,"../primitives":140}],154:[function(_dereq_,module,exports){
354
+ var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-videosphere",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:32},material:{color:"#FFF",shader:"flat",npot:!0},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-height":"geometry.segmentsHeight","segments-width":"geometry.segmentsWidth"}}));
355
+ },{"../../../utils/":196,"../getMeshMixin":138,"../primitives":140}],155:[function(_dereq_,module,exports){
356
+ function unCamelCase(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var getMeshMixin=_dereq_("../getMeshMixin"),geometries=_dereq_("../../../core/geometry").geometries,geometryNames=_dereq_("../../../core/geometry").geometryNames,registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/"),meshPrimitives=module.exports={};geometryNames.forEach(function(e){var i=geometries[e],r=unCamelCase(e),t={};Object.keys(i.schema).forEach(function(e){t[unCamelCase(e)]="geometry."+e});var m="a-"+r,s=registerPrimitive(m,utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:e}},mappings:t}));meshPrimitives[m]=s});
357
+ },{"../../../core/geometry":126,"../../../utils/":196,"../getMeshMixin":138,"../primitives":140}],156:[function(_dereq_,module,exports){
358
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("box",{schema:{depth:{default:1,min:0},height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"},segmentsDepth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new THREE.BoxGeometry(e.width,e.height,e.depth)}});
359
+ },{"../core/geometry":126,"../lib/three":173}],157:[function(_dereq_,module,exports){
360
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("circle",{schema:{radius:{default:1,min:0},segments:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CircleGeometry(e.radius,e.segments,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
361
+ },{"../core/geometry":126,"../lib/three":173}],158:[function(_dereq_,module,exports){
362
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("cone",{schema:{height:{default:1,min:0},openEnded:{default:!1},radiusBottom:{default:1,min:0},radiusTop:{default:.01,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
363
+ },{"../core/geometry":126,"../lib/three":173}],159:[function(_dereq_,module,exports){
364
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("cylinder",{schema:{height:{default:1,min:0},openEnded:{default:!1},radius:{default:1,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CylinderGeometry(e.radius,e.radius,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
365
+ },{"../core/geometry":126,"../lib/three":173}],160:[function(_dereq_,module,exports){
366
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("dodecahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.DodecahedronGeometry(e.radius,e.detail)}});
367
+ },{"../core/geometry":126,"../lib/three":173}],161:[function(_dereq_,module,exports){
368
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("icosahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.IcosahedronGeometry(e.radius,e.detail)}});
369
+ },{"../core/geometry":126,"../lib/three":173}],162:[function(_dereq_,module,exports){
370
+ _dereq_("./box.js"),_dereq_("./circle.js"),_dereq_("./cone.js"),_dereq_("./cylinder.js"),_dereq_("./dodecahedron.js"),_dereq_("./icosahedron.js"),_dereq_("./octahedron.js"),_dereq_("./plane.js"),_dereq_("./ring.js"),_dereq_("./sphere.js"),_dereq_("./tetrahedron.js"),_dereq_("./torus.js"),_dereq_("./torusKnot.js"),_dereq_("./triangle.js");
371
+ },{"./box.js":156,"./circle.js":157,"./cone.js":158,"./cylinder.js":159,"./dodecahedron.js":160,"./icosahedron.js":161,"./octahedron.js":163,"./plane.js":164,"./ring.js":165,"./sphere.js":166,"./tetrahedron.js":167,"./torus.js":168,"./torusKnot.js":169,"./triangle.js":170}],163:[function(_dereq_,module,exports){
372
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("octahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.OctahedronGeometry(e.radius,e.detail)}});
373
+ },{"../core/geometry":126,"../lib/three":173}],164:[function(_dereq_,module,exports){
374
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("plane",{schema:{height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new THREE.PlaneGeometry(e.width,e.height,e.segmentsWidth,e.segmentsHeight)}});
375
+ },{"../core/geometry":126,"../lib/three":173}],165:[function(_dereq_,module,exports){
376
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("ring",{schema:{radiusInner:{default:.8,min:0},radiusOuter:{default:1.2,min:0},segmentsPhi:{default:10,min:1,type:"int"},segmentsTheta:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.RingGeometry(e.radiusInner,e.radiusOuter,e.segmentsTheta,e.segmentsPhi,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
377
+ },{"../core/geometry":126,"../lib/three":173}],166:[function(_dereq_,module,exports){
378
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("sphere",{schema:{radius:{default:1,min:0},phiLength:{default:360},phiStart:{default:0,min:0},thetaLength:{default:180,min:0},thetaStart:{default:0},segmentsHeight:{default:18,min:2,type:"int"},segmentsWidth:{default:36,min:3,type:"int"}},init:function(e){this.geometry=new THREE.SphereGeometry(e.radius,e.segmentsWidth,e.segmentsHeight,degToRad(e.phiStart),degToRad(e.phiLength),degToRad(e.thetaStart),degToRad(e.thetaLength))}});
379
+ },{"../core/geometry":126,"../lib/three":173}],167:[function(_dereq_,module,exports){
380
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("tetrahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.TetrahedronGeometry(e.radius,e.detail)}});
381
+ },{"../core/geometry":126,"../lib/three":173}],168:[function(_dereq_,module,exports){
382
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("torus",{schema:{arc:{default:360},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:36,min:2,type:"int"},segmentsTubular:{default:32,min:3,type:"int"}},init:function(e){this.geometry=new THREE.TorusGeometry(e.radius,2*e.radiusTubular,e.segmentsRadial,e.segmentsTubular,degToRad(e.arc))}});
383
+ },{"../core/geometry":126,"../lib/three":173}],169:[function(_dereq_,module,exports){
384
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("torusKnot",{schema:{p:{default:2,min:1},q:{default:3,min:1},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:8,min:3,type:"int"},segmentsTubular:{default:100,min:3,type:"int"}},init:function(e){this.geometry=new THREE.TorusKnotGeometry(e.radius,2*e.radiusTubular,e.segmentsTubular,e.segmentsRadial,e.p,e.q)}});
385
+ },{"../core/geometry":126,"../lib/three":173}],170:[function(_dereq_,module,exports){
386
+ var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),quaternion=new THREE.Quaternion,rotateVector=new THREE.Vector3(0,0,1),uvMinVector=new THREE.Vector2,uvMaxVector=new THREE.Vector2,uvScaleVector=new THREE.Vector2;registerGeometry("triangle",{schema:{vertexA:{type:"vec3",default:{x:0,y:.5,z:0}},vertexB:{type:"vec3",default:{x:-.5,y:-.5,z:0}},vertexC:{type:"vec3",default:{x:.5,y:-.5,z:0}}},init:function(e){var t,r,o,c,n,a;o=new THREE.Triangle,o.a.set(e.vertexA.x,e.vertexA.y,e.vertexA.z),o.b.set(e.vertexB.x,e.vertexB.y,e.vertexB.z),o.c.set(e.vertexC.x,e.vertexC.y,e.vertexC.z),r=o.normal(),quaternion.setFromUnitVectors(r,rotateVector),c=o.a.clone().applyQuaternion(quaternion),n=o.b.clone().applyQuaternion(quaternion),a=o.c.clone().applyQuaternion(quaternion),uvMinVector.set(Math.min(c.x,n.x,a.x),Math.min(c.y,n.y,a.y)),uvMaxVector.set(Math.max(c.x,n.x,a.x),Math.max(c.y,n.y,a.y)),uvScaleVector.set(0,0).subVectors(uvMaxVector,uvMinVector),c=(new THREE.Vector2).subVectors(c,uvMinVector).divide(uvScaleVector),n=(new THREE.Vector2).subVectors(n,uvMinVector).divide(uvScaleVector),a=(new THREE.Vector2).subVectors(a,uvMinVector).divide(uvScaleVector),t=this.geometry=new THREE.Geometry,t.vertices.push(o.a),t.vertices.push(o.b),t.vertices.push(o.c),t.faces.push(new THREE.Face3(0,1,2,r)),t.faceVertexUvs[0]=[[c,n,a]]}});
387
+ },{"../core/geometry":126,"../lib/three":173}],171:[function(_dereq_,module,exports){
388
+ var utils=_dereq_("./utils/"),debug=utils.debug,error=debug("A-Frame:error"),warn=debug("A-Frame:warn");window.document.currentScript&&window.document.currentScript.parentNode!==window.document.head&&!window.debug&&warn("Put the A-Frame <script> tag in the <head> of the HTML *before* the scene to ensure everything for A-Frame is properly registered before they are used from HTML."),"file:"===window.location.protocol&&error("This HTML file is currently being served via the file:// protocol. Assets, textures, and models WILL NOT WORK due to cross-origin policy! Please use a local or hosted server: https://aframe.io/docs/0.5.0/introduction/getting-started.html#using-a-local-server."),window.Promise=window.Promise||_dereq_("promise-polyfill"),window.hasNativeWebVRImplementation=!!window.navigator.getVRDisplays||!!window.navigator.getVRDevices,window.WebVRConfig=window.WebVRConfig||{BUFFER_SCALE:1,CARDBOARD_UI_DISABLED:!0,ROTATE_INSTRUCTIONS_DISABLED:!0,TOUCH_PANNER_DISABLED:!0,MOUSE_KEYBOARD_CONTROLS_DISABLED:!0},utils.device.isIOSOlderThan10(window.navigator.userAgent)&&(window.WebVRConfig.BUFFER_SCALE=1/window.devicePixelRatio),_dereq_("webvr-polyfill"),_dereq_("present"),utils.device.isBrowserEnvironment&&(_dereq_("./style/aframe.css"),_dereq_("./style/rStats.css"));var AScene=_dereq_("./core/scene/a-scene").AScene,components=_dereq_("./core/component").components,registerComponent=_dereq_("./core/component").registerComponent,registerGeometry=_dereq_("./core/geometry").registerGeometry,registerPrimitive=_dereq_("./extras/primitives/primitives").registerPrimitive,registerShader=_dereq_("./core/shader").registerShader,registerSystem=_dereq_("./core/system").registerSystem,shaders=_dereq_("./core/shader").shaders,systems=_dereq_("./core/system").systems,THREE=window.THREE=_dereq_("./lib/three"),TWEEN=window.TWEEN=_dereq_("@tweenjs/tween.js"),pkg=_dereq_("../package");_dereq_("./components/index"),_dereq_("./geometries/index"),_dereq_("./shaders/index"),_dereq_("./systems/index");var ANode=_dereq_("./core/a-node"),AEntity=_dereq_("./core/a-entity");_dereq_("./core/a-animation"),_dereq_("./core/a-assets"),_dereq_("./core/a-cubemap"),_dereq_("./core/a-mixin"),_dereq_("./extras/components/"),_dereq_("./extras/primitives/"),console.log("A-Frame Version: 0.6.1 (Date 19-07-2017, Commit #a4b91bc)"),console.log("three Version:",pkg.dependencies.three),console.log("WebVR Polyfill Version:",pkg.dependencies["webvr-polyfill"]),module.exports=window.AFRAME={AComponent:_dereq_("./core/component").Component,AEntity:AEntity,ANode:ANode,AScene:AScene,components:components,geometries:_dereq_("./core/geometry").geometries,registerComponent:registerComponent,registerElement:_dereq_("./core/a-register-element").registerElement,registerGeometry:registerGeometry,registerPrimitive:registerPrimitive,registerShader:registerShader,registerSystem:registerSystem,primitives:{getMeshMixin:_dereq_("./extras/primitives/getMeshMixin"),primitives:_dereq_("./extras/primitives/primitives").primitives},scenes:_dereq_("./core/scene/scenes"),schema:_dereq_("./core/schema"),shaders:shaders,systems:systems,THREE:THREE,TWEEN:TWEEN,utils:utils,version:pkg.version};
389
+ },{"../package":76,"./components/index":85,"./core/a-animation":118,"./core/a-assets":119,"./core/a-cubemap":120,"./core/a-entity":121,"./core/a-mixin":122,"./core/a-node":123,"./core/a-register-element":124,"./core/component":125,"./core/geometry":126,"./core/scene/a-scene":128,"./core/scene/scenes":131,"./core/schema":133,"./core/shader":134,"./core/system":135,"./extras/components/":136,"./extras/primitives/":139,"./extras/primitives/getMeshMixin":138,"./extras/primitives/primitives":140,"./geometries/index":162,"./lib/three":173,"./shaders/index":175,"./style/aframe.css":180,"./style/rStats.css":181,"./systems/index":185,"./utils/":196,"@tweenjs/tween.js":1,"present":33,"promise-polyfill":34,"webvr-polyfill":61}],172:[function(_dereq_,module,exports){
390
+ window.aframeStats=function(t){function e(){i("te").set(n()),window.performance.getEntriesByName&&i("lt").set(window.performance.getEntriesByName("render-started")[0].startTime.toFixed(0))}function n(){var t=c.querySelectorAll("*");return Array.prototype.slice.call(t).filter(function(t){return t.isEntity}),t.length}function r(){}function a(){}function o(t){i=t}var i=null,c=t;return{update:e,start:r,end:a,attach:o,values:{te:{caption:"Entities"},lt:{caption:"Load Time"}},groups:[{caption:"A-Frame",values:["te","lt"]}],fractions:[]}},"object"==typeof module&&(module.exports={aframeStats:window.aframeStats});
391
+ },{}],173:[function(_dereq_,module,exports){
392
+ (function (global){
393
+ var THREE=global.THREE=_dereq_("three");THREE.TextureLoader&&(THREE.TextureLoader.prototype.crossOrigin="anonymous"),THREE.ImageLoader&&(THREE.ImageLoader.prototype.crossOrigin="anonymous"),THREE.Cache&&(THREE.Cache.enabled=!0),_dereq_("three/examples/js/loaders/GLTFLoader"),_dereq_("three/examples/js/loaders/OBJLoader"),_dereq_("three/examples/js/loaders/MTLLoader"),_dereq_("three/examples/js/loaders/ColladaLoader"),_dereq_("../../vendor/VRControls"),_dereq_("../../vendor/VREffect"),THREE.ColladaLoader.prototype.crossOrigin="anonymous",THREE.GLTFLoader.prototype.crossOrigin="anonymous",THREE.MTLLoader.prototype.crossOrigin="anonymous",THREE.OBJLoader.prototype.crossOrigin="anonymous",module.exports=THREE;
394
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
395
+
396
+ },{"../../vendor/VRControls":201,"../../vendor/VREffect":202,"three":41,"three/examples/js/loaders/ColladaLoader":42,"three/examples/js/loaders/GLTFLoader":43,"three/examples/js/loaders/MTLLoader":44,"three/examples/js/loaders/OBJLoader":45}],174:[function(_dereq_,module,exports){
397
+ function getMaterialData(e){return{fog:e.fog,color:new THREE.Color(e.color),wireframe:e.wireframe,wireframeLinewidth:e.wireframeLinewidth}}var registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/");module.exports.Shader=registerShader("flat",{schema:{color:{type:"color"},fog:{default:!0},height:{default:256},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},src:{type:"map"},width:{default:512},wireframe:{default:!1},wireframeLinewidth:{default:2}},init:function(e){this.textureSrc=null,this.material=new THREE.MeshBasicMaterial(getMaterialData(e)),utils.material.updateMap(this,e)},update:function(e){this.updateMaterial(e),utils.material.updateMap(this,e)},updateMaterial:function(e){var t=this.material;e=getMaterialData(e),Object.keys(e).forEach(function(a){t[a]=e[a]})}});
398
+ },{"../core/shader":134,"../lib/three":173,"../utils/":196}],175:[function(_dereq_,module,exports){
399
+ _dereq_("./flat"),_dereq_("./standard"),_dereq_("./sdf"),_dereq_("./msdf"),_dereq_("./ios10hls");
400
+ },{"./flat":174,"./ios10hls":176,"./msdf":177,"./sdf":178,"./standard":179}],176:[function(_dereq_,module,exports){
401
+ var registerShader=_dereq_("../core/shader").registerShader;module.exports.Shader=registerShader("ios10hls",{schema:{src:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},vertexShader:["varying vec2 vUV;","void main(void) {"," gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);"," vUV = uv;","}"].join("\n"),fragmentShader:["uniform sampler2D src;","uniform float opacity;","varying vec2 vUV;","void main() {"," vec2 offset = vec2(0, 0);"," vec2 repeat = vec2(1, 1);"," vec4 color = texture2D(src, vec2(vUV.x / repeat.x + offset.x, (1.0 - vUV.y) / repeat.y + offset.y)).bgra;"," gl_FragColor = vec4(color.rgb, opacity);","}"].join("\n")});
402
+ },{"../core/shader":134}],177:[function(_dereq_,module,exports){
403
+ var registerShader=_dereq_("../core/shader").registerShader;module.exports.Shader=registerShader("msdf",{schema:{alphaTest:{type:"number",is:"uniform",default:.5},color:{type:"color",is:"uniform",default:"white"},map:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},raw:!0,vertexShader:["attribute vec2 uv;","attribute vec3 position;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUV;","void main(void) {"," gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);"," vUV = uv;","}"].join("\n"),fragmentShader:["#ifdef GL_OES_standard_derivatives","#extension GL_OES_standard_derivatives: enable","#endif","precision highp float;","#define BIG_ENOUGH 0.001","#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)","#define ALL_SMOOTH 0.4","#define ALL_ROUGH 0.02","#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))","uniform sampler2D map;","uniform vec3 color;","uniform float opacity;","uniform float alphaTest;","varying vec2 vUV;","float median(float r, float g, float b) {"," return max(min(r, g), min(max(r, g), b));","}","void main() {"," vec3 sample = 1.0 - texture2D(map, vUV).rgb;"," float sigDist = median(sample.r, sample.g, sample.b) - 0.5;"," float alpha = clamp(sigDist/fwidth(sigDist) + 0.5, 0.0, 1.0);"," float dscale = 0.353505;"," vec2 duv = dscale * (dFdx(vUV) + dFdy(vUV));"," float isBigEnough = max(abs(duv.x), abs(duv.y));"," if (isBigEnough > BIG_ENOUGH) {"," float ratio = BIG_ENOUGH / isBigEnough;"," alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);"," }"," if (isBigEnough <= BIG_ENOUGH && alpha < alphaTest) { discard; return; }"," if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }"," gl_FragColor = vec4(color.xyz, alpha * opacity);","}"].join("\n")});
404
+ },{"../core/shader":134}],178:[function(_dereq_,module,exports){
405
+ var registerShader=_dereq_("../core/shader").registerShader;module.exports.Shader=registerShader("sdf",{schema:{alphaTest:{type:"number",is:"uniform",default:.5},color:{type:"color",is:"uniform",default:"white"},map:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},raw:!0,vertexShader:["attribute vec2 uv;","attribute vec3 position;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUV;","void main(void) {"," gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);"," vUV = uv;","}"].join("\n"),fragmentShader:["#ifdef GL_OES_standard_derivatives","#extension GL_OES_standard_derivatives: enable","#endif","precision highp float;","#define BIG_ENOUGH 0.001","#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)","#define ALL_SMOOTH 0.4","#define ALL_ROUGH 0.02","#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))","uniform sampler2D map;","uniform vec3 color;","uniform float opacity;","uniform float alphaTest;","varying vec2 vUV;","#ifdef GL_OES_standard_derivatives","float contour(float width, float value) {"," return smoothstep(0.5 - value, 0.5 + value, width);","}","#else","float aastep(float value, float afwidth) {"," return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);","}","#endif","void main() {","#ifdef GL_OES_standard_derivatives"," vec2 uv = vUV;"," vec4 texColor = texture2D(map, uv);"," float dist = texColor.a;"," float width = fwidth(dist);"," float alpha = contour(dist, width);"," float dscale = 0.353505;"," vec2 duv = dscale * (dFdx(uv) + dFdy(uv));"," float isBigEnough = max(abs(duv.x), abs(duv.y));"," if (isBigEnough > BIG_ENOUGH) {"," float ratio = BIG_ENOUGH / isBigEnough;"," alpha = ratio * alpha + (1.0 - ratio) * dist;"," }"," else if (isBigEnough <= BIG_ENOUGH) {"," vec4 box = vec4 (uv - duv, uv + duv);"," alpha = (alpha + 0.5 * ("," contour(texture2D(map, box.xy).a, width)"," + contour(texture2D(map, box.zw).a, width)"," + contour(texture2D(map, box.xw).a, width)"," + contour(texture2D(map, box.zy).a, width)"," )) / 3.0;"," }"," if (isBigEnough <= BIG_ENOUGH && alpha < alphaTest) { discard; return; }"," if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }","#else"," vec4 texColor = texture2D(map, vUV);"," float value = texColor.a;"," float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));"," float alpha = aastep(value, afwidth);"," float ratio = (gl_FragCoord.w >= ALL_SMOOTH) ? 1.0 : (gl_FragCoord.w < ALL_ROUGH) ? 0.0 : (gl_FragCoord.w - ALL_ROUGH) / (ALL_SMOOTH - ALL_ROUGH);"," if (alpha < alphaTest) { if (ratio >= 1.0) { discard; return; } alpha = 0.0; }"," alpha = alpha * ratio + (1.0 - ratio) * value;"," if (ratio < 1.0)"," if (alpha <= DISCARD_ALPHA) { discard; return; }","#endif"," gl_FragColor = vec4(color, opacity * alpha);","}"].join("\n")});
406
+ },{"../core/shader":134}],179:[function(_dereq_,module,exports){
407
+ function getMaterialData(e){var a={color:new THREE.Color(e.color),fog:e.fog,metalness:e.metalness,roughness:e.roughness,wireframe:e.wireframe,wireframeLinewidth:e.wireframeLinewidth};return e.normalMap&&(a.normalScale=e.normalScale),e.ambientOcclusionMap&&(a.aoMapIntensity=e.ambientOcclusionMapIntensity),e.displacementMap&&(a.displacementScale=e.displacementScale,a.displacementBias=e.displacementBias),a}var registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),CubeLoader=new THREE.CubeTextureLoader,texturePromises={};module.exports.Shader=registerShader("standard",{schema:{ambientOcclusionMap:{type:"map"},ambientOcclusionMapIntensity:{default:1},ambientOcclusionTextureOffset:{type:"vec2"},ambientOcclusionTextureRepeat:{type:"vec2",default:{x:1,y:1}},color:{type:"color"},displacementMap:{type:"map"},displacementScale:{default:1},displacementBias:{default:.5},displacementTextureOffset:{type:"vec2"},displacementTextureRepeat:{type:"vec2",default:{x:1,y:1}},envMap:{default:""},fog:{default:!0},height:{default:256},metalness:{default:0,min:0,max:1},normalMap:{type:"map"},normalScale:{type:"vec2",default:{x:1,y:1}},normalTextureOffset:{type:"vec2"},normalTextureRepeat:{type:"vec2",default:{x:1,y:1}},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},roughness:{default:.5,min:0,max:1},sphericalEnvMap:{type:"map"},src:{type:"map"},width:{default:512},wireframe:{default:!1},wireframeLinewidth:{default:2}},init:function(e){this.material=new THREE.MeshStandardMaterial(getMaterialData(e)),utils.material.updateMap(this,e),e.normalMap&&utils.material.updateDistortionMap("normal",this,e),e.displacementMap&&utils.material.updateDistortionMap("displacement",this,e),e.ambientOcclusionMap&&utils.material.updateDistortionMap("ambientOcclusion",this,e),this.updateEnvMap(e)},update:function(e){this.updateMaterial(e),utils.material.updateMap(this,e),e.normalMap&&utils.material.updateDistortionMap("normal",this,e),e.displacementMap&&utils.material.updateDistortionMap("displacement",this,e),e.ambientOcclusionMap&&utils.material.updateDistortionMap("ambientOcclusion",this,e),this.updateEnvMap(e)},updateMaterial:function(e){var a=this.material;e=getMaterialData(e),Object.keys(e).forEach(function(t){a[t]=e[t]})},updateEnvMap:function(e){var a=this,t=this.material,i=e.envMap,n=e.sphericalEnvMap;return!i&&!n||this.isLoadingEnvMap?(t.envMap=null,void(t.needsUpdate=!0)):(this.isLoadingEnvMap=!0,n?void this.el.sceneEl.systems.material.loadTexture(n,{src:n},function(e){a.isLoadingEnvMap=!1,e.mapping=THREE.SphericalReflectionMapping,t.envMap=e,utils.material.handleTextureEvents(a.el,e),t.needsUpdate=!0}):texturePromises[i]?void texturePromises[i].then(function(e){a.isLoadingEnvMap=!1,t.envMap=e,utils.material.handleTextureEvents(a.el,e),t.needsUpdate=!0}):void(texturePromises[i]=new Promise(function(e){utils.srcLoader.validateCubemapSrc(i,function(i){CubeLoader.load(i,function(i){a.isLoadingEnvMap=!1,t.envMap=i,utils.material.handleTextureEvents(a.el,i),e(i)})})})))}});
408
+ },{"../core/shader":134,"../lib/three":173,"../utils/":196}],180:[function(_dereq_,module,exports){
409
+ var css = ".a-html{bottom:0;left:0;position:fixed;right:0;top:0}.a-body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.a-grab-cursor:hover{cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.a-canvas.a-grab-cursor:active,.a-grabbing{cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}// Class is removed when doing <a-scene embedded>. a-scene.fullscreen .a-canvas{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:999999!important;position:fixed!important}.a-inspector-loader{background-color:#ed3160;position:fixed;left:3px;top:3px;padding:6px 10px;color:#fff;text-decoration:none;font-size:12px;font-family:Roboto,sans-serif;text-align:center;z-index:99999;width:204px}@keyframes dots-1{from{opacity:0}25%{opacity:1}}@keyframes dots-2{from{opacity:0}50%{opacity:1}}@keyframes dots-3{from{opacity:0}75%{opacity:1}}@-webkit-keyframes dots-1{from{opacity:0}25%{opacity:1}}@-webkit-keyframes dots-2{from{opacity:0}50%{opacity:1}}@-webkit-keyframes dots-3{from{opacity:0}75%{opacity:1}}.a-inspector-loader .dots span{animation:dots-1 2s infinite steps(1);-webkit-animation:dots-1 2s infinite steps(1)}.a-inspector-loader .dots span:first-child+span{animation-name:dots-2;-webkit-animation-name:dots-2}.a-inspector-loader .dots span:first-child+span+span{animation-name:dots-3;-webkit-animation-name:dots-3}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;position:absolute;right:20px;bottom:20px}.a-enter-vr.embedded{right:5px;bottom:5px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff}.a-enter-vr-button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E) 50% 50%/70% 70% no-repeat rgba(0,0,0,.35);border:0;bottom:0;cursor:pointer;min-width:50px;min-height:30px;padding-right:5%;padding-top:4%;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999}.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#666}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\"Insert phone into Cardboard holder.\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}"; (_dereq_("browserify-css").createStyle(css, { "href": "src\\style\\aframe.css"})); module.exports = css;
410
+ },{"browserify-css":5}],181:[function(_dereq_,module,exports){
411
+ var css = ".rs-base{background-color:#333;color:#fafafa;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-base.alarm{color:#b70000;text-shadow:0 0 0 #b70000,0 0 1px #fff,0 0 1px #fff,0 0 2px #fff,0 0 2px #fff,0 0 3px #fff,0 0 3px #fff,0 0 4px #fff,0 0 4px #fff}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}"; (_dereq_("browserify-css").createStyle(css, { "href": "src\\style\\rStats.css"})); module.exports = css;
412
+ },{"browserify-css":5}],182:[function(_dereq_,module,exports){
413
+ function removeDefaultCamera(e){var t;e.camera&&(t=e.querySelector("["+DEFAULT_CAMERA_ATTR+"]"))&&e.removeChild(t)}var bind=_dereq_("../utils/bind"),constants=_dereq_("../constants/"),registerSystem=_dereq_("../core/system").registerSystem,DEFAULT_CAMERA_ATTR="data-aframe-default-camera";module.exports.System=registerSystem("camera",{init:function(){this.activeCameraEl=null,this.sceneEl.addEventListener("loaded",bind(this.setupDefaultCamera,this))},setupDefaultCamera:function(){var e,t=this.sceneEl;if(t.camera)return void t.emit("camera-ready",{cameraEl:t.camera.el});e=document.createElement("a-entity"),e.setAttribute("position","0 0 0"),e.setAttribute(DEFAULT_CAMERA_ATTR,""),e.setAttribute("camera",{active:!0,userHeight:constants.DEFAULT_CAMERA_HEIGHT}),e.setAttribute("wasd-controls",""),e.setAttribute("look-controls",""),e.setAttribute(constants.AFRAME_INJECTED,""),t.appendChild(e),t.addEventListener("enter-vr",this.removeDefaultOffset),t.addEventListener("exit-vr",this.addDefaultOffset),t.emit("camera-ready",{cameraEl:e})},disableActiveCamera:function(){var e=this.sceneEl.querySelectorAll("[camera]");e[e.length-1].setAttribute("camera","active",!0)},setActiveCamera:function(e){var t,a,r,i,s=this.activeCameraEl,c=this.sceneEl;if((i=e.getObject3D("camera"))&&e!==this.activeCameraEl){var m=c.querySelector("["+DEFAULT_CAMERA_ATTR+"]"),l=m&&m.querySelector("[camera]");for(e!==l&&removeDefaultCamera(c),this.activeCameraEl=e,this.activeCameraEl.play(),c.camera=i,s&&s.setAttribute("camera","active",!1),a=c.querySelectorAll("[camera]"),r=0;r<a.length;r++)t=a[r],e!==t&&(t.setAttribute("camera","active",!1),t.pause());c.emit("camera-set-active",{cameraEl:e})}}});
414
+ },{"../constants/":116,"../core/system":135,"../utils/bind":190}],183:[function(_dereq_,module,exports){
415
+ function createGeometry(e){var t=e.primitive,r=geometries[t]&&geometries[t].Geometry,o=new r;if(!r)throw new Error("Unknown geometry `"+t+"`");return o.init(e),toBufferGeometry(o.geometry,e.buffer)}function decrementCacheCount(e,t){e[t]--}function incrementCacheCount(e,t){e[t]=void 0===e[t]?1:e[t]+1}function toBufferGeometry(e,t){var r;return t?(r=(new THREE.BufferGeometry).fromGeometry(e),r.metadata={type:e.type,parameters:e.parameters||{}},e.dispose(),r):e}var geometries=_dereq_("../core/geometry").geometries,registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three");module.exports.System=registerSystem("geometry",{init:function(){this.cache={},this.cacheCount={}},clearCache:function(){this.cache={},this.cacheCount={}},getOrCreateGeometry:function(e){var t,r,o=this.cache;return e.skipCache||e.mergeTo?createGeometry(e):(r=this.hash(e),t=o[r],incrementCacheCount(this.cacheCount,r),t||(t=createGeometry(e),o[r]=t,t))},unuseGeometry:function(e){var t,r,o=this.cache,i=this.cacheCount;e.skipCache||e.mergeTo||(r=this.hash(e),o[r]&&(decrementCacheCount(i,r),i[r]>0||(t=o[r],t.dispose(),delete o[r],delete i[r])))},hash:function(e){return JSON.stringify(e)}});
416
+ },{"../core/geometry":126,"../core/system":135,"../lib/three":173}],184:[function(_dereq_,module,exports){
417
+ var registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three");module.exports.System=registerSystem("gltf-model",{init:function(){this.models=[]},tick:function(){var e=this.sceneEl;e.hasLoaded&&this.models.length&&THREE.GLTFLoader.Shaders.update(e.object3D,e.camera)},registerModel:function(e){this.models.push(e)},unregisterModel:function(e){var t=this.models,s=t.indexOf(e);s>=0&&t.splice(s,1)}});
418
+ },{"../core/system":135,"../lib/three":173}],185:[function(_dereq_,module,exports){
419
+ _dereq_("./camera"),_dereq_("./geometry"),_dereq_("./gltf-model"),_dereq_("./light"),_dereq_("./material"),_dereq_("./shadow"),_dereq_("./tracked-controls");
420
+ },{"./camera":182,"./geometry":183,"./gltf-model":184,"./light":186,"./material":187,"./shadow":188,"./tracked-controls":189}],186:[function(_dereq_,module,exports){
421
+ var registerSystem=_dereq_("../core/system").registerSystem,bind=_dereq_("../utils/bind"),constants=_dereq_("../constants/"),DEFAULT_LIGHT_ATTR="data-aframe-default-light";module.exports.System=registerSystem("light",{schema:{defaultLightsEnabled:{default:!0}},init:function(){this.defaultLights=!1,this.userDefinedLights=!1,this.sceneEl.addEventListener("loaded",bind(this.setupDefaultLights,this))},registerLight:function(t){t.hasAttribute(DEFAULT_LIGHT_ATTR)||(this.removeDefaultLights(),this.userDefinedLights=!0)},removeDefaultLights:function(){var t,e=this.sceneEl;if(this.defaultLights){t=document.querySelectorAll("["+DEFAULT_LIGHT_ATTR+"]");for(var i=0;i<t.length;i++)e.removeChild(t[i]);this.defaultLights=!1}},setupDefaultLights:function(){var t,e,i=this.sceneEl;this.userDefinedLights||this.defaultLights||!this.data.defaultLightsEnabled||(t=document.createElement("a-entity"),e=document.createElement("a-entity"),t.setAttribute("light",{color:"#BBB",type:"ambient"}),t.setAttribute(DEFAULT_LIGHT_ATTR,""),t.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(t),e.setAttribute("light",{color:"#FFF",intensity:.6}),e.setAttribute("position",{x:-.5,y:1,z:1}),e.setAttribute(DEFAULT_LIGHT_ATTR,""),e.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(e),this.defaultLights=!0)}});
422
+ },{"../constants/":116,"../core/system":135,"../utils/bind":190}],187:[function(_dereq_,module,exports){
423
+ function calculateVideoCacheHash(e,t){var r,i,a,n=t.getAttribute("id");if(n)return n;for(i="",a=e||{},r=0;r<t.attributes.length;r++)a[t.attributes[r].name]=t.attributes[r].value;return Object.keys(a).sort().forEach(function(e){i+=e+":"+a[e]+";"}),i}function loadImageTexture(e,t){function r(r,i){function a(e){setTextureProperties(e,t),e.needsUpdate=!0,r(e)}if("string"!=typeof e)return void a(new THREE.Texture(e));TextureLoader.load(e,a,function(){},function(e){error("`$s` could not be fetched (Error code: %s; Response: %s)",e.status,e.statusText)})}return new Promise(r)}function setTextureProperties(e,t){var r=t.offset||{x:0,y:0},i=t.repeat||{x:1,y:1};(t.npot||!1)&&(e.wrapS=THREE.ClampToEdgeWrapping,e.wrapT=THREE.ClampToEdgeWrapping,e.magFilter=THREE.LinearFilter,e.minFilter=THREE.LinearFilter),1===i.x&&1===i.y||(e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,e.repeat.set(i.x,i.y)),0===r.x&&0===r.y||e.offset.set(r.x,r.y)}function createVideoEl(e,t,r){var i=document.createElement("video");return i.width=t,i.height=r,i.setAttribute("playsinline",""),i.setAttribute("webkit-playsinline",""),i.autoplay=!0,i.loop=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){warn("`$s` is not a valid video",e)},!0),i.src=e,i}function fixVideoAttributes(e){return e.autoplay=e.hasAttribute("autoplay")&&"false"!==e.getAttribute("autoplay"),e.controls=e.hasAttribute("controls")&&"false"!==e.getAttribute("controls"),"false"===e.getAttribute("loop")&&e.removeAttribute("loop"),"false"===e.getAttribute("preload")&&(e.preload="none"),e.crossOrigin=e.crossOrigin||"anonymous",e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e}var registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),isHLS=_dereq_("../utils/material").isHLS,bind=utils.bind,debug=utils.debug,error=debug("components:texture:error"),TextureLoader=new THREE.TextureLoader,warn=debug("components:texture:warn");TextureLoader.setCrossOrigin("anonymous"),module.exports.System=registerSystem("material",{init:function(){this.materials={},this.textureCounts={},this.textureCache={},this.sceneEl.addEventListener("materialtextureloaded",bind(this.onMaterialTextureLoaded,this))},clearTextureCache:function(){this.textureCache={}},loadTexture:function(e,t,r){function i(e){n.loadImage(e,t,r)}function a(e){n.loadVideo(e,t,r)}var n=this;return"CANVAS"===e.tagName?void this.loadCanvas(e,t,r):"VIDEO"===e.tagName?(e.hasAttribute("src")||e.hasAttribute("srcObject")||warn("Video element was defined without `src` nor `srcObject` attributes."),void this.loadVideo(e,t,r)):void utils.srcLoader.validateSrc(e,i,a)},loadImage:function(e,t,r){var i=this.hash(t),a=this.textureCache;if(a[i])return void a[i].then(r);a[i]=loadImageTexture(e,t),a[i].then(r)},loadCanvas:function(e,t,r){e.readyState=2,e.HAVE_CURRENT_DATA=2,this.loadVideo(e,t,r)},loadVideo:function(e,t,r){function i(e){e.texture.needsUpdate=!0,r(e.texture,e.videoEl)}var a,n,s,o,u=this.textureCache;if("string"!=typeof e){if(s=e,a=this.hashVideo(t,s),u[a])return void u[a].then(i);fixVideoAttributes(s)}if(s=s||createVideoEl(e,t.width,t.height),a=this.hashVideo(t,s),u[a])return void u[a].then(i);n=new THREE.VideoTexture(s),n.minFilter=THREE.LinearFilter,setTextureProperties(n,t),this.sceneEl.isIOS&&isHLS(s.src||s.getAttribute("src"),s.type||s.getAttribute("type"))&&(n.format=THREE.RGBAFormat,n.needsCorrectionBGRA=!0,n.flipY=!1,n.needsCorrectionFlipY=!0),o={texture:n,videoEl:s},u[a]=Promise.resolve(o),i(o)},hash:function(e){return e.src.tagName&&(e=utils.extendDeep({},e),e.src=e.src.getAttribute("src")),JSON.stringify(e)},hashVideo:function(e,t){return calculateVideoCacheHash(e,t)},registerMaterial:function(e){this.materials[e.uuid]=e},unregisterMaterial:function(e){delete this.materials[e.uuid];var t=this.textureCounts;Object.keys(e).filter(function(t){return e[t]&&e[t].isTexture}).forEach(function(r){--t[e[r].uuid]<=0&&e[r].dispose()})},updateMaterials:function(e){var t=this.materials;Object.keys(t).forEach(function(e){t[e].needsUpdate=!0})},onMaterialTextureLoaded:function(e){this.textureCounts[e.detail.texture.uuid]||(this.textureCounts[e.detail.texture.uuid]=0),this.textureCounts[e.detail.texture.uuid]++}});
424
+ },{"../core/system":135,"../lib/three":173,"../utils/":196,"../utils/material":197}],188:[function(_dereq_,module,exports){
425
+ var registerSystem=_dereq_("../core/system").registerSystem,bind=_dereq_("../utils/bind"),THREE=_dereq_("../lib/three"),SHADOW_MAP_TYPE_MAP={basic:THREE.BasicShadowMap,pcf:THREE.PCFShadowMap,pcfsoft:THREE.PCFSoftShadowMap};module.exports.System=registerSystem("shadow",{schema:{type:{default:"pcf",oneOf:["basic","pcf","pcfsoft"]},renderReverseSided:{default:!0},renderSingleSided:{default:!0}},init:function(){var e=this.sceneEl,d=this.data;this.shadowMapEnabled=!1,e.addEventListener("render-target-loaded",bind(function(){e.renderer&&(e.renderer.shadowMap.type=SHADOW_MAP_TYPE_MAP[d.type],e.renderer.shadowMap.renderReverseSided=d.renderReverseSided,e.renderer.shadowMap.renderSingleSided=d.renderSingleSided,this.setShadowMapEnabled(this.shadowMapEnabled))},this))},setShadowMapEnabled:function(e){var d=this.sceneEl.renderer;this.shadowMapEnabled=e,d&&(d.shadowMap.enabled=e)}});
426
+ },{"../core/system":135,"../lib/three":173,"../utils/bind":190}],189:[function(_dereq_,module,exports){
427
+ var registerSystem=_dereq_("../core/system").registerSystem,trackedControlsUtils=_dereq_("../utils/tracked-controls"),utils=_dereq_("../utils");module.exports.System=registerSystem("tracked-controls",{init:function(){var t=this;this.controllers=[],this.lastControllersUpdate=0,this.tick=utils.throttle(this.throttledTick,10,this),navigator.getVRDisplays&&this.sceneEl.addEventListener("enter-vr",function(){navigator.getVRDisplays().then(function(e){e.length&&(t.vrDisplay=e[0])})})},updateControllerList:function(){for(var t=this.controllers=[],e=trackedControlsUtils.getGamepadsByPrefix(""),r=0;r<e.length;r++){var s=e[r];s&&s.pose&&t.push(s)}},throttledTick:function(){this.updateControllerList(),this.sceneEl.emit("controllersupdated",{controllers:this.controllers})}});
428
+ },{"../core/system":135,"../utils":196,"../utils/tracked-controls":200}],190:[function(_dereq_,module,exports){
429
+ module.exports=function(r,t){return function(n){return function(){var o=n.concat(Array.prototype.slice.call(arguments,0));return r.apply(t,o)}}(Array.prototype.slice.call(arguments,2))};
430
+ },{}],191:[function(_dereq_,module,exports){
431
+ function parse(e,t){var o,r={};return e&&"object"==typeof e?vecParseFloat({x:void 0!==e.x?e.x:t&&t.x,y:void 0!==e.y?e.y:t&&t.y,z:void 0!==e.z?e.z:t&&t.z,w:void 0!==e.w?e.w:t&&t.w}):"string"!=typeof e||null===e?"object"==typeof t?extend({},t):t:(o=e.trim().replace(/\s+/g," ").split(" "),r.x=o[0]||t&&t.x,r.y=o[1]||t&&t.y,r.z=o[2]||t&&t.z,r.w=o[3]||t&&t.w,vecParseFloat(r))}function stringify(e){return"object"!=typeof e?e:[e.x,e.y,e.z,e.w].join(" ").trim()}function isCoordinates(e){return regex.test(e)}function vecParseFloat(e){return Object.keys(e).forEach(function(t){if(void 0===e[t])return void delete e[t];e[t]=parseFloat(e[t],10)}),e}var debug=_dereq_("./debug"),extend=_dereq_("object-assign"),warn=debug("utils:coordinates:warn"),regex=/^\s*((-?\d*\.{0,1}\d+(e-?\d+)?)\s+){2,3}(-?\d*\.{0,1}\d+(e-?\d+)?)\s*$/;module.exports.regex=regex,module.exports.parse=parse,module.exports.stringify=stringify,module.exports.isCoordinates=isCoordinates,module.exports.isCoordinate=function(e){return warn("`AFRAME.utils.isCoordinate` has been renamed to `AFRAME.utils.isCoordinates`"),isCoordinates(e)},module.exports.toVector3=function(e){return new THREE.Vector3(e.x,e.y,e.z)};
432
+ },{"./debug":192,"object-assign":26}],192:[function(_dereq_,module,exports){
433
+ (function (process){
434
+ function getDebugNamespaceType(e){var r=e.split(":");return r[r.length-1]}function getDebugNamespaceColor(e){var r=getDebugNamespaceType(e);return settings.colors&&settings.colors[r]||null}function storage(){try{return window.localStorage}catch(e){}}var debugLib=_dereq_("debug"),extend=_dereq_("object-assign"),settings={colors:{debug:"gray",error:"red",info:"gray",warn:"orange"}},debug=function(e){var r=debugLib(e);return r.color=getDebugNamespaceColor(e),r};extend(debug,debugLib);var ls=storage();ls&&(parseInt(ls.logs,10)||"true"===ls.logs)?debug.enable("*"):debug.enable("*:error,*:info,*:warn"),process.browser&&(window.logs=debug),module.exports=debug;
435
+ }).call(this,_dereq_('_process'))
436
+
437
+ },{"_process":6,"debug":10,"object-assign":26}],193:[function(_dereq_,module,exports){
438
+ (function (process){
439
+ function checkHeadsetConnected(){var e,o=controls.getVRDisplay();return o&&"isConnected"in o?o.isConnected:(controls.update(),e=dolly.quaternion,0!==e._x||0!==e._y||0!==e._z)}function checkHasPositionalTracking(){var e=controls.getVRDisplay();return!isMobile()&&!isGearVR()&&(e&&e.capabilities.hasPosition)}function isTablet(e){return/ipad|Nexus (7|9)|xoom|sch-i800|playbook|tablet|kindle/i.test(e||window.navigator.userAgent)}function isIOS(){return/iPad|iPhone|iPod/.test(window.navigator.platform)}function isGearVR(){return/SamsungBrowser.+Mobile VR/i.test(window.navigator.userAgent)}var THREE=_dereq_("../lib/three"),dolly=new THREE.Object3D,controls=new THREE.VRControls(dolly);module.exports.checkHeadsetConnected=checkHeadsetConnected,module.exports.checkHasPositionalTracking=checkHasPositionalTracking;var isMobile=function(){var e=!1;return function(o){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(o)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(o.substr(0,4)))&&(e=!0),(isIOS()||isTablet())&&(e=!0)}(window.navigator.userAgent||window.navigator.vendor||window.opera),function(){return e}}();module.exports.isMobile=isMobile,module.exports.isTablet=isTablet,module.exports.isIOS=isIOS,module.exports.isGearVR=isGearVR,module.exports.isLandscape=function(){return 90===window.orientation||-90===window.orientation},module.exports.isIOSOlderThan10=function(e){return/(iphone|ipod|ipad).*os.(7|8|9)/i.test(e)},module.exports.isBrowserEnvironment=!(process&&!process.browser),module.exports.isNodeEnvironment=!module.exports.isBrowserEnvironment;
440
+ }).call(this,_dereq_('_process'))
441
+
442
+ },{"../lib/three":173,"_process":6}],194:[function(_dereq_,module,exports){
443
+ module.exports.getComponentPropertyPath=function(t,e){return e=e||".",-1===t.indexOf(e)?t:t.split(e)},module.exports.getComponentProperty=function(t,e,r){var o;return r=r||".",-1!==e.indexOf(r)?(o=e.split(r),t.getAttribute(o[0])[o[1]]):t.getAttribute(e)},module.exports.setComponentProperty=function(t,e,r,o){var n,i={};if(o=o||".",-1!==e.indexOf(o))return n=e.split(o),i[n[1]]=r,void t.setAttribute(n[0],i);t.setAttribute(e,r)};
444
+ },{}],195:[function(_dereq_,module,exports){
445
+ module.exports=function(t){var e=t.style.width,s=t.style.height;t.style.width=parseInt(e,10)+1+"px",t.style.height=parseInt(s,10)+1+"px",setTimeout(function(){t.style.width=e,t.style.height=s},200)};
446
+ },{}],196:[function(_dereq_,module,exports){
447
+ function deepEqual(e,t){var r,o,n,i,u;if(void 0===e||void 0===t||null===e||null===t||!(e&&t&&e.constructor===Object&&t.constructor===Object||e.constructor===Array&&t.constructor===Array))return e===t;if(o=Object.keys(e),n=Object.keys(t),o.length!==n.length)return!1;for(r=0;r<o.length;++r)if(i=e[o[r]],u=t[o[r]],"object"==typeof i||"object"==typeof u||Array.isArray(i)&&Array.isArray(u)){if(i===u)continue;if(!deepEqual(i,u))return!1}else if(i!==u)return!1;return!0}var debug=_dereq_("./debug"),deepAssign=_dereq_("deep-assign"),device=_dereq_("./device"),objectAssign=_dereq_("object-assign"),warn=debug("utils:warn");module.exports.bind=_dereq_("./bind"),module.exports.coordinates=_dereq_("./coordinates"),module.exports.debug=debug,module.exports.device=device,module.exports.entity=_dereq_("./entity"),module.exports.forceCanvasResizeSafariMobile=_dereq_("./forceCanvasResizeSafariMobile"),module.exports.material=_dereq_("./material"),module.exports.styleParser=_dereq_("./styleParser"),module.exports.trackedControls=_dereq_("./tracked-controls"),module.exports.checkHeadsetConnected=function(){return warn("`utils.checkHeadsetConnected` has moved to `utils.device.checkHeadsetConnected`"),device.checkHeadsetConnected(arguments)},module.exports.isGearVR=function(){return warn("`utils.isGearVR` has moved to `utils.device.isGearVR`"),device.isGearVR(arguments)},module.exports.isIOS=function(){return warn("`utils.isIOS` has moved to `utils.device.isIOS`"),device.isIOS(arguments)},module.exports.isMobile=function(){return warn("`utils.isMobile has moved to `utils.device.isMobile`"),device.isMobile(arguments)},module.exports.throttle=function(e,t,r){var o;return r&&(e=module.exports.bind(e,r)),function(){var r=Date.now(),n=void 0===o?t:r-o;(void 0===o||n>=t)&&(o=r,e.apply(null,arguments))}},module.exports.throttleTick=function(e,t,r){var o;return r&&(e=module.exports.bind(e,r)),function(r,n){var i=void 0===o?n:r-o;(void 0===o||i>=t)&&(o=r,e(r,i))}},module.exports.fireEvent=function(e,t,r){r=r||{},r.detail=r.detail||{},r.detail.target=r.detail.target||e;var o=new CustomEvent(t,r);e.dispatchEvent(o)},module.exports.extend=objectAssign,module.exports.extendDeep=deepAssign,module.exports.clone=function(e){return JSON.parse(JSON.stringify(e))},module.exports.deepEqual=deepEqual,module.exports.diff=function(e,t){var r={},o=Object.keys(e);return t?(Object.keys(t).forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),o.forEach(function(o){var n=e[o],i=t[o],u=n&&i&&n.constructor===Object&&i.constructor===Object;(u&&!deepEqual(n,i)||!u&&n!==i)&&(r[o]=i)}),r):r},module.exports.shouldCaptureKeyEvent=function(e){return!e.metaKey&&document.activeElement===document.body},module.exports.splitString=function(e,t){void 0===t&&(t=" ");var r=new RegExp(t,"g");return e=(e||"").replace(r,t),e.split(t)},module.exports.getElData=function(e,t){function r(t){e.hasAttribute(t)&&(o[t]=e.getAttribute(t))}t=t||{};var o={};return Object.keys(t).forEach(r),o},module.exports.getUrlParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),r=t.exec(location.search);return null===r?"":decodeURIComponent(r[1].replace(/\+/g," "))},module.exports.isIframed=function(){return window.top!==window.self},module.exports.findAllScenes=function(e){for(var t=[],r=e.getElementsByTagName("*"),o=0,n=r.length;o<n;o++)r[o].isScene&&t.push(r[o]);return t},module.exports.srcLoader=_dereq_("./src-loader");
448
+ },{"./bind":190,"./coordinates":191,"./debug":192,"./device":193,"./entity":194,"./forceCanvasResizeSafariMobile":195,"./material":197,"./src-loader":198,"./styleParser":199,"./tracked-controls":200,"deep-assign":12,"object-assign":26}],197:[function(_dereq_,module,exports){
449
+ function handleTextureEvents(e,t){t&&(e.emit("materialtextureloaded",{src:t.image,texture:t}),t.image&&"VIDEO"===t.image.tagName&&(t.image.addEventListener("loadeddata",function(){e.components&&e.components.material&&(t.needsCorrectionBGRA&&t.needsCorrectionFlipY&&-1!==["standard","flat"].indexOf(e.components.material.data.shader)&&e.setAttribute("material","shader","ios10hls"),e.emit("materialvideoloadeddata",{src:t.image,texture:t}))}),t.image.addEventListener("ended",function(){e.emit("materialvideoended",{src:t.image,texture:t})})))}var THREE=_dereq_("../lib/three"),HLS_MIMETYPES=["application/x-mpegurl","application/vnd.apple.mpegurl"];module.exports.updateMapMaterialFromData=function(e,t,a,r){function n(t){a.materialSrcs[e]===l&&i(t)}function i(t){s[e]=t,s.needsUpdate=!0,handleTextureEvents(o,t)}var o=a.el,s=a.material,l=r[t];if(a.materialSrcs||(a.materialSrcs={}),!l)return delete a.materialSrcs[e],void i(null);l!==a.materialSrcs[e]&&(a.materialSrcs[e]=l,l instanceof THREE.Texture?i(l):o.sceneEl.systems.material.loadTexture(l,{src:l,repeat:r.repeat,offset:r.offset,npot:r.npot},n))},module.exports.updateMap=function(e,t){return module.exports.updateMapMaterialFromData("map","src",e,t)},module.exports.updateDistortionMap=function(e,t,a){function r(e){o[n+"Map"]=e,o.needsUpdate=!0,handleTextureEvents(i,e)}var n=e;"ambientOcclusion"===e&&(n="ao");var i=t.el,o=t.material,s=a[e+"Map"],l={};if(l.src=s,l.offset=a[e+"TextureOffset"],l.repeat=a[e+"TextureRepeat"],l.wrap=a[e+"TextureWrap"],s){if(s===t[e+"TextureSrc"])return;return t[e+"TextureSrc"]=s,void i.sceneEl.systems.material.loadTexture(s,l,r)}o.map&&r(null)},module.exports.handleTextureEvents=handleTextureEvents,module.exports.isHLS=function(e,t){return!(!t||!HLS_MIMETYPES.includes(t.toLowerCase()))||!!(e&&e.toLowerCase().indexOf(".m3u8")>0)};
450
+ },{"../lib/three":173}],198:[function(_dereq_,module,exports){
451
+ function validateSrc(e,r,a){checkIsImage(e,function(t){if(t)return void r(e);a(e)})}function validateCubemapSrc(e,r){function a(e){o.push(e),6===o.length&&r(o)}var t,n,c,i="",o=[];for(n=0;n<5;n++)i+="(url\\((?:[^\\)]+)\\),\\s*)";if(i+="(url\\((?:[^\\)]+)\\)\\s*)",c=e.match(new RegExp(i)))for(n=1;n<7;n++)validateSrc(parseUrl(c[n]),a);else if(t=validateAndGetQuerySelector(e))return"A-CUBEMAP"===t.tagName&&t.srcs?r(t.srcs):void warn('Selector "%s" does not point to <a-cubemap>',e)}function parseUrl(e){var r=e.match(/\url\((.+)\)/);if(r)return r[1]}function checkIsImage(e,r){function a(){r(!0)}function t(){r(!1)}if(e.tagName)return void r("IMG"===e.tagName);var n=new Image;n.addEventListener("load",a),n.addEventListener("error",t),n.src=e}function validateAndGetQuerySelector(e){try{var r=document.querySelector(e);return r||warn('No element was found matching the selector: "%s"',e),r}catch(r){return void warn('"%s" is not a valid selector',e)}}var debug=_dereq_("./debug"),warn=debug("utils:src-loader:warn");module.exports={parseUrl:parseUrl,validateSrc:validateSrc,validateCubemapSrc:validateCubemapSrc};
452
+ },{"./debug":192}],199:[function(_dereq_,module,exports){
453
+ function toCamelCase(e){function r(e){return e[1].toUpperCase()}return e.replace(/-([a-z])/g,r)}function transformKeysToCamelCase(e){var r=Object.keys(e),t={};return r.forEach(function(r){var s=toCamelCase(r);t[s]=e[r]}),t}var styleParser=_dereq_("style-attr");module.exports.parse=function(e){var r;return"string"!=typeof e?e:(r=styleParser.parse(e),r[""]?e:transformKeysToCamelCase(r))},module.exports.stringify=function(e){return"string"==typeof e?e:styleParser.stringify(e)},module.exports.toCamelCase=toCamelCase,module.exports.transformKeysToCamelCase=transformKeysToCamelCase;
454
+ },{"style-attr":36}],200:[function(_dereq_,module,exports){
455
+ function isControllerPresent(e,n,r){var t,o,l,s=!1,i=0,a=e.el.sceneEl,c=a&&a.systems["tracked-controls"];if(!c)return s;if(l=c.controllers,l&&0!==l.length||(c.updateControllerList(),l=c.controllers),!l)return s;for(var d=0;d<l.length&&(t=l[d],o=!n||""===n||0===t.id.indexOf(n),s=o,s&&r.hand&&(s=(t.hand||DEFAULT_HANDEDNESS)===r.hand),s&&r.index&&(s=i===r.index),!s);++d)o&&i++;return s}var DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,AXIS_LABELS=["x","y","z","w"];module.exports.getGamepadsByPrefix=function(e){var n,r=[],t=navigator.getGamepads&&navigator.getGamepads();if(!t)return r;for(var o=0;o<t.length;++o)(n=t[o])&&(e&&0!==n.id.indexOf(e)||r.push(n));return r},module.exports.checkControllerPresentAndSetup=function(e,n,r){var t=e.el,o=isControllerPresent(e,n,r);if(e.controllerPresent&&!e.controllerEventsActive&&e.addEventListeners(),o===e.controllerPresent)return o;e.controllerPresent=o,o?(e.injectTrackedControls(),e.addEventListeners(),t.emit("controllerconnected",{name:e.name,component:e})):(e.removeEventListeners(),t.emit("controllerdisconnected",{name:e.name,component:e}))},module.exports.isControllerPresent=isControllerPresent,module.exports.emitIfAxesChanged=function(e,n,r){Object.keys(n).forEach(function(t){var o=n[t],l=r.detail.changed;if(o.reduce(function(e,n){return e||l[n]},!l)){var s={};o.forEach(function(e){s[AXIS_LABELS[e]]=r.detail.axis[e]}),e.el.emit(t+"moved",s)}})};
456
+ },{"../constants":116}],201:[function(_dereq_,module,exports){
457
+ THREE.VRControls=function(t,n){function s(t){i=t,t.length>0?e=t[0]:n&&n("VR input not available.")}var e,i,o=this,a=new THREE.Matrix4,r=null;"VRFrameData"in window&&(r=new window.VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(s).catch(function(){console.warn("THREE.VRControls: Unable to get VR Displays")}),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return e},this.setVRDisplay=function(t){e=t},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),i},this.getStandingMatrix=function(){return a},this.update=function(){if(e){var n;e.getFrameData?(e.getFrameData(r),n=r.pose):e.getPose&&(n=e.getPose()),null!==n.orientation&&t.quaternion.fromArray(n.orientation),null!==n.position?t.position.fromArray(n.position):t.position.set(0,0,0),this.standing&&(e.stageParameters?(t.updateMatrix(),a.fromArray(e.stageParameters.sittingToStandingTransform),t.applyMatrix(a)):t.position.setY(t.position.y+this.userHeight)),t.position.multiplyScalar(o.scale)}},this.resetPose=function(){e&&e.resetPose()},this.resetSensor=function(){console.warn("THREE.VRControls: .resetSensor() is now .resetPose()."),this.resetPose()},this.zeroSensor=function(){console.warn("THREE.VRControls: .zeroSensor() is now .resetPose()."),this.resetPose()},this.dispose=function(){e=null}};
458
+ },{}],202:[function(_dereq_,module,exports){
459
+ THREE.VREffect=function(e,t){function i(e){h=e,e.length>0?o=e[0]:t&&t("HMD not available")}function r(){var t=f.isPresenting;if(f.isPresenting=void 0!==o&&o.isPresenting,f.isPresenting){var i=o.getEyeParameters("left"),r=i.renderWidth,n=i.renderHeight;t||(m=e.getPixelRatio(),w=e.getSize(),e.setPixelRatio(1),e.setSize(2*r,n,!1))}else t&&(e.setPixelRatio(m),e.setSize(w.width,w.height,p))}function n(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,r=2/(e.upTan+e.downTan);return{scale:[t,r],offset:[i,(e.upTan-e.downTan)*r*.5]}}function a(e,t,i,r){t=void 0===t||t,i=void 0===i?.01:i,r=void 0===r?1e4:r;var a=t?-1:1,s=new THREE.Matrix4,o=s.elements,h=n(e);return o[0]=h.scale[0],o[1]=0,o[2]=h.offset[0]*a,o[3]=0,o[4]=0,o[5]=h.scale[1],o[6]=-h.offset[1]*a,o[7]=0,o[8]=0,o[9]=0,o[10]=r/(i-r)*-a,o[11]=r*i/(i-r),o[12]=0,o[13]=0,o[14]=a,o[15]=0,s.transpose(),s}function s(e,t,i,r){var n=Math.PI/180;return a({upTan:Math.tan(e.upDegrees*n),downTan:Math.tan(e.downDegrees*n),leftTan:Math.tan(e.leftDegrees*n),rightTan:Math.tan(e.rightDegrees*n)},t,i,r)}var o,h,d,l,u=new THREE.Vector3,c=new THREE.Vector3,g=null;"VRFrameData"in window&&(g=new window.VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(i).catch(function(){console.warn("THREE.VREffect: Unable to get VR Displays")}),this.isPresenting=!1;var f=this,w=e.getSize(),p=!1,m=e.getPixelRatio();this.getVRDisplay=function(){return o},this.setVRDisplay=function(e){o=e},this.getVRDisplays=function(){return console.warn("THREE.VREffect: getVRDisplays() is being deprecated."),h},this.setSize=function(t,i,r){if(w={width:t,height:i},p=r,f.isPresenting){var n=o.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*n.renderWidth,n.renderHeight,!1)}else e.setPixelRatio(m),e.setSize(t,i,r)};var v=e.domElement,y=[0,0,.5,1],x=[.5,0,.5,1];window.addEventListener("vrdisplaypresentchange",r,!1),this.setFullScreen=function(e){return new Promise(function(t,i){return void 0===o?void i(new Error("No VR hardware found.")):f.isPresenting===e?void t():void t(e?o.requestPresent([{source:v}]):o.exitPresent())})},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)},this.requestAnimationFrame=function(e){return void 0!==o?o.requestAnimationFrame(e):window.requestAnimationFrame(e)},this.cancelAnimationFrame=function(e){void 0!==o?o.cancelAnimationFrame(e):window.cancelAnimationFrame(e)},this.submitFrame=function(){void 0!==o&&f.isPresenting&&o.submitFrame()},this.autoSubmitFrame=!0;var R=new THREE.PerspectiveCamera;R.layers.enable(1);var E=new THREE.PerspectiveCamera;E.layers.enable(2),this.render=function(t,i,r,n){if(o&&f.isPresenting){var a=t.autoUpdate;a&&(t.updateMatrixWorld(),t.autoUpdate=!1);var h=o.getEyeParameters("left"),w=o.getEyeParameters("right");u.fromArray(h.offset),c.fromArray(w.offset),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var p,m,v=e.getSize(),P=o.getLayers();if(P.length){var T=P[0];p=null!==T.leftBounds&&4===T.leftBounds.length?T.leftBounds:y,m=null!==T.rightBounds&&4===T.rightBounds.length?T.rightBounds:x}else p=y,m=x;return d={x:Math.round(v.width*p[0]),y:Math.round(v.height*p[1]),width:Math.round(v.width*p[2]),height:Math.round(v.height*p[3])},l={x:Math.round(v.width*m[0]),y:Math.round(v.height*m[1]),width:Math.round(v.width*m[2]),height:Math.round(v.height*m[3])},r?(e.setRenderTarget(r),r.scissorTest=!0):(e.setRenderTarget(null),e.setScissorTest(!0)),(e.autoClear||n)&&e.clear(),null===i.parent&&i.updateMatrixWorld(),i.matrixWorld.decompose(R.position,R.quaternion,R.scale),E.position.copy(R.position),E.quaternion.copy(R.quaternion),E.scale.copy(R.scale),R.translateOnAxis(u,R.scale.x),E.translateOnAxis(c,E.scale.x),o.getFrameData?(o.depthNear=i.near,o.depthFar=i.far,o.getFrameData(g),R.projectionMatrix.elements=g.leftProjectionMatrix,E.projectionMatrix.elements=g.rightProjectionMatrix):(R.projectionMatrix=s(h.fieldOfView,!0,i.near,i.far),E.projectionMatrix=s(w.fieldOfView,!0,i.near,i.far)),r?(r.viewport.set(d.x,d.y,d.width,d.height),r.scissor.set(d.x,d.y,d.width,d.height)):(e.setViewport(d.x,d.y,d.width,d.height),e.setScissor(d.x,d.y,d.width,d.height)),e.render(t,R,r,n),r?(r.viewport.set(l.x,l.y,l.width,l.height),r.scissor.set(l.x,l.y,l.width,l.height)):(e.setViewport(l.x,l.y,l.width,l.height),e.setScissor(l.x,l.y,l.width,l.height)),e.render(t,E,r,n),r?(r.viewport.set(0,0,v.width,v.height),r.scissor.set(0,0,v.width,v.height),r.scissorTest=!1,e.setRenderTarget(null)):(e.setViewport(0,0,v.width,v.height),e.setScissorTest(!1)),a&&(t.autoUpdate=!0),void(f.autoSubmitFrame&&f.submitFrame())}e.render(t,i,r,n)},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",r,!1)}};
460
+ },{}],203:[function(_dereq_,module,exports){
461
+ window.glStats=function(){function e(e,r){return function(){r.apply(this,arguments),e.apply(this,arguments)}}function r(){a("allcalls").set(s+i),a("drawElements").set(i),a("drawArrays").set(s),a("bindTexture").set(m),a("useProgram").set(d),a("glfaces").set(l),a("glvertices").set(c),a("glpoints").set(p)}function n(){s=0,i=0,d=0,l=0,c=0,p=0,m=0}function t(){}function o(e){a=e}var a=null,s=0,i=0,d=0,l=0,c=0,p=0,m=0;return WebGLRenderingContext.prototype.drawArrays=e(WebGLRenderingContext.prototype.drawArrays,function(){s++,arguments[0]==this.POINTS?p+=arguments[2]:c+=arguments[2]}),WebGLRenderingContext.prototype.drawElements=e(WebGLRenderingContext.prototype.drawElements,function(){i++,l+=arguments[1]/3,c+=arguments[1]}),WebGLRenderingContext.prototype.useProgram=e(WebGLRenderingContext.prototype.useProgram,function(){d++}),WebGLRenderingContext.prototype.bindTexture=e(WebGLRenderingContext.prototype.bindTexture,function(){m++}),{update:r,start:n,end:t,attach:o,values:{allcalls:{over:3e3,caption:"Calls (hook)"},drawelements:{caption:"drawElements (hook)"},drawarrays:{caption:"drawArrays (hook)"}},groups:[{caption:"WebGL",values:["allcalls","drawelements","drawarrays","useprogram","bindtexture","glfaces","glvertices","glpoints"]}],fractions:[{base:"allcalls",steps:["drawelements","drawarrays"]}]}},window.threeStats=function(e){function r(){a("renderer.info.memory.geometries").set(e.info.memory.geometries),a("renderer.info.programs").set(e.info.programs.length),a("renderer.info.memory.textures").set(e.info.memory.textures),a("renderer.info.render.calls").set(e.info.render.calls),a("renderer.info.render.faces").set(e.info.render.faces),a("renderer.info.render.points").set(e.info.render.points),a("renderer.info.render.vertices").set(e.info.render.vertices)}function n(){}function t(){}function o(e){a=e}var a=null;return{update:r,start:n,end:t,attach:o,values:{"renderer.info.memory.geometries":{caption:"Geometries"},"renderer.info.memory.textures":{caption:"Textures"},"renderer.info.programs":{caption:"Programs"},"renderer.info.render.calls":{caption:"Calls"},"renderer.info.render.faces":{caption:"Faces",over:1e3},"renderer.info.render.points":{caption:"Points"},"renderer.info.render.vertices":{caption:"Vertices"}},groups:[{caption:"Three.js - Memory",values:["renderer.info.memory.geometries","renderer.info.programs","renderer.info.memory.textures"]},{caption:"Three.js - Render",values:["renderer.info.render.calls","renderer.info.render.faces","renderer.info.render.points","renderer.info.render.vertices"]}],fractions:[]}},window.BrowserStats=function(){function e(e){var r=Math.floor(Math.log(e)/p);return Math.round(100*e/Math.pow(1024,r))/100}function r(){s=e(performance.memory.usedJSHeapSize),i=e(performance.memory.totalJSHeapSize),a("memory").set(s),a("total").set(i)}function n(){s=0}function t(){}function o(e){a=e}var a=null,s=0,i=0;window.performance&&!performance.memory&&(performance.memory={usedJSHeapSize:0,totalJSHeapSize:0}),0===performance.memory.totalJSHeapSize&&console.warn("totalJSHeapSize === 0... performance.memory is only available in Chrome .");var d={memory:{caption:"Used Memory",average:!0,avgMs:1e3,over:22},total:{caption:"Total Memory"}},l=[{caption:"Browser",values:["memory","total"]}],c=[{base:"total",steps:["memory"]}],p=Math.log(1024);return{update:r,start:n,end:t,attach:o,values:d,groups:l,fractions:c}},"object"==typeof module&&(module.exports={glStats:window.glStats,threeStats:window.threeStats,BrowserStats:window.BrowserStats});
462
+ },{}],204:[function(_dereq_,module,exports){
463
+ "use strict";!function(){"performance"in window==0&&(window.performance={});var e=window.performance;if("now"in e==0){var t=Date.now();e.timing&&e.timing.navigationStart&&(t=e.timing.navigationStart),e.now=function(){return Date.now()-t}}e.mark||(e.mark=function(){}),e.measure||(e.measure=function(){})}(),window.rStats=function(e){function t(e,t){for(var n=Object.keys(e),a=0,r=n.length;a<r;a++)t(n[a])}function n(e){var t=document.createElement("link");t.href=e,t.rel="stylesheet",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t)}function a(e,t,n){function a(e,t){l+=.1*(e-l),c*=.99,l>c&&(c=l),o.drawImage(i,1,0,i.width-1,i.height,0,0,i.width-1,i.height),t?o.drawImage(f,i.width-1,i.height-l*i.height/c-p):o.drawImage(u,i.width-1,i.height-l*i.height/c-p)}var r=n||{},i=document.createElement("canvas"),o=i.getContext("2d"),c=0,l=0,s=r.color?r.color:"#666666",u=document.createElement("canvas"),d=u.getContext("2d");u.width=1,u.height=2*p,d.fillStyle="#444444",d.fillRect(0,0,1,2*p),d.fillStyle=s,d.fillRect(0,p,1,p),d.fillStyle="#ffffff",d.globalAlpha=.5,d.fillRect(0,p,1,1),d.globalAlpha=1;var f=document.createElement("canvas"),m=f.getContext("2d");return f.width=1,f.height=2*p,m.fillStyle="#444444",m.fillRect(0,0,1,2*p),m.fillStyle="#b70000",m.fillRect(0,p,1,p),m.globalAlpha=.5,m.fillStyle="#ffffff",m.fillRect(0,p,1,1),m.globalAlpha=1,function(){i.width=h,i.height=p,i.style.width=i.width+"px",i.style.height=i.height+"px",i.className="rs-canvas",e.appendChild(i),o.fillStyle="#444444",o.fillRect(0,0,i.width,i.height)}(),{draw:a}}function r(e,n){function a(e){i.drawImage(r,1,0,r.width-1,r.height,0,0,r.width-1,r.height);var n=0;t(e,function(t){var a=e[t]*r.height;i.fillStyle=s[t],i.fillRect(r.width-1,n,1,a),n+=a})}var r=document.createElement("canvas"),i=r.getContext("2d");return function(){r.width=h,r.height=p*n,r.style.width=r.width+"px",r.style.height=r.height+"px",r.className="rs-canvas",e.appendChild(r),i.fillStyle="#444444",i.fillRect(0,0,r.width,r.height)}(),{draw:a}}function i(e,t){function n(e){if(x&&x.average){v+=e,C++;var t=performance.now();t-w>=(x.avgMs||1e3)&&(g=v/C,v=0,w=t,C=0)}}function r(){d=performance.now(),l.userTimingAPI&&performance.mark(p+"-start"),I=!0}function i(){h=performance.now()-d,l.userTimingAPI&&(performance.mark(p+"-end"),I&&performance.measure(p,p+"-start",p+"-end")),n(h)}function o(){i(),r()}function c(){var e=x&&x.average?g:h;b.nodeValue=Math.round(100*e)/100;var t=x&&(x.below&&h<x.below||x.over&&h>x.over);N.draw(h,t),y.className=t?"rs-counter-base alarm":"rs-counter-base"}function s(){var e=performance.now(),t=e-d;m++,t>1e3&&(h=x&&!1===x.interpolate?m:1e3*m/t,m=0,d=e,n(h))}function u(e){h=e,n(h)}var d,p=e,h=0,m=0,g=0,v=0,w=performance.now(),C=0,y=document.createElement("div"),E=document.createElement("span"),S=document.createElement("div"),b=document.createTextNode(""),x=l?l.values[p.toLowerCase()]:null,N=new a(y,p,x),I=!1;return E.className="rs-counter-id",E.textContent=x&&x.caption?x.caption:p,S.className="rs-counter-value",S.appendChild(b),y.appendChild(E),y.appendChild(S),t?t.div.appendChild(y):f.appendChild(y),d=performance.now(),{set:u,start:r,tick:o,end:i,frame:s,value:function(){return h},draw:c}}function o(e){var n=e.toLowerCase();if(void 0===n&&(n="default"),m[n])return m[n];var a=null;l&&l.groups&&t(l.groups,function(e){var t=l.groups[parseInt(e,10)];a||-1===t.values.indexOf(n.toLowerCase())||(a=t)});var r=new i(n,a);return m[n]=r,r}function c(){t(l.plugins,function(e){l.plugins[e].update()}),t(m,function(e){m[e].draw()}),l&&l.fractions&&t(l.fractions,function(e){var n=l.fractions[parseInt(e,10)],a=[],r=m[n.base.toLowerCase()];r&&(r=r.value(),t(l.fractions[e].steps,function(t){var n=l.fractions[e].steps[parseInt(t,10)].toLowerCase(),i=m[n];i&&a.push(i.value()/r)})),n.graph.draw(a)})}var l=e||{},s=l.colours||["#850700","#c74900","#fcb300","#284280","#4c7c0c"],u=(l.CSSPath?l.CSSPath:"")+"rStats.css";(l.css||["https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300",u]).forEach(function(e){n(e)}),l.values||(l.values={});var d,f,p=10,h=200,m={};return function(){if(l.plugins){l.values||(l.values={}),l.groups||(l.groups=[]),l.fractions||(l.fractions=[]);for(var e=0;e<l.plugins.length;e++)l.plugins[e].attach(o),t(l.plugins[e].values,function(t){l.values[t]=l.plugins[e].values[t]}),l.groups=l.groups.concat(l.plugins[e].groups),l.fractions=l.fractions.concat(l.plugins[e].fractions)}else l.plugins={};d=document.createElement("div"),d.className="rs-base",f=document.createElement("div"),f.className="rs-container",f.style.height="auto",d.appendChild(f),document.body.appendChild(d),l&&(l.groups&&t(l.groups,function(e){var t=l.groups[parseInt(e,10)],n=document.createElement("div");n.className="rs-group",t.div=n;var a=document.createElement("h1");a.textContent=t.caption,a.addEventListener("click",function(e){this.classList.toggle("hidden"),e.preventDefault()}.bind(n)),f.appendChild(a),f.appendChild(n)}),l.fractions&&t(l.fractions,function(e){var n=l.fractions[parseInt(e,10)],a=document.createElement("div");a.className="rs-fraction";var i=document.createElement("div");i.className="rs-legend";var o=0;t(l.fractions[e].steps,function(t){var n=document.createElement("p");n.textContent=l.fractions[e].steps[t],n.style.color=s[o],i.appendChild(n),o++}),a.appendChild(i),a.style.height=o*p+"px",n.div=a;var c=new r(a,o);n.graph=c,f.appendChild(a)}))}(),function(e){return e?o(e):{element:d,update:c}}},"object"==typeof module&&(module.exports=window.rStats);
464
+ },{}],205:[function(_dereq_,module,exports){
465
+ var Util={};Util.base64=function(e,i){return"data:"+e+";base64,"+i},Util.isMobile=function(){var e=!1;return function(i){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},Util.isIOS=function(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)},Util.isIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},Util.appendQueryParameter=function(e,i,t){return e+=(e.indexOf("?")<0?"?":"&")+i+"="+t},Util.getQueryParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"=([^&#]*)"),t=i.exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},Util.isLandscapeMode=function(){return 90==window.orientation||-90==window.orientation},module.exports=Util;
466
+ },{}],206:[function(_dereq_,module,exports){
467
+ function AndroidWakeLock(){var A=document.createElement("video");A.addEventListener("ended",function(){A.play()}),this.request=function(){A.paused&&(A.src=Util.base64("video/webm","GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4ECQoWBAhhTgGcBAAAAAAAH4xFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsggfG7AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU2LjQwLjEwMVdBjUxhdmY1Ni40MC4xMDFzpJAGSJTMbsLpDt/ySkipgX1fRImIQO1MAAAAAAAWVK5rAQAAAAAAADuuAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDmDgQEj44OEO5rKAOABAAAAAAAABrCBsLqBkB9DtnUBAAAAAAAAo+eBAKOmgQAAgKJJg0IAAV4BHsAHBIODCoAACmH2MAAAZxgz4dPSTFi5JACjloED6ACmAECSnABMQAADYAAAWi0quoCjloEH0ACmAECSnABNwAADYAAAWi0quoCjloELuACmAECSnABNgAADYAAAWi0quoCjloEPoACmAECSnABNYAADYAAAWi0quoCjloETiACmAECSnABNIAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTnghdwo5aBAAAApgBAkpwATOAAA2AAAFotKrqAo5aBA+gApgBAkpwATMAAA2AAAFotKrqAo5aBB9AApgBAkpwATIAAA2AAAFotKrqAo5aBC7gApgBAkpwATEAAA2AAAFotKrqAo5aBD6AApgDAkpwAQ2AAA2AAAFotKrqAo5aBE4gApgBAkpwATCAAA2AAAFotKrqAH0O2dQEAAAAAAACU54Iu4KOWgQAAAKYAQJKcAEvAAANgAABaLSq6gKOWgQPoAKYAQJKcAEtgAANgAABaLSq6gKOWgQfQAKYAQJKcAEsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEogAANgAABaLSq6gKOWgROIAKYAQJKcAEnAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCRlCjloEAAACmAECSnABJgAADYAAAWi0quoCjloED6ACmAECSnABJIAADYAAAWi0quoCjloEH0ACmAMCSnABDYAADYAAAWi0quoCjloELuACmAECSnABI4AADYAAAWi0quoCjloEPoACmAECSnABIoAADYAAAWi0quoCjloETiACmAECSnABIYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngl3Ao5aBAAAApgBAkpwASCAAA2AAAFotKrqAo5aBA+gApgBAkpwASAAAA2AAAFotKrqAo5aBB9AApgBAkpwAR8AAA2AAAFotKrqAo5aBC7gApgBAkpwAR4AAA2AAAFotKrqAo5aBD6AApgBAkpwAR2AAA2AAAFotKrqAo5aBE4gApgBAkpwARyAAA2AAAFotKrqAH0O2dQEAAAAAAACU54J1MKOWgQAAAKYAwJKcAENgAANgAABaLSq6gKOWgQPoAKYAQJKcAEbgAANgAABaLSq6gKOWgQfQAKYAQJKcAEagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEZAAANgAABaLSq6gKOWgROIAKYAQJKcAEYAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCjKCjloEAAACmAECSnABF4AADYAAAWi0quoCjloED6ACmAECSnABFwAADYAAAWi0quoCjloEH0ACmAECSnABFoAADYAAAWi0quoCjloELuACmAECSnABFgAADYAAAWi0quoCjloEPoACmAMCSnABDYAADYAAAWi0quoCjloETiACmAECSnABFYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngqQQo5aBAAAApgBAkpwARUAAA2AAAFotKrqAo5aBA+gApgBAkpwARSAAA2AAAFotKrqAo5aBB9AApgBAkpwARQAAA2AAAFotKrqAo5aBC7gApgBAkpwARQAAA2AAAFotKrqAo5aBD6AApgBAkpwAROAAA2AAAFotKrqAo5aBE4gApgBAkpwARMAAA2AAAFotKrqAH0O2dQEAAAAAAACU54K7gKOWgQAAAKYAQJKcAESgAANgAABaLSq6gKOWgQPoAKYAQJKcAESAAANgAABaLSq6gKOWgQfQAKYAwJKcAENgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+gAKYAQJKcAERAAANgAABaLSq6gKOWgROIAKYAQJKcAEQgAANgAABaLSq6gB9DtnUBAAAAAAAAlOeC0vCjloEAAACmAECSnABEIAADYAAAWi0quoCjloED6ACmAECSnABEAAADYAAAWi0quoCjloEH0ACmAECSnABD4AADYAAAWi0quoCjloELuACmAECSnABDwAADYAAAWi0quoCjloEPoACmAECSnABDoAADYAAAWi0quoCjloETiACmAECSnABDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw=="),A.play())},this.release=function(){A.pause(),A.src=""}}function iOSWakeLock(){var A=null;this.request=function(){A||(A=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){A&&(clearInterval(A),A=null)}}function getWakeLock(){var A=navigator.userAgent||navigator.vendor||window.opera;return A.match(/iPhone/i)||A.match(/iPod/i)?iOSWakeLock:AndroidWakeLock}var Util=_dereq_("./util.js");module.exports=getWakeLock();
468
+ },{"./util.js":205}]},{},[171])(171)
469
+ });
470
+
471
+
472
+ //# sourceMappingURL=aframe.min.js.map