1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174 |
- (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(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
- 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;
- },{}],2:[function(_dereq_,module,exports){
- module.exports=function(e,n){return"number"==typeof e?e:"number"==typeof n?n:0};
- },{}],3:[function(_dereq_,module,exports){
- "use strict";function getLens(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=o.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function byteLength(o){var r=getLens(o),e=r[0],t=r[1];return 3*(e+t)/4-t}function _byteLength(o,r,e){return 3*(r+e)/4-e}function toByteArray(o){for(var r,e=getLens(o),t=e[0],n=e[1],u=new Arr(_byteLength(o,t,n)),p=0,a=n>0?t-4:t,h=0;h<a;h+=4)r=revLookup[o.charCodeAt(h)]<<18|revLookup[o.charCodeAt(h+1)]<<12|revLookup[o.charCodeAt(h+2)]<<6|revLookup[o.charCodeAt(h+3)],u[p++]=r>>16&255,u[p++]=r>>8&255,u[p++]=255&r;return 2===n&&(r=revLookup[o.charCodeAt(h)]<<2|revLookup[o.charCodeAt(h+1)]>>4,u[p++]=255&r),1===n&&(r=revLookup[o.charCodeAt(h)]<<10|revLookup[o.charCodeAt(h+1)]<<4|revLookup[o.charCodeAt(h+2)]>>2,u[p++]=r>>8&255,u[p++]=255&r),u}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,n=[],u=r;u<e;u+=3)t=(o[u]<<16&16711680)+(o[u+1]<<8&65280)+(255&o[u+2]),n.push(tripletToBase64(t));return n.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,n=[],u=0,p=e-t;u<p;u+=16383)n.push(encodeChunk(o,u,u+16383>p?p:u+16383));return 1===t?(r=o[e-1],n.push(lookup[r>>2]+lookup[r<<4&63]+"==")):2===t&&(r=(o[e-2]<<8)+o[e-1],n.push(lookup[r>>10]+lookup[r>>4&63]+lookup[r<<2&63]+"=")),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;
- },{}],4:[function(_dereq_,module,exports){
- "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))}};
- },{}],5:[function(_dereq_,module,exports){
- 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}};
- },{"buffer":6}],6:[function(_dereq_,module,exports){
- (function (global,Buffer){
- "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;
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},_dereq_("buffer").Buffer)
- },{"base64-js":3,"buffer":6,"ieee754":29,"isarray":35}],7:[function(_dereq_,module,exports){
- !function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,r;return t=t||{},t.bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,n=document.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}();
- },{}],8:[function(_dereq_,module,exports){
- 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());
- },{"./debug":9}],9:[function(_dereq_,module,exports){
- 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;
- },{}],10:[function(_dereq_,module,exports){
- "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};
- },{"is-obj":34}],11:[function(_dereq_,module,exports){
- "use strict";var keys=_dereq_("object-keys"),hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),toStr=Object.prototype.toString,concat=Array.prototype.concat,origDefineProperty=Object.defineProperty,isFunction=function(e){return"function"==typeof e&&"[object Function]"===toStr.call(e)},arePropertyDescriptorsSupported=function(){var e={};try{origDefineProperty(e,"x",{enumerable:!1,value:e});for(var r in e)return!1;return e.x===e}catch(e){return!1}},supportsDescriptors=origDefineProperty&&arePropertyDescriptorsSupported(),defineProperty=function(e,r,t,o){(!(r in e)||isFunction(o)&&o())&&(supportsDescriptors?origDefineProperty(e,r,{configurable:!0,enumerable:!1,value:t,writable:!0}):e[r]=t)},defineProperties=function(e,r){var t=arguments.length>2?arguments[2]:{},o=keys(r);hasSymbols&&(o=concat.call(o,Object.getOwnPropertySymbols(r)));for(var n=0;n<o.length;n+=1)defineProperty(e,o[n],r[o[n]],t[o[n]])};defineProperties.supportsDescriptors=!!supportsDescriptors,module.exports=defineProperties;
- },{"object-keys":41}],12:[function(_dereq_,module,exports){
- !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");
- },{}],13:[function(_dereq_,module,exports){
- 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}};
- },{}],14:[function(_dereq_,module,exports){
- "use strict";var undefined,ThrowTypeError=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,getProto=Object.getPrototypeOf||function(e){return e.__proto__},generator,generatorFunction=generator?getProto(generator):undefined,asyncFn,asyncFunction=asyncFn?asyncFn.constructor:undefined,asyncGen,asyncGenFunction=asyncGen?getProto(asyncGen):undefined,asyncGenIterator=asyncGen?asyncGen():undefined,TypedArray="undefined"==typeof Uint8Array?undefined:getProto(Uint8Array),INTRINSICS={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":hasSymbols?getProto([][Symbol.iterator]()):undefined,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":undefined,"$ %AsyncFunction%":asyncFunction,"$ %AsyncFunctionPrototype%":asyncFunction?asyncFunction.prototype:undefined,"$ %AsyncGenerator%":asyncGen?getProto(asyncGenIterator):undefined,"$ %AsyncGeneratorFunction%":asyncGenFunction,"$ %AsyncGeneratorPrototype%":asyncGenFunction?asyncGenFunction.prototype:undefined,"$ %AsyncIteratorPrototype%":asyncGenIterator&&hasSymbols&&Symbol.asyncIterator?asyncGenIterator[Symbol.asyncIterator]():undefined,"$ %Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?undefined:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?undefined:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?undefined:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?undefined:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":generator?getProto(generator()):undefined,"$ %GeneratorFunction%":generatorFunction,"$ %GeneratorPrototype%":generatorFunction?generatorFunction.prototype:undefined,"$ %Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?undefined:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?undefined:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?undefined:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":hasSymbols?getProto(getProto([][Symbol.iterator]())):undefined,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?undefined:Map,"$ %MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols?getProto((new Map)[Symbol.iterator]()):undefined,"$ %MapPrototype%":"undefined"==typeof Map?undefined:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?undefined:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?undefined:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?undefined:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?undefined:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?undefined:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?undefined:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?undefined:Set,"$ %SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols?getProto((new Set)[Symbol.iterator]()):undefined,"$ %SetPrototype%":"undefined"==typeof Set?undefined:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":hasSymbols?getProto(""[Symbol.iterator]()):undefined,"$ %StringPrototype%":String.prototype,"$ %Symbol%":hasSymbols?Symbol:undefined,"$ %SymbolPrototype%":hasSymbols?Symbol.prototype:undefined,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":ThrowTypeError,"$ %TypedArray%":TypedArray,"$ %TypedArrayPrototype%":TypedArray?TypedArray.prototype:undefined,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?undefined:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?undefined:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?undefined:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?undefined:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?undefined:WeakSet.prototype};module.exports=function(e,r){if(arguments.length>1&&"boolean"!=typeof r)throw new TypeError('"allowMissing" argument must be a boolean');var t="$ "+e;if(!(t in INTRINSICS))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===INTRINSICS[t]&&!r)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return INTRINSICS[t]};
- },{}],15:[function(_dereq_,module,exports){
- "use strict";var GetIntrinsic=_dereq_("./GetIntrinsic"),$Object=GetIntrinsic("%Object%"),$TypeError=GetIntrinsic("%TypeError%"),$String=GetIntrinsic("%String%"),assertRecord=_dereq_("./helpers/assertRecord"),$isNaN=_dereq_("./helpers/isNaN"),$isFinite=_dereq_("./helpers/isFinite"),sign=_dereq_("./helpers/sign"),mod=_dereq_("./helpers/mod"),IsCallable=_dereq_("is-callable"),toPrimitive=_dereq_("es-to-primitive/es5"),has=_dereq_("has"),ES5={ToPrimitive:toPrimitive,ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var r=this.ToNumber(e);return $isNaN(r)?0:0!==r&&$isFinite(r)?sign(r)*Math.floor(Math.abs(r)):r},ToInt32:function(e){return this.ToNumber(e)>>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var r=this.ToNumber(e);if($isNaN(r)||0===r||!$isFinite(r))return 0;var t=sign(r)*Math.floor(Math.abs(r));return mod(t,65536)},ToString:function(e){return $String(e)},ToObject:function(e){return this.CheckObjectCoercible(e),$Object(e)},CheckObjectCoercible:function(e,r){if(null==e)throw new $TypeError(r||"Cannot call method on "+e);return e},IsCallable:IsCallable,SameValue:function(e,r){return e===r?0!==e||1/e==1/r:$isNaN(e)&&$isNaN(r)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var t in e)if(has(e,t)&&!r[t])return!1;var i=has(e,"[[Value]]"),o=has(e,"[[Get]]")||has(e,"[[Set]]");if(i&&o)throw new $TypeError("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return void 0!==e&&(assertRecord(this,"Property Descriptor","Desc",e),!(!has(e,"[[Get]]")&&!has(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(assertRecord(this,"Property Descriptor","Desc",e),!(!has(e,"[[Value]]")&&!has(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(assertRecord(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(assertRecord(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new $TypeError("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new $TypeError("ToPropertyDescriptor requires an object");var r={};if(has(e,"enumerable")&&(r["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),has(e,"configurable")&&(r["[[Configurable]]"]=this.ToBoolean(e.configurable)),has(e,"value")&&(r["[[Value]]"]=e.value),has(e,"writable")&&(r["[[Writable]]"]=this.ToBoolean(e.writable)),has(e,"get")){var t=e.get;if(void 0!==t&&!this.IsCallable(t))throw new TypeError("getter must be a function");r["[[Get]]"]=t}if(has(e,"set")){var i=e.set;if(void 0!==i&&!this.IsCallable(i))throw new $TypeError("setter must be a function");r["[[Set]]"]=i}if((has(r,"[[Get]]")||has(r,"[[Set]]"))&&(has(r,"[[Value]]")||has(r,"[[Writable]]")))throw new $TypeError("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return r}};module.exports=ES5;
- },{"./GetIntrinsic":14,"./helpers/assertRecord":16,"./helpers/isFinite":17,"./helpers/isNaN":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"has":28,"is-callable":32}],16:[function(_dereq_,module,exports){
- "use strict";var GetIntrinsic=_dereq_("../GetIntrinsic"),$TypeError=GetIntrinsic("%TypeError%"),$SyntaxError=GetIntrinsic("%SyntaxError%"),has=_dereq_("has"),predicates={"Property Descriptor":function(r,e){if("Object"!==r.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(has(e,n)&&!t[n])return!1;var o=has(e,"[[Value]]"),a=has(e,"[[Get]]")||has(e,"[[Set]]");if(o&&a)throw new $TypeError("Property Descriptors may not be both accessor and data descriptors");return!0}};module.exports=function(r,e,t,n){var o=predicates[e];if("function"!=typeof o)throw new $SyntaxError("unknown record type: "+e);if(!o(r,n))throw new $TypeError(t+" must be a "+e);console.log(o(r,n),n)};
- },{"../GetIntrinsic":14,"has":28}],17:[function(_dereq_,module,exports){
- var $isNaN=Number.isNaN||function(e){return e!==e};module.exports=Number.isFinite||function(e){return"number"==typeof e&&!$isNaN(e)&&e!==1/0&&e!==-1/0};
- },{}],18:[function(_dereq_,module,exports){
- module.exports=Number.isNaN||function(e){return e!==e};
- },{}],19:[function(_dereq_,module,exports){
- module.exports=function(o,r){var t=o%r;return Math.floor(t>=0?t:t+r)};
- },{}],20:[function(_dereq_,module,exports){
- module.exports=function(e){return e>=0?1:-1};
- },{}],21:[function(_dereq_,module,exports){
- "use strict";var toStr=Object.prototype.toString,isPrimitive=_dereq_("./helpers/isPrimitive"),isCallable=_dereq_("is-callable"),ES5internalSlots={"[[DefaultValue]]":function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===toStr.call(e)?String:Number)===String||t===Number){var r,i,l=t===String?["toString","valueOf"]:["valueOf","toString"];for(i=0;i<l.length;++i)if(isCallable(e[l[i]])&&(r=e[l[i]](),isPrimitive(r)))return r;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")}};module.exports=function(e){return isPrimitive(e)?e:arguments.length>1?ES5internalSlots["[[DefaultValue]]"](e,arguments[1]):ES5internalSlots["[[DefaultValue]]"](e)};
- },{"./helpers/isPrimitive":22,"is-callable":32}],22:[function(_dereq_,module,exports){
- module.exports=function(o){return null===o||"function"!=typeof o&&"object"!=typeof o};
- },{}],23:[function(_dereq_,module,exports){
- function flattenVertexData(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&e[0]&&"number"==typeof e[0][0]){var n,a,l,o,f=e[0].length,s=e.length*f;t&&"string"!=typeof t||(t=new(dtype(t||"float32"))(s+r));var i=t.length-r;if(s!==i)throw new Error("source length "+s+" ("+f+"x"+e.length+") does not match destination length "+i);for(n=0,l=r;n<e.length;n++)for(a=0;a<f;a++)t[l++]=null===e[n][a]?NaN:e[n][a]}else if(t&&"string"!=typeof t)t.set(e,r);else{var y=dtype(t||"float32");if(Array.isArray(e)||"array"===t)for(t=new y(e.length+r),n=0,l=r,o=t.length;l<o;l++,n++)t[l]=null===e[n]?NaN:e[n];else 0===r?t=new y(e):(t=new y(e.length+r),t.set(e,r))}return t}var dtype=_dereq_("dtype");module.exports=flattenVertexData;
- },{"dtype":13}],24:[function(_dereq_,module,exports){
- "use strict";var isCallable=_dereq_("is-callable"),toStr=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,forEachArray=function(r,t,a){for(var o=0,l=r.length;o<l;o++)hasOwnProperty.call(r,o)&&(null==a?t(r[o],o,r):t.call(a,r[o],o,r))},forEachString=function(r,t,a){for(var o=0,l=r.length;o<l;o++)null==a?t(r.charAt(o),o,r):t.call(a,r.charAt(o),o,r)},forEachObject=function(r,t,a){for(var o in r)hasOwnProperty.call(r,o)&&(null==a?t(r[o],o,r):t.call(a,r[o],o,r))},forEach=function(r,t,a){if(!isCallable(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===toStr.call(r)?forEachArray(r,t,o):"string"==typeof r?forEachString(r,t,o):forEachObject(r,t,o)};module.exports=forEach;
- },{"is-callable":32}],25:[function(_dereq_,module,exports){
- "use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",slice=Array.prototype.slice,toStr=Object.prototype.toString,funcType="[object Function]";module.exports=function(t){var n=this;if("function"!=typeof n||toStr.call(n)!==funcType)throw new TypeError(ERROR_MESSAGE+n);for(var o,e=slice.call(arguments,1),r=function(){if(this instanceof o){var r=n.apply(this,e.concat(slice.call(arguments)));return Object(r)===r?r:this}return n.apply(t,e.concat(slice.call(arguments)))},c=Math.max(0,n.length-e.length),i=[],p=0;p<c;p++)i.push("$"+p);if(o=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")(r),n.prototype){var l=function(){};l.prototype=n.prototype,o.prototype=new l,l.prototype=null}return o};
- },{}],26:[function(_dereq_,module,exports){
- "use strict";var implementation=_dereq_("./implementation");module.exports=Function.prototype.bind||implementation;
- },{"./implementation":25}],27:[function(_dereq_,module,exports){
- (function (global){
- var win;win="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},module.exports=win;
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
- },{}],28:[function(_dereq_,module,exports){
- "use strict";var bind=_dereq_("function-bind");module.exports=bind.call(Function.call,Object.prototype.hasOwnProperty);
- },{"function-bind":26}],29:[function(_dereq_,module,exports){
- 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};
- },{}],30:[function(_dereq_,module,exports){
- "function"==typeof Object.create?module.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(t,e){if(e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}};
- },{}],31:[function(_dereq_,module,exports){
- 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)};
- },{}],32:[function(_dereq_,module,exports){
- "use strict";var fnToStr=Function.prototype.toString,constructorRegex=/^\s*class\b/,isES6ClassFn=function(t){try{var n=fnToStr.call(t);return constructorRegex.test(n)}catch(t){return!1}},tryFunctionObject=function(t){try{return!isES6ClassFn(t)&&(fnToStr.call(t),!0)}catch(t){return!1}},toStr=Object.prototype.toString,fnClass="[object Function]",genClass="[object GeneratorFunction]",hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(hasToStringTag)return tryFunctionObject(t);if(isES6ClassFn(t))return!1;var n=toStr.call(t);return n===fnClass||n===genClass};
- },{}],33:[function(_dereq_,module,exports){
- 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;
- },{}],34:[function(_dereq_,module,exports){
- "use strict";module.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)};
- },{}],35:[function(_dereq_,module,exports){
- var toString={}.toString;module.exports=Array.isArray||function(r){return"[object Array]"==toString.call(r)};
- },{}],36:[function(_dereq_,module,exports){
- 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);
- },{"as-number":2,"word-wrapper":68,"xtend":71}],37:[function(_dereq_,module,exports){
- (function (Buffer){
- 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)})};
- }).call(this,_dereq_("buffer").Buffer)
- },{"./lib/is-binary":38,"buffer":6,"parse-bmfont-ascii":43,"parse-bmfont-binary":44,"parse-bmfont-xml":45,"xhr":69,"xtend":71}],38:[function(_dereq_,module,exports){
- (function (Buffer){
- 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)};
- }).call(this,_dereq_("buffer").Buffer)
- },{"buffer":6,"buffer-equal":5}],39:[function(_dereq_,module,exports){
- "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};
- },{}],40:[function(_dereq_,module,exports){
- "use strict";var keysShim;if(!Object.keys){var has=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,isArgs=_dereq_("./isArguments"),isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call(function(){},"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(t){var o=t.constructor;return o&&o.prototype===t},excludedKeys={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!excludedKeys["$"+t]&&has.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{equalsConstructorPrototype(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),equalsConstructorPrototypeIfNotBuggy=function(t){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(t);try{return equalsConstructorPrototype(t)}catch(t){return!1}};keysShim=function(t){var o=null!==t&&"object"==typeof t,r="[object Function]"===toStr.call(t),e=isArgs(t),n=o&&"[object String]"===toStr.call(t),u=[];if(!o&&!r&&!e)throw new TypeError("Object.keys called on a non-object");var s=hasProtoEnumBug&&r;if(n&&t.length>0&&!has.call(t,0))for(var a=0;a<t.length;++a)u.push(String(a));if(e&&t.length>0)for(var l=0;l<t.length;++l)u.push(String(l));else for(var i in t)s&&"prototype"===i||!has.call(t,i)||u.push(String(i));if(hasDontEnumBug)for(var c=equalsConstructorPrototypeIfNotBuggy(t),p=0;p<dontEnums.length;++p)c&&"constructor"===dontEnums[p]||!has.call(t,dontEnums[p])||u.push(dontEnums[p]);return u}}module.exports=keysShim;
- },{"./isArguments":42}],41:[function(_dereq_,module,exports){
- "use strict";var slice=Array.prototype.slice,isArgs=_dereq_("./isArguments"),origKeys=Object.keys,keysShim=origKeys?function(e){return origKeys(e)}:_dereq_("./implementation"),originalKeys=Object.keys;keysShim.shim=function(){if(Object.keys){(function(){var e=Object.keys(arguments);return e&&e.length===arguments.length})(1,2)||(Object.keys=function(e){return originalKeys(isArgs(e)?slice.call(e):e)})}else Object.keys=keysShim;return Object.keys||keysShim},module.exports=keysShim;
- },{"./implementation":40,"./isArguments":42}],42:[function(_dereq_,module,exports){
- "use strict";var toStr=Object.prototype.toString;module.exports=function(t){var e=toStr.call(t),o="[object Arguments]"===e;return o||(o="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===toStr.call(t.callee)),o};
- },{}],43:[function(_dereq_,module,exports){
- 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};
- },{}],44:[function(_dereq_,module,exports){
- 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};
- },{}],45:[function(_dereq_,module,exports){
- 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};
- },{"./parse-attribs":46,"xml-parse-from-string":70}],46:[function(_dereq_,module,exports){
- 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};
- },{}],47:[function(_dereq_,module,exports){
- var trim=_dereq_("string.prototype.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};
- },{"for-each":24,"string.prototype.trim":53}],48:[function(_dereq_,module,exports){
- (function (global){
- 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;
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
- },{}],49:[function(_dereq_,module,exports){
- 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&¤tQueue&&(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&¤tQueue[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};
- },{}],50:[function(_dereq_,module,exports){
- (function (setImmediate){
- !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);
- }).call(this,_dereq_("timers").setImmediate)
- },{"timers":66}],51:[function(_dereq_,module,exports){
- 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};
- },{"an-array":1,"dtype":13,"is-buffer":31}],52:[function(_dereq_,module,exports){
- "use strict";var bind=_dereq_("function-bind"),ES=_dereq_("es-abstract/es5"),replace=bind.call(Function.call,String.prototype.replace),leftWhitespace=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,rightWhitespace=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;module.exports=function(){var u=ES.ToString(ES.CheckObjectCoercible(this));return replace(replace(u,leftWhitespace,""),rightWhitespace,"")};
- },{"es-abstract/es5":15,"function-bind":26}],53:[function(_dereq_,module,exports){
- "use strict";var bind=_dereq_("function-bind"),define=_dereq_("define-properties"),implementation=_dereq_("./implementation"),getPolyfill=_dereq_("./polyfill"),shim=_dereq_("./shim"),boundTrim=bind.call(Function.call,getPolyfill());define(boundTrim,{getPolyfill:getPolyfill,implementation:implementation,shim:shim}),module.exports=boundTrim;
- },{"./implementation":52,"./polyfill":54,"./shim":55,"define-properties":11,"function-bind":26}],54:[function(_dereq_,module,exports){
- "use strict";var implementation=_dereq_("./implementation"),zeroWidthSpace="";module.exports=function(){return String.prototype.trim&&zeroWidthSpace.trim()===zeroWidthSpace?String.prototype.trim:implementation};
- },{"./implementation":52}],55:[function(_dereq_,module,exports){
- "use strict";var define=_dereq_("define-properties"),getPolyfill=_dereq_("./polyfill");module.exports=function(){var e=getPolyfill();return define(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e};
- },{"./polyfill":54,"define-properties":11}],56:[function(_dereq_,module,exports){
- "use strict";function minMax(e,t,n){return Math.min(Math.max(e,t),n)}function stringContains(e,t){return e.indexOf(t)>-1}function applyArguments(e,t){return e.apply(null,t)}function parseEasingParameters(e){var t=easingFunctionRegex.exec(e);return t?t[1].split(",").map(function(e){return parseFloat(e)}):[]}function spring(e,t){function n(e){var n=t?t*e/1e3:e;return n=l<1?Math.exp(-n*l*c)*(f*Math.cos(g*n)+p*Math.sin(g*n)):(f+p*n)*Math.exp(-n*c),0===e||1===e?e:1-n}function r(){var t=cache.springs[e];if(t)return t;for(var r=0,a=0;;)if(r+=1/6,1===n(r)){if(++a>=16)break}else a=0;var i=r*(1/6)*1e3;return cache.springs[e]=i,i}var a=parseEasingParameters(e),i=minMax(is.und(a[0])?1:a[0],.1,100),s=minMax(is.und(a[1])?100:a[1],.1,100),o=minMax(is.und(a[2])?10:a[2],.1,100),u=minMax(is.und(a[3])?0:a[3],.1,100),c=Math.sqrt(s/i),l=o/(2*Math.sqrt(s*i)),g=l<1?c*Math.sqrt(1-l*l):0,f=1,p=l<1?(l*c-u)/g:-u+c;return t?n:r}function elastic(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=minMax(e,1,10),r=minMax(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}function steps(e){return void 0===e&&(e=10),function(t){return Math.round(t*e)*(1/e)}}function parseEasings(e,t){if(is.fnc(e))return e;var n=e.split("(")[0],r=penner[n],a=parseEasingParameters(e);switch(n){case"spring":return spring(e,t);case"cubicBezier":return applyArguments(bezier,a);case"steps":return applyArguments(steps,a);default:return is.fnc(r)?applyArguments(r,a):applyArguments(bezier,r)}}function selectString(e){try{return document.querySelectorAll(e)}catch(e){return}}function filterArray(e,t){for(var n=auxArrayFilter,r=e.length,a=arguments.length>=2?arguments[1]:void 0,i=0;i<r;i++)if(i in e){var s=e[i];t.call(a,s,i,e)&&n.push(s)}return auxArrayFilter=e,auxArrayFilter.length=0,n}function flattenArray(e,t){t||(t=[]);for(var n=0,r=e.length;n<r;n++){var a=e[n];Array.isArray(a)?flattenArray(a,t):t.push(a)}return t}function toArray(e){return is.arr(e)?e:(is.str(e)&&(e=selectString(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function arrayContains(e,t){return e.some(function(e){return e===t})}function cloneObject(e){var t={};for(var n in e)t[n]=e[n];return t}function replaceObjectProps(e,t){var n=cloneObject(e);for(var r in e)n[r]=t.hasOwnProperty(r)?t[r]:e[r];return n}function mergeObjects(e,t){var n=cloneObject(e);for(var r in t)n[r]=is.und(e[r])?t[r]:e[r];return n}function rgbToRgba(e){var t=rgbRegex.exec(e);return t?"rgba("+t[1]+",1)":e}function hexToRgba(e){var t=e.replace(hexToRgbaHexRegex,function(e,t,n,r){return t+t+n+n+r+r}),n=hexToRgbaRgbRegex.exec(t);return"rgba("+parseInt(n[1],16)+","+parseInt(n[2],16)+","+parseInt(n[3],16)+",1)"}function hslToRgba(e){function t(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n,r,a,i=hslToRgbaHsl1Regex.exec(e)||hslToRgbaHsl2Regex.exec(e),s=parseInt(i[1],10)/360,o=parseInt(i[2],10)/100,u=parseInt(i[3],10)/100,c=i[4]||1;if(0==o)n=r=a=u;else{var l=u<.5?u*(1+o):u+o-u*o,g=2*u-l;n=t(g,l,s+1/3),r=t(g,l,s),a=t(g,l,s-1/3)}return"rgba("+255*n+","+255*r+","+255*a+","+c+")"}function colorToRgb(e){return is.rgb(e)?rgbToRgba(e):is.hex(e)?hexToRgba(e):is.hsl(e)?hslToRgba(e):void 0}function getUnit(e){var t=unitRegex.exec(e);if(t)return t[2]}function getTransformUnit(e){return stringContains(e,"translate")||"perspective"===e?"px":stringContains(e,"rotate")||stringContains(e,"skew")?"deg":void 0}function getFunctionValue(e,t){return is.fnc(e)?e(t.target,t.id,t.total):e}function getAttribute(e,t){return e.getAttribute(t)}function convertPxToUnit(e,t,n){if(arrayContains([n,"deg","rad","turn"],getUnit(t)))return t;var r=cache.CSS[t+n];if(!is.und(r))return r;var a=document.createElement(e.tagName),i=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;i.appendChild(a),a.style.position="absolute",a.style.width=100+n;var s=100/a.offsetWidth;i.removeChild(a);var o=s*parseFloat(t);return cache.CSS[t+n]=o,o}function getCSSValue(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?convertPxToUnit(e,a,n):a}}function getAnimationType(e,t){return is.dom(e)&&!is.inp(e)&&(getAttribute(e,t)||is.svg(e)&&e[t])?"attribute":is.dom(e)&&arrayContains(validTransforms,t)?"transform":is.dom(e)&&"transform"!==t&&getCSSValue(e,t)?"css":null!=e[t]?"object":void 0}function getElementTransforms(e){if(is.dom(e)){for(var t,n=e.style.transform||"",r=new Map;t=transformRegex.exec(n);)r.set(t[1],t[2]);return r}}function getTransformValue(e,t,n,r){var a=stringContains(t,"scale")?1:0+getTransformUnit(t),i=getElementTransforms(e).get(t)||a;return n&&(n.transforms.list.set(t,i),n.transforms.last=t),r?convertPxToUnit(e,i,r):i}function getOriginalTargetValue(e,t,n,r){switch(getAnimationType(e,t)){case"transform":return getTransformValue(e,t,r,n);case"css":return getCSSValue(e,t,n);case"attribute":return getAttribute(e,t);default:return e[t]||0}}function getRelativeValue(e,t){var n=operatorRegex.exec(e);if(!n)return e;var r=getUnit(e)||0,a=parseFloat(t),i=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return a+i+r;case"-":return a-i+r;case"*":return a*i+r}}function validateValue(e,t){if(is.col(e))return colorToRgb(e);var n=getUnit(e),r=n?e.substr(0,e.length-n.length):e;return t&&!whitespaceRegex.test(e)?r+t:r}function getDistance(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function getCircleLength(e){return 2*Math.PI*getAttribute(e,"r")}function getRectLength(e){return 2*getAttribute(e,"width")+2*getAttribute(e,"height")}function getLineLength(e){return getDistance({x:getAttribute(e,"x1"),y:getAttribute(e,"y1")},{x:getAttribute(e,"x2"),y:getAttribute(e,"y2")})}function getPolylineLength(e){for(var t,n=e.points,r=0,a=0;a<n.numberOfItems;a++){var i=n.getItem(a);a>0&&(r+=getDistance(t,i)),t=i}return r}function getPolygonLength(e){var t=e.points;return getPolylineLength(e)+getDistance(t.getItem(t.numberOfItems-1),t.getItem(0))}function getTotalLength(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return getCircleLength(e);case"rect":return getRectLength(e);case"line":return getLineLength(e);case"polyline":return getPolylineLength(e);case"polygon":return getPolygonLength(e)}}function setDashoffset(e){var t=getTotalLength(e);return e.setAttribute("stroke-dasharray",t),t}function getParentSvgEl(e){for(var t=e.parentNode;is.svg(t)&&(t=t.parentNode,is.svg(t.parentNode)););return t}function getParentSvg(e,t){var n=t||{},r=n.el||getParentSvgEl(e),a=r.getBoundingClientRect(),i=getAttribute(r,"viewBox"),s=a.width,o=a.height,u=n.viewBox||(i?i.split(" "):[0,0,s,o]);return{el:r,viewBox:u,x:u[0]/1,y:u[1]/1,w:s/u[2],h:o/u[3]}}function getPath(e,t){var n=is.str(e)?selectString(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:getParentSvg(n),totalLength:getTotalLength(n)*(r/100)}}}function getPathProgress(e,t){function n(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var r=getParentSvg(e.el,e.svg),a=n(),i=n(-1),s=n(1);switch(e.property){case"x":return(a.x-r.x)*r.w;case"y":return(a.y-r.y)*r.h;case"angle":return 180*Math.atan2(s.y-i.y,s.x-i.x)/Math.PI}}function decomposeValue(e,t){var n=validateValue(is.pth(e)?e.totalLength:e,t)+"";return{original:n,numbers:n.match(valueRegex)?n.match(valueRegex).map(Number):[0],strings:is.str(e)||t?n.split(valueRegex):[]}}function parseTargets(e){return filterArray(e?flattenArray(is.arr(e)?e.map(toArray):toArray(e)):[],function(e,t,n){return n.indexOf(e)===t})}function getAnimatables(e){var t=parseTargets(e);return t.map(function(e,n){return{target:e,id:n,total:t.length,transforms:{list:getElementTransforms(e)}}})}function normalizePropertyTweens(e,t){var n=cloneObject(t);if(springRegex.test(n.easing)&&(n.duration=spring(n.easing)),is.arr(e)){var r=e.length;2===r&&!is.obj(e[0])?e={value:e}:is.fnc(t.duration)||(n.duration=t.duration/r)}var a=is.arr(e)?e:[e];return a.map(function(e,n){var r=is.obj(e)&&!is.pth(e)?e:{value:e};return is.und(r.delay)&&(r.delay=n?0:t.delay),is.und(r.endDelay)&&(r.endDelay=n===a.length-1?t.endDelay:0),r}).map(function(e){return mergeObjects(e,n)})}function flattenKeyframes(e){for(var t=filterArray(flattenArray(e.map(function(e){return Object.keys(e)})),function(e){return is.key(e)}).reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]),n={},r=0;r<t.length;r++)!function(r){var a=t[r];n[a]=e.map(function(e){var t={};for(var n in e)is.key(n)?n==a&&(t.value=e[n]):t[n]=e[n];return t})}(r);return n}function getProperties(e,t){var n=[],r=t.keyframes;r&&(t=mergeObjects(flattenKeyframes(r),t));for(var a in t)is.key(a)&&n.push({name:a,tweens:normalizePropertyTweens(t[a],e)});return n}function normalizeTweenValues(e,t){var n={};for(var r in e){var a=getFunctionValue(e[r],t);is.arr(a)&&(a=a.map(function(e){return getFunctionValue(e,t)}),1===a.length&&(a=a[0])),n[r]=a}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}function normalizeTweens(e,t){var n;return e.tweens.map(function(r){var a=normalizeTweenValues(r,t),i=a.value,s=is.arr(i)?i[1]:i,o=getUnit(s),u=getOriginalTargetValue(t.target,e.name,o,t),c=n?n.to.original:u,l=is.arr(i)?i[0]:c,g=getUnit(l)||getUnit(u),f=o||g;return is.und(s)&&(s=c),a.from=decomposeValue(l,f),a.to=decomposeValue(getRelativeValue(s,l),f),a.start=n?n.end:0,a.end=a.start+a.delay+a.duration+a.endDelay,a.easing=parseEasings(a.easing,a.duration),a.isPath=is.pth(i),a.isColor=is.col(a.from.original),a.isColor&&(a.round=1),n=a,a})}function setTargetsValue(e,t){for(var n=getAnimatables(e),r=0,a=n.length;r<a;r++){var i=n[r];for(var s in t){var o=getFunctionValue(t[s],i),u=i.target,c=getUnit(o),l=getOriginalTargetValue(u,s,c,i),g=c||getUnit(l),f=getRelativeValue(validateValue(o,g),l),p=getAnimationType(u,s);setProgressValue[p](u,s,f,i.transforms,!0)}}}function createAnimation(e,t){var n=getAnimationType(e.target,t.name);if(n){var r=normalizeTweens(t,e),a=r[r.length-1];return{type:n,property:t.name,animatable:e,tweens:r,duration:a.end,delay:r[0].delay,endDelay:a.endDelay}}}function getAnimations(e,t){return filterArray(flattenArray(e.map(function(e){return t.map(function(t){return createAnimation(e,t)})})),function(e){return!is.und(e)})}function getInstanceTimings(e,t){var n=e.length,r=function(e){return e.timelineOffset?e.timelineOffset:0},a={};return a.duration=n?Math.max.apply(Math,e.map(function(e){return r(e)+e.duration})):t.duration,a.delay=n?Math.min.apply(Math,e.map(function(e){return r(e)+e.delay})):t.delay,a.endDelay=n?a.duration-Math.max.apply(Math,e.map(function(e){return r(e)+e.duration-e.endDelay})):t.endDelay,a}function createNewInstance(e){var t=replaceObjectProps(defaultInstanceSettings,e),n=replaceObjectProps(defaultTweenSettings,e),r=getProperties(n,e),a=getAnimatables(e.targets),i=getAnimations(a,r),s=getInstanceTimings(i,n),o=instanceID;return instanceID++,mergeObjects(t,{id:o,children:[],animatables:a,animations:i,duration:s.duration,delay:s.delay,endDelay:s.endDelay})}function handleVisibilityChange(){if(document.hidden){for(var e=0,t=activeInstances.length;e<t;e++)activeInstance[e].pause();pausedInstances=activeInstances.slice(0),activeInstances=[]}else for(var n=0,r=pausedInstances.length;n<r;n++)pausedInstances[n].play()}function anime(e){function t(){return window.Promise&&new Promise(function(e){return v=e})}function n(){y.reversed=!y.reversed;for(var e=0,t=g.length;e<t;e++)g[e].reversed=y.reversed}function r(e){return y.reversed?y.duration-e:e}function a(){f=0,p=r(y.currentTime)*(1/anime.speed)}function i(e,t){t&&t.seek(e-t.timelineOffset)}function s(e){if(y.reversePlayback)for(var t=d;t--;)i(e,g[t]);else for(var n=0;n<d;n++)i(e,g[n])}function o(e){for(var t=0,n=y.animations,r=n.length;t<r;){var a=n[t],i=a.animatable,s=a.tweens,o=s.length-1,u=s[o];o&&(u=filterArray(s,function(t){return e<t.end})[0]||u);for(var c=minMax(e-u.start-u.delay,0,u.duration)/u.duration,l=isNaN(c)?1:u.easing(c),g=u.to.strings,f=u.round,p=[],m=u.to.numbers.length,d=void 0,v=0;v<m;v++){var h=void 0,b=u.to.numbers[v],x=u.from.numbers[v]||0;h=u.isPath?getPathProgress(u.value,l*b):x+l*(b-x),f&&(u.isColor&&v>2||(h=Math.round(h*f)/f)),p.push(h)}var T=g.length;if(T){d=g[0];for(var A=0;A<T;A++){var R=(g[A],g[A+1]),P=p[A];isNaN(P)||(d+=R?P+R:P+" ")}}else d=p[0];setProgressValue[a.type](i.target,a.property,d,i.transforms),a.currentValue=d,t++}}function u(e){y[e]&&!y.passThrough&&y[e](y)}function c(){y.remaining&&!0!==y.remaining&&y.remaining--}function l(e){var a=y.duration,i=y.delay,l=a-y.endDelay,d=r(e);y.progress=minMax(d/a*100,0,100),y.reversePlayback=d<y.currentTime,g&&s(d),!y.began&&y.currentTime>0&&(y.began=!0,u("begin"),u("loopBegin")),d<=i&&0!==y.currentTime&&o(0),(d>=l&&y.currentTime!==a||!a)&&o(a),d>i&&d<l?(y.changeBegan||(y.changeBegan=!0,y.changeCompleted=!1,u("changeBegin")),u("change"),o(d)):y.changeBegan&&(y.changeCompleted=!0,y.changeBegan=!1,u("changeComplete")),y.currentTime=minMax(d,0,a),y.began&&u("update"),e>=a&&(p=0,c(),y.remaining?(f=m,u("loopComplete"),u("loopBegin"),"alternate"===y.direction&&n()):(y.paused=!0,y.completed||(y.completed=!0,u("loopComplete"),u("complete"),"Promise"in window&&(v(),h=t()))))}void 0===e&&(e={});var g,f=0,p=0,m=0,d=0,v=null,h=t(),y=createNewInstance(e);return y.reset=function(){var e=y.direction;y.passThrough=!1,y.currentTime=0,y.progress=0,y.paused=!0,y.began=!1,y.changeBegan=!1,y.completed=!1,y.changeCompleted=!1,y.reversePlayback=!1,y.reversed="reverse"===e,y.remaining=y.loop,g=y.children,d=g.length;for(var t=d;t--;)y.children[t].reset();(y.reversed&&!0!==y.loop||"alternate"===e&&1===y.loop)&&y.remaining++,o(0)},y.set=function(e,t){return setTargetsValue(e,t),y},y.tick=function(e){m=e,f||(f=m),l((m+(p-f))*anime.speed)},y.seek=function(e){l(r(e))},y.pause=function(){y.paused=!0,a()},y.play=function(){y.paused&&(y.paused=!1,activeInstances.push(y),a(),raf||engine())},y.reverse=function(){n(),a()},y.restart=function(){y.reset(),y.play()},y.finished=h,y.reset(),y.autoplay&&y.play(),y}function removeTargetsFromAnimations(e,t){for(var n=t.length;n--;)arrayContains(e,t[n].animatable.target)&&t.splice(n,1)}function removeTargets(e){for(var t=parseTargets(e),n=activeInstances.length;n--;){var r=activeInstances[n],a=r.animations,i=r.children;removeTargetsFromAnimations(t,a);for(var s=i.length;s--;){var o=i[s],u=o.animations;removeTargetsFromAnimations(t,u),u.length||o.children.length||i.splice(s,1)}a.length||i.length||r.pause()}}function stagger(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?parseEasings(t.easing):null,a=t.grid,i=t.axis,s=t.from||0,o="first"===s,u="center"===s,c="last"===s,l=is.arr(e),g=l?parseFloat(e[0]):parseFloat(e),f=l?parseFloat(e[1]):0,p=getUnit(l?e[1]:e)||0,m=t.start||0+(l?g:0),d=[],v=0;return function(e,t,h){if(o&&(s=0),u&&(s=(h-1)/2),c&&(s=h-1),!d.length){for(var y=0;y<h;y++){if(a){var b=u?(a[0]-1)/2:s%a[0],x=u?(a[1]-1)/2:Math.floor(s/a[0]),T=y%a[0],A=Math.floor(y/a[0]),R=b-T,P=x-A,w=Math.sqrt(R*R+P*P);"x"===i&&(w=-R),"y"===i&&(w=-P),d.push(w)}else d.push(Math.abs(s-y));v=Math.max.apply(Math,d)}r&&(d=d.map(function(e){return r(e/v)*v})),"reverse"===n&&(d=d.map(function(e){return i?e<0?-1*e:-e:Math.abs(v-e)}))}return m+(l?(f-g)/v:g)*(Math.round(100*d[t])/100)+p}}function timeline(e){void 0===e&&(e={});var t=anime(e);return t.duration=0,t.add=function(n,r){function a(e){e.passThrough=!0}var i=activeInstances.indexOf(t),s=t.children;i>-1&&activeInstances.splice(i,1);for(var o=0;o<s.length;o++)a(s[o]);var u=mergeObjects(n,replaceObjectProps(defaultTweenSettings,e));u.targets=u.targets||e.targets;var c=t.duration;u.autoplay=!1,u.direction=t.direction,u.timelineOffset=is.und(r)?c:getRelativeValue(r,c),a(t),t.seek(u.timelineOffset);var l=anime(u);a(l),s.push(l);var g=getInstanceTimings(s,e);return t.delay=g.delay,t.endDelay=g.endDelay,t.duration=g.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t}var defaultInstanceSettings={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},defaultTweenSettings={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},validTransforms=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective"],cache={CSS:{},springs:{}},hexRegex=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,rgbPrefixRegex=/^rgb/,hslRegex=/^hsl/,is={arr:function(e){return Array.isArray(e)},obj:function(e){return stringContains(Object.prototype.toString.call(e),"Object")},pth:function(e){return is.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||is.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},hex:function(e){return hexRegex.test(e)},rgb:function(e){return rgbPrefixRegex.test(e)},hsl:function(e){return hslRegex.test(e)},col:function(e){return is.hex(e)||is.rgb(e)||is.hsl(e)},key:function(e){return!defaultInstanceSettings.hasOwnProperty(e)&&!defaultTweenSettings.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}},easingFunctionRegex=/\(([^)]+)\)/,bezier=function(){function e(e,t){return 1-3*t+3*e}function t(e,t){return 3*t-6*e}function n(e){return 3*e}function r(r,a,i){return((e(a,i)*r+t(a,i))*r+n(a))*r}function a(r,a,i){return 3*e(a,i)*r*r+2*t(a,i)*r+n(a)}function i(e,t,n,a,i){var s,o,u=0;do{o=t+(n-t)/2,s=r(o,a,i)-e,s>0?n=o:t=o}while(Math.abs(s)>1e-7&&++u<10);return o}function s(e,t,n,i){for(var s=0;s<4;++s){var o=a(t,n,i);if(0===o)return t;t-=(r(t,n,i)-e)/o}return t}function o(e,t,n,o){function l(t){for(var r=0,o=1,l=u-1;o!==l&&g[o]<=t;++o)r+=c;--o;var f=(t-g[o])/(g[o+1]-g[o]),p=r+f*c,m=a(p,e,n);return m>=.001?s(t,p,e,n):0===m?p:i(t,r,r+c,e,n)}if(0<=e&&e<=1&&0<=n&&n<=1){var g=new Float32Array(u);if(e!==t||n!==o)for(var f=0;f<u;++f)g[f]=r(f*c,e,n);return function(a){return e===t&&n===o?a:0===a||1===a?a:r(l(a),t,o)}}}var u=11,c=1/(u-1);return o}(),penner=function(){var e=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],t={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],elastic],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(e,t){return function(n){return 1-elastic(e,t)(1-n)}}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(e,t){return function(n){return n<.5?elastic(e,t)(2*n)/2:1-elastic(e,t)(-2*n+2)/2}}]},n={linear:[.25,.25,.75,.75]};for(var r in t)for(var a=0,i=t[r].length;a<i;a++)n["ease"+r+e[a]]=t[r][a];return n}(),auxArrayFilter=[],rgbRegex=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g,hexToRgbaHexRegex=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,hexToRgbaRgbRegex=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hslToRgbaHsl1Regex=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g,hslToRgbaHsl2Regex=/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g,unitRegex=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/,transformRegex=/(\w+)\(([^)]*)\)/g,operatorRegex=/^(\*=|\+=|-=)/,whitespaceRegex=/\s/g,valueRegex=/-?\d*\.?\d+/g,springRegex=/^spring/,setProgressValue={css:function(e,t,n){return e.style[t]=n},attribute:function(e,t,n){return e.setAttribute(t,n)},object:function(e,t,n){return e[t]=n},transform:function(e,t,n,r,a){if(r.list.set(t,n),t===r.last||a){var i="";r.list.forEach(function(e,t){i+=t+"("+e+") "}),e.style.transform=i}}},instanceID=0,activeInstances=[],pausedInstances=[],raf,engine=function(){function e(){raf=requestAnimationFrame(t)}function t(t){var n=activeInstances.length;if(n){for(var r=0;r<n;){var a=activeInstances[r];if(a.paused){var i=activeInstances.indexOf(a);i>-1&&(activeInstances.splice(i,1),n=activeInstances.length)}else a.tick(t);r++}e()}else raf=cancelAnimationFrame(raf)}return e}();document.addEventListener("visibilitychange",handleVisibilityChange),anime.version="3.0.0",anime.speed=1,anime.running=activeInstances,anime.remove=removeTargets,anime.get=getOriginalTargetValue,anime.set=setTargetsValue,anime.convertPx=convertPxToUnit,anime.path=getPath,anime.setDashoffset=setDashoffset,anime.stagger=stagger,anime.timeline=timeline,anime.easing=parseEasings,anime.penner=penner,anime.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},module.exports=anime;
- },{}],57:[function(_dereq_,module,exports){
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=e||self,t(e.THREE={}))}(this,function(e){"use strict";function t(){}function n(e,t){this.x=e||0,this.y=t||0}function i(){this.elements=[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 r(e,t,a,o,s,c,l,h,u,p){Object.defineProperty(this,"id",{value:Al++}),this.uuid=Tl.generateUUID(),this.name="",this.image=void 0!==e?e:r.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:r.DEFAULT_MAPPING,this.wrapS=void 0!==a?a:tc,this.wrapT=void 0!==o?o:tc,this.magFilter=void 0!==s?s:oc,this.minFilter=void 0!==c?c:cc,this.anisotropy=void 0!==u?u:1,this.format=void 0!==l?l:Mc,this.internalFormat=null,this.type=void 0!==h?h:lc,this.offset=new n(0,0),this.repeat=new n(1,1),this.center=new n(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new i,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==p?p:ol,this.version=0,this.onUpdate=null}function a(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==i?i:1}function o(e,t,n){this.width=e,this.height=t,this.scissor=new a(0,0,e,t),this.scissorTest=!1,this.viewport=new a(0,0,e,t),n=n||{},this.texture=new r(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:oc,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function s(e,t,n){o.call(this,e,t,n),this.samples=4}function c(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1}function l(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function h(){this.elements=[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 u(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||u.DefaultOrder}function p(){this.mask=1}function d(){function e(){a.setFromEuler(r,!1)}function t(){r.setFromQuaternion(a,void 0,!1)}Object.defineProperty(this,"id",{value:Ul++}),this.uuid=Tl.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=d.DefaultUp.clone();var n=new l,r=new u,a=new c,o=new l(1,1,1);r._onChange(e),a._onChange(t),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:n},rotation:{configurable:!0,enumerable:!0,value:r},quaternion:{configurable:!0,enumerable:!0,value:a},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new h},normalMatrix:{value:new i}}),this.matrix=new h,this.matrixWorld=new h,this.matrixAutoUpdate=d.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new p,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function f(){d.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function m(e,t){this.min=void 0!==e?e:new l(1/0,1/0,1/0),this.max=void 0!==t?t:new l(-1/0,-1/0,-1/0)}function v(e,t,n,i,r){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){hh.fromArray(e,a);var s=r.x*Math.abs(hh.x)+r.y*Math.abs(hh.y)+r.z*Math.abs(hh.z),c=t.dot(hh),l=n.dot(hh),h=i.dot(hh);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>s)return!1}return!0}function g(e,t){this.center=void 0!==e?e:new l,this.radius=void 0!==t?t:0}function y(e,t){this.origin=void 0!==e?e:new l,this.direction=void 0!==t?t:new l(0,0,-1)}function x(e,t){this.normal=void 0!==e?e:new l(1,0,0),this.constant=void 0!==t?t:0}function b(e,t,n){this.a=void 0!==e?e:new l,this.b=void 0!==t?t:new l,this.c=void 0!==n?n:new l}function w(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function _(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function M(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function T(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function E(e,t,n,i,r,a){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new l,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new w,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}function S(){Object.defineProperty(this,"id",{value:Nh++}),this.uuid=Tl.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=ls,this.side=ns,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=as,this.opacity=1,this.transparent=!1,this.blendSrc=Ms,this.blendDst=Ts,this.blendEquation=fs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Ds,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=xl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=yl,this.stencilZFail=yl,this.stencilZPass=yl,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function A(e){S.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=Fs,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.setValues(e)}function L(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=bl,this.updateRange={offset:0,count:-1},this.version=0}function R(e,t,n){L.call(this,new Int8Array(e),t,n)}function P(e,t,n){L.call(this,new Uint8Array(e),t,n)}function C(e,t,n){L.call(this,new Uint8ClampedArray(e),t,n)}function O(e,t,n){L.call(this,new Int16Array(e),t,n)}function D(e,t,n){L.call(this,new Uint16Array(e),t,n)}function I(e,t,n){L.call(this,new Int32Array(e),t,n)}function N(e,t,n){L.call(this,new Uint32Array(e),t,n)}function B(e,t,n){L.call(this,new Float32Array(e),t,n)}function z(e,t,n){L.call(this,new Float64Array(e),t,n)}function F(){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 U(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}function G(){Object.defineProperty(this,"id",{value:zh+=2}),this.uuid=Tl.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function H(e,t){d.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new G,this.material=void 0!==t?t:new A,this.updateMorphTargets()}function V(e,t,n,i,r,a,o,s){if(null===(t.side===is?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,t.side!==rs,s)))return null;ou.copy(s),ou.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(ou);return c<n.near||c>n.far?null:{distance:c,point:ou.clone(),object:e}}function j(e,t,i,r,a,o,s,c,l,h,u,p){Xh.fromBufferAttribute(a,h),Yh.fromBufferAttribute(a,u),Zh.fromBufferAttribute(a,p);var d=e.morphTargetInfluences;if(t.morphTargets&&o&&d){$h.set(0,0,0),eu.set(0,0,0),tu.set(0,0,0);for(var f=0,m=o.length;f<m;f++){var v=d[f],g=o[f];0!==v&&(Jh.fromBufferAttribute(g,h),Qh.fromBufferAttribute(g,u),Kh.fromBufferAttribute(g,p),s?($h.addScaledVector(Jh,v),eu.addScaledVector(Qh,v),tu.addScaledVector(Kh,v)):($h.addScaledVector(Jh.sub(Xh),v),eu.addScaledVector(Qh.sub(Yh),v),tu.addScaledVector(Kh.sub(Zh),v)))}Xh.add($h),Yh.add(eu),Zh.add(tu)}var y=V(e,t,i,r,Xh,Yh,Zh,au);if(y){c&&(nu.fromBufferAttribute(c,h),iu.fromBufferAttribute(c,u),ru.fromBufferAttribute(c,p),y.uv=b.getUV(au,Xh,Yh,Zh,nu,iu,ru,new n)),l&&(nu.fromBufferAttribute(l,h),iu.fromBufferAttribute(l,u),ru.fromBufferAttribute(l,p),y.uv2=b.getUV(au,Xh,Yh,Zh,nu,iu,ru,new n));var x=new E(h,u,p);b.getNormal(Xh,Yh,Zh,x.normal),y.face=x}return y}function k(){Object.defineProperty(this,"id",{value:su+=2}),this.uuid=Tl.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 W(e){var t={};for(var n in e){t[n]={};for(var i in e[n]){var r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}}return t}function q(e){for(var t={},n=0;n<e.length;n++){var i=W(e[n]);for(var r in i)t[r]=i[r]}return t}function X(e){S.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=fu,this.fragmentShader=mu,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,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Y(){d.call(this),this.type="Camera",this.matrixWorldInverse=new h,this.projectionMatrix=new h,this.projectionMatrixInverse=new h}function Z(e,t,n,i){Y.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function J(e,t,n,i){d.call(this),this.type="CubeCamera";var r=new Z(vu,gu,e,t);r.up.set(0,-1,0),r.lookAt(new l(1,0,0)),this.add(r);var a=new Z(vu,gu,e,t);a.up.set(0,-1,0),a.lookAt(new l(-1,0,0)),this.add(a);var o=new Z(vu,gu,e,t);o.up.set(0,0,1),o.lookAt(new l(0,1,0)),this.add(o);var s=new Z(vu,gu,e,t);s.up.set(0,0,-1),s.lookAt(new l(0,-1,0)),this.add(s);var c=new Z(vu,gu,e,t);c.up.set(0,-1,0),c.lookAt(new l(0,0,1)),this.add(c);var h=new Z(vu,gu,e,t);h.up.set(0,-1,0),h.lookAt(new l(0,0,-1)),this.add(h),i=i||{format:_c,magFilter:oc,minFilter:oc},this.renderTarget=new Q(n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),i=this.renderTarget,l=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,a),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,s),e.setRenderTarget(i,4),e.render(t,c),i.texture.generateMipmaps=l,e.setRenderTarget(i,5),e.render(t,h),e.setRenderTarget(n)},this.clear=function(e,t,n,i){for(var r=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,i);e.setRenderTarget(r)}}function Q(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),o.call(this,e,e,t)}function K(e,t,n,i,a,o,s,c,l,h,u,p){r.call(this,null,o,s,c,l,h,i,a,u,p),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:ic,this.minFilter=void 0!==h?h:ic,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}function $(e,t,n,i,r,a){this.planes=[void 0!==e?e:new x,void 0!==t?t:new x,void 0!==n?n:new x,void 0!==i?i:new x,void 0!==r?r:new x,void 0!==a?a:new x]}function ee(){function e(r,a){!1!==n&&(i(r,a),t.requestAnimationFrame(e))}var t=null,n=!1,i=null;return{start:function(){!0!==n&&null!==i&&(t.requestAnimationFrame(e),n=!0)},stop:function(){n=!1},setAnimationLoop:function(e){i=e},setContext:function(e){t=e}}}function te(e,t){function n(t,n){var i=t.array,r=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,i,r),t.onUploadCallback();var o=5126;return i instanceof Float32Array?o=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?o=5123:i instanceof Int16Array?o=5122:i instanceof Uint32Array?o=5125:i instanceof Int32Array?o=5124:i instanceof Int8Array?o=5120:i instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}function i(t,n,i){var r=n.array,a=n.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,r):(s?e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r,a.offset,a.count):e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r.subarray(a.offset,a.offset+a.count)),a.count=-1)}function r(e){return e.isInterleavedBufferAttribute&&(e=e.data),c.get(e)}function a(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=c.get(t);n&&(e.deleteBuffer(n.buffer),c.delete(t))}function o(e,t){e.isInterleavedBufferAttribute&&(e=e.data);var r=c.get(e);void 0===r?c.set(e,n(e,t)):r.version<e.version&&(i(r.buffer,e,t),r.version=e.version)}var s=t.isWebGL2,c=new WeakMap;return{get:r,remove:a,update:o}}function ne(e,t,n,i){k.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new ie(e,t,n,i)),this.mergeVertices()}function ie(e,t,n,i){G.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},e=e||1,t=t||1;var r,a,o=e/2,s=t/2,c=Math.floor(n)||1,l=Math.floor(i)||1,h=c+1,u=l+1,p=e/c,d=t/l,f=[],m=[],v=[],g=[];for(a=0;a<u;a++){var y=a*d-s;for(r=0;r<h;r++){var x=r*p-o;m.push(x,-y,0),v.push(0,0,1),g.push(r/c),g.push(1-a/l)}}for(a=0;a<l;a++)for(r=0;r<c;r++){var b=r+h*a,w=r+h*(a+1),_=r+1+h*(a+1),M=r+1+h*a;f.push(b,w,M),f.push(w,_,M)}this.setIndex(f),this.setAttribute("position",new B(m,3)),this.setAttribute("normal",new B(v,3)),this.setAttribute("uv",new B(g,2))}function re(e,t,n,i){function r(t,i,r,d){var f=i.background,m=e.xr,v=m.getSession&&m.getSession();if(v&&"additive"===v.environmentBlendMode&&(f=null),null===f?a(c,l):f&&f.isColor&&(a(f,1),d=!0),(e.autoClear||d)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||f.mapping===Ks)){void 0===s&&(s=new H(new pu(1,1,1),new X({type:"BackgroundCubeMaterial",uniforms:W(_u.cube.uniforms),vertexShader:_u.cube.vertexShader,fragmentShader:_u.cube.fragmentShader,side:is,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(s));var g=f.isWebGLCubeRenderTarget?f.texture:f;s.material.uniforms.envMap.value=g,s.material.uniforms.flipEnvMap.value=g.isCubeTexture?-1:1,h===f&&u===g.version&&p===e.toneMapping||(s.material.needsUpdate=!0,h=f,u=g.version,p=e.toneMapping),t.unshift(s,s.geometry,s.material,0,0,null)}else f&&f.isTexture&&(void 0===o&&(o=new H(new ie(2,2),new X({type:"BackgroundMaterial",uniforms:W(_u.background.uniforms),vertexShader:_u.background.vertexShader,fragmentShader:_u.background.fragmentShader,side:ns,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),o.material.uniforms.uvTransform.value.copy(f.matrix),h===f&&u===f.version&&p===e.toneMapping||(o.material.needsUpdate=!0,h=f,u=f.version,p=e.toneMapping),t.unshift(o,o.geometry,o.material,0,0,null))}function a(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,i)}var o,s,c=new w(0),l=0,h=null,u=0,p=null;return{getClearColor:function(){return c},setClearColor:function(e,t){c.set(e),l=void 0!==t?t:1,a(c,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,a(c,l)},render:r}}function ae(e,t,n,i){function r(e){s=e}function a(t,i){e.drawArrays(s,t,i),n.update(i,s)}function o(i,r,a,o){if(0!==o){var l,h;if(c)l=e,h="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](s,r,a,o),n.update(a,s,o)}}var s,c=i.isWebGL2;this.setMode=r,this.render=a,this.renderInstances=o}function oe(e,t,n){function i(){if(void 0!==a)return a;var n=t.get("EXT_texture_filter_anisotropic");return a=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a,o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,s=void 0!==n.precision?n.precision:"highp",c=r(s);c!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",c,"instead."),s=c);var l=!0===n.logarithmicDepthBuffer,h=e.getParameter(34930),u=e.getParameter(35660),p=e.getParameter(3379),d=e.getParameter(34076),f=e.getParameter(34921),m=e.getParameter(36347),v=e.getParameter(36348),g=e.getParameter(36349),y=u>0,x=o||!!t.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:i,getMaxPrecision:r,precision:s,logarithmicDepthBuffer:l,maxTextures:h,maxVertexTextures:u,maxTextureSize:p,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:y&&x,maxSamples:o?e.getParameter(36183):0}}function se(){function e(){h.value!==r&&(h.value=r,h.needsUpdate=a>0),n.numPlanes=a,n.numIntersection=0}function t(e,t,i,r){var a=null!==e?e.length:0,o=null;if(0!==a){if(o=h.value,!0!==r||null===o){var s=i+4*a,u=t.matrixWorldInverse;l.getNormalMatrix(u),(null===o||o.length<s)&&(o=new Float32Array(s));for(var p=0,d=i;p!==a;++p,d+=4)c.copy(e[p]).applyMatrix4(u,l),c.normal.toArray(o,d),o[d+3]=c.constant}h.value=o,h.needsUpdate=!0}return n.numPlanes=a,o}var n=this,r=null,a=0,o=!1,s=!1,c=new x,l=new i,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(e,n,i){var s=0!==e.length||n||0!==a||o;return o=n,r=t(e,i,0),a=e.length,s},this.beginShadows=function(){s=!0,t(null)},this.endShadows=function(){s=!1,e()},this.setState=function(n,i,c,l,u,p){if(!o||null===n||0===n.length||s&&!c)s?t(null):e();else{var d=s?0:a,f=4*d,m=u.clippingState||null;h.value=m,m=t(n,l,f,p);for(var v=0;v!==f;++v)m[v]=r[v];u.clippingState=m,this.numIntersection=i?this.numPlanes:0,this.numPlanes+=d}}}function ce(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=i,i}}}function le(e,t,n){function i(e){var r=e.target,a=c.get(r);null!==a.index&&t.remove(a.index);for(var o in a.attributes)t.remove(a.attributes[o]);r.removeEventListener("dispose",i),c.delete(r);var s=l.get(a);s&&(t.remove(s),l.delete(a)),n.memory.geometries--}function r(e,t){var r=c.get(t);return r||(t.addEventListener("dispose",i),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new G).setFromObject(e)),r=t._bufferGeometry),c.set(t,r),n.memory.geometries++,r)}function a(e){var n=e.index,i=e.attributes;null!==n&&t.update(n,34963);for(var r in i)t.update(i[r],34962);var a=e.morphAttributes;for(var r in a)for(var o=a[r],s=0,c=o.length;s<c;s++)t.update(o[s],34962)}function o(e){var n=[],i=e.index,r=e.attributes.position,a=0;if(null!==i){var o=i.array;a=i.version;for(var s=0,c=o.length;s<c;s+=3){var h=o[s+0],u=o[s+1],p=o[s+2];n.push(h,u,u,p,p,h)}}else{var o=r.array;a=r.version;for(var s=0,c=o.length/3-1;s<c;s+=3){var h=s+0,u=s+1,p=s+2;n.push(h,u,u,p,p,h)}}var d=new(U(n)>65535?N:D)(n,1);d.version=a,t.update(d,34963);var f=l.get(e);f&&t.remove(f),l.set(e,d)}function s(e){var t=l.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return l.get(e)}var c=new WeakMap,l=new WeakMap;return{get:r,update:a,getWireframeAttribute:s}}function he(e,t,n,i){function r(e){c=e}function a(e){l=e.type,h=e.bytesPerElement}function o(t,i){e.drawElements(c,i,l,t*h),n.update(i,c)}function s(i,r,a,o){if(0!==o){var s,p;if(u)s=e,p="drawElementsInstanced";else if(s=t.get("ANGLE_instanced_arrays"),p="drawElementsInstancedANGLE",null===s)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");s[p](c,a,l,r*h,o),n.update(a,c,o)}}var c,l,h,u=i.isWebGL2;this.setMode=r,this.setIndex=a,this.render=o,this.renderInstances=s}function ue(e){function t(e,t,n){switch(n=n||1,r.calls++,t){case 4:r.triangles+=n*(e/3);break;case 1:r.lines+=n*(e/2);break;case 3:r.lines+=n*(e-1);break;case 2:r.lines+=n*e;break;case 0:r.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",t)}}function n(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0}var i={geometries:0,textures:0},r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:i,render:r,programs:null,autoReset:!0,reset:n,update:t}}function pe(e,t){return Math.abs(t[1])-Math.abs(e[1])}function de(e){function t(t,r,a,o){var s=t.morphTargetInfluences,c=void 0===s?0:s.length,l=n[r.id];if(void 0===l){l=[];for(var h=0;h<c;h++)l[h]=[h,0];n[r.id]=l}for(var u=a.morphTargets&&r.morphAttributes.position,p=a.morphNormals&&r.morphAttributes.normal,h=0;h<c;h++){var d=l[h];0!==d[1]&&(u&&r.deleteAttribute("morphTarget"+h),p&&r.deleteAttribute("morphNormal"+h))}for(var h=0;h<c;h++){var d=l[h];d[0]=h,d[1]=s[h]}l.sort(pe);for(var f=0,h=0;h<8;h++){var d=l[h];if(d){var m=d[0],v=d[1];if(v){u&&r.setAttribute("morphTarget"+h,u[m]),p&&r.setAttribute("morphNormal"+h,p[m]),i[h]=v,f+=v;continue}}i[h]=0}var g=r.morphTargetsRelative?1:1-f;o.getUniforms().setValue(e,"morphTargetBaseInfluence",g),o.getUniforms().setValue(e,"morphTargetInfluences",i)}var n={},i=new Float32Array(8);return{update:t}}function fe(e,t,n,i){function r(e){var r=i.render.frame,a=e.geometry,s=t.get(e,a);return o[s.id]!==r&&(a.isGeometry&&s.updateFromObject(e),t.update(s),o[s.id]=r),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s}function a(){o={}}var o={};return{update:r,dispose:a}}function me(e,t,n,i,a,o,s,c,l,h){e=void 0!==e?e:[],t=void 0!==t?t:Xs,s=void 0!==s?s:_c,r.call(this,e,t,n,i,a,o,s,c,l,h),this.flipY=!1}function ve(e,t,n,i){r.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=ic,this.minFilter=ic,this.wrapR=tc,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function ge(e,t,n,i){r.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=ic,this.minFilter=ic,this.wrapR=tc,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function ye(e,t,n){var i=e[0];if(i<=0||i>0)return e;var r=t*n,a=Au[r];if(void 0===a&&(a=new Float32Array(r),Au[r]=a),0!==t){i.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function xe(e,t){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function be(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function we(e,t){var n=Lu[t];void 0===n&&(n=new Int32Array(t),Lu[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function _e(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Me(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(xe(n,t))return;e.uniform2fv(this.addr,t),be(n,t)}}function Te(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(xe(n,t))return;e.uniform3fv(this.addr,t),be(n,t)}}function Ee(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(xe(n,t))return;e.uniform4fv(this.addr,t),be(n,t)}}function Se(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(xe(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),be(n,t)}else{if(xe(n,i))return;Cu.set(i),e.uniformMatrix2fv(this.addr,!1,Cu),be(n,i)}}function Ae(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(xe(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),be(n,t)}else{if(xe(n,i))return;Pu.set(i),e.uniformMatrix3fv(this.addr,!1,Pu),be(n,i)}}function Le(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(xe(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),be(n,t)}else{if(xe(n,i))return;Ru.set(i),e.uniformMatrix4fv(this.addr,!1,Ru),be(n,i)}}function Re(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||Mu,r)}function Pe(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||Tu,r)}function Ce(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||Eu,r)}function Oe(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||Su,r)}function De(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Ie(e,t){var n=this.cache;xe(n,t)||(e.uniform2iv(this.addr,t),be(n,t))}function Ne(e,t){var n=this.cache;xe(n,t)||(e.uniform3iv(this.addr,t),be(n,t))}function Be(e,t){var n=this.cache;xe(n,t)||(e.uniform4iv(this.addr,t),be(n,t))}function ze(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Fe(e){switch(e){case 5126:return _e;case 35664:return Me;case 35665:return Te;case 35666:return Ee;case 35674:return Se;case 35675:return Ae;case 35676:return Le;case 5124:case 35670:return De;case 35667:case 35671:return Ie;case 35668:case 35672:return Ne;case 35669:case 35673:return Be;case 5125:return ze;case 35678:case 36198:case 36298:case 36306:case 35682:return Re;case 35679:case 36299:case 36307:return Ce;case 35680:case 36300:case 36308:case 36293:return Oe;case 36289:case 36303:case 36311:case 36292:return Pe}}function Ue(e,t){e.uniform1fv(this.addr,t)}function Ge(e,t){e.uniform1iv(this.addr,t)}function He(e,t){e.uniform2iv(this.addr,t)}function Ve(e,t){e.uniform3iv(this.addr,t)}function je(e,t){e.uniform4iv(this.addr,t)}function ke(e,t){var n=ye(t,this.size,2);e.uniform2fv(this.addr,n)}function We(e,t){var n=ye(t,this.size,3);e.uniform3fv(this.addr,n)}function qe(e,t){var n=ye(t,this.size,4);e.uniform4fv(this.addr,n)}function Xe(e,t){var n=ye(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Ye(e,t){var n=ye(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Ze(e,t){var n=ye(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Je(e,t,n){var i=t.length,r=we(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(t[a]||Mu,r[a])}function Qe(e,t,n){var i=t.length,r=we(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(t[a]||Su,r[a])}function Ke(e){switch(e){case 5126:return Ue;case 35664:return ke;case 35665:return We;case 35666:return qe;case 35674:return Xe;case 35675:return Ye;case 35676:return Ze;case 5124:case 35670:return Ge;case 35667:case 35671:return He;case 35668:case 35672:return Ve;case 35669:case 35673:return je;case 35678:case 36198:case 36298:case 36306:case 35682:return Je;case 35680:case 36300:case 36308:case 36293:return Qe}}function $e(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=Fe(t.type)}function et(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=Ke(t.type)}function tt(e){this.id=e,this.seq=[],this.map={}}function nt(e,t){e.seq.push(t),e.map[t.id]=t}function it(e,t,n){var i=e.name,r=i.length;for(Ou.lastIndex=0;;){var a=Ou.exec(i),o=Ou.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===r){nt(n,void 0===l?new $e(s,e,t):new et(s,e,t));break}var h=n.map,u=h[s];void 0===u&&(u=new tt(s),nt(n,u)),n=u}}function rt(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),i=0;i<n;++i){var r=e.getActiveUniform(t,i);it(r,e.getUniformLocation(t,r.name),this)}}function at(e,t,n){var i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}function ot(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function st(e){switch(e){case ol:return["Linear","( value )"];case sl:return["sRGB","( value )"];case ll:return["RGBE","( value )"];case ul:return["RGBM","( value, 7.0 )"];case pl:return["RGBM","( value, 16.0 )"];case dl:return["RGBD","( value, 256.0 )"];case cl:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case hl:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function ct(e,t,n){var i=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+ot(e.getShaderSource(t))}function lt(e,t){var n=st(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ht(e,t){var n=st(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function ut(e,t){var n;switch(t){case Vs:n="Linear";break;case js:n="Reinhard";break;case ks:n="Uncharted2";break;case Ws:n="OptimizedCineon";break;case qs:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function pt(e){
- return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(mt).join("\n")}function dt(e){var t=[];for(var n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}function ft(e,t){for(var n={},i=e.getProgramParameter(t,35721),r=0;r<i;r++){var a=e.getActiveAttrib(t,r),o=a.name;n[o]=e.getAttribLocation(t,o)}return n}function mt(e){return""!==e}function vt(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function gt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function yt(e){return e.replace(Iu,xt)}function xt(e,t){var n=wu[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return yt(n)}function bt(e){return e.replace(Nu,wt)}function wt(e,t,n,i){for(var r="",a=parseInt(t);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function _t(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Mt(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===$o?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===es?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===ts&&(t="SHADOWMAP_TYPE_VSM"),t}function Tt(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case Xs:case Ys:t="ENVMAP_TYPE_CUBE";break;case Ks:case $s:t="ENVMAP_TYPE_CUBE_UV";break;case Zs:case Js:t="ENVMAP_TYPE_EQUIREC";break;case Qs:t="ENVMAP_TYPE_SPHERE"}return t}function Et(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case Ys:case Js:t="ENVMAP_MODE_REFRACTION"}return t}function St(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case Fs:t="ENVMAP_BLENDING_MULTIPLY";break;case Us:t="ENVMAP_BLENDING_MIX";break;case Gs:t="ENVMAP_BLENDING_ADD"}return t}function At(e,t,n){var i,r,a=e.getContext(),o=n.defines,s=n.vertexShader,c=n.fragmentShader,l=Mt(n),h=Tt(n),u=Et(n),p=St(n),d=e.gammaFactor>0?e.gammaFactor:1,f=n.isWebGL2?"":pt(n),m=dt(o),v=a.createProgram(),g=n.numMultiviewViews;if(n.isRawShaderMaterial?(i=[m].filter(mt).join("\n"),i.length>0&&(i+="\n"),r=[f,m].filter(mt).join("\n"),r.length>0&&(r+="\n")):(i=[_t(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#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.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_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.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#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(mt).join("\n"),r=[f,_t(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",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.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Hs?"#define TONE_MAPPING":"",n.toneMapping!==Hs?wu.tonemapping_pars_fragment:"",n.toneMapping!==Hs?ut("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?wu.encodings_pars_fragment:"",n.mapEncoding?lt("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?lt("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?lt("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?lt("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?lt("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?ht("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(mt).join("\n")),s=yt(s),s=vt(s,n),s=gt(s,n),c=yt(c),c=vt(c,n),c=gt(c,n),s=bt(s),c=bt(c),n.isWebGL2&&!n.isRawShaderMaterial){var y=!1,x=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==s.match(x)&&null!==c.match(x)&&(y=!0,s=s.replace(x,""),c=c.replace(x,"")),i=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,r=["#version 300 es\n","#define varying in",y?"":"out highp vec4 pc_fragColor;",y?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+r,g>0&&(i=i.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+g+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n")),i=i.replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+g+"];","uniform mat4 projectionMatrices["+g+"];","uniform mat4 viewMatrices["+g+"];","uniform mat3 normalMatrices["+g+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),r=r.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n")),r=r.replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+g+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var b=i+s,w=r+c,_=at(a,35633,b),M=at(a,35632,w);if(a.attachShader(v,_),a.attachShader(v,M),void 0!==n.index0AttributeName?a.bindAttribLocation(v,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(v,0,"position"),a.linkProgram(v),e.debug.checkShaderErrors){var T=a.getProgramInfoLog(v).trim(),E=a.getShaderInfoLog(_).trim(),S=a.getShaderInfoLog(M).trim(),A=!0,L=!0;if(!1===a.getProgramParameter(v,35714)){A=!1;var R=ct(a,_,"vertex"),P=ct(a,M,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(v,35715),"gl.getProgramInfoLog",T,R,P)}else""!==T?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):""!==E&&""!==S||(L=!1);L&&(this.diagnostics={runnable:A,programLog:T,vertexShader:{log:E,prefix:i},fragmentShader:{log:S,prefix:r}})}a.deleteShader(_),a.deleteShader(M);var C;this.getUniforms=function(){return void 0===C&&(C=new rt(a,v)),C};var O;return this.getAttributes=function(){return void 0===O&&(O=ft(a,v)),O},this.destroy=function(){a.deleteProgram(v),this.program=void 0},this.name=n.shaderName,this.id=Du++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=_,this.fragmentShader=M,this.numMultiviewViews=g,this}function Lt(e,t,n){function i(e,t){var n;if(t){var i=_u[t];n={name:e.type,uniforms:du.clone(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader}}else n={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return n}function r(e){var t=e.skeleton,n=t.bones;if(l)return 1024;var i=u,r=Math.floor((i-20)/4),a=Math.min(r,n.length);return a<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+a+"."),0):a}function a(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=ol,t}var o=[],s=n.isWebGL2,c=n.logarithmicDepthBuffer,l=n.floatVertexTextures,h=n.precision,u=n.maxVertexUniforms,p=n.vertexTextures,d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},f=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];this.getParameters=function(o,u,f,m,v,g,y){var x=m.fog,b=o.isMeshStandardMaterial?m.environment:null,w=o.envMap||b,_=d[o.type],M=y.isSkinnedMesh?r(y):0;null!==o.precision&&(h=n.getMaxPrecision(o.precision))!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",h,"instead.");var T=i(o,_);o.onBeforeCompile(T,e);var E=e.getRenderTarget(),S=E&&E.isWebGLMultiviewRenderTarget?E.numViews:0;return{isWebGL2:s,shaderID:_,shaderName:T.name,uniforms:T.uniforms,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,defines:o.defines,isRawShaderMaterial:o.isRawShaderMaterial,isShaderMaterial:o.isShaderMaterial,precision:h,instancing:!0===y.isInstancedMesh,supportsVertexTextures:p,numMultiviewViews:S,outputEncoding:null!==E?a(E.texture):e.outputEncoding,map:!!o.map,mapEncoding:a(o.map),matcap:!!o.matcap,matcapEncoding:a(o.matcap),envMap:!!w,envMapMode:w&&w.mapping,envMapEncoding:a(w),envMapCubeUV:!!w&&(w.mapping===Ks||w.mapping===$s),lightMap:!!o.lightMap,lightMapEncoding:a(o.lightMap),aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,emissiveMapEncoding:a(o.emissiveMap),bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,objectSpaceNormalMap:o.normalMapType===gl,tangentSpaceNormalMap:o.normalMapType===vl,clearcoatNormalMap:!!o.clearcoatNormalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,alphaMap:!!o.alphaMap,gradientMap:!!o.gradientMap,sheen:!!o.sheen,combine:o.combine,vertexTangents:o.normalMap&&o.vertexTangents,vertexColors:o.vertexColors,vertexUvs:!!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||o.displacementMap),uvsVertexOnly:!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||!o.displacementMap),fog:!!x,useFog:o.fog,fogExp2:x&&x.isFogExp2,flatShading:o.flatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:c,skinning:o.skinning&&M>0,maxBones:M,useVertexTexture:l,morphTargets:o.morphTargets,morphNormals:o.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:u.directional.length,numPointLights:u.point.length,numSpotLights:u.spot.length,numRectAreaLights:u.rectArea.length,numHemiLights:u.hemi.length,numDirLightShadows:u.directionalShadowMap.length,numPointLightShadows:u.pointShadowMap.length,numSpotLightShadows:u.spotShadowMap.length,numClippingPlanes:v,numClipIntersection:g,dithering:o.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:o.toneMapped?e.toneMapping:Hs,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,alphaTest:o.alphaTest,doubleSided:o.side===rs,flipSided:o.side===is,depthPacking:void 0!==o.depthPacking&&o.depthPacking,index0AttributeName:o.index0AttributeName,extensionDerivatives:o.extensions&&o.extensions.derivatives,extensionFragDepth:o.extensions&&o.extensions.frawbuffers,extensionDrawbuffers:o.extensions&&o.extensions.drawbuffers,extensionShaderTextureLOD:o.extensions&&o.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:s||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||null!==t.get("EXT_shader_texture_lod"),onBeforeCompile:o.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)n.push(i),n.push(t.defines[i]);if(void 0===t.isRawShaderMaterial){for(var r=0;r<f.length;r++)n.push(t[f[r]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var i,r=0,a=o.length;r<a;r++){var s=o[r];if(s.cacheKey===n){i=s,++i.usedTimes;break}}return void 0===i&&(i=new At(e,n,t),o.push(i)),i},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=o.indexOf(e);o[t]=o[o.length-1],o.pop(),e.destroy()}},this.programs=o}function Rt(){function e(e){var t=r.get(e);return void 0===t&&(t={},r.set(e,t)),t}function t(e){r.delete(e)}function n(e,t,n){r.get(e)[t]=n}function i(){r=new WeakMap}var r=new WeakMap;return{get:e,remove:t,update:n,dispose:i}}function Pt(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Ct(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Ot(){function e(){o=0,s.length=0,c.length=0}function t(e,t,n,i,r,s){var c=a[o];return void 0===c?(c={id:e.id,object:e,geometry:t,material:n,program:n.program||l,groupOrder:i,renderOrder:e.renderOrder,z:r,group:s},a[o]=c):(c.id=e.id,c.object=e,c.geometry=t,c.material=n,c.program=n.program||l,c.groupOrder=i,c.renderOrder=e.renderOrder,c.z=r,c.group=s),o++,c}function n(e,n,i,r,a,o){var l=t(e,n,i,r,a,o);(!0===i.transparent?c:s).push(l)}function i(e,n,i,r,a,o){var l=t(e,n,i,r,a,o);(!0===i.transparent?c:s).unshift(l)}function r(e,t){s.length>1&&s.sort(e||Pt),c.length>1&&c.sort(t||Ct)}var a=[],o=0,s=[],c=[],l={id:-1};return{opaque:s,transparent:c,init:e,push:n,unshift:i,sort:r}}function Dt(){function e(t){var n=t.target;n.removeEventListener("dispose",e),i.delete(n)}function t(t,n){var r,a=i.get(t);return void 0===a?(r=new Ot,i.set(t,new WeakMap),i.get(t).set(n,r),t.addEventListener("dispose",e)):void 0===(r=a.get(n))&&(r=new Ot,a.set(n,r)),r}function n(){i=new WeakMap}var i=new WeakMap;return{get:t,dispose:n}}function It(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var i;switch(t.type){case"DirectionalLight":i={direction:new l,color:new w,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n};break;case"SpotLight":i={position:new l,direction:new l,color:new w,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n};break;case"PointLight":i={position:new l,color:new w,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":i={direction:new l,skyColor:new w,groundColor:new w};break;case"RectAreaLight":i={color:new w,position:new l,halfWidth:new l,halfHeight:new l}}return e[t.id]=i,i}}}function Nt(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Bt(){function e(e,i,s){for(var c=0,l=0,h=0,u=0;u<9;u++)n.probe[u].set(0,0,0);var p=0,d=0,f=0,m=0,v=0,g=0,y=0,x=0,b=s.matrixWorldInverse;e.sort(Nt);for(var u=0,w=e.length;u<w;u++){var _=e[u],M=_.color,T=_.intensity,E=_.distance,S=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)c+=M.r*T,l+=M.g*T,h+=M.b*T;else if(_.isLightProbe)for(var A=0;A<9;A++)n.probe[A].addScaledVector(_.sh.coefficients[A],T);else if(_.isDirectionalLight){var L=t.get(_);if(L.color.copy(_.color).multiplyScalar(_.intensity),L.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),L.direction.sub(r),L.direction.transformDirection(b),L.shadow=_.castShadow,_.castShadow){var R=_.shadow;L.shadowBias=R.bias,L.shadowRadius=R.radius,L.shadowMapSize=R.mapSize,n.directionalShadowMap[p]=S,n.directionalShadowMatrix[p]=_.shadow.matrix,g++}n.directional[p]=L,p++}else if(_.isSpotLight){var L=t.get(_);if(L.position.setFromMatrixPosition(_.matrixWorld),L.position.applyMatrix4(b),L.color.copy(M).multiplyScalar(T),L.distance=E,L.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),L.direction.sub(r),L.direction.transformDirection(b),L.coneCos=Math.cos(_.angle),L.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),L.decay=_.decay,L.shadow=_.castShadow,_.castShadow){var R=_.shadow;L.shadowBias=R.bias,L.shadowRadius=R.radius,L.shadowMapSize=R.mapSize,n.spotShadowMap[f]=S,n.spotShadowMatrix[f]=_.shadow.matrix,x++}n.spot[f]=L,f++}else if(_.isRectAreaLight){var L=t.get(_);L.color.copy(M).multiplyScalar(T),L.position.setFromMatrixPosition(_.matrixWorld),L.position.applyMatrix4(b),o.identity(),a.copy(_.matrixWorld),a.premultiply(b),o.extractRotation(a),L.halfWidth.set(.5*_.width,0,0),L.halfHeight.set(0,.5*_.height,0),L.halfWidth.applyMatrix4(o),L.halfHeight.applyMatrix4(o),n.rectArea[m]=L,m++}else if(_.isPointLight){var L=t.get(_);if(L.position.setFromMatrixPosition(_.matrixWorld),L.position.applyMatrix4(b),L.color.copy(_.color).multiplyScalar(_.intensity),L.distance=_.distance,L.decay=_.decay,L.shadow=_.castShadow,_.castShadow){var R=_.shadow;L.shadowBias=R.bias,L.shadowRadius=R.radius,L.shadowMapSize=R.mapSize,L.shadowCameraNear=R.camera.near,L.shadowCameraFar=R.camera.far,n.pointShadowMap[d]=S,n.pointShadowMatrix[d]=_.shadow.matrix,y++}n.point[d]=L,d++}else if(_.isHemisphereLight){var L=t.get(_);L.direction.setFromMatrixPosition(_.matrixWorld),L.direction.transformDirection(b),L.direction.normalize(),L.skyColor.copy(_.color).multiplyScalar(T),L.groundColor.copy(_.groundColor).multiplyScalar(T),n.hemi[v]=L,v++}}n.ambient[0]=c,n.ambient[1]=l,n.ambient[2]=h;var P=n.hash;P.directionalLength===p&&P.pointLength===d&&P.spotLength===f&&P.rectAreaLength===m&&P.hemiLength===v&&P.numDirectionalShadows===g&&P.numPointShadows===y&&P.numSpotShadows===x||(n.directional.length=p,n.spot.length=f,n.rectArea.length=m,n.point.length=d,n.hemi.length=v,n.directionalShadowMap.length=g,n.pointShadowMap.length=y,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=g,n.pointShadowMatrix.length=y,n.spotShadowMatrix.length=x,P.directionalLength=p,P.pointLength=d,P.spotLength=f,P.rectAreaLength=m,P.hemiLength=v,P.numDirectionalShadows=g,P.numPointShadows=y,P.numSpotShadows=x,n.version=Bu++)}for(var t=new It,n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},i=0;i<9;i++)n.probe.push(new l);var r=new l,a=new h,o=new h;return{setup:e,state:n}}function zt(){function e(){a.length=0,o.length=0}function t(e){a.push(e)}function n(e){o.push(e)}function i(e){r.setup(a,o,e)}var r=new Bt,a=[],o=[];return{init:e,state:{lightsArray:a,shadowsArray:o,lights:r},setupLights:i,pushLight:t,pushShadow:n}}function Ft(){function e(t){var n=t.target;n.removeEventListener("dispose",e),i.delete(n)}function t(t,n){var r;return!1===i.has(t)?(r=new zt,i.set(t,new WeakMap),i.get(t).set(n,r),t.addEventListener("dispose",e)):!1===i.get(t).has(n)?(r=new zt,i.get(t).set(n,r)):r=i.get(t).get(n),r}function n(){i=new WeakMap}var i=new WeakMap;return{get:t,dispose:n}}function Ut(e){S.call(this),this.type="MeshDepthMaterial",this.depthPacking=fl,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.setValues(e)}function Gt(e){S.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new l,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}function Ht(e,t,i){function r(n,i){var r=t.update(_);x.uniforms.shadow_pass.value=n.map.texture,x.uniforms.resolution.value=n.mapSize,x.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,x,_,null),b.uniforms.shadow_pass.value=n.mapPass.texture,b.uniforms.resolution.value=n.mapSize,b.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,b,_,null)}function s(e,t,n){var i=e<<0|t<<1|n<<2,r=m[i];return void 0===r&&(r=new Ut({depthPacking:ml,morphTargets:e,skinning:t}),m[i]=r),r}function c(e,t,n){var i=e<<0|t<<1|n<<2,r=v[i];return void 0===r&&(r=new Gt({morphTargets:e,skinning:t}),v[i]=r),r}function l(t,n,i,r,a,o){var l=t.geometry,h=null,u=s,p=t.customDepthMaterial;if(!0===i.isPointLight&&(u=c,p=t.customDistanceMaterial),void 0===p){var d=!1;!0===n.morphTargets&&(!0===l.isBufferGeometry?d=l.morphAttributes&&l.morphAttributes.position&&l.morphAttributes.position.length>0:!0===l.isGeometry&&(d=l.morphTargets&&l.morphTargets.length>0));var f=!1;!0===t.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t));h=u(d,f,!0===t.isInstancedMesh)}else h=p;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=h.uuid,v=n.uuid,x=g[m];void 0===x&&(x={},g[m]=x);var b=x[v];void 0===b&&(b=h.clone(),x[v]=b),h=b}return h.visible=n.visible,h.wireframe=n.wireframe,h.side=o===ts?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:y[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===i.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(i.matrixWorld),h.nearDistance=r,h.farDistance=a),h}function h(n,i,r,a,o){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===ts)&&(!n.frustumCulled||u.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,n.matrixWorld);var s=t.update(n),c=n.material;if(Array.isArray(c))for(var p=s.groups,d=0,f=p.length;d<f;d++){var m=p[d],v=c[m.materialIndex];if(v&&v.visible){var g=l(n,v,a,r.near,r.far,o);e.renderBufferDirect(r,null,s,g,n,m)}}else if(c.visible){var g=l(n,c,a,r.near,r.far,o);e.renderBufferDirect(r,null,s,g,n,null)}}for(var y=n.children,x=0,b=y.length;x<b;x++)h(y[x],i,r,a,o)}}var u=new $,p=new n,d=new n,f=new a,m=[],v=[],g={},y={0:is,1:ns,2:rs},x=new X({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new n},radius:{value:4}},vertexShader:Fu,fragmentShader:zu}),b=x.clone();b.defines.HORIZONAL_PASS=1;var w=new G;w.setAttribute("position",new L(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var _=new H(w,x),M=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=$o,this.render=function(t,n,a){if(!1!==M.enabled&&(!1!==M.autoUpdate||!1!==M.needsUpdate)&&0!==t.length){var s=e.getRenderTarget(),c=e.getActiveCubeFace(),l=e.getActiveMipmapLevel(),m=e.state;m.setBlending(cs),m.buffers.color.setClear(1,1,1,1),m.buffers.depth.setTest(!0),m.setScissorTest(!1);for(var v=0,g=t.length;v<g;v++){var y=t[v],x=y.shadow;if(void 0!==x){p.copy(x.mapSize);var b=x.getFrameExtents();if(p.multiply(b),d.copy(x.mapSize),(p.x>i||p.y>i)&&(console.warn("THREE.WebGLShadowMap:",y,"has shadow exceeding max texture size, reducing"),p.x>i&&(d.x=Math.floor(i/b.x),p.x=d.x*b.x,x.mapSize.x=d.x),p.y>i&&(d.y=Math.floor(i/b.y),p.y=d.y*b.y,x.mapSize.y=d.y)),null===x.map&&!x.isPointLightShadow&&this.type===ts){var w={minFilter:oc,magFilter:oc,format:Mc};x.map=new o(p.x,p.y,w),x.map.texture.name=y.name+".shadowMap",x.mapPass=new o(p.x,p.y,w),x.camera.updateProjectionMatrix()}if(null===x.map){var w={minFilter:ic,magFilter:ic,format:Mc};x.map=new o(p.x,p.y,w),x.map.texture.name=y.name+".shadowMap",x.camera.updateProjectionMatrix()}e.setRenderTarget(x.map),e.clear();for(var _=x.getViewportCount(),T=0;T<_;T++){var E=x.getViewport(T);f.set(d.x*E.x,d.y*E.y,d.x*E.z,d.y*E.w),m.viewport(f),x.updateMatrices(y,T),u=x.getFrustum(),h(n,a,x.camera,y,this.type)}x.isPointLightShadow||this.type!==ts||r(x,a)}else console.warn("THREE.WebGLShadowMap:",y,"has no shadow.")}M.needsUpdate=!1,e.setRenderTarget(s,c,l)}}}function Vt(e,t,n){function i(){var t=!1,n=new a,i=null,r=new a(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,o,s){!0===s&&(t*=o,i*=o,a*=o),n.set(t,i,a,o),!1===r.equals(n)&&(e.clearColor(t,i,a,o),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}}function r(){var t=!1,n=null,i=null,r=null;return{setTest:function(e){e?p(2929):d(2929)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){if(t)switch(t){case Ps:e.depthFunc(512);break;case Cs:e.depthFunc(519);break;case Os:e.depthFunc(513);break;case Ds:e.depthFunc(515);break;case Is:e.depthFunc(514);break;case Ns:e.depthFunc(518);break;case Bs:e.depthFunc(516);break;case zs:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}}function o(){var t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(e){t||(e?p(2960):d(2960))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&r===n&&a===o||(e.stencilFunc(t,n,o),i=t,r=n,a=o)},setOp:function(t,n,i){o===t&&s===n&&c===i||(e.stencilOp(t,n,i),o=t,s=n,c=i)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null}}}function s(t,n,i){var r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<i;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,r);return a}function c(){for(var e=0,t=B.length;e<t;e++)B[e]=0}function l(e){h(e,0)}function h(n,i){if(B[n]=1,0===z[n]&&(e.enableVertexAttribArray(n),z[n]=1),F[n]!==i){(C?e:t.get("ANGLE_instanced_arrays"))[C?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),F[n]=i}}function u(){
- for(var t=0,n=z.length;t!==n;++t)z[t]!==B[t]&&(e.disableVertexAttribArray(t),z[t]=0)}function p(t){!0!==U[t]&&(e.enable(t),U[t]=!0)}function d(t){!1!==U[t]&&(e.disable(t),U[t]=!1)}function f(t){return G!==t&&(e.useProgram(t),G=t,!0)}function m(t,n,i,r,a,o,s,c){if(t===cs)return void(H&&(d(3042),H=!1));if(H||(p(3042),H=!0),t===ds)a=a||n,o=o||i,s=s||r,n===j&&a===q||(e.blendEquationSeparate(he[n],he[a]),j=n,q=a),i===k&&r===W&&o===X&&s===Y||(e.blendFuncSeparate(pe[i],pe[r],pe[o],pe[s]),k=i,W=r,X=o,Y=s),V=t,Z=null;else if(t!==V||c!==Z){if(j===fs&&q===fs||(e.blendEquation(32774),j=fs,q=fs),c)switch(t){case ls:e.blendFuncSeparate(1,771,1,771);break;case hs:e.blendFunc(1,1);break;case us:e.blendFuncSeparate(0,0,769,771);break;case ps:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case ls:e.blendFuncSeparate(770,771,1,771);break;case hs:e.blendFunc(770,1);break;case us:e.blendFunc(0,769);break;case ps:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}k=null,W=null,X=null,Y=null,V=t,Z=c}}function v(e,t){e.side===rs?d(2884):p(2884);var n=e.side===is;t&&(n=!n),g(n),e.blending===ls&&!1===e.transparent?m(cs):m(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),D.setFunc(e.depthFunc),D.setTest(e.depthTest),D.setMask(e.depthWrite),O.setMask(e.colorWrite);var i=e.stencilWrite;I.setTest(i),i&&(I.setMask(e.stencilWriteMask),I.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),I.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),b(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function g(t){J!==t&&(t?e.frontFace(2304):e.frontFace(2305),J=t)}function y(t){t!==Jo?(p(2884),t!==Q&&(t===Qo?e.cullFace(1029):t===Ko?e.cullFace(1028):e.cullFace(1032))):d(2884),Q=t}function x(t){t!==K&&(ne&&e.lineWidth(t),K=t)}function b(t,n,i){t?(p(32823),$===n&&ee===i||(e.polygonOffset(n,i),$=n,ee=i)):d(32823)}function w(e){e?p(3089):d(3089)}function _(t){void 0===t&&(t=33984+te-1),ae!==t&&(e.activeTexture(t),ae=t)}function M(t,n){null===ae&&_();var i=oe[ae];void 0===i&&(i={type:void 0,texture:void 0},oe[ae]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||le[t]),i.type=t,i.texture=n)}function T(){var t=oe[ae];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function E(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function S(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function A(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function L(t){!1===se.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),se.copy(t))}function R(t){!1===ce.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),ce.copy(t))}function P(){for(var t=0;t<z.length;t++)1===z[t]&&(e.disableVertexAttribArray(t),z[t]=0);U={},ae=null,oe={},G=null,V=null,J=null,Q=null,O.reset(),D.reset(),I.reset()}var C=n.isWebGL2,O=new i,D=new r,I=new o,N=e.getParameter(34921),B=new Uint8Array(N),z=new Uint8Array(N),F=new Uint8Array(N),U={},G=null,H=null,V=null,j=null,k=null,W=null,q=null,X=null,Y=null,Z=!1,J=null,Q=null,K=null,$=null,ee=null,te=e.getParameter(35661),ne=!1,ie=0,re=e.getParameter(7938);-1!==re.indexOf("WebGL")?(ie=parseFloat(/^WebGL\ ([0-9])/.exec(re)[1]),ne=ie>=1):-1!==re.indexOf("OpenGL ES")&&(ie=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(re)[1]),ne=ie>=2);var ae=null,oe={},se=new a,ce=new a,le={};le[3553]=s(3553,3553,1),le[34067]=s(34067,34069,6),O.setClear(0,0,0,1),D.setClear(1),I.setClear(0),p(2929),D.setFunc(Ds),g(!1),y(Qo),p(2884),m(cs);var he={};if(he[fs]=32774,he[ms]=32778,he[vs]=32779,C)he[gs]=32775,he[ys]=32776;else{var ue=t.get("EXT_blend_minmax");null!==ue&&(he[gs]=ue.MIN_EXT,he[ys]=ue.MAX_EXT)}var pe={};return pe[xs]=0,pe[bs]=1,pe[ws]=768,pe[Ms]=770,pe[Rs]=776,pe[As]=774,pe[Es]=772,pe[_s]=769,pe[Ts]=771,pe[Ls]=775,pe[Ss]=773,{buffers:{color:O,depth:D,stencil:I},initAttributes:c,enableAttribute:l,enableAttributeAndDivisor:h,disableUnusedAttributes:u,enable:p,disable:d,useProgram:f,setBlending:m,setMaterial:v,setFlipSided:g,setCullFace:y,setLineWidth:x,setPolygonOffset:b,setScissorTest:w,activeTexture:_,bindTexture:M,unbindTexture:T,compressedTexImage2D:E,texImage2D:S,texImage3D:A,scissor:L,viewport:R,reset:P}}function jt(e,t,n,i,r,a,o){function s(e,t){return X?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function c(e,t,n,i){var r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Tl.floorPowerOfTwo:Math.floor,o=a(r*e.width),c=a(r*e.height);void 0===G&&(G=s(o,c));var l=n?s(o,c):G;l.width=o,l.height=c;return l.getContext("2d").drawImage(e,0,0,o,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+c+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function l(e){return Tl.isPowerOfTwo(e.width)&&Tl.isPowerOfTwo(e.height)}function h(e){return!H&&(e.wrapS!==tc||e.wrapT!==tc||e.minFilter!==ic&&e.minFilter!==oc)}function u(e,t){return e.generateMipmaps&&t&&e.minFilter!==ic&&e.minFilter!==oc}function p(t,n,r,a){e.generateMipmap(t),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function d(n,i,r){if(!1===H)return i;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=i;return 6403===i&&(5126===r&&(a=33326),5131===r&&(a=33325),5121===r&&(a=33321)),6407===i&&(5126===r&&(a=34837),5131===r&&(a=34843),5121===r&&(a=32849)),6408===i&&(5126===r&&(a=34836),5131===r&&(a=34842),5121===r&&(a=32856)),33325===a||33326===a||34842===a||34836===a?t.get("EXT_color_buffer_float"):34843!==a&&34837!==a||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),a}function f(e){return e===ic||e===rc||e===ac?9728:9729}function m(e){var t=e.target;t.removeEventListener("dispose",m),g(t),t.isVideoTexture&&q.delete(t),o.memory.textures--}function v(e){var t=e.target;t.removeEventListener("dispose",v),y(t),o.memory.textures--}function g(t){var n=i.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),i.remove(t))}function y(t){var n=i.get(t),r=i.get(t.texture);if(t){if(void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){e.deleteTexture(n.__webglColorTexture),e.deleteTexture(n.__webglDepthStencilTexture),o.memory.textures-=2;for(var a=0,s=n.__webglViewFramebuffers.length;a<s;a++)e.deleteFramebuffer(n.__webglViewFramebuffers[a])}i.remove(t.texture),i.remove(t)}}function x(){Y=0}function b(){var e=Y;return e>=V&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+V),Y+=1,e}function w(e,t){var r=i.get(e);if(e.isVideoTexture&&z(e),e.version>0&&r.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void L(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,r.__webglTexture)}function _(e,t){var r=i.get(e);if(e.version>0&&r.__version!==e.version)return void L(r,e,t);n.activeTexture(33984+t),n.bindTexture(35866,r.__webglTexture)}function M(e,t){var r=i.get(e);if(e.version>0&&r.__version!==e.version)return void L(r,e,t);n.activeTexture(33984+t),n.bindTexture(32879,r.__webglTexture)}function T(t,r){if(6===t.image.length){var o=i.get(t);if(t.version>0&&o.__version!==t.version){A(o,t),n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),h=t.image[0]&&t.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=s||h?h?t.image[m].image:t.image[m]:c(t.image[m],!1,!0,j);var v=f[0],g=l(v)||H,y=a.convert(t.format),x=a.convert(t.type),b=d(t.internalFormat,y,x);S(34067,t,g);var w;if(s){for(var m=0;m<6;m++){w=f[m].mipmaps;for(var _=0;_<w.length;_++){var M=w[_];t.format!==Mc&&t.format!==_c?null!==y?n.compressedTexImage2D(34069+m,_,b,M.width,M.height,0,M.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+m,_,b,M.width,M.height,0,y,x,M.data)}}o.__maxMipLevel=w.length-1}else{w=t.mipmaps;for(var m=0;m<6;m++)if(h){n.texImage2D(34069+m,0,b,f[m].width,f[m].height,0,y,x,f[m].data);for(var _=0;_<w.length;_++){var M=w[_],T=M.image[m].image;n.texImage2D(34069+m,_+1,b,T.width,T.height,0,y,x,T.data)}}else{n.texImage2D(34069+m,0,b,y,x,f[m]);for(var _=0;_<w.length;_++){var M=w[_];n.texImage2D(34069+m,_+1,b,y,x,M.image[m])}}o.__maxMipLevel=w.length}u(t,g)&&p(34067,t,v.width,v.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture)}}function E(e,t){n.activeTexture(33984+t),n.bindTexture(34067,i.get(e).__webglTexture)}function S(n,a,o){o?(e.texParameteri(n,10242,Z[a.wrapS]),e.texParameteri(n,10243,Z[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,Z[a.wrapR]),e.texParameteri(n,10240,J[a.magFilter]),e.texParameteri(n,10241,J[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),a.wrapS===tc&&a.wrapT===tc||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,f(a.magFilter)),e.texParameteri(n,10241,f(a.minFilter)),a.minFilter!==ic&&a.minFilter!==oc&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(a.type===mc&&null===t.get("OES_texture_float_linear"))return;if(a.type===vc&&null===(H||t.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||i.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function A(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",m),t.__webglTexture=e.createTexture(),o.memory.textures++)}function L(t,i,r){var o=3553;i.isDataTexture2DArray&&(o=35866),i.isDataTexture3D&&(o=32879),A(t,i),n.activeTexture(33984+r),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment);var s=h(i)&&!1===l(i.image),f=c(i.image,s,!1,k),m=l(f)||H,v=a.convert(i.format),g=a.convert(i.type),y=d(i.internalFormat,v,g);S(o,i,m);var x,b=i.mipmaps;if(i.isDepthTexture){if(y=6402,i.type===mc){if(!1===H)throw new Error("Float Depth Texture only supported in WebGL2.0");y=36012}else H&&(y=33189);i.format===Ac&&6402===y&&i.type!==pc&&i.type!==fc&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=pc,g=a.convert(i.type)),i.format===Lc&&(y=34041,i.type!==bc&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=bc,g=a.convert(i.type))),n.texImage2D(3553,0,y,f.width,f.height,0,v,g,null)}else if(i.isDataTexture)if(b.length>0&&m){for(var w=0,_=b.length;w<_;w++)x=b[w],n.texImage2D(3553,w,y,x.width,x.height,0,v,g,x.data);i.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,y,f.width,f.height,0,v,g,f.data),t.__maxMipLevel=0;else if(i.isCompressedTexture){for(var w=0,_=b.length;w<_;w++)x=b[w],i.format!==Mc&&i.format!==_c?null!==v?n.compressedTexImage2D(3553,w,y,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,w,y,x.width,x.height,0,v,g,x.data);t.__maxMipLevel=b.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,y,f.width,f.height,f.depth,0,v,g,f.data),t.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,y,f.width,f.height,f.depth,0,v,g,f.data),t.__maxMipLevel=0;else if(b.length>0&&m){for(var w=0,_=b.length;w<_;w++)x=b[w],n.texImage2D(3553,w,y,v,g,x);i.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,y,v,g,f),t.__maxMipLevel=0;u(i,m)&&p(o,i,f.width,f.height),t.__version=i.version,i.onUpdate&&i.onUpdate(i)}function R(t,r,o,s){var c=a.convert(r.texture.format),l=a.convert(r.texture.type),h=d(r.texture.internalFormat,c,l);n.texImage2D(s,0,h,r.width,r.height,0,c,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,i.get(r.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function P(t,n,i){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){if(i){var r=B(n);e.renderbufferStorageMultisample(36161,r,33189,n.width,n.height)}else e.renderbufferStorage(36161,33189,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(i){var r=B(n);e.renderbufferStorageMultisample(36161,r,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var o=a.convert(n.texture.format),s=a.convert(n.texture.type),c=d(n.texture.internalFormat,o,s);if(i){var r=B(n);e.renderbufferStorageMultisample(36161,r,c,n.width,n.height)}else e.renderbufferStorage(36161,c,n.width,n.height)}e.bindRenderbuffer(36161,null)}function C(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),w(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Ac)e.framebufferTexture2D(36160,36096,3553,r,0);else{if(n.depthTexture.format!==Lc)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,r,0)}}function O(t){var n=i.get(t),r=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");C(n.__webglFramebuffer,t)}else if(r){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),P(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),P(n.__webglDepthbuffer,t);e.bindFramebuffer(36160,null)}function D(r){var s=i.get(r),c=i.get(r.texture);r.addEventListener("dispose",v),c.__webglTexture=e.createTexture(),o.memory.textures++;var h=!0===r.isWebGLCubeRenderTarget,f=!0===r.isWebGLMultisampleRenderTarget,m=!0===r.isWebGLMultiviewRenderTarget,g=l(r)||H;if(h){s.__webglFramebuffer=[];for(var y=0;y<6;y++)s.__webglFramebuffer[y]=e.createFramebuffer()}else if(s.__webglFramebuffer=e.createFramebuffer(),f)if(H){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var x=a.convert(r.texture.format),b=a.convert(r.texture.type),w=d(r.texture.internalFormat,x,b),_=B(r);e.renderbufferStorageMultisample(36161,_,w,r.width,r.height),e.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),r.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),P(s.__webglDepthRenderbuffer,r,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(m){var M=r.width,T=r.height,E=r.numViews;e.bindFramebuffer(36160,s.__webglFramebuffer);var A=t.get("OVR_multiview2");o.memory.textures+=2;var L=e.createTexture();e.bindTexture(35866,L),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,32856,M,T,E,0,6408,5121,null),A.framebufferTextureMultiviewOVR(36160,36064,L,0,0,E);var C=e.createTexture();e.bindTexture(35866,C),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,35056,M,T,E,0,34041,34042,null),A.framebufferTextureMultiviewOVR(36160,33306,C,0,0,E);for(var D=new Array(E),y=0;y<E;++y)D[y]=e.createFramebuffer(),e.bindFramebuffer(36160,D[y]),e.framebufferTextureLayer(36160,36064,L,0,y);s.__webglColorTexture=L,s.__webglDepthStencilTexture=C,s.__webglViewFramebuffers=D,e.bindFramebuffer(36160,null),e.bindTexture(35866,null)}if(h){n.bindTexture(34067,c.__webglTexture),S(34067,r.texture,g);for(var y=0;y<6;y++)R(s.__webglFramebuffer[y],r,36064,34069+y);u(r.texture,g)&&p(34067,r.texture,r.width,r.height),n.bindTexture(34067,null)}else m||(n.bindTexture(3553,c.__webglTexture),S(3553,r.texture,g),R(s.__webglFramebuffer,r,36064,3553),u(r.texture,g)&&p(3553,r.texture,r.width,r.height),n.bindTexture(3553,null));r.depthBuffer&&O(r)}function I(e){var t=e.texture;if(u(t,l(e)||H)){var r=e.isWebGLCubeRenderTarget?34067:3553,a=i.get(t).__webglTexture;n.bindTexture(r,a),p(r,t,e.width,e.height),n.bindTexture(r,null)}}function N(t){if(t.isWebGLMultisampleRenderTarget)if(H){var n=i.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var r=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function B(e){return H&&e.isWebGLMultisampleRenderTarget?Math.min(W,e.samples):0}function z(e){var t=o.render.frame;q.get(e)!==t&&(q.set(e,t),e.update())}function F(e,t){e&&e.isWebGLRenderTarget&&(!1===Q&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Q=!0),e=e.texture),w(e,t)}function U(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===K&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),K=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?T(e,t):E(e,t)}var G,H=r.isWebGL2,V=r.maxTextures,j=r.maxCubemapSize,k=r.maxTextureSize,W=r.maxSamples,q=new WeakMap,X=!1;try{X="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}var Y=0,Z={};Z[ec]=10497,Z[tc]=33071,Z[nc]=33648;var J={};J[ic]=9728,J[rc]=9984,J[ac]=9986,J[oc]=9729,J[sc]=9985,J[cc]=9987;var Q=!1,K=!1;this.allocateTextureUnit=b,this.resetTextureUnits=x,this.setTexture2D=w,this.setTexture2DArray=_,this.setTexture3D=M,this.setTextureCube=T,this.setTextureCubeDynamic=E,this.setupRenderTarget=D,this.updateRenderTargetMipmap=I,this.updateMultisampleRenderTarget=N,this.safeSetTexture2D=F,this.safeSetTextureCube=U}function kt(e,t,n){function i(e){var n;if(e===lc)return 5121;if(e===gc)return 32819;if(e===yc)return 32820;if(e===xc)return 33635;if(e===hc)return 5120;if(e===uc)return 5122;if(e===pc)return 5123;if(e===dc)return 5124;if(e===fc)return 5125;if(e===mc)return 5126;if(e===vc)return r?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(e===wc)return 6406;if(e===_c)return 6407;if(e===Mc)return 6408;if(e===Tc)return 6409;if(e===Ec)return 6410;if(e===Ac)return 6402;if(e===Lc)return 34041;if(e===Rc)return 6403;if(e===Pc)return 36244;if(e===Cc)return 33319;if(e===Oc)return 33320;if(e===Dc)return 36248;if(e===Ic)return 36249;if(e===Nc||e===Bc||e===zc||e===Fc){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===Nc)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Bc)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===zc)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Fc)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===Uc||e===Gc||e===Hc||e===Vc){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===Uc)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Gc)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Hc)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===Vc)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return e===jc?(n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null):e===kc||e===Wc||e===qc||e===Xc||e===Yc||e===Zc||e===Jc||e===Qc||e===Kc||e===$c||e===el||e===tl||e===nl||e===il?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):e===bc?r?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}var r=n.isWebGL2;return{convert:i}}function Wt(e,t,n,i){o.call(this,e,t,i),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function qt(e,t){function r(){if(void 0===w){var e=M.get("OVR_multiview2");if(w=null!==e&&!1===t.getContextAttributes().antialias){E=t.getParameter(e.MAX_VIEWS_OVR),m=new Wt(0,0,_),b=new n,y=[],g=[],x=[];for(var r=0;r<E;r++)y[r]=new h,g[r]=new i}}return w}function a(e){return e.isArrayCamera?e.cameras:(x[0]=e,x)}function o(e,n){for(var i=a(e),r=0;r<i.length;r++)y[r].copy(i[r].projectionMatrix);n.setValue(t,"projectionMatrices",y)}function s(e,n){for(var i=a(e),r=0;r<i.length;r++)y[r].copy(i[r].matrixWorldInverse);n.setValue(t,"viewMatrices",y)}function c(e,n,i){for(var r=a(n),o=0;o<r.length;o++)y[o].multiplyMatrices(r[o].matrixWorldInverse,e.matrixWorld),g[o].getNormalMatrix(y[o]);i.setValue(t,"modelViewMatrices",y),i.setValue(t,"normalMatrices",g)}function l(e){if(void 0===e.isArrayCamera)return!0;var t=e.cameras;if(t.length>E)return!1;for(var n=1,i=t.length;n<i;n++)if(t[0].viewport.z!==t[n].viewport.z||t[0].viewport.w!==t[n].viewport.w)return!1;return!0}function u(t){if(v?b.set(v.width,v.height):e.getDrawingBufferSize(b),t.isArrayCamera){var n=t.cameras[0].viewport;m.setSize(n.z,n.w),m.setNumViews(t.cameras.length)}else m.setSize(b.x,b.y),m.setNumViews(_)}function p(t){!1!==l(t)&&(v=e.getRenderTarget(),u(t),e.setRenderTarget(m))}function d(t){m===e.getRenderTarget()&&(e.setRenderTarget(v),f(t))}function f(e){var n=m,i=n.numViews,r=T.get(n).__webglViewFramebuffers,a=n.width,o=n.height;if(e.isArrayCamera)for(var s=0;s<i;s++){var c=e.cameras[s].viewport,l=c.x,h=c.y,u=l+c.z,p=h+c.w;t.bindFramebuffer(36008,r[s]),t.blitFramebuffer(0,0,a,o,l,h,u,p,16384,9728)}else t.bindFramebuffer(36008,r[0]),t.blitFramebuffer(0,0,a,o,0,0,b.x,b.y,16384,9728)}var m,v,g,y,x,b,w,_=2,M=e.extensions,T=e.properties,E=0;this.isAvailable=r,this.attachCamera=p,this.detachCamera=d,this.updateCameraProjectionMatricesUniform=o,this.updateCameraViewMatricesUniform=s,this.updateObjectMatricesUniforms=c}function Xt(){d.call(this),this.type="Group"}function Yt(e){Z.call(this),this.cameras=e||[]}function Zt(e,t,n){Uu.setFromMatrixPosition(t.matrixWorld),Gu.setFromMatrixPosition(n.matrixWorld);var i=Uu.distanceTo(Gu),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),c=(r[9]+1)/r[5],l=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(a[8]+1)/a[0],p=o*h,d=o*u,f=i/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=o+f,g=s+f,y=p-m,x=d+(i-m),b=c*s/g*v,w=l*s/g*v;e.projectionMatrix.makePerspective(y,x,b,w,v,g)}function Jt(e){function t(){if(p.isPresenting=null!==d&&!0===d.isPresenting){var t=d.getEyeParameters("left");s=2*t.renderWidth*x,u=t.renderHeight*x,A=e.getPixelRatio(),e.getSize(L),e.setDrawingBufferSize(s,u,1),T.viewport.set(0,0,s/2,u),E.viewport.set(s/2,0,s/2,u),C.start(),p.dispatchEvent({type:"sessionstart"})}else p.enabled&&e.setDrawingBufferSize(L.width,L.height,A),C.stop(),p.dispatchEvent({type:"sessionend"})}function i(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,i=t.length;n<i;n++){var r=t[n];if(r&&("Daydream Controller"===r.id||"Gear VR Controller"===r.id||"Oculus Go Controller"===r.id||"OpenVR Gamepad"===r.id||r.id.startsWith("Oculus Touch")||r.id.startsWith("HTC Vive Focus")||r.id.startsWith("Spatial Controller"))){var a=r.hand;if(0===e&&(""===a||"right"===a))return r;if(1===e&&"left"===a)return r}}}function r(){for(var e=0;e<v.length;e++){var t=v[e],n=i(e);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var r=n.pose;!1===r.hasPosition&&t.position.set(.2,-.6,-.05),null!==r.position&&t.position.fromArray(r.position),null!==r.orientation&&t.quaternion.fromArray(r.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(g),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0;var a="Daydream Controller"===n.id?0:1;void 0===R[e]&&(R[e]=!1),R[e]!==n.buttons[a].pressed&&(R[e]=n.buttons[a].pressed,!0===R[e]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"}))),a=2,void 0===P[e]&&(P[e]=!1),void 0!==n.buttons[a]&&P[e]!==n.buttons[a].pressed&&(P[e]=n.buttons[a].pressed,!0===P[e]?t.dispatchEvent({type:"squeezestart"}):(t.dispatchEvent({type:"squeezeend"}),t.dispatchEvent({type:"squeeze"})))}else t.visible=!1}}function o(e,t){null!==t&&4===t.length&&e.set(t[0]*s,t[1]*u,t[2]*s,t[3]*u)}var s,u,p=this,d=null,f=null,m=null,v=[],g=new h,y=new h,x=1,b="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(f=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",t,!1));var w=new h,_=new c,M=new l,T=new Z;T.viewport=new a,T.layers.enable(1);var E=new Z;E.viewport=new a,E.layers.enable(2);var S=new Yt([T,E]);S.layers.enable(1),S.layers.enable(2);var A,L=new n,R=[],P=[];this.enabled=!1,this.getController=function(e){var t=v[e];return void 0===t&&(t=new Xt,t.matrixAutoUpdate=!1,t.visible=!1,v[e]=t),t},this.getDevice=function(){return d},this.setDevice=function(e){void 0!==e&&(d=e),C.setContext(e)},this.setFramebufferScaleFactor=function(e){x=e},this.setReferenceSpaceType=function(e){b=e},this.setPoseTarget=function(e){void 0!==e&&(m=e)},this.getCamera=function(e){var t="local-floor"===b?1.6:0;if(d.depthNear=e.near,d.depthFar=e.far,d.getFrameData(f),"local-floor"===b){var n=d.stageParameters;n?g.fromArray(n.sittingToStandingTransform):g.makeTranslation(0,t,0)}var i=f.pose,a=null!==m?m:e;a.matrix.copy(g),a.matrix.decompose(a.position,a.quaternion,a.scale),null!==i.orientation&&(_.fromArray(i.orientation),a.quaternion.multiply(_)),null!==i.position&&(_.setFromRotationMatrix(g),M.fromArray(i.position),M.applyQuaternion(_),a.position.add(M)),a.updateMatrixWorld();for(var s=a.children,c=0,l=s.length;c<l;c++)s[c].updateMatrixWorld(!0);T.near=e.near,E.near=e.near,T.far=e.far,E.far=e.far,T.matrixWorldInverse.fromArray(f.leftViewMatrix),E.matrixWorldInverse.fromArray(f.rightViewMatrix),y.getInverse(g),"local-floor"===b&&(T.matrixWorldInverse.multiply(y),E.matrixWorldInverse.multiply(y));var h=a.parent;null!==h&&(w.getInverse(h.matrixWorld),T.matrixWorldInverse.multiply(w),E.matrixWorldInverse.multiply(w)),T.matrixWorld.getInverse(T.matrixWorldInverse),E.matrixWorld.getInverse(E.matrixWorldInverse),T.projectionMatrix.fromArray(f.leftProjectionMatrix),E.projectionMatrix.fromArray(f.rightProjectionMatrix),Zt(S,T,E);var u=d.getLayers();if(u.length){var p=u[0];o(T.viewport,p.leftBounds),o(E.viewport,p.rightBounds)}return r(),S},this.getStandingMatrix=function(){return g},this.isPresenting=!1;var C=new ee;this.setAnimationLoop=function(e){C.setAnimationLoop(e),this.isPresenting&&C.start()},this.submitFrame=function(){this.isPresenting&&d.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",t)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function Qt(e,t){function n(e){var t=y.get(e.inputSource);t&&(t.targetRay&&t.targetRay.dispatchEvent({type:e.type}),t.grip&&t.grip.dispatchEvent({type:e.type}))}function i(){y.forEach(function(e,t){e.targetRay&&(e.targetRay.dispatchEvent({type:"disconnected",data:t}),e.targetRay.visible=!1),e.grip&&(e.grip.dispatchEvent({type:"disconnected",data:t}),e.grip.visible=!1)}),y.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),A.stop(),u.isPresenting=!1,u.dispatchEvent({type:"sessionend"})}function r(e){d=e,A.setContext(p),A.start(),u.isPresenting=!0,u.dispatchEvent({type:"sessionstart"})}function o(e){for(var t=p.inputSources,n=0;n<g.length;n++)y.set(t[n],g[n]);for(var n=0;n<e.removed.length;n++){var i=e.removed[n],r=y.get(i);r&&(r.targetRay&&r.targetRay.dispatchEvent({type:"disconnected",data:i}),r.grip&&r.grip.dispatchEvent({type:"disconnected",data:i}),y.delete(i))}for(var n=0;n<e.added.length;n++){var i=e.added[n],r=y.get(i);r&&(r.targetRay&&r.targetRay.dispatchEvent({type:"connected",data:i}),r.grip&&r.grip.dispatchEvent({type:"connected",data:i}))}}function s(e,t,n){T.setFromMatrixPosition(t.matrixWorld),E.setFromMatrixPosition(n.matrixWorld);var i=T.distanceTo(E),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),c=(r[9]+1)/r[5],l=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(a[8]+1)/a[0],p=o*h,d=o*u,f=i/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=o+f,g=s+f,y=p-m,x=d+(i-m),b=c*s/g*v,w=l*s/g*v;e.projectionMatrix.makePerspective(y,x,b,w,v,g)}function c(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}function h(t,n){if(null!==(m=n.getViewerPose(d))){var i=m.views,r=p.renderState.baseLayer;e.setFramebuffer(r.framebuffer);for(var a=0;a<i.length;a++){var o=i[a],s=r.getViewport(o),c=w.cameras[a];c.matrix.fromArray(o.transform.matrix),c.projectionMatrix.fromArray(o.projectionMatrix),c.viewport.set(s.x,s.y,s.width,s.height),0===a&&w.matrix.copy(c.matrix)}}for(var l=p.inputSources,a=0;a<g.length;a++){var h=g[a],u=l[a],f=null,v=null;u&&(h.targetRay&&null!==(f=n.getPose(u.targetRaySpace,d))&&(h.targetRay.matrix.fromArray(f.transform.matrix),h.targetRay.matrix.decompose(h.targetRay.position,h.targetRay.rotation,h.targetRay.scale)),h.grip&&u.gripSpace&&null!==(v=n.getPose(u.gripSpace,d))&&(h.grip.matrix.fromArray(v.transform.matrix),h.grip.matrix.decompose(h.grip.position,h.grip.rotation,h.grip.scale))),h.targetRay&&(h.targetRay.visible=null!==f),h.grip&&(h.grip.visible=null!==v)}S&&S(t,n)}var u=this,p=null,d=null,f="local-floor",m=null,v=null,g=[],y=new Map,x=new Z;x.layers.enable(1),x.viewport=new a;var b=new Z;b.layers.enable(2),b.viewport=new a;var w=new Yt([x,b]);w.layers.enable(1),w.layers.enable(2);var _=null,M=null;this.enabled=!1,this.isPresenting=!1,this.getCameraPose=function(){return m},this.getController=function(e){var t=g[e];return void 0===t&&(t={},g[e]=t),void 0===t.targetRay&&(t.targetRay=new Xt,t.targetRay.matrixAutoUpdate=!1,t.targetRay.visible=!1),t.targetRay},this.getControllerGrip=function(e){var t=g[e];return void 0===t&&(t={},g[e]=t),void 0===t.grip&&(t.grip=new Xt,t.grip.matrixAutoUpdate=!1,t.grip.visible=!1),t.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){f=e},this.getReferenceSpace=function(){return d},this.getSession=function(){return p},this.setSession=function(e){if(null!==(p=e)){
- p.addEventListener("select",n),p.addEventListener("selectstart",n),p.addEventListener("selectend",n),p.addEventListener("squeeze",n),p.addEventListener("squeezestart",n),p.addEventListener("squeezeend",n),p.addEventListener("end",i);var a=t.getContextAttributes(),s={antialias:a.antialias,alpha:a.alpha,depth:a.depth,stencil:a.stencil},c=new XRWebGLLayer(p,t,s);p.updateRenderState({baseLayer:c}),p.requestReferenceSpace(f).then(r),p.addEventListener("inputsourceschange",o)}};var T=new l,E=new l;this.setPoseTarget=function(e){void 0!==e&&(v=e)},this.getCamera=function(e){w.near=b.near=x.near=e.near,w.far=b.far=x.far=e.far,_===w.near&&M===w.far||(p.updateRenderState({depthNear:w.near,depthFar:w.far}),_=w.near,M=w.far);var t=e.parent,n=w.cameras,i=v||e;c(w,t);for(var r=0;r<n.length;r++)c(n[r],t);i.matrixWorld.copy(w.matrixWorld);for(var a=i.children,r=0,o=a.length;r<o;r++)a[r].updateMatrixWorld(!0);return s(w,x,b),w};var S=null,A=new ee;A.setAnimationLoop(h),this.setAnimationLoop=function(e){S=e},this.dispose=function(){},this.submitFrame=function(){}}function Kt(e){function t(){return null===ve?Ae:1}function i(){Ge=new ce(J),He=new oe(J,Ge,e),!1===He.isWebGL2&&(Ge.get("WEBGL_depth_texture"),Ge.get("OES_texture_float"),Ge.get("OES_texture_half_float"),Ge.get("OES_texture_half_float_linear"),Ge.get("OES_standard_derivatives"),Ge.get("OES_element_index_uint"),Ge.get("ANGLE_instanced_arrays")),Ge.get("OES_texture_float_linear"),nt=new kt(J,Ge,He),Ve=new Vt(J,Ge,He),Ve.scissor(Me.copy(Ce).multiplyScalar(Ae).floor()),Ve.viewport(_e.copy(Pe).multiplyScalar(Ae).floor()),je=new ue(J),ke=new Rt,We=new jt(J,Ge,Ve,ke,He,nt,je),qe=new te(J,He),Xe=new le(J,qe,je),Ye=new fe(J,Xe,qe,je),$e=new de(J),Ze=new Lt(Q,Ge,He),Je=new Dt,Qe=new Ft,Ke=new re(Q,Ve,Ye,k),et=new ae(J,Ge,je,He),tt=new he(J,Ge,je,He),je.programs=Ze.programs,Q.capabilities=He,Q.extensions=Ge,Q.properties=ke,Q.renderLists=Je,Q.state=Ve,Q.info=je}function r(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),ne=!0}function o(){console.log("THREE.WebGLRenderer: Context Restored."),ne=!1,i()}function s(e){var t=e.target;t.removeEventListener("dispose",s),c(t)}function c(e){u(e),ke.remove(e)}function u(e){var t=ke.get(e).program;e.program=void 0,void 0!==t&&Ze.releaseProgram(t)}function p(e,t){e.render(function(e){Q.renderBufferImmediate(e,t)})}function d(e,t,n,i){if(!1!==He.isWebGL2||!e.isInstancedMesh&&!t.isInstancedBufferGeometry||null!==Ge.get("ANGLE_instanced_arrays")){Ve.initAttributes();var r=t.attributes,a=i.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=r[s];if(void 0!==l){var h=l.normalized,u=l.itemSize,p=qe.get(l);if(void 0===p)continue;var d=p.buffer,f=p.type,m=p.bytesPerElement;if(l.isInterleavedBufferAttribute){var v=l.data,g=v.stride,y=l.offset;v&&v.isInstancedInterleavedBuffer?(Ve.enableAttributeAndDivisor(c,v.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=v.meshPerAttribute*v.count)):Ve.enableAttribute(c),J.bindBuffer(34962,d),J.vertexAttribPointer(c,u,f,h,g*m,y*m)}else l.isInstancedBufferAttribute?(Ve.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=l.meshPerAttribute*l.count)):Ve.enableAttribute(c),J.bindBuffer(34962,d),J.vertexAttribPointer(c,u,f,h,0,0)}else if("instanceMatrix"===s){var p=qe.get(e.instanceMatrix);if(void 0===p)continue;var d=p.buffer,f=p.type;Ve.enableAttributeAndDivisor(c+0,1),Ve.enableAttributeAndDivisor(c+1,1),Ve.enableAttributeAndDivisor(c+2,1),Ve.enableAttributeAndDivisor(c+3,1),J.bindBuffer(34962,d),J.vertexAttribPointer(c+0,4,f,!1,64,0),J.vertexAttribPointer(c+1,4,f,!1,64,16),J.vertexAttribPointer(c+2,4,f,!1,64,32),J.vertexAttribPointer(c+3,4,f,!1,64,48)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:J.vertexAttrib2fv(c,x);break;case 3:J.vertexAttrib3fv(c,x);break;case 4:J.vertexAttrib4fv(c,x);break;default:J.vertexAttrib1fv(c,x)}}}}Ve.disableUnusedAttributes()}}function m(e){it.isPresenting||ct&&ct(e)}function v(e,t,n,i){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)Z.pushLight(e),e.castShadow&&Z.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||De.intersectsSprite(e)){i&&Fe.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ze);var r=Ye.update(e),a=e.material;a.visible&&Y.push(e,r,a,n,Fe.z,null)}}else if(e.isImmediateRenderObject)i&&Fe.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ze),Y.push(e,null,e.material,n,Fe.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==je.render.frame&&(e.skeleton.update(),e.skeleton.frame=je.render.frame),!e.frustumCulled||De.intersectsObject(e))){i&&Fe.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ze);var r=Ye.update(e),a=e.material;if(Array.isArray(a))for(var o=r.groups,s=0,c=o.length;s<c;s++){var l=o[s],h=a[l.materialIndex];h&&h.visible&&Y.push(e,r,h,n,Fe.z,l)}else a.visible&&Y.push(e,r,a,n,Fe.z,null)}for(var u=e.children,s=0,c=u.length;s<c;s++)v(u[s],t,n,i)}}function g(e,t,n,i){for(var r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,c=o.geometry,l=void 0===i?o.material:i,h=o.group;if(n.isArrayCamera)if(we=n,it.enabled&&at.isAvailable())y(s,t,n,c,l,h);else for(var u=n.cameras,p=0,d=u.length;p<d;p++){var f=u[p];s.layers.test(f.layers)&&(Ve.viewport(_e.copy(f.viewport)),Z.setupLights(f),y(s,t,f,c,l,h))}else we=null,y(s,t,n,c,l,h)}}function y(e,t,n,i,r,a){if(e.onBeforeRender(Q,t,n,i,r,a),Z=Qe.get(t,we||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=b(n,t,r,e);Ve.setMaterial(r),xe.geometry=null,xe.program=null,xe.wireframe=!1,p(e,o)}else Q.renderBufferDirect(n,t,i,r,e,a);e.onAfterRender(Q,t,n,i,r,a),Z=Qe.get(t,we||n)}function x(e,t,n){var i=ke.get(e),r=Z.state.lights,a=Z.state.shadowsArray,o=r.state.version,c=Ze.getParameters(e,r.state,a,t,Ie.numPlanes,Ie.numIntersection,n),l=Ze.getProgramCacheKey(c),h=i.program,p=!0;if(void 0===h)e.addEventListener("dispose",s);else if(h.cacheKey!==l)u(e);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,p=!1;else{if(void 0!==c.shaderID)return;p=!1}p&&(h=Ze.acquireProgram(c,l),i.program=h,i.uniforms=c.uniforms,i.environment=e.isMeshStandardMaterial?t.environment:null,i.outputEncoding=Q.outputEncoding,e.program=h);var d=h.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var f=0;f<Q.maxMorphTargets;f++)d["morphTarget"+f]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(var f=0;f<Q.maxMorphNormals;f++)d["morphNormal"+f]>=0&&e.numSupportedMorphNormals++}var m=i.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(i.numClippingPlanes=Ie.numPlanes,i.numIntersection=Ie.numIntersection,m.clippingPlanes=Ie.uniform),i.fog=t.fog,i.needsLights=z(e),i.lightsStateVersion=o,i.needsLights&&(m.ambientLightColor.value=r.state.ambient,m.lightProbe.value=r.state.probe,m.directionalLights.value=r.state.directional,m.spotLights.value=r.state.spot,m.rectAreaLights.value=r.state.rectArea,m.pointLights.value=r.state.point,m.hemisphereLights.value=r.state.hemi,m.directionalShadowMap.value=r.state.directionalShadowMap,m.directionalShadowMatrix.value=r.state.directionalShadowMatrix,m.spotShadowMap.value=r.state.spotShadowMap,m.spotShadowMatrix.value=r.state.spotShadowMatrix,m.pointShadowMap.value=r.state.pointShadowMap,m.pointShadowMatrix.value=r.state.pointShadowMatrix);var v=i.program.getUniforms(),g=rt.seqWithValue(v.seq,m);i.uniformsList=g}function b(e,t,n,i){We.resetTextureUnits();var r=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=ke.get(n),s=Z.state.lights;if(Ne&&(Be||e!==be)){var c=e===be&&n.id===ye;Ie.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,o,c)}n.version===o.__version?void 0===o.program?x(n,t,i):n.fog&&o.fog!==r?x(n,t,i):o.environment!==a?x(n,t,i):o.needsLights&&o.lightsStateVersion!==s.state.version?x(n,t,i):void 0===o.numClippingPlanes||o.numClippingPlanes===Ie.numPlanes&&o.numIntersection===Ie.numIntersection?o.outputEncoding!==Q.outputEncoding&&x(n,t,i):x(n,t,i):(x(n,t,i),o.__version=n.version);var l=!1,h=!1,u=!1,p=o.program,d=p.getUniforms(),f=o.uniforms;if(Ve.useProgram(p.program)&&(l=!0,h=!0,u=!0),n.id!==ye&&(ye=n.id,h=!0),l||be!==e){if(p.numMultiviewViews>0?at.updateCameraProjectionMatricesUniform(e,d):d.setValue(J,"projectionMatrix",e.projectionMatrix),He.logarithmicDepthBuffer&&d.setValue(J,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),be!==e&&(be=e,h=!0,u=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var m=d.map.cameraPosition;void 0!==m&&m.setValue(J,Fe.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&d.setValue(J,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(p.numMultiviewViews>0?at.updateCameraViewMatricesUniform(e,d):d.setValue(J,"viewMatrix",e.matrixWorldInverse))}if(n.skinning){d.setOptional(J,i,"bindMatrix"),d.setOptional(J,i,"bindMatrixInverse");var v=i.skeleton;if(v){var g=v.bones;if(He.floatVertexTextures){if(void 0===v.boneTexture){var y=Math.sqrt(4*g.length);y=Tl.ceilPowerOfTwo(y),y=Math.max(y,4);var b=new Float32Array(y*y*4);b.set(v.boneMatrices);var z=new K(b,y,y,Mc,mc);v.boneMatrices=b,v.boneTexture=z,v.boneTextureSize=y}d.setValue(J,"boneTexture",v.boneTexture,We),d.setValue(J,"boneTextureSize",v.boneTextureSize)}else d.setOptional(J,v,"boneMatrices")}}return(h||o.receiveShadow!==i.receiveShadow)&&(o.receiveShadow=i.receiveShadow,d.setValue(J,"receiveShadow",i.receiveShadow)),h&&(d.setValue(J,"toneMappingExposure",Q.toneMappingExposure),d.setValue(J,"toneMappingWhitePoint",Q.toneMappingWhitePoint),o.needsLights&&B(f,u),r&&n.fog&&S(f,r),n.isMeshBasicMaterial?w(f,n):n.isMeshLambertMaterial?(w(f,n),A(f,n)):n.isMeshToonMaterial?(w(f,n),R(f,n)):n.isMeshPhongMaterial?(w(f,n),L(f,n)):n.isMeshStandardMaterial?(w(f,n,a),n.isMeshPhysicalMaterial?C(f,n,a):P(f,n,a)):n.isMeshMatcapMaterial?(w(f,n),O(f,n)):n.isMeshDepthMaterial?(w(f,n),D(f,n)):n.isMeshDistanceMaterial?(w(f,n),I(f,n)):n.isMeshNormalMaterial?(w(f,n),N(f,n)):n.isLineBasicMaterial?(_(f,n),n.isLineDashedMaterial&&M(f,n)):n.isPointsMaterial?T(f,n):n.isSpriteMaterial?E(f,n):n.isShadowMaterial&&(f.color.value.copy(n.color),f.opacity.value=n.opacity),void 0!==f.ltc_1&&(f.ltc_1.value=bu.LTC_1),void 0!==f.ltc_2&&(f.ltc_2.value=bu.LTC_2),rt.upload(J,o.uniformsList,f,We),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(rt.upload(J,o.uniformsList,f,We),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&d.setValue(J,"center",i.center),p.numMultiviewViews>0?at.updateObjectMatricesUniforms(i,e,d):(d.setValue(J,"modelViewMatrix",i.modelViewMatrix),d.setValue(J,"normalMatrix",i.normalMatrix)),d.setValue(J,"modelMatrix",i.matrixWorld),p}function w(e,t,n){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap);var i=t.envMap||n;i&&(e.envMap.value=i,e.flipEnvMap.value=i.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=ke.get(i).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity);var r;t.map?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix));var a;t.aoMap?a=t.aoMap:t.lightMap&&(a=t.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),e.uv2Transform.value.copy(a.matrix))}function _(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}function M(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function T(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*Ae,e.scale.value=.5*Se,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function E(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function S(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}function A(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function L(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===is&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===is&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function R(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===is&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===is&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function P(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===is&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===is&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}function C(e,t,n){P(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===is&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}function O(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===is&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===is&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function D(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function I(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}function N(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===is&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===is&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function B(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function z(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}e=e||{};var F=void 0!==e.canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),U=void 0!==e.context?e.context:null,G=void 0!==e.alpha&&e.alpha,H=void 0===e.depth||e.depth,V=void 0===e.stencil||e.stencil,j=void 0!==e.antialias&&e.antialias,k=void 0===e.premultipliedAlpha||e.premultipliedAlpha,W=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,q=void 0!==e.powerPreference?e.powerPreference:"default",X=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,Y=null,Z=null;this.domElement=F,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ol,this.physicallyCorrectLights=!1,this.toneMapping=Vs,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var J,Q=this,ne=!1,ie=null,pe=0,me=0,ve=null,ge=null,ye=-1,xe={geometry:null,program:null,wireframe:!1},be=null,we=null,_e=new a,Me=new a,Te=null,Ee=F.width,Se=F.height,Ae=1,Le=null,Re=null,Pe=new a(0,0,Ee,Se),Ce=new a(0,0,Ee,Se),Oe=!1,De=new $,Ie=new se,Ne=!1,Be=!1,ze=new h,Fe=new l;try{var Ue={alpha:G,depth:H,stencil:V,antialias:j,premultipliedAlpha:k,preserveDrawingBuffer:W,powerPreference:q,failIfMajorPerformanceCaveat:X,xrCompatible:!0};if(F.addEventListener("webglcontextlost",r,!1),F.addEventListener("webglcontextrestored",o,!1),null===(J=U||F.getContext("webgl",Ue)||F.getContext("experimental-webgl",Ue)))throw null!==F.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===J.getShaderPrecisionFormat&&(J.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}var Ge,He,Ve,je,ke,We,qe,Xe,Ye,Ze,Je,Qe,Ke,$e,et,tt,nt;i();var it="undefined"!=typeof navigator&&"xr"in navigator?new Qt(Q,J):new Jt(Q);this.xr=it;var at=new qt(Q,J),ot=new Ht(Q,Ye,He.maxTextureSize);this.shadowMap=ot,this.getContext=function(){return J},this.getContextAttributes=function(){return J.getContextAttributes()},this.forceContextLoss=function(){var e=Ge.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=Ge.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return Ae},this.setPixelRatio=function(e){void 0!==e&&(Ae=e,this.setSize(Ee,Se,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new n),e.set(Ee,Se)},this.setSize=function(e,t,n){if(it.isPresenting)return void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");Ee=e,Se=t,F.width=Math.floor(e*Ae),F.height=Math.floor(t*Ae),!1!==n&&(F.style.width=e+"px",F.style.height=t+"px"),this.setViewport(0,0,e,t)},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new n),e.set(Ee*Ae,Se*Ae).floor()},this.setDrawingBufferSize=function(e,t,n){Ee=e,Se=t,Ae=n,F.width=Math.floor(e*n),F.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new a),e.copy(_e)},this.getViewport=function(e){return e.copy(Pe)},this.setViewport=function(e,t,n,i){e.isVector4?Pe.set(e.x,e.y,e.z,e.w):Pe.set(e,t,n,i),Ve.viewport(_e.copy(Pe).multiplyScalar(Ae).floor())},this.getScissor=function(e){return e.copy(Ce)},this.setScissor=function(e,t,n,i){e.isVector4?Ce.set(e.x,e.y,e.z,e.w):Ce.set(e,t,n,i),Ve.scissor(Me.copy(Ce).multiplyScalar(Ae).floor())},this.getScissorTest=function(){return Oe},this.setScissorTest=function(e){Ve.setScissorTest(Oe=e)},this.setOpaqueSort=function(e){Le=e},this.setTransparentSort=function(e){Re=e},this.getClearColor=function(){return Ke.getClearColor()},this.setClearColor=function(){Ke.setClearColor.apply(Ke,arguments)},this.getClearAlpha=function(){return Ke.getClearAlpha()},this.setClearAlpha=function(){Ke.setClearAlpha.apply(Ke,arguments)},this.clear=function(e,t,n){var i=0;(void 0===e||e)&&(i|=16384),(void 0===t||t)&&(i|=256),(void 0===n||n)&&(i|=1024),J.clear(i)},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.dispose=function(){F.removeEventListener("webglcontextlost",r,!1),F.removeEventListener("webglcontextrestored",o,!1),Je.dispose(),Qe.dispose(),ke.dispose(),Ye.dispose(),it.dispose(),lt.stop()},this.renderBufferImmediate=function(e,t){Ve.initAttributes();var n=ke.get(e);e.hasPositions&&!n.position&&(n.position=J.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=J.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=J.createBuffer()),e.hasColors&&!n.color&&(n.color=J.createBuffer());var i=t.getAttributes();e.hasPositions&&(J.bindBuffer(34962,n.position),J.bufferData(34962,e.positionArray,35048),Ve.enableAttribute(i.position),J.vertexAttribPointer(i.position,3,5126,!1,0,0)),e.hasNormals&&(J.bindBuffer(34962,n.normal),J.bufferData(34962,e.normalArray,35048),Ve.enableAttribute(i.normal),J.vertexAttribPointer(i.normal,3,5126,!1,0,0)),e.hasUvs&&(J.bindBuffer(34962,n.uv),J.bufferData(34962,e.uvArray,35048),Ve.enableAttribute(i.uv),J.vertexAttribPointer(i.uv,2,5126,!1,0,0)),e.hasColors&&(J.bindBuffer(34962,n.color),J.bufferData(34962,e.colorArray,35048),Ve.enableAttribute(i.color),J.vertexAttribPointer(i.color,3,5126,!1,0,0)),Ve.disableUnusedAttributes(),J.drawArrays(4,0,e.count),e.count=0};var st=new f;this.renderBufferDirect=function(e,n,i,r,a,o){null===n&&(n=st);var s=a.isMesh&&a.matrixWorld.determinant()<0,c=b(e,n,r,a);Ve.setMaterial(r,s);var l=!1;xe.geometry===i.id&&xe.program===c.id&&xe.wireframe===(!0===r.wireframe)||(xe.geometry=i.id,xe.program=c.id,xe.wireframe=!0===r.wireframe,l=!0),(r.morphTargets||r.morphNormals)&&($e.update(a,i,r,c),l=!0);var h=i.index,u=i.attributes.position;if(null===h){if(void 0===u||0===u.count)return}else if(0===h.count)return;var p=1;!0===r.wireframe&&(h=Xe.getWireframeAttribute(i),p=2);var f,m=et;null!==h&&(f=qe.get(h),m=tt,m.setIndex(f)),l&&(d(a,i,r,c),null!==h&&J.bindBuffer(34963,f.buffer));var v=null!==h?h.count:u.count,g=i.drawRange.start*p,y=i.drawRange.count*p,x=null!==o?o.start*p:0,w=null!==o?o.count*p:1/0,_=Math.max(g,x),M=Math.min(v,g+y,x+w)-1,T=Math.max(0,M-_+1);if(0!==T){if(a.isMesh)!0===r.wireframe?(Ve.setLineWidth(r.wireframeLinewidth*t()),m.setMode(1)):m.setMode(4);else if(a.isLine){var E=r.linewidth;void 0===E&&(E=1),Ve.setLineWidth(E*t()),a.isLineSegments?m.setMode(1):a.isLineLoop?m.setMode(2):m.setMode(3)}else a.isPoints?m.setMode(0):a.isSprite&&m.setMode(4);a.isInstancedMesh?m.renderInstances(i,_,T,a.count):i.isInstancedBufferGeometry?m.renderInstances(i,_,T,i.maxInstancedCount):m.render(_,T)}},this.compile=function(e,t){Z=Qe.get(e,t),Z.init(),e.traverse(function(e){e.isLight&&(Z.pushLight(e),e.castShadow&&Z.pushShadow(e))}),Z.setupLights(t);var n={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var i=0;i<t.material.length;i++)t.material[i].uuid in n==!1&&(x(t.material[i],e,t),n[t.material[i].uuid]=!0);else t.material.uuid in n==!1&&(x(t.material,e,t),n[t.material.uuid]=!0)})};var ct=null,lt=new ee;lt.setAnimationLoop(m),"undefined"!=typeof window&<.setContext(window),this.setAnimationLoop=function(e){ct=e,it.setAnimationLoop(e),lt.start()},this.render=function(e,t){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),!t||!t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!ne){xe.geometry=null,xe.program=null,xe.wireframe=!1,ye=-1,be=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),it.enabled&&it.isPresenting&&(t=it.getCamera(t)),Z=Qe.get(e,t),Z.init(),e.onBeforeRender(Q,e,t,n||ve),ze.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),De.setFromProjectionMatrix(ze),Be=this.localClippingEnabled,Ne=Ie.init(this.clippingPlanes,Be,t),Y=Je.get(e,t),Y.init(),v(e,t,0,Q.sortObjects),!0===Q.sortObjects&&Y.sort(Le,Re),Ne&&Ie.beginShadows();var r=Z.state.shadowsArray;ot.render(r,e,t),Z.setupLights(t),Ne&&Ie.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),it.enabled&&at.isAvailable()&&at.attachCamera(t),Ke.render(Y,e,t,i);var a=Y.opaque,o=Y.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&g(a,e,t,s),o.length&&g(o,e,t,s)}else a.length&&g(a,e,t),o.length&&g(o,e,t);e.onAfterRender(Q,e,t),null!==ve&&(We.updateRenderTargetMipmap(ve),We.updateMultisampleRenderTarget(ve)),Ve.buffers.depth.setTest(!0),Ve.buffers.depth.setMask(!0),Ve.buffers.color.setMask(!0),Ve.setPolygonOffset(!1),it.enabled&&(at.isAvailable()&&at.detachCamera(t),it.submitFrame()),Y=null,Z=null}},this.setTexture2D=function(){var e=!1;return function(t,n){t&&t.isWebGLRenderTarget&&(e||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),We.setTexture2D(t,n)}}(),this.setFramebuffer=function(e){ie!==e&&null===ve&&J.bindFramebuffer(36160,e),ie=e},this.getActiveCubeFace=function(){return pe},this.getActiveMipmapLevel=function(){return me},this.getRenderTarget=function(){return ve},this.setRenderTarget=function(e,t,n){ve=e,pe=t,me=n,e&&void 0===ke.get(e).__webglFramebuffer&&We.setupRenderTarget(e);var i=ie,r=!1;if(e){var a=ke.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=a[t||0],r=!0):i=e.isWebGLMultisampleRenderTarget?ke.get(e).__webglMultisampledFramebuffer:a,_e.copy(e.viewport),Me.copy(e.scissor),Te=e.scissorTest}else _e.copy(Pe).multiplyScalar(Ae).floor(),Me.copy(Ce).multiplyScalar(Ae).floor(),Te=Oe;if(ge!==i&&(J.bindFramebuffer(36160,i),ge=i),Ve.viewport(_e),Ve.scissor(Me),Ve.setScissorTest(Te),r){var o=ke.get(e.texture);J.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,i,r,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var s=ke.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var c=!1;s!==ge&&(J.bindFramebuffer(36160,s),c=!0);try{var l=e.texture,h=l.format,u=l.type;if(h!==Mc&&nt.convert(h)!==J.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u===lc||nt.convert(u)===J.getParameter(35738)||u===mc&&(He.isWebGL2||Ge.get("OES_texture_float")||Ge.get("WEBGL_color_buffer_float"))||u===vc&&(He.isWebGL2?Ge.get("EXT_color_buffer_float"):Ge.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===J.checkFramebufferStatus(36160)?t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&J.readPixels(t,n,i,r,nt.convert(h),nt.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&J.bindFramebuffer(36160,ge)}}},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(t.image.width*i),a=Math.floor(t.image.height*i),o=nt.convert(t.format);We.setTexture2D(t,0),J.copyTexImage2D(3553,n,o,e.x,e.y,r,a,0),Ve.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i){var r=t.image.width,a=t.image.height,o=nt.convert(n.format),s=nt.convert(n.type);We.setTexture2D(n,0),t.isDataTexture?J.texSubImage2D(3553,i||0,e.x,e.y,r,a,o,s,t.image.data):J.texSubImage2D(3553,i||0,e.x,e.y,o,s,t.image),Ve.unbindTexture()},this.initTexture=function(e){We.setTexture2D(e,0),Ve.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function $t(e,t){this.name="",this.color=new w(e),this.density=void 0!==t?t:25e-5}function en(e,t,n){this.name="",this.color=new w(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function tn(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=bl,this.updateRange={offset:0,count:-1},this.version=0}function nn(e,t,n,i){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}function rn(e){S.call(this),this.type="SpriteMaterial",this.color=new w(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}function an(e){if(d.call(this),this.type="Sprite",void 0===Vu){Vu=new G;var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new tn(t,5);Vu.setIndex([0,1,2,0,2,3]),Vu.setAttribute("position",new nn(i,3,0,!1)),Vu.setAttribute("uv",new nn(i,2,3,!1))}this.geometry=Vu,this.material=void 0!==e?e:new rn,this.center=new n(.5,.5)}function on(e,t,n,i,r,a){qu.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(Xu.x=a*qu.x-r*qu.y,Xu.y=r*qu.x+a*qu.y):Xu.copy(qu),e.copy(t),e.x+=Xu.x,e.y+=Xu.y,e.applyMatrix4(Yu)}function sn(){d.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function cn(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),H.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new h,this.bindMatrixInverse=new h}function ln(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new h)}}function hn(){d.call(this),this.type="Bone"}function un(e,t,n){H.call(this,e,t),this.instanceMatrix=new L(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function pn(e){S.call(this),this.type="LineBasicMaterial",this.color=new w(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}function dn(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),d.call(this),this.type="Line",this.geometry=void 0!==e?e:new G,
- this.material=void 0!==t?t:new pn}function fn(e,t){dn.call(this,e,t),this.type="LineSegments"}function mn(e,t){dn.call(this,e,t),this.type="LineLoop"}function vn(e){S.call(this),this.type="PointsMaterial",this.color=new w(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}function gn(e,t){d.call(this),this.type="Points",this.geometry=void 0!==e?e:new G,this.material=void 0!==t?t:new vn,this.updateMorphTargets()}function yn(e,t,n,i,r,a,o){var s=gp.distanceSqToPoint(e);if(s<n){var c=new l;gp.closestPointToPoint(e,c),c.applyMatrix4(i);var h=r.ray.origin.distanceTo(c);if(h<r.near||h>r.far)return;a.push({distance:h,distanceToRay:Math.sqrt(s),point:c,index:t,face:null,object:o})}}function xn(e,t,n,i,a,o,s,c,l){r.call(this,e,t,n,i,a,o,s,c,l),this.format=void 0!==s?s:_c,this.minFilter=void 0!==o?o:oc,this.magFilter=void 0!==a?a:oc,this.generateMipmaps=!1}function bn(e,t,n,i,a,o,s,c,l,h,u,p){r.call(this,null,o,s,c,l,h,i,a,u,p),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function wn(e,t,n,i,a,o,s,c,l){r.call(this,e,t,n,i,a,o,s,c,l),this.needsUpdate=!0}function _n(e,t,n,i,a,o,s,c,l,h){if((h=void 0!==h?h:Ac)!==Ac&&h!==Lc)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&h===Ac&&(n=pc),void 0===n&&h===Lc&&(n=bc),r.call(this,null,i,a,o,s,c,h,n,l),this.image={width:e,height:t},this.magFilter=void 0!==s?s:ic,this.minFilter=void 0!==c?c:ic,this.flipY=!1,this.generateMipmaps=!1}function Mn(e){G.call(this),this.type="WireframeGeometry";var t,n,i,r,a,o,s,c,h,u,p=[],d=[0,0],f={},m=["a","b","c"];if(e&&e.isGeometry){var v=e.faces;for(t=0,i=v.length;t<i;t++){var g=v[t];for(n=0;n<3;n++)s=g[m[n]],c=g[m[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),h=d[0]+","+d[1],void 0===f[h]&&(f[h]={index1:d[0],index2:d[1]})}for(h in f)o=f[h],u=e.vertices[o.index1],p.push(u.x,u.y,u.z),u=e.vertices[o.index2],p.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var y,x,b,w,_,M,T,E;if(u=new l,null!==e.index){for(y=e.attributes.position,x=e.index,b=e.groups,0===b.length&&(b=[{start:0,count:x.count,materialIndex:0}]),r=0,a=b.length;r<a;++r)for(w=b[r],_=w.start,M=w.count,t=_,i=_+M;t<i;t+=3)for(n=0;n<3;n++)s=x.getX(t+n),c=x.getX(t+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),h=d[0]+","+d[1],void 0===f[h]&&(f[h]={index1:d[0],index2:d[1]});for(h in f)o=f[h],u.fromBufferAttribute(y,o.index1),p.push(u.x,u.y,u.z),u.fromBufferAttribute(y,o.index2),p.push(u.x,u.y,u.z)}else for(y=e.attributes.position,t=0,i=y.count/3;t<i;t++)for(n=0;n<3;n++)T=3*t+n,u.fromBufferAttribute(y,T),p.push(u.x,u.y,u.z),E=3*t+(n+1)%3,u.fromBufferAttribute(y,E),p.push(u.x,u.y,u.z)}this.setAttribute("position",new B(p,3))}function Tn(e,t,n){k.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new En(e,t,n)),this.mergeVertices()}function En(e,t,n){G.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var i,r,a=[],o=[],s=[],c=[],h=new l,u=new l,p=new l,d=new l,f=new l;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=t+1;for(i=0;i<=n;i++){var v=i/n;for(r=0;r<=t;r++){var g=r/t;e(g,v,u),o.push(u.x,u.y,u.z),g-1e-5>=0?(e(g-1e-5,v,p),d.subVectors(u,p)):(e(g+1e-5,v,p),d.subVectors(p,u)),v-1e-5>=0?(e(g,v-1e-5,p),f.subVectors(u,p)):(e(g,v+1e-5,p),f.subVectors(p,u)),h.crossVectors(d,f).normalize(),s.push(h.x,h.y,h.z),c.push(g,v)}}for(i=0;i<n;i++)for(r=0;r<t;r++){var y=i*m+r,x=i*m+r+1,b=(i+1)*m+r+1,w=(i+1)*m+r;a.push(y,x,w),a.push(x,b,w)}this.setIndex(a),this.setAttribute("position",new B(o,3)),this.setAttribute("normal",new B(s,3)),this.setAttribute("uv",new B(c,2))}function Sn(e,t,n,i){k.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},this.fromBufferGeometry(new An(e,t,n,i)),this.mergeVertices()}function An(e,t,i,r){function a(e,t,n,i){var r,a,o=Math.pow(2,i),c=[];for(r=0;r<=o;r++){c[r]=[];var l=e.clone().lerp(n,r/o),h=t.clone().lerp(n,r/o),u=o-r;for(a=0;a<=u;a++)c[r][a]=0===a&&r===o?l:l.clone().lerp(h,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 e=0;e<m.length;e+=6){var t=m[e+0],n=m[e+2],i=m[e+4],r=Math.max(t,n,i),a=Math.min(t,n,i);r>.9&&a<.1&&(t<.2&&(m[e+0]+=1),n<.2&&(m[e+2]+=1),i<.2&&(m[e+4]+=1))}}function s(e){f.push(e.x,e.y,e.z)}function c(t,n){var i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function h(){for(var e=new l,t=new l,i=new l,r=new l,a=new n,o=new n,s=new n,c=0,h=0;c<f.length;c+=9,h+=6){e.set(f[c+0],f[c+1],f[c+2]),t.set(f[c+3],f[c+4],f[c+5]),i.set(f[c+6],f[c+7],f[c+8]),a.set(m[h+0],m[h+1]),o.set(m[h+2],m[h+3]),s.set(m[h+4],m[h+5]),r.copy(e).add(t).add(i).divideScalar(3);var d=p(r);u(a,h+0,e,d),u(o,h+2,t,d),u(s,h+4,i,d)}}function u(e,t,n,i){i<0&&1===e.x&&(m[t]=e.x-1),0===n.x&&0===n.z&&(m[t]=i/2/Math.PI+.5)}function p(e){return Math.atan2(e.z,-e.x)}function d(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}G.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r},i=i||1,r=r||0;var f=[],m=[];!function(e){for(var n=new l,i=new l,r=new l,o=0;o<t.length;o+=3)c(t[o+0],n),c(t[o+1],i),c(t[o+2],r),a(n,i,r,e)}(r),function(e){for(var t=new l,n=0;n<f.length;n+=3)t.x=f[n+0],t.y=f[n+1],t.z=f[n+2],t.normalize().multiplyScalar(e),f[n+0]=t.x,f[n+1]=t.y,f[n+2]=t.z}(i),function(){for(var e=new l,t=0;t<f.length;t+=3){e.x=f[t+0],e.y=f[t+1],e.z=f[t+2];var n=p(e)/2/Math.PI+.5,i=d(e)/Math.PI+.5;m.push(n,1-i)}h(),o()}(),this.setAttribute("position",new B(f,3)),this.setAttribute("normal",new B(f.slice(),3)),this.setAttribute("uv",new B(m,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Ln(e,t){k.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Rn(e,t)),this.mergeVertices()}function Rn(e,t){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];An.call(this,n,i,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Pn(e,t){k.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Cn(e,t)),this.mergeVertices()}function Cn(e,t){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];An.call(this,n,i,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function On(e,t){k.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Dn(e,t)),this.mergeVertices()}function Dn(e,t){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,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];An.call(this,i,r,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function In(e,t){k.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Nn(e,t)),this.mergeVertices()}function Nn(e,t){var n=(1+Math.sqrt(5))/2,i=1/n,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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],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];An.call(this,r,a,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Bn(e,t,n,i,r,a){k.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new zn(e,t,n,i,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function zn(e,t,i,r,a){function o(n){v=e.getPointAt(n/t,v);var a=h.normals[n],o=h.binormals[n];for(p=0;p<=r;p++){var s=p/r*Math.PI*2,c=Math.sin(s),l=-Math.cos(s);f.x=l*a.x+c*o.x,f.y=l*a.y+c*o.y,f.z=l*a.z+c*o.z,f.normalize(),y.push(f.x,f.y,f.z),d.x=v.x+i*f.x,d.y=v.y+i*f.y,d.z=v.z+i*f.z,g.push(d.x,d.y,d.z)}}function s(){for(p=1;p<=t;p++)for(u=1;u<=r;u++){var e=(r+1)*(p-1)+(u-1),n=(r+1)*p+(u-1),i=(r+1)*p+u,a=(r+1)*(p-1)+u;b.push(e,n,a),b.push(n,i,a)}}function c(){for(u=0;u<=t;u++)for(p=0;p<=r;p++)m.x=u/t,m.y=p/r,x.push(m.x,m.y)}G.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:a},t=t||64,i=i||1,r=r||8,a=a||!1;var h=e.computeFrenetFrames(t,a);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var u,p,d=new l,f=new l,m=new n,v=new l,g=[],y=[],x=[],b=[];!function(){for(u=0;u<t;u++)o(u);o(!1===a?t:0),c(),s()}(),this.setIndex(b),this.setAttribute("position",new B(g,3)),this.setAttribute("normal",new B(y,3)),this.setAttribute("uv",new B(x,2))}function Fn(e,t,n,i,r,a,o){k.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Un(e,t,n,i,r,a)),this.mergeVertices()}function Un(e,t,n,i,r,a){function o(e,t,n,i,r){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);r.x=i*(2+c)*.5*a,r.y=i*(2+c)*o*.5,r.z=i*Math.sin(s)*.5}G.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var s,c,h=[],u=[],p=[],d=[],f=new l,m=new l,v=new l,g=new l,y=new l,x=new l,b=new l;for(s=0;s<=n;++s){var w=s/n*r*Math.PI*2;for(o(w,r,a,e,v),o(w+.01,r,a,e,g),x.subVectors(g,v),b.addVectors(g,v),y.crossVectors(x,b),b.crossVectors(y,x),y.normalize(),b.normalize(),c=0;c<=i;++c){var _=c/i*Math.PI*2,M=-t*Math.cos(_),T=t*Math.sin(_);f.x=v.x+(M*b.x+T*y.x),f.y=v.y+(M*b.y+T*y.y),f.z=v.z+(M*b.z+T*y.z),u.push(f.x,f.y,f.z),m.subVectors(f,v).normalize(),p.push(m.x,m.y,m.z),d.push(s/n),d.push(c/i)}}for(c=1;c<=n;c++)for(s=1;s<=i;s++){var E=(i+1)*(c-1)+(s-1),S=(i+1)*c+(s-1),A=(i+1)*c+s,L=(i+1)*(c-1)+s;h.push(E,S,L),h.push(S,A,L)}this.setIndex(h),this.setAttribute("position",new B(u,3)),this.setAttribute("normal",new B(p,3)),this.setAttribute("uv",new B(d,2))}function Gn(e,t,n,i,r){k.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Hn(e,t,n,i,r)),this.mergeVertices()}function Hn(e,t,n,i,r){G.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},e=e||1,t=t||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var a,o,s=[],c=[],h=[],u=[],p=new l,d=new l,f=new l;for(a=0;a<=n;a++)for(o=0;o<=i;o++){var m=o/i*r,v=a/n*Math.PI*2;d.x=(e+t*Math.cos(v))*Math.cos(m),d.y=(e+t*Math.cos(v))*Math.sin(m),d.z=t*Math.sin(v),c.push(d.x,d.y,d.z),p.x=e*Math.cos(m),p.y=e*Math.sin(m),f.subVectors(d,p).normalize(),h.push(f.x,f.y,f.z),u.push(o/i),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var g=(i+1)*a+o-1,y=(i+1)*(a-1)+o-1,x=(i+1)*(a-1)+o,b=(i+1)*a+o;s.push(g,y,b),s.push(y,x,b)}this.setIndex(s),this.setAttribute("position",new B(c,3)),this.setAttribute("normal",new B(h,3)),this.setAttribute("uv",new B(u,2))}function Vn(e,t,n,i,r){var a,o;if(r===mi(e,t,n,i)>0)for(a=t;a<n;a+=i)o=pi(a,e[a],e[a+1],o);else for(a=n-i;a>=t;a-=i)o=pi(a,e[a],e[a+1],o);return o&&oi(o,o.next)&&(di(o),o=o.next),o}function jn(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!oi(i,i.next)&&0!==ai(i.prev,i,i.next))i=i.next;else{if(di(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function kn(e,t,n,i,r,a,o){if(e){!o&&a&&$n(e,i,r,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?qn(e,i,r,a):Wn(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),di(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?(e=Xn(e,t,n),kn(e,t,n,i,r,a,2)):2===o&&Yn(e,t,n,i,r,a):kn(jn(e),t,n,i,r,a,1);break}}}function Wn(e){var t=e.prev,n=e,i=e.next;if(ai(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(ii(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&ai(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function qn(e,t,n,i){var r=e.prev,a=e,o=e.next;if(ai(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,c=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,l=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,u=ti(s,c,t,n,i),p=ti(l,h,t,n,i),d=e.prevZ,f=e.nextZ;d&&d.z>=u&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&ii(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ai(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&ii(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&ai(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&ii(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ai(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&ii(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&ai(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Xn(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!oi(r,a)&&si(r,i,i.next,a)&&li(r,a)&&li(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),di(i),di(i.next),i=e=a),i=i.next}while(i!==e);return i}function Yn(e,t,n,i,r,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ri(o,s)){var c=ui(o,s);return o=jn(o,o.next),c=jn(c,c.next),kn(o,t,n,i,r,a),void kn(c,t,n,i,r,a)}s=s.next}o=o.next}while(o!==e)}function Zn(e,t,n,i){var r,a,o,s,c,l=[];for(r=0,a=t.length;r<a;r++)o=t[r]*i,s=r<a-1?t[r+1]*i:e.length,c=Vn(e,o,s,i,!1),c===c.next&&(c.steiner=!0),l.push(ni(c));for(l.sort(Jn),r=0;r<l.length;r++)Qn(l[r],n),n=jn(n,n.next);return n}function Jn(e,t){return e.x-t.x}function Qn(e,t){if(t=Kn(e,t)){var n=ui(t,e);jn(n,n.next)}}function Kn(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===o)return n.prev;var c,l=n,h=n.x,u=n.y,p=1/0;for(i=n.next;i!==l;)r>=i.x&&i.x>=h&&r!==i.x&&ii(a<u?r:o,a,h,u,a<u?o:r,a,i.x,i.y)&&((c=Math.abs(a-i.y)/(r-i.x))<p||c===p&&i.x>n.x)&&li(i,e)&&(n=i,p=c),i=i.next;return n}function $n(e,t,n,i){var r=e;do{null===r.z&&(r.z=ti(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,ei(r)}function ei(e){var t,n,i,r,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t<l&&(s++,i=i.nextZ);t++);for(c=l;s>0||c>0&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,l*=2}while(o>1);return e}function ti(e,t,n,i,r){return e=32767*(e-n)*r,t=32767*(t-i)*r,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function ni(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function ii(e,t,n,i,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function ri(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!ci(e,t)&&li(e,t)&&li(t,e)&&hi(e,t)}function ai(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function oi(e,t){return e.x===t.x&&e.y===t.y}function si(e,t,n,i){return!!(oi(e,n)&&oi(t,i)||oi(e,i)&&oi(n,t))||ai(e,t,n)>0!=ai(e,t,i)>0&&ai(n,i,e)>0!=ai(n,i,t)>0}function ci(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&si(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function li(e,t){return ai(e.prev,e,e.next)<0?ai(e,t,e.next)>=0&&ai(e,e.prev,t)>=0:ai(e,t,e.prev)<0||ai(e,e.next,t)<0}function hi(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}function ui(e,t){var n=new fi(e.i,e.x,e.y),i=new fi(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function pi(e,t,n,i){var r=new fi(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function di(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function fi(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function mi(e,t,n,i){for(var r=0,a=t,o=n-i;a<n;a+=i)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}function vi(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function gi(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function yi(e,t){k.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new xi(e,t)),this.mergeVertices()}function xi(e,t){G.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var i=this,r=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];!function(e){function o(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}function s(e,t,i){var r,a,o,s=e.x-t.x,c=e.y-t.y,l=i.x-e.x,h=i.y-e.y,u=s*s+c*c,p=s*h-c*l;if(Math.abs(p)>Number.EPSILON){var d=Math.sqrt(u),f=Math.sqrt(l*l+h*h),m=t.x-c/d,v=t.y+s/d,g=i.x-h/f,y=i.y+l/f,x=((g-m)*h-(y-v)*l)/(s*h-c*l);r=m+s*x-e.x,a=v+c*x-e.y;var b=r*r+a*a;if(b<=2)return new n(r,a);o=Math.sqrt(b/2)}else{var w=!1;s>Number.EPSILON?l>Number.EPSILON&&(w=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(w=!0):Math.sign(c)===Math.sign(h)&&(w=!0),w?(r=-c,a=s,o=Math.sqrt(u)):(r=s,a=c,o=Math.sqrt(u/2))}return new n(r/o,a/o)}function c(e,t){var n,i;for(Z=e.length;--Z>=0;){n=Z,(i=Z-1)<0&&(i=e.length-1);var r=0,a=g+2*M;for(r=0;r<a;r++){var o=q*r,s=q*(r+1);p(t+n+o,t+i+o,t+i+s,t+n+s)}}}function h(e,t,n){m.push(e),m.push(t),m.push(n)}function u(e,t,n){d(e),d(t),d(n);var a=r.length/3,o=E.generateTopUV(i,r,a-3,a-2,a-1);f(o[0]),f(o[1]),f(o[2])}function p(e,t,n,a){d(e),d(t),d(a),d(t),d(n),d(a);var o=r.length/3,s=E.generateSideWallUV(i,r,o-6,o-3,o-2,o-1);f(s[0]),f(s[1]),f(s[3]),f(s[1]),f(s[2]),f(s[3])}function d(e){r.push(m[3*e+0]),r.push(m[3*e+1]),r.push(m[3*e+2])}function f(e){a.push(e.x),a.push(e.y)}var m=[],v=void 0!==t.curveSegments?t.curveSegments:12,g=void 0!==t.steps?t.steps:1,y=void 0!==t.depth?t.depth:100,x=void 0===t.bevelEnabled||t.bevelEnabled,b=void 0!==t.bevelThickness?t.bevelThickness:6,w=void 0!==t.bevelSize?t.bevelSize:b-2,_=void 0!==t.bevelOffset?t.bevelOffset:0,M=void 0!==t.bevelSegments?t.bevelSegments:3,T=t.extrudePath,E=void 0!==t.UVGenerator?t.UVGenerator:_p;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),y=t.amount);var S,A,L,R,P,C=!1;T&&(S=T.getSpacedPoints(g),C=!0,x=!1,A=T.computeFrenetFrames(g,!1),L=new l,R=new l,P=new l),x||(M=0,b=0,w=0,_=0);var O,D,I,N=e.extractPoints(v),B=N.shape,z=N.holes;if(!wp.isClockWise(B))for(B=B.reverse(),D=0,I=z.length;D<I;D++)O=z[D],wp.isClockWise(O)&&(z[D]=O.reverse());var F=wp.triangulateShape(B,z),U=B;for(D=0,I=z.length;D<I;D++)O=z[D],B=B.concat(O);for(var G,H,V,j,k,W,q=B.length,X=F.length,Y=[],Z=0,J=U.length,Q=J-1,K=Z+1;Z<J;Z++,Q++,K++)Q===J&&(Q=0),K===J&&(K=0),Y[Z]=s(U[Z],U[Q],U[K]);var $,ee=[],te=Y.concat();for(D=0,I=z.length;D<I;D++){for(O=z[D],$=[],Z=0,J=O.length,Q=J-1,K=Z+1;Z<J;Z++,Q++,K++)Q===J&&(Q=0),K===J&&(K=0),$[Z]=s(O[Z],O[Q],O[K]);ee.push($),te=te.concat($)}for(G=0;G<M;G++){for(V=G/M,j=b*Math.cos(V*Math.PI/2),H=w*Math.sin(V*Math.PI/2)+_,Z=0,J=U.length;Z<J;Z++)k=o(U[Z],Y[Z],H),h(k.x,k.y,-j);for(D=0,I=z.length;D<I;D++)for(O=z[D],$=ee[D],Z=0,J=O.length;Z<J;Z++)k=o(O[Z],$[Z],H),h(k.x,k.y,-j)}for(H=w+_,Z=0;Z<q;Z++)k=x?o(B[Z],te[Z],H):B[Z],C?(R.copy(A.normals[0]).multiplyScalar(k.x),L.copy(A.binormals[0]).multiplyScalar(k.y),P.copy(S[0]).add(R).add(L),h(P.x,P.y,P.z)):h(k.x,k.y,0);var ne;for(ne=1;ne<=g;ne++)for(Z=0;Z<q;Z++)k=x?o(B[Z],te[Z],H):B[Z],C?(R.copy(A.normals[ne]).multiplyScalar(k.x),L.copy(A.binormals[ne]).multiplyScalar(k.y),P.copy(S[ne]).add(R).add(L),h(P.x,P.y,P.z)):h(k.x,k.y,y/g*ne);for(G=M-1;G>=0;G--){for(V=G/M,j=b*Math.cos(V*Math.PI/2),H=w*Math.sin(V*Math.PI/2)+_,Z=0,J=U.length;Z<J;Z++)k=o(U[Z],Y[Z],H),h(k.x,k.y,y+j);for(D=0,I=z.length;D<I;D++)for(O=z[D],$=ee[D],Z=0,J=O.length;Z<J;Z++)k=o(O[Z],$[Z],H),C?h(k.x,k.y+S[g-1].y,S[g-1].x+j):h(k.x,k.y,y+j)}!function(){var e=r.length/3;if(x){var t=0,n=q*t;for(Z=0;Z<X;Z++)W=F[Z],u(W[2]+n,W[1]+n,W[0]+n);for(t=g+2*M,n=q*t,Z=0;Z<X;Z++)W=F[Z],u(W[0]+n,W[1]+n,W[2]+n)}else{for(Z=0;Z<X;Z++)W=F[Z],u(W[2],W[1],W[0]);for(Z=0;Z<X;Z++)W=F[Z],u(W[0]+q*g,W[1]+q*g,W[2]+q*g)}i.addGroup(e,r.length/3-e,0)}(),function(){var e=r.length/3,t=0;for(c(U,t),t+=U.length,D=0,I=z.length;D<I;D++)O=z[D],c(O,t),t+=O.length;i.addGroup(e,r.length/3-e,1)}()}(c)}this.setAttribute("position",new B(r,3)),this.setAttribute("uv",new B(a,2)),this.computeVertexNormals()}function bi(e,t,n){if(n.shapes=[],Array.isArray(e))for(var i=0,r=e.length;i<r;i++){var a=e[i];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function wi(e,t){k.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new _i(e,t)),this.mergeVertices()}function _i(e,t){t=t||{};var n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new k;var i=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),xi.call(this,i,t),this.type="TextBufferGeometry"}function Mi(e,t,n,i,r,a,o){k.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Ti(e,t,n,i,r,a,o)),this.mergeVertices()}function Ti(e,t,n,i,r,a,o){G.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,c,h=Math.min(a+o,Math.PI),u=0,p=[],d=new l,f=new l,m=[],v=[],g=[],y=[];for(c=0;c<=n;c++){var x=[],b=c/n,w=0;for(0==c&&0==a?w=.5/t:c==n&&h==Math.PI&&(w=-.5/t),s=0;s<=t;s++){var _=s/t;d.x=-e*Math.cos(i+_*r)*Math.sin(a+b*o),d.y=e*Math.cos(a+b*o),d.z=e*Math.sin(i+_*r)*Math.sin(a+b*o),v.push(d.x,d.y,d.z),f.copy(d).normalize(),g.push(f.x,f.y,f.z),y.push(_+w,1-b),x.push(u++)}p.push(x)}for(c=0;c<n;c++)for(s=0;s<t;s++){var M=p[c][s+1],T=p[c][s],E=p[c+1][s],S=p[c+1][s+1];(0!==c||a>0)&&m.push(M,T,S),(c!==n-1||h<Math.PI)&&m.push(T,E,S)}this.setIndex(m),this.setAttribute("position",new B(v,3)),this.setAttribute("normal",new B(g,3)),this.setAttribute("uv",new B(y,2))}function Ei(e,t,n,i,r,a){k.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new Si(e,t,n,i,r,a)),this.mergeVertices()}function Si(e,t,i,r,a,o){G.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:o},e=e||.5,t=t||1,a=void 0!==a?a:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8,r=void 0!==r?Math.max(1,r):1;var s,c,h,u=[],p=[],d=[],f=[],m=e,v=(t-e)/r,g=new l,y=new n;for(c=0;c<=r;c++){for(h=0;h<=i;h++)s=a+h/i*o,g.x=m*Math.cos(s),g.y=m*Math.sin(s),p.push(g.x,g.y,g.z),d.push(0,0,1),y.x=(g.x/t+1)/2,y.y=(g.y/t+1)/2,f.push(y.x,y.y);m+=v}for(c=0;c<r;c++){var x=c*(i+1);for(h=0;h<i;h++){s=h+x;var b=s,w=s+i+1,_=s+i+2,M=s+1;u.push(b,w,M),u.push(w,_,M)}}this.setIndex(u),this.setAttribute("position",new B(p,3)),this.setAttribute("normal",new B(d,3)),this.setAttribute("uv",new B(f,2))}function Ai(e,t,n,i){k.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},this.fromBufferGeometry(new Li(e,t,n,i)),this.mergeVertices()}function Li(e,t,i,r){G.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t)||12,i=i||0,r=r||2*Math.PI,r=Tl.clamp(r,0,2*Math.PI);var a,o,s,c=[],h=[],u=[],p=1/t,d=new l,f=new n;for(o=0;o<=t;o++){var m=i+o*p*r,v=Math.sin(m),g=Math.cos(m);for(s=0;s<=e.length-1;s++)d.x=e[s].x*v,d.y=e[s].y,d.z=e[s].x*g,h.push(d.x,d.y,d.z),f.x=o/t,f.y=s/(e.length-1),u.push(f.x,f.y)}for(o=0;o<t;o++)for(s=0;s<e.length-1;s++){a=s+o*e.length;var y=a,x=a+e.length,b=a+e.length+1,w=a+1;c.push(y,x,w),c.push(x,b,w)}if(this.setIndex(c),this.setAttribute("position",new B(h,3)),this.setAttribute("uv",new B(u,2)),this.computeVertexNormals(),r===2*Math.PI){var _=this.attributes.normal.array,M=new l,T=new l,E=new l;for(a=t*e.length*3,o=0,s=0;o<e.length;o++,s+=3)M.x=_[s+0],M.y=_[s+1],M.z=_[s+2],T.x=_[a+s+0],T.y=_[a+s+1],T.z=_[a+s+2],E.addVectors(M,T).normalize(),_[s+0]=_[a+s+0]=E.x,_[s+1]=_[a+s+1]=E.y,_[s+2]=_[a+s+2]=E.z}}function Ri(e,t){k.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new Pi(e,t)),this.mergeVertices()}function Pi(e,t){function n(e){var n,s,l,h=r.length/3,u=e.extractPoints(t),p=u.shape,d=u.holes;for(!1===wp.isClockWise(p)&&(p=p.reverse()),n=0,s=d.length;n<s;n++)l=d[n],!0===wp.isClockWise(l)&&(d[n]=l.reverse());var f=wp.triangulateShape(p,d);for(n=0,s=d.length;n<s;n++)l=d[n],p=p.concat(l);for(n=0,s=p.length;n<s;n++){var m=p[n];r.push(m.x,m.y,0),a.push(0,0,1),o.push(m.x,m.y)}for(n=0,s=f.length;n<s;n++){var v=f[n],g=v[0]+h,y=v[1]+h,x=v[2]+h;i.push(g,y,x),c+=3}}G.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var i=[],r=[],a=[],o=[],s=0,c=0;if(!1===Array.isArray(e))n(e);else for(var l=0;l<e.length;l++)n(e[l]),this.addGroup(s,c,l),s+=c,c=0;this.setIndex(i),this.setAttribute("position",new B(r,3)),this.setAttribute("normal",new B(a,3)),this.setAttribute("uv",new B(o,2))}function Ci(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,i=e.length;n<i;n++){var r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}function Oi(e,t){G.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,i,r,a,o=[],s=Math.cos(Tl.DEG2RAD*t),c=[0,0],l={},h=["a","b","c"];e.isBufferGeometry?(a=new k,a.fromBufferGeometry(e)):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var u=a.vertices,p=a.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],v=0;v<3;v++)n=m[h[v]],i=m[h[(v+1)%3]],c[0]=Math.min(n,i),c[1]=Math.max(n,i),r=c[0]+","+c[1],void 0===l[r]?l[r]={index1:c[0],index2:c[1],face1:d,face2:void 0}:l[r].face2=d;for(r in l){var g=l[r];if(void 0===g.face2||p[g.face1].normal.dot(p[g.face2].normal)<=s){var y=u[g.index1];o.push(y.x,y.y,y.z),y=u[g.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new B(o,3))}function Di(e,t,n,i,r,a,o,s){k.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Ii(e,t,n,i,r,a,o,s)),this.mergeVertices()}function Ii(e,t,i,r,a,o,s,c){function h(i){var a,o,h,g=new n,b=new l,w=0,_=!0===i?e:t,M=!0===i?1:-1;for(o=v,a=1;a<=r;a++)d.push(0,y*M,0),f.push(0,M,0),m.push(.5,.5),v++;for(h=v,a=0;a<=r;a++){var T=a/r,E=T*c+s,S=Math.cos(E),A=Math.sin(E);b.x=_*A,b.y=y*M,b.z=_*S,d.push(b.x,b.y,b.z),f.push(0,M,0),g.x=.5*S+.5,g.y=.5*A*M+.5,m.push(g.x,g.y),v++}for(a=0;a<r;a++){var L=o+a,R=h+a;!0===i?p.push(R,R+1,L):p.push(R+1,R,L),w+=3}u.addGroup(x,w,!0===i?1:2),x+=w}G.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:c};var u=this;e=void 0!==e?e:1,t=void 0!==t?t:1,i=i||1,r=Math.floor(r)||8,a=Math.floor(a)||1,o=void 0!==o&&o,s=void 0!==s?s:0,c=void 0!==c?c:2*Math.PI;var p=[],d=[],f=[],m=[],v=0,g=[],y=i/2,x=0;!function(){var n,o,h=new l,b=new l,w=0,_=(t-e)/i;for(o=0;o<=a;o++){var M=[],T=o/a,E=T*(t-e)+e;for(n=0;n<=r;n++){var S=n/r,A=S*c+s,L=Math.sin(A),R=Math.cos(A);b.x=E*L,b.y=-T*i+y,b.z=E*R,d.push(b.x,b.y,b.z),h.set(L,_,R).normalize(),f.push(h.x,h.y,h.z),m.push(S,1-T),M.push(v++)}g.push(M)}for(n=0;n<r;n++)for(o=0;o<a;o++){var P=g[o][n],C=g[o+1][n],O=g[o+1][n+1],D=g[o][n+1];p.push(P,C,D),p.push(C,O,D),w+=6}u.addGroup(x,w,0),x+=w}(),!1===o&&(e>0&&h(!0),t>0&&h(!1)),this.setIndex(p),this.setAttribute("position",new B(d,3)),this.setAttribute("normal",new B(f,3)),this.setAttribute("uv",new B(m,2))}function Ni(e,t,n,i,r,a,o){Di.call(this,0,e,t,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Bi(e,t,n,i,r,a,o){Ii.call(this,0,e,t,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function zi(e,t,n,i){k.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Fi(e,t,n,i)),this.mergeVertices()}function Fi(e,t,i,r){G.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var a,o,s=[],c=[],h=[],u=[],p=new l,d=new n;for(c.push(0,0,0),h.push(0,0,1),u.push(.5,.5),o=0,a=3;o<=t;o++,a+=3){var f=i+o/t*r;p.x=e*Math.cos(f),p.y=e*Math.sin(f),c.push(p.x,p.y,p.z),h.push(0,0,1),d.x=(c[a]/e+1)/2,d.y=(c[a+1]/e+1)/2,u.push(d.x,d.y)}for(a=1;a<=t;a++)s.push(a,a+1,0);this.setIndex(s),this.setAttribute("position",new B(c,3)),this.setAttribute("normal",new B(h,3)),this.setAttribute("uv",new B(u,2))}function Ui(e){S.call(this),this.type="ShadowMaterial",this.color=new w(0),this.transparent=!0,this.setValues(e)}function Gi(e){X.call(this,e),this.type="RawShaderMaterial"}function Hi(e){S.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new w(16777215),this.roughness=1,this.metalness=0,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.normalMapType=vl,this.normalScale=new n(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(e)}function Vi(e){Hi.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new n(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function ji(e){S.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.normalMapType=vl,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,
- this.combine=Fs,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(e)}function ki(e){S.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new w(16777215),this.specular=new w(1118481),this.shininess=30,this.map=null,this.gradientMap=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.normalMapType=vl,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Wi(e){S.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=vl,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function qi(e){S.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=Fs,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(e)}function Xi(e){S.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new w(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=vl,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Yi(e){pn.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}function Zi(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Ji(e,t,n,i){Zi.call(this,e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Qi(e,t,n,i){Zi.call(this,e,t,n,i)}function Ki(e,t,n,i){Zi.call(this,e,t,n,i)}function $i(e,t,n,i){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Ep.convertArray(t,this.TimeBufferType),this.values=Ep.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function er(e,t,n){$i.call(this,e,t,n)}function tr(e,t,n,i){$i.call(this,e,t,n,i)}function nr(e,t,n,i){$i.call(this,e,t,n,i)}function ir(e,t,n,i){Zi.call(this,e,t,n,i)}function rr(e,t,n,i){$i.call(this,e,t,n,i)}function ar(e,t,n,i){$i.call(this,e,t,n,i)}function or(e,t,n,i){$i.call(this,e,t,n,i)}function sr(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=Tl.generateUUID(),this.duration<0&&this.resetDuration()}function cr(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return nr;case"vector":case"vector2":case"vector3":case"vector4":return or;case"color":return tr;case"quaternion":return rr;case"bool":case"boolean":return er;case"string":return ar}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function lr(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=cr(e.type);if(void 0===e.times){var n=[],i=[];Ep.flattenJSON(e.keys,n,i,"value"),e.times=n,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}function hr(e,t,n){var i=this,r=!1,a=0,o=0,s=void 0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===r&&void 0!==i.onStart&&i.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==i.onProgress&&i.onProgress(e,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return-1!==t&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=c.length;t<n;t+=2){var i=c[t],r=c[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return r}return null}}function ur(e){this.manager=void 0!==e?e:Ap,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}function pr(e){ur.call(this,e)}function dr(e){ur.call(this,e)}function fr(e){ur.call(this,e)}function mr(e){ur.call(this,e)}function vr(e){ur.call(this,e)}function gr(e){ur.call(this,e)}function yr(e){ur.call(this,e)}function xr(){this.type="Curve",this.arcLengthDivisions=200}function br(e,t,n,i,r,a,o,s){xr.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function wr(e,t,n,i,r,a){br.call(this,e,t,n,n,i,r,a),this.type="ArcCurve"}function _r(){function e(e,a,o,s){t=e,n=o,i=-3*e+3*a-2*o-s,r=2*e-2*a+o+s}var t=0,n=0,i=0,r=0;return{initCatmullRom:function(t,n,i,r,a){e(n,i,a*(i-t),a*(r-n))},initNonuniformCatmullRom:function(t,n,i,r,a,o,s){var c=(n-t)/a-(i-t)/(a+o)+(i-n)/o,l=(i-n)/o-(r-n)/(o+s)+(r-i)/s;c*=o,l*=o,e(n,i,c,l)},calc:function(e){var a=e*e;return t+n*e+i*a+r*(a*e)}}}function Mr(e,t,n,i){xr.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}function Tr(e,t,n,i,r){var a=.5*(i-t),o=.5*(r-n),s=e*e;return(2*n-2*i+a+o)*(e*s)+(-3*n+3*i-2*a-o)*s+a*e+n}function Er(e,t){var n=1-e;return n*n*t}function Sr(e,t){return 2*(1-e)*e*t}function Ar(e,t){return e*e*t}function Lr(e,t,n,i){return Er(e,t)+Sr(e,n)+Ar(e,i)}function Rr(e,t){var n=1-e;return n*n*n*t}function Pr(e,t){var n=1-e;return 3*n*n*e*t}function Cr(e,t){return 3*(1-e)*e*e*t}function Or(e,t){return e*e*e*t}function Dr(e,t,n,i,r){return Rr(e,t)+Pr(e,n)+Cr(e,i)+Or(e,r)}function Ir(e,t,i,r){xr.call(this),this.type="CubicBezierCurve",this.v0=e||new n,this.v1=t||new n,this.v2=i||new n,this.v3=r||new n}function Nr(e,t,n,i){xr.call(this),this.type="CubicBezierCurve3",this.v0=e||new l,this.v1=t||new l,this.v2=n||new l,this.v3=i||new l}function Br(e,t){xr.call(this),this.type="LineCurve",this.v1=e||new n,this.v2=t||new n}function zr(e,t){xr.call(this),this.type="LineCurve3",this.v1=e||new l,this.v2=t||new l}function Fr(e,t,i){xr.call(this),this.type="QuadraticBezierCurve",this.v0=e||new n,this.v1=t||new n,this.v2=i||new n}function Ur(e,t,n){xr.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new l,this.v1=t||new l,this.v2=n||new l}function Gr(e){xr.call(this),this.type="SplineCurve",this.points=e||[]}function Hr(){xr.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Vr(e){Hr.call(this),this.type="Path",this.currentPoint=new n,e&&this.setFromPoints(e)}function jr(e){Vr.call(this,e),this.uuid=Tl.generateUUID(),this.type="Shape",this.holes=[]}function kr(e,t){d.call(this),this.type="Light",this.color=new w(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Wr(e,t,n){kr.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(d.DefaultUp),this.updateMatrix(),this.groundColor=new w(t)}function qr(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new n(512,512),this.map=null,this.mapPass=null,this.matrix=new h,this._frustum=new $,this._frameExtents=new n(1,1),this._viewportCount=1,this._viewports=[new a(0,0,1,1)]}function Xr(){qr.call(this,new Z(50,1,.5,500))}function Yr(e,t,n,i,r,a){kr.call(this,e,t),this.type="SpotLight",this.position.copy(d.DefaultUp),this.updateMatrix(),this.target=new d,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new Xr}function Zr(){qr.call(this,new Z(90,1,.5,500)),this._frameExtents=new n(4,2),this._viewportCount=6,this._viewports=[new a(2,1,1,1),new a(0,1,1,1),new a(3,1,1,1),new a(1,1,1,1),new a(3,0,1,1),new a(1,0,1,1)],this._cubeDirections=[new l(1,0,0),new l(-1,0,0),new l(0,0,1),new l(0,0,-1),new l(0,1,0),new l(0,-1,0)],this._cubeUps=[new l(0,1,0),new l(0,1,0),new l(0,1,0),new l(0,1,0),new l(0,0,1),new l(0,0,-1)]}function Jr(e,t,n,i){kr.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new Zr}function Qr(e,t,n,i,r,a){Y.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Kr(){qr.call(this,new Qr(-5,5,5,-5,.5,500))}function $r(e,t){kr.call(this,e,t),this.type="DirectionalLight",this.position.copy(d.DefaultUp),this.updateMatrix(),this.target=new d,this.shadow=new Kr}function ea(e,t){kr.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function ta(e,t,n,i){kr.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function na(e){ur.call(this,e),this.textures={}}function ia(){G.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function ra(e,t,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),L.call(this,e,t,n),this.meshPerAttribute=i||1}function aa(e){ur.call(this,e)}function oa(e){ur.call(this,e)}function sa(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ur.call(this,e),this.options=void 0}function ca(){this.type="ShapePath",this.color=new w,this.subPaths=[],this.currentPath=null}function la(e){this.type="Font",this.data=e}function ha(e,t,n){for(var i=Array.from?Array.from(e):String(e).split(""),r=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,c=0,l=0;l<i.length;l++){var h=i[l];if("\n"===h)s=0,c-=a;else{var u=ua(h,r,s,c,n);s+=u.offsetX,o.push(u.path)}}return o}function ua(e,t,n,i,r){var a=r.glyphs[e]||r.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+r.familyName+".");var o,s,c,l,h,u,p,d,f=new ca;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),v=0,g=m.length;v<g;){var y=m[v++];switch(y){case"m":o=m[v++]*t+n,s=m[v++]*t+i,f.moveTo(o,s);break;case"l":o=m[v++]*t+n,s=m[v++]*t+i,f.lineTo(o,s);break;case"q":c=m[v++]*t+n,l=m[v++]*t+i,h=m[v++]*t+n,u=m[v++]*t+i,f.quadraticCurveTo(h,u,c,l);break;case"b":c=m[v++]*t+n,l=m[v++]*t+i,h=m[v++]*t+n,u=m[v++]*t+i,p=m[v++]*t+n,d=m[v++]*t+i,f.bezierCurveTo(h,u,p,d,c,l)}}return{offsetX:a.ha*t,path:f}}function pa(e){ur.call(this,e)}function da(e){ur.call(this,e)}function fa(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new l)}function ma(e,t){kr.call(this,void 0,t),this.sh=void 0!==e?e:new fa}function va(e,t,n){ma.call(this,void 0,n);var i=(new w).set(e),r=(new w).set(t),a=new l(i.r,i.g,i.b),o=new l(r.r,r.g,r.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(c)}function ga(e,t){ma.call(this,void 0,t);var n=(new w).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function ya(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Z,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Z,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function xa(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function ba(){d.call(this),this.type="AudioListener",this.context=Gp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new xa}function wa(e){d.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}function _a(e){wa.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Ma(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Ta(e,t,n){this.binding=e,this.valueSize=n;var i,r=Float64Array;switch(t){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Ea(e,t,n){var i=n||Sa.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function Sa(e,t,n){this.path=t,this.parsedPath=n||Sa.parseTrackName(t),this.node=Sa.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Aa(){this.uuid=Tl.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function La(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var i=t.tracks,r=i.length,a=new Array(r),o={endingStart:al,endingEnd:al},s=0;s!==r;++s){var c=i[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=rl,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 Ra(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Pa(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Ca(e,t,n){tn.call(this,e,t),this.meshPerAttribute=n||1}function Oa(e,t,n,i){this.ray=new y(e,t),this.near=n||0,this.far=i||1/0,this.camera=null,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 Da(e,t){return e.distance-t.distance}function Ia(e,t,n,i){if(!1!==e.visible&&(e.raycast(t,n),!0===i))for(var r=e.children,a=0,o=r.length;a<o;a++)Ia(r[a],t,n,!0)}function Na(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function Ba(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}function za(e,t){this.min=void 0!==e?e:new n(1/0,1/0),this.max=void 0!==t?t:new n(-1/0,-1/0)}function Fa(e,t){this.start=void 0!==e?e:new l,this.end=void 0!==t?t:new l}function Ua(e){d.call(this),this.material=e,this.render=function(){}}function Ga(e,t){d.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new G,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],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;i.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new B(i,3));var c=new pn({fog:!1});this.cone=new fn(n,c),this.add(this.cone),this.update()}function Ha(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,Ha(e.children[n]));return t}function Va(e){for(var t=Ha(e),n=new G,i=[],r=[],a=new w(0,0,1),o=new w(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new B(i,3)),n.setAttribute("color",new B(r,3));var l=new pn({vertexColors:ss,depthTest:!1,depthWrite:!1,transparent:!0});fn.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function ja(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var i=new Ti(t,4,2),r=new A({wireframe:!0,fog:!1});H.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function ka(e,t,n){d.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new Cn(t);i.rotateY(.5*Math.PI),this.material=new A({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=ss);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.setAttribute("color",new L(a,3)),this.add(new H(i,this.material)),this.update()}function Wa(e,t,n,i){e=e||10,t=t||10,n=new w(void 0!==n?n:4473924),i=new w(void 0!==i?i:8947848);for(var r=t/2,a=e/t,o=e/2,s=[],c=[],l=0,h=0,u=-o;l<=t;l++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var p=l===r?n:i;p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3}var d=new G;d.setAttribute("position",new B(s,3)),d.setAttribute("color",new B(c,3));var f=new pn({vertexColors:ss});fn.call(this,d,f)}function qa(e,t,n,i,r,a){e=e||10,t=t||16,n=n||8,i=i||64,r=new w(void 0!==r?r:4473924),a=new w(void 0!==a?a:8947848);var o,s,c,l,h,u,p,d=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),o=Math.sin(c)*e,s=Math.cos(c)*e,d.push(0,0,0),d.push(o,0,s),p=1&l?r:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(l=0;l<=n;l++)for(p=1&l?r:a,u=e-e/n*l,h=0;h<i;h++)c=h/i*(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=(h+1)/i*(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 G;m.setAttribute("position",new B(d,3)),m.setAttribute("color",new B(f,3));var v=new pn({vertexColors:ss});fn.call(this,m,v)}function Xa(e,t,n){d.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var i=new G;i.setAttribute("position",new B([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var r=new pn({fog:!1});this.lightPlane=new dn(i,r),this.add(this.lightPlane),i=new G,i.setAttribute("position",new B([0,0,0,0,0,1],3)),this.targetLine=new dn(i,r),this.add(this.targetLine),this.update()}function Ya(e){function t(e,t,i){n(e,i),n(t,i)}function n(e,t){a.push(0,0,0),o.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(a.length/3-1)}var i=new G,r=new pn({color:16777215,vertexColors:os}),a=[],o=[],s={},c=new w(16755200),l=new w(16711680),h=new w(43775),u=new w(16777215),p=new w(3355443);t("n1","n2",c),t("n2","n4",c),t("n4","n3",c),t("n3","n1",c),t("f1","f2",c),t("f2","f4",c),t("f4","f3",c),t("f3","f1",c),t("n1","f1",c),t("n2","f2",c),t("n3","f3",c),t("n4","f4",c),t("p","n1",l),t("p","n2",l),t("p","n3",l),t("p","n4",l),t("u1","u2",h),t("u2","u3",h),t("u3","u1",h),t("c","t",u),t("p","c",p),t("cn1","cn2",p),t("cn3","cn4",p),t("cf1","cf2",p),t("cf3","cf4",p),i.setAttribute("position",new B(a,3)),i.setAttribute("color",new B(o,3)),fn.call(this,i,r),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function Za(e,t,n,i,r,a,o){bd.set(r,a,o).unproject(i);var s=t[e];if(void 0!==s)for(var c=n.getAttribute("position"),l=0,h=s.length;l<h;l++)c.setXYZ(s[l],bd.x,bd.y,bd.z)}function Ja(e,t){this.object=e,void 0===t&&(t=16776960);var n=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]),i=new Float32Array(24),r=new G;r.setIndex(new L(n,1)),r.setAttribute("position",new L(i,3)),fn.call(this,r,new pn({color:t})),this.matrixAutoUpdate=!1,this.update()}function Qa(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=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]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],r=new G;r.setIndex(new L(n,1)),r.setAttribute("position",new B(i,3)),fn.call(this,r,new pn({color:t})),this.geometry.computeBoundingSphere()}function Ka(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var i=void 0!==n?n:16776960,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,0,1,0,0,0],a=new G;a.setAttribute("position",new B(r,3)),a.computeBoundingSphere(),dn.call(this,a,new pn({color:i}));var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new G;s.setAttribute("position",new B(o,3)),s.computeBoundingSphere(),this.add(new H(s,new A({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function $a(e,t,n,i,r,a){d.call(this),void 0===e&&(e=new l(0,0,1)),void 0===t&&(t=new l(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===Md&&(Md=new G,Md.setAttribute("position",new B([0,0,0,0,1,0],3)),Td=new Ii(0,.5,1,5,1),Td.translate(0,-.5,0)),this.position.copy(t),this.line=new dn(Md,new pn({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new H(Td,new A({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,a)}function eo(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new G;i.setAttribute("position",new B(t,3)),i.setAttribute("color",new B(n,3));var r=new pn({vertexColors:ss});fn.call(this,i,r)}function to(e){Vd=e,oo(Id)}function no(e){var t={magFilter:ic,minFilter:ic,generateMipmaps:!1,type:e?e.type:lc,format:e?e.format:Sc,encoding:e?e.encoding:ll,depthBuffer:!1,stencilBuffer:!1},n=so(t);return n.depthBuffer=!e,Hd=so(t),n}function io(e){Hd.dispose(),Vd.setRenderTarget(jd),e.scissorTest=!1,e.setSize(e.width,e.height)}function ro(e,t,n,i){var r=new Z(90,1,t,n),a=[1,1,1,1,-1,1],o=[1,1,-1,-1,-1,1],s=Vd.outputEncoding,c=Vd.toneMapping,l=Vd.toneMappingExposure,h=Vd.getClearColor(),u=Vd.getClearAlpha();Vd.toneMapping=Vs,Vd.toneMappingExposure=1,Vd.outputEncoding=ol,e.scale.z*=-1;var p=e.background;if(p&&p.isColor){p.convertSRGBToLinear();var d=Math.max(p.r,p.g,p.b),f=Math.min(Math.max(Math.ceil(Math.log2(d)),-128),127);p=p.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;Vd.setClearColor(p,m),e.background=null}for(var v=0;v<6;v++){var g=v%3;0==g?(r.up.set(0,a[v],0),r.lookAt(o[v],0,0)):1==g?(r.up.set(0,0,a[v]),r.lookAt(0,o[v],0)):(r.up.set(0,a[v],0),r.lookAt(0,0,o[v])),co(i,g*Ld,v>2?Ld:0,Ld,Ld),Vd.setRenderTarget(i),Vd.render(e,r)}Vd.toneMapping=c,Vd.toneMappingExposure=l,Vd.outputEncoding=s,Vd.setClearColor(h,u),e.scale.z*=-1}function ao(e,t){var n=new f;e.isCubeTexture?null==Bd&&(Bd=fo()):null==Nd&&(Nd=po());var i=e.isCubeTexture?Bd:Nd;n.add(new H(Fd[0],i));var r=i.uniforms;r.envMap.value=e,e.isCubeTexture||r.texelSize.value.set(1/e.image.width,1/e.image.height),r.inputEncoding.value=Od[e.encoding],r.outputEncoding.value=Od[e.encoding],co(t,0,0,3*Ld,2*Ld),Vd.setRenderTarget(t),Vd.render(n,Dd)}function oo(e){var t=new f;t.add(new H(Fd[0],e)),Vd.compile(t,Dd)}function so(e){var t=new o(3*Ld,3*Ld,e);return t.texture.mapping=Ks,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function co(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function lo(e){var t=Vd.autoClear;Vd.autoClear=!1;for(var n=1;n<Pd;n++){ho(e,n-1,n,Math.sqrt(Gd[n]*Gd[n]-Gd[n-1]*Gd[n-1]),qd[(n-1)%qd.length])}Vd.autoClear=t}function ho(e,t,n,i,r){uo(e,Hd,t,n,i,"latitudinal",r),uo(Hd,e,n,n,i,"longitudinal",r)}function uo(e,t,n,i,r,a,o){"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var s=new f;s.add(new H(Fd[i],Id));var c=Id.uniforms,l=Ud[n]-1,h=isFinite(r)?Math.PI/(2*l):2*Math.PI/(2*Cd-1),u=r/h,p=isFinite(r)?1+Math.floor(3*u):Cd;p>Cd&&console.warn("sigmaRadians, "+r+", is too large and will clip, as it requested "+p+" samples when the maximum is set to "+Cd);for(var d=[],m=0,v=0;v<Cd;++v){var g=v/u,y=Math.exp(-g*g/2);d.push(y),0==v?m+=y:v<p&&(m+=2*y)}for(var v=0;v<d.length;v++)d[v]=d[v]/m;c.envMap.value=e.texture,c.samples.value=p,c.weights.value=d,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o),c.dTheta.value=h,c.mipInt.value=Ad-n,c.inputEncoding.value=Od[e.texture.encoding],c.outputEncoding.value=Od[e.texture.encoding];var x=Ud[i],g=3*Math.max(0,Ld-2*x);co(t,g,(0===i?0:2*Ld)+2*x*(i>Ad-Sd?i-Ad+Sd:0),3*x,2*x),Vd.setRenderTarget(t),Vd.render(s,Dd)}function po(){var e=new n(1,1),t=new Gi({uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:Od[ol]},outputEncoding:{value:Od[ol]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:cs,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function fo(){var e=new Gi({uniforms:{envMap:{value:null},inputEncoding:{value:Od[ol]},outputEncoding:{value:Od[ol]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:cs,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function mo(e,t,n,i,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new E(e,t,n,r,a,o)}function vo(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function go(e){
- return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function yo(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new gn(e,t)}function xo(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new an(e)}function bo(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new gn(e,t)}function wo(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new vn(e)}function _o(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new vn(e)}function Mo(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new vn(e)}function To(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new l(e,t,n)}function Eo(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new L(e,t).setUsage(wl)}function So(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new R(e,t)}function Ao(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new P(e,t)}function Lo(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new C(e,t)}function Ro(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new O(e,t)}function Po(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new D(e,t)}function Co(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new I(e,t)}function Oo(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new N(e,t)}function Do(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new B(e,t)}function Io(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new z(e,t)}function No(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Mr.call(this,e),this.type="catmullrom",this.closed=!0}function Bo(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Mr.call(this,e),this.type="catmullrom"}function zo(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Mr.call(this,e),this.type="catmullrom"}function Fo(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new eo(e)}function Uo(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Ja(e,t)}function Go(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new fn(new Oi(e.geometry),new pn({color:void 0!==t?t:16777215}))}function Ho(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new fn(new Mn(e.geometry),new pn({color:void 0!==t?t:16777215}))}function Vo(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new pr(e)}function jo(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new mr(e)}function ko(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Q(e,n)}function Wo(){console.error("THREE.CanvasRenderer has been removed")}function qo(){console.error("THREE.JSONLoader has been removed.")}function Xo(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(void 0!==i&&null!==i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t});var Yo={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Zo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Jo=0,Qo=1,Ko=2,$o=1,es=2,ts=3,ns=0,is=1,rs=2,as=0,os=1,ss=2,cs=0,ls=1,hs=2,us=3,ps=4,ds=5,fs=100,ms=101,vs=102,gs=103,ys=104,xs=200,bs=201,ws=202,_s=203,Ms=204,Ts=205,Es=206,Ss=207,As=208,Ls=209,Rs=210,Ps=0,Cs=1,Os=2,Ds=3,Is=4,Ns=5,Bs=6,zs=7,Fs=0,Us=1,Gs=2,Hs=0,Vs=1,js=2,ks=3,Ws=4,qs=5,Xs=301,Ys=302,Zs=303,Js=304,Qs=305,Ks=306,$s=307,ec=1e3,tc=1001,nc=1002,ic=1003,rc=1004,ac=1005,oc=1006,sc=1007,cc=1008,lc=1009,hc=1010,uc=1011,pc=1012,dc=1013,fc=1014,mc=1015,vc=1016,gc=1017,yc=1018,xc=1019,bc=1020,wc=1021,_c=1022,Mc=1023,Tc=1024,Ec=1025,Sc=Mc,Ac=1026,Lc=1027,Rc=1028,Pc=1029,Cc=1030,Oc=1031,Dc=1032,Ic=1033,Nc=33776,Bc=33777,zc=33778,Fc=33779,Uc=35840,Gc=35841,Hc=35842,Vc=35843,jc=36196,kc=37808,Wc=37809,qc=37810,Xc=37811,Yc=37812,Zc=37813,Jc=37814,Qc=37815,Kc=37816,$c=37817,el=37818,tl=37819,nl=37820,il=37821,rl=2201,al=2400,ol=3e3,sl=3001,cl=3007,ll=3002,hl=3003,ul=3004,pl=3005,dl=3006,fl=3200,ml=3201,vl=0,gl=1,yl=7680,xl=519,bl=35044,wl=35048;Object.assign(t.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners,i=n[e];if(void 0!==i){var r=i.indexOf(t);-1!==r&&i.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,n=t[e.type];if(void 0!==n){e.target=this;for(var i=n.slice(0),r=0,a=i.length;r<a;r++)i[r].call(this,e)}}}});for(var _l=[],Ml=0;Ml<256;Ml++)_l[Ml]=(Ml<16?"0":"")+Ml.toString(16);var Tl={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(_l[255&e]+_l[e>>8&255]+_l[e>>16&255]+_l[e>>24&255]+"-"+_l[255&t]+_l[t>>8&255]+"-"+_l[t>>16&15|64]+_l[t>>24&255]+"-"+_l[63&n|128]+_l[n>>8&255]+"-"+_l[n>>16&255]+_l[n>>24&255]+_l[255&i]+_l[i>>8&255]+_l[i>>16&255]+_l[i>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Tl.DEG2RAD},radToDeg:function(e){return e*Tl.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,r){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+i)/2),h=o((t+i)/2),u=a((t-i)/2),p=o((t-i)/2),d=a((i-t)/2),f=o((i-t)/2);"XYX"===r?e.set(s*h,c*u,c*p,s*l):"YZY"===r?e.set(c*p,s*h,c*u,s*l):"ZXZ"===r?e.set(c*u,c*p,s*h,s*l):"XZX"===r?e.set(s*h,c*f,c*d,s*l):"YXY"===r?e.set(c*d,s*h,c*f,s*l):"ZYZ"===r?e.set(c*f,c*d,s*h,s*l):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};Object.defineProperties(n.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(n.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},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(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}}),Object.assign(i.prototype,{isMatrix3:!0,set:function(e,t,n,i,r,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=i,l[2]=o,l[3]=t,l[4]=r,l[5]=s,l[6]=n,l[7]=a,l[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(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],h=n[7],u=n[2],p=n[5],d=n[8],f=i[0],m=i[3],v=i[6],g=i[1],y=i[4],x=i[7],b=i[2],w=i[5],_=i[8];return r[0]=a*f+o*g+s*b,r[3]=a*m+o*y+s*w,r[6]=a*v+o*x+s*_,r[1]=c*f+l*g+h*b,r[4]=c*m+l*y+h*w,r[7]=c*v+l*x+h*_,r[2]=u*f+p*g+d*b,r[5]=u*m+p*y+d*w,r[8]=u*v+p*x+d*_,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*r*l+n*o*s+i*r*c-i*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,i=this.elements,r=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],h=n[6],u=n[7],p=n[8],d=p*c-l*u,f=l*h-p*s,m=u*s-c*h,v=r*d+a*f+o*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return i[0]=d*y,i[1]=(o*u-p*a)*y,i[2]=(l*a-o*c)*y,i[3]=f*y,i[4]=(p*r-o*h)*y,i[5]=(o*s-l*r)*y,i[6]=m*y,i[7]=(a*h-u*r)*y,i[8]=(c*r-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,i,r,a,o){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-i*c,i*s,-i*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],c=i[4],l=i[7];return i[0]=t*r+n*s,i[3]=t*a+n*c,i[6]=t*o+n*l,i[1]=-n*r+t*s,i[4]=-n*a+t*c,i[7]=-n*o+t*l,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var El,Sl={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===El&&(El=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),El.width=e.width,El.height=e.height;var n=El.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=El}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},Al=0;r.DEFAULT_IMAGE=void 0,r.DEFAULT_MAPPING=300,r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,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],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=Tl.generateUUID()),!t&&void 0===e.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(Sl.getDataURL(i[a]))}else r=Sl.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ec:e.x=e.x-Math.floor(e.x);break;case tc:e.x=e.x<0?0:1;break;case nc:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ec:e.y=e.y-Math.floor(e.y);break;case tc:e.y=e.y<0?0:1;break;case nc:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(r.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(a.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(a.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){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: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,i,r,a=e.elements,o=a[0],s=a[4],c=a[8],l=a[1],h=a[5],u=a[9],p=a[2],d=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+p)<.1&&Math.abs(u+d)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,v=(h+1)/2,g=(f+1)/2,y=(s+l)/4,x=(c+p)/4,b=(u+d)/4;return m>v&&m>g?m<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(m),i=y/n,r=x/n):v>g?v<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(v),n=y/i,r=b/i):g<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(g),n=x/r,i=b/r),this.set(n,i,r,t),this}var w=Math.sqrt((d-u)*(d-u)+(c-p)*(c-p)+(l-s)*(l-s));return Math.abs(w)<.001&&(w=1),this.x=(d-u)/w,this.y=(c-p)/w,this.z=(l-s)/w,this.w=Math.acos((o+h+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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)},manhattanLength: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()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),o.prototype=Object.assign(Object.create(t.prototype),{constructor:o,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,isWebGLMultisampleRenderTarget:!0,copy:function(e){return o.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(c,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],c=n[i+1],l=n[i+2],h=n[i+3],u=r[a+0],p=r[a+1],d=r[a+2],f=r[a+3];if(h!==f||s!==u||c!==p||l!==d){var m=1-o,v=s*u+c*p+l*d+h*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var w=o*g;if(s=s*m+u*w,c=c*m+p*w,l=l*m+d*w,h=h*m+f*w,m===1-o){var _=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=_,c*=_,l*=_,h*=_}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=h}}),Object.defineProperties(c.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(c.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,i=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(i/2),h=o(r/2),u=s(n/2),p=s(i/2),d=s(r/2);return"XYZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"YXZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"ZXY"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"ZYX"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"YZX"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h-u*p*d):"XZY"===a&&(this._x=u*l*h-c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h+u*p*d),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],h=n[6],u=n[10],p=i+s+u;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(h-c)*t,this._y=(a-l)*t,this._z=(o-r)*t):i>s&&i>u?(t=2*Math.sqrt(1+i-s-u),this._w=(h-c)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+l)/t):s>u?(t=2*Math.sqrt(1+s-i-u),this._w=(a-l)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+u-i-s),this._w=(o-r)/t,this._x=(a+l)/t,this._y=(c+h)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Tl.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var i=Math.min(1,t/n);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+i*c-r*s,this._y=i*l+a*s+r*o-n*c,this._z=r*l+a*c+n*s-i*o,this._w=a*l-n*o-i*s-r*c,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-t;return this._w=c*a+t*this._w,this._x=c*n+t*this._x,this._y=c*i+t*this._y,this._z=c*r+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),h=Math.atan2(l,o),u=Math.sin((1-t)*h)/l,p=Math.sin(t*h)/l;return this._w=a*u+this._w*p,this._x=n*u+this._x*p,this._y=i*u+this._y*p,this._z=r*u+this._z*p,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var Ll=new l,Rl=new c;Object.assign(l.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){
- return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Rl.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(Rl.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*i-o*n,l=s*n+o*t-r*i,h=s*i+r*n-a*t,u=-r*t-a*n-o*i;return this.x=c*s+u*-r+l*-o-h*-a,this.y=l*s+u*-a+h*-r-c*-o,this.z=h*s+u*-o+c*-a-l*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},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(e){return this.x*e.x+this.y*e.y+this.z*e.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)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return Ll.copy(this).projectOnVector(e),this.sub(Ll)},reflect:function(e){return this.sub(Ll.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(Tl.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var Pl=new l,Cl=new h,Ol=new l(0,0,0),Dl=new l(1,1,1),Il=new l,Nl=new l,Bl=new l;Object.assign(h.prototype,{isMatrix4:!0,set:function(e,t,n,i,r,a,o,s,c,l,h,u,p,d,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=i,v[1]=r,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=l,v[10]=h,v[14]=u,v[3]=p,v[7]=d,v[11]=f,v[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(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,i=1/Pl.setFromMatrixColumn(e,0).length(),r=1/Pl.setFromMatrixColumn(e,1).length(),a=1/Pl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=-s*h,t[8]=c,t[1]=p+d*c,t[5]=u-f*c,t[9]=-o*s,t[2]=f-u*c,t[6]=d+p*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,v=s*h,g=c*l,y=c*h;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*c,t[1]=a*h,t[5]=a*l,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order){var m=s*l,v=s*h,g=c*l,y=c*h;t[0]=m-y*o,t[4]=-a*h,t[8]=g+v*o,t[1]=v+g*o,t[5]=a*l,t[9]=y-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=d*c-p,t[8]=u*c+f,t[1]=s*h,t[5]=f*c+u,t[9]=p*c-d,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var x=a*s,b=a*c,w=o*s,_=o*c;t[0]=s*l,t[4]=_-x*h,t[8]=w*h+b,t[1]=h,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=b*h+w,t[10]=x-_*h}else if("XZY"===e.order){var x=a*s,b=a*c,w=o*s,_=o*c;t[0]=s*l,t[4]=-h,t[8]=c*l,t[1]=x*h+_,t[5]=a*l,t[9]=b*h-w,t[2]=w*h-b,t[6]=o*l,t[10]=_*h+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(Ol,e,Dl)},lookAt:function(e,t,n){var i=this.elements;return Bl.subVectors(e,t),0===Bl.lengthSq()&&(Bl.z=1),Bl.normalize(),Il.crossVectors(n,Bl),0===Il.lengthSq()&&(1===Math.abs(n.z)?Bl.x+=1e-4:Bl.z+=1e-4,Bl.normalize(),Il.crossVectors(n,Bl)),Il.normalize(),Nl.crossVectors(Bl,Il),i[0]=Il.x,i[4]=Nl.x,i[8]=Bl.x,i[1]=Il.y,i[5]=Nl.y,i[9]=Bl.y,i[2]=Il.z,i[6]=Nl.z,i[10]=Bl.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],h=n[5],u=n[9],p=n[13],d=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],b=n[15],w=i[0],_=i[4],M=i[8],T=i[12],E=i[1],S=i[5],A=i[9],L=i[13],R=i[2],P=i[6],C=i[10],O=i[14],D=i[3],I=i[7],N=i[11],B=i[15];return r[0]=a*w+o*E+s*R+c*D,r[4]=a*_+o*S+s*P+c*I,r[8]=a*M+o*A+s*C+c*N,r[12]=a*T+o*L+s*O+c*B,r[1]=l*w+h*E+u*R+p*D,r[5]=l*_+h*S+u*P+p*I,r[9]=l*M+h*A+u*C+p*N,r[13]=l*T+h*L+u*O+p*B,r[2]=d*w+f*E+m*R+v*D,r[6]=d*_+f*S+m*P+v*I,r[10]=d*M+f*A+m*C+v*N,r[14]=d*T+f*L+m*O+v*B,r[3]=g*w+y*E+x*R+b*D,r[7]=g*_+y*S+x*P+b*I,r[11]=g*M+y*A+x*C+b*N,r[15]=g*T+y*L+x*O+b*B,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],h=e[6],u=e[10],p=e[14];return e[3]*(+r*s*h-i*c*h-r*o*u+n*c*u+i*o*p-n*s*p)+e[7]*(+t*s*p-t*c*u+r*a*u-i*a*p+i*c*l-r*s*l)+e[11]*(+t*c*h-t*o*p-r*a*h+n*a*p+r*o*l-n*c*l)+e[15]*(-i*o*l-t*s*h+t*o*u+i*a*h-n*a*u+n*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){var n=this.elements,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],h=i[6],u=i[7],p=i[8],d=i[9],f=i[10],m=i[11],v=i[12],g=i[13],y=i[14],x=i[15],b=d*y*u-g*f*u+g*h*m-l*y*m-d*h*x+l*f*x,w=v*f*u-p*y*u-v*h*m+c*y*m+p*h*x-c*f*x,_=p*g*u-v*d*u+v*l*m-c*g*m-p*l*x+c*d*x,M=v*d*h-p*g*h-v*l*f+c*g*f+p*l*y-c*d*y,T=r*b+a*w+o*_+s*M;if(0===T){var E="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(E);return console.warn(E),this.identity()}var S=1/T;return n[0]=b*S,n[1]=(g*f*s-d*y*s-g*o*m+a*y*m+d*o*x-a*f*x)*S,n[2]=(l*y*s-g*h*s+g*o*u-a*y*u-l*o*x+a*h*x)*S,n[3]=(d*h*s-l*f*s-d*o*u+a*f*u+l*o*m-a*h*m)*S,n[4]=w*S,n[5]=(p*y*s-v*f*s+v*o*m-r*y*m-p*o*x+r*f*x)*S,n[6]=(v*h*s-c*y*s-v*o*u+r*y*u+c*o*x-r*h*x)*S,n[7]=(c*f*s-p*h*s+p*o*u-r*f*u-c*o*m+r*h*m)*S,n[8]=_*S,n[9]=(v*d*s-p*g*s-v*a*m+r*g*m+p*a*x-r*d*x)*S,n[10]=(c*g*s-v*l*s+v*a*u-r*g*u-c*a*x+r*l*x)*S,n[11]=(p*l*s-c*d*s-p*a*u+r*d*u+c*a*m-r*l*m)*S,n[12]=M*S,n[13]=(p*g*o-v*d*o+v*a*f-r*g*f-p*a*y+r*d*y)*S,n[14]=(v*l*o-c*g*o-v*a*h+r*g*h+c*a*y-r*l*y)*S,n[15]=(c*d*o-p*l*o+p*a*h-r*d*h-c*a*f+r*l*f)*S,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,c=r*a,l=r*o;return this.set(c*a+n,c*o-i*s,c*s+i*o,0,c*o+i*s,l*o+n,l*s-i*a,0,c*s-i*o,l*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,c=r+r,l=a+a,h=o+o,u=r*c,p=r*l,d=r*h,f=a*l,m=a*h,v=o*h,g=s*c,y=s*l,x=s*h,b=n.x,w=n.y,_=n.z;return i[0]=(1-(f+v))*b,i[1]=(p+x)*b,i[2]=(d-y)*b,i[3]=0,i[4]=(p-x)*w,i[5]=(1-(u+v))*w,i[6]=(m+g)*w,i[7]=0,i[8]=(d+y)*_,i[9]=(m-g)*_,i[10]=(1-(u+f))*_,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,t,n){var i=this.elements,r=Pl.set(i[0],i[1],i[2]).length(),a=Pl.set(i[4],i[5],i[6]).length(),o=Pl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Cl.copy(this);var s=1/r,c=1/a,l=1/o;return Cl.elements[0]*=s,Cl.elements[1]*=s,Cl.elements[2]*=s,Cl.elements[4]*=c,Cl.elements[5]*=c,Cl.elements[6]*=c,Cl.elements[8]*=l,Cl.elements[9]*=l,Cl.elements[10]*=l,t.setFromRotationMatrix(Cl),n.x=r,n.y=a,n.z=o,this},makePerspective:function(e,t,n,i,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/(t-e),c=2*r/(n-i),l=(t+e)/(t-e),h=(n+i)/(n-i),u=-(a+r)/(a-r),p=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=h,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(e,t,n,i,r,a){var o=this.elements,s=1/(t-e),c=1/(n-i),l=1/(a-r),h=(t+e)*s,u=(n+i)*c,p=(a+r)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var zl=new h,Fl=new c;u.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],u.DefaultOrder="XYZ",Object.defineProperties(u.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(u.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=Tl.clamp,r=e.elements,a=r[0],o=r[4],s=r[8],c=r[1],l=r[5],h=r[9],u=r[2],p=r[6],d=r[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return zl.makeRotationFromQuaternion(e),this.setFromRotationMatrix(zl,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return Fl.setFromEuler(this),this.setFromQuaternion(Fl,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new l(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(p.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return 0!=(this.mask&e.mask)}});var Ul=0,Gl=new l,Hl=new c,Vl=new h,jl=new l,kl=new l,Wl=new l,ql=new c,Xl=new l(1,0,0),Yl=new l(0,1,0),Zl=new l(0,0,1),Jl={type:"added"},Ql={type:"removed"};d.DefaultUp=new l(0,1,0),d.DefaultMatrixAutoUpdate=!0,d.prototype=Object.assign(Object.create(t.prototype),{constructor:d,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return Hl.setFromAxisAngle(e,t),this.quaternion.multiply(Hl),this},rotateOnWorldAxis:function(e,t){return Hl.setFromAxisAngle(e,t),this.quaternion.premultiply(Hl),this},rotateX:function(e){return this.rotateOnAxis(Xl,e)},rotateY:function(e){return this.rotateOnAxis(Yl,e)},rotateZ:function(e){return this.rotateOnAxis(Zl,e)},translateOnAxis:function(e,t){return Gl.copy(e).applyQuaternion(this.quaternion),this.position.add(Gl.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(Xl,e)},translateY:function(e){return this.translateOnAxis(Yl,e)},translateZ:function(e){return this.translateOnAxis(Zl,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(Vl.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?jl.copy(e):jl.set(e,t,n);var i=this.parent;this.updateWorldMatrix(!0,!1),kl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Vl.lookAt(kl,jl,this.up):Vl.lookAt(jl,kl,this.up),this.quaternion.setFromRotationMatrix(Vl),i&&(Vl.extractRotation(i.matrixWorld),Hl.setFromRotationMatrix(Vl),this.quaternion.premultiply(Hl.inverse()))},add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Jl)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Ql)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),Vl.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Vl.multiply(e.parent.matrixWorld)),e.applyMatrix4(Vl),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n],a=r.getObjectByProperty(e,t);if(void 0!==a)return a}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new l),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new c),this.updateMatrixWorld(!0),this.matrixWorld.decompose(kl,e,Wl),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new l),this.updateMatrixWorld(!0),this.matrixWorld.decompose(kl,ql,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new l),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(e){function t(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}function n(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}var i=void 0===e||"string"==typeof e,r={};i&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var a={};if(a.uuid=this.uuid,a.type=this.type,""!==this.name&&(a.name=this.name),!0===this.castShadow&&(a.castShadow=!0),!0===this.receiveShadow&&(a.receiveShadow=!0),!1===this.visible&&(a.visible=!1),!1===this.frustumCulled&&(a.frustumCulled=!1),0!==this.renderOrder&&(a.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){a.geometry=t(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var s=o.shapes;if(Array.isArray(s))for(var c=0,l=s.length;c<l;c++){var h=s[c];t(e.shapes,h)}else t(e.shapes,s)}}if(void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],c=0,l=this.material.length;c<l;c++)u.push(t(e.materials,this.material[c]));a.material=u}else a.material=t(e.materials,this.material);if(this.children.length>0){a.children=[];for(var c=0;c<this.children.length;c++)a.children.push(this.children[c].toJSON(e).object)}if(i){var p=n(e.geometries),d=n(e.materials),f=n(e.textures),m=n(e.images),s=n(e.shapes);p.length>0&&(r.geometries=p),d.length>0&&(r.materials=d),f.length>0&&(r.textures=f),m.length>0&&(r.images=m),s.length>0&&(r.shapes=s)}return r.object=a,r},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}}),f.prototype=Object.assign(Object.create(d.prototype),{constructor:f,isScene:!0,copy:function(e,t){return d.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=d.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Kl=[new l,new l,new l,new l,new l,new l,new l,new l],$l=new l,eh=new m,th=new l,nh=new l,ih=new l,rh=new l,ah=new l,oh=new l,sh=new l,ch=new l,lh=new l,hh=new l;Object.assign(m.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],h=e[s+1],u=e[s+2];l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),h=e.getY(s),u=e.getZ(s);l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=$l.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.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(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new l),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new l),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),eh.copy(t.boundingBox),eh.applyMatrix4(e.matrixWorld),this.expandByPoint(eh.min),this.expandByPoint(eh.max));for(var n=e.children,i=0,r=n.length;i<r;i++)this.expandByObject(n[i]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new l),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,$l),$l.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(sh),ch.subVectors(this.max,sh),th.subVectors(e.a,sh),nh.subVectors(e.b,sh),ih.subVectors(e.c,sh),rh.subVectors(nh,th),ah.subVectors(ih,nh),oh.subVectors(th,ih);var t=[0,-rh.z,rh.y,0,-ah.z,ah.y,0,-oh.z,oh.y,rh.z,0,-rh.x,ah.z,0,-ah.x,oh.z,0,-oh.x,-rh.y,rh.x,0,-ah.y,ah.x,0,-oh.y,oh.x,0];return!!v(t,th,nh,ih,ch)&&(t=[1,0,0,0,1,0,0,0,1],!!v(t,th,nh,ih,ch)&&(lh.crossVectors(rh,ah),t=[lh.x,lh.y,lh.z],v(t,th,nh,ih,ch)))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new l),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return $l.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){
- return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize($l).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()?this:(Kl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Kl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Kl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Kl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Kl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Kl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Kl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Kl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Kl),this)},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var uh=new m;Object.assign(g.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):uh.setFromPoints(e).getCenter(n);for(var i=0,r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new l),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new m),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var ph=new l,dh=new l,fh=new l,mh=new l,vh=new l,gh=new l,yh=new l;Object.assign(y.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new l),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,ph)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new l),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=ph.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ph.copy(this.direction).multiplyScalar(t).add(this.origin),ph.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,i){dh.copy(e).add(t).multiplyScalar(.5),fh.copy(t).sub(e).normalize(),mh.copy(this.origin).sub(dh);var r,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(fh),h=mh.dot(this.direction),u=-mh.dot(fh),p=mh.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(r=l*u-h,a=l*h-u,s=c*d,r>=0)if(a>=-s)if(a<=s){var f=1/d;r*=f,a*=f,o=r*(r+l*a+2*h)+a*(l*r+a+2*u)+p}else a=c,r=Math.max(0,-(l*a+h)),o=-r*r+a*(a+2*u)+p;else a=-c,r=Math.max(0,-(l*a+h)),o=-r*r+a*(a+2*u)+p;else a<=-s?(r=Math.max(0,-(-l*c+h)),a=r>0?-c:Math.min(Math.max(-c,-u),c),o=-r*r+a*(a+2*u)+p):a<=s?(r=0,a=Math.min(Math.max(-c,-u),c),o=a*(a+2*u)+p):(r=Math.max(0,-(l*c+h)),a=r>0?c:Math.min(Math.max(-c,-u),c),o=-r*r+a*(a+2*u)+p);else a=l>0?-c:c,r=Math.max(0,-(l*a+h)),o=-r*r+a*(a+2*u)+p;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(fh).multiplyScalar(a).add(dh),o},intersectSphere:function(e,t){ph.subVectors(e.center,this.origin);var n=ph.dot(this.direction),i=ph.dot(ph)-n*n,r=e.radius*e.radius;if(i>r)return null;var a=Math.sqrt(r-i),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,i,r,a,o,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(e.min.x-u.x)*c,i=(e.max.x-u.x)*c):(n=(e.max.x-u.x)*c,i=(e.min.x-u.x)*c),l>=0?(r=(e.min.y-u.y)*l,a=(e.max.y-u.y)*l):(r=(e.max.y-u.y)*l,a=(e.min.y-u.y)*l),n>a||r>i?null:((r>n||n!==n)&&(n=r),(a<i||i!==i)&&(i=a),h>=0?(o=(e.min.z-u.z)*h,s=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,s=(e.min.z-u.z)*h),n>s||o>i?null:((o>n||n!==n)&&(n=o),(s<i||i!==i)&&(i=s),i<0?null:this.at(n>=0?n:i,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,ph)},intersectTriangle:function(e,t,n,i,r){vh.subVectors(t,e),gh.subVectors(n,e),yh.crossVectors(vh,gh);var a,o=this.direction.dot(yh);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}mh.subVectors(this.origin,e);var s=a*this.direction.dot(gh.crossVectors(mh,gh));if(s<0)return null;var c=a*this.direction.dot(vh.cross(mh));if(c<0)return null;if(s+c>o)return null;var l=-a*mh.dot(yh);return l<0?null:this.at(l/o,r)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var xh=new l,bh=new l,wh=new i;Object.assign(x.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var i=xh.subVectors(n,t).cross(bh.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new l),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new l);var n=e.delta(xh),i=this.normal.dot(n);if(0!==i){var r=-(e.start.dot(this.normal)+this.constant)/i;if(!(r<0||r>1))return t.copy(n).multiplyScalar(r).add(e.start)}else if(0===this.distanceToPoint(e.start))return t.copy(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new l),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||wh.getNormalMatrix(e),i=this.coplanarPoint(xh).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var _h=new l,Mh=new l,Th=new l,Eh=new l,Sh=new l,Ah=new l,Lh=new l,Rh=new l,Ph=new l,Ch=new l;Object.assign(b,{getNormal:function(e,t,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new l),i.subVectors(n,t),_h.subVectors(e,t),i.cross(_h);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(e,t,n,i,r){_h.subVectors(i,t),Mh.subVectors(n,t),Th.subVectors(e,t);var a=_h.dot(_h),o=_h.dot(Mh),s=_h.dot(Th),c=Mh.dot(Mh),h=Mh.dot(Th),u=a*c-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new l),0===u)return r.set(-2,-1,-1);var p=1/u,d=(c*s-o*h)*p,f=(a*h-o*s)*p;return r.set(1-d-f,f,d)},containsPoint:function(e,t,n,i){return b.getBarycoord(e,t,n,i,Eh),Eh.x>=0&&Eh.y>=0&&Eh.x+Eh.y<=1},getUV:function(e,t,n,i,r,a,o,s){return this.getBarycoord(e,t,n,i,Eh),s.set(0,0),s.addScaledVector(r,Eh.x),s.addScaledVector(a,Eh.y),s.addScaledVector(o,Eh.z),s},isFrontFacing:function(e,t,n,i){return _h.subVectors(n,t),Mh.subVectors(e,t),_h.cross(Mh).dot(i)<0}}),Object.assign(b.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return _h.subVectors(this.c,this.b),Mh.subVectors(this.a,this.b),.5*_h.cross(Mh).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new l),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return b.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new x),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return b.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,i,r){return b.getUV(e,this.a,this.b,this.c,t,n,i,r)},containsPoint:function(e){return b.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return b.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new l);var n,i,r=this.a,a=this.b,o=this.c;Sh.subVectors(a,r),Ah.subVectors(o,r),Rh.subVectors(e,r);var s=Sh.dot(Rh),c=Ah.dot(Rh);if(s<=0&&c<=0)return t.copy(r);Ph.subVectors(e,a);var h=Sh.dot(Ph),u=Ah.dot(Ph);if(h>=0&&u<=h)return t.copy(a);var p=s*u-h*c;if(p<=0&&s>=0&&h<=0)return n=s/(s-h),t.copy(r).addScaledVector(Sh,n);Ch.subVectors(e,o);var d=Sh.dot(Ch),f=Ah.dot(Ch);if(f>=0&&d<=f)return t.copy(o);var m=d*c-s*f;if(m<=0&&c>=0&&f<=0)return i=c/(c-f),t.copy(r).addScaledVector(Ah,i);var v=h*f-d*u;if(v<=0&&u-h>=0&&d-f>=0)return Lh.subVectors(o,a),i=(u-h)/(u-h+(d-f)),t.copy(a).addScaledVector(Lh,i);var g=1/(v+m+p);return n=m*g,i=p*g,t.copy(r).addScaledVector(Sh,n).addScaledVector(Ah,i)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var Oh={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,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,rebeccapurple:6697881,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},Dh={h:0,s:0,l:0},Ih={h:0,s:0,l:0};Object.assign(w.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=Tl.euclideanModulo(e,1),t=Tl.clamp(t,0,1),n=Tl.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=_(r,i,e+1/3),this.g=_(r,i,e),this.b=_(r,i,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=n[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=Oh[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=M(e.r),this.g=M(e.g),this.b=M(e.b),this},copyLinearToSRGB:function(e){return this.r=T(e.r),this.g=T(e.g),this.b=T(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),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(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),c=(s+o)/2;if(s===o)t=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case i:t=(r-a)/l+(r<a?6:0);break;case r:t=(a-i)/l+2;break;case a:t=(i-r)/l+4}t/=6}return e.h=t,e.s=n,e.l=c,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(Dh),Dh.h+=e,Dh.s+=t,Dh.l+=n,this.setHSL(Dh.h,Dh.s,Dh.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(Dh),e.getHSL(Ih);var n=Tl.lerp(Dh.h,Ih.h,t),i=Tl.lerp(Dh.s,Ih.s,t),r=Tl.lerp(Dh.l,Ih.l,t);return this.setHSL(n,i,r),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),w.NAMES=Oh,Object.assign(E.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Nh=0;S.prototype=Object.assign(Object.create(t.prototype),{constructor:S,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){function t(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}var n=void 0===e||"string"==typeof e;n&&(e={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,i.reflectivity=this.reflectivity,i.refractionRatio=this.refractionRatio,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ls&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),this.side!==ns&&(i.side=this.side),this.vertexColors!==as&&(i.vertexColors=this.vertexColors),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.morphNormals&&(i.morphNormals=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),n){var r=t(e.textures),a=t(e.images);r.length>0&&(i.textures=r),a.length>0&&(i.images=a)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var i=t.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(S.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),A.prototype=Object.create(S.prototype),A.prototype.constructor=A,A.prototype.isMeshBasicMaterial=!0,A.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var Bh=new l;Object.defineProperty(L.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(L.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new w),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,i=0,r=0,a=e.length;r<a;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new n),t[i++]=o.x,t[i++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new l),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var o=e[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new a),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)Bh.x=this.getX(t),Bh.y=this.getY(t),Bh.z=this.getZ(t),Bh.applyMatrix3(e),this.setXYZ(t,Bh.x,Bh.y,Bh.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Bh.x=this.getX(t),Bh.y=this.getY(t),Bh.z=this.getZ(t),Bh.applyMatrix4(e),this.setXYZ(t,Bh.x,Bh.y,Bh.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Bh.x=this.getX(t),Bh.y=this.getY(t),Bh.z=this.getZ(t),Bh.applyNormalMatrix(e),this.setXYZ(t,Bh.x,Bh.y,Bh.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Bh.x=this.getX(t),Bh.y=this.getY(t),Bh.z=this.getZ(t),Bh.transformDirection(e),this.setXYZ(t,Bh.x,Bh.y,Bh.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),R.prototype=Object.create(L.prototype),R.prototype.constructor=R,P.prototype=Object.create(L.prototype),P.prototype.constructor=P,C.prototype=Object.create(L.prototype),C.prototype.constructor=C,O.prototype=Object.create(L.prototype),O.prototype.constructor=O,D.prototype=Object.create(L.prototype),D.prototype.constructor=D,I.prototype=Object.create(L.prototype),I.prototype.constructor=I,N.prototype=Object.create(L.prototype),N.prototype.constructor=N,B.prototype=Object.create(L.prototype),B.prototype.constructor=B,z.prototype=Object.create(L.prototype),z.prototype.constructor=z,Object.assign(F.prototype,{computeGroups:function(e){for(var t,n=[],i=void 0,r=e.faces,a=0;a<r.length;a++){var o=r[a]
- ;o.materialIndex!==i&&(i=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:i})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,i=e.faces,r=e.vertices,a=e.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,c=e.morphTargets,l=c.length;if(l>0){t=[];for(var h=0;h<l;h++)t[h]={name:c[h].name,data:[]};this.morphTargets.position=t}var u,p=e.morphNormals,d=p.length;if(d>0){u=[];for(var h=0;h<d;h++)u[h]={name:p[h].name,data:[]};this.morphTargets.normal=u}var f=e.skinIndices,m=e.skinWeights,v=f.length===r.length,g=m.length===r.length;r.length>0&&0===i.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var h=0;h<i.length;h++){var y=i[h];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 b=y.normal;this.normals.push(b,b,b)}var w=y.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var _=y.color;this.colors.push(_,_,_)}if(!0===o){var M=a[0][h];void 0!==M?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new n,new n,new n))}if(!0===s){var M=a[1][h];void 0!==M?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new n,new n,new n))}for(var T=0;T<l;T++){var E=c[T].vertices;t[T].data.push(E[y.a],E[y.b],E[y.c])}for(var T=0;T<d;T++){var S=p[T].vertexNormals[h];u[T].data.push(S.a,S.b,S.c)}v&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),g&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var zh=1,Fh=new h,Uh=new d,Gh=new l,Hh=new m,Vh=new m,jh=new l;G.prototype=Object.assign(Object.create(t.prototype),{constructor:G,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(U(e)>65535?N:D)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new i).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var a=this.attributes.tangent;return void 0!==a&&(a.transformDirection(e),a.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Fh.makeRotationX(e),this.applyMatrix4(Fh),this},rotateY:function(e){return Fh.makeRotationY(e),this.applyMatrix4(Fh),this},rotateZ:function(e){return Fh.makeRotationZ(e),this.applyMatrix4(Fh),this},translate:function(e,t,n){return Fh.makeTranslation(e,t,n),this.applyMatrix4(Fh),this},scale:function(e,t,n){return Fh.makeScale(e,t,n),this.applyMatrix4(Fh),this},lookAt:function(e){return Uh.lookAt(e),Uh.updateMatrix(),this.applyMatrix4(Uh.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gh).negate(),this.translate(Gh.x,Gh.y,Gh.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new B(3*t.vertices.length,3),i=new B(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new B(t.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new B(t,3)),this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var n=t.__directGeometry;if(!0===t.elementsNeedUpdate&&(n=void 0,t.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(t);n.verticesNeedUpdate=t.verticesNeedUpdate,n.normalsNeedUpdate=t.normalsNeedUpdate,n.colorsNeedUpdate=t.colorsNeedUpdate,n.uvsNeedUpdate=t.uvsNeedUpdate,n.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=n}var i;return!0===t.verticesNeedUpdate&&(i=this.attributes.position,void 0!==i&&(i.copyVector3sArray(t.vertices),i.needsUpdate=!0),t.verticesNeedUpdate=!1),!0===t.normalsNeedUpdate&&(i=this.attributes.normal,void 0!==i&&(i.copyVector3sArray(t.normals),i.needsUpdate=!0),t.normalsNeedUpdate=!1),!0===t.colorsNeedUpdate&&(i=this.attributes.color,void 0!==i&&(i.copyColorsArray(t.colors),i.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(i=this.attributes.uv,void 0!==i&&(i.copyVector2sArray(t.uvs),i.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(i=this.attributes.lineDistance,void 0!==i&&(i.copyArray(t.lineDistances),i.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new F).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new L(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new L(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(3*e.colors.length);this.setAttribute("color",new L(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new L(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new L(a,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(var o in e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,h=c.length;l<h;l++){var u=c[l],p=new B(3*u.data.length,3);p.name=u.name,s.push(p.copyVector3sArray(u.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var d=new B(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new B(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new m);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,i=t.length;n<i;n++){var r=t[n];Hh.setFromBufferAttribute(r),this.morphTargetsRelative?(jh.addVectors(this.boundingBox.min,Hh.min),this.boundingBox.expandByPoint(jh),jh.addVectors(this.boundingBox.max,Hh.max),this.boundingBox.expandByPoint(jh)):(this.boundingBox.expandByPoint(Hh.min),this.boundingBox.expandByPoint(Hh.max))}}else 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(){null===this.boundingSphere&&(this.boundingSphere=new g);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(Hh.setFromBufferAttribute(e),t)for(var i=0,r=t.length;i<r;i++){var a=t[i];Vh.setFromBufferAttribute(a),this.morphTargetsRelative?(jh.addVectors(Hh.min,Vh.min),Hh.expandByPoint(jh),jh.addVectors(Hh.max,Vh.max),Hh.expandByPoint(jh)):(Hh.expandByPoint(Vh.min),Hh.expandByPoint(Vh.max))}Hh.getCenter(n);for(var o=0,i=0,r=e.count;i<r;i++)jh.fromBufferAttribute(e,i),o=Math.max(o,n.distanceToSquared(jh));if(t)for(var i=0,r=t.length;i<r;i++)for(var a=t[i],s=this.morphTargetsRelative,c=0,l=a.count;c<l;c++)jh.fromBufferAttribute(a,c),s&&(Gh.fromBufferAttribute(e,c),jh.add(Gh)),o=Math.max(o,n.distanceToSquared(jh));this.boundingSphere.radius=Math.sqrt(o),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 e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new L(new Float32Array(n.length),3));else for(var i=t.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,c,h=t.normal.array,u=new l,p=new l,d=new l,f=new l,m=new l;if(e)for(var v=e.array,r=0,a=e.count;r<a;r+=3)o=3*v[r+0],s=3*v[r+1],c=3*v[r+2],u.fromArray(n,o),p.fromArray(n,s),d.fromArray(n,c),f.subVectors(d,p),m.subVectors(u,p),f.cross(m),h[o]+=f.x,h[o+1]+=f.y,h[o+2]+=f.z,h[s]+=f.x,h[s+1]+=f.y,h[s+2]+=f.z,h[c]+=f.x,h[c+1]+=f.y,h[c+2]+=f.z;else for(var r=0,a=n.length;r<a;r+=9)u.fromArray(n,r),p.fromArray(n,r+3),d.fromArray(n,r+6),f.subVectors(d,p),m.subVectors(u,p),f.cross(m),h[r]=f.x,h[r+1]=f.y,h[r+2]=f.z,h[r+3]=f.x,h[r+4]=f.y,h[r+5]=f.z,h[r+6]=f.x,h[r+7]=f.y,h[r+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==e.attributes[i])for(var r=n[i],a=r.array,o=e.attributes[i],s=o.array,c=o.itemSize*t,l=Math.min(s.length,a.length-c),h=0,u=c;h<l;h++,u++)a[u]=s[h];return this},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)jh.x=e.getX(t),jh.y=e.getY(t),jh.z=e.getZ(t),jh.normalize(),e.setXYZ(t,jh.x,jh.y,jh.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,i=e.itemSize,r=new n.constructor(t.length*i),a=0,o=0,s=0,c=t.length;s<c;s++){a=t[s]*i;for(var l=0;l<i;l++)r[o++]=n[a++]}return new L(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new G,n=this.index.array,i=this.attributes;for(var r in i){var a=i[r],o=e(a,n);t.setAttribute(r,o)}var s=this.morphAttributes;for(r in s){for(var c=[],l=s[r],h=0,u=l.length;h<u;h++){var a=l[h],o=e(a,n);c.push(o)}t.morphAttributes[r]=c}t.morphTargetsRelative=this.morphTargetsRelative;for(var p=this.groups,h=0,d=p.length;h<d;h++){var f=p[h];t.addGroup(f.start,f.count,f.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var i=this.index;null!==i&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=r[n],o=a.toJSON();""!==a.name&&(o.name=a.name),e.data.attributes[n]=o}var s={},c=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],h=[],u=0,p=l.length;u<p;u++){var a=l[u],o=a.toJSON();""!==a.name&&(o.name=a.name),h.push(o)}h.length>0&&(s[n]=h,c=!0)}c&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new G).copy(this)},copy:function(e){var t,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,i=l.length;n<i;n++)c.push(l[n].clone());this.morphAttributes[t]=c}this.morphTargetsRelative=e.morphTargetsRelative;var h=e.groups;for(n=0,i=h.length;n<i;n++){var u=h[n];this.addGroup(u.start,u.count,u.materialIndex)}var p=e.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var kh=new h,Wh=new y,qh=new g,Xh=new l,Yh=new l,Zh=new l,Jh=new l,Qh=new l,Kh=new l,$h=new l,eu=new l,tu=new l,nu=new n,iu=new n,ru=new n,au=new l,ou=new l;H.prototype=Object.assign(Object.create(d.prototype),{constructor:H,isMesh:!0,copy:function(e){return d.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),qh.copy(i.boundingSphere),qh.applyMatrix4(a),!1!==e.ray.intersectsSphere(qh)&&(kh.getInverse(a),Wh.copy(e.ray).applyMatrix4(kh),null===i.boundingBox||!1!==Wh.intersectsBox(i.boundingBox)))){var o;if(i.isBufferGeometry){var s,c,l,h,u,p,d,f,m,v,g,y=i.index,x=i.attributes.position,w=i.morphAttributes.position,_=i.morphTargetsRelative,M=i.attributes.uv,T=i.attributes.uv2,E=i.groups,S=i.drawRange;if(null!==y)if(Array.isArray(r))for(h=0,p=E.length;h<p;h++)for(f=E[h],m=r[f.materialIndex],v=Math.max(f.start,S.start),g=Math.min(f.start+f.count,S.start+S.count),u=v,d=g;u<d;u+=3)s=y.getX(u),c=y.getX(u+1),l=y.getX(u+2),(o=j(this,m,e,Wh,x,w,_,M,T,s,c,l))&&(o.faceIndex=Math.floor(u/3),o.face.materialIndex=f.materialIndex,t.push(o));else for(v=Math.max(0,S.start),g=Math.min(y.count,S.start+S.count),h=v,p=g;h<p;h+=3)s=y.getX(h),c=y.getX(h+1),l=y.getX(h+2),(o=j(this,r,e,Wh,x,w,_,M,T,s,c,l))&&(o.faceIndex=Math.floor(h/3),t.push(o));else if(void 0!==x)if(Array.isArray(r))for(h=0,p=E.length;h<p;h++)for(f=E[h],m=r[f.materialIndex],v=Math.max(f.start,S.start),g=Math.min(f.start+f.count,S.start+S.count),u=v,d=g;u<d;u+=3)s=u,c=u+1,l=u+2,(o=j(this,m,e,Wh,x,w,_,M,T,s,c,l))&&(o.faceIndex=Math.floor(u/3),o.face.materialIndex=f.materialIndex,t.push(o));else for(v=Math.max(0,S.start),g=Math.min(x.count,S.start+S.count),h=v,p=g;h<p;h+=3)s=h,c=h+1,l=h+2,(o=j(this,r,e,Wh,x,w,_,M,T,s,c,l))&&(o.faceIndex=Math.floor(h/3),t.push(o))}else if(i.isGeometry){var A,L,R,P,C=Array.isArray(r),O=i.vertices,D=i.faces,I=i.faceVertexUvs[0];I.length>0&&(P=I);for(var N=0,B=D.length;N<B;N++){var z=D[N],F=C?r[z.materialIndex]:r;if(void 0!==F&&(A=O[z.a],L=O[z.b],R=O[z.c],o=V(this,F,e,Wh,A,L,R,au))){if(P&&P[N]){var U=P[N];nu.copy(U[0]),iu.copy(U[1]),ru.copy(U[2]),o.uv=b.getUV(au,A,L,R,nu,iu,ru,new n)}o.face=z,o.faceIndex=N,t.push(o)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var su=0,cu=new h,lu=new d,hu=new l;k.prototype=Object.assign(Object.create(t.prototype),{constructor:k,isGeometry:!0,applyMatrix4:function(e){for(var t=(new i).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(var n=0,r=this.faces.length;n<r;n++){var a=this.faces[n];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return cu.makeRotationX(e),this.applyMatrix4(cu),this},rotateY:function(e){return cu.makeRotationY(e),this.applyMatrix4(cu),this},rotateZ:function(e){return cu.makeRotationZ(e),this.applyMatrix4(cu),this},translate:function(e,t,n){return cu.makeTranslation(e,t,n),this.applyMatrix4(cu),this},scale:function(e,t,n){return cu.makeScale(e,t,n),this.applyMatrix4(cu),this},lookAt:function(e){return lu.lookAt(e),lu.updateMatrix(),this.applyMatrix4(lu.matrix),this},fromBufferGeometry:function(e){function t(e,t,r,a){var o=void 0===c?[]:[i.colors[e].clone(),i.colors[t].clone(),i.colors[r].clone()],p=void 0===s?[]:[(new l).fromArray(s,3*e),(new l).fromArray(s,3*t),(new l).fromArray(s,3*r)],d=new E(e,t,r,p,o,a);i.faces.push(d),void 0!==h&&i.faceVertexUvs[0].push([(new n).fromArray(h,2*e),(new n).fromArray(h,2*t),(new n).fromArray(h,2*r)]),void 0!==u&&i.faceVertexUvs[1].push([(new n).fromArray(u,2*e),(new n).fromArray(u,2*t),(new n).fromArray(u,2*r)])}var i=this,r=null!==e.index?e.index.array:void 0,a=e.attributes;if(void 0===a.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var o=a.position.array,s=void 0!==a.normal?a.normal.array:void 0,c=void 0!==a.color?a.color.array:void 0,h=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=0;p<o.length;p+=3)i.vertices.push((new l).fromArray(o,p)),void 0!==c&&i.colors.push((new w).fromArray(c,p));var d=e.groups;if(d.length>0)for(var p=0;p<d.length;p++)for(var f=d[p],m=f.start,v=f.count,g=m,y=m+v;g<y;g+=3)void 0!==r?t(r[g],r[g+1],r[g+2],f.materialIndex):t(g,g+1,g+2,f.materialIndex);else if(void 0!==r)for(var p=0;p<r.length;p+=3)t(r[p],r[p+1],r[p+2]);else for(var p=0;p<o.length/3;p+=3)t(p,p+1,p+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(hu).negate(),this.translate(hu.x,hu.y,hu.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,i=new h;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){for(var e=new l,t=new l,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);var t,n,i,r,a,o;for(o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new l;if(e){var s,c,h,u=new l,p=new l;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],s=this.vertices[a.a],c=this.vertices[a.b],h=this.vertices[a.c],u.subVectors(h,c),p.subVectors(s,c),u.cross(p),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)a=this.faces[i],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(i=0,r=this.faces.length;i<r;i++){a=this.faces[i];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 e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){n=this.faces[e];var i=n.vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for(r=this.faces[n],r.__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var a=new k;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o,s,c=this.morphNormals[e].faceNormals,h=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)o=new l,s={a:new l,b:new l,c:new l},c.push(o),h.push(s)}var u=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var o,s;for(n=0,i=this.faces.length;n<i;n++)r=this.faces[n],o=u.faceNormals[n],s=u.vertexNormals[n],o.copy(r.normal),s.a.copy(r.vertexNormals[0]),s.b.copy(r.vertexNormals[1]),s.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)r=this.faces[n],r.normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new m),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new g),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(!e||!e.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);var r,a=this.vertices.length,o=this.vertices,s=e.vertices,c=this.faces,l=e.faces,h=this.colors,u=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new i).getNormalMatrix(t));for(var p=0,d=s.length;p<d;p++){var f=s[p],m=f.clone();void 0!==t&&m.applyMatrix4(t),o.push(m)}for(var p=0,d=u.length;p<d;p++)h.push(u[p].clone());for(p=0,d=l.length;p<d;p++){var v,g,y,x=l[p],b=x.vertexNormals,w=x.vertexColors;v=new E(x.a+a,x.b+a,x.c+a),v.normal.copy(x.normal),void 0!==r&&v.normal.applyMatrix3(r).normalize();for(var _=0,M=b.length;_<M;_++)g=b[_].clone(),void 0!==r&&g.applyMatrix3(r).normalize(),v.vertexNormals.push(g);v.color.copy(x.color);for(var _=0,M=w.length;_<M;_++)y=w[_],v.vertexColors.push(y.clone());v.materialIndex=x.materialIndex+n,c.push(v)}for(var p=0,d=e.faceVertexUvs.length;p<d;p++){var T=e.faceVertexUvs[p];void 0===this.faceVertexUvs[p]&&(this.faceVertexUvs[p]=[]);for(var _=0,M=T.length;_<M;_++){for(var S=T[_],A=[],L=0,R=S.length;L<R;L++)A.push(S[L].clone());this.faceVertexUvs[p].push(A)}}},mergeMesh:function(e){if(!e||!e.isMesh)return void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)},mergeVertices:function(){var e,t,n,i,r,a,o,s,c={},l=[],h=[],u=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)e=this.vertices[n],t=Math.round(e.x*u)+"_"+Math.round(e.y*u)+"_"+Math.round(e.z*u),void 0===c[t]?(c[t]=n,l.push(this.vertices[n]),h[n]=l.length-1):h[n]=h[c[t]];var p=[];for(n=0,i=this.faces.length;n<i;n++){r=this.faces[n],r.a=h[r.a],r.b=h[r.b],r.c=h[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(n);break}}for(n=p.length-1;n>=0;n--){var f=p[n];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-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new l(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){function e(e,t){return e.materialIndex-t.materialIndex}for(var t=this.faces,n=t.length,i=0;i<n;i++)t[i]._id=i;t.sort(e);var r,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===n&&(r=[]),s&&s.length===n&&(a=[]);for(var i=0;i<n;i++){var c=t[i]._id;r&&r.push(o[c]),a&&a.push(s[c])}r&&(this.faceVertexUvs[0]=r),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){function e(e,t,n){return n?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==p[t]?p[t]:(p[t]=u.length/3,u.push(e.x,e.y,e.z),p[t])}function n(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==f[t]?f[t]:(f[t]=d.length,d.push(e.getHex()),f[t])}function i(e){var t=e.x.toString()+e.y.toString();return void 0!==v[t]?v[t]:(v[t]=m.length/2,m.push(e.x,e.y),v[t])}var r={metadata:{version:4.5,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 l=this.vertices[c];s.push(l.x,l.y,l.z)}for(var h=[],u=[],p={},d=[],f={},m=[],v={},c=0;c<this.faces.length;c++){var g=this.faces[c],y=void 0!==this.faceVertexUvs[0][c],x=g.normal.length()>0,b=g.vertexNormals.length>0,w=1!==g.color.r||1!==g.color.g||1!==g.color.b,_=g.vertexColors.length>0,M=0;if(M=e(M,0,0),M=e(M,1,!0),M=e(M,2,!1),M=e(M,3,y),M=e(M,4,x),M=e(M,5,b),M=e(M,6,w),M=e(M,7,_),h.push(M),h.push(g.a,g.b,g.c),h.push(g.materialIndex),y){var T=this.faceVertexUvs[0][c];h.push(i(T[0]),i(T[1]),i(T[2]))}if(x&&h.push(t(g.normal)),b){var E=g.vertexNormals;h.push(t(E[0]),t(E[1]),t(E[2]))}if(w&&h.push(n(g.color)),_){var S=g.vertexColors;h.push(n(S[0]),n(S[1]),n(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=h,r},clone:function(){return(new k).copy(this)},copy:function(e){var t,n,i,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=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var h=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),i=0,r=h.length;i<r;i++){var u=h[i],p=[];for(a=0,o=u.length;a<o;a++){var d=u[a];p.push(d.clone())}this.faceVertexUvs[t].push(p)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],i=0,r=f[t].vertices.length;i<r;i++)m.vertices.push(f[t].vertices[i].clone());if(void 0!==f[t].normals)for(m.normals=[],i=0,r=f[t].normals.length;i<r;i++)m.normals.push(f[t].normals[i].clone());this.morphTargets.push(m)}var v=e.morphNormals;for(t=0,n=v.length;t<n;t++){var g={};if(void 0!==v[t].vertexNormals)for(g.vertexNormals=[],i=0,r=v[t].vertexNormals.length;i<r;i++){var y=v[t].vertexNormals[i],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[t].faceNormals)for(g.faceNormals=[],i=0,r=v[t].faceNormals.length;i<r;i++)g.faceNormals.push(v[t].faceNormals[i].clone());this.morphNormals.push(g)}var b=e.skinWeights;for(t=0,n=b.length;t<n;t++)this.skinWeights.push(b[t].clone());var w=e.skinIndices;for(t=0,n=w.length;t<n;t++)this.skinIndices.push(w[t].clone());var _=e.lineDistances;for(t=0,n=_.length;t<n;t++)this.lineDistances.push(_[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var T=e.boundingSphere;return null!==T&&(this.boundingSphere=T.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var uu=function(e){function t(t,n,i,r,a,o){e.call(this),this.type="BoxGeometry",this.parameters={width:t,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o},this.fromBufferGeometry(new pu(t,n,i,r,a,o)),this.mergeVertices()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(k),pu=function(e){function t(t,n,i,r,a,o){function s(e,t,n,i,r,a,o,s,v,g,y){var x,b,w=a/v,_=o/g,M=a/2,T=o/2,E=s/2,S=v+1,A=g+1,L=0,R=0,P=new l;for(b=0;b<A;b++){var C=b*_-T;for(x=0;x<S;x++){var O=x*w-M;P[e]=O*i,P[t]=C*r,P[n]=E,u.push(P.x,P.y,P.z),P[e]=0,P[t]=0,P[n]=s>0?1:-1,p.push(P.x,P.y,P.z),d.push(x/v),d.push(1-b/g),L+=1}}for(b=0;b<g;b++)for(x=0;x<v;x++){var D=f+x+S*b,I=f+x+S*(b+1),N=f+(x+1)+S*(b+1),B=f+(x+1)+S*b;h.push(D,I,B),h.push(I,N,B),R+=6}c.addGroup(m,R,y),m+=R,f+=L}e.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o};var c=this;t=t||1,n=n||1,i=i||1,r=Math.floor(r)||1,a=Math.floor(a)||1,o=Math.floor(o)||1;var h=[],u=[],p=[],d=[],f=0,m=0;s("z","y","x",-1,-1,i,n,t,o,a,0),s("z","y","x",1,-1,i,n,-t,o,a,1),s("x","z","y",1,1,t,i,n,r,o,2),s("x","z","y",1,-1,t,i,-n,r,o,3),s("x","y","z",1,-1,t,n,i,r,a,4),s("x","y","z",-1,-1,t,n,-i,r,a,5),this.setIndex(h),this.setAttribute("position",new B(u,3)),this.setAttribute("normal",new B(p,3)),this.setAttribute("uv",new B(d,2))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(G),du={clone:W,merge:q},fu="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",mu="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";X.prototype=Object.create(S.prototype),X.prototype.constructor=X,X.prototype.isShaderMaterial=!0,X.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=W(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},X.prototype.toJSON=function(e){var t=S.prototype.toJSON.call(this,e);t.uniforms={};for(var n in this.uniforms){var i=this.uniforms[n],r=i.value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var a={};for(var o in this.extensions)!0===this.extensions[o]&&(a[o]=!0);return Object.keys(a).length>0&&(t.extensions=a),t},Y.prototype=Object.assign(Object.create(d.prototype),{constructor:Y,isCamera:!0,copy:function(e,t){return d.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),
- this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new l),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){d.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){d.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Z.prototype=Object.assign(Object.create(Y.prototype),{constructor:Z,isPerspectiveCamera:!0,copy:function(e,t){return Y.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Tl.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Tl.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Tl.RAD2DEG*Math.atan(Math.tan(.5*Tl.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(e,t,n,i,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Tl.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,t-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(r+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=d.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var vu=90,gu=1;J.prototype=Object.create(d.prototype),J.prototype.constructor=J,Q.prototype=Object.create(o.prototype),Q.prototype.constructor=Q,Q.prototype.isWebGLCubeRenderTarget=!0,Q.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new f,i={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new X({type:"CubemapFromEquirect",uniforms:W(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:is,blending:cs});r.uniforms.tEquirect.value=t;var a=new H(new pu(5,5,5),r);n.add(a);var o=new J(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},K.prototype=Object.create(r.prototype),K.prototype.constructor=K,K.prototype.isDataTexture=!0;var yu=new g,xu=new l;Object.assign($.prototype,{set:function(e,t,n,i,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],h=n[7],u=n[8],p=n[9],d=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return t[0].setComponents(o-i,h-s,f-u,y-m).normalize(),t[1].setComponents(o+i,h+s,f+u,y+m).normalize(),t[2].setComponents(o+r,h+c,f+p,y+v).normalize(),t[3].setComponents(o-r,h-c,f-p,y-v).normalize(),t[4].setComponents(o-a,h-l,f-d,y-g).normalize(),t[5].setComponents(o+a,h+l,f+d,y+g).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),yu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(yu)},intersectsSprite:function(e){return yu.center.set(0,0,0),yu.radius=.7071067811865476,yu.applyMatrix4(e.matrixWorld),this.intersectsSphere(yu)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,i=-e.radius,r=0;r<6;r++){if(t[r].distanceToPoint(n)<i)return!1}return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if(xu.x=i.normal.x>0?e.max.x:e.min.x,xu.y=i.normal.y>0?e.max.y:e.min.y,xu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(xu)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var bu={common:{diffuse:{value:new w(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new i},uv2Transform:{value:new i},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},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 n(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:[]},lightProbe:{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:{},shadowCameraNear:{},shadowCameraFar:{}}},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},alphaMap:{value:null},uvTransform:{value:new i}},sprite:{diffuse:{value:new w(15658734)},opacity:{value:1},center:{value:new n(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new i}}};ne.prototype=Object.create(k.prototype),ne.prototype.constructor=ne,ie.prototype=Object.create(G.prototype),ie.prototype.constructor=ie;var wu={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",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( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\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}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( 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 LTC_Uv( const in vec3 N, const in vec3 V, 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\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",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#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(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}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\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#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",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.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\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.a );\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.a );\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.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, 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.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.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 = cLogLuvM * value.rgb;\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 = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = 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\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\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",
- envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\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\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 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 roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, 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\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 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",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\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",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\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",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",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",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 = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\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\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\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 ltc_1;\tuniform sampler2D ltc_2;\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",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\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_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",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};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial 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\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_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#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 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\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#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\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 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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\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}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? 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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? 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\t#pragma unroll_loop\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 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\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#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * 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 defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\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 *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",
- normal_fragment_begin:"#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 );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\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}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\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\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\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( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), 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( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), 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 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\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, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\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",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\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 highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\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",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\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",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\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",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\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\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}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).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\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\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( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\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#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\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}",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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_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\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * 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 <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\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}",
- meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\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#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\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 <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\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_begin>\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}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_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 <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_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 <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\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 <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_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_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\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 <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 <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_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}",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 <dithering_pars_fragment>\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\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_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\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 <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_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}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\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 <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_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 <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\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 <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\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_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}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\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>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#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 <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\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_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\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_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 <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#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\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},_u={basic:{uniforms:q([bu.common,bu.specularmap,bu.envmap,bu.aomap,bu.lightmap,bu.fog]),vertexShader:wu.meshbasic_vert,fragmentShader:wu.meshbasic_frag},lambert:{uniforms:q([bu.common,bu.specularmap,bu.envmap,bu.aomap,bu.lightmap,bu.emissivemap,bu.fog,bu.lights,{emissive:{value:new w(0)}}]),vertexShader:wu.meshlambert_vert,fragmentShader:wu.meshlambert_frag},phong:{uniforms:q([bu.common,bu.specularmap,bu.envmap,bu.aomap,bu.lightmap,bu.emissivemap,bu.bumpmap,bu.normalmap,bu.displacementmap,bu.fog,bu.lights,{emissive:{value:new w(0)},specular:{value:new w(1118481)},shininess:{value:30}}]),vertexShader:wu.meshphong_vert,fragmentShader:wu.meshphong_frag},standard:{uniforms:q([bu.common,bu.envmap,bu.aomap,bu.lightmap,bu.emissivemap,bu.bumpmap,bu.normalmap,bu.displacementmap,bu.roughnessmap,bu.metalnessmap,bu.fog,bu.lights,{emissive:{value:new w(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:wu.meshphysical_vert,fragmentShader:wu.meshphysical_frag},toon:{uniforms:q([bu.common,bu.specularmap,bu.aomap,bu.lightmap,bu.emissivemap,bu.bumpmap,bu.normalmap,bu.displacementmap,bu.gradientmap,bu.fog,bu.lights,{emissive:{value:new w(0)},specular:{value:new w(1118481)},shininess:{value:30}}]),vertexShader:wu.meshtoon_vert,fragmentShader:wu.meshtoon_frag},matcap:{uniforms:q([bu.common,bu.bumpmap,bu.normalmap,bu.displacementmap,bu.fog,{matcap:{value:null}}]),vertexShader:wu.meshmatcap_vert,fragmentShader:wu.meshmatcap_frag},points:{uniforms:q([bu.points,bu.fog]),vertexShader:wu.points_vert,fragmentShader:wu.points_frag},dashed:{uniforms:q([bu.common,bu.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wu.linedashed_vert,fragmentShader:wu.linedashed_frag},depth:{uniforms:q([bu.common,bu.displacementmap]),vertexShader:wu.depth_vert,fragmentShader:wu.depth_frag},normal:{uniforms:q([bu.common,bu.bumpmap,bu.normalmap,bu.displacementmap,{opacity:{value:1}}]),vertexShader:wu.normal_vert,fragmentShader:wu.normal_frag},sprite:{uniforms:q([bu.sprite,bu.fog]),vertexShader:wu.sprite_vert,fragmentShader:wu.sprite_frag},background:{uniforms:{uvTransform:{value:new i},t2D:{value:null}},vertexShader:wu.background_vert,fragmentShader:wu.background_frag},cube:{uniforms:q([bu.envmap,{opacity:{value:1}}]),vertexShader:wu.cube_vert,fragmentShader:wu.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wu.equirect_vert,fragmentShader:wu.equirect_frag},distanceRGBA:{uniforms:q([bu.common,bu.displacementmap,{referencePosition:{value:new l},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wu.distanceRGBA_vert,fragmentShader:wu.distanceRGBA_frag},shadow:{uniforms:q([bu.lights,bu.fog,{color:{value:new w(0)},opacity:{value:1}}]),vertexShader:wu.shadow_vert,fragmentShader:wu.shadow_frag}};_u.physical={uniforms:q([_u.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new w(0)},clearcoatNormalScale:{value:new n(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:wu.meshphysical_vert,fragmentShader:wu.meshphysical_frag},me.prototype=Object.create(r.prototype),me.prototype.constructor=me,me.prototype.isCubeTexture=!0,Object.defineProperty(me.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),ve.prototype=Object.create(r.prototype),ve.prototype.constructor=ve,ve.prototype.isDataTexture2DArray=!0,ge.prototype=Object.create(r.prototype),ge.prototype.constructor=ge,ge.prototype.isDataTexture3D=!0;var Mu=new r,Tu=new ve,Eu=new ge,Su=new me,Au=[],Lu=[],Ru=new Float32Array(16),Pu=new Float32Array(9),Cu=new Float32Array(4);et.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),be(t,e)},tt.prototype.setValue=function(e,t,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(e,t[o.id],n)}};var Ou=/([\w\d_]+)(\])?(\[|\.)?/g;rt.prototype.setValue=function(e,t,n,i){var r=this.map[t];void 0!==r&&r.setValue(e,n,i)},rt.prototype.setOptional=function(e,t,n){var i=t[n];void 0!==i&&this.setValue(e,n,i)},rt.upload=function(e,t,n,i){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},rt.seqWithValue=function(e,t){for(var n=[],i=0,r=e.length;i!==r;++i){var a=e[i];a.id in t&&n.push(a)}return n};var Du=0,Iu=/^[ \t]*#include +<([\w\d.\/]+)>/gm,Nu=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Bu=0;Ut.prototype=Object.create(S.prototype),Ut.prototype.constructor=Ut,Ut.prototype.isMeshDepthMaterial=!0,Ut.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Gt.prototype=Object.create(S.prototype),Gt.prototype.constructor=Gt,Gt.prototype.isMeshDistanceMaterial=!0,Gt.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};var zu="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",Fu="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";Wt.prototype=Object.assign(Object.create(o.prototype),{constructor:Wt,isWebGLMultiviewRenderTarget:!0,copy:function(e){return o.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}}),Xt.prototype=Object.assign(Object.create(d.prototype),{constructor:Xt,isGroup:!0}),Yt.prototype=Object.assign(Object.create(Z.prototype),{constructor:Yt,isArrayCamera:!0});var Uu=new l,Gu=new l;Object.assign(Jt.prototype,t.prototype),Object.assign(Qt.prototype,t.prototype),Object.assign($t.prototype,{isFogExp2:!0,clone:function(){return new $t(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(en.prototype,{isFog:!0,clone:function(){return new en(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(tn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(tn.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var Hu=new l;Object.defineProperties(nn.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(nn.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)Hu.x=this.getX(t),Hu.y=this.getY(t),Hu.z=this.getZ(t),Hu.applyMatrix4(e),this.setXYZ(t,Hu.x,Hu.y,Hu.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){
- return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}}),rn.prototype=Object.create(S.prototype),rn.prototype.constructor=rn,rn.prototype.isSpriteMaterial=!0,rn.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var Vu,ju=new l,ku=new l,Wu=new l,qu=new n,Xu=new n,Yu=new h,Zu=new l,Ju=new l,Qu=new l,Ku=new n,$u=new n,ep=new n;an.prototype=Object.assign(Object.create(d.prototype),{constructor:an,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ku.setFromMatrixScale(this.matrixWorld),Yu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Wu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&ku.multiplyScalar(-Wu.z);var i,r,a=this.material.rotation;0!==a&&(r=Math.cos(a),i=Math.sin(a));var o=this.center;on(Zu.set(-.5,-.5,0),Wu,o,ku,i,r),on(Ju.set(.5,-.5,0),Wu,o,ku,i,r),on(Qu.set(.5,.5,0),Wu,o,ku,i,r),Ku.set(0,0),$u.set(1,0),ep.set(1,1);var s=e.ray.intersectTriangle(Zu,Ju,Qu,!1,ju);if(null!==s||(on(Ju.set(-.5,.5,0),Wu,o,ku,i,r),$u.set(0,1),null!==(s=e.ray.intersectTriangle(Zu,Qu,Ju,!1,ju)))){var c=e.ray.origin.distanceTo(ju);c<e.near||c>e.far||t.push({distance:c,point:ju.clone(),uv:b.getUV(ju,Zu,Ju,Qu,Ku,$u,ep,new n),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return d.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var tp=new l,np=new l;sn.prototype=Object.assign(Object.create(d.prototype),{constructor:sn,isLOD:!0,copy:function(e){d.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,i=t.length;n<i;n++){var r=t[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){tp.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(tp);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){tp.setFromMatrixPosition(e.matrixWorld),np.setFromMatrixPosition(this.matrixWorld);var n=tp.distanceTo(np);t[0].object.visible=!0;for(var i=1,r=t.length;i<r&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(;i<r;i++)t[i].object.visible=!1}},toJSON:function(e){var t=d.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),cn.prototype=Object.assign(Object.create(H.prototype),{constructor:cn,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new a,t=this.geometry.attributes.skinWeight,n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){H.prototype.updateMatrixWorld.call(this,e),"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).copy(this)}});var ip=new h,rp=new h;Object.assign(ln.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new h;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=e.length;r<a;r++){var o=e[r]?e[r].matrixWorld:rp;ip.multiplyMatrices(o,t[r]),ip.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new ln(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var i=this.bones[t];if(i.name===e)return i}}}),hn.prototype=Object.assign(Object.create(d.prototype),{constructor:hn,isBone:!0});var ap=new h,op=new h,sp=[],cp=new H;un.prototype=Object.assign(Object.create(H.prototype),{constructor:un,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,i=this.count;if(cp.geometry=this.geometry,cp.material=this.material,void 0!==cp.material)for(var r=0;r<i;r++)this.getMatrixAt(r,ap),op.multiplyMatrices(n,ap),cp.matrixWorld=op,cp.raycast(e,sp),sp.length>0&&(sp[0].instanceId=r,sp[0].object=this,t.push(sp[0]),sp.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),pn.prototype=Object.create(S.prototype),pn.prototype.constructor=pn,pn.prototype.isLineBasicMaterial=!0,pn.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var lp=new l,hp=new l,up=new h,pp=new y,dp=new g;dn.prototype=Object.assign(Object.create(d.prototype),{constructor:dn,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],i=1,r=t.count;i<r;i++)lp.fromBufferAttribute(t,i-1),hp.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=lp.distanceTo(hp);e.setAttribute("lineDistance",new B(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices,n=e.lineDistances;n[0]=0;for(var i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this},raycast:function(e,t){var n=e.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),dp.copy(i.boundingSphere),dp.applyMatrix4(r),dp.radius+=n,!1!==e.ray.intersectsSphere(dp)){up.getInverse(r),pp.copy(e.ray).applyMatrix4(up);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new l,c=new l,h=new l,u=new l,p=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var d=i.index,f=i.attributes,m=f.position.array;if(null!==d)for(var v=d.array,g=0,y=v.length-1;g<y;g+=p){var x=v[g],b=v[g+1];s.fromArray(m,3*x),c.fromArray(m,3*b);var w=pp.distanceSqToSegment(s,c,u,h);if(!(w>o)){u.applyMatrix4(this.matrixWorld);var _=e.ray.origin.distanceTo(u);_<e.near||_>e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this})}}else for(var g=0,y=m.length/3-1;g<y;g+=p){s.fromArray(m,3*g),c.fromArray(m,3*g+3);var w=pp.distanceSqToSegment(s,c,u,h);if(!(w>o)){u.applyMatrix4(this.matrixWorld);var _=e.ray.origin.distanceTo(u);_<e.near||_>e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this})}}}else if(i.isGeometry)for(var M=i.vertices,T=M.length,g=0;g<T-1;g+=p){var w=pp.distanceSqToSegment(M[g],M[g+1],u,h);if(!(w>o)){u.applyMatrix4(this.matrixWorld);var _=e.ray.origin.distanceTo(u);_<e.near||_>e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var fp=new l,mp=new l;fn.prototype=Object.assign(Object.create(dn.prototype),{constructor:fn,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],i=0,r=t.count;i<r;i+=2)fp.fromBufferAttribute(t,i),mp.fromBufferAttribute(t,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+fp.distanceTo(mp);e.setAttribute("lineDistance",new B(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(var a=e.vertices,n=e.lineDistances,i=0,r=a.length;i<r;i+=2)fp.copy(a[i]),mp.copy(a[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+fp.distanceTo(mp);return this}}),mn.prototype=Object.assign(Object.create(dn.prototype),{constructor:mn,isLineLoop:!0}),vn.prototype=Object.create(S.prototype),vn.prototype.constructor=vn,vn.prototype.isPointsMaterial=!0,vn.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var vp=new h,gp=new y,yp=new g,xp=new l;gn.prototype=Object.assign(Object.create(d.prototype),{constructor:gn,isPoints:!0,raycast:function(e,t){var n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),yp.copy(n.boundingSphere),yp.applyMatrix4(i),yp.radius+=r,!1!==e.ray.intersectsSphere(yp)){vp.getInverse(i),gp.copy(e.ray).applyMatrix4(vp);var a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes,l=c.position.array;if(null!==s)for(var h=s.array,u=0,p=h.length;u<p;u++){var d=h[u];xp.fromArray(l,3*d),yn(xp,d,o,i,e,t,this)}else for(var u=0,f=l.length/3;u<f;u++)xp.fromArray(l,3*u),yn(xp,u,o,i,e,t,this)}else for(var m=n.vertices,u=0,f=m.length;u<f;u++)yn(m[u],u,o,i,e,t,this)}},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),xn.prototype=Object.assign(Object.create(r.prototype),{constructor:xn,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),bn.prototype=Object.create(r.prototype),bn.prototype.constructor=bn,bn.prototype.isCompressedTexture=!0,wn.prototype=Object.create(r.prototype),wn.prototype.constructor=wn,wn.prototype.isCanvasTexture=!0,_n.prototype=Object.create(r.prototype),_n.prototype.constructor=_n,_n.prototype.isDepthTexture=!0,Mn.prototype=Object.create(G.prototype),Mn.prototype.constructor=Mn,Tn.prototype=Object.create(k.prototype),Tn.prototype.constructor=Tn,En.prototype=Object.create(G.prototype),En.prototype.constructor=En,Sn.prototype=Object.create(k.prototype),Sn.prototype.constructor=Sn,An.prototype=Object.create(G.prototype),An.prototype.constructor=An,Ln.prototype=Object.create(k.prototype),Ln.prototype.constructor=Ln,Rn.prototype=Object.create(An.prototype),Rn.prototype.constructor=Rn,Pn.prototype=Object.create(k.prototype),Pn.prototype.constructor=Pn,Cn.prototype=Object.create(An.prototype),Cn.prototype.constructor=Cn,On.prototype=Object.create(k.prototype),On.prototype.constructor=On,Dn.prototype=Object.create(An.prototype),Dn.prototype.constructor=Dn,In.prototype=Object.create(k.prototype),In.prototype.constructor=In,Nn.prototype=Object.create(An.prototype),Nn.prototype.constructor=Nn,Bn.prototype=Object.create(k.prototype),Bn.prototype.constructor=Bn,zn.prototype=Object.create(G.prototype),zn.prototype.constructor=zn,zn.prototype.toJSON=function(){var e=G.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Fn.prototype=Object.create(k.prototype),Fn.prototype.constructor=Fn,Un.prototype=Object.create(G.prototype),Un.prototype.constructor=Un,Gn.prototype=Object.create(k.prototype),Gn.prototype.constructor=Gn,Hn.prototype=Object.create(G.prototype),Hn.prototype.constructor=Hn;var bp={triangulate:function(e,t,n){n=n||2;var i=t&&t.length,r=i?t[0]*n:e.length,a=Vn(e,0,r,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,h,u,p,d;if(i&&(a=Zn(e,t,a,n)),e.length>80*n){s=l=e[0],c=h=e[1];for(var f=n;f<r;f+=n)u=e[f],p=e[f+1],u<s&&(s=u),p<c&&(c=p),u>l&&(l=u),p>h&&(h=p);d=Math.max(l-s,h-c),d=0!==d?1/d:0}return kn(a,o,n,s,c,d),o}},wp={area:function(e){for(var t=e.length,n=0,i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n},isClockWise:function(e){return wp.area(e)<0},triangulateShape:function(e,t){var n=[],i=[],r=[];vi(e),gi(n,e);var a=e.length;t.forEach(vi);for(var o=0;o<t.length;o++)i.push(a),a+=t[o].length,gi(n,t[o]);for(var s=bp.triangulate(n,i),o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};yi.prototype=Object.create(k.prototype),yi.prototype.constructor=yi,yi.prototype.toJSON=function(){var e=k.prototype.toJSON.call(this);return bi(this.parameters.shapes,this.parameters.options,e)},xi.prototype=Object.create(G.prototype),xi.prototype.constructor=xi,xi.prototype.toJSON=function(){var e=G.prototype.toJSON.call(this);return bi(this.parameters.shapes,this.parameters.options,e)};var _p={generateTopUV:function(e,t,i,r,a){var o=t[3*i],s=t[3*i+1],c=t[3*r],l=t[3*r+1],h=t[3*a],u=t[3*a+1];return[new n(o,s),new n(c,l),new n(h,u)]},generateSideWallUV:function(e,t,i,r,a,o){var s=t[3*i],c=t[3*i+1],l=t[3*i+2],h=t[3*r],u=t[3*r+1],p=t[3*r+2],d=t[3*a],f=t[3*a+1],m=t[3*a+2],v=t[3*o],g=t[3*o+1],y=t[3*o+2];return Math.abs(c-u)<.01?[new n(s,1-l),new n(h,1-p),new n(d,1-m),new n(v,1-y)]:[new n(c,1-l),new n(u,1-p),new n(f,1-m),new n(g,1-y)]}};wi.prototype=Object.create(k.prototype),wi.prototype.constructor=wi,_i.prototype=Object.create(xi.prototype),_i.prototype.constructor=_i,Mi.prototype=Object.create(k.prototype),Mi.prototype.constructor=Mi,Ti.prototype=Object.create(G.prototype),Ti.prototype.constructor=Ti,Ei.prototype=Object.create(k.prototype),Ei.prototype.constructor=Ei,Si.prototype=Object.create(G.prototype),Si.prototype.constructor=Si,Ai.prototype=Object.create(k.prototype),Ai.prototype.constructor=Ai,Li.prototype=Object.create(G.prototype),Li.prototype.constructor=Li,Ri.prototype=Object.create(k.prototype),Ri.prototype.constructor=Ri,Ri.prototype.toJSON=function(){var e=k.prototype.toJSON.call(this);return Ci(this.parameters.shapes,e)},Pi.prototype=Object.create(G.prototype),Pi.prototype.constructor=Pi,Pi.prototype.toJSON=function(){var e=G.prototype.toJSON.call(this);return Ci(this.parameters.shapes,e)},Oi.prototype=Object.create(G.prototype),Oi.prototype.constructor=Oi,Di.prototype=Object.create(k.prototype),Di.prototype.constructor=Di,Ii.prototype=Object.create(G.prototype),Ii.prototype.constructor=Ii,Ni.prototype=Object.create(Di.prototype),Ni.prototype.constructor=Ni,Bi.prototype=Object.create(Ii.prototype),Bi.prototype.constructor=Bi,zi.prototype=Object.create(k.prototype),zi.prototype.constructor=zi,Fi.prototype=Object.create(G.prototype),Fi.prototype.constructor=Fi;var Mp=Object.freeze({__proto__:null,WireframeGeometry:Mn,ParametricGeometry:Tn,ParametricBufferGeometry:En,TetrahedronGeometry:Ln,TetrahedronBufferGeometry:Rn,OctahedronGeometry:Pn,OctahedronBufferGeometry:Cn,IcosahedronGeometry:On,IcosahedronBufferGeometry:Dn,DodecahedronGeometry:In,DodecahedronBufferGeometry:Nn,PolyhedronGeometry:Sn,PolyhedronBufferGeometry:An,TubeGeometry:Bn,TubeBufferGeometry:zn,TorusKnotGeometry:Fn,TorusKnotBufferGeometry:Un,TorusGeometry:Gn,TorusBufferGeometry:Hn,TextGeometry:wi,TextBufferGeometry:_i,SphereGeometry:Mi,SphereBufferGeometry:Ti,RingGeometry:Ei,RingBufferGeometry:Si,PlaneGeometry:ne,PlaneBufferGeometry:ie,LatheGeometry:Ai,LatheBufferGeometry:Li,ShapeGeometry:Ri,ShapeBufferGeometry:Pi,ExtrudeGeometry:yi,ExtrudeBufferGeometry:xi,EdgesGeometry:Oi,ConeGeometry:Ni,ConeBufferGeometry:Bi,CylinderGeometry:Di,CylinderBufferGeometry:Ii,CircleGeometry:zi,CircleBufferGeometry:Fi,BoxGeometry:uu,BoxBufferGeometry:pu});Ui.prototype=Object.create(S.prototype),Ui.prototype.constructor=Ui,Ui.prototype.isShadowMaterial=!0,Ui.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this},Gi.prototype=Object.create(X.prototype),Gi.prototype.constructor=Gi,Gi.prototype.isRawShaderMaterial=!0,Hi.prototype=Object.create(S.prototype),Hi.prototype.constructor=Hi,Hi.prototype.isMeshStandardMaterial=!0,Hi.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Vi.prototype=Object.create(Hi.prototype),Vi.prototype.constructor=Vi,Vi.prototype.isMeshPhysicalMaterial=!0,Vi.prototype.copy=function(e){return Hi.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new w).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},ji.prototype=Object.create(S.prototype),ji.prototype.constructor=ji,ji.prototype.isMeshPhongMaterial=!0,ji.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ki.prototype=Object.create(S.prototype),ki.prototype.constructor=ki,ki.prototype.isMeshToonMaterial=!0,ki.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Wi.prototype=Object.create(S.prototype),Wi.prototype.constructor=Wi,Wi.prototype.isMeshNormalMaterial=!0,Wi.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},qi.prototype=Object.create(S.prototype),qi.prototype.constructor=qi,qi.prototype.isMeshLambertMaterial=!0,qi.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Xi.prototype=Object.create(S.prototype),Xi.prototype.constructor=Xi,Xi.prototype.isMeshMatcapMaterial=!0,Xi.prototype.copy=function(e){return S.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Yi.prototype=Object.create(pn.prototype),Yi.prototype.constructor=Yi,Yi.prototype.isLineDashedMaterial=!0,Yi.prototype.copy=function(e){return pn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Tp=Object.freeze({__proto__:null,ShadowMaterial:Ui,SpriteMaterial:rn,RawShaderMaterial:Gi,ShaderMaterial:X,PointsMaterial:vn,MeshPhysicalMaterial:Vi,MeshStandardMaterial:Hi,MeshPhongMaterial:ji,MeshToonMaterial:ki,MeshNormalMaterial:Wi,MeshLambertMaterial:qi,MeshDepthMaterial:Ut,MeshDistanceMaterial:Gt,MeshBasicMaterial:A,MeshMatcapMaterial:Xi,LineDashedMaterial:Yi,LineBasicMaterial:pn,Material:S}),Ep={arraySlice:function(e,t,n){return Ep.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){function t(t,n){return e[t]-e[n]}for(var n=e.length,i=new Array(n),r=0;r!==n;++r)i[r]=r;return i.sort(t),i},sortedArray:function(e,t,n){for(var i=e.length,r=new e.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*t,c=0;c!==t;++c)r[o++]=e[s+c];return r},flattenJSON:function(e,t,n,i){for(var r=1,a=e[0];void 0!==a&&void 0===a[i];)a=e[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))do{o=a[i],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[i],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[r++]}while(void 0!==a);else do{o=a[i],void 0!==o&&(t.push(a.time),n.push(o)),a=e[r++]}while(void 0!==a)}},subclip:function(e,t,n,i,r){r=r||30;var a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var c=a.tracks[s],l=c.getValueSize(),h=[],u=[],p=0;p<c.times.length;++p){var d=c.times[p]*r;if(!(d<n||d>=i)){h.push(c.times[p]);for(var f=0;f<l;++f)u.push(c.values[p*l+f])}}0!==h.length&&(c.times=Ep.convertArray(h,c.times.constructor),c.values=Ep.convertArray(u,c.values.constructor),o.push(c))}a.tracks=o;for(var m=1/0,s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(var s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};Object.assign(Zi.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{var a;n:{i:if(!(e<i)){for(var o=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===o)break;if(r=i,i=t[++n],e<i)break t}a=t.length;break n}{if(e>=r)break e;var s=t[1];e<s&&(n=2,r=s);for(var o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===o)break;if(i=r,r=t[--n-1],e>=r)break t}a=n,n=0}}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(i=t[n],void 0===(r=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i,a=0;a!==i;++a)t[a]=n[r+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Zi.prototype,{beforeStart_:Zi.prototype.copySampleValue_,afterEnd_:Zi.prototype.copySampleValue_}),Ji.prototype=Object.assign(Object.create(Zi.prototype),{constructor:Ji,DefaultSettings_:{endingStart:al,endingEnd:al},intervalChanged_:function(e,t,n){var i=this.parameterPositions,r=e-2,a=e+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=e,o=2*t-n;break;case 2402:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:a=1,s=n+i[1]-i[0];break;default:a=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=r*l,this._offsetNext=a*l},interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(n-t)/(i-t),f=d*d,m=f*d,v=-u*m+2*u*f-u*d,g=(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,b=0;b!==o;++b)r[b]=v*a[l+b]+g*a[c+b]+y*a[s+b]+x*a[h+b];return r}}),Qi.prototype=Object.assign(Object.create(Zi.prototype),{constructor:Qi,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(i-t),h=1-l,u=0;u!==o;++u)r[u]=a[c+u]*h+a[s+u]*l;return r}}),Ki.prototype=Object.assign(Object.create(Zi.prototype),{constructor:Ki,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign($i,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Ep.convertArray(e.times,Array),values:Ep.convertArray(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}}),Object.assign($i.prototype,{constructor:$i,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new Ki(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Qi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Ji(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},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(e){if(0!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);var o=this.getValueSize();this.times=Ep.arraySlice(n,r,a),this.values=Ep.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==r;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==i&&Ep.isTypedArray(i))for(var o=0,c=i.length;o!==c;++o){var l=i[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}return e},optimize:function(){for(var e=Ep.arraySlice(this.times),t=Ep.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(i)s=!0;else for(var l=o*n,h=l-n,u=l+n,p=0;p!==n;++p){var d=t[l+p];if(d!==t[h+p]||d!==t[u+p]){s=!0;break}}if(s){if(o!==r){e[r]=e[o];for(var f=o*n,m=r*n,p=0;p!==n;++p)t[m+p]=t[f+p]}++r}}if(a>0){e[r]=e[a];for(var f=a*n,m=r*n,p=0;p!==n;++p)t[m+p]=t[f+p];++r}return r!==e.length?(this.times=Ep.arraySlice(e,0,r),this.values=Ep.arraySlice(t,0,r*n)):(this.times=e,this.values=t),this},clone:function(){
- var e=Ep.arraySlice(this.times,0),t=Ep.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}),er.prototype=Object.assign(Object.create($i.prototype),{constructor:er,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),tr.prototype=Object.assign(Object.create($i.prototype),{constructor:tr,ValueTypeName:"color"}),nr.prototype=Object.assign(Object.create($i.prototype),{constructor:nr,ValueTypeName:"number"}),ir.prototype=Object.assign(Object.create(Zi.prototype),{constructor:ir,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(i-t),h=s+o;s!==h;s+=4)c.slerpFlat(r,0,a,s-o,a,s,l);return r}}),rr.prototype=Object.assign(Object.create($i.prototype),{constructor:rr,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new ir(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),ar.prototype=Object.assign(Object.create($i.prototype),{constructor:ar,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),or.prototype=Object.assign(Object.create($i.prototype),{constructor:or,ValueTypeName:"vector"}),Object.assign(sr,{parse:function(e){for(var t=[],n=e.tracks,i=1/(e.fps||1),r=0,a=n.length;r!==a;++r)t.push(lr(n[r]).scale(i));return new sr(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},r=0,a=n.length;r!==a;++r)t.push($i.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){for(var r=t.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 l=Ep.getKeyframeOrder(s);s=Ep.sortedArray(s,1,l),c=Ep.sortedArray(c,1,l),i||0!==s[0]||(s.push(r),c.push(c[0])),a.push(new nr(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new sr(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var i=e;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(r);if(c&&c.length>1){var l=c[1],h=i[l];h||(i[l]=h=[]),h.push(s)}}var u=[];for(var l in i)u.push(sr.CreateFromMorphTargetSequence(l,i[l],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,i,r){if(0!==n.length){var a=[],o=[];Ep.flattenJSON(n,a,o,i),0!==a.length&&r.push(new e(t,a,o))}},i=[],r=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},u=0;u<l.length;u++)if(l[u].morphTargets)for(var p=0;p<l[u].morphTargets.length;p++)h[l[u].morphTargets[p]]=-1;for(var d in h){for(var f=[],m=[],p=0;p!==l[u].morphTargets.length;++p){var v=l[u];f.push(v.time),m.push(v.morphTarget===d?1:0)}i.push(new nr(".morphTargetInfluence["+d+"]",f,m))}a=h.length*(o||1)}else{var g=".bones["+t[c].name+"]";n(or,g+".position",l,"pos",i),n(rr,g+".quaternion",l,"rot",i),n(or,g+".scale",l,"scl",i)}}return 0===i.length?null:new sr(r,a,i)}}),Object.assign(sr.prototype,{resetDuration:function(){for(var e=this.tracks,t=0,n=0,i=e.length;n!==i;++n){var r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new sr(this.name,this.duration,e)}});var Sp={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},Ap=new hr;Object.assign(ur.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var Lp={};pr.prototype=Object.assign(Object.create(ur.prototype),{constructor:pr,load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Sp.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;if(void 0!==Lp[e])return void Lp[e].push({onLoad:t,onProgress:n,onError:i});var o=/^data:(.*?)(;base64)?,(.*)$/,s=e.match(o);if(s){var c=s[1],l=!!s[2],h=s[3];h=decodeURIComponent(h),l&&(h=atob(h));try{var u,p=(this.responseType||"").toLowerCase();switch(p){case"arraybuffer":case"blob":for(var d=new Uint8Array(h.length),f=0;f<h.length;f++)d[f]=h.charCodeAt(f);u="blob"===p?new Blob([d.buffer],{type:c}):d.buffer;break;case"document":var m=new DOMParser;u=m.parseFromString(h,c);break;case"json":u=JSON.parse(h);break;default:u=h}setTimeout(function(){t&&t(u),r.manager.itemEnd(e)},0)}catch(t){setTimeout(function(){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)},0)}}else{Lp[e]=[],Lp[e].push({onLoad:t,onProgress:n,onError:i});var v=new XMLHttpRequest;v.open("GET",e,!0),v.addEventListener("load",function(t){var n=this.response,i=Lp[e];if(delete Lp[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Sp.add(e,n);for(var a=0,o=i.length;a<o;a++){var s=i[a];s.onLoad&&s.onLoad(n)}r.manager.itemEnd(e)}else{for(var a=0,o=i.length;a<o;a++){var s=i[a];s.onError&&s.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}},!1),v.addEventListener("progress",function(t){for(var n=Lp[e],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(t)}},!1),v.addEventListener("error",function(t){var n=Lp[e];delete Lp[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)},!1),v.addEventListener("abort",function(t){var n=Lp[e];delete Lp[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)},!1),void 0!==this.responseType&&(v.responseType=this.responseType),void 0!==this.withCredentials&&(v.withCredentials=this.withCredentials),v.overrideMimeType&&v.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(var g in this.requestHeader)v.setRequestHeader(g,this.requestHeader[g]);v.send(null)}return r.manager.itemStart(e),v},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),dr.prototype=Object.assign(Object.create(ur.prototype),{constructor:dr,load:function(e,t,n,i){var r=this,a=new pr(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var i=sr.parse(e[n]);t.push(i)}return t}}),fr.prototype=Object.assign(Object.create(ur.prototype),{constructor:fr,load:function(e,t,n,i){var r=this,a=[],o=new bn;o.image=a;var s=new pr(this.manager);if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var c=0,l=0,h=e.length;l<h;++l)!function(l){s.load(e[l],function(e){var n=r.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(o.minFilter=oc),o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,i)}(l);else s.load(e,function(e){var n=r.parse(e,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=oc),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,i);return o}}),mr.prototype=Object.assign(Object.create(ur.prototype),{constructor:mr,load:function(e,t,n,i){var r=this,a=new K,o=new pr(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(e){var n=r.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:tc,a.wrapT=void 0!==n.wrapT?n.wrapT:tc,a.magFilter=void 0!==n.magFilter?n.magFilter:oc,a.minFilter=void 0!==n.minFilter?n.minFilter:oc,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=cc),1===n.mipmapCount&&(a.minFilter=oc),a.needsUpdate=!0,t&&t(a,n))},n,i),a}}),vr.prototype=Object.assign(Object.create(ur.prototype),{constructor:vr,load:function(e,t,n,i){function r(){c.removeEventListener("load",r,!1),c.removeEventListener("error",a,!1),Sp.add(e,this),t&&t(this),o.manager.itemEnd(e)}function a(t){c.removeEventListener("load",r,!1),c.removeEventListener("error",a,!1),i&&i(t),o.manager.itemError(e),o.manager.itemEnd(e)}void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var o=this,s=Sp.get(e);if(void 0!==s)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;var c=document.createElementNS("http://www.w3.org/1999/xhtml","img");return c.addEventListener("load",r,!1),c.addEventListener("error",a,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(c.crossOrigin=this.crossOrigin),o.manager.itemStart(e),c.src=e,c}}),gr.prototype=Object.assign(Object.create(ur.prototype),{constructor:gr,load:function(e,t,n,i){var r=new me,a=new vr(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);for(var o=0,s=0;s<e.length;++s)!function(n){a.load(e[n],function(e){r.images[n]=e,6==++o&&(r.needsUpdate=!0,t&&t(r))},void 0,i)}(s);return r}}),yr.prototype=Object.assign(Object.create(ur.prototype),{constructor:yr,load:function(e,t,n,i){var a=new r,o=new vr(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(n){a.image=n;var i=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);a.format=i?_c:Mc,a.needsUpdate=!0,void 0!==t&&t(a)},n,i),a}}),Object.assign(xr.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=e;n++)t=this.getPoint(n/e),a+=t.distanceTo(r),i.push(a),r=t;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,i=this.getLengths(),r=0,a=i.length;n=t||e*i[a-1];for(var o,s=0,c=a-1;s<=c;)if(r=Math.floor(s+(c-s)/2),(o=i[r]-n)<0)s=r+1;else{if(!(o>0)){c=r;break}c=r-1}if(r=c,i[r]===n)return r/(a-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var i=this.getPoint(t);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,i,r,a=new l,o=[],s=[],c=[],u=new l,p=new h;for(n=0;n<=e;n++)i=n/e,o[n]=this.getTangentAt(i),o[n].normalize();s[0]=new l,c[0]=new l;var d=Number.MAX_VALUE,f=Math.abs(o[0].x),m=Math.abs(o[0].y),v=Math.abs(o[0].z);for(f<=d&&(d=f,a.set(1,0,0)),m<=d&&(d=m,a.set(0,1,0)),v<=d&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),c[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),u.crossVectors(o[n-1],o[n]),u.length()>Number.EPSILON&&(u.normalize(),r=Math.acos(Tl.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(p.makeRotationAxis(u,r))),c[n].crossVectors(o[n],s[n]);if(!0===t)for(r=Math.acos(Tl.clamp(s[0].dot(s[e]),-1,1)),r/=e,o[0].dot(u.crossVectors(s[0],s[e]))>0&&(r=-r),n=1;n<=e;n++)s[n].applyMatrix4(p.makeRotationAxis(o[n],r*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),br.prototype=Object.create(xr.prototype),br.prototype.constructor=br,br.prototype.isEllipseCurve=!0,br.prototype.getPoint=function(e,t){for(var i=t||new n,r=2*Math.PI,a=this.aEndAngle-this.aStartAngle,o=Math.abs(a)<Number.EPSILON;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(a=o?0:r),!0!==this.aClockwise||o||(a===r?a=-r:a-=r);var s=this.aStartAngle+e*a,c=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){var h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),p=c-this.aX,d=l-this.aY;c=p*h-d*u+this.aX,l=p*u+d*h+this.aY}return i.set(c,l)},br.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},br.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},br.prototype.fromJSON=function(e){return xr.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},wr.prototype=Object.create(br.prototype),wr.prototype.constructor=wr,wr.prototype.isArcCurve=!0;var Rp=new l,Pp=new _r,Cp=new _r,Op=new _r;Mr.prototype=Object.create(xr.prototype),Mr.prototype.constructor=Mr,Mr.prototype.isCatmullRomCurve3=!0,Mr.prototype.getPoint=function(e,t){var n=t||new l,i=this.points,r=i.length,a=(r-(this.closed?0:1))*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:0===s&&o===r-1&&(o=r-2,s=1);var c,h,u,p;if(this.closed||o>0?c=i[(o-1)%r]:(Rp.subVectors(i[0],i[1]).add(i[0]),c=Rp),h=i[o%r],u=i[(o+1)%r],this.closed||o+2<r?p=i[(o+2)%r]:(Rp.subVectors(i[r-1],i[r-2]).add(i[r-1]),p=Rp),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(c.distanceToSquared(h),d),m=Math.pow(h.distanceToSquared(u),d),v=Math.pow(u.distanceToSquared(p),d);m<1e-4&&(m=1),f<1e-4&&(f=m),v<1e-4&&(v=m),Pp.initNonuniformCatmullRom(c.x,h.x,u.x,p.x,f,m,v),Cp.initNonuniformCatmullRom(c.y,h.y,u.y,p.y,f,m,v),Op.initNonuniformCatmullRom(c.z,h.z,u.z,p.z,f,m,v)}else"catmullrom"===this.curveType&&(Pp.initCatmullRom(c.x,h.x,u.x,p.x,this.tension),Cp.initCatmullRom(c.y,h.y,u.y,p.y,this.tension),Op.initCatmullRom(c.z,h.z,u.z,p.z,this.tension));return n.set(Pp.calc(s),Cp.calc(s),Op.calc(s)),n},Mr.prototype.copy=function(e){xr.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Mr.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Mr.prototype.fromJSON=function(e){xr.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new l).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Ir.prototype=Object.create(xr.prototype),Ir.prototype.constructor=Ir,Ir.prototype.isCubicBezierCurve=!0,Ir.prototype.getPoint=function(e,t){var i=t||new n,r=this.v0,a=this.v1,o=this.v2,s=this.v3;return i.set(Dr(e,r.x,a.x,o.x,s.x),Dr(e,r.y,a.y,o.y,s.y)),i},Ir.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Ir.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Ir.prototype.fromJSON=function(e){return xr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Nr.prototype=Object.create(xr.prototype),Nr.prototype.constructor=Nr,Nr.prototype.isCubicBezierCurve3=!0,Nr.prototype.getPoint=function(e,t){var n=t||new l,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(Dr(e,i.x,r.x,a.x,o.x),Dr(e,i.y,r.y,a.y,o.y),Dr(e,i.z,r.z,a.z,o.z)),n},Nr.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Nr.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Nr.prototype.fromJSON=function(e){return xr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Br.prototype=Object.create(xr.prototype),Br.prototype.constructor=Br,Br.prototype.isLineCurve=!0,Br.prototype.getPoint=function(e,t){var i=t||new n;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i},Br.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Br.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Br.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Br.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Br.prototype.fromJSON=function(e){return xr.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},zr.prototype=Object.create(xr.prototype),zr.prototype.constructor=zr,zr.prototype.isLineCurve3=!0,zr.prototype.getPoint=function(e,t){var n=t||new l;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},zr.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},zr.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},zr.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},zr.prototype.fromJSON=function(e){return xr.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Fr.prototype=Object.create(xr.prototype),Fr.prototype.constructor=Fr,Fr.prototype.isQuadraticBezierCurve=!0,Fr.prototype.getPoint=function(e,t){var i=t||new n,r=this.v0,a=this.v1,o=this.v2;return i.set(Lr(e,r.x,a.x,o.x),Lr(e,r.y,a.y,o.y)),i},Fr.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Fr.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Fr.prototype.fromJSON=function(e){return xr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ur.prototype=Object.create(xr.prototype),Ur.prototype.constructor=Ur,Ur.prototype.isQuadraticBezierCurve3=!0,Ur.prototype.getPoint=function(e,t){var n=t||new l,i=this.v0,r=this.v1,a=this.v2;return n.set(Lr(e,i.x,r.x,a.x),Lr(e,i.y,r.y,a.y),Lr(e,i.z,r.z,a.z)),n},Ur.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ur.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ur.prototype.fromJSON=function(e){return xr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Gr.prototype=Object.create(xr.prototype),Gr.prototype.constructor=Gr,Gr.prototype.isSplineCurve=!0,Gr.prototype.getPoint=function(e,t){var i=t||new n,r=this.points,a=(r.length-1)*e,o=Math.floor(a),s=a-o,c=r[0===o?o:o-1],l=r[o],h=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return i.set(Tr(s,c.x,l.x,h.x,u.x),Tr(s,c.y,l.y,h.y,u.y)),i},Gr.prototype.copy=function(e){xr.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this},Gr.prototype.toJSON=function(){var e=xr.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e},Gr.prototype.fromJSON=function(e){xr.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var r=e.points[t];this.points.push((new n).fromArray(r))}return this};var Dp=Object.freeze({__proto__:null,ArcCurve:wr,CatmullRomCurve3:Mr,CubicBezierCurve:Ir,CubicBezierCurve3:Nr,EllipseCurve:br,LineCurve:Br,LineCurve3:zr,QuadraticBezierCurve:Fr,QuadraticBezierCurve3:Ur,SplineCurve:Gr});Hr.prototype=Object.assign(Object.create(xr.prototype),{constructor:Hr,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Br(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=t){var r=n[i]-t,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){xr.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=xr.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var i=this.curves[t];e.curves.push(i.toJSON())}return e},fromJSON:function(e){xr.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push((new Dp[i.type]).fromJSON(i))}return this}}),Vr.prototype=Object.assign(Object.create(Hr.prototype),{constructor:Vr,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var i=new Br(this.currentPoint.clone(),new n(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,i,r){var a=new Fr(this.currentPoint.clone(),new n(e,t),new n(i,r));return this.curves.push(a),this.currentPoint.set(i,r),this},bezierCurveTo:function(e,t,i,r,a,o){var s=new Ir(this.currentPoint.clone(),new n(e,t),new n(i,r),new n(a,o));return this.curves.push(s),this.currentPoint.set(a,o),this},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e),n=new Gr(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,i,r,a),this},absarc:function(e,t,n,i,r,a){return this.absellipse(e,t,n,n,i,r,a),this},ellipse:function(e,t,n,i,r,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,i,r,a,o,s),this},absellipse:function(e,t,n,i,r,a,o,s){var c=new br(e,t,n,i,r,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var h=c.getPoint(1);return this.currentPoint.copy(h),this},copy:function(e){return Hr.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Hr.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Hr.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),jr.prototype=Object.assign(Object.create(Vr.prototype),{constructor:jr,getPointsHoles:function(e){for(var t=[],n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Vr.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push(i.clone())}return this},toJSON:function(){var e=Vr.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var i=this.holes[t];e.holes.push(i.toJSON())}return e},fromJSON:function(e){Vr.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push((new Vr).fromJSON(i))}return this}}),kr.prototype=Object.assign(Object.create(d.prototype),{constructor:kr,isLight:!0,copy:function(e){return d.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=d.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Wr.prototype=Object.assign(Object.create(kr.prototype),{constructor:Wr,isHemisphereLight:!0,copy:function(e){return kr.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(qr.prototype,{_projScreenMatrix:new h,_lightPositionWorld:new l,_lookTarget:new l,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),r.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(r),t.updateMatrixWorld(),i.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Xr.prototype=Object.assign(Object.create(qr.prototype),{constructor:Xr,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*Tl.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),qr.prototype.updateMatrices.call(this,e)}}),Yr.prototype=Object.assign(Object.create(kr.prototype),{constructor:Yr,isSpotLight:!0,copy:function(e){return kr.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Zr.prototype=Object.assign(Object.create(qr.prototype),{constructor:Zr,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,i=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(e.matrixWorld),n.position.copy(r),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Jr.prototype=Object.assign(Object.create(kr.prototype),{constructor:Jr,isPointLight:!0,copy:function(e){return kr.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Qr.prototype=Object.assign(Object.create(Y.prototype),{constructor:Qr,isOrthographicCamera:!0,copy:function(e,t){return Y.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,i,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){var c=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=l*this.view.offsetY,s=o-l*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=d.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Kr.prototype=Object.assign(Object.create(qr.prototype),{constructor:Kr,isDirectionalLightShadow:!0,updateMatrices:function(e){qr.prototype.updateMatrices.call(this,e)}}),$r.prototype=Object.assign(Object.create(kr.prototype),{constructor:$r,
- isDirectionalLight:!0,copy:function(e){return kr.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),ea.prototype=Object.assign(Object.create(kr.prototype),{constructor:ea,isAmbientLight:!0}),ta.prototype=Object.assign(Object.create(kr.prototype),{constructor:ta,isRectAreaLight:!0,copy:function(e){return kr.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=kr.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),na.prototype=Object.assign(Object.create(ur.prototype),{constructor:na,load:function(e,t,n,i){var r=this,a=new pr(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){function t(e){return void 0===r[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),r[e]}var r=this.textures,o=new Tp[e.type];if(void 0!==e.uuid&&(o.uuid=e.uuid),void 0!==e.name&&(o.name=e.name),void 0!==e.color&&o.color.setHex(e.color),void 0!==e.roughness&&(o.roughness=e.roughness),void 0!==e.metalness&&(o.metalness=e.metalness),void 0!==e.sheen&&(o.sheen=(new w).setHex(e.sheen)),void 0!==e.emissive&&o.emissive.setHex(e.emissive),void 0!==e.specular&&o.specular.setHex(e.specular),void 0!==e.shininess&&(o.shininess=e.shininess),void 0!==e.clearcoat&&(o.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(o.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.vertexColors&&(o.vertexColors=e.vertexColors),void 0!==e.fog&&(o.fog=e.fog),void 0!==e.flatShading&&(o.flatShading=e.flatShading),void 0!==e.blending&&(o.blending=e.blending),void 0!==e.combine&&(o.combine=e.combine),void 0!==e.side&&(o.side=e.side),void 0!==e.opacity&&(o.opacity=e.opacity),void 0!==e.transparent&&(o.transparent=e.transparent),void 0!==e.alphaTest&&(o.alphaTest=e.alphaTest),void 0!==e.depthTest&&(o.depthTest=e.depthTest),void 0!==e.depthWrite&&(o.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(o.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(o.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(o.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(o.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(o.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(o.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(o.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(o.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(o.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(o.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(o.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(o.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(o.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(o.rotation=e.rotation),1!==e.linewidth&&(o.linewidth=e.linewidth),void 0!==e.dashSize&&(o.dashSize=e.dashSize),void 0!==e.gapSize&&(o.gapSize=e.gapSize),void 0!==e.scale&&(o.scale=e.scale),void 0!==e.polygonOffset&&(o.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(o.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(o.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(o.skinning=e.skinning),void 0!==e.morphTargets&&(o.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(o.morphNormals=e.morphNormals),void 0!==e.dithering&&(o.dithering=e.dithering),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.toneMapped&&(o.toneMapped=e.toneMapped),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.uniforms)for(var s in e.uniforms){var c=e.uniforms[s];switch(o.uniforms[s]={},c.type){case"t":o.uniforms[s].value=t(c.value);break;case"c":o.uniforms[s].value=(new w).setHex(c.value);break;case"v2":o.uniforms[s].value=(new n).fromArray(c.value);break;case"v3":o.uniforms[s].value=(new l).fromArray(c.value);break;case"v4":o.uniforms[s].value=(new a).fromArray(c.value);break;case"m3":o.uniforms[s].value=(new i).fromArray(c.value);case"m4":o.uniforms[s].value=(new h).fromArray(c.value);break;default:o.uniforms[s].value=c.value}}if(void 0!==e.defines&&(o.defines=e.defines),void 0!==e.vertexShader&&(o.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(o.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var u in e.extensions)o.extensions[u]=e.extensions[u];if(void 0!==e.shading&&(o.flatShading=1===e.shading),void 0!==e.size&&(o.size=e.size),void 0!==e.sizeAttenuation&&(o.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(o.map=t(e.map)),void 0!==e.matcap&&(o.matcap=t(e.matcap)),void 0!==e.alphaMap&&(o.alphaMap=t(e.alphaMap),o.transparent=!0),void 0!==e.bumpMap&&(o.bumpMap=t(e.bumpMap)),void 0!==e.bumpScale&&(o.bumpScale=e.bumpScale),void 0!==e.normalMap&&(o.normalMap=t(e.normalMap)),void 0!==e.normalMapType&&(o.normalMapType=e.normalMapType),void 0!==e.normalScale){var p=e.normalScale;!1===Array.isArray(p)&&(p=[p,p]),o.normalScale=(new n).fromArray(p)}return void 0!==e.displacementMap&&(o.displacementMap=t(e.displacementMap)),void 0!==e.displacementScale&&(o.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(o.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(o.roughnessMap=t(e.roughnessMap)),void 0!==e.metalnessMap&&(o.metalnessMap=t(e.metalnessMap)),void 0!==e.emissiveMap&&(o.emissiveMap=t(e.emissiveMap)),void 0!==e.emissiveIntensity&&(o.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(o.specularMap=t(e.specularMap)),void 0!==e.envMap&&(o.envMap=t(e.envMap)),void 0!==e.envMapIntensity&&(o.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(o.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(o.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(o.lightMap=t(e.lightMap)),void 0!==e.lightMapIntensity&&(o.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(o.aoMap=t(e.aoMap)),void 0!==e.aoMapIntensity&&(o.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(o.gradientMap=t(e.gradientMap)),void 0!==e.clearcoatNormalMap&&(o.clearcoatNormalMap=t(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(o.clearcoatNormalScale=(new n).fromArray(e.clearcoatNormalScale)),o},setTextures:function(e){return this.textures=e,this}});var Ip={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};ia.prototype=Object.assign(Object.create(G.prototype),{constructor:ia,isInstancedBufferGeometry:!0,copy:function(e){return G.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=G.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),ra.prototype=Object.assign(Object.create(L.prototype),{constructor:ra,isInstancedBufferAttribute:!0,copy:function(e){return L.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=L.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),aa.prototype=Object.assign(Object.create(ur.prototype),{constructor:aa,load:function(e,t,n,i){var r=this,a=new pr(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){var t=e.isInstancedBufferGeometry?new ia:new G,n=e.data.index;if(void 0!==n){var i=new Np[n.type](n.array);t.setIndex(new L(i,1))}var r=e.data.attributes;for(var a in r){var o=r[a],i=new Np[o.type](o.array),s=o.isInstancedBufferAttribute?ra:L,c=new s(i,o.itemSize,o.normalized);void 0!==o.name&&(c.name=o.name),t.setAttribute(a,c)}var h=e.data.morphAttributes;if(h)for(var a in h){for(var u=h[a],p=[],d=0,f=u.length;d<f;d++){var o=u[d],i=new Np[o.type](o.array),c=new L(i,o.itemSize,o.normalized);void 0!==o.name&&(c.name=o.name),p.push(c)}t.morphAttributes[a]=p}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var m=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==m)for(var d=0,v=m.length;d!==v;++d){var y=m[d];t.addGroup(y.start,y.count,y.materialIndex)}var x=e.data.boundingSphere;if(void 0!==x){var b=new l;void 0!==x.center&&b.fromArray(x.center),t.boundingSphere=new g(b,x.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var Np={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};oa.prototype=Object.assign(Object.create(ur.prototype),{constructor:oa,load:function(e,t,n,i){var r=this,a=""===this.path?Ip.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new pr(r.manager);o.setPath(this.path),o.load(e,function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==i&&i(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.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 "+e);r.parse(a,t)},n,i)},parse:function(e,t){var n=this.parseShape(e.shapes),i=this.parseGeometries(e.geometries,n),r=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,i,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,i=e.length;n<i;n++){var r=(new jr).fromJSON(e[n]);t[r.uuid]=r}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var i=new aa,r=0,a=e.length;r<a;r++){var o,s=e[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Mp[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Mp[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Mp[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Mp[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 Mp[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Mp[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Mp[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Mp[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Mp[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Mp[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Mp[s.type]((new Dp[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Mp[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Mp[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],l=0,h=s.shapes.length;l<h;l++){var u=t[s.shapes[l]];c.push(u)}o=new Mp[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(var c=[],l=0,h=s.shapes.length;l<h;l++){var u=t[s.shapes[l]];c.push(u)}var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Dp[p.type]).fromJSON(p)),o=new Mp[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE){var d=new THREE.LegacyJSONLoader;o=d.parse(s,this.resourcePath).geometry}else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "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),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},i={};if(void 0!==e){var r=new na;r.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var c=[],l=0;l<s.materials.length;l++){var h=s.materials[l];void 0===n[h.uuid]&&(n[h.uuid]=r.parse(h)),c.push(n[h.uuid])}i[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=sr.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),t.push(r)}return t},parseImages:function(e,t){function n(e){return i.manager.itemStart(e),o.load(e,function(){i.manager.itemEnd(e)},void 0,function(){i.manager.itemError(e),i.manager.itemEnd(e)})}var i=this,r={};if(void 0!==e&&e.length>0){var a=new hr(t),o=new vr(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,c=e.length;s<c;s++){var l=e[s],h=l.url;if(Array.isArray(h)){r[l.uuid]=[];for(var u=0,p=h.length;u<p;u++){var d=h[u],f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:i.resourcePath+d;r[l.uuid].push(n(f))}}else{var f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:i.resourcePath+l.url;r[l.uuid]=n(f)}}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var i={};if(void 0!==e)for(var a=0,o=e.length;a<o;a++){var s=e[a];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var c;c=Array.isArray(t[s.image])?new me(t[s.image]):new r(t[s.image]),c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=n(s.mapping,Bp)),void 0!==s.offset&&c.offset.fromArray(s.offset),void 0!==s.repeat&&c.repeat.fromArray(s.repeat),void 0!==s.center&&c.center.fromArray(s.center),void 0!==s.rotation&&(c.rotation=s.rotation),void 0!==s.wrap&&(c.wrapS=n(s.wrap[0],zp),c.wrapT=n(s.wrap[1],zp)),void 0!==s.format&&(c.format=s.format),void 0!==s.type&&(c.type=s.type),void 0!==s.encoding&&(c.encoding=s.encoding),void 0!==s.minFilter&&(c.minFilter=n(s.minFilter,Fp)),void 0!==s.magFilter&&(c.magFilter=n(s.magFilter,Fp)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),void 0!==s.flipY&&(c.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(c.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(c.unpackAlignment=s.unpackAlignment),i[s.uuid]=c}return i},parseObject:function(e,t,n){function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function r(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],i=0,r=e.length;i<r;i++){var a=e[i];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}var a;switch(e.type){case"Scene":a=new f,void 0!==e.background&&Number.isInteger(e.background)&&(a.background=new w(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new en(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new $t(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":a=new Z(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new Qr(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new ea(e.color,e.intensity);break;case"DirectionalLight":a=new $r(e.color,e.intensity);break;case"PointLight":a=new Jr(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new ta(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new Yr(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new Wr(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=r(e.material);a=o.bones&&o.bones.length>0?new cn(o,s):new H(o,s);break;case"InstancedMesh":var o=i(e.geometry),s=r(e.material),c=e.count,l=e.instanceMatrix;a=new un(o,s,c),a.instanceMatrix=new L(new Float32Array(l.array),16);break;case"LOD":a=new sn;break;case"Line":a=new dn(i(e.geometry),r(e.material),e.mode);break;case"LineLoop":a=new mn(i(e.geometry),r(e.material));break;case"LineSegments":a=new fn(i(e.geometry),r(e.material));break;case"PointCloud":case"Points":a=new gn(i(e.geometry),r(e.material));break;case"Sprite":a=new an(r(e.material));break;case"Group":a=new Xt;break;default:a=new d}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children)for(var h=e.children,u=0;u<h.length;u++)a.add(this.parseObject(h[u],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate);for(var p=e.levels,m=0;m<p.length;m++){var v=p[m],g=a.getObjectByProperty("uuid",v.object);void 0!==g&&a.addLevel(g,v.distance)}}return a}});var Bp={UVMapping:300,CubeReflectionMapping:Xs,CubeRefractionMapping:Ys,EquirectangularReflectionMapping:Zs,EquirectangularRefractionMapping:Js,SphericalReflectionMapping:Qs,CubeUVReflectionMapping:Ks,CubeUVRefractionMapping:$s},zp={RepeatWrapping:ec,ClampToEdgeWrapping:tc,MirroredRepeatWrapping:nc},Fp={NearestFilter:ic,NearestMipmapNearestFilter:rc,NearestMipmapLinearFilter:ac,LinearFilter:oc,LinearMipmapNearestFilter:sc,LinearMipmapLinearFilter:cc};sa.prototype=Object.assign(Object.create(ur.prototype),{constructor:sa,setOptions:function(e){return this.options=e,this},load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Sp.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;fetch(e).then(function(e){return e.blob()}).then(function(e){return void 0===r.options?createImageBitmap(e):createImageBitmap(e,r.options)}).then(function(n){Sp.add(e,n),t&&t(n),r.manager.itemEnd(e)}).catch(function(t){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}),Object.assign(ca.prototype,{moveTo:function(e,t){return this.currentPath=new Vr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this},bezierCurveTo:function(e,t,n,i,r,a){return this.currentPath.bezierCurveTo(e,t,n,i,r,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n],a=new jr;a.curves=r.curves,t.push(a)}return t}var i=wp.isClockWise,r=this.subPaths;if(0===r.length)return[];if(!0===t)return n(r);var a,o,s,c=[];if(1===r.length)return o=r[0],s=new jr,s.curves=o.curves,c.push(s),c;var l=!i(r[0].getPoints());l=e?!l:l;var h,u=[],p=[],d=[],f=0;p[f]=void 0,d[f]=[];for(var m=0,v=r.length;m<v;m++)o=r[m],h=o.getPoints(),a=i(h),a=e?!a:a,a?(!l&&p[f]&&f++,p[f]={s:new jr,p:h},p[f].s.curves=o.curves,l&&f++,d[f]=[]):d[f].push({h:o,p:h[0]});if(!p[0])return n(r);if(p.length>1){for(var g=!1,y=[],x=0,b=p.length;x<b;x++)u[x]=[];for(var x=0,b=p.length;x<b;x++)for(var w=d[x],_=0;_<w.length;_++){for(var M=w[_],T=!0,E=0;E<p.length;E++)(function(e,t){for(var n=t.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=t[r],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[r],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=l*(e.x-o.x)-c*(e.y-o.y);if(0===h)return!0;if(h<0)continue;i=!i}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return i})(M.p,p[E].p)&&(x!==E&&y.push({froms:x,tos:E,hole:_}),T?(T=!1,u[E].push(M)):g=!0);T&&u[x].push(M)}y.length>0&&(g||(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(la.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],i=ha(e,t,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),pa.prototype=Object.assign(Object.create(ur.prototype),{constructor:pa,load:function(e,t,n,i){var r=this,a=new pr(this.manager);a.setPath(this.path),a.load(e,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var i=r.parse(n);t&&t(i)},n,i)},parse:function(e){return new la(e)}});var Up,Gp={getContext:function(){return void 0===Up&&(Up=new(window.AudioContext||window.webkitAudioContext)),Up},setContext:function(e){Up=e}};da.prototype=Object.assign(Object.create(ur.prototype),{constructor:da,load:function(e,t,n,i){var r=new pr(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(e,function(e){var n=e.slice(0);Gp.getContext().decodeAudioData(n,function(e){t(e)})},n,i)}}),Object.assign(fa.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*i),t.addScale(a[2],.488603*r),t.addScale(a[3],.488603*n),t.addScale(a[4],n*i*1.092548),t.addScale(a[5],i*r*1.092548),t.addScale(a[6],.315392*(3*r*r-1)),t.addScale(a[7],n*r*1.092548),t.addScale(a[8],.546274*(n*n-i*i)),t},getIrradianceAt:function(e,t){var n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*i),t.addScale(a[2],1.023328*r),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*i),t.addScale(a[5],.858086*i*r),t.addScale(a[6],.743125*r*r-.247708),t.addScale(a[7],.858086*n*r),t.addScale(a[8],.429043*(n*n-i*i)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}}),Object.assign(fa,{getBasisAt:function(e,t){var n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}),ma.prototype=Object.assign(Object.create(kr.prototype),{constructor:ma,isLightProbe:!0,copy:function(e){return kr.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return kr.prototype.toJSON.call(this,e)}}),va.prototype=Object.assign(Object.create(ma.prototype),{constructor:va,isHemisphereLightProbe:!0,copy:function(e){return ma.prototype.copy.call(this,e),this},toJSON:function(e){return ma.prototype.toJSON.call(this,e)}}),ga.prototype=Object.assign(Object.create(ma.prototype),{constructor:ga,isAmbientLightProbe:!0,copy:function(e){return ma.prototype.copy.call(this,e),this},toJSON:function(e){return ma.prototype.toJSON.call(this,e)}});var Hp=new h,Vp=new h;Object.assign(ya.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,i,r=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan(Tl.DEG2RAD*t.fov*.5)/t.zoom;Vp.elements[12]=-a,Hp.elements[12]=a,n=-s*t.aspect+o,i=s*t.aspect+o,r.elements[0]=2*t.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(r),n=-s*t.aspect-o,i=s*t.aspect-o,r.elements[0]=2*t.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Vp),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Hp)}}),Object.assign(xa.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var jp=new l,kp=new c,Wp=new l,qp=new l;ba.prototype=Object.assign(Object.create(d.prototype),{constructor:ba,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){d.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(jp,kp,Wp),qp.set(0,0,-1).applyQuaternion(kp),t.positionX){var i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(jp.x,i),t.positionY.linearRampToValueAtTime(jp.y,i),t.positionZ.linearRampToValueAtTime(jp.z,i),t.forwardX.linearRampToValueAtTime(qp.x,i),t.forwardY.linearRampToValueAtTime(qp.y,i),t.forwardZ.linearRampToValueAtTime(qp.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(jp.x,jp.y,jp.z),t.setOrientation(qp.x,qp.y,qp.z,n.x,n.y,n.z)}}),wa.prototype=Object.assign(Object.create(d.prototype),{constructor:wa,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!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.");this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},pause:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)},stop:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this)},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);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 e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),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(e){
- return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this)},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var Xp=new l,Yp=new c,Zp=new l,Jp=new l;_a.prototype=Object.assign(Object.create(wa.prototype),{constructor:_a,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(d.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Xp,Yp,Zp),Jp.set(0,0,1).applyQuaternion(Yp);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Xp.x,n),t.positionY.linearRampToValueAtTime(Xp.y,n),t.positionZ.linearRampToValueAtTime(Xp.z,n),t.orientationX.linearRampToValueAtTime(Jp.x,n),t.orientationY.linearRampToValueAtTime(Jp.y,n),t.orientationZ.linearRampToValueAtTime(Jp.z,n)}else t.setPosition(Xp.x,Xp.y,Xp.z),t.setOrientation(Jp.x,Jp.y,Jp.z)}}}),Object.assign(Ma.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Ta.prototype,{accumulate:function(e,t){var n=this.buffer,i=this.valueSize,r=e*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=t}else{a+=t;var s=t/a;this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*t;this._mixBufferRegion(n,i,o,1-r,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){a.setValue(n,i);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,i=3*n;e.getValue(t,i);for(var r=n,a=i;r!==a;++r)t[r]=t[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,i,r){if(i>=.5)for(var a=0;a!==r;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,i){c.slerpFlat(e,t,e,t,e,n,i)},_lerp:function(e,t,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*i}}});var Qp="\\[\\]\\.:\\/",Kp=new RegExp("["+Qp+"]","g"),$p="[^"+Qp+"]",ed="[^"+Qp.replace("\\.","")+"]",td=/((?:WC+[\/:])*)/.source.replace("WC",$p),nd=/(WCOD+)?/.source.replace("WCOD",ed),id=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",$p),rd=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",$p),ad=new RegExp("^"+td+nd+id+rd+"$"),od=["material","materials","bones"];Object.assign(Ea.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Sa,{Composite:Ea,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Sa.Composite(e,t,n):new Sa(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Kp,"")},parseTrackName:function(e){var t=ad.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==od.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var i=function(e){for(var n=0;n<e.length;n++){var r=e[n];if(r.name===t||r.uuid===t)return r;var a=i(r.children);if(a)return a}return null},r=i(e.children);if(r)return r}return null}}),Object.assign(Sa.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)e[t++]=n[i]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=Sa.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[i];if(void 0===s){var c=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",e)}var l=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var h=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(var o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===r){r=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(var o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===r){r=o;break}}}h=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(h=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][l]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Sa.prototype,{_getValue_unbound:Sa.prototype.getValue,_setValue_unbound:Sa.prototype.setValue}),Object.assign(Aa.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,l=0,h=arguments.length;l!==h;++l){var u=arguments[l],p=u.uuid,d=i[p];if(void 0===d){d=t++,i[p]=d,e.push(u);for(var f=0,m=s;f!==m;++f)o[f].push(new Sa(u,r[f],a[f]))}else if(d<n){c=e[d];var v=--n,g=e[v];i[g.uuid]=d,e[d]=g,i[p]=v,e[v]=u;for(var f=0,m=s;f!==m;++f){var y=o[f],x=y[v],b=y[d];y[d]=x,void 0===b&&(b=new Sa(u,r[f],a[f])),y[v]=b}}else e[d]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(void 0!==l&&l>=t){var h=t++,u=e[h];n[u.uuid]=l,e[l]=u,n[c]=h,e[h]=s;for(var p=0,d=r;p!==d;++p){var f=i[p],m=f[h],v=f[l];f[l]=m,f[h]=v}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,h=i[l];if(void 0!==h)if(delete i[l],h<n){var u=--n,p=e[u],d=--t,f=e[d];i[p.uuid]=h,e[h]=p,i[f.uuid]=u,e[u]=f,e.pop();for(var m=0,v=a;m!==v;++m){var g=r[m],y=g[u],x=g[d];g[h]=y,g[u]=x,g.pop()}}else{var d=--t,f=e[d];i[f.uuid]=h,e[h]=f,e.pop();for(var m=0,v=a;m!==v;++m){var g=r[m];g[h]=g[d],g.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,h=new Array(c);i=r.length,n[e]=i,a.push(e),o.push(t),r.push(h);for(var u=l,p=s.length;u!==p;++u){var d=s[u];h[u]=new Sa(d,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(La.prototype,{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(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var i=this._clip.duration,r=e._clip.duration,a=r/i,o=i/r;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=r,s[1]=r+n,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);var r=this._startTime;if(null!==r){var a=(e-r)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulate(i,s)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,i=this.loop,r=this._loopCount,a=2202===i;if(0===e)return-1===r?t:a&&1==(1&r)?n-t:t;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&r))return n-t}return t},_setEndings:function(e,t,n){var i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=e?this.zeroSlopeAtStart?2401:al:2402,i.endingEnd=t?this.zeroSlopeAtEnd?2401:al:2402)},_scheduleFading:function(e,t,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=t,o[1]=r+e,s[1]=n,this}}),Ra.prototype=Object.assign(Object.create(t.prototype),{constructor:Ra,_bindAction:function(e,t){var n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var h=0;h!==r;++h){var u=i[h],p=u.name,d=l[p];if(void 0!==d)a[h]=d;else{if(void 0!==(d=a[h])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[h].binding.parsedPath;d=new Ta(Sa.create(n,p,f),u.ValueTypeName,u.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,p),a[h]=d}o[h].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}for(var r=e._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var i=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;var r=e._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_addInactiveBinding:function(e,t,n){var i=this._bindingsByRootAndName,r=i[t],a=this._bindings;void 0===r&&(r={},i[t]=r),r[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[r],0===Object.keys(o).length&&delete a[i]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&(n=new Qi(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?sr.findByName(n,e):e,a=null!==r?r.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[i];if(void 0!==c)return c;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var l=new La(this,r,t);return this._bindAction(l,s),this._addInactiveAction(l,a,i),l},existingAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?sr.findByName(n,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return void 0!==o?o.actionByRoot[i]||null:null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==t;++r)e[r].reset();for(var r=0;r!==i;++r)n[r].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(i,e,r,a)}for(var s=this._bindings,c=this._nActiveBindings,o=0;o!==c;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];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 l=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=l,t[l]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot,a=r[t];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[t];if(void 0!==s)for(var c in s){var l=s[c];l.restoreOriginalState(),this._removeInactiveBinding(l)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Pa.prototype.clone=function(){return new Pa(void 0===this.value.clone?this.value:this.value.clone())},Ca.prototype=Object.assign(Object.create(tn.prototype),{constructor:Ca,isInstancedInterleavedBuffer:!0,copy:function(e){return tn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(Oa.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var i=n||[];return Ia(e,this,i,t),i.sort(Da),i},intersectObjects:function(e,t,n){var i=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,a=e.length;r<a;r++)Ia(e[r],this,i,t);return i.sort(Da),i}}),Object.assign(Na.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Tl.clamp(t/this.radius,-1,1))),this}}),Object.assign(Ba.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var sd=new n;Object.assign(za.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=sd.copy(t).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(e){return this.min.copy(e.min),this.max.copy(e.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(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new n),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new n),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new n),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new n),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return sd.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var cd=new l,ld=new l;Object.assign(Fa.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new l),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new l),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new l),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){cd.subVectors(e,this.start),ld.subVectors(this.end,this.start);var n=ld.dot(ld),i=ld.dot(cd),r=i/n;return t&&(r=Tl.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var i=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new l),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Ua.prototype=Object.create(d.prototype),Ua.prototype.constructor=Ua,Ua.prototype.isImmediateRenderObject=!0;var hd=new l;Ga.prototype=Object.create(d.prototype),Ga.prototype.constructor=Ga,Ga.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ga.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),hd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(hd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var ud=new l,pd=new h,dd=new h;Va.prototype=Object.create(fn.prototype),Va.prototype.constructor=Va,Va.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,i=n.getAttribute("position");dd.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<t.length;r++){var o=t[r];o.parent&&o.parent.isBone&&(pd.multiplyMatrices(dd,o.matrixWorld),ud.setFromMatrixPosition(pd),i.setXYZ(a,ud.x,ud.y,ud.z),pd.multiplyMatrices(dd,o.parent.matrixWorld),ud.setFromMatrixPosition(pd),i.setXYZ(a+1,ud.x,ud.y,ud.z),a+=2)}n.getAttribute("position").needsUpdate=!0,d.prototype.updateMatrixWorld.call(this,e)},ja.prototype=Object.create(H.prototype),ja.prototype.constructor=ja,ja.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},ja.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var fd=new l,md=new w,vd=new w;ka.prototype=Object.create(d.prototype),ka.prototype.constructor=ka,ka.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},ka.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");md.copy(this.light.color),vd.copy(this.light.groundColor);for(var n=0,i=t.count;n<i;n++){var r=n<i/2?md:vd;t.setXYZ(n,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(fd.setFromMatrixPosition(this.light.matrixWorld).negate())},Wa.prototype=Object.assign(Object.create(fn.prototype),{constructor:Wa,copy:function(e){return fn.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),qa.prototype=Object.create(fn.prototype),qa.prototype.constructor=qa;var gd=new l,yd=new l,xd=new l;Xa.prototype=Object.create(d.prototype),Xa.prototype.constructor=Xa,Xa.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Xa.prototype.update=function(){gd.setFromMatrixPosition(this.light.matrixWorld),yd.setFromMatrixPosition(this.light.target.matrixWorld),xd.subVectors(yd,gd),this.lightPlane.lookAt(yd),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(yd),this.targetLine.scale.z=xd.length()};var bd=new l,wd=new Y;Ya.prototype=Object.create(fn.prototype),Ya.prototype.constructor=Ya,
- Ya.prototype.update=function(){var e=this.geometry,t=this.pointMap;wd.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Za("c",t,e,wd,0,0,-1),Za("t",t,e,wd,0,0,1),Za("n1",t,e,wd,-1,-1,-1),Za("n2",t,e,wd,1,-1,-1),Za("n3",t,e,wd,-1,1,-1),Za("n4",t,e,wd,1,1,-1),Za("f1",t,e,wd,-1,-1,1),Za("f2",t,e,wd,1,-1,1),Za("f3",t,e,wd,-1,1,1),Za("f4",t,e,wd,1,1,1),Za("u1",t,e,wd,.7,1.1,-1),Za("u2",t,e,wd,-.7,1.1,-1),Za("u3",t,e,wd,0,2,-1),Za("cf1",t,e,wd,-1,0,1),Za("cf2",t,e,wd,1,0,1),Za("cf3",t,e,wd,0,-1,1),Za("cf4",t,e,wd,0,1,1),Za("cn1",t,e,wd,-1,0,-1),Za("cn2",t,e,wd,1,0,-1),Za("cn3",t,e,wd,0,-1,-1),Za("cn4",t,e,wd,0,1,-1),e.getAttribute("position").needsUpdate=!0};var _d=new m;Ja.prototype=Object.create(fn.prototype),Ja.prototype.constructor=Ja,Ja.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&_d.setFromObject(this.object),!_d.isEmpty()){var t=_d.min,n=_d.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=t.x,r[4]=n.y,r[5]=n.z,r[6]=t.x,r[7]=t.y,r[8]=n.z,r[9]=n.x,r[10]=t.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=t.z,r[15]=t.x,r[16]=n.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=n.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Ja.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Ja.prototype.copy=function(e){return fn.prototype.copy.call(this,e),this.object=e.object,this},Ja.prototype.clone=function(){return(new this.constructor).copy(this)},Qa.prototype=Object.create(fn.prototype),Qa.prototype.constructor=Qa,Qa.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),d.prototype.updateMatrixWorld.call(this,e))},Ka.prototype=Object.create(dn.prototype),Ka.prototype.constructor=Ka,Ka.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?is:ns,this.lookAt(this.plane.normal),d.prototype.updateMatrixWorld.call(this,e)};var Md,Td,Ed=new l;$a.prototype=Object.create(d.prototype),$a.prototype.constructor=$a,$a.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Ed.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Ed,t)}},$a.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},$a.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},$a.prototype.copy=function(e){return d.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},$a.prototype.clone=function(){return(new this.constructor).copy(this)},eo.prototype=Object.create(fn.prototype),eo.prototype.constructor=eo;var Sd=4,Ad=8,Ld=Math.pow(2,Ad),Rd=[.125,.215,.35,.446,.526,.582],Pd=Ad-Sd+1+Rd.length,Cd=20,Od={};Od[ol]=0,Od[sl]=1,Od[ll]=2,Od[ul]=3,Od[pl]=4,Od[dl]=5,Od[cl]=6;var Dd=new Qr,Id=function(e){var t=new Float32Array(e),n=new l(0,1,0),i=new Gi({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Od[ol]},outputEncoding:{value:Od[ol]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:cs,depthTest:!1,depthWrite:!1});return i.type="SphericalGaussianBlur",i}(Cd),Nd=null,Bd=null,zd=function(){for(var e=[],t=[],n=[],i=Ad,r=0;r<Pd;r++){var a=Math.pow(2,i);t.push(a);var o=1/a;r>Ad-Sd?o=Rd[r-Ad+Sd-1]:0==r&&(o=0),n.push(o);for(var s=1/(a-1),c=-s/2,l=1+s/2,h=[c,c,l,c,l,l,c,c,l,l,c,l],u=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];u.set(g,18*f),p.set(h,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new G;x.setAttribute("position",new L(u,3)),x.setAttribute("uv",new L(p,2)),x.setAttribute("faceIndex",new L(d,1)),e.push(x),i>Sd&&i--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),Fd=zd._lodPlanes,Ud=zd._sizeLods,Gd=zd._sigmas,Hd=null,Vd=null,jd=null,kd=(1+Math.sqrt(5))/2,Wd=1/kd,qd=[new l(1,1,1),new l(-1,1,1),new l(1,1,-1),new l(-1,1,-1),new l(0,kd,Wd),new l(0,kd,-Wd),new l(Wd,0,kd),new l(-Wd,0,kd),new l(kd,Wd,0),new l(-kd,Wd,0)];to.prototype={constructor:to,fromScene:function(e,t,n,i){void 0===t&&(t=0),void 0===n&&(n=.1),void 0===i&&(i=100),jd=Vd.getRenderTarget();var r=no();return ro(e,n,i,r),t>0&&ho(r,0,0,t),lo(r),io(r),r},fromEquirectangular:function(e){return e.magFilter=ic,e.minFilter=ic,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){jd=Vd.getRenderTarget();var t=no(e);return ao(e,t),lo(t),io(t),t},compileCubemapShader:function(){null==Bd&&(Bd=fo(),oo(Bd))},compileEquirectangularShader:function(){null==Nd&&(Nd=po(),oo(Nd))},dispose:function(){Id.dispose(),null!=Bd&&Bd.dispose(),null!=Nd&&Nd.dispose();for(var e=0;e<Fd.length;e++)Fd[e].dispose()}};xr.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(xr.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Hr.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new k,n=0,i=e.length;n<i;n++){var r=e[n];t.vertices.push(new l(r.x,r.y,r.z||0))}return t}}),Object.assign(Vr.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),No.prototype=Object.create(Mr.prototype),Bo.prototype=Object.create(Mr.prototype),zo.prototype=Object.create(Mr.prototype),Object.assign(zo.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Wa.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Va.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ur.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Ip.extractUrlBase(e)}}),ur.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(oa.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(za.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(m.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),$.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Fa.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(Tl,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Tl.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Tl.ceilPowerOfTwo(e)}}),Object.assign(i.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(h.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new l).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.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.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,a)}}),x.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},c.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(y.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(b.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(b,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),b.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),b.getNormal(e,t,n,i)}}),Object.assign(jr.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new yi(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ri(this,e)}}),Object.assign(n.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(l.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(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(a.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(k.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(d.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(d.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},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.assign(H.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(H.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(sn.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(ln.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),cn.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(xr.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Z.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(kr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(L.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===wl},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(wl)}}}),Object.assign(L.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?wl:bl),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(G.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new L(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},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.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(G.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(tn.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===wl},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(tn.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?wl:bl),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(xi.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Pa.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(S.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new w}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(ji.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(X.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Kt.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){
- return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},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(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},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.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Kt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?sl:ol}}}),Object.defineProperties(Ht.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(o.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(wa.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new da).load(e,function(e){t.setBuffer(e)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Ma.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},J.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var Xd={merge:function(e,t,n){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),i=t.matrix,t=t.geometry),e.merge(t,i,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};Sl.crossOrigin=void 0,Sl.loadTexture=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new yr;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},Sl.loadTextureCube=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new gr;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},Sl.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Sl.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Yd={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"113"}})),e.ACESFilmicToneMapping=qs,e.AddEquation=fs,e.AddOperation=Gs,e.AdditiveBlending=hs,e.AlphaFormat=wc,e.AlwaysDepth=Cs,e.AlwaysStencilFunc=xl,e.AmbientLight=ea,e.AmbientLightProbe=ga,e.AnimationClip=sr,e.AnimationLoader=dr,e.AnimationMixer=Ra,e.AnimationObjectGroup=Aa,e.AnimationUtils=Ep,e.ArcCurve=wr,e.ArrayCamera=Yt,e.ArrowHelper=$a,e.Audio=wa,e.AudioAnalyser=Ma,e.AudioContext=Gp,e.AudioListener=ba,e.AudioLoader=da,e.AxesHelper=eo,e.AxisHelper=Fo,e.BackSide=is,e.BasicDepthPacking=fl,e.BasicShadowMap=0,e.BinaryTextureLoader=jo,e.Bone=hn,e.BooleanKeyframeTrack=er,e.BoundingBoxHelper=Uo,e.Box2=za,e.Box3=m,e.Box3Helper=Qa,e.BoxBufferGeometry=pu,e.BoxGeometry=uu,e.BoxHelper=Ja,e.BufferAttribute=L,e.BufferGeometry=G,e.BufferGeometryLoader=aa,e.ByteType=hc,e.Cache=Sp,e.Camera=Y,e.CameraHelper=Ya,e.CanvasRenderer=Wo,e.CanvasTexture=wn,e.CatmullRomCurve3=Mr,e.CineonToneMapping=Ws,e.CircleBufferGeometry=Fi,e.CircleGeometry=zi,e.ClampToEdgeWrapping=tc,e.Clock=xa,e.ClosedSplineCurve3=No,e.Color=w,e.ColorKeyframeTrack=tr,e.CompressedTexture=bn,e.CompressedTextureLoader=fr,e.ConeBufferGeometry=Bi,e.ConeGeometry=Ni,e.CubeCamera=J,e.CubeGeometry=uu,e.CubeReflectionMapping=Xs,e.CubeRefractionMapping=Ys,e.CubeTexture=me,e.CubeTextureLoader=gr,e.CubeUVReflectionMapping=Ks,e.CubeUVRefractionMapping=$s,e.CubicBezierCurve=Ir,e.CubicBezierCurve3=Nr,e.CubicInterpolant=Ji,e.CullFaceBack=Qo,e.CullFaceFront=Ko,e.CullFaceFrontBack=3,e.CullFaceNone=Jo,e.Curve=xr,e.CurvePath=Hr,e.CustomBlending=ds,e.CylinderBufferGeometry=Ii,e.CylinderGeometry=Di,e.Cylindrical=Ba,e.DataTexture=K,e.DataTexture2DArray=ve,e.DataTexture3D=ge,e.DataTextureLoader=mr,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=Ap,e.DepthFormat=Ac,e.DepthStencilFormat=Lc,e.DepthTexture=_n,e.DirectionalLight=$r,e.DirectionalLightHelper=Xa,e.DirectionalLightShadow=Kr,e.DiscreteInterpolant=Ki,e.DodecahedronBufferGeometry=Nn,e.DodecahedronGeometry=In,e.DoubleSide=rs,e.DstAlphaFactor=Es,e.DstColorFactor=As,e.DynamicBufferAttribute=Eo,e.DynamicCopyUsage=35050,e.DynamicDrawUsage=wl,e.DynamicReadUsage=35049,e.EdgesGeometry=Oi,e.EdgesHelper=Go,e.EllipseCurve=br,e.EqualDepth=Is,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=Zs,e.EquirectangularRefractionMapping=Js,e.Euler=u,e.EventDispatcher=t,e.ExtrudeBufferGeometry=xi,e.ExtrudeGeometry=yi,e.Face3=E,e.Face4=mo,e.FaceColors=os,e.FileLoader=pr,e.FlatShading=1,e.Float32Attribute=Do,e.Float32BufferAttribute=B,e.Float64Attribute=Io,e.Float64BufferAttribute=z,e.FloatType=mc,e.Fog=en,e.FogExp2=$t,e.Font=la,e.FontLoader=pa,e.FrontFaceDirectionCCW=1,e.FrontFaceDirectionCW=0,e.FrontSide=ns,e.Frustum=$,e.GammaEncoding=cl,e.Geometry=k,e.GeometryUtils=Xd,e.GreaterDepth=Bs,e.GreaterEqualDepth=Ns,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=Wa,e.Group=Xt,e.HalfFloatType=vc,e.HemisphereLight=Wr,e.HemisphereLightHelper=ka,e.HemisphereLightProbe=va,e.IcosahedronBufferGeometry=Dn,e.IcosahedronGeometry=On,e.ImageBitmapLoader=sa,e.ImageLoader=vr,e.ImageUtils=Sl,e.ImmediateRenderObject=Ua,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=ra,e.InstancedBufferGeometry=ia,e.InstancedInterleavedBuffer=Ca,e.InstancedMesh=un,e.Int16Attribute=Ro,e.Int16BufferAttribute=O,e.Int32Attribute=Co,e.Int32BufferAttribute=I,e.Int8Attribute=So,e.Int8BufferAttribute=R,e.IntType=dc,e.InterleavedBuffer=tn,e.InterleavedBufferAttribute=nn,e.Interpolant=Zi,e.InterpolateDiscrete=2300,e.InterpolateLinear=2301,e.InterpolateSmooth=2302,e.InvertStencilOp=5386,e.JSONLoader=qo,e.KeepStencilOp=yl,e.KeyframeTrack=$i,e.LOD=sn,e.LatheBufferGeometry=Li,e.LatheGeometry=Ai,e.Layers=p,e.LensFlare=Xo,e.LessDepth=Os,e.LessEqualDepth=Ds,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=kr,e.LightProbe=ma,e.LightShadow=qr,e.Line=dn,e.Line3=Fa,e.LineBasicMaterial=pn,e.LineCurve=Br,e.LineCurve3=zr,e.LineDashedMaterial=Yi,e.LineLoop=mn,e.LinePieces=1,e.LineSegments=fn,e.LineStrip=0,e.LinearEncoding=ol,e.LinearFilter=oc,e.LinearInterpolant=Qi;e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=cc,e.LinearMipmapNearestFilter=sc,e.LinearToneMapping=Vs,e.Loader=ur,e.LoaderUtils=Ip,e.LoadingManager=hr,e.LogLuvEncoding=hl,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=rl,e.LuminanceAlphaFormat=Ec,e.LuminanceFormat=Tc,e.MOUSE=Yo,e.Material=S,e.MaterialLoader=na,e.Math=Tl,e.MathUtils=Tl,e.Matrix3=i,e.Matrix4=h,e.MaxEquation=ys,e.Mesh=H,e.MeshBasicMaterial=A,e.MeshDepthMaterial=Ut,e.MeshDistanceMaterial=Gt,e.MeshFaceMaterial=vo,e.MeshLambertMaterial=qi,e.MeshMatcapMaterial=Xi,e.MeshNormalMaterial=Wi,e.MeshPhongMaterial=ji,e.MeshPhysicalMaterial=Vi,e.MeshStandardMaterial=Hi,e.MeshToonMaterial=ki,e.MinEquation=gs,e.MirroredRepeatWrapping=nc,e.MixOperation=Us,e.MultiMaterial=go,e.MultiplyBlending=ps,e.MultiplyOperation=Fs,e.NearestFilter=ic,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=ac,e.NearestMipmapNearestFilter=rc,e.NeverDepth=Ps,e.NeverStencilFunc=512,e.NoBlending=cs,e.NoColors=as,e.NoToneMapping=Hs,e.NormalBlending=ls,e.NotEqualDepth=zs,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=nr,e.Object3D=d,e.ObjectLoader=oa,e.ObjectSpaceNormalMap=gl,e.OctahedronBufferGeometry=Cn,e.OctahedronGeometry=Pn,e.OneFactor=bs,e.OneMinusDstAlphaFactor=Ss,e.OneMinusDstColorFactor=Ls,e.OneMinusSrcAlphaFactor=Ts,e.OneMinusSrcColorFactor=_s,e.OrthographicCamera=Qr,e.PCFShadowMap=$o,e.PCFSoftShadowMap=es,e.PMREMGenerator=to,e.ParametricBufferGeometry=En,e.ParametricGeometry=Tn,e.Particle=xo,e.ParticleBasicMaterial=_o,e.ParticleSystem=bo,e.ParticleSystemMaterial=Mo,e.Path=Vr,e.PerspectiveCamera=Z,e.Plane=x,e.PlaneBufferGeometry=ie,e.PlaneGeometry=ne,e.PlaneHelper=Ka,e.PointCloud=yo,e.PointCloudMaterial=wo,e.PointLight=Jr,e.PointLightHelper=ja,e.Points=gn,e.PointsMaterial=vn,e.PolarGridHelper=qa,e.PolyhedronBufferGeometry=An,e.PolyhedronGeometry=Sn,e.PositionalAudio=_a,e.PropertyBinding=Sa,e.PropertyMixer=Ta,e.QuadraticBezierCurve=Fr,e.QuadraticBezierCurve3=Ur,e.Quaternion=c,e.QuaternionKeyframeTrack=rr,e.QuaternionLinearInterpolant=ir,e.REVISION="113",e.RGBADepthPacking=ml,e.RGBAFormat=Mc,e.RGBAIntegerFormat=Ic,e.RGBA_ASTC_10x10_Format=tl,e.RGBA_ASTC_10x5_Format=Kc,e.RGBA_ASTC_10x6_Format=$c,e.RGBA_ASTC_10x8_Format=el,e.RGBA_ASTC_12x10_Format=nl,e.RGBA_ASTC_12x12_Format=il,e.RGBA_ASTC_4x4_Format=kc,e.RGBA_ASTC_5x4_Format=Wc,e.RGBA_ASTC_5x5_Format=qc,e.RGBA_ASTC_6x5_Format=Xc,e.RGBA_ASTC_6x6_Format=Yc,e.RGBA_ASTC_8x5_Format=Zc,e.RGBA_ASTC_8x6_Format=Jc,e.RGBA_ASTC_8x8_Format=Qc,e.RGBA_PVRTC_2BPPV1_Format=Vc,e.RGBA_PVRTC_4BPPV1_Format=Hc,e.RGBA_S3TC_DXT1_Format=Bc,e.RGBA_S3TC_DXT3_Format=zc,e.RGBA_S3TC_DXT5_Format=Fc,e.RGBDEncoding=dl,e.RGBEEncoding=ll,e.RGBEFormat=Sc,e.RGBFormat=_c,e.RGBIntegerFormat=Dc,e.RGBM16Encoding=pl,e.RGBM7Encoding=ul,e.RGB_ETC1_Format=jc,e.RGB_PVRTC_2BPPV1_Format=Gc,e.RGB_PVRTC_4BPPV1_Format=Uc,e.RGB_S3TC_DXT1_Format=Nc,e.RGFormat=Cc,e.RGIntegerFormat=Oc,e.RawShaderMaterial=Gi,e.Ray=y,e.Raycaster=Oa,e.RectAreaLight=ta,e.RedFormat=Rc,e.RedIntegerFormat=Pc,e.ReinhardToneMapping=js,e.RepeatWrapping=ec,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=vs,e.RingBufferGeometry=Si,e.RingGeometry=Ei,e.Scene=f,e.SceneUtils=Yd,e.ShaderChunk=wu,e.ShaderLib=_u,e.ShaderMaterial=X,e.ShadowMaterial=Ui,e.Shape=jr,e.ShapeBufferGeometry=Pi,e.ShapeGeometry=Ri,e.ShapePath=ca,e.ShapeUtils=wp,e.ShortType=uc,e.Skeleton=ln,e.SkeletonHelper=Va,e.SkinnedMesh=cn,e.SmoothShading=2,e.Sphere=g,e.SphereBufferGeometry=Ti,e.SphereGeometry=Mi,e.Spherical=Na,e.SphericalHarmonics3=fa,e.SphericalReflectionMapping=Qs,e.Spline=zo,e.SplineCurve=Gr,e.SplineCurve3=Bo,e.SpotLight=Yr,e.SpotLightHelper=Ga,e.SpotLightShadow=Xr,e.Sprite=an,e.SpriteMaterial=rn,e.SrcAlphaFactor=Ms,e.SrcAlphaSaturateFactor=Rs,e.SrcColorFactor=ws,e.StaticCopyUsage=35046,e.StaticDrawUsage=bl,e.StaticReadUsage=35045,e.StereoCamera=ya,e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=ar,e.SubtractEquation=ms,e.SubtractiveBlending=us,e.TOUCH=Zo,e.TangentSpaceNormalMap=vl,e.TetrahedronBufferGeometry=Rn,e.TetrahedronGeometry=Ln,e.TextBufferGeometry=_i,e.TextGeometry=wi,e.Texture=r,e.TextureLoader=yr,e.TorusBufferGeometry=Hn,e.TorusGeometry=Gn,e.TorusKnotBufferGeometry=Un,e.TorusKnotGeometry=Fn;e.Triangle=b,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=zn,e.TubeGeometry=Bn,e.UVMapping=300,e.Uint16Attribute=Po,e.Uint16BufferAttribute=D,e.Uint32Attribute=Oo,e.Uint32BufferAttribute=N,e.Uint8Attribute=Ao,e.Uint8BufferAttribute=P,e.Uint8ClampedAttribute=Lo,e.Uint8ClampedBufferAttribute=C,e.Uncharted2ToneMapping=ks,e.Uniform=Pa,e.UniformsLib=bu,e.UniformsUtils=du,e.UnsignedByteType=lc,e.UnsignedInt248Type=bc,e.UnsignedIntType=fc,e.UnsignedShort4444Type=gc,e.UnsignedShort5551Type=yc,e.UnsignedShort565Type=xc,e.UnsignedShortType=pc,e.VSMShadowMap=ts,e.Vector2=n,e.Vector3=l,e.Vector4=a,e.VectorKeyframeTrack=or,e.Vertex=To,e.VertexColors=ss,e.VideoTexture=xn,e.WebGLCubeRenderTarget=Q,e.WebGLMultisampleRenderTarget=s,e.WebGLRenderTarget=o,e.WebGLRenderTargetCube=ko,e.WebGLRenderer=Kt,e.WebGLUtils=kt,e.WireframeGeometry=Mn,e.WireframeHelper=Ho,e.WrapAroundEnding=2402,e.XHRLoader=Vo,e.ZeroCurvatureEnding=al,e.ZeroFactor=xs,e.ZeroSlopeEnding=2401,e.ZeroStencilOp=0,e.sRGBEncoding=sl,Object.defineProperty(e,"__esModule",{value:!0})});
- },{}],58:[function(_dereq_,module,exports){
- /**
- * @author Don McCurdy / https://www.donmccurdy.com
- */
- THREE.DRACOLoader = function ( manager ) {
- THREE.Loader.call( this, manager );
- this.decoderPath = '';
- this.decoderConfig = {};
- this.decoderBinary = null;
- this.decoderPending = null;
- this.workerLimit = 4;
- this.workerPool = [];
- this.workerNextTaskID = 1;
- this.workerSourceURL = '';
- this.defaultAttributeIDs = {
- position: 'POSITION',
- normal: 'NORMAL',
- color: 'COLOR',
- uv: 'TEX_COORD'
- };
- this.defaultAttributeTypes = {
- position: 'Float32Array',
- normal: 'Float32Array',
- color: 'Float32Array',
- uv: 'Float32Array'
- };
- };
- THREE.DRACOLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
- constructor: THREE.DRACOLoader,
- setDecoderPath: function ( path ) {
- this.decoderPath = path;
- return this;
- },
- setDecoderConfig: function ( config ) {
- this.decoderConfig = config;
- return this;
- },
- setWorkerLimit: function ( workerLimit ) {
- this.workerLimit = workerLimit;
- return this;
- },
- /** @deprecated */
- setVerbosity: function () {
- console.warn( 'THREE.DRACOLoader: The .setVerbosity() method has been removed.' );
- },
- /** @deprecated */
- setDrawMode: function () {
- console.warn( 'THREE.DRACOLoader: The .setDrawMode() method has been removed.' );
- },
- /** @deprecated */
- setSkipDequantization: function () {
- console.warn( 'THREE.DRACOLoader: The .setSkipDequantization() method has been removed.' );
- },
- load: function ( url, onLoad, onProgress, onError ) {
- var loader = new THREE.FileLoader( this.manager );
- loader.setPath( this.path );
- loader.setResponseType( 'arraybuffer' );
- if ( this.crossOrigin === 'use-credentials' ) {
- loader.setWithCredentials( true );
- }
- loader.load( url, ( buffer ) => {
- var taskConfig = {
- attributeIDs: this.defaultAttributeIDs,
- attributeTypes: this.defaultAttributeTypes,
- useUniqueIDs: false
- };
- this.decodeGeometry( buffer, taskConfig )
- .then( onLoad )
- .catch( onError );
- }, onProgress, onError );
- },
- /** @deprecated Kept for backward-compatibility with previous DRACOLoader versions. */
- decodeDracoFile: function ( buffer, callback, attributeIDs, attributeTypes ) {
- var taskConfig = {
- attributeIDs: attributeIDs || this.defaultAttributeIDs,
- attributeTypes: attributeTypes || this.defaultAttributeTypes,
- useUniqueIDs: !! attributeIDs
- };
- this.decodeGeometry( buffer, taskConfig ).then( callback );
- },
- decodeGeometry: function ( buffer, taskConfig ) {
- // TODO: For backward-compatibility, support 'attributeTypes' objects containing
- // references (rather than names) to typed array constructors. These must be
- // serialized before sending them to the worker.
- for ( var attribute in taskConfig.attributeTypes ) {
- var type = taskConfig.attributeTypes[ attribute ];
- if ( type.BYTES_PER_ELEMENT !== undefined ) {
- taskConfig.attributeTypes[ attribute ] = type.name;
- }
- }
- //
- var taskKey = JSON.stringify( taskConfig );
- // Check for an existing task using this buffer. A transferred buffer cannot be transferred
- // again from this thread.
- if ( THREE.DRACOLoader.taskCache.has( buffer ) ) {
- var cachedTask = THREE.DRACOLoader.taskCache.get( buffer );
- if ( cachedTask.key === taskKey ) {
- return cachedTask.promise;
- } else if ( buffer.byteLength === 0 ) {
- // Technically, it would be possible to wait for the previous task to complete,
- // transfer the buffer back, and decode again with the second configuration. That
- // is complex, and I don't know of any reason to decode a Draco buffer twice in
- // different ways, so this is left unimplemented.
- throw new Error(
- 'THREE.DRACOLoader: Unable to re-decode a buffer with different ' +
- 'settings. Buffer has already been transferred.'
- );
- }
- }
- //
- var worker;
- var taskID = this.workerNextTaskID ++;
- var taskCost = buffer.byteLength;
- // Obtain a worker and assign a task, and construct a geometry instance
- // when the task completes.
- var geometryPending = this._getWorker( taskID, taskCost )
- .then( ( _worker ) => {
- worker = _worker;
- return new Promise( ( resolve, reject ) => {
- worker._callbacks[ taskID ] = { resolve, reject };
- worker.postMessage( { type: 'decode', id: taskID, taskConfig, buffer }, [ buffer ] );
- // this.debug();
- } );
- } )
- .then( ( message ) => this._createGeometry( message.geometry ) );
- // Remove task from the task list.
- geometryPending
- .finally( () => {
- if ( worker && taskID ) {
- this._releaseTask( worker, taskID );
- // this.debug();
- }
- } );
- // Cache the task result.
- THREE.DRACOLoader.taskCache.set( buffer, {
- key: taskKey,
- promise: geometryPending
- } );
- return geometryPending;
- },
- _createGeometry: function ( geometryData ) {
- var geometry = new THREE.BufferGeometry();
- if ( geometryData.index ) {
- geometry.setIndex( new THREE.BufferAttribute( geometryData.index.array, 1 ) );
- }
- for ( var i = 0; i < geometryData.attributes.length; i ++ ) {
- var attribute = geometryData.attributes[ i ];
- var name = attribute.name;
- var array = attribute.array;
- var itemSize = attribute.itemSize;
- geometry.setAttribute( name, new THREE.BufferAttribute( array, itemSize ) );
- }
- return geometry;
- },
- _loadLibrary: function ( url, responseType ) {
- var loader = new THREE.FileLoader( this.manager );
- loader.setPath( this.decoderPath );
- loader.setResponseType( responseType );
- return new Promise( ( resolve, reject ) => {
- loader.load( url, resolve, undefined, reject );
- } );
- },
- preload: function () {
- this._initDecoder();
- return this;
- },
- _initDecoder: function () {
- if ( this.decoderPending ) return this.decoderPending;
- var useJS = typeof WebAssembly !== 'object' || this.decoderConfig.type === 'js';
- var librariesPending = [];
- if ( useJS ) {
- librariesPending.push( this._loadLibrary( 'draco_decoder.js', 'text' ) );
- } else {
- librariesPending.push( this._loadLibrary( 'draco_wasm_wrapper.js', 'text' ) );
- librariesPending.push( this._loadLibrary( 'draco_decoder.wasm', 'arraybuffer' ) );
- }
- this.decoderPending = Promise.all( librariesPending )
- .then( ( libraries ) => {
- var jsContent = libraries[ 0 ];
- if ( ! useJS ) {
- this.decoderConfig.wasmBinary = libraries[ 1 ];
- }
- var fn = THREE.DRACOLoader.DRACOWorker.toString();
- var body = [
- '/* draco decoder */',
- jsContent,
- '',
- '/* worker */',
- fn.substring( fn.indexOf( '{' ) + 1, fn.lastIndexOf( '}' ) )
- ].join( '\n' );
- this.workerSourceURL = URL.createObjectURL( new Blob( [ body ] ) );
- } );
- return this.decoderPending;
- },
- _getWorker: function ( taskID, taskCost ) {
- return this._initDecoder().then( () => {
- if ( this.workerPool.length < this.workerLimit ) {
- var worker = new Worker( this.workerSourceURL );
- worker._callbacks = {};
- worker._taskCosts = {};
- worker._taskLoad = 0;
- worker.postMessage( { type: 'init', decoderConfig: this.decoderConfig } );
- worker.onmessage = function ( e ) {
- var message = e.data;
- switch ( message.type ) {
- case 'decode':
- worker._callbacks[ message.id ].resolve( message );
- break;
- case 'error':
- worker._callbacks[ message.id ].reject( message );
- break;
- default:
- console.error( 'THREE.DRACOLoader: Unexpected message, "' + message.type + '"' );
- }
- };
- this.workerPool.push( worker );
- } else {
- this.workerPool.sort( function ( a, b ) {
- return a._taskLoad > b._taskLoad ? - 1 : 1;
- } );
- }
- var worker = this.workerPool[ this.workerPool.length - 1 ];
- worker._taskCosts[ taskID ] = taskCost;
- worker._taskLoad += taskCost;
- return worker;
- } );
- },
- _releaseTask: function ( worker, taskID ) {
- worker._taskLoad -= worker._taskCosts[ taskID ];
- delete worker._callbacks[ taskID ];
- delete worker._taskCosts[ taskID ];
- },
- debug: function () {
- console.log( 'Task load: ', this.workerPool.map( ( worker ) => worker._taskLoad ) );
- },
- dispose: function () {
- for ( var i = 0; i < this.workerPool.length; ++ i ) {
- this.workerPool[ i ].terminate();
- }
- this.workerPool.length = 0;
- return this;
- }
- } );
- /* WEB WORKER */
- THREE.DRACOLoader.DRACOWorker = function () {
- var decoderConfig;
- var decoderPending;
- onmessage = function ( e ) {
- var message = e.data;
- switch ( message.type ) {
- case 'init':
- decoderConfig = message.decoderConfig;
- decoderPending = new Promise( function ( resolve/*, reject*/ ) {
- decoderConfig.onModuleLoaded = function ( draco ) {
- // Module is Promise-like. Wrap before resolving to avoid loop.
- resolve( { draco: draco } );
- };
- DracoDecoderModule( decoderConfig );
- } );
- break;
- case 'decode':
- var buffer = message.buffer;
- var taskConfig = message.taskConfig;
- decoderPending.then( ( module ) => {
- var draco = module.draco;
- var decoder = new draco.Decoder();
- var decoderBuffer = new draco.DecoderBuffer();
- decoderBuffer.Init( new Int8Array( buffer ), buffer.byteLength );
- try {
- var geometry = decodeGeometry( draco, decoder, decoderBuffer, taskConfig );
- var buffers = geometry.attributes.map( ( attr ) => attr.array.buffer );
- if ( geometry.index ) buffers.push( geometry.index.array.buffer );
- self.postMessage( { type: 'decode', id: message.id, geometry }, buffers );
- } catch ( error ) {
- console.error( error );
- self.postMessage( { type: 'error', id: message.id, error: error.message } );
- } finally {
- draco.destroy( decoderBuffer );
- draco.destroy( decoder );
- }
- } );
- break;
- }
- };
- function decodeGeometry( draco, decoder, decoderBuffer, taskConfig ) {
- var attributeIDs = taskConfig.attributeIDs;
- var attributeTypes = taskConfig.attributeTypes;
- var dracoGeometry;
- var decodingStatus;
- var geometryType = decoder.GetEncodedGeometryType( decoderBuffer );
- if ( geometryType === draco.TRIANGULAR_MESH ) {
- dracoGeometry = new draco.Mesh();
- decodingStatus = decoder.DecodeBufferToMesh( decoderBuffer, dracoGeometry );
- } else if ( geometryType === draco.POINT_CLOUD ) {
- dracoGeometry = new draco.PointCloud();
- decodingStatus = decoder.DecodeBufferToPointCloud( decoderBuffer, dracoGeometry );
- } else {
- throw new Error( 'THREE.DRACOLoader: Unexpected geometry type.' );
- }
- if ( ! decodingStatus.ok() || dracoGeometry.ptr === 0 ) {
- throw new Error( 'THREE.DRACOLoader: Decoding failed: ' + decodingStatus.error_msg() );
- }
- var geometry = { index: null, attributes: [] };
- // Gather all vertex attributes.
- for ( var attributeName in attributeIDs ) {
- var attributeType = self[ attributeTypes[ attributeName ] ];
- var attribute;
- var attributeID;
- // A Draco file may be created with default vertex attributes, whose attribute IDs
- // are mapped 1:1 from their semantic name (POSITION, NORMAL, ...). Alternatively,
- // a Draco file may contain a custom set of attributes, identified by known unique
- // IDs. glTF files always do the latter, and `.drc` files typically do the former.
- if ( taskConfig.useUniqueIDs ) {
- attributeID = attributeIDs[ attributeName ];
- attribute = decoder.GetAttributeByUniqueId( dracoGeometry, attributeID );
- } else {
- attributeID = decoder.GetAttributeId( dracoGeometry, draco[ attributeIDs[ attributeName ] ] );
- if ( attributeID === - 1 ) continue;
- attribute = decoder.GetAttribute( dracoGeometry, attributeID );
- }
- geometry.attributes.push( decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) );
- }
- // Add index.
- if ( geometryType === draco.TRIANGULAR_MESH ) {
- // Generate mesh faces.
- var numFaces = dracoGeometry.num_faces();
- var numIndices = numFaces * 3;
- var index = new Uint32Array( numIndices );
- var indexArray = new draco.DracoInt32Array();
- for ( var i = 0; i < numFaces; ++ i ) {
- decoder.GetFaceFromMesh( dracoGeometry, i, indexArray );
- for ( var j = 0; j < 3; ++ j ) {
- index[ i * 3 + j ] = indexArray.GetValue( j );
- }
- }
- geometry.index = { array: index, itemSize: 1 };
- draco.destroy( indexArray );
- }
- draco.destroy( dracoGeometry );
- return geometry;
- }
- function decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) {
- var numComponents = attribute.num_components();
- var numPoints = dracoGeometry.num_points();
- var numValues = numPoints * numComponents;
- var dracoArray;
- var array;
- switch ( attributeType ) {
- case Float32Array:
- dracoArray = new draco.DracoFloat32Array();
- decoder.GetAttributeFloatForAllPoints( dracoGeometry, attribute, dracoArray );
- array = new Float32Array( numValues );
- break;
- case Int8Array:
- dracoArray = new draco.DracoInt8Array();
- decoder.GetAttributeInt8ForAllPoints( dracoGeometry, attribute, dracoArray );
- array = new Int8Array( numValues );
- break;
- case Int16Array:
- dracoArray = new draco.DracoInt16Array();
- decoder.GetAttributeInt16ForAllPoints( dracoGeometry, attribute, dracoArray );
- array = new Int16Array( numValues );
- break;
- case Int32Array:
- dracoArray = new draco.DracoInt32Array();
- decoder.GetAttributeInt32ForAllPoints( dracoGeometry, attribute, dracoArray );
- array = new Int32Array( numValues );
- break;
- case Uint8Array:
- dracoArray = new draco.DracoUInt8Array();
- decoder.GetAttributeUInt8ForAllPoints( dracoGeometry, attribute, dracoArray );
- array = new Uint8Array( numValues );
- break;
- case Uint16Array:
- dracoArray = new draco.DracoUInt16Array();
- decoder.GetAttributeUInt16ForAllPoints( dracoGeometry, attribute, dracoArray );
- array = new Uint16Array( numValues );
- break;
- case Uint32Array:
- dracoArray = new draco.DracoUInt32Array();
- decoder.GetAttributeUInt32ForAllPoints( dracoGeometry, attribute, dracoArray );
- array = new Uint32Array( numValues );
- break;
- default:
- throw new Error( 'THREE.DRACOLoader: Unexpected attribute type.' );
- }
- for ( var i = 0; i < numValues; i ++ ) {
- array[ i ] = dracoArray.GetValue( i );
- }
- draco.destroy( dracoArray );
- return {
- name: attributeName,
- array: array,
- itemSize: numComponents
- };
- }
- };
- THREE.DRACOLoader.taskCache = new WeakMap();
- /** Deprecated static methods */
- /** @deprecated */
- THREE.DRACOLoader.setDecoderPath = function () {
- console.warn( 'THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.' );
- };
- /** @deprecated */
- THREE.DRACOLoader.setDecoderConfig = function () {
- console.warn( 'THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.' );
- };
- /** @deprecated */
- THREE.DRACOLoader.releaseDecoderModule = function () {
- console.warn( 'THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.' );
- };
- /** @deprecated */
- THREE.DRACOLoader.getDecoderModule = function () {
- console.warn( 'THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.' );
- };
- },{}],59:[function(_dereq_,module,exports){
- THREE.GLTFLoader=function(){function e(e){THREE.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null}function t(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function r(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=L.MSFT_TEXTURE_DDS,this.ddsLoader=e}function a(e){this.name=L.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[L.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=L.KHR_MATERIALS_UNLIT}function n(e){this.name=L.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,A);if(this.header={magic:THREE.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==H)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=new DataView(e,A),a=0;a<r.byteLength;){var s=r.getUint32(a,!0);a+=4;var n=r.getUint32(a,!0);if(a+=4,n===_.JSON){var i=new Uint8Array(e,A+a,s);this.content=THREE.LoaderUtils.decodeText(i)}else if(n===_.BIN){var o=A+a;this.body=e.slice(o,o+s)}a+=s}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function i(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=L.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function o(){this.name=L.KHR_TEXTURE_TRANSFORM}function l(e){THREE.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),r=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),a=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),n=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),i={specular:{value:(new THREE.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=i,this.onBeforeCompile=function(e){for(var o in i)e.uniforms[o]=i[o];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",t),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",a),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",s),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",n)},Object.defineProperties(this,{specular:{get:function(){return i.specular.value},set:function(e){i.specular.value=e}},specularMap:{get:function(){return i.specularMap.value},set:function(e){i.specularMap.value=e}},glossiness:{get:function(){return i.glossiness.value},set:function(e){i.glossiness.value=e}},glossinessMap:{get:function(){return i.glossinessMap.value},set:function(e){i.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function u(){return{name:L.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return l},extendParams:function(e,t,r){var a=t.extensions[this.name];e.color=new THREE.Color(1,1,1),e.opacity=1;var s=[];if(Array.isArray(a.diffuseFactor)){var n=a.diffuseFactor;e.color.fromArray(n),e.opacity=n[3]}if(void 0!==a.diffuseTexture&&s.push(r.assignTexture(e,"map",a.diffuseTexture)),e.emissive=new THREE.Color(0,0,0),e.glossiness=void 0!==a.glossinessFactor?a.glossinessFactor:1,e.specular=new THREE.Color(1,1,1),Array.isArray(a.specularFactor)&&e.specular.fromArray(a.specularFactor),void 0!==a.specularGlossinessTexture){var i=a.specularGlossinessTexture;s.push(r.assignTexture(e,"glossinessMap",i)),s.push(r.assignTexture(e,"specularMap",i))}return Promise.all(s)},createMaterial:function(e){var t=new l(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=THREE.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function c(){this.name=L.KHR_MESH_QUANTIZATION}function p(e,t,r,a){THREE.Interpolant.call(this,e,t,r,a)}function d(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:/^blob:.*$/i.test(e)?e:t+e)}function h(e){return void 0===e.DefaultMaterial&&(e.DefaultMaterial=new THREE.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:THREE.FrontSide})),e.DefaultMaterial}function f(e,t,r){for(var a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function m(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function E(e,t,r){for(var a=!1,s=!1,n=0,i=t.length;n<i;n++){var o=t[n];if(void 0!==o.POSITION&&(a=!0),void 0!==o.NORMAL&&(s=!0),a&&s)break}if(!a&&!s)return Promise.resolve(e);for(var l=[],u=[],n=0,i=t.length;n<i;n++){var o=t[n];if(a){var c=void 0!==o.POSITION?r.getDependency("accessor",o.POSITION):e.attributes.position;l.push(c)}if(s){var c=void 0!==o.NORMAL?r.getDependency("accessor",o.NORMAL):e.attributes.normal;u.push(c)}}return Promise.all([Promise.all(l),Promise.all(u)]).then(function(t){var r=t[0],n=t[1];return a&&(e.morphAttributes.position=r),s&&(e.morphAttributes.normal=n),e.morphTargetsRelative=!0,e})}function T(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,a=t.weights.length;r<a;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var s=t.extras.targetNames;if(e.morphTargetInfluences.length===s.length){e.morphTargetDictionary={};for(var r=0,a=s.length;r<a;r++)e.morphTargetDictionary[s[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function g(e){var t=e.extensions&&e.extensions[L.KHR_DRACO_MESH_COMPRESSION];return t?"draco:"+t.bufferView+":"+t.indices+":"+v(t.attributes):e.indices+":"+v(e.attributes)+":"+e.mode}function v(e){for(var t="",r=Object.keys(e).sort(),a=0,s=r.length;a<s;a++)t+=r[a]+":"+e[r[a]]+";";return t}function R(e,r,a){this.json=e||{},this.extensions=r||{},this.options=a||{},this.cache=new t,this.primitiveCache={},this.textureLoader=new THREE.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new THREE.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function S(e,t,r){var a=t.attributes,s=new THREE.Box3;if(void 0!==a.POSITION){var n=r.json.accessors[a.POSITION],i=n.min,o=n.max;if(void 0===i||void 0===o)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");s.set(new THREE.Vector3(i[0],i[1],i[2]),new THREE.Vector3(o[0],o[1],o[2]));var l=t.targets;if(void 0!==l)for(var u=new THREE.Vector3,c=0,p=l.length;c<p;c++){var d=l[c];if(void 0!==d.POSITION){var n=r.json.accessors[d.POSITION],i=n.min,o=n.max;void 0!==i&&void 0!==o?(u.setX(Math.max(Math.abs(i[0]),Math.abs(o[0]))),u.setY(Math.max(Math.abs(i[1]),Math.abs(o[1]))),u.setZ(Math.max(Math.abs(i[2]),Math.abs(o[2]))),s.expandByVector(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}e.boundingBox=s;var h=new THREE.Sphere;s.getCenter(h.center),h.radius=s.min.distanceTo(s.max)/2,e.boundingSphere=h}}function M(e,t,r){var a=t.attributes,s=[];for(var n in a){var i=P[n]||n.toLowerCase();i in e.attributes||s.push(function(t,a){return r.getDependency("accessor",t).then(function(t){e.setAttribute(a,t)})}(a[n],i))}if(void 0!==t.indices&&!e.index){var o=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});s.push(o)}return m(e,t),S(e,t,r),Promise.all(s).then(function(){return void 0!==t.targets?E(e,t.targets,r):e})}function y(e,t){var r=e.getIndex();if(null===r){var a=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var n=0;n<s.count;n++)a.push(n);e.setIndex(a),r=e.getIndex()}var i=r.count-2,o=[];if(t===THREE.TriangleFanDrawMode)for(var n=1;n<=i;n++)o.push(r.getX(0)),o.push(r.getX(n)),o.push(r.getX(n+1));else for(var n=0;n<i;n++)n%2==0?(o.push(r.getX(n)),o.push(r.getX(n+1)),o.push(r.getX(n+2))):(o.push(r.getX(n+2)),o.push(r.getX(n+1)),o.push(r.getX(n)));o.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var l=e.clone();return l.setIndex(o),l}e.prototype=Object.assign(Object.create(THREE.Loader.prototype),{constructor:e,load:function(e,t,r,a){var s,n=this;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:THREE.LoaderUtils.extractUrlBase(e),n.manager.itemStart(e);var i=function(t){a?a(t):console.error(t),n.manager.itemError(e),n.manager.itemEnd(e)},o=new THREE.FileLoader(n.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),"use-credentials"===n.crossOrigin&&o.setWithCredentials(!0),o.load(e,function(r){try{n.parse(r,s,function(r){t(r),n.manager.itemEnd(e)},i)}catch(e){i(e)}},r,i)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,l,p){var d,h={};if("string"==typeof e)d=e;else{if(THREE.LoaderUtils.decodeText(new Uint8Array(e,0,4))===H){try{h[L.KHR_BINARY_GLTF]=new n(e)}catch(e){return void(p&&p(e))}d=h[L.KHR_BINARY_GLTF].content}else d=THREE.LoaderUtils.decodeText(new Uint8Array(e))}var f=JSON.parse(d);if(void 0===f.asset||f.asset.version[0]<2)return void(p&&p(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));if(f.extensionsUsed)for(var m=0;m<f.extensionsUsed.length;++m){var E=f.extensionsUsed[m],T=f.extensionsRequired||[];switch(E){case L.KHR_LIGHTS_PUNCTUAL:h[E]=new a(f);break;case L.KHR_MATERIALS_UNLIT:h[E]=new s;break;case L.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:h[E]=new u;break;case L.KHR_DRACO_MESH_COMPRESSION:h[E]=new i(f,this.dracoLoader);break;case L.MSFT_TEXTURE_DDS:h[E]=new r(this.ddsLoader);break;case L.KHR_TEXTURE_TRANSFORM:h[E]=new o;break;case L.KHR_MESH_QUANTIZATION:h[E]=new c;break;default:T.indexOf(E)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+E+'".')}}new R(f,h,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(l,p)}});var L={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};a.prototype.loadLight=function(e){var t,r=this.lightDefs[e],a=new THREE.Color(16777215);void 0!==r.color&&a.fromArray(r.color);var s=void 0!==r.range?r.range:0;switch(r.type){case"directional":t=new THREE.DirectionalLight(a),t.target.position.set(0,0,-1),t.add(t.target);break;case"point":t=new THREE.PointLight(a),t.distance=s;break;case"spot":t=new THREE.SpotLight(a),t.distance=s,r.spot=r.spot||{},r.spot.innerConeAngle=void 0!==r.spot.innerConeAngle?r.spot.innerConeAngle:0,r.spot.outerConeAngle=void 0!==r.spot.outerConeAngle?r.spot.outerConeAngle:Math.PI/4,t.angle=r.spot.outerConeAngle,t.penumbra=1-r.spot.innerConeAngle/r.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+r.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==r.intensity&&(t.intensity=r.intensity),t.name=r.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return THREE.MeshBasicMaterial},s.prototype.extendParams=function(e,t,r){var a=[];e.color=new THREE.Color(1,1,1),e.opacity=1;var s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){var n=s.baseColorFactor;e.color.fromArray(n),e.opacity=n[3]}void 0!==s.baseColorTexture&&a.push(r.assignTexture(e,"map",s.baseColorTexture))}return Promise.all(a)};var H="glTF",A=12,_={JSON:1313821514,BIN:5130562};i.prototype.decodePrimitive=function(e,t){var r=this.json,a=this.dracoLoader,s=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,i={},o={},l={};for(var u in n){var c=P[u]||u.toLowerCase();i[c]=n[u]}for(u in e.attributes){var c=P[u]||u.toLowerCase();if(void 0!==n[u]){var p=r.accessors[e.attributes[u]],d=w[p.componentType];l[c]=d,o[c]=!0===p.normalized}}return t.getDependency("bufferView",s).then(function(e){return new Promise(function(t){a.decodeDracoFile(e,function(e){for(var r in e.attributes){var a=e.attributes[r],s=o[r];void 0!==s&&(a.normalized=s)}t(e)},i,l)})})},o.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},l.prototype=Object.create(THREE.MeshStandardMaterial.prototype),l.prototype.constructor=l,l.prototype.copy=function(e){return THREE.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},p.prototype=Object.create(THREE.Interpolant.prototype),p.prototype.constructor=p,p.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,a=this.valueSize,s=e*a*3+a,n=0;n!==a;n++)t[n]=r[s+n];return t},p.prototype.beforeStart_=p.prototype.copySampleValue_,p.prototype.afterEnd_=p.prototype.copySampleValue_,p.prototype.interpolate_=function(e,t,r,a){for(var s=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=2*i,l=3*i,u=a-t,c=(r-t)/u,p=c*c,d=p*c,h=e*l,f=h-l,m=-2*d+3*p,E=d-p,T=1-m,g=E-p+c,v=0;v!==i;v++){var R=n[f+v+i],S=n[f+v+o]*u,M=n[h+v+i],y=n[h+v]*u;s[v]=T*R+g*S+m*M+E*y}return s};var x={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},w={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},b={9728:THREE.NearestFilter,9729:THREE.LinearFilter,9984:THREE.NearestMipmapNearestFilter,9985:THREE.LinearMipmapNearestFilter,9986:THREE.NearestMipmapLinearFilter,9987:THREE.LinearMipmapLinearFilter},I={33071:THREE.ClampToEdgeWrapping,33648:THREE.MirroredRepeatWrapping,10497:THREE.RepeatWrapping},N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},P={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},O={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},F={CUBICSPLINE:void 0,LINEAR:THREE.InterpolateLinear,STEP:THREE.InterpolateDiscrete},U={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},C={"image/png":THREE.RGBAFormat,"image/jpeg":THREE.RGBFormat};return R.prototype.parse=function(e,t){var r=this,a=this.json,s=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(t){var n={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};f(s,n,a),m(n,a),e(n)}).catch(t)},R.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},s={},n=0,i=t.length;n<i;n++)for(var o=t[n].joints,l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0;for(var c=0,p=e.length;c<p;c++){var d=e[c];void 0!==d.mesh&&(void 0===a[d.mesh]&&(a[d.mesh]=s[d.mesh]=0),a[d.mesh]++,void 0!==d.skin&&(r[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=a,this.json.meshUses=s},R.prototype.getDependency=function(e,t){var r=e+":"+t,a=this.cache.get(r);if(!a){switch(e){case"scene":a=this.loadScene(t);break;case"node":a=this.loadNode(t);break;case"mesh":a=this.loadMesh(t);break;case"accessor":a=this.loadAccessor(t);break;case"bufferView":a=this.loadBufferView(t);break;case"buffer":a=this.loadBuffer(t);break;case"material":a=this.loadMaterial(t);break;case"texture":a=this.loadTexture(t);break;case"skin":a=this.loadSkin(t);break;case"animation":a=this.loadAnimation(t);break;case"camera":a=this.loadCamera(t);break;case"light":a=this.extensions[L.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(r,a)}return a},R.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,a=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(a.map(function(t,a){return r.getDependency(e,a)})),this.cache.add(e,t)}return t},R.prototype.loadBuffer=function(e){var t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[L.KHR_BINARY_GLTF].body);var a=this.options;return new Promise(function(e,s){r.load(d(t.uri,a.path),e,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})},R.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){var r=t.byteLength||0,a=t.byteOffset||0;return e.slice(a,a+r)})},R.prototype.loadAccessor=function(e){var t=this,r=this.json,a=this.json.accessors[e];if(void 0===a.bufferView&&void 0===a.sparse)return Promise.resolve(null);var s=[];return void 0!==a.bufferView?s.push(this.getDependency("bufferView",a.bufferView)):s.push(null),void 0!==a.sparse&&(s.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(s).then(function(e){var s,n,i=e[0],o=N[a.type],l=w[a.componentType],u=l.BYTES_PER_ELEMENT,c=u*o,p=a.byteOffset||0,d=void 0!==a.bufferView?r.bufferViews[a.bufferView].byteStride:void 0,h=!0===a.normalized;if(d&&d!==c){var f=Math.floor(p/d),m="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+f+":"+a.count,E=t.cache.get(m);E||(s=new l(i,f*d,a.count*d/u),E=new THREE.InterleavedBuffer(s,d/u),t.cache.add(m,E)),n=new THREE.InterleavedBufferAttribute(E,o,p%d/u,h)}else s=null===i?new l(a.count*o):new l(i,p,a.count*o),n=new THREE.BufferAttribute(s,o,h);if(void 0!==a.sparse){var T=N.SCALAR,g=w[a.sparse.indices.componentType],v=a.sparse.indices.byteOffset||0,R=a.sparse.values.byteOffset||0,S=new g(e[1],v,a.sparse.count*T),M=new l(e[2],R,a.sparse.count*o);null!==i&&(n=new THREE.BufferAttribute(n.array.slice(),n.itemSize,n.normalized));for(var y=0,L=S.length;y<L;y++){var H=S[y];if(n.setX(H,M[y*o]),o>=2&&n.setY(H,M[y*o+1]),o>=3&&n.setZ(H,M[y*o+2]),o>=4&&n.setW(H,M[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return n})},R.prototype.loadTexture=function(e){var t,r=this,a=this.json,s=this.options,n=this.textureLoader,i=window.URL||window.webkitURL,o=a.textures[e],l=o.extensions||{};t=l[L.MSFT_TEXTURE_DDS]?a.images[l[L.MSFT_TEXTURE_DDS].source]:a.images[o.source];var u=t.uri,c=!1;return void 0!==t.bufferView&&(u=r.getDependency("bufferView",t.bufferView).then(function(e){c=!0;var r=new Blob([e],{type:t.mimeType});return u=i.createObjectURL(r)})),Promise.resolve(u).then(function(e){var t=s.manager.getHandler(e);return t||(t=l[L.MSFT_TEXTURE_DDS]?r.extensions[L.MSFT_TEXTURE_DDS].ddsLoader:n),new Promise(function(r,a){t.load(d(e,s.path),r,void 0,a)})}).then(function(e){!0===c&&i.revokeObjectURL(u),e.flipY=!1,void 0!==o.name&&(e.name=o.name),t.mimeType in C&&(e.format=C[t.mimeType]);var r=a.samplers||{},s=r[o.sampler]||{};return e.magFilter=b[s.magFilter]||THREE.LinearFilter,e.minFilter=b[s.minFilter]||THREE.LinearMipmapLinearFilter,e.wrapS=I[s.wrapS]||THREE.RepeatWrapping,e.wrapT=I[s.wrapT]||THREE.RepeatWrapping,e})},R.prototype.assignTexture=function(e,t,r){var a=this;return this.getDependency("texture",r.index).then(function(s){if(!s.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":s.format=THREE.RGBFormat}if(void 0===r.texCoord||0==r.texCoord||"aoMap"===t&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+t+" not yet supported."),a.extensions[L.KHR_TEXTURE_TRANSFORM]){var n=void 0!==r.extensions?r.extensions[L.KHR_TEXTURE_TRANSFORM]:void 0;n&&(s=a.extensions[L.KHR_TEXTURE_TRANSFORM].extendTexture(s,n))}e[t]=s})},R.prototype.assignFinalMaterial=function(e){var t=e.geometry,r=e.material,a=(this.extensions,void 0!==t.attributes.tangent),s=void 0!==t.attributes.color,n=void 0===t.attributes.normal,i=!0===e.isSkinnedMesh,o=Object.keys(t.morphAttributes).length>0,l=o&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+r.uuid,c=this.cache.get(u);c||(c=new THREE.PointsMaterial,THREE.Material.prototype.copy.call(c,r),c.color.copy(r.color),c.map=r.map,c.sizeAttenuation=!1,this.cache.add(u,c)),r=c}else if(e.isLine){var u="LineBasicMaterial:"+r.uuid,p=this.cache.get(u);p||(p=new THREE.LineBasicMaterial,THREE.Material.prototype.copy.call(p,r),p.color.copy(r.color),this.cache.add(u,p)),r=p}if(a||s||n||i||o){var u="ClonedMaterial:"+r.uuid+":";r.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),i&&(u+="skinning:"),a&&(u+="vertex-tangents:"),s&&(u+="vertex-colors:"),n&&(u+="flat-shading:"),o&&(u+="morph-targets:"),l&&(u+="morph-normals:");var d=this.cache.get(u);d||(d=r.clone(),i&&(d.skinning=!0),a&&(d.vertexTangents=!0),s&&(d.vertexColors=THREE.VertexColors),n&&(d.flatShading=!0),o&&(d.morphTargets=!0),l&&(d.morphNormals=!0),this.cache.add(u,d)),r=d}r.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",new THREE.BufferAttribute(t.attributes.uv.array,2)),r.normalScale&&!a&&(r.normalScale.y=-r.normalScale.y),e.material=r},R.prototype.loadMaterial=function(e){var t,r=this,a=this.json,s=this.extensions,n=a.materials[e],i={},o=n.extensions||{},u=[];if(o[L.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var c=s[L.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=c.getMaterialType(),u.push(c.extendParams(i,n,r))}else if(o[L.KHR_MATERIALS_UNLIT]){var p=s[L.KHR_MATERIALS_UNLIT];t=p.getMaterialType(),u.push(p.extendParams(i,n,r))}else{t=THREE.MeshStandardMaterial;var d=n.pbrMetallicRoughness||{};if(i.color=new THREE.Color(1,1,1),i.opacity=1,Array.isArray(d.baseColorFactor)){var h=d.baseColorFactor;i.color.fromArray(h),i.opacity=h[3]}void 0!==d.baseColorTexture&&u.push(r.assignTexture(i,"map",d.baseColorTexture)),i.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,i.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(u.push(r.assignTexture(i,"metalnessMap",d.metallicRoughnessTexture)),u.push(r.assignTexture(i,"roughnessMap",d.metallicRoughnessTexture)))}!0===n.doubleSided&&(i.side=THREE.DoubleSide);var E=n.alphaMode||U.OPAQUE;return E===U.BLEND?i.transparent=!0:(i.transparent=!1,E===U.MASK&&(i.alphaTest=void 0!==n.alphaCutoff?n.alphaCutoff:.5)),void 0!==n.normalTexture&&t!==THREE.MeshBasicMaterial&&(u.push(r.assignTexture(i,"normalMap",n.normalTexture)),i.normalScale=new THREE.Vector2(1,1),void 0!==n.normalTexture.scale&&i.normalScale.set(n.normalTexture.scale,n.normalTexture.scale)),void 0!==n.occlusionTexture&&t!==THREE.MeshBasicMaterial&&(u.push(r.assignTexture(i,"aoMap",n.occlusionTexture)),void 0!==n.occlusionTexture.strength&&(i.aoMapIntensity=n.occlusionTexture.strength)),void 0!==n.emissiveFactor&&t!==THREE.MeshBasicMaterial&&(i.emissive=(new THREE.Color).fromArray(n.emissiveFactor)),void 0!==n.emissiveTexture&&t!==THREE.MeshBasicMaterial&&u.push(r.assignTexture(i,"emissiveMap",n.emissiveTexture)),Promise.all(u).then(function(){var e;return e=t===l?s[L.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(i):new t(i),void 0!==n.name&&(e.name=n.name),e.map&&(e.map.encoding=THREE.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=THREE.sRGBEncoding),m(e,n),n.extensions&&f(s,e,n),e})},R.prototype.loadGeometries=function(e){for(var t=this,r=this.extensions,a=this.primitiveCache,s=[],n=0,i=e.length;n<i;n++){var o=e[n],l=g(o),u=a[l];if(u)s.push(u.promise);else{var c;c=o.extensions&&o.extensions[L.KHR_DRACO_MESH_COMPRESSION]?function(e){return r[L.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(r){return M(r,e,t)})}(o):M(new THREE.BufferGeometry,o,t),a[l]={primitive:o,promise:c},s.push(c)}}return Promise.all(s)},R.prototype.loadMesh=function(e){for(var t=this,r=this.json,a=r.meshes[e],s=a.primitives,n=[],i=0,o=s.length;i<o;i++){var l=void 0===s[i].material?h(this.cache):this.getDependency("material",s[i].material);n.push(l)}return n.push(t.loadGeometries(s)),Promise.all(n).then(function(r){for(var n=r.slice(0,r.length-1),i=r[r.length-1],o=[],l=0,u=i.length;l<u;l++){var c,p=i[l],d=s[l],h=n[l];if(d.mode===x.TRIANGLES||d.mode===x.TRIANGLE_STRIP||d.mode===x.TRIANGLE_FAN||void 0===d.mode)c=!0===a.isSkinnedMesh?new THREE.SkinnedMesh(p,h):new THREE.Mesh(p,h),!0!==c.isSkinnedMesh||c.geometry.attributes.skinWeight.normalized||c.normalizeSkinWeights(),d.mode===x.TRIANGLE_STRIP?c.geometry=y(c.geometry,THREE.TriangleStripDrawMode):d.mode===x.TRIANGLE_FAN&&(c.geometry=y(c.geometry,THREE.TriangleFanDrawMode));else if(d.mode===x.LINES)c=new THREE.LineSegments(p,h);else if(d.mode===x.LINE_STRIP)c=new THREE.Line(p,h);else if(d.mode===x.LINE_LOOP)c=new THREE.LineLoop(p,h);else{if(d.mode!==x.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);c=new THREE.Points(p,h)}Object.keys(c.geometry.morphAttributes).length>0&&T(c,a),c.name=a.name||"mesh_"+e,i.length>1&&(c.name+="_"+l),m(c,a),t.assignFinalMaterial(c),o.push(c)}if(1===o.length)return o[0];for(var f=new THREE.Group,l=0,u=o.length;l<u;l++)f.add(o[l]);return f})},R.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],a=r[r.type];return a?("perspective"===r.type?t=new THREE.PerspectiveCamera(THREE.MathUtils.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):"orthographic"===r.type&&(t=new THREE.OrthographicCamera(a.xmag/-2,a.xmag/2,a.ymag/2,a.ymag/-2,a.znear,a.zfar)),void 0!==r.name&&(t.name=r.name),m(t,r),Promise.resolve(t)):void console.warn("THREE.GLTFLoader: Missing camera parameters.")},R.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return r.inverseBindMatrices=e,r})},R.prototype.loadAnimation=function(e){for(var t=this.json,r=t.animations[e],a=[],s=[],n=[],i=[],o=[],l=0,u=r.channels.length;l<u;l++){var c=r.channels[l],d=r.samplers[c.sampler],h=c.target,f=void 0!==h.node?h.node:h.id,m=void 0!==r.parameters?r.parameters[d.input]:d.input,E=void 0!==r.parameters?r.parameters[d.output]:d.output;a.push(this.getDependency("node",f)),s.push(this.getDependency("accessor",m)),n.push(this.getDependency("accessor",E)),i.push(d),o.push(h)}return Promise.all([Promise.all(a),Promise.all(s),Promise.all(n),Promise.all(i),Promise.all(o)]).then(function(t){for(var a=t[0],s=t[1],n=t[2],i=t[3],o=t[4],l=[],u=0,c=a.length;u<c;u++){var d=a[u],h=s[u],f=n[u],m=i[u],E=o[u];if(void 0!==d){d.updateMatrix(),d.matrixAutoUpdate=!0;var T;switch(O[E.path]){case O.weights:T=THREE.NumberKeyframeTrack;break;case O.rotation:T=THREE.QuaternionKeyframeTrack;break;case O.position:case O.scale:default:T=THREE.VectorKeyframeTrack}var g=d.name?d.name:d.uuid,v=void 0!==m.interpolation?F[m.interpolation]:THREE.InterpolateLinear,R=[];O[E.path]===O.weights?d.traverse(function(e){!0===e.isMesh&&e.morphTargetInfluences&&R.push(e.name?e.name:e.uuid)}):R.push(g);var S=f.array;if(f.normalized){var M;if(S.constructor===Int8Array)M=1/127;else if(S.constructor===Uint8Array)M=1/255;else if(S.constructor==Int16Array)M=1/32767;else{if(S.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");M=1/65535}for(var y=new Float32Array(S.length),L=0,H=S.length;L<H;L++)y[L]=S[L]*M;S=y}for(var L=0,H=R.length;L<H;L++){var A=new T(R[L]+"."+O[E.path],h.array,S,v);"CUBICSPLINE"===m.interpolation&&(A.createInterpolant=function(e){return new p(this.times,this.values,this.getValueSize()/3,e)},A.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(A)}}}var _=void 0!==r.name?r.name:"animation_"+e;return new THREE.AnimationClip(_,void 0,l)})},R.prototype.loadNode=function(e){var t=this.json,r=this.extensions,a=this,s=t.meshReferences,n=t.meshUses,i=t.nodes[e];return function(){var e=[];return void 0!==i.mesh&&e.push(a.getDependency("mesh",i.mesh).then(function(e){var t;if(s[i.mesh]>1){var r=n[i.mesh]++;t=e.clone(),t.name+="_instance_"+r}else t=e;return void 0!==i.weights&&t.traverse(function(e){if(e.isMesh)for(var t=0,r=i.weights.length;t<r;t++)e.morphTargetInfluences[t]=i.weights[t]}),t})),void 0!==i.camera&&e.push(a.getDependency("camera",i.camera)),i.extensions&&i.extensions[L.KHR_LIGHTS_PUNCTUAL]&&void 0!==i.extensions[L.KHR_LIGHTS_PUNCTUAL].light&&e.push(a.getDependency("light",i.extensions[L.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(e)}().then(function(e){var t
- ;if((t=!0===i.isBone?new THREE.Bone:e.length>1?new THREE.Group:1===e.length?e[0]:new THREE.Object3D)!==e[0])for(var a=0,s=e.length;a<s;a++)t.add(e[a]);if(void 0!==i.name&&(t.userData.name=i.name,t.name=THREE.PropertyBinding.sanitizeNodeName(i.name)),m(t,i),i.extensions&&f(r,t,i),void 0!==i.matrix){var n=new THREE.Matrix4;n.fromArray(i.matrix),t.applyMatrix4(n)}else void 0!==i.translation&&t.position.fromArray(i.translation),void 0!==i.rotation&&t.quaternion.fromArray(i.rotation),void 0!==i.scale&&t.scale.fromArray(i.scale);return t})},R.prototype.loadScene=function(){function e(t,r,a,s){var n=a.nodes[t];return s.getDependency("node",t).then(function(e){if(void 0===n.skin)return e;var t;return s.getDependency("skin",n.skin).then(function(e){t=e;for(var r=[],a=0,n=t.joints.length;a<n;a++)r.push(s.getDependency("node",t.joints[a]));return Promise.all(r)}).then(function(r){return e.traverse(function(e){if(e.isMesh){for(var a=[],s=[],n=0,i=r.length;n<i;n++){var o=r[n];if(o){a.push(o);var l=new THREE.Matrix4;void 0!==t.inverseBindMatrices&&l.fromArray(t.inverseBindMatrices.array,16*n),s.push(l)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[n])}e.bind(new THREE.Skeleton(a,s),e.matrixWorld)}}),e})}).then(function(t){r.add(t);var i=[];if(n.children)for(var o=n.children,l=0,u=o.length;l<u;l++){var c=o[l];i.push(e(c,t,a,s))}return Promise.all(i)})}return function(t){var r=this.json,a=this.extensions,s=this.json.scenes[t],n=this,i=new THREE.Scene;void 0!==s.name&&(i.name=s.name),m(i,s),s.extensions&&f(a,i,s);for(var o=s.nodes||[],l=[],u=0,c=o.length;u<c;u++)l.push(e(o[u],i,r,n));return Promise.all(l).then(function(){return i})}}(),e}();
- },{}],60:[function(_dereq_,module,exports){
- THREE.MTLLoader=function(a){THREE.Loader.call(this,a)},THREE.MTLLoader.prototype=Object.assign(Object.create(THREE.Loader.prototype),{constructor:THREE.MTLLoader,load:function(a,t,r,e){var s=this,i=""===this.path?THREE.LoaderUtils.extractUrlBase(a):this.path,o=new THREE.FileLoader(this.manager);o.setPath(this.path),o.load(a,function(a){t(s.parse(a,i))},r,e)},setMaterialOptions:function(a){return this.materialOptions=a,this},parse:function(a,t){for(var r=a.split("\n"),e={},s=/\s+/,i={},o=0;o<r.length;o++){var n=r[o];if(n=n.trim(),0!==n.length&&"#"!==n.charAt(0)){var p=n.indexOf(" "),l=p>=0?n.substring(0,p):n;l=l.toLowerCase();var c=p>=0?n.substring(p+1):"";if(c=c.trim(),"newmtl"===l)e={name:c},i[c]=e;else if("ka"===l||"kd"===l||"ks"===l||"ke"===l){var h=c.split(s,3);e[l]=[parseFloat(h[0]),parseFloat(h[1]),parseFloat(h[2])]}else e[l]=c}}var u=new THREE.MTLLoader.MaterialCreator(this.resourcePath||t,this.materialOptions);return u.setCrossOrigin(this.crossOrigin),u.setManager(this.manager),u.setMaterials(i),u}}),THREE.MTLLoader.MaterialCreator=function(a,t){this.baseUrl=a||"",this.options=t,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,crossOrigin:"anonymous",setCrossOrigin:function(a){return this.crossOrigin=a,this},setManager:function(a){this.manager=a},setMaterials:function(a){this.materialsInfo=this.convert(a),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(a){if(!this.options)return a;var t={};for(var r in a){var e=a[r],s={};t[r]=s;for(var i in e){var o=!0,n=e[i],p=i.toLowerCase();switch(p){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[p]=n)}}return t},preload:function(){for(var a in this.materialsInfo)this.create(a)},getIndex:function(a){return this.nameLookup[a]},getAsArray:function(){var a=0;for(var t in this.materialsInfo)this.materialsArray[a]=this.create(t),this.nameLookup[t]=a,a++;return this.materialsArray},create:function(a){return void 0===this.materials[a]&&this.createMaterial_(a),this.materials[a]},createMaterial_:function(a){function t(a,t){return"string"!=typeof t||""===t?"":/^https?:\/\//i.test(t)?t:a+t}function r(a,r){if(!i[a]){var s=e.getTextureParams(r,i),o=e.loadTexture(t(e.baseUrl,s.url));o.repeat.copy(s.scale),o.offset.copy(s.offset),o.wrapS=e.wrap,o.wrapT=e.wrap,i[a]=o}}var e=this,s=this.materialsInfo[a],i={name:a,side:this.side};for(var o in s){var n,p=s[o];if(""!==p)switch(o.toLowerCase()){case"kd":i.color=(new THREE.Color).fromArray(p);break;case"ks":i.specular=(new THREE.Color).fromArray(p);break;case"ke":i.emissive=(new THREE.Color).fromArray(p);break;case"map_kd":r("map",p);break;case"map_ks":r("specularMap",p);break;case"map_ke":r("emissiveMap",p);break;case"norm":r("normalMap",p);break;case"map_bump":case"bump":r("bumpMap",p);break;case"map_d":r("alphaMap",p),i.transparent=!0;break;case"ns":i.shininess=parseFloat(p);break;case"d":n=parseFloat(p),n<1&&(i.opacity=n,i.transparent=!0);break;case"tr":n=parseFloat(p),this.options&&this.options.invertTrProperty&&(n=1-n),n>0&&(i.opacity=1-n,i.transparent=!0)}}return this.materials[a]=new THREE.MeshPhongMaterial(i),this.materials[a]},getTextureParams:function(a,t){var r,e={scale:new THREE.Vector2(1,1),offset:new THREE.Vector2(0,0)},s=a.split(/\s+/);return r=s.indexOf("-bm"),r>=0&&(t.bumpScale=parseFloat(s[r+1]),s.splice(r,2)),r=s.indexOf("-s"),r>=0&&(e.scale.set(parseFloat(s[r+1]),parseFloat(s[r+2])),s.splice(r,4)),r=s.indexOf("-o"),r>=0&&(e.offset.set(parseFloat(s[r+1]),parseFloat(s[r+2])),s.splice(r,4)),e.url=s.join(" ").trim(),e},loadTexture:function(a,t,r,e,s){var i,o=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager,n=o.getHandler(a);return null===n&&(n=new THREE.TextureLoader(o)),n.setCrossOrigin&&n.setCrossOrigin(this.crossOrigin),i=n.load(a,r,e,s),void 0!==t&&(i.mapping=t),i}};
- },{}],61:[function(_dereq_,module,exports){
- THREE.OBJLoader=function(){function t(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);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:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[]},materials:[],smooth:!0,startMaterial:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var i={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.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(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(i),i},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&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 t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},r&&r.name&&"function"==typeof r.clone){var i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)},parseNormalIndex:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)},parseUVIndex:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)},addVertex:function(t,e,r){var i=this.vertices,s=this.object.geometry.vertices;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,r){var i=this.normals,s=this.object.geometry.normals;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[r+0],i[r+1],i[r+2])},addColor:function(t,e,r){var i=this.colors,s=this.object.geometry.colors;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[r+0],i[r+1],i[r+2])},addUV:function(t,e,r){var i=this.uvs,s=this.object.geometry.uvs;s.push(i[t+0],i[t+1]),s.push(i[e+0],i[e+1]),s.push(i[r+0],i[r+1])},addUVLine:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,r,i,s,a,o,n,l){var h=this.vertices.length,c=this.parseVertexIndex(t,h),u=this.parseVertexIndex(e,h),p=this.parseVertexIndex(r,h);if(this.addVertex(c,u,p),this.colors.length>0&&this.addColor(c,u,p),void 0!==i&&""!==i){var m=this.uvs.length;c=this.parseUVIndex(i,m),u=this.parseUVIndex(s,m),p=this.parseUVIndex(a,m),this.addUV(c,u,p)}if(void 0!==o&&""!==o){var f=this.normals.length;c=this.parseNormalIndex(o,f),u=o===n?c:this.parseNormalIndex(n,f),p=o===l?c:this.parseNormalIndex(l,f),this.addNormal(c,u,p)}},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,r=0,i=t.length;r<i;r++)this.addVertexPoint(this.parseVertexIndex(t[r],e))},addLineGeometry:function(t,e){this.object.geometry.type="Line";for(var r=this.vertices.length,i=this.uvs.length,s=0,a=t.length;s<a;s++)this.addVertexLine(this.parseVertexIndex(t[s],r));for(var o=0,a=e.length;o<a;o++)this.addUVLine(this.parseUVIndex(e[o],i))}};return t.startObject("",!1),t}function e(t){THREE.Loader.call(this,t),this.materials=null}var r=/^[og]\s*(.+)?/,i=/^mtllib /,s=/^usemtl /,a=/^usemap /;return e.prototype=Object.assign(Object.create(THREE.Loader.prototype),{constructor:e,load:function(t,e,r,i){var s=this,a=new THREE.FileLoader(s.manager);a.setPath(this.path),a.load(t,function(t){e(s.parse(t))},r,i)},setMaterials:function(t){return this.materials=t,this},parse:function(e){var o=new t;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));for(var n=e.split("\n"),l="",h="",c=[],u="function"==typeof"".trimLeft,p=0,m=n.length;p<m;p++)if(l=n[p],l=u?l.trimLeft():l.trim(),0!==l.length&&"#"!==(h=l.charAt(0)))if("v"===h){var f=l.split(/\s+/);switch(f[0]){case"v":o.vertices.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3])),f.length>=7&&o.colors.push(parseFloat(f[4]),parseFloat(f[5]),parseFloat(f[6]));break;case"vn":o.normals.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3]));break;case"vt":o.uvs.push(parseFloat(f[1]),parseFloat(f[2]))}}else if("f"===h){for(var d=l.substr(1).trim(),v=d.split(/\s+/),g=[],b=0,E=v.length;b<E;b++){var j=v[b];if(j.length>0){var x=j.split("/");g.push(x)}}for(var y=g[0],b=1,E=g.length-1;b<E;b++){var T=g[b],R=g[b+1];o.addFace(y[0],T[0],R[0],y[1],T[1],R[1],y[2],T[2],R[2])}}else if("l"===h){var H=l.substring(1).trim().split(" "),L=[],w=[];if(-1===l.indexOf("/"))L=H;else for(var V=0,M=H.length;V<M;V++){var F=H[V].split("/");""!==F[0]&&L.push(F[0]),""!==F[1]&&w.push(F[1])}o.addLineGeometry(L,w)}else if("p"===h){var d=l.substr(1).trim(),I=d.split(" ");o.addPointGeometry(I)}else if(null!==(c=r.exec(l))){var A=(" "+c[0].substr(1).trim()).substr(1);o.startObject(A)}else if(s.test(l))o.object.startMaterial(l.substring(7).trim(),o.materialLibraries);else if(i.test(l))o.materialLibraries.push(l.substring(7).trim());else if(a.test(l))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===h){if(c=l.split(" "),c.length>1){var P=c[1].trim().toLowerCase();o.object.smooth="0"!==P&&"off"!==P}else o.object.smooth=!0;var z=o.object.currentMaterial();z&&(z.smooth=o.object.smooth)}else{if("\0"===l)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+l+'"')}o.finalize();var C=new THREE.Group;C.materialLibraries=[].concat(o.materialLibraries);for(var p=0,m=o.objects.length;p<m;p++){var B=o.objects[p],O=B.geometry,U=B.materials,N="Line"===O.type,_="Points"===O.type,G=!1;if(0!==O.vertices.length){var S=new THREE.BufferGeometry;S.setAttribute("position",new THREE.Float32BufferAttribute(O.vertices,3)),O.normals.length>0?S.setAttribute("normal",new THREE.Float32BufferAttribute(O.normals,3)):S.computeVertexNormals(),O.colors.length>0&&(G=!0,S.setAttribute("color",new THREE.Float32BufferAttribute(O.colors,3))),O.uvs.length>0&&S.setAttribute("uv",new THREE.Float32BufferAttribute(O.uvs,2));for(var D=[],J=0,k=U.length;J<k;J++){var q=U[J],K=q.name+"_"+q.smooth+"_"+G,z=o.materials[K];if(null!==this.materials)if(z=this.materials.create(q.name),!N||!z||z instanceof THREE.LineBasicMaterial){if(_&&z&&!(z instanceof THREE.PointsMaterial)){var Q=new THREE.PointsMaterial({size:10,sizeAttenuation:!1});THREE.Material.prototype.copy.call(Q,z),Q.color.copy(z.color),Q.map=z.map,z=Q}}else{var W=new THREE.LineBasicMaterial;THREE.Material.prototype.copy.call(W,z),W.color.copy(z.color),z=W}void 0===z&&(z=N?new THREE.LineBasicMaterial:_?new THREE.PointsMaterial({size:1,sizeAttenuation:!1}):new THREE.MeshPhongMaterial,z.name=q.name,z.flatShading=!q.smooth,z.vertexColors=G?THREE.VertexColors:THREE.NoColors,o.materials[K]=z),D.push(z)}var X;if(D.length>1){for(var J=0,k=U.length;J<k;J++){var q=U[J];S.addGroup(q.groupStart,q.groupCount,J)}X=N?new THREE.LineSegments(S,D):_?new THREE.Points(S,D):new THREE.Mesh(S,D)}else X=N?new THREE.LineSegments(S,D[0]):_?new THREE.Points(S,D[0]):new THREE.Mesh(S,D[0]);X.name=B.name,C.add(X)}}return C}}),e}();
- },{}],62:[function(_dereq_,module,exports){
- 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)};
- },{"./lib/utils":63,"./lib/vertices":64,"inherits":30,"layout-bmfont-text":36,"object-assign":39,"quad-indices":51,"three-buffer-vertex-data":65}],63:[function(_dereq_,module,exports){
- 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};
- },{}],64:[function(_dereq_,module,exports){
- 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};
- },{}],65:[function(_dereq_,module,exports){
- function setIndex(t,e,r,n){"number"!=typeof r&&(r=1),"string"!=typeof n&&(n="uint16");var i=!t.index&&"function"!=typeof t.setIndex,u=i?t.getAttribute("index"):t.index,a=updateAttribute(u,e,r,n);a&&(i?t.addAttribute("index",a):t.index=a)}function setAttribute(t,e,r,n,i){if("number"!=typeof n&&(n=3),"string"!=typeof i&&(i="float32"),Array.isArray(r)&&Array.isArray(r[0])&&r[0].length!==n)throw new Error("Nested vertex array has unexpected size; expected "+n+" but found "+r[0].length);var u=t.getAttribute(e),a=updateAttribute(u,r,n,i);t.setAttribute(e,a)}function updateAttribute(t,e,r,n){return e=e||[],e=flatten(e,n),t=new THREE.BufferAttribute(e,r),t.itemSize=r,t.needsUpdate=!0,t}function rebuildAttribute(t,e,r){if(t.itemSize!==r)return!0;if(!t.array)return!0;var n=t.array.length;return Array.isArray(e)&&Array.isArray(e[0])?n!==e.length*r:n!==e.length}var flatten=_dereq_("flatten-vertex-data"),warned=!1;module.exports.attr=setAttribute,module.exports.index=setIndex;
- },{"flatten-vertex-data":23}],66:[function(_dereq_,module,exports){
- (function (setImmediate,clearImmediate){
- function Timeout(e,t){this._id=e,this._clearFn=t}var nextTick=_dereq_("process/browser.js").nextTick,apply=Function.prototype.apply,slice=Array.prototype.slice,immediateIds={},nextImmediateId=0;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(e){e.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},exports.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},exports._unrefActive=exports.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},exports.setImmediate="function"==typeof setImmediate?setImmediate:function(e){var t=nextImmediateId++,i=!(arguments.length<2)&&slice.call(arguments,1);return immediateIds[t]=!0,nextTick(function(){immediateIds[t]&&(i?e.apply(null,i):e.call(null),exports.clearImmediate(t))}),t},exports.clearImmediate="function"==typeof clearImmediate?clearImmediate:function(e){delete immediateIds[e]};
- }).call(this,_dereq_("timers").setImmediate,_dereq_("timers").clearImmediate)
- },{"process/browser.js":49,"timers":66}],67:[function(_dereq_,module,exports){
- (function (global){
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.WebVRPolyfill=t()}(this,function(){"use strict";function e(e){this.config=n(n({},a),e),this.polyfillDisplays=[],this.enabled=!1,this.hasNative="getVRDisplays"in navigator,this.native={},this.native.getVRDisplays=navigator.getVRDisplays,this.native.VRFrameData=window.VRFrameData,this.native.VRDisplay=window.VRDisplay,(!this.hasNative||this.config.PROVIDE_MOBILE_VRDISPLAY&&i())&&(this.enable(),this.getVRDisplays().then(function(e){e&&e[0]&&e[0].fireVRDisplayConnect_&&e[0].fireVRDisplayConnect_()}))}var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},r=function(e,t){for(var i=0,r=e.length;i<r;i++)t[i]=e[i]},n=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},A=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,i){!function(i,r){e.exports=function(){function e(e,t,i){if(!t)return void i(e);for(var r=[],n=null,A=0;A<t.length;++A){var s=t[A];switch(s){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:var a=t[++A];if(a<e.TEXTURE0||a>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),r.push(null,null);break}n||(n=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(a),r.push(e.getParameter(s),null);break;case e.ACTIVE_TEXTURE:n=e.getParameter(e.ACTIVE_TEXTURE),r.push(null);break;default:r.push(e.getParameter(s))}}i(e);for(var A=0;A<t.length;++A){var s=t[A],o=r[A];switch(s){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,o);break;case e.COLOR_CLEAR_VALUE:e.clearColor(o[0],o[1],o[2],o[3]);break;case e.COLOR_WRITEMASK:e.colorMask(o[0],o[1],o[2],o[3]);break;case e.CURRENT_PROGRAM:e.useProgram(o);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,o);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,o);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,o);break;case e.TEXTURE_BINDING_2D:var a=t[++A];if(a<e.TEXTURE0||a>e.TEXTURE31)break;e.activeTexture(a),e.bindTexture(e.TEXTURE_2D,o);break;case e.TEXTURE_BINDING_CUBE_MAP:var a=t[++A];if(a<e.TEXTURE0||a>e.TEXTURE31)break;e.activeTexture(a),e.bindTexture(e.TEXTURE_CUBE_MAP,o);break;case e.VIEWPORT:e.viewport(o[0],o[1],o[2],o[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:o?e.enable(s):e.disable(s);break;default:console.log("No GL restore behavior for 0x"+s.toString(16))}n&&e.activeTexture(n)}}function i(e,t,i,r){this.gl=e,this.cardboardUI=t,this.bufferScale=i,this.dirtySubmitFrameBindings=r,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,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,M()||(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=G(e,J,q,this.attribs),this.uniforms=O(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()}function r(e){this.gl=e,this.attribs={position:0},this.program=G(e,$,ee,this.attribs),this.uniforms=O(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()}function n(e){this.coefficients=e}function A(e){this.width=e.width||x(),this.height=e.height||L(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}function s(e,t){this.viewer=le.CardboardV2,this.updateDeviceParams(e),this.distortion=new n(this.viewer.distortionCoefficients);for(var i=0;i<t.length;i++){var r=t[i];le[r.id]=new a(r)}}function a(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}function o(e,t){if(this.dpdb=he,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t;var i=new XMLHttpRequest,r=this;i.open("GET",e,!0),i.addEventListener("load",function(){r.loading=!1,i.status>=200&&i.status<=299?(r.dpdb=JSON.parse(i.response),r.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function l(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function c(e,t){this.set(e,t)}function h(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new c,this.currentGyroMeasurement=new c,this.previousGyroMeasurement=new c,M()?this.filterQ=new se(-1,0,0,1):this.filterQ=new se(1,0,0,1),this.previousFilterQ=new se,this.previousFilterQ.copy(this.filterQ),this.accelQ=new se,this.isOrientationInitialized=!1,this.estimatedGravity=new Ae,this.measuredGravity=new Ae,this.gyroIntegralQ=new se}function d(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new se,this.previousTimestampS=null,this.deltaQ=new se,this.outQ=new se}function u(e,t,i,r){this.yawOnly=i,this.accelerometer=new Ae,this.gyroscope=new Ae,this.filter=new h(e,r),this.posePredictor=new d(t,r),this.isFirefoxAndroid=T(),this.isIOS=M();var n=F();this.isDeviceMotionInRadians=!this.isIOS&&n&&n<66,this.isWithoutDeviceMotion=R(),this.filterToWorldQ=new se,M()?this.filterToWorldQ.setFromAxisAngle(new Ae(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new Ae(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new se,this.worldToScreenQ=new se,this.originalPoseAdjustQ=new se,this.originalPoseAdjustQ.setFromAxisAngle(new Ae(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),S()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new se,this.orientationOut_=new Float32Array(4),this.start()}function p(){this.loadIcon_();var e=document.createElement("div"),t=e.style;t.position="fixed",t.top=0,t.right=0,t.bottom=0,t.left=0,t.backgroundColor="gray",t.fontFamily="sans-serif",t.zIndex=1e6;var i=document.createElement("img");i.src=this.icon;var t=i.style;t.marginLeft="25%",t.marginTop="25%",t.width="50%",e.appendChild(i);var r=document.createElement("div"),t=r.style;t.textAlign="center",t.fontSize="16px",t.lineHeight="24px",t.margin="24px 25%",t.width="50%",r.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(r);var n=document.createElement("div"),t=n.style;t.backgroundColor="#CFD8DC",t.position="fixed",t.bottom=0,t.width="100%",t.height="48px",t.padding="14px 24px",t.boxSizing="border-box",t.color="#656A6B",e.appendChild(n);var A=document.createElement("div");A.style.float="left",A.innerHTML="No Cardboard viewer?";var s=document.createElement("a");s.href="https://www.google.com/get/cardboard/get-cardboard/",s.innerHTML="get one",s.target="_blank";var t=s.style;t.float="right",t.fontWeight=600,t.textTransform="uppercase",t.borderLeft="1px solid gray",t.paddingLeft="24px",t.textDecoration="none",t.color="#656A6B",n.appendChild(A),n.appendChild(s),this.overlay=e,this.text=r,this.hide()}function f(e){try{this.selectedKey=localStorage.getItem(ve)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||me),this.dialog=this.createDialog_(s.Viewers),this.root=null,this.onChangeCallbacks_=[]}function m(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function v(e){Object.defineProperties(this,{hasPosition:{writable:!1,enumerable:!0,value:e.hasPosition},hasExternalDisplay:{writable:!1,enumerable:!0,value:e.hasExternalDisplay},canPresent:{writable:!1,enumerable:!0,value:e.canPresent},maxLayers:{writable:!1,enumerable:!0,value:e.maxLayers},hasOrientation:{enumerable:!0,get:function(){return j("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function g(e){e=e||{};var t=!("wakelock"in e)||e.wakelock;this.isPolyfilled=!0,this.displayId=ye++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return j("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new v({hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1}),this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.originalParent_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,t&&k()&&(this.wakelock_=new we)}function w(e){var t=V({},Me);e=V(t,e||{}),g.call(this,{wakelock:e.MOBILE_WAKE_LOCK}),this.config=e,this.displayName="Cardboard VRDisplay",this.capabilities=new v({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new fe(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new o(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new s(this.dpdb_.getDeviceParams(),e.ADDITIONAL_VIEWERS),this.viewerSelector_=new f(e.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new p),M()&&window.addEventListener("resize",this.onResize_.bind(this))}var y=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},E=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),b=function(){function e(e,t){var i=[],r=!0,n=!1,A=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(i.push(s.value),!t||i.length!==t);r=!0);}catch(e){n=!0,A=e}finally{try{!r&&a.return&&a.return()}finally{if(n)throw A}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e,t){return"data:"+e+","+encodeURIComponent(t)},D=function(e,t,i){return e+(t-e)*i},M=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),B=function(){var e=-1!==navigator.userAgent.indexOf("Version")&&-1!==navigator.userAgent.indexOf("Android")&&-1!==navigator.userAgent.indexOf("Chrome");return function(){return e}}(),T=(function(){var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}(),function(){var e=-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}()),F=function(){var e=navigator.userAgent.match(/.*Chrome\/([0-9]+)/),t=e?parseInt(e[1],10):null;return function(){return t}}(),R=function(){var e=!1;if(65===F()){var t=navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/);if(t){var i=t[1].split("."),r=b(i,4),n=(r[0],r[1],r[2]),A=r[3];e=3325===parseInt(n,10)&&parseInt(A,10)<148}}return function(){return e}}(),C=function(){var e=-1!==navigator.userAgent.indexOf("R7 Build");return function(){return e}}(),S=function(){var e=90==window.orientation||-90==window.orientation;return C()?!e:e},I=function(e){return!isNaN(e)&&(!(e<=.001)&&!(e>1))},x=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},L=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},P=function(e){if(B())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},N=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},Q=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},G=function(e,t,i,r){var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n);var A=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(A,i),e.compileShader(A);var s=e.createProgram();e.attachShader(s,n),e.attachShader(s,A);for(var a in r)e.bindAttribLocation(s,r[a],a);return e.linkProgram(s),e.deleteShader(n),e.deleteShader(A),s},O=function(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n="",A=0;A<r;A++){n=e.getActiveUniform(t,A).name.replace("[0]",""),i[n]=e.getUniformLocation(t,n)}return i},U=function(e,t,i,r,n,A,s){var a=1/(t-i),o=1/(r-n),l=1/(A-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+i)*a,e[13]=(n+r)*o,e[14]=(s+A)*l,e[15]=1,e},k=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},V=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},z=function(e){if(M()){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.canvas=e},H=function(){function e(e,t,i,r){var n=Math.tan(t?t.upDegrees*A:s),a=Math.tan(t?t.downDegrees*A:s),o=Math.tan(t?t.leftDegrees*A:s),l=Math.tan(t?t.rightDegrees*A:s),c=2/(o+l),h=2/(n+a);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=-(o-l)*c*.5,e[9]=(n-a)*h*.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],A=t[2],s=t[3],a=r+r,o=n+n,l=A+A,c=r*a,h=r*o,d=r*l,u=n*o,p=n*l,f=A*l,m=s*a,v=s*o,g=s*l;return e[0]=1-(u+f),e[1]=h+g,e[2]=d-v,e[3]=0,e[4]=h-g,e[5]=1-(c+f),e[6]=p+m,e[7]=0,e[8]=d+v,e[9]=p-m,e[10]=1-(c+u),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,A,s,a,o,l,c,h,d,u,p,f=i[0],m=i[1],v=i[2];return t===e?(e[12]=t[0]*f+t[4]*m+t[8]*v+t[12],e[13]=t[1]*f+t[5]*m+t[9]*v+t[13],e[14]=t[2]*f+t[6]*m+t[10]*v+t[14],e[15]=t[3]*f+t[7]*m+t[11]*v+t[15]):(r=t[0],n=t[1],A=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],d=t[9],u=t[10],p=t[11],e[0]=r,e[1]=n,e[2]=A,e[3]=s,e[4]=a,e[5]=o,e[6]=l,e[7]=c,e[8]=h,e[9]=d,e[10]=u,e[11]=p,e[12]=r*f+a*m+h*v+t[12],e[13]=n*f+o*m+d*v+t[13],e[14]=A*f+l*m+u*v+t[14],e[15]=s*f+c*m+p*v+t[15]),e}function r(e,t){var i=t[0],r=t[1],n=t[2],A=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],d=t[10],u=t[11],p=t[12],f=t[13],m=t[14],v=t[15],g=i*a-r*s,w=i*o-n*s,y=i*l-A*s,E=r*o-n*a,b=r*l-A*a,_=n*l-A*o,D=c*f-h*p,M=c*m-d*p,B=c*v-u*p,T=h*m-d*f,F=h*v-u*f,R=d*v-u*m,C=g*R-w*F+y*T+E*B-b*M+_*D;return C?(C=1/C,e[0]=(a*R-o*F+l*T)*C,e[1]=(n*F-r*R-A*T)*C,e[2]=(f*_-m*b+v*E)*C,e[3]=(d*b-h*_-u*E)*C,e[4]=(o*B-s*R-l*M)*C,e[5]=(i*R-n*B+A*M)*C,e[6]=(m*y-p*_-v*w)*C,e[7]=(c*_-d*y+u*w)*C,e[8]=(s*F-a*B+l*D)*C,e[9]=(r*B-i*F-A*D)*C,e[10]=(p*b-f*y+v*g)*C,e[11]=(h*y-c*b-u*g)*C,e[12]=(a*M-s*T-o*D)*C,e[13]=(i*T-r*M+n*D)*C,e[14]=(f*w-p*E-m*g)*C,e[15]=(c*E-h*w+d*g)*C,e):null}function n(n,A,s,l,c,h){e(n,l||null,h.depthNear,h.depthFar),t(A,s.orientation||a,s.position||o),c&&i(A,A,c),r(A,A)}var A=Math.PI/180,s=.25*Math.PI,a=new Float32Array([0,0,0,1]),o=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._getFieldOfView("left"),i._getEyeOffset("left"),i),n(e.rightProjectionMatrix,e.rightViewMatrix,t,i._getFieldOfView("right"),i._getEyeOffset("right"),i),!0)}}(),W=function(){var e=window.self!==window.top,t=X(document.referrer),i=X(window.location.href);return e&&t!==i},X=function(e){var t,i=e.indexOf("://");t=-1!==i?i+3:0;var r=e.indexOf("/",t);return-1===r&&(r=e.length),e.substring(0,r)},Y=function(e){return e.w>1?(console.warn("getQuaternionAngle: w > 1"),0):2*Math.acos(e.w)},Z=function(){var e={};return function(t,i){void 0===e[t]&&(console.warn("webvr-polyfill: "+i),e[t]=!0)}}(),j=function(e,t){Z(e,e+" has been deprecated. This may not work on native WebVR displays. "+(t?"Please use "+t+" instead.":""))},K=e,J=["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"),q=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");i.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()},i.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];K(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.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,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},i.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;M()||(t.width=x()*this.bufferScale,t.height=L()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(i){e.bufferWidth=i,e.realCanvasWidth.set.call(t,i),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(i){e.bufferHeight=i,e.realCanvasHeight.set.call(t,i),e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,r){e.lastBoundFramebuffer=r||e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,r,n,A){e.colorMask[0]=t,e.colorMask[1]=r,e.colorMask[2]=n,e.colorMask[3]=A,e.realColorMask.call(i,t,r,n,A)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,r,n,A){e.clearColor[0]=t,e.clearColor[1]=r,e.clearColor[2]=n,e.clearColor[3]=A,e.realClearColor.call(i,t,r,n,A)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,r,n,A){e.viewport[0]=t,e.viewport[1]=r,e.viewport[2]=n,e.viewport[3]=A,e.realViewport.call(i,t,r,n,A)},this.isPatched=!0,z(t)}},i.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;M()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.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(){z(t)},1)}},i.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.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]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},i.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(this.dirtySubmitFrameBindings||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),K(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||M())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.dirtySubmitFrameBindings||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor)}),M()){var r=e.canvas;r.width==t.bufferWidth&&r.height==t.bufferHeight||(t.bufferWidth=r.width,t.bufferHeight=r.height,t.onResize())}},i.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,r=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];K(t,r,function(t){var r=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),!i.indexCount){var n=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),i.indexCount=n.length}})},i.prototype.computeMeshVertices_=function(e,t,i){for(var r=new Float32Array(2*e*t*5),n=i.getLeftEyeVisibleTanAngles(),A=i.getLeftEyeNoLensTanAngles(),s=i.getLeftEyeVisibleScreenRect(A),a=0,o=0;o<2;o++){for(var l=0;l<t;l++)for(var c=0;c<e;c++,a++){var h=c/(e-1),d=l/(t-1),u=h,p=d,f=D(n[0],n[2],h),m=D(n[3],n[1],d),v=Math.sqrt(f*f+m*m),g=i.distortion.distortInverse(v),w=f*g/v,y=m*g/v;h=(w-A[0])/(A[2]-A[0]),d=(y-A[3])/(A[1]-A[3]),h=2*(s.x+h*s.width-.5),d=2*(s.y+d*s.height-.5),r[5*a+0]=h,r[5*a+1]=d,r[5*a+2]=u,r[5*a+3]=p,r[5*a+4]=o}var E=n[2]-n[0];n[0]=-(E+n[0]),n[2]=E-n[2],E=A[2]-A[0],A[0]=-(E+A[0]),A[2]=E-A[2],s.x=1-(s.x+s.width)}return r},i.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),r=e/2,n=t/2,A=0,s=0,a=0;a<2;a++)for(var o=0;o<t;o++)for(var l=0;l<e;l++,A++)0!=l&&0!=o&&(l<=r==o<=n?(i[s++]=A,i[s++]=A-e-1,i[s++]=A-e,i[s++]=A-e-1,i[s++]=A,i[s++]=A-1):(i[s++]=A-1,i[s++]=A-e,i[s++]=A,i[s++]=A-e,i[s++]=A-1,i[s++]=A-e-1));return i},i.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return void 0!==i.get&&void 0!==i.set||(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i};var $=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),ee=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),te=Math.PI/180,ie=.3125;r.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},r.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(r){var n=i.clientWidth/2;r.clientX>n-42&&r.clientX<n+42&&r.clientY>i.clientHeight-42?e(r):r.clientX<42&&r.clientY<42&&t(r)},i.addEventListener("click",this.listener,!1)},r.prototype.onResize=function(){var e=this.gl,t=this,i=[e.ARRAY_BUFFER_BINDING];K(e,i,function(e){function i(e,t){var i=(90-e)*te,r=Math.cos(i),s=Math.sin(i);n.push(ie*r*h+A,ie*s*h+h),n.push(t*r*h+A,t*s*h+h)}function r(t,i){n.push(d+t,e.drawingBufferHeight-d-i)}var n=[],A=e.drawingBufferWidth/2,s=Math.max(screen.width,screen.height)*window.devicePixelRatio,a=e.drawingBufferWidth/s,o=a*window.devicePixelRatio,l=4*o/2,c=42*o,h=28*o/2,d=14*o;n.push(A-l,c),n.push(A-l,e.drawingBufferHeight),n.push(A+l,c),n.push(A+l,e.drawingBufferHeight),t.gearOffset=n.length/2;for(var u=0;u<=6;u++){var p=60*u;i(p,1),i(p+12,1),i(p+20,.75),i(p+40,.75),i(p+48,1)}t.gearVertexCount=n.length/2-t.gearOffset,t.arrowOffset=n.length/2;var f=l/Math.sin(45*te);r(0,h),r(h,0),r(h+f,f),r(f,h+f),r(f,h-f),r(0,h),r(h,2*h),r(h+f,2*h-f),r(f,h-f),r(0,h),r(f,h-l),r(28*o,h-l),r(f,h+l),r(28*o,h+l),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)})},r.prototype.render=function(){var e=this.gl,t=this,i=[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];K(e,i,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()})},r.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),U(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)},n.prototype.distortInverse=function(e){for(var t=0,i=1,r=e-this.distort(t);Math.abs(i-t)>1e-4;){var n=e-this.distort(i),A=i-n*((i-t)/(n-r));t=i,i=A,r=n}return i},n.prototype.distort=function(e){for(var t=e*e,i=0,r=0;r<this.coefficients.length;r++)i=t*(i+this.coefficients[r]);return(i+1)*e};var re=Math.PI/180,ne=180/Math.PI,Ae=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0};Ae.prototype={constructor:Ae,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,A=e.y,s=e.z,a=e.w,o=a*t+A*r-s*i,l=a*i+s*t-n*r,c=a*r+n*i-A*t,h=-n*t-A*i-s*r;return this.x=o*a+h*-n+l*-s-c*-A,this.y=l*a+h*-A+c*-n-o*-s,this.z=c*a+h*-s+o*-A-l*-n,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,A=t.x,s=t.y,a=t.z;return this.x=r*a-n*s,this.y=n*A-i*a,this.z=i*s-r*A,this}};var se=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1};se.prototype={constructor:se,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),A=Math.cos(i/2),s=Math.sin(e/2),a=Math.sin(t/2),o=Math.sin(i/2);return this.x=s*n*A+r*a*o,this.y=r*a*A-s*n*o,this.z=r*n*o+s*a*A,this.w=r*n*A-s*a*o,this},setFromEulerYXZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),A=Math.cos(i/2),s=Math.sin(e/2),a=Math.sin(t/2),o=Math.sin(i/2);return this.x=s*n*A+r*a*o,this.y=r*a*A-s*n*o,this.z=r*n*o-s*a*A,this.w=r*n*A+s*a*o,this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,r=e.y,n=e.z,A=e.w,s=t.x,a=t.y,o=t.z,l=t.w;return this.x=i*l+A*s+r*o-n*a,this.y=r*l+A*a+n*s-i*o,this.z=n*l+A*o+i*a-r*s,this.w=A*l-i*s-r*a-n*o,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,r=this.y,n=this.z,A=this.w,s=A*e.w+i*e.x+r*e.y+n*e.z;if(s<0?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,s=-s):this.copy(e),s>=1)return this.w=A,this.x=i,this.y=r,this.z=n,this;var a=Math.acos(s),o=Math.sqrt(1-s*s);if(Math.abs(o)<.001)return this.w=.5*(A+this.w),this.x=.5*(i+this.x),this.y=.5*(r+this.y),this.z=.5*(n+this.z),this;var l=Math.sin((1-t)*a)/o,c=Math.sin(t*a)/o;return this.w=A*l+this.w*c,this.x=i*l+this.x*c,this.y=r*l+this.y*c,this.z=n*l+this.z*c,this},setFromUnitVectors:function(){var e,t;return function(i,r){return void 0===e&&(e=new Ae),t=i.dot(r)+1,t<1e-6?(t=0,Math.abs(i.x)>Math.abs(i.z)?e.set(-i.y,i.x,0):e.set(0,-i.z,i.y)):e.crossVectors(i,r),this.x=e.x,this.y=e.y,this.z=e.z,this.w=t,this.normalize(),this}}()};var ae=new A({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),oe=new A({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),le={CardboardV1:new a({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 a({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]})};s.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},s.prototype.getDevice=function(){return this.device},s.prototype.setViewer=function(e){this.viewer=e,this.distortion=new n(this.viewer.distortionCoefficients)},s.prototype.determineDevice_=function(e){if(!e)return M()?(console.warn("Using fallback iOS device measurements."),oe):(console.warn("Using fallback Android device measurements."),ae);var t=.0254/e.xdpi,i=.0254/e.ydpi;return new A({widthMeters:t*x(),heightMeters:i*L(),bevelMeters:.001*e.bevelMm})},s.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=(t.widthMeters-e.interLensDistance)/2,A=e.interLensDistance/2,s=e.baselineLensDistance-t.bevelMeters,a=t.heightMeters-s,o=ne*Math.atan(i.distort(n/r)),l=ne*Math.atan(i.distort(A/r)),c=ne*Math.atan(i.distort(s/r)),h=ne*Math.atan(i.distort(a/r));return{leftDegrees:Math.min(o,e.fov),rightDegrees:Math.min(l,e.fov),downDegrees:Math.min(c,e.fov),upDegrees:Math.min(h,e.fov)}},s.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=Math.tan(-re*e.fov),n=Math.tan(re*e.fov),A=Math.tan(re*e.fov),s=Math.tan(-re*e.fov),a=t.widthMeters/4,o=t.heightMeters/2,l=e.baselineLensDistance-t.bevelMeters-o,c=e.interLensDistance/2-a,h=-l,d=e.screenLensDistance,u=i.distort((c-a)/d),p=i.distort((h+o)/d),f=i.distort((c+a)/d),m=i.distort((h-o)/d),v=new Float32Array(4);return v[0]=Math.max(r,u),v[1]=Math.min(n,p),v[2]=Math.min(A,f),v[3]=Math.max(s,m),v},s.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=new Float32Array(4),n=i.distortInverse(Math.tan(-re*e.fov)),A=i.distortInverse(Math.tan(re*e.fov)),s=i.distortInverse(Math.tan(re*e.fov)),a=i.distortInverse(Math.tan(-re*e.fov)),o=t.widthMeters/4,l=t.heightMeters/2,c=e.baselineLensDistance-t.bevelMeters-l,h=e.interLensDistance/2-o,d=-c,u=e.screenLensDistance,p=(h-o)/u,f=(d+l)/u,m=(h+o)/u,v=(d-l)/u;return r[0]=Math.max(n,p),r[1]=Math.min(A,f),r[2]=Math.min(s,m),r[3]=Math.max(a,v),r},s.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,r=t.screenLensDistance,n=(i.widthMeters-t.interLensDistance)/2,A=t.baselineLensDistance-i.bevelMeters,s=(e[0]*r+n)/i.widthMeters,a=(e[1]*r+A)/i.heightMeters,o=(e[2]*r+n)/i.widthMeters,l=(e[3]*r+A)/i.heightMeters;return{x:s,y:l,width:o-s,height:a-l}},s.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},s.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},s.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:ne*Math.atan(e.outerDist),rightDegrees:ne*Math.atan(e.innerDist),downDegrees:ne*Math.atan(e.bottomDist),upDegrees:ne*Math.atan(e.topDist)}},s.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,r=t.screenLensDistance,n=i.widthMeters/r,A=i.heightMeters/r,s=i.width/n,a=i.height/A,o=Math.round((e.eyePosX-e.outerDist)*s),l=Math.round((e.eyePosY-e.bottomDist)*a);return{x:o,y:l,width:Math.round((e.eyePosX+e.innerDist)*s)-o,height:Math.round((e.eyePosY+e.topDist)*a)-l}},s.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=e.interLensDistance/2/r,A=t.widthMeters/r,s=t.heightMeters/r,a=A/2-n,o=(e.baselineLensDistance-t.bevelMeters)/r,l=e.fov,c=i.distortInverse(Math.tan(re*l)),h=Math.min(a,c),d=Math.min(n,c),u=Math.min(o,c);return{outerDist:h,innerDist:d,topDist:Math.min(s-o,c),bottomDist:u,eyePosX:a,eyePosY:o}},s.Viewers=le;var ce=[{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:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 2 XL/*"},{ua:"Pixel 2 XL"}],dpi:537.9,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 3 XL/*"},{ua:"Pixel 3 XL"}],dpi:[558.5,553.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel XL/*"},{ua:"Pixel XL"}],dpi:[537.9,533],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 3/*"},{ua:"Pixel 3"}],dpi:442.4,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 2/*"},{ua:"Pixel 2"}],dpi:441,bw:3,ac:500},{type:"android",rules:[{mdmh:"Google/*/Pixel/*"},{ua:"Pixel"}],dpi:[432.6,436.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{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:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/BLN-L24/*"},{ua:"HONORBLN-L24"}],dpi:480,bw:4,ac:500},{type:"android",rules:[{mdmh:"Huawei/*/BKL-L09/*"},{ua:"BKL-L09"}],dpi:403,bw:3.47,ac:500},{type:"android",rules:[{mdmh:"LENOVO/*/Lenovo PB2-690Y/*"},{ua:"Lenovo PB2-690Y"}],dpi:[457.2,454.713],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{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:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 B"}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/G5/*"},{ua:"Moto G (5) Plus"}],dpi:[403.4,403],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{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:1e3},{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:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 B"}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{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:1e3},{type:"android",rules:[{mdmh:"motorola/*/G4/*"},{ua:"Moto G (4)"}],dpi:401,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A5000/*"},{ua:"ONEPLUS A5000 "}],dpi:[403.411,399.737],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A5010/*"},{ua:"ONEPLUS A5010"}],dpi:[403,400],bw:2,ac:1e3},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{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:1e3},{type:"android",rules:[{mdmh:"samsung/*/SGH-M919/*"},{ua:"SGH-M919"}],dpi:[440.8,437.7],bw:3,ac:1e3},{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:1e3},{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:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{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:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920P/*"},{ua:"SM-N920P"}],dpi:[386.3655,390.144],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920W8/*"},{ua:"SM-N920W8"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{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:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{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:1e3},{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:1e3},{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:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G930F/*"},{ua:"SM-G930F"}],dpi:576.6,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G935F/*"},{ua:"SM-G935F"}],dpi:533,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G950F/*"},{ua:"SM-G950F"}],dpi:[562.707,565.293],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G955U/*"},{ua:"SM-G955U"}],dpi:[522.514,525.762],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G955F/*"},{ua:"SM-G955F"}],dpi:[522.514,525.762],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:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{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:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Fly/*/IQ4412/*"},{ua:"IQ4412"}],dpi:307.9,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"BENEVE/*/VR518/*"},{ua:"VR518"}],dpi:480,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2001]}],dpi:[410.9,415.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2436]}],dpi:458,bw:4,ac:1e3}],he={format:1,last_updated:"2018-12-10T17:01:42Z",devices:ce};o.prototype.getDeviceParams=function(){return this.deviceParams},o.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},o.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 t=navigator.userAgent||navigator.vendor||window.opera,i=x(),r=L();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var n=0;n<e.devices.length;n++){var A=e.devices[n];if(A.rules)if("ios"==A.type||"android"==A.type){if(M()==("ios"==A.type)){for(var s=!1,a=0;a<A.rules.length;a++){var o=A.rules[a];if(this.ruleMatches_(o,t,i,r)){s=!0;break}}if(s){var c=A.dpi[0]||A.dpi,h=A.dpi[1]||A.dpi;return new l({xdpi:c,ydpi:h,bevelMm:A.bw})}}}else console.warn("Device["+n+"] has invalid type.");else console.warn("Device["+n+"] has no rules section.")}return console.warn("No DPDB device match."),null},o.prototype.ruleMatches_=function(e,t,i,r){if(!e.ua&&!e.res)return!1;if(e.ua&&"SM"===e.ua.substring(0,2)&&(e.ua=e.ua.substring(0,7)),e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var n=e.res[0],A=e.res[1];if(Math.min(i,r)!=Math.min(n,A)||Math.max(i,r)!=Math.max(n,A))return!1}return!0},c.prototype.set=function(e,t){this.sample=e,this.timestampS=t},c.prototype.copy=function(e){this.set(e.sample,e.timestampS)},h.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},h.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;I(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},h.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new se;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 se;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",ne*Y(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 n=new se;n.copy(this.filterQ),n.multiply(r),this.filterQ.slerp(n,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},h.prototype.getOrientation=function(){return this.filterQ},h.prototype.accelToQuaternion_=function(e){var t=new Ae;t.copy(e),t.normalize();var i=new se;return i.setFromUnitVectors(new Ae(0,0,-1),t),i.inverse(),i},h.prototype.gyroToQuaternionDelta_=function(e,t){var i=new se,r=new Ae;return r.copy(e),r.normalize(),i.setFromAxisAngle(r,e.length()*t),i},d.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var r=new Ae;r.copy(t),r.normalize();var n=t.length();if(n<20*re)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(ne*n).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var A=n*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,A),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=i,this.outQ},u.prototype.getPosition=function(){return null},u.prototype.getOrientation=function(){var e=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var e=(new se).setFromAxisAngle(new Ae(0,0,-1),0),t=new se;return-90===window.orientation?t.setFromAxisAngle(new Ae(0,1,0),Math.PI/-2):t.setFromAxisAngle(new Ae(0,1,0),Math.PI/2),e.multiply(t)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var e=new se;return e.setFromAxisAngle(new Ae(1,0,0),-Math.PI/2),e}(),e=this._deviceOrientationQ;var t=new se;return t.copy(e),t.multiply(this.deviceOrientationFilterToWorldQ),t.multiply(this.resetQ),t.multiply(this.worldToScreenQ),t.multiplyQuaternions(this.deviceOrientationFixQ,t),this.yawOnly&&(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_}var i=this.filter.getOrientation();e=this.posePredictor.getPrediction(i,this.gyroscope,this.previousTimestampS);var t=new se;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),t.multiply(e),t.multiply(this.worldToScreenQ),this.yawOnly&&(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_},u.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),S()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},u.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new se;var t=e.alpha,i=e.beta,r=e.gamma;t=(t||0)*Math.PI/180,i=(i||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEulerYXZ(i,t,-r)},u.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},u.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,r=e.timeStamp/1e3,n=r-this.previousTimestampS;return n<0?(Z("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=r)):n<=.001||n>1?(Z("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=r)):(this.accelerometer.set(-t.x,-t.y,-t.z),C()?this.gyroscope.set(-i.beta,i.alpha,i.gamma):this.gyroscope.set(i.alpha,i.beta,i.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,r),this.filter.addGyroMeasurement(this.gyroscope,r),void(this.previousTimestampS=r))},u.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},u.prototype.onMessage_=function(e){var t=e.data;if(t&&t.type){"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)}},u.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new Ae(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new Ae(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},u.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),this.onDeviceOrientationCallback_=this.onDeviceOrientation_.bind(this),M()&&W()&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},u.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)};var de=new Ae(1,0,0),ue=new Ae(0,0,1),pe=new se;pe.setFromAxisAngle(de,-Math.PI/2),pe.multiply((new se).setFromAxisAngle(ue,Math.PI/2));var fe=function(){function e(t){y(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new se,this._outQ=new se,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this.init()}return E(e,[{key:"init",value:function(){var e=null;try{e=new RelativeOrientationSensor({frequency:60,referenceFrame:"screen"}),e.addEventListener("error",this._onSensorError)}catch(e){this.errors.push(e),"SecurityError"===e.name?(console.error("Cannot construct sensors due to the Feature Policy"),console.warn('Attempting to fall back using "devicemotion"; however this will fail in the future without correct permissions.'),this.useDeviceMotion()):"ReferenceError"===e.name?this.useDeviceMotion():console.error(e)}e&&(this.api="sensor",this.sensor=e,this.sensor.addEventListener("reading",this._onSensorRead),this.sensor.start())}},{key:"useDeviceMotion",value:function(){this.api="devicemotion",this.fusionSensor=new u(this.config.K_FILTER,this.config.PREDICTION_TIME_S,this.config.YAW_ONLY,this.config.DEBUG),this.sensor&&(this.sensor.removeEventListener("reading",this._onSensorRead),this.sensor.removeEventListener("error",this._onSensorError),this.sensor=null)}},{key:"getOrientation",value:function(){if(this.fusionSensor)return this.fusionSensor.getOrientation();if(!this.sensor||!this.sensor.quaternion)return this._out[0]=this._out[1]=this._out[2]=0,this._out[3]=1,this._out;var e=this.sensor.quaternion;this._sensorQ.set(e[0],e[1],e[2],e[3]);var t=this._outQ;return t.copy(pe),t.multiply(this._sensorQ),this.config.YAW_ONLY&&(t.x=t.z=0,t.normalize()),this._out[0]=t.x,this._out[1]=t.y,this._out[2]=t.z,this._out[3]=t.w,this._out}},{key:"_onSensorError",value:function(e){this.errors.push(e.error),"NotAllowedError"===e.error.name?console.error("Permission to access sensor was denied"):"NotReadableError"===e.error.name?console.error("Sensor could not be read"):console.error(e.error),this.useDeviceMotion()}},{key:"_onSensorRead",value:function(){}}]),e}();p.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img"),i=t.style;S()?(i.width="20%",i.marginLeft="40%",i.marginTop="3%"):(i.width="50%",i.marginLeft="25%",i.marginTop="25%")},p.prototype.hide=function(){this.overlay.style.display="none"},p.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},p.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},p.prototype.update=function(){this.disableShowTemporarily(),!S()&&k()?this.show():this.hide()},p.prototype.loadIcon_=function(){
- this.icon=_("image/svg+xml","<svg width='198' height='240' viewBox='0 0 198 240' xmlns='http://www.w3.org/2000/svg'><g fill='none' fill-rule='evenodd'><path d='M149.625 109.527l6.737 3.891v.886c0 .177.013.36.038.549.01.081.02.162.027.242.14 1.415.974 2.998 2.105 3.999l5.72 5.062.081-.09s4.382-2.53 5.235-3.024l25.97 14.993v54.001c0 .771-.386 1.217-.948 1.217-.233 0-.495-.076-.772-.236l-23.967-13.838-.014.024-27.322 15.775-.85-1.323c-4.731-1.529-9.748-2.74-14.951-3.61a.27.27 0 0 0-.007.024l-5.067 16.961-7.891 4.556-.037-.063v27.59c0 .772-.386 1.217-.948 1.217-.232 0-.495-.076-.772-.236l-42.473-24.522c-.95-.549-1.72-1.877-1.72-2.967v-1.035l-.021.047a5.111 5.111 0 0 0-1.816-.399 5.682 5.682 0 0 0-.546.001 13.724 13.724 0 0 1-1.918-.041c-1.655-.153-3.2-.6-4.404-1.296l-46.576-26.89.005.012-10.278-18.75c-1.001-1.827-.241-4.216 1.698-5.336l56.011-32.345a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.659 3.227 1.853l.005-.003.227.413-.006.004a9.63 9.63 0 0 0 1.477 2.018l.277.27c1.914 1.85 4.468 2.801 7.113 2.801 1.949 0 3.948-.517 5.775-1.572.013 0 7.319-4.219 7.319-4.219a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.658 3.226 1.853l3.25 5.928.022-.018 6.785 3.917-.105-.182 46.881-26.965m0-1.635c-.282 0-.563.073-.815.218l-46.169 26.556-5.41-3.124-3.005-5.481c-.913-1.667-2.699-2.702-4.66-2.703-1.011 0-2.02.274-2.917.792a3825 3825 0 0 1-7.275 4.195l-.044.024a9.937 9.937 0 0 1-4.957 1.353c-2.292 0-4.414-.832-5.976-2.342l-.252-.245a7.992 7.992 0 0 1-1.139-1.534 1.379 1.379 0 0 0-.06-.122l-.227-.414a1.718 1.718 0 0 0-.095-.154c-.938-1.574-2.673-2.545-4.571-2.545-1.011 0-2.02.274-2.917.792L3.125 155.502c-2.699 1.559-3.738 4.94-2.314 7.538l10.278 18.75c.177.323.448.563.761.704l46.426 26.804c1.403.81 3.157 1.332 5.072 1.508a15.661 15.661 0 0 0 2.146.046 4.766 4.766 0 0 1 .396 0c.096.004.19.011.283.022.109 1.593 1.159 3.323 2.529 4.114l42.472 24.522c.524.302 1.058.455 1.59.455 1.497 0 2.583-1.2 2.583-2.852v-26.562l7.111-4.105a1.64 1.64 0 0 0 .749-.948l4.658-15.593c4.414.797 8.692 1.848 12.742 3.128l.533.829a1.634 1.634 0 0 0 2.193.531l26.532-15.317L193 192.433c.523.302 1.058.455 1.59.455 1.497 0 2.583-1.199 2.583-2.852v-54.001c0-.584-.312-1.124-.818-1.416l-25.97-14.993a1.633 1.633 0 0 0-1.636.001c-.606.351-2.993 1.73-4.325 2.498l-4.809-4.255c-.819-.725-1.461-1.933-1.561-2.936a7.776 7.776 0 0 0-.033-.294 2.487 2.487 0 0 1-.023-.336v-.886c0-.584-.312-1.123-.817-1.416l-6.739-3.891a1.633 1.633 0 0 0-.817-.219' fill='#455A64'/><path d='M96.027 132.636l46.576 26.891c1.204.695 1.979 1.587 2.242 2.541l-.01.007-81.374 46.982h-.001c-1.654-.152-3.199-.6-4.403-1.295l-46.576-26.891 83.546-48.235' fill='#FAFAFA'/><path d='M63.461 209.174c-.008 0-.015 0-.022-.002-1.693-.156-3.228-.609-4.441-1.309l-46.576-26.89a.118.118 0 0 1 0-.203l83.546-48.235a.117.117 0 0 1 .117 0l46.576 26.891c1.227.708 2.021 1.612 2.296 2.611a.116.116 0 0 1-.042.124l-.021.016-81.375 46.981a.11.11 0 0 1-.058.016zm-50.747-28.303l46.401 26.79c1.178.68 2.671 1.121 4.32 1.276l81.272-46.922c-.279-.907-1.025-1.73-2.163-2.387l-46.517-26.857-83.313 48.1z' fill='#607D8B'/><path d='M148.327 165.471a5.85 5.85 0 0 1-.546.001c-1.894-.083-3.302-1.038-3.145-2.132a2.693 2.693 0 0 0-.072-1.105l-81.103 46.822c.628.058 1.272.073 1.918.042.182-.009.364-.009.546-.001 1.894.083 3.302 1.038 3.145 2.132l79.257-45.759' fill='#FFF'/><path d='M69.07 211.347a.118.118 0 0 1-.115-.134c.045-.317-.057-.637-.297-.925-.505-.61-1.555-1.022-2.738-1.074a5.966 5.966 0 0 0-.535.001 14.03 14.03 0 0 1-1.935-.041.117.117 0 0 1-.103-.092.116.116 0 0 1 .055-.126l81.104-46.822a.117.117 0 0 1 .171.07c.104.381.129.768.074 1.153-.045.316.057.637.296.925.506.61 1.555 1.021 2.739 1.073.178.008.357.008.535-.001a.117.117 0 0 1 .064.218l-79.256 45.759a.114.114 0 0 1-.059.016zm-3.405-2.372c.089 0 .177.002.265.006 1.266.056 2.353.488 2.908 1.158.227.274.35.575.36.882l78.685-45.429c-.036 0-.072-.001-.107-.003-1.267-.056-2.354-.489-2.909-1.158-.282-.34-.402-.724-.347-1.107a2.604 2.604 0 0 0-.032-.91L63.846 208.97a13.91 13.91 0 0 0 1.528.012c.097-.005.194-.007.291-.007z' fill='#607D8B'/><path d='M2.208 162.134c-1.001-1.827-.241-4.217 1.698-5.337l56.011-32.344c1.939-1.12 4.324-.546 5.326 1.281l.232.41a9.344 9.344 0 0 0 1.47 2.021l.278.27c3.325 3.214 8.583 3.716 12.888 1.23l7.319-4.22c1.94-1.119 4.324-.546 5.325 1.282l3.25 5.928-83.519 48.229-10.278-18.75z' fill='#FAFAFA'/><path d='M12.486 181.001a.112.112 0 0 1-.031-.005.114.114 0 0 1-.071-.056L2.106 162.19c-1.031-1.88-.249-4.345 1.742-5.494l56.01-32.344a4.328 4.328 0 0 1 2.158-.588c1.415 0 2.65.702 3.311 1.882.01.008.018.017.024.028l.227.414a.122.122 0 0 1 .013.038 9.508 9.508 0 0 0 1.439 1.959l.275.266c1.846 1.786 4.344 2.769 7.031 2.769 1.977 0 3.954-.538 5.717-1.557a.148.148 0 0 1 .035-.013l7.284-4.206a4.321 4.321 0 0 1 2.157-.588c1.427 0 2.672.716 3.329 1.914l3.249 5.929a.116.116 0 0 1-.044.157l-83.518 48.229a.116.116 0 0 1-.059.016zm49.53-57.004c-.704 0-1.41.193-2.041.557l-56.01 32.345c-1.882 1.086-2.624 3.409-1.655 5.179l10.221 18.645 83.317-48.112-3.195-5.829c-.615-1.122-1.783-1.792-3.124-1.792a4.08 4.08 0 0 0-2.04.557l-7.317 4.225a.148.148 0 0 1-.035.013 11.7 11.7 0 0 1-5.801 1.569c-2.748 0-5.303-1.007-7.194-2.835l-.278-.27a9.716 9.716 0 0 1-1.497-2.046.096.096 0 0 1-.013-.037l-.191-.347a.11.11 0 0 1-.023-.029c-.615-1.123-1.783-1.793-3.124-1.793z' fill='#607D8B'/><path d='M42.434 155.808c-2.51-.001-4.697-1.258-5.852-3.365-1.811-3.304-.438-7.634 3.059-9.654l12.291-7.098a7.599 7.599 0 0 1 3.789-1.033c2.51 0 4.697 1.258 5.852 3.365 1.811 3.304.439 7.634-3.059 9.654l-12.291 7.098a7.606 7.606 0 0 1-3.789 1.033zm13.287-20.683a7.128 7.128 0 0 0-3.555.971l-12.291 7.098c-3.279 1.893-4.573 5.942-2.883 9.024 1.071 1.955 3.106 3.122 5.442 3.122a7.13 7.13 0 0 0 3.556-.97l12.291-7.098c3.279-1.893 4.572-5.942 2.883-9.024-1.072-1.955-3.106-3.123-5.443-3.123z' fill='#607D8B'/><path d='M149.588 109.407l6.737 3.89v.887c0 .176.013.36.037.549.011.081.02.161.028.242.14 1.415.973 2.998 2.105 3.999l7.396 6.545c.177.156.358.295.541.415 1.579 1.04 2.95.466 3.062-1.282.049-.784.057-1.595.023-2.429l-.003-.16v-1.151l25.987 15.003v54c0 1.09-.77 1.53-1.72.982l-42.473-24.523c-.95-.548-1.72-1.877-1.72-2.966v-34.033' fill='#FAFAFA'/><path d='M194.553 191.25c-.257 0-.54-.085-.831-.253l-42.472-24.521c-.981-.567-1.779-1.943-1.779-3.068v-34.033h.234v34.033c0 1.051.745 2.336 1.661 2.866l42.473 24.521c.424.245.816.288 1.103.122.285-.164.442-.52.442-1.002v-53.933l-25.753-14.868.003 1.106c.034.832.026 1.654-.024 2.439-.054.844-.396 1.464-.963 1.746-.619.309-1.45.173-2.28-.373a5.023 5.023 0 0 1-.553-.426l-7.397-6.544c-1.158-1.026-1.999-2.625-2.143-4.076a9.624 9.624 0 0 0-.027-.238 4.241 4.241 0 0 1-.038-.564v-.82l-6.68-3.856.117-.202 6.738 3.89.058.034v.954c0 .171.012.351.036.533.011.083.021.165.029.246.138 1.395.948 2.935 2.065 3.923l7.397 6.545c.173.153.35.289.527.406.758.499 1.504.63 2.047.359.49-.243.786-.795.834-1.551.05-.778.057-1.591.024-2.417l-.004-.163v-1.355l.175.1 25.987 15.004.059.033v54.068c0 .569-.198.996-.559 1.204a1.002 1.002 0 0 1-.506.131' fill='#607D8B'/><path d='M145.685 163.161l24.115 13.922-25.978 14.998-1.462-.307c-6.534-2.17-13.628-3.728-21.019-4.616-4.365-.524-8.663 1.096-9.598 3.62a2.746 2.746 0 0 0-.011 1.928c1.538 4.267 4.236 8.363 7.995 12.135l.532.845-25.977 14.997-24.115-13.922 75.518-43.6' fill='#FFF'/><path d='M94.282 220.818l-.059-.033-24.29-14.024.175-.101 75.577-43.634.058.033 24.29 14.024-26.191 15.122-.045-.01-1.461-.307c-6.549-2.174-13.613-3.725-21.009-4.614a13.744 13.744 0 0 0-1.638-.097c-3.758 0-7.054 1.531-7.837 3.642a2.62 2.62 0 0 0-.01 1.848c1.535 4.258 4.216 8.326 7.968 12.091l.016.021.526.835.006.01.064.102-.105.061-25.977 14.998-.058.033zm-23.881-14.057l23.881 13.788 24.802-14.32c.546-.315.846-.489 1.017-.575l-.466-.74c-3.771-3.787-6.467-7.881-8.013-12.168a2.851 2.851 0 0 1 .011-2.008c.815-2.199 4.203-3.795 8.056-3.795.557 0 1.117.033 1.666.099 7.412.891 14.491 2.445 21.041 4.621.836.175 1.215.254 1.39.304l25.78-14.884-23.881-13.788-75.284 43.466z' fill='#607D8B'/><path d='M167.23 125.979v50.871l-27.321 15.773-6.461-14.167c-.91-1.996-3.428-1.738-5.624.574a10.238 10.238 0 0 0-2.33 4.018l-6.46 21.628-27.322 15.774v-50.871l75.518-43.6' fill='#FFF'/><path d='M91.712 220.567a.127.127 0 0 1-.059-.016.118.118 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.519-43.6a.117.117 0 0 1 .175.101v50.871c0 .041-.023.08-.059.1l-27.321 15.775a.118.118 0 0 1-.094.01.12.12 0 0 1-.071-.063l-6.46-14.168c-.375-.822-1.062-1.275-1.934-1.275-1.089 0-2.364.686-3.5 1.881a10.206 10.206 0 0 0-2.302 3.972l-6.46 21.627a.118.118 0 0 1-.054.068L91.77 220.551a.12.12 0 0 1-.058.016zm.117-50.92v50.601l27.106-15.65 6.447-21.583a10.286 10.286 0 0 1 2.357-4.065c1.18-1.242 2.517-1.954 3.669-1.954.969 0 1.731.501 2.146 1.411l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M168.543 126.213v50.87l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.624.574a10.248 10.248 0 0 0-2.33 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6' fill='#FFF'/><path d='M93.025 220.8a.123.123 0 0 1-.059-.015.12.12 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.518-43.6a.112.112 0 0 1 .117 0c.036.02.059.059.059.1v50.871a.116.116 0 0 1-.059.101l-27.321 15.774a.111.111 0 0 1-.094.01.115.115 0 0 1-.071-.062l-6.46-14.168c-.375-.823-1.062-1.275-1.935-1.275-1.088 0-2.363.685-3.499 1.881a10.19 10.19 0 0 0-2.302 3.971l-6.461 21.628a.108.108 0 0 1-.053.067l-27.322 15.775a.12.12 0 0 1-.058.015zm.117-50.919v50.6l27.106-15.649 6.447-21.584a10.293 10.293 0 0 1 2.357-4.065c1.179-1.241 2.516-1.954 3.668-1.954.969 0 1.732.502 2.147 1.412l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M169.8 177.083l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.625.574a10.246 10.246 0 0 0-2.329 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6v50.87z' fill='#FAFAFA'/><path d='M94.282 220.917a.234.234 0 0 1-.234-.233v-50.871c0-.083.045-.161.117-.202l75.518-43.601a.234.234 0 1 1 .35.202v50.871a.233.233 0 0 1-.116.202l-27.322 15.775a.232.232 0 0 1-.329-.106l-6.461-14.168c-.36-.789-.992-1.206-1.828-1.206-1.056 0-2.301.672-3.415 1.844a10.099 10.099 0 0 0-2.275 3.924l-6.46 21.628a.235.235 0 0 1-.107.136l-27.322 15.774a.23.23 0 0 1-.116.031zm.233-50.969v50.331l26.891-15.525 6.434-21.539a10.41 10.41 0 0 1 2.384-4.112c1.201-1.265 2.569-1.991 3.753-1.991 1.018 0 1.818.526 2.253 1.48l6.354 13.934 26.982-15.578v-50.331l-75.051 43.331z' fill='#607D8B'/><path d='M109.894 199.943c-1.774 0-3.241-.725-4.244-2.12a.224.224 0 0 1 .023-.294.233.233 0 0 1 .301-.023c.78.547 1.705.827 2.75.827 1.323 0 2.754-.439 4.256-1.306 5.311-3.067 9.631-10.518 9.631-16.611 0-1.927-.442-3.56-1.278-4.724a.232.232 0 0 1 .323-.327c1.671 1.172 2.591 3.381 2.591 6.219 0 6.242-4.426 13.863-9.865 17.003-1.574.908-3.084 1.356-4.488 1.356zm-2.969-1.542c.813.651 1.82.877 2.968.877h.001c1.321 0 2.753-.327 4.254-1.194 5.311-3.067 9.632-10.463 9.632-16.556 0-1.979-.463-3.599-1.326-4.761.411 1.035.625 2.275.625 3.635 0 6.243-4.426 13.883-9.865 17.023-1.574.909-3.084 1.317-4.49 1.317-.641 0-1.243-.149-1.799-.341z' fill='#607D8B'/><path d='M113.097 197.23c5.384-3.108 9.748-10.636 9.748-16.814 0-2.051-.483-3.692-1.323-4.86-1.784-1.252-4.374-1.194-7.257.47-5.384 3.108-9.748 10.636-9.748 16.814 0 2.051.483 3.692 1.323 4.86 1.784 1.252 4.374 1.194 7.257-.47' fill='#FAFAFA'/><path d='M108.724 198.614c-1.142 0-2.158-.213-3.019-.817-.021-.014-.04.014-.055-.007-.894-1.244-1.367-2.948-1.367-4.973 0-6.242 4.426-13.864 9.865-17.005 1.574-.908 3.084-1.363 4.49-1.363 1.142 0 2.158.309 3.018.913a.23.23 0 0 1 .056.056c.894 1.244 1.367 2.972 1.367 4.997 0 6.243-4.426 13.783-9.865 16.923-1.574.909-3.084 1.276-4.49 1.276zm-2.718-1.109c.774.532 1.688.776 2.718.776 1.323 0 2.754-.413 4.256-1.28 5.311-3.066 9.631-10.505 9.631-16.598 0-1.909-.434-3.523-1.255-4.685-.774-.533-1.688-.799-2.718-.799-1.323 0-2.755.441-4.256 1.308-5.311 3.066-9.631 10.506-9.631 16.599 0 1.909.434 3.517 1.255 4.679z' fill='#607D8B'/><path d='M149.318 114.262l-9.984 8.878 15.893 11.031 5.589-6.112-11.498-13.797' fill='#FAFAFA'/><path d='M169.676 120.84l-9.748 5.627c-3.642 2.103-9.528 2.113-13.147.024-3.62-2.089-3.601-5.488.041-7.591l9.495-5.608-6.729-3.885-81.836 47.071 45.923 26.514 3.081-1.779c.631-.365.869-.898.618-1.39-2.357-4.632-2.593-9.546-.683-14.262 5.638-13.92 24.509-24.815 48.618-28.07 8.169-1.103 16.68-.967 24.704.394.852.145 1.776.008 2.407-.357l3.081-1.778-25.825-14.91' fill='#FAFAFA'/><path d='M113.675 183.459a.47.47 0 0 1-.233-.062l-45.924-26.515a.468.468 0 0 1 .001-.809l81.836-47.071a.467.467 0 0 1 .466 0l6.729 3.885a.467.467 0 0 1-.467.809l-6.496-3.75-80.9 46.533 44.988 25.973 2.848-1.644c.192-.111.62-.409.435-.773-2.416-4.748-2.658-9.814-.7-14.65 2.806-6.927 8.885-13.242 17.582-18.263 8.657-4.998 19.518-8.489 31.407-10.094 8.198-1.107 16.79-.97 24.844.397.739.125 1.561.007 2.095-.301l2.381-1.374-25.125-14.506a.467.467 0 0 1 .467-.809l25.825 14.91a.467.467 0 0 1 0 .809l-3.081 1.779c-.721.417-1.763.575-2.718.413-7.963-1.351-16.457-1.486-24.563-.392-11.77 1.589-22.512 5.039-31.065 9.977-8.514 4.916-14.456 11.073-17.183 17.805-1.854 4.578-1.623 9.376.666 13.875.37.725.055 1.513-.8 2.006l-3.081 1.78a.476.476 0 0 1-.234.062' fill='#455A64'/><path d='M153.316 128.279c-2.413 0-4.821-.528-6.652-1.586-1.818-1.049-2.82-2.461-2.82-3.975 0-1.527 1.016-2.955 2.861-4.02l9.493-5.607a.233.233 0 1 1 .238.402l-9.496 5.609c-1.696.979-2.628 2.263-2.628 3.616 0 1.34.918 2.608 2.585 3.571 3.549 2.049 9.343 2.038 12.914-.024l9.748-5.628a.234.234 0 0 1 .234.405l-9.748 5.628c-1.858 1.072-4.296 1.609-6.729 1.609' fill='#607D8B'/><path d='M113.675 182.992l-45.913-26.508M113.675 183.342a.346.346 0 0 1-.175-.047l-45.913-26.508a.35.35 0 1 1 .35-.607l45.913 26.508a.35.35 0 0 1-.175.654' fill='#455A64'/><path d='M67.762 156.484v54.001c0 1.09.77 2.418 1.72 2.967l42.473 24.521c.95.549 1.72.11 1.72-.98v-54.001' fill='#FAFAFA'/><path d='M112.727 238.561c-.297 0-.62-.095-.947-.285l-42.473-24.521c-1.063-.613-1.895-2.05-1.895-3.27v-54.001a.35.35 0 1 1 .701 0v54.001c0 .96.707 2.18 1.544 2.663l42.473 24.522c.344.198.661.243.87.122.206-.119.325-.411.325-.799v-54.001a.35.35 0 1 1 .7 0v54.001c0 .655-.239 1.154-.675 1.406a1.235 1.235 0 0 1-.623.162' fill='#455A64'/><path d='M112.86 147.512h-.001c-2.318 0-4.499-.522-6.142-1.471-1.705-.984-2.643-2.315-2.643-3.749 0-1.445.952-2.791 2.68-3.788l12.041-6.953c1.668-.962 3.874-1.493 6.212-1.493 2.318 0 4.499.523 6.143 1.472 1.704.984 2.643 2.315 2.643 3.748 0 1.446-.952 2.791-2.68 3.789l-12.042 6.952c-1.668.963-3.874 1.493-6.211 1.493zm12.147-16.753c-2.217 0-4.298.497-5.861 1.399l-12.042 6.952c-1.502.868-2.33 1.998-2.33 3.182 0 1.173.815 2.289 2.293 3.142 1.538.889 3.596 1.378 5.792 1.378h.001c2.216 0 4.298-.497 5.861-1.399l12.041-6.953c1.502-.867 2.33-1.997 2.33-3.182 0-1.172-.814-2.288-2.292-3.142-1.539-.888-3.596-1.377-5.793-1.377z' fill='#607D8B'/><path d='M165.63 123.219l-5.734 3.311c-3.167 1.828-8.286 1.837-11.433.02-3.147-1.817-3.131-4.772.036-6.601l5.734-3.31 11.397 6.58' fill='#FAFAFA'/><path d='M154.233 117.448l9.995 5.771-4.682 2.704c-1.434.827-3.352 1.283-5.399 1.283-2.029 0-3.923-.449-5.333-1.263-1.29-.744-2-1.694-2-2.674 0-.991.723-1.955 2.036-2.713l5.383-3.108m0-.809l-5.734 3.31c-3.167 1.829-3.183 4.784-.036 6.601 1.568.905 3.623 1.357 5.684 1.357 2.077 0 4.159-.46 5.749-1.377l5.734-3.311-11.397-6.58M145.445 179.667c-1.773 0-3.241-.85-4.243-2.245-.067-.092-.057-.275.023-.356.08-.081.207-.12.3-.055.781.548 1.706.812 2.751.811 1.322 0 2.754-.446 4.256-1.313 5.31-3.066 9.631-10.522 9.631-16.615 0-1.927-.442-3.562-1.279-4.726a.235.235 0 0 1 .024-.301.232.232 0 0 1 .3-.027c1.67 1.172 2.59 3.38 2.59 6.219 0 6.242-4.425 13.987-9.865 17.127-1.573.908-3.083 1.481-4.488 1.481zM142.476 178c.814.651 1.82 1.002 2.969 1.002 1.322 0 2.753-.452 4.255-1.32 5.31-3.065 9.631-10.523 9.631-16.617 0-1.98-.463-3.63-1.325-4.793.411 1.035.624 2.26.624 3.62 0 6.242-4.425 13.875-9.865 17.015-1.573.909-3.084 1.376-4.489 1.376a5.49 5.49 0 0 1-1.8-.283z' fill='#607D8B'/><path d='M148.648 176.704c5.384-3.108 9.748-10.636 9.748-16.813 0-2.052-.483-3.693-1.322-4.861-1.785-1.252-4.375-1.194-7.258.471-5.383 3.108-9.748 10.636-9.748 16.813 0 2.051.484 3.692 1.323 4.86 1.785 1.253 4.374 1.195 7.257-.47' fill='#FAFAFA'/><path d='M144.276 178.276c-1.143 0-2.158-.307-3.019-.911a.217.217 0 0 1-.055-.054c-.895-1.244-1.367-2.972-1.367-4.997 0-6.241 4.425-13.875 9.865-17.016 1.573-.908 3.084-1.369 4.489-1.369 1.143 0 2.158.307 3.019.91a.24.24 0 0 1 .055.055c.894 1.244 1.367 2.971 1.367 4.997 0 6.241-4.425 13.875-9.865 17.016-1.573.908-3.084 1.369-4.489 1.369zm-2.718-1.172c.773.533 1.687.901 2.718.901 1.322 0 2.754-.538 4.256-1.405 5.31-3.066 9.631-10.567 9.631-16.661 0-1.908-.434-3.554-1.256-4.716-.774-.532-1.688-.814-2.718-.814-1.322 0-2.754.433-4.256 1.3-5.31 3.066-9.631 10.564-9.631 16.657 0 1.91.434 3.576 1.256 4.738z' fill='#607D8B'/><path d='M150.72 172.361l-.363-.295a24.105 24.105 0 0 0 2.148-3.128 24.05 24.05 0 0 0 1.977-4.375l.443.149a24.54 24.54 0 0 1-2.015 4.46 24.61 24.61 0 0 1-2.19 3.189M115.917 191.514l-.363-.294a24.174 24.174 0 0 0 2.148-3.128 24.038 24.038 0 0 0 1.976-4.375l.443.148a24.48 24.48 0 0 1-2.015 4.461 24.662 24.662 0 0 1-2.189 3.188M114 237.476V182.584 237.476' fill='#607D8B'/><g><path d='M81.822 37.474c.017-.135-.075-.28-.267-.392-.327-.188-.826-.21-1.109-.045l-6.012 3.471c-.131.076-.194.178-.191.285.002.132.002.461.002.578v.043l-.007.128-6.591 3.779c-.001 0-2.077 1.046-2.787 5.192 0 0-.912 6.961-.898 19.745.015 12.57.606 17.07 1.167 21.351.22 1.684 3.001 2.125 3.001 2.125.331.04.698-.027 1.08-.248l75.273-43.551c1.808-1.069 2.667-3.719 3.056-6.284 1.213-7.99 1.675-32.978-.275-39.878-.196-.693-.51-1.083-.868-1.282l-2.086-.79c-.727.028-1.416.467-1.534.535L82.032 37.072l-.21.402' fill='#FFF'/><path d='M144.311 1.701l2.085.79c.358.199.672.589.868 1.282 1.949 6.9 1.487 31.887.275 39.878-.39 2.565-1.249 5.215-3.056 6.284L69.21 93.486a1.78 1.78 0 0 1-.896.258l-.183-.011c0 .001-2.782-.44-3.003-2.124-.56-4.282-1.151-8.781-1.165-21.351-.015-12.784.897-19.745.897-19.745.71-4.146 2.787-5.192 2.787-5.192l6.591-3.779.007-.128v-.043c0-.117 0-.446-.002-.578-.003-.107.059-.21.191-.285l6.012-3.472a.98.98 0 0 1 .481-.11c.218 0 .449.053.627.156.193.112.285.258.268.392l.211-.402 60.744-34.836c.117-.068.806-.507 1.534-.535m0-.997l-.039.001c-.618.023-1.283.244-1.974.656l-.021.012-60.519 34.706a2.358 2.358 0 0 0-.831-.15c-.365 0-.704.084-.98.244l-6.012 3.471c-.442.255-.699.69-.689 1.166l.001.15-6.08 3.487c-.373.199-2.542 1.531-3.29 5.898l-.006.039c-.009.07-.92 7.173-.906 19.875.014 12.62.603 17.116 1.172 21.465l.002.015c.308 2.355 3.475 2.923 3.836 2.98l.034.004c.101.013.204.019.305.019a2.77 2.77 0 0 0 1.396-.392l75.273-43.552c1.811-1.071 2.999-3.423 3.542-6.997 1.186-7.814 1.734-33.096-.301-40.299-.253-.893-.704-1.527-1.343-1.882l-.132-.062-2.085-.789a.973.973 0 0 0-.353-.065' fill='#455A64'/><path d='M128.267 11.565l1.495.434-56.339 32.326' fill='#FFF'/><path d='M74.202 90.545a.5.5 0 0 1-.25-.931l18.437-10.645a.499.499 0 1 1 .499.864L74.451 90.478l-.249.067M75.764 42.654l-.108-.062.046-.171 5.135-2.964.17.045-.045.171-5.135 2.964-.063.017M70.52 90.375V46.421l.063-.036L137.84 7.554v43.954l-.062.036L70.52 90.375zm.25-43.811v43.38l66.821-38.579V7.985L70.77 46.564z' fill='#607D8B'/><path d='M86.986 83.182c-.23.149-.612.384-.849.523l-11.505 6.701c-.237.139-.206.252.068.252h.565c.275 0 .693-.113.93-.252L87.7 83.705c.237-.139.428-.253.425-.256a11.29 11.29 0 0 1-.006-.503c0-.274-.188-.377-.418-.227l-.715.463' fill='#607D8B'/><path d='M75.266 90.782H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.236-.138.615-.371.844-.519l.715-.464a.488.488 0 0 1 .266-.089c.172 0 .345.13.345.421 0 .214.001.363.003.437l.006.004-.004.069c-.003.075-.003.075-.486.356l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.108.866-.234l11.505-6.702c.168-.098.294-.173.361-.214-.004-.084-.004-.218-.004-.437l-.095-.171-.131.049-.714.463c-.232.15-.616.386-.854.525l-11.505 6.702-.029.018z' fill='#607D8B'/><path d='M75.266 89.871H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.258-.151.694-.268.993-.268h.565c.2 0 .316.056.346.166.03.11-.043.217-.215.317l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.107.866-.234l11.505-6.702.03-.018-.035-.001h-.565c-.252 0-.649.108-.867.234l-11.505 6.702-.029.018zM74.37 90.801v-1.247 1.247' fill='#607D8B'/><path d='M68.13 93.901c-.751-.093-1.314-.737-1.439-1.376-.831-4.238-1.151-8.782-1.165-21.352-.015-12.784.897-19.745.897-19.745.711-4.146 2.787-5.192 2.787-5.192l74.859-43.219c.223-.129 2.487-1.584 3.195.923 1.95 6.9 1.488 31.887.275 39.878-.389 2.565-1.248 5.215-3.056 6.283L69.21 93.653c-.382.221-.749.288-1.08.248 0 0-2.781-.441-3.001-2.125-.561-4.281-1.152-8.781-1.167-21.351-.014-12.784.898-19.745.898-19.745.71-4.146 2.787-5.191 2.787-5.191l6.598-3.81.871-.119 6.599-3.83.046-.461L68.13 93.901' fill='#FAFAFA'/><path d='M68.317 94.161l-.215-.013h-.001l-.244-.047c-.719-.156-2.772-.736-2.976-2.292-.568-4.34-1.154-8.813-1.168-21.384-.014-12.654.891-19.707.9-19.777.725-4.231 2.832-5.338 2.922-5.382l6.628-3.827.87-.119 6.446-3.742.034-.334a.248.248 0 0 1 .273-.223.248.248 0 0 1 .223.272l-.059.589-6.752 3.919-.87.118-6.556 3.785c-.031.016-1.99 1.068-2.666 5.018-.007.06-.908 7.086-.894 19.702.014 12.539.597 16.996 1.161 21.305.091.691.689 1.154 1.309 1.452a1.95 1.95 0 0 1-.236-.609c-.781-3.984-1.155-8.202-1.17-21.399-.014-12.653.891-19.707.9-19.777.725-4.231 2.832-5.337 2.922-5.382-.004.001 74.444-42.98 74.846-43.212l.028-.017c.904-.538 1.72-.688 2.36-.433.555.221.949.733 1.172 1.52 2.014 7.128 1.46 32.219.281 39.983-.507 3.341-1.575 5.515-3.175 6.462L69.335 93.869a2.023 2.023 0 0 1-1.018.292zm-.147-.507c.293.036.604-.037.915-.217l75.273-43.551c1.823-1.078 2.602-3.915 2.934-6.106 1.174-7.731 1.731-32.695-.268-39.772-.178-.631-.473-1.032-.876-1.192-.484-.193-1.166-.052-1.921.397l-.034.021-74.858 43.218c-.031.017-1.989 1.069-2.666 5.019-.007.059-.908 7.085-.894 19.702.015 13.155.386 17.351 1.161 21.303.09.461.476.983 1.037 1.139.114.025.185.037.196.039h.001z' fill='#455A64'/><path d='M69.317 68.982c.489-.281.885-.056.885.505 0 .56-.396 1.243-.885 1.525-.488.282-.884.057-.884-.504 0-.56.396-1.243.884-1.526' fill='#FFF'/><path d='M68.92 71.133c-.289 0-.487-.228-.487-.625 0-.56.396-1.243.884-1.526a.812.812 0 0 1 .397-.121c.289 0 .488.229.488.626 0 .56-.396 1.243-.885 1.525a.812.812 0 0 1-.397.121m.794-2.459a.976.976 0 0 0-.49.147c-.548.317-.978 1.058-.978 1.687 0 .486.271.812.674.812a.985.985 0 0 0 .491-.146c.548-.317.978-1.057.978-1.687 0-.486-.272-.813-.675-.813' fill='#8097A2'/><path d='M68.92 70.947c-.271 0-.299-.307-.299-.439 0-.491.361-1.116.79-1.363a.632.632 0 0 1 .303-.096c.272 0 .301.306.301.438 0 .491-.363 1.116-.791 1.364a.629.629 0 0 1-.304.096m.794-2.086a.812.812 0 0 0-.397.121c-.488.283-.884.966-.884 1.526 0 .397.198.625.487.625a.812.812 0 0 0 .397-.121c.489-.282.885-.965.885-1.525 0-.397-.199-.626-.488-.626' fill='#8097A2'/><path d='M69.444 85.35c.264-.152.477-.031.477.272 0 .303-.213.67-.477.822-.263.153-.477.031-.477-.271 0-.302.214-.671.477-.823' fill='#FFF'/><path d='M69.23 86.51c-.156 0-.263-.123-.263-.337 0-.302.214-.671.477-.823a.431.431 0 0 1 .214-.066c.156 0 .263.124.263.338 0 .303-.213.67-.477.822a.431.431 0 0 1-.214.066m.428-1.412c-.1 0-.203.029-.307.09-.32.185-.57.618-.57.985 0 .309.185.524.449.524a.63.63 0 0 0 .308-.09c.32-.185.57-.618.57-.985 0-.309-.185-.524-.45-.524' fill='#8097A2'/><path d='M69.23 86.322l-.076-.149c0-.235.179-.544.384-.661l.12-.041.076.151c0 .234-.179.542-.383.66l-.121.04m.428-1.038a.431.431 0 0 0-.214.066c-.263.152-.477.521-.477.823 0 .214.107.337.263.337a.431.431 0 0 0 .214-.066c.264-.152.477-.519.477-.822 0-.214-.107-.338-.263-.338' fill='#8097A2'/><path d='M139.278 7.769v43.667L72.208 90.16V46.493l67.07-38.724' fill='#455A64'/><path d='M72.083 90.375V46.421l.063-.036 67.257-38.831v43.954l-.062.036-67.258 38.831zm.25-43.811v43.38l66.821-38.579V7.985L72.333 46.564z' fill='#607D8B'/></g><path d='M125.737 88.647l-7.639 3.334V84l-11.459 4.713v8.269L99 100.315l13.369 3.646 13.368-15.314' fill='#455A64'/></g></svg>")};var me="CardboardV1",ve="WEBVR_CARDBOARD_VIEWER";f.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},f.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},f.prototype.getCurrentViewer=function(){return s.Viewers[this.selectedKey]},f.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},f.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},f.prototype.fireOnChange_=function(e){for(var t=0;t<this.onChangeCallbacks_.length;t++)this.onChangeCallbacks_[t](e)},f.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),!this.selectedKey||!s.Viewers[this.selectedKey])return void console.error("ViewerSelector.onSave_: this should never happen!");this.fireOnChange_(s.Viewers[this.selectedKey]);try{localStorage.setItem(ve,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()},f.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add("webvr-polyfill-viewer-selector"),t.style.display="none";var i=document.createElement("div"),r=i.style;r.position="fixed",r.left=0,r.top=0,r.width="100%",r.height="100%",r.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var n=document.createElement("div"),r=n.style;r.boxSizing="border-box",r.position="fixed",r.top="24px",r.left="50%",r.marginLeft="-140px",r.width="280px",r.padding="24px",r.overflow="hidden",r.background="#fafafa",r.fontFamily="'Roboto', sans-serif",r.boxShadow="0px 5px 20px #666",n.appendChild(this.createH1_("Select your viewer"));for(var A in e)n.appendChild(this.createChoice_(A,e[A].label));return n.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(n),t},f.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},f.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var r=document.createElement("input");r.style.fontSize="30px",r.setAttribute("id",e),r.setAttribute("type","radio"),r.setAttribute("value",e),r.setAttribute("name","field");var n=document.createElement("label");return n.style.marginLeft="4px",n.setAttribute("for",e),n.innerHTML=t,i.appendChild(r),i.appendChild(n),i},f.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var r=i.style;return r.float="right",r.textTransform="uppercase",r.color="#1094f7",r.fontSize="14px",r.letterSpacing=0,r.border=0,r.background="none",r.marginTop="16px",i.addEventListener("click",t),i};var ge=("undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self,function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,t){!function(t,i){e.exports=i()}(0,function(){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,i){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),A=i(1),s="undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,a=function(){function e(){r(this,e),s?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("playsinline",""),this.noSleepVideo.setAttribute("src",A),this.noSleepVideo.addEventListener("timeupdate",function(e){this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return n(e,[{key:"enable",value:function(){s?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location.href="/",window.setTimeout(window.stop,0)},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){s?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=a},function(e,t,i){
- e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])})})),we=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(ge),ye=1e3,Ee=[0,0,.5,1],be=[.5,0,.5,1],_e=window.requestAnimationFrame,De=window.cancelAnimationFrame;g.prototype.getFrameData=function(e){return H(e,this._getPose(),this)},g.prototype.getPose=function(){return j("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},g.prototype.resetPose=function(){return j("VRDisplay.prototype.resetPose"),this._resetPose()},g.prototype.getImmediatePose=function(){return j("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},g.prototype.requestAnimationFrame=function(e){return _e(e)},g.prototype.cancelAnimationFrame=function(e){return De(e)},g.prototype.wrapForFullscreen=function(e){if(M())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["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",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;if(this.fullscreenElement_&&(this.originalParent_?this.originalParent_.appendChild(this.fullscreenElement_):this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_)),this.fullscreenElement_=e,this.originalParent_=e.parentElement,this.originalParent_||document.body.appendChild(e),!this.fullscreenWrapper_.parentElement){var i=this.fullscreenElement_.parentElement;i.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),i.removeChild(this.fullscreenElement_)}this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var r=this;return function(){if(r.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"];r.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}(),this.fullscreenWrapper_},g.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 t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),this.originalParent_===t?t.insertBefore(e,this.fullscreenWrapper_):this.originalParent_&&this.originalParent_.appendChild(e),t.removeChild(this.fullscreenWrapper_),e}},g.prototype.requestPresent=function(e){var t=this.isPresenting,i=this;return e instanceof Array||(j("VRDisplay.prototype.requestPresent with non-array argument","an array of VRLayers as the first argument"),e=[e]),new Promise(function(r,n){if(!i.capabilities.canPresent)return void n(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>i.capabilities.maxLayers)return void n(new Error("Invalid number of layers."));var A=e[0];if(!A.source)return void r();var s=A.leftBounds||Ee,a=A.rightBounds||be;if(t){var o=i.layer_;o.source!==A.source&&(o.source=A.source);for(var l=0;l<4;l++)o.leftBounds[l]=s[l],o.rightBounds[l]=a[l];return i.wrapForFullscreen(i.layer_.source),i.updatePresent_(),void r()}if(i.layer_={predistorted:A.predistorted,source:A.source,leftBounds:s.slice(0),rightBounds:a.slice(0)},i.waitingForPresent_=!1,i.layer_&&i.layer_.source){var c=i.wrapForFullscreen(i.layer_.source),h=function(){var e=Q();i.isPresenting=c===e,i.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch(function(e){console.error("screen.orientation.lock() failed due to",e.message)}),i.waitingForPresent_=!1,i.beginPresent_(),r()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),i.removeFullscreenWrapper(),i.disableWakeLock(),i.endPresent_(),i.removeFullscreenListeners_()),i.fireVRDisplayPresentChange_()},d=function(){i.waitingForPresent_&&(i.removeFullscreenWrapper(),i.removeFullscreenListeners_(),i.disableWakeLock(),i.waitingForPresent_=!1,i.isPresenting=!1,n(new Error("Unable to present.")))};i.addFullscreenListeners_(c,h,d),P(c)?(i.enableWakeLock(),i.waitingForPresent_=!0):(M()||B())&&(i.enableWakeLock(),i.isPresenting=!0,i.beginPresent_(),i.fireVRDisplayPresentChange_(),r())}i.waitingForPresent_||M()||(N(),n(new Error("Unable to present.")))})},g.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise(function(i,r){e?(!N()&&M()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),B()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):r(new Error("Was not presenting to VRDisplay."))})},g.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},g.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},g.prototype.fireVRDisplayConnect_=function(){var e=new CustomEvent("vrdisplayconnect",{detail:{display:this}});window.dispatchEvent(e)},g.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),i&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",i,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",i,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",i,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",i,!1))},g.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},g.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},g.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},g.prototype.beginPresent_=function(){},g.prototype.endPresent_=function(){},g.prototype.submitFrame=function(e){},g.prototype.getEyeParameters=function(e){return null};var Me={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},Be={LEFT:"left",RIGHT:"right"};return w.prototype=Object.create(g.prototype),w.prototype._getPose=function(){return{position:null,orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},w.prototype._resetPose=function(){this.poseSensor_.resetPose&&this.poseSensor_.resetPose()},w.prototype._getFieldOfView=function(e){var t;if(e==Be.LEFT)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=Be.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return t},w.prototype._getEyeOffset=function(e){var t;if(e==Be.LEFT)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=Be.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=[.5*this.deviceInfo_.viewer.interLensDistance,0,0]}return t},w.prototype.getEyeParameters=function(e){var t=this._getEyeOffset(e),i=this._getFieldOfView(e),r={offset:t,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_};return Object.defineProperty(r,"fieldOfView",{enumerable:!0,get:function(){return j("VRFieldOfView","VRFrameData's projection matrices"),i}}),r},w.prototype.onDeviceParamsUpdated_=function(e){this.config.DEBUG&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},w.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},w.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?this.config.CARDBOARD_UI_DISABLED||(e.canvas.width=x()*this.bufferScale_,e.canvas.height=L()*this.bufferScale_,this.cardboardUI_=new r(e)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new r(e)),this.distorter_=new i(e,this.cardboardUI_,this.config.BUFFER_SCALE,this.config.DIRTY_SUBMIT_FRAME_BINDINGS),this.distorter_.updateDeviceInfo(this.deviceInfo_)),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_&&(S()&&k()?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_())},w.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)},w.prototype.updatePresent_=function(){this.endPresent_(),this.beginPresent_()},w.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()}},w.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},w.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl"),i=["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"];t.canvas.setAttribute("style",i.join("; ")+";"),z(t.canvas)}},w.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},w.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},w.VRFrameData=m,w.VRDisplay=g,w}()}()}),s=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(A),a={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",PROVIDE_MOBILE_VRDISPLAY:!0,MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1};e.prototype.getPolyfillDisplays=function(){if(this._polyfillDisplaysPopulated)return this.polyfillDisplays;if(i()){var e=new s({ADDITIONAL_VIEWERS:this.config.ADDITIONAL_VIEWERS,DEFAULT_VIEWER:this.config.DEFAULT_VIEWER,MOBILE_WAKE_LOCK:this.config.MOBILE_WAKE_LOCK,DEBUG:this.config.DEBUG,DPDB_URL:this.config.DPDB_URL,CARDBOARD_UI_DISABLED:this.config.CARDBOARD_UI_DISABLED,K_FILTER:this.config.K_FILTER,PREDICTION_TIME_S:this.config.PREDICTION_TIME_S,ROTATE_INSTRUCTIONS_DISABLED:this.config.ROTATE_INSTRUCTIONS_DISABLED,YAW_ONLY:this.config.YAW_ONLY,BUFFER_SCALE:this.config.BUFFER_SCALE,DIRTY_SUBMIT_FRAME_BINDINGS:this.config.DIRTY_SUBMIT_FRAME_BINDINGS});this.polyfillDisplays.push(e)}return this._polyfillDisplaysPopulated=!0,this.polyfillDisplays},e.prototype.enable=function(){if(this.enabled=!0,this.hasNative&&this.native.VRFrameData){var e=this.native.VRFrameData,t=new this.native.VRFrameData,i=this.native.VRDisplay.prototype.getFrameData;window.VRDisplay.prototype.getFrameData=function(n){if(n instanceof e)return void i.call(this,n);i.call(this,t),n.pose=t.pose,r(t.leftProjectionMatrix,n.leftProjectionMatrix),r(t.rightProjectionMatrix,n.rightProjectionMatrix),r(t.leftViewMatrix,n.leftViewMatrix),r(t.rightViewMatrix,n.rightViewMatrix)}}navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=s.VRDisplay,window.VRFrameData=s.VRFrameData},e.prototype.getVRDisplays=function(){var e=this;this.config;return this.hasNative?this.native.getVRDisplays.call(navigator).then(function(t){return t.length>0?t:e.getPolyfillDisplays()}):Promise.resolve(this.getPolyfillDisplays())},e.version="0.10.10",e.VRFrameData=s.VRFrameData,e.VRDisplay=s.VRDisplay;var o=Object.freeze({default:e}),l=o&&e||o;return void 0!==t&&t.window&&(t.document||(t.document=t.window.document),t.navigator||(t.navigator=t.window.navigator)),l});
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
- },{}],68:[function(_dereq_,module,exports){
- 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)};
- },{}],69:[function(_dereq_,module,exports){
- "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){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}function noop(){}var window=_dereq_("global/window"),isFunction=_dereq_("is-function"),parseHeaders=_dereq_("parse-headers"),xtend=_dereq_("xtend");module.exports=createXHR,module.exports.default=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)}});
- },{"global/window":27,"is-function":33,"parse-headers":47,"xtend":71}],70:[function(_dereq_,module,exports){
- 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}}();
- },{}],71:[function(_dereq_,module,exports){
- 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;
- },{}],72:[function(_dereq_,module,exports){
- module.exports={"name":"aframe","version":"1.0.4","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-master.js.map > dist/aframe-master.js","dist:min":"npm run browserify -s -- --debug -p [ minifyify --map aframe-master.min.js.map --output dist/aframe-master.min.js.map ] -o dist/aframe-master.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","prepush":"node scripts/testOnlyCheck.js","prerelease":"node scripts/release.js 1.0.3 1.0.4","start":"npm run dev","start:https":"cross-env SSL=true 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:nobrowser":"NO_BROWSER=true npm test","test:node":"mocha --ui tdd tests/node"},"repository":"aframevr/aframe","license":"MIT","files":["dist/*","docs/**/*","src/**/*","vendor/**/*"],"dependencies":{"custom-event-polyfill":"^1.0.6","debug":"ngokevin/debug#noTimestamp","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90","load-bmfont":"^1.2.3","object-assign":"^4.0.1","present":"0.0.6","promise-polyfill":"^3.1.0","super-animejs":"^3.1.0","super-three":"^0.113.0","three-bmfont-text":"dmarcos/three-bmfont-text#1babdf8507c731a18f8af3b807292e2b9740955e","webvr-polyfill":"^0.10.10"},"devDependencies":{"browserify":"^13.1.0","browserify-css":"^0.8.4","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","envify":"^3.4.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.2.0","karma-mocha":"^1.1.1","karma-mocha-reporter":"^2.1.0","karma-sinon-chai":"1.2.4","lolex":"^1.5.1","markserv":"github:sukima/markserv#feature/fix-broken-websoketio-link","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"}}
- },{}],73:[function(_dereq_,module,exports){
- function getPropertyType(t,e){var i,n,o,a;return o=e.split("."),n=o[0],a=o[1],i=t.components[n]||components[n],i?a&&!i.schema[a]?null:a?i.schema[a].type:i.schema.type:null}function toRadians(t){t.x=THREE.Math.degToRad(t.x),t.y=THREE.Math.degToRad(t.y),t.z=THREE.Math.degToRad(t.z)}function addEventListeners(t,e,i){var n;for(n=0;n<e.length;n++)t.addEventListener(e[n],i)}function removeEventListeners(t,e,i){var n;for(n=0;n<e.length;n++)t.removeEventListener(e[n],i)}function getRawProperty(t,e){var i,n,o;for(n=splitDot(e),o=t,i=0;i<n.length;i++)o=o[n[i]];if(void 0===o)throw console.log(t),new Error("[animation] property ("+e+") could not be found");return o}function setRawProperty(t,e,i,n){var o,a,r,s;for(e.startsWith("object3D.rotation")&&(i=THREE.Math.degToRad(i)),a=splitDot(e),s=t,o=0;o<a.length-1;o++)s=s[a[o]];if(r=a[a.length-1],n===TYPE_COLOR)return void("r"in s[r]?(s[r].r=i.r,s[r].g=i.g,s[r].b=i.b):(s[r].x=i.r,s[r].y=i.g,s[r].z=i.b));s[r]=i}function splitDot(t){return t in splitCache?splitCache[t]:(splitCache[t]=t.split("."),splitCache[t])}function isRawProperty(t){return t.isRawProperty||t.property.startsWith(STRING_COMPONENTS)||t.property.startsWith(STRING_OBJECT3D)}var anime=_dereq_("super-animejs"),components=_dereq_("../core/component").components,registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils"),colorHelperFrom=new THREE.Color,colorHelperTo=new THREE.Color,getComponentProperty=utils.entity.getComponentProperty,setComponentProperty=utils.entity.setComponentProperty,splitCache={},TYPE_COLOR="color",PROP_POSITION="position",PROP_ROTATION="rotation",PROP_SCALE="scale",STRING_COMPONENTS="components",STRING_OBJECT3D="object3D";module.exports.Component=registerComponent("animation",{schema:{autoplay:{default:!0},delay:{default:0},dir:{default:""},dur:{default:1e3},easing:{default:"easeInQuad"},elasticity:{default:400},enabled:{default:!0},from:{default:""},loop:{default:0,parse:function(t){return!0===t||"true"===t||!1!==t&&"false"!==t&&parseInt(t,10)}},property:{default:""},startEvents:{type:"array"},pauseEvents:{type:"array"},resumeEvents:{type:"array"},round:{default:!1},to:{default:""},type:{default:""},isRawProperty:{default:!1}},multiple:!0,init:function(){var t=this;this.eventDetail={name:this.attrName},this.time=0,this.animation=null,this.animationIsPlaying=!1,this.onStartEvent=this.onStartEvent.bind(this),this.beginAnimation=this.beginAnimation.bind(this),this.pauseAnimation=this.pauseAnimation.bind(this),this.resumeAnimation=this.resumeAnimation.bind(this),this.fromColor={},this.toColor={},this.targets={},this.targetsArray=[],this.updateConfigForDefault=this.updateConfigForDefault.bind(this),this.updateConfigForRawColor=this.updateConfigForRawColor.bind(this),this.config={complete:function(){t.animationIsPlaying=!1,t.el.emit("animationcomplete",t.eventDetail,!1),t.id&&t.el.emit("animationcomplete__"+t.id,t.eventDetail,!1)}}},update:function(t){var e=this.config,i=this.data;this.animationIsPlaying=!1,this.data.enabled&&i.property&&(e.autoplay=!1,e.direction=i.dir,e.duration=i.dur,e.easing=i.easing,e.elasticity=i.elasticity,e.loop=i.loop,e.round=i.round,this.createAndStartAnimation())},tick:function(t,e){this.animationIsPlaying&&(this.time+=e,this.animation.tick(this.time))},remove:function(){this.pauseAnimation(),this.removeEventListeners()},pause:function(){this.paused=!0,this.pausedWasPlaying=this.animationIsPlaying,this.pauseAnimation(),this.removeEventListeners()},play:function(){this.paused&&(this.paused=!1,this.addEventListeners(),this.pausedWasPlaying&&(this.resumeAnimation(),this.pausedWasPlaying=!1))},createAndStartAnimation:function(){var t=this.data;if(this.updateConfig(),this.animationIsPlaying=!1,this.animation=anime(this.config),this.animation.began=!0,this.removeEventListeners(),this.addEventListeners(),!(!t.autoplay||t.startEvents&&t.startEvents.length))return t.delay?void setTimeout(this.beginAnimation,t.delay):void this.beginAnimation()},beginAnimation:function(){this.updateConfig(),this.animation.began=!0,this.time=0,this.animationIsPlaying=!0,this.stopRelatedAnimations(),this.el.emit("animationbegin",this.eventDetail,!1)},pauseAnimation:function(){this.animationIsPlaying=!1},resumeAnimation:function(){this.animationIsPlaying=!0},onStartEvent:function(){if(this.data.enabled){if(this.updateConfig(),this.animation&&this.animation.pause(),this.animation=anime(this.config),this.data.delay)return void setTimeout(this.beginAnimation,this.data.delay);this.beginAnimation()}},updateConfigForRawColor:function(){var t,e,i,n=this.config,o=this.data,a=this.el;if(!this.waitComponentInitRawProperty(this.updateConfigForRawColor)){t=""===o.from?getRawProperty(a,o.property):o.from,i=o.to,this.setColorConfig(t,i),t=this.fromColor,i=this.toColor,this.targetsArray.length=0,this.targetsArray.push(t),n.targets=this.targetsArray;for(e in i)n[e]=i[e];n.update=function(){var t={};return function(e){var i;i=e.animatables[0].target,i.r===t.r&&i.g===t.g&&i.b===t.b||setRawProperty(a,o.property,i,o.type)}}()}},updateConfigForDefault:function(){var t,e,i,n,o=this.config,a=this.data,r=this.el;this.waitComponentInitRawProperty(this.updateConfigForDefault)||(t=""===a.from?isRawProperty(a)?getRawProperty(r,a.property):getComponentProperty(r,a.property):a.from,n=a.to,i=!isNaN(t||n),i?(t=parseFloat(t),n=parseFloat(n)):(t=t?t.toString():t,n=n?n.toString():n),e="true"===a.to||"false"===a.to||!0===a.to||!1===a.to,e&&(t="true"===a.from||!0===a.from?1:0,n="true"===a.to||!0===a.to?1:0),this.targets.aframeProperty=t,o.targets=this.targets,o.aframeProperty=n,o.update=function(){var t;return function(i){var n;(n=i.animatables[0].target.aframeProperty)!==t&&(t=n,e&&(n=n>=1),isRawProperty(a)?setRawProperty(r,a.property,n,a.type):setComponentProperty(r,a.property,n))}}())},updateConfigForVector:function(){var t,e,i,n=this.config,o=this.data,a=this.el;e=""!==o.from?utils.coordinates.parse(o.from):getComponentProperty(a,o.property),i=utils.coordinates.parse(o.to),o.property===PROP_ROTATION&&(toRadians(e),toRadians(i)),this.targetsArray.length=0,this.targetsArray.push(e),n.targets=this.targetsArray;for(t in i)n[t]=i[t];if(o.property===PROP_POSITION||o.property===PROP_ROTATION||o.property===PROP_SCALE)return void(n.update=function(){var t={};return function(e){var i=e.animatables[0].target;o.property===PROP_SCALE&&(i.x=Math.max(1e-4,i.x),i.y=Math.max(1e-4,i.y),i.z=Math.max(1e-4,i.z)),i.x===t.x&&i.y===t.y&&i.z===t.z||(t.x=i.x,t.y=i.y,t.z=i.z,a.object3D[o.property].set(i.x,i.y,i.z))}}());n.update=function(){var t={};return function(e){var i=e.animatables[0].target;i.x===t.x&&i.y===t.y&&i.z===t.z||(t.x=i.x,t.y=i.y,t.z=i.z,setComponentProperty(a,o.property,i))}}()},updateConfig:function(){var t;t=getPropertyType(this.el,this.data.property),isRawProperty(this.data)&&this.data.type===TYPE_COLOR?this.updateConfigForRawColor():"vec2"===t||"vec3"===t||"vec4"===t?this.updateConfigForVector():this.updateConfigForDefault()},waitComponentInitRawProperty:function(t){var e,i=this.data,n=this.el,o=this;return""===i.from&&(!!i.property.startsWith(STRING_COMPONENTS)&&(e=splitDot(i.property)[1],!n.components[e]&&(n.addEventListener("componentinitialized",function i(a){a.detail.name===e&&(t(),o.animation=anime(o.config),n.removeEventListener("componentinitialized",i))}),!0)))},stopRelatedAnimations:function(){var t,e;for(e in this.el.components)t=this.el.components[e],e!==this.attrName&&"animation"===t.name&&t.animationIsPlaying&&t.data.property===this.data.property&&(t.animationIsPlaying=!1)},addEventListeners:function(){var t=this.data,e=this.el;addEventListeners(e,t.startEvents,this.onStartEvent),addEventListeners(e,t.pauseEvents,this.pauseAnimation),addEventListeners(e,t.resumeEvents,this.resumeAnimation)},removeEventListeners:function(){var t=this.data,e=this.el;removeEventListeners(e,t.startEvents,this.onStartEvent),removeEventListeners(e,t.pauseEvents,this.pauseAnimation),removeEventListeners(e,t.resumeEvents,this.resumeAnimation)},setColorConfig:function(t,e){colorHelperFrom.set(t),colorHelperTo.set(e),t=this.fromColor,e=this.toColor,t.r=colorHelperFrom.r,t.g=colorHelperFrom.g,t.b=colorHelperFrom.b,e.r=colorHelperTo.r,e.g=colorHelperTo.g,e.b=colorHelperTo.b}});
- },{"../core/component":128,"../lib/three":176,"../utils":202,"super-animejs":56}],74:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("camera",{schema:{active:{default:!0},far:{default:1e4},fov:{default:80,min:0},near:{default:.005,min:0},spectator:{default:!1},zoom:{default:1,min:0}},init:function(){var e,t=this.el;e=this.camera=new THREE.PerspectiveCamera,t.setObject3D("camera",e)},update:function(e){var t=this.data,a=this.camera;a.aspect=t.aspect||window.innerWidth/window.innerHeight,a.far=t.far,a.fov=t.fov,a.near=t.near,a.zoom=t.zoom,a.updateProjectionMatrix(),this.updateActiveCamera(e),this.updateSpectatorCamera(e)},updateActiveCamera:function(e){var t=this.data,a=this.el,r=this.system;e&&e.active===t.active||t.spectator||(t.active&&r.activeCameraEl!==a?r.setActiveCamera(a):t.active||r.activeCameraEl!==a||r.disableActiveCamera())},updateSpectatorCamera:function(e){var t=this.data,a=this.el,r=this.system;e&&e.spectator===t.spectator||(t.spectator&&r.spectatorCameraEl!==a?r.setSpectatorCamera(a):t.spectator||r.spectatorCameraEl!==a||r.disableSpectatorCamera())},remove:function(){this.el.removeObject3D("camera")}});
- },{"../core/component":128,"../lib/three":176}],75:[function(_dereq_,module,exports){
- 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"},CANVAS_EVENTS={DOWN:["mousedown","touchstart"],UP:["mouseup","touchend"]},WEBXR_EVENTS={DOWN:["selectstart"],UP:["selectend"]},CANVAS_HOVER_CLASS="a-mouse-cursor-hover";module.exports.Component=registerComponent("cursor",{dependencies:["raycaster"],schema:{downEvents:{default:[]},fuse:{default:utils.device.isMobile()},fuseTimeout:{default:1500,min:0},mouseCursorStylesEnabled:{default:!0},upEvents:{default:[]},rayOrigin:{default:"entity",oneOf:["mouse","entity"]}},init:function(){var e=this;this.fuseTimeout=void 0,this.cursorDownEl=null,this.intersectedEl=null,this.canvasBounds=document.body.getBoundingClientRect(),this.isCursorDown=!1,this.updateCanvasBounds=utils.debounce(function(){e.canvasBounds=e.el.sceneEl.canvas.getBoundingClientRect()},500),this.eventDetail={},this.intersectedEventDetail={cursorEl:this.el},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),this.onEnterVR=bind(this.onEnterVR,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(){function e(){t=s.sceneEl.canvas,n.downEvents.length||n.upEvents.length||(CANVAS_EVENTS.DOWN.forEach(function(e){t.addEventListener(e,i.onCursorDown)}),CANVAS_EVENTS.UP.forEach(function(e){t.addEventListener(e,i.onCursorUp)}))}var t,n=this.data,s=this.el,i=this;t=s.sceneEl.canvas,t?e():s.sceneEl.addEventListener("render-target-loaded",e),n.downEvents.forEach(function(e){s.addEventListener(e,i.onCursorDown)}),n.upEvents.forEach(function(e){s.addEventListener(e,i.onCursorUp)}),s.addEventListener("raycaster-intersection",this.onIntersection),s.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),s.sceneEl.addEventListener("rendererresize",this.updateCanvasBounds),s.sceneEl.addEventListener("enter-vr",this.onEnterVR),window.addEventListener("resize",this.updateCanvasBounds),window.addEventListener("scroll",this.updateCanvasBounds),this.updateMouseEventListeners()},removeEventListeners:function(){var e,t=this.data,n=this.el,s=this;e=n.sceneEl.canvas,!e||t.downEvents.length||t.upEvents.length||(CANVAS_EVENTS.DOWN.forEach(function(t){e.removeEventListener(t,s.onCursorDown)}),CANVAS_EVENTS.UP.forEach(function(t){e.removeEventListener(t,s.onCursorUp)})),t.downEvents.forEach(function(e){n.removeEventListener(e,s.onCursorDown)}),t.upEvents.forEach(function(e){n.removeEventListener(e,s.onCursorUp)}),n.removeEventListener("raycaster-intersection",this.onIntersection),n.removeEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("touchstart",this.onMouseMove),e.removeEventListener("touchmove",this.onMouseMove),n.sceneEl.removeEventListener("rendererresize",this.updateCanvasBounds),n.sceneEl.removeEventListener("enter-vr",this.onEnterVR),window.removeEventListener("resize",this.updateCanvasBounds),window.removeEventListener("scroll",this.updateCanvasBounds)},updateMouseEventListeners:function(){var e,t=this.el;e=t.sceneEl.canvas,e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("touchmove",this.onMouseMove),t.setAttribute("raycaster","useWorldCoordinates",!1),"mouse"===this.data.rayOrigin&&(e.addEventListener("mousemove",this.onMouseMove,!1),e.addEventListener("touchmove",this.onMouseMove,!1),t.setAttribute("raycaster","useWorldCoordinates",!0),this.updateCanvasBounds())},onMouseMove:function(){var e=new THREE.Vector3,t=new THREE.Vector2,n=new THREE.Vector3,s={origin:n,direction:e};return function(i){var o,r,a,E=this.canvasBounds,u=this.el.sceneEl.camera;u.parent.updateMatrixWorld(),r="touchmove"===i.type||"touchstart"===i.type?i.touches.item(0):i,o=r.clientX-E.left,a=r.clientY-E.top,t.x=o/E.width*2-1,t.y=-a/E.height*2+1,n.setFromMatrixPosition(u.matrixWorld),e.set(t.x,t.y,.5).unproject(u).sub(n).normalize(),this.el.setAttribute("raycaster",s),"touchmove"===i.type&&i.preventDefault()}}(),onCursorDown:function(e){this.isCursorDown=!0,"mouse"===this.data.rayOrigin&&"touchstart"===e.type&&(this.onMouseMove(e),this.el.components.raycaster.checkIntersections(),e.preventDefault()),this.twoWayEmit(EVENTS.MOUSEDOWN),this.cursorDownEl=this.intersectedEl},onCursorUp:function(e){if(this.isCursorDown){this.isCursorDown=!1;var t=this.data;this.twoWayEmit(EVENTS.MOUSEUP),this.cursorDownEl&&this.cursorDownEl!==this.intersectedEl&&(this.intersectedEventDetail.intersection=null,this.cursorDownEl.emit(EVENTS.MOUSEUP,this.intersectedEventDetail)),t.fuse&&"mouse"!==t.rayOrigin||!this.intersectedEl||this.cursorDownEl!==this.intersectedEl||this.twoWayEmit(EVENTS.CLICK),this.cursorDownEl=null,"touchend"===e.type&&e.preventDefault()}},onIntersection:function(e){var t,n,s,i,o=this.el;n=e.detail.els[0]===o?1:0,i=e.detail.intersections[n],(s=e.detail.els[n])&&this.intersectedEl!==s&&(this.intersectedEl&&(t=this.el.components.raycaster.getIntersection(this.intersectedEl))&&t.distance<=i.distance||(this.clearCurrentIntersection(!0),this.setIntersection(s,i)))},onIntersectionCleared:function(e){-1!==e.detail.clearedEls.indexOf(this.intersectedEl)&&this.clearCurrentIntersection()},onEnterVR:function(){var e=this.el.xrSession,t=this;e&&(WEBXR_EVENTS.DOWN.forEach(function(n){e.addEventListener(n,t.onCursorDown)}),WEBXR_EVENTS.UP.forEach(function(n){e.addEventListener(n,t.onCursorUp)}))},setIntersection:function(e,t){var n=this.el,s=this.data,i=this;this.intersectedEl!==e&&(this.intersectedEl=e,n.addState(STATES.HOVERING),e.addState(STATES.HOVERED),this.twoWayEmit(EVENTS.MOUSEENTER),this.data.mouseCursorStylesEnabled&&"mouse"===this.data.rayOrigin&&this.el.sceneEl.canvas.classList.add(CANVAS_HOVER_CLASS),0!==s.fuseTimeout&&s.fuse&&(n.addState(STATES.FUSING),this.twoWayEmit(EVENTS.FUSING),this.fuseTimeout=setTimeout(function(){n.removeState(STATES.FUSING),i.twoWayEmit(EVENTS.CLICK)},s.fuseTimeout)))},clearCurrentIntersection:function(e){var t,n,s,i=this.el;this.intersectedEl&&(this.intersectedEl.removeState(STATES.HOVERED),i.removeState(STATES.HOVERING),i.removeState(STATES.FUSING),this.twoWayEmit(EVENTS.MOUSELEAVE),this.data.mouseCursorStylesEnabled&&"mouse"===this.data.rayOrigin&&this.el.sceneEl.canvas.classList.remove(CANVAS_HOVER_CLASS),this.intersectedEl=null,clearTimeout(this.fuseTimeout),!0!==e&&(s=this.el.components.raycaster.intersections,0!==s.length&&(t=s[0].object.el===i?1:0,(n=s[t])&&this.setIntersection(n.object.el,n))))},twoWayEmit:function(e){var t,n=this.el,s=this.intersectedEl;t=this.el.components.raycaster.getIntersection(s),this.eventDetail.intersectedEl=s,this.eventDetail.intersection=t,n.emit(e,this.eventDetail),s&&(this.intersectedEventDetail.intersection=t,s.emit(e,this.intersectedEventDetail))}});
- },{"../core/component":128,"../utils/":202}],76:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,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",isWebXRAvailable=_dereq_("../utils/").device.isWebXRAvailable,GAMEPAD_ID_WEBXR="google-daydream",GAMEPAD_ID_WEBVR="Daydream Controller",GAMEPAD_ID_PREFIX=isWebXRAvailable?GAMEPAD_ID_WEBXR:GAMEPAD_ID_WEBVR;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},orientationOffset:{type:"vec3"},armModel:{default:!0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","menu","system"]},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)},init:function(){var t=this;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.controllerPresent=!1,this.lastControllerCheck=0,this.bindMethods()},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(){checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{armModel:e.armModel,hand:e.hand,idPrefix:GAMEPAD_ID_PREFIX,orientationOffset:e.orientationOffset}),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.checkIfControllerPresent()},onModelLoaded:function(t){var e,o=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.menu=o.getObjectByName("AppButton_AppButton_Cylinder.004"),e.system=o.getObjectByName("HomeButton_HomeButton_Cylinder.005"),e.trackpad=o.getObjectByName("TouchPad_TouchPad_Cylinder.003"),o.position.set(0,0,-.04))},onAxisMoved:function(t){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)},updateModel:function(t,e){this.data.model&&this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var o=this.buttonMeshes;if(o&&o[t]){var n;switch(e){case"down":n=this.data.buttonHighlightColor;break;case"touchstart":n=this.data.buttonTouchedColor;break;default:n=this.data.buttonColor}o[t].material.color.set(n)}}});
- },{"../core/component":128,"../utils/":202,"../utils/bind":196,"../utils/tracked-controls":210}],77:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,isWebXRAvailable=_dereq_("../utils/").device.isWebXRAvailable,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_WEBXR="samsung-gearvr",GAMEPAD_ID_WEBVR="Gear VR",GAMEPAD_ID_PREFIX=isWebXRAvailable?GAMEPAD_ID_WEBXR:GAMEPAD_ID_WEBVR,INPUT_MAPPING_WEBVR={axes:{trackpad:[0,1]},buttons:["trackpad","trigger"]},INPUT_MAPPING_WEBXR={left:{axes:{touchpad:[0,1]},buttons:["trigger","none","touchpad","menu"]},right:{axes:{touchpad:[0,1]},buttons:["trigger","none","touchpad","menu"]}},INPUT_MAPPING=isWebXRAvailable?INPUT_MAPPING_WEBXR:INPUT_MAPPING_WEBVR;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},orientationOffset:{type:"vec3"},armModel:{default:!0}},mapping:INPUT_MAPPING,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)},init:function(){var t=this;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.controllerPresent=!1,this.lastControllerCheck=0,this.bindMethods()},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(){checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,this.data.hand?{hand:this.data.hand}:{})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{armModel:e.armModel,hand:e.hand,idPrefix:GAMEPAD_ID_PREFIX,id:GAMEPAD_ID_PREFIX,orientationOffset:e.orientationOffset}),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.children[2],e.trackpad=n.children[1])},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){this.data.model&&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)}}});
- },{"../core/component":128,"../utils/":202,"../utils/bind":196,"../utils/tracked-controls":210}],78:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,GAMEPAD_ID_PREFIX="generic",INPUT_MAPPING={axes:{touchpad:[0,1],thumbstick:[2,3]},buttons:["trigger","squeeze","touchpad","thumbstick"]};module.exports.Component=registerComponent("generic-tracked-controller-controls",{schema:{hand:{default:""},defaultModel:{default:!0},defaultModelColor:{default:"gray"},orientationOffset:{type:"vec3"}},mapping:INPUT_MAPPING,bindMethods:function(){this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=bind(this.removeControllersUpdateListener,this),this.onAxisMoved=bind(this.onAxisMoved,this)},init:function(){var t=this;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.controllerPresent=!1,this.lastControllerCheck=0,this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},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),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),this.controllerEventsActive=!1},checkIfControllerPresent:function(){var t=this.data,e=t.hand?t.hand:void 0;checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:e,iterateControllerProfiles:!0})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var t=this.el,e=this.data;this.el.components["tracked-controls"]||(t.setAttribute("tracked-controls",{hand:e.hand,idPrefix:GAMEPAD_ID_PREFIX,orientationOffset:e.orientationOffset,iterateControllerProfiles:!0}),this.data.defaultModel&&this.initDefaultModel())},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=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping.axes,t)},initDefaultModel:function(){var t=this.modelEl=document.createElement("a-entity");t.setAttribute("geometry",{primitive:"sphere",radius:.03}),t.setAttribute("material",{color:this.data.color}),this.el.appendChild(t)}});
- },{"../core/component":128,"../utils/bind":196,"../utils/tracked-controls":210}],79:[function(_dereq_,module,exports){
- var geometries=_dereq_("../core/geometry").geometries,geometryNames=_dereq_("../core/geometry").geometryNames,registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),dummyGeometry=new THREE.Geometry;module.exports.Component=registerComponent("geometry",{schema:{buffer:{default:!0},primitive:{default:"box",oneOf:geometryNames,schemaChange:!0},skipCache:{default:!1}},init:function(){this.geometry=null},update:function(e){var t,r=this.data,m=this.el,o=this.system;this.geometry&&(o.unuseGeometry(e),this.geometry=null),this.geometry=o.getOrCreateGeometry(r),t=m.getObject3D("mesh"),t?t.geometry=this.geometry:(t=new THREE.Mesh,t.geometry=this.geometry,m.setObject3D("mesh",t))},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=dummyGeometry,this.geometry=null},updateSchema:function(e){var t=this.oldData&&this.oldData.primitive,r=e.primitive,m=geometries[r]&&geometries[r].schema;if(!m)throw new Error("Unknown geometry schema `"+r+"`");t&&t===r||this.extendSchema(m)}});
- },{"../core/component":128,"../core/geometry":129,"../lib/three":176}],80:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),warn=utils.debug("components:gltf-model:warn");module.exports.Component=registerComponent("gltf-model",{schema:{type:"model"},init:function(){var e=this.system.getDRACOLoader();this.model=null,this.loader=new THREE.GLTFLoader,e&&this.loader.setDRACOLoader(e)},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,o.setObject3D("mesh",e.model),o.emit("model-loaded",{format:"gltf",model:e.model})},void 0,function(e){var r=e&&e.message?e.message:"Failed to load glTF model";warn(r),o.emit("model-error",{format:"gltf",src:t})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}});
- },{"../core/component":128,"../lib/three":176,"../utils/":202}],81:[function(_dereq_,module,exports){
- function getGestureEventName(t,e){var n;if(t)return n=EVENTS[t],"grip"===n?n+(e?"close":"open"):"point"===n?n+(e?"up":"down"):"pointing"===n||"pistol"===n?n+(e?"start":"end"):void 0}function isViveController(t){var e=t&&t.controller;return e&&(e.id&&0===e.id.indexOf("OpenVR ")||e.profiles&&e.profiles[0]&&"htc-vive-controller-mv"===e.profiles[0])}var registerComponent=_dereq_("../core/component").registerComponent,MODEL_URLS={toonLeft:"https://cdn.aframe.io/controllers/hands/leftHand.glb",toonRight:"https://cdn.aframe.io/controllers/hands/rightHand.glb",lowPolyLeft:"https://cdn.aframe.io/controllers/hands/leftHandLow.glb",lowPolyRight:"https://cdn.aframe.io/controllers/hands/rightHandLow.glb",highPolyLeft:"https://cdn.aframe.io/controllers/hands/leftHandHigh.glb",highPolyRight:"https://cdn.aframe.io/controllers/hands/rightHandHigh.glb"},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",module.exports.Component=registerComponent("hand-controls",{schema:{color:{default:"white",type:"color"},hand:{default:"left"},handModelStyle:{default:"lowPoly",oneOf:["lowPoly","highPoly","toon"]}},init:function(){var t=this,e=this.el;this.gesture=ANIMATIONS.open,this.pressedButtons={},this.touchedButtons={},this.loader=new THREE.GLTFLoader,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")},this.onControllerConnected=this.onControllerConnected.bind(this),this.onControllerDisconnected=this.onControllerDisconnected.bind(this),e.addEventListener("controllerconnected",this.onControllerConnected),e.addEventListener("controllerdisconnected",this.onControllerDisconnected),e.object3D.visible=!1},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(t,e){var n=this.el.getObject3D("mesh");n&&n.mixer&&n.mixer.update(e/1e3)},onControllerConnected:function(){this.el.object3D.visible=!0},onControllerDisconnected:function(){this.el.object3D.visible=!1},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 e,n=this.el,o=this.data.hand,i=this.data.handModelStyle,r=this.data.color,s=this;if(e={hand:o,model:!1},o!==t){var h=MODEL_URLS[i+o.charAt(0).toUpperCase()+o.slice(1)];this.loader.load(h,function(t){var i=t.scene.children[0],h="left"===o?Math.PI/2:-Math.PI/2;i.mixer=new THREE.AnimationMixer(i),s.clips=t.animations,n.setObject3D("mesh",i),i.children[1].material.color=new THREE.Color(r),i.position.set(0,0,0),i.rotation.set(0,0,h),n.setAttribute("magicleap-controls",e),n.setAttribute("vive-controls",e),n.setAttribute("oculus-touch-controls",e),n.setAttribute("windows-motion-controls",e)})}},remove:function(){this.el.removeObject3D("mesh")},handleButton:function(t,e){var n,o="down"===e,i="touchstart"===e;if(0===e.indexOf("touch")){if(i===this.touchedButtons[t])return;this.touchedButtons[t]=i}else{if(o===this.pressedButtons[t])return;this.pressedButtons[t]=o}n=this.gesture,this.gesture=this.determineGesture(),this.gesture!==n&&(this.animateGesture(this.gesture,n),this.emitGestureEvents(this.gesture,n))},determineGesture:function(){var t,e=this.pressedButtons.grip,n=this.pressedButtons.surface||this.touchedButtons.surface,o=this.pressedButtons.trackpad||this.touchedButtons.trackpad,i=this.pressedButtons.trigger||this.touchedButtons.trigger,r=this.touchedButtons.AorX||this.touchedButtons.BorY;return isViveController(this.el.components["tracked-controls"])?e||i?t=ANIMATIONS.fist:o&&(t=ANIMATIONS.point):e?t=n||r||o?i?ANIMATIONS.fist:ANIMATIONS.point:i?ANIMATIONS.thumbUp:ANIMATIONS.pointThumb:i&&(t=ANIMATIONS.hold),t},getClip:function(t){var e,n;for(n=0;n<this.clips.length;n++)if(e=this.clips[n],e.name===t)return e},animateGesture:function(t,e){if(t)return void this.playAnimation(t||ANIMATIONS.open,e,!1);this.playAnimation(e,e,!0)},emitGestureEvents:function(t,e){var n,o=this.el;e!==t&&(n=getGestureEventName(e,!1),n&&o.emit(n),(n=getGestureEventName(t,!0))&&o.emit(n))},playAnimation:function(t,e,n){var o,i,r,s=this.el.getObject3D("mesh");if(s){if(s.mixer.stopAllAction(),o=this.getClip(t),r=s.mixer.clipAction(o),r.clampWhenFinished=!0,r.loop=THREE.LoopRepeat,r.repetitions=0,r.timeScale=n?-1:1,r.time=n?o.duration:0,r.weight=1,!e||t===e)return s.mixer.stopAllAction(),void r.play();o=this.getClip(e),i=s.mixer.clipAction(o),i.weight=.15,i.play(),r.play(),i.crossFadeTo(r,.15,!0)}}});
- },{"../core/component":128}],82:[function(_dereq_,module,exports){
- _dereq_("./animation"),_dereq_("./camera"),_dereq_("./cursor"),_dereq_("./daydream-controls"),_dereq_("./gearvr-controls"),_dereq_("./geometry"),_dereq_("./generic-tracked-controller-controls"),_dereq_("./gltf-model"),_dereq_("./hand-controls"),_dereq_("./laser-controls"),_dereq_("./light"),_dereq_("./line"),_dereq_("./link"),_dereq_("./look-controls"),_dereq_("./magicleap-controls"),_dereq_("./material"),_dereq_("./obj-model"),_dereq_("./oculus-go-controls"),_dereq_("./oculus-touch-controls"),_dereq_("./position"),_dereq_("./raycaster"),_dereq_("./rotation"),_dereq_("./scale"),_dereq_("./shadow"),_dereq_("./sound"),_dereq_("./text"),_dereq_("./tracked-controls"),_dereq_("./tracked-controls-webvr"),_dereq_("./tracked-controls-webxr"),_dereq_("./visible"),_dereq_("./valve-index-controls"),_dereq_("./vive-controls"),_dereq_("./vive-focus-controls"),_dereq_("./wasd-controls"),_dereq_("./windows-motion-controls"),_dereq_("./scene/background"),_dereq_("./scene/debug"),_dereq_("./scene/device-orientation-permission-ui"),_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");
- },{"./animation":73,"./camera":74,"./cursor":75,"./daydream-controls":76,"./gearvr-controls":77,"./generic-tracked-controller-controls":78,"./geometry":79,"./gltf-model":80,"./hand-controls":81,"./laser-controls":83,"./light":84,"./line":85,"./link":86,"./look-controls":87,"./magicleap-controls":88,"./material":89,"./obj-model":90,"./oculus-go-controls":91,"./oculus-touch-controls":92,"./position":93,"./raycaster":94,"./rotation":95,"./scale":96,"./scene/background":97,"./scene/debug":98,"./scene/device-orientation-permission-ui":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":113,"./tracked-controls-webvr":111,"./tracked-controls-webxr":112,"./valve-index-controls":114,"./visible":115,"./vive-controls":116,"./vive-focus-controls":117,"./wasd-controls":118,"./windows-motion-controls":119}],83:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/");registerComponent("laser-controls",{schema:{hand:{default:"right"},model:{default:!0},defaultModelColor:{type:"color",default:"grey"}},init:function(){function t(t){var r=e[t.detail.name];if(r){var o=utils.extend({showLine:!0},r.raycaster||{});t.detail.rayOrigin&&(o.origin=t.detail.rayOrigin.origin,o.direction=t.detail.rayOrigin.direction,o.showLine=!0),t.detail.rayOrigin||!i.modelReady?n.setAttribute("raycaster",o):n.setAttribute("raycaster","showLine",!0),n.setAttribute("cursor",utils.extend({fuse:!1},r.cursor))}}function r(){n.setAttribute("raycaster","showLine",!1)}var e=this.config,o=this.data,n=this.el,i=this,s={hand:o.hand,model:o.model};n.setAttribute("daydream-controls",s),n.setAttribute("gearvr-controls",s),n.setAttribute("magicleap-controls",s),n.setAttribute("oculus-go-controls",s),n.setAttribute("oculus-touch-controls",s),n.setAttribute("valve-index-controls",s),n.setAttribute("vive-controls",s),n.setAttribute("vive-focus-controls",s),n.setAttribute("windows-motion-controls",s),n.setAttribute("generic-tracked-controller-controls",s),n.addEventListener("controllerconnected",t),n.addEventListener("controllerdisconnected",r),n.addEventListener("controllermodelready",function(r){t(r),i.modelReady=!0})},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"gearvr-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]},raycaster:{origin:{x:0,y:.001,z:0}}},"generic-tracked-controller-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}},"magicleap-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-go-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]},raycaster:{origin:{x:0,y:5e-4,z:0}}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]},raycaster:{origin:{x:0,y:0,z:0}}},"valve-index-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}},"vive-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}},"vive-focus-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"windows-motion-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]},raycaster:{showLine:!1}}}});
- },{"../core/component":128,"../utils/":202}],84:[function(_dereq_,module,exports){
- 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"],schemaChange:!0},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}},shadowRadius:{default:1,if:{castShadow:!0}}},init:function(){var e=this.el;this.light=null,this.defaultTarget=null,this.rendererSystem=this.el.sceneEl.systems.renderer,this.system.registerLight(e)},update:function(e){var a=this.data,t=diff(a,e),o=this.light,r=this.rendererSystem,i=this;if(o&&!("type"in t)){var s=!1;return void Object.keys(t).forEach(function(e){var t=a[e];switch(e){case"color":o.color.set(t),r.applyColorCorrection(o.color);break;case"groundColor":o.groundColor.set(t),r.applyColorCorrection(o.groundColor);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":case"shadowRadius":s||(i.updateShadow(),s=!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.radius=a.shadowRadius,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);this.rendererSystem.applyColorCorrection(t),t=t.getHex();var o=e.decay,r=e.distance,i=new THREE.Color(e.groundColor);this.rendererSystem.applyColorCorrection(i),i=i.getHex();var 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,i,s);case"point":return new THREE.PointLight(t,s,r,o);case"spot":return n=new THREE.SpotLight(t,s,r,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")}});
- },{"../core/component":128,"../lib/three":176,"../utils":202,"../utils/bind":196,"../utils/debug":198}],85:[function(_dereq_,module,exports){
- function isEqualVec3(e,t){return!(!e||!t)&&(e.x===t.x&&e.y===t.y&&e.z===t.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 e,t,r=this.data;this.rendererSystem=this.el.sceneEl.systems.renderer,t=this.material=new THREE.LineBasicMaterial({color:r.color,opacity:r.opacity,transparent:r.opacity<1,visible:r.visible}),e=this.geometry=new THREE.BufferGeometry,e.setAttribute("position",new THREE.BufferAttribute(new Float32Array(6),3)),this.rendererSystem.applyColorCorrection(t.color),this.line=new THREE.Line(e,t),this.el.setObject3D(this.attrName,this.line)},update:function(e){var t=this.data,r=this.geometry,i=!1,o=this.material,n=r.attributes.position.array;isEqualVec3(t.start,e.start)||(n[0]=t.start.x,n[1]=t.start.y,n[2]=t.start.z,i=!0),isEqualVec3(t.end,e.end)||(n[3]=t.end.x,n[4]=t.end.y,n[5]=t.end.z,i=!0),i&&(r.attributes.position.needsUpdate=!0,r.computeBoundingSphere()),o.color.setStyle(t.color),this.rendererSystem.applyColorCorrection(o.color),o.opacity=t.opacity,o.transparent=t.opacity<1,o.visible=t.visible},remove:function(){this.el.removeObject3D("line",this.line)}});
- },{"../core/component":128}],86:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("link",{schema:{backgroundColor:{default:"red",type:"color"},borderColor:{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:""},titleColor:{default:"white",type:"color"},visualAspectEnabled:{default:!1}},init:function(){this.navigate=this.navigate.bind(this),this.previousQuaternion=void 0,this.quaternionClone=new THREE.Quaternion,this.hiddenEls=[]},update:function(e){var t,i,r=this.data,o=this.el;r.visualAspectEnabled&&(this.initVisualAspect(),t=r.highlighted?r.highlightedColor:r.backgroundColor,i=r.highlighted?r.highlightedColor:r.borderColor,o.setAttribute("material","backgroundColor",t),o.setAttribute("material","strokeColor",i),r.on!==e.on&&this.updateEventListener(),void 0!==e.peekMode&&r.peekMode!==e.peekMode&&this.updatePeekMode(),r.image&&e.image!==r.image&&o.setAttribute("material","pano","string"==typeof r.image?r.image:r.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&&!this.visualAspectInitialized&&(i=this.textEl=this.textEl||document.createElement("a-entity"),t=this.sphereEl=this.sphereEl||document.createElement("a-entity"),e=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"}),i.setAttribute("text",{color:this.data.titleColor,align:"center",font:"kelsonsans",value:this.data.title||this.data.href,width:4}),i.setAttribute("position","0 1.5 0"),r.appendChild(i),e.setAttribute("geometry",{primitive:"sphere",radius:1,phiStart:0,segmentsWidth:64,segmentsHeight:64,phiLength:180,thetaStart:0,thetaLength:360}),e.setAttribute("material",{shader:"portal",borderEnabled:0,pano:this.data.image,side:"back"}),e.setAttribute("rotation","0 180 0"),e.setAttribute("position","0 0 0"),e.setAttribute("visible",!1),r.appendChild(e),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),this.visualAspectInitialized=!0)},navigate:function(){window.location=this.data.href},tick:function(){var e=new THREE.Vector3,t=new THREE.Vector3,i=new THREE.Quaternion,r=new THREE.Vector3;return function(){var o,a,n=this.el,s=n.object3D,l=n.sceneEl.camera,d=this.textEl;if(this.data.visualAspectEnabled)if(s.updateMatrixWorld(),l.parent.updateMatrixWorld(),l.updateMatrixWorld(),s.matrix.decompose(t,i,r),t.setFromMatrixPosition(s.matrixWorld),e.setFromMatrixPosition(l.matrixWorld),(a=t.distanceTo(e))>20)this.previousQuaternion||(this.quaternionClone.copy(i),this.previousQuaternion=this.quaternionClone),s.lookAt(e);else{if(o=this.calculateCameraPortalOrientation(),a<.5){if(!0===this.semiSphereEl.getAttribute("visible"))return;d.setAttribute("text","width",1.5),o<=0?(d.setAttribute("position","0 0 0.75"),d.setAttribute("rotation","0 180 0"),this.semiSphereEl.setAttribute("rotation","0 0 0")):(d.setAttribute("position","0 0 -0.75"),d.setAttribute("rotation","0 0 0"),this.semiSphereEl.setAttribute("rotation","0 180 0")),n.getObject3D("mesh").visible=!1,this.semiSphereEl.setAttribute("visible",!0),this.peekCameraPortalOrientation=o}else o<=0?d.setAttribute("rotation","0 180 0"):d.setAttribute("rotation","0 0 0"),d.setAttribute("text","width",5),d.setAttribute("position","0 1.5 0"),n.getObject3D("mesh").visible=!0,this.semiSphereEl.setAttribute("visible",!1),this.peekCameraPortalOrientation=void 0;this.previousQuaternion&&(s.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:{borderEnabled:{default:1,type:"int",is:"uniform"},backgroundColor:{default:"red",type:"color",is:"uniform"},pano:{type:"map",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 vec3 backgroundColor;","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(backgroundColor, 1.0), clamp(pow((vDistance / 15.0), 2.0), 0.0, 1.0));","}","}"].join("\n")});
- },{"../core/component":128,"../core/shader":138,"../lib/three":176}],87:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,PI_2=Math.PI/2;module.exports.Component=registerComponent("look-controls",{dependencies:["position","rotation"],schema:{enabled:{default:!0},hmdEnabled:{default:!0},pointerLockEnabled:{default:!1},reverseMouseDrag:{default:!1},reverseTouchDrag:{default:!1},touchEnabled:{default:!0}},init:function(){this.deltaYaw=0,this.previousHMDPosition=new THREE.Vector3,this.hmdQuaternion=new THREE.Quaternion,this.magicWindowAbsoluteEuler=new THREE.Euler,this.magicWindowDeltaEuler=new THREE.Euler,this.position=new THREE.Vector3,this.magicWindowObject=new THREE.Object3D,this.rotation={},this.deltaRotation={},this.savedPose=null,this.pointerLocked=!1,this.setupMouseControls(),this.bindMethods(),this.setupMagicWindowControls(),this.savedPose={position:new THREE.Vector3,rotation:new THREE.Euler},this.el.sceneEl.is("vr-mode")&&this.onEnterVR()},setupMagicWindowControls:function(){var e;utils.device.isMobile()&&(e=this.magicWindowControls=new THREE.DeviceOrientationControls(this.magicWindowObject),"undefined"!=typeof DeviceOrientationEvent&&DeviceOrientationEvent.requestPermission&&(e.enabled=!1,this.el.sceneEl.components["device-orientation-permission-ui"].permissionGranted?e.enabled=!0:this.el.sceneEl.addEventListener("deviceorientationpermissiongranted",function(){e.enabled=!0})))},update:function(e){var t=this.data;t.enabled!==e.enabled&&this.updateGrabCursor(t.enabled),!e||t.hmdEnabled||e.hmdEnabled||(this.pitchObject.rotation.set(0,0,0),this.yawObject.rotation.set(0,0,0)),e&&!t.pointerLockEnabled!==e.pointerLockEnabled&&(this.removeEventListeners(),this.addEventListeners(),this.pointerLocked&&this.exitPointerLock())},tick:function(e){this.data.enabled&&this.updateOrientation()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners(),this.pointerLocked&&this.exitPointerLock()},remove:function(){this.removeEventListeners(),this.pointerLocked&&this.exitPointerLock()},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.onEnterVR=bind(this.onEnterVR,this),this.onExitVR=bind(this.onExitVR,this),this.onPointerLockChange=bind(this.onPointerLockChange,this),this.onPointerLockError=bind(this.onPointerLockError,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)},addEventListeners:function(){var e=this.el.sceneEl,t=e.canvas;if(!t)return void e.addEventListener("render-target-loaded",bind(this.addEventListeners,this));t.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.onMouseUp,!1),t.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),window.addEventListener("touchend",this.onTouchEnd),e.addEventListener("enter-vr",this.onEnterVR),e.addEventListener("exit-vr",this.onExitVR),this.data.pointerLockEnabled&&(document.addEventListener("pointerlockchange",this.onPointerLockChange,!1),document.addEventListener("mozpointerlockchange",this.onPointerLockChange,!1),document.addEventListener("pointerlockerror",this.onPointerLockError,!1))},removeEventListeners:function(){var e=this.el.sceneEl,t=e&&e.canvas;t&&(t.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("enter-vr",this.onEnterVR),e.removeEventListener("exit-vr",this.onExitVR),document.removeEventListener("pointerlockchange",this.onPointerLockChange,!1),document.removeEventListener("mozpointerlockchange",this.onPointerLockChange,!1),document.removeEventListener("pointerlockerror",this.onPointerLockError,!1))},updateOrientation:function(){var e=new THREE.Matrix4;return function(){var t,o=this.el.object3D,n=this.pitchObject,i=this.yawObject,s=this.el.sceneEl;if(s.is("vr-mode")&&s.checkHeadsetConnected())return void(s.hasWebXR&&(t=s.renderer.xr.getCameraPose())&&(e.elements=t.transform.matrix,e.decompose(o.position,o.rotation,o.scale)));this.updateMagicWindowOrientation(),o.rotation.x=this.magicWindowDeltaEuler.x+n.rotation.x,o.rotation.y=this.magicWindowDeltaEuler.y+i.rotation.y,o.rotation.z=this.magicWindowDeltaEuler.z}}(),updateMagicWindowOrientation:function(){var e=this.magicWindowAbsoluteEuler,t=this.magicWindowDeltaEuler;this.magicWindowControls&&this.magicWindowControls.enabled&&(this.magicWindowControls.update(),e.setFromQuaternion(this.magicWindowObject.quaternion,"YXZ"),this.previousMagicWindowYaw||0===e.y||(this.previousMagicWindowYaw=e.y),this.previousMagicWindowYaw&&(t.x=e.x,t.y+=e.y-this.previousMagicWindowYaw,t.z=e.z,this.previousMagicWindowYaw=e.y))},onMouseMove:function(e){var t,o,n,i=this.pitchObject,s=this.previousMouseEvent,r=this.yawObject;this.data.enabled&&(this.mouseDown||this.pointerLocked)&&(this.pointerLocked?(o=e.movementX||e.mozMovementX||0,n=e.movementY||e.mozMovementY||0):(o=e.screenX-s.screenX,n=e.screenY-s.screenY),this.previousMouseEvent=e,t=this.data.reverseMouseDrag?1:-1,r.rotation.y+=.002*o*t,i.rotation.x+=.002*n*t,i.rotation.x=Math.max(-PI_2,Math.min(PI_2,i.rotation.x)))},onMouseDown:function(e){var t=this.el.sceneEl;if(!(!this.data.enabled||t.is("vr-mode")&&t.checkHeadsetConnected())&&0===e.button){var o=t&&t.canvas;this.mouseDown=!0,this.previousMouseEvent=e,this.showGrabbingCursor(),this.data.pointerLockEnabled&&!this.pointerLocked&&(o.requestPointerLock?o.requestPointerLock():o.mozRequestPointerLock&&o.mozRequestPointerLock())}},showGrabbingCursor:function(){this.el.sceneEl.canvas.style.cursor="grabbing"},hideGrabbingCursor:function(){this.el.sceneEl.canvas.style.cursor=""},onMouseUp:function(){this.mouseDown=!1,this.hideGrabbingCursor()},onTouchStart:function(e){1===e.touches.length&&this.data.touchEnabled&&!this.el.sceneEl.is("vr-mode")&&(this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(e){var t,o,n=this.el.sceneEl.canvas,i=this.yawObject;this.touchStarted&&this.data.touchEnabled&&(o=2*Math.PI*(e.touches[0].pageX-this.touchStart.x)/n.clientWidth,t=this.data.reverseTouchDrag?1:-1,i.rotation.y-=.5*o*t,this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1},onEnterVR:function(){var e=this.el.sceneEl;e.checkHeadsetConnected()&&(this.saveCameraPose(),this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0),e.hasWebXR&&(this.el.object3D.matrixAutoUpdate=!1,this.el.object3D.updateMatrix()))},onExitVR:function(){this.el.sceneEl.checkHeadsetConnected()&&(this.restoreCameraPose(),this.previousHMDPosition.set(0,0,0),this.el.object3D.matrixAutoUpdate=!0)},onPointerLockChange:function(){this.pointerLocked=!(!document.pointerLockElement&&!document.mozPointerLockElement)},onPointerLockError:function(){this.pointerLocked=!1},exitPointerLock:function(){document.exitPointerLock(),this.pointerLocked=!1},updateGrabCursor:function(e){function t(){n.canvas.classList.add("a-grab-cursor")}function o(){n.canvas.classList.remove("a-grab-cursor")}var n=this.el.sceneEl;return n.canvas?e?void t():void o():void(e?n.addEventListener("render-target-loaded",t):n.addEventListener("render-target-loaded",o))},saveCameraPose:function(){var e=this.el;this.savedPose.position.copy(e.object3D.position),this.savedPose.rotation.copy(e.object3D.rotation),this.hasSavedPose=!0},restoreCameraPose:function(){var e=this.el,t=this.savedPose;this.hasSavedPose&&(e.object3D.position.copy(t.position),e.object3D.rotation.copy(t.rotation),this.hasSavedPose=!1)}});
- },{"../core/component":128,"../lib/three":176,"../utils/":202}],88:[function(_dereq_,module,exports){
- var bind=_dereq_("../utils/bind"),registerComponent=_dereq_("../core/component").registerComponent,trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,GAMEPAD_ID_PREFIX="magicleap",GAMEPAD_ID_SUFFIX="-one",GAMEPAD_ID_COMPOSITE=GAMEPAD_ID_PREFIX+GAMEPAD_ID_SUFFIX,MAGICLEAP_CONTROLLER_MODEL_GLB_URL="https://cdn.aframe.io/controllers/magicleap/magicleap-one-controller.glb",INPUT_MAPPING_WEBXR={axes:{touchpad:[0,1]},buttons:["trigger","grip","touchpad","menu"]};module.exports.Component=registerComponent("magicleap-controls",{schema:{hand:{default:"none"},model:{default:!0},orientationOffset:{type:"vec3"}},mapping:INPUT_MAPPING_WEBXR,init:function(){var t=this;this.controllerPresent=!1,this.lastControllerCheck=0,this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.previousButtonValues={},this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},update:function(){var t=this.data;this.controllerIndex="right"===t.hand?0:"left"===t.hand?1:2},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},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("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(){var t=this.data;checkControllerPresentAndSetup(this,GAMEPAD_ID_COMPOSITE,{index:this.controllerIndex,hand:t.hand})},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_COMPOSITE,hand:e.hand,controller:this.controllerIndex,orientationOffset:e.orientationOffset}),this.data.model&&this.el.setAttribute("gltf-model",MAGICLEAP_CONTROLLER_MODEL_GLB_URL)},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];n&&("trigger"===n&&(e=t.detail.state.value,console.log("analog value of trigger press: "+e)),this.el.emit(n+"changed",t.detail.state))},onModelLoaded:function(t){t.detail.model.scale.set(.01,.01,.01)},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){},setButtonColor:function(t,e){}});
- },{"../core/component":128,"../utils/bind":196,"../utils/tracked-controls":210}],89:[function(_dereq_,module,exports){
- function parseSide(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}function parseVertexColors(e){switch(e){case"face":return THREE.FaceColors;case"vertex":return THREE.VertexColors;default:return THREE.NoColors}}function parseBlending(e){switch(e){case"none":return THREE.NoBlending;case"additive":return THREE.AdditiveBlending;case"subtractive":return THREE.SubtractiveBlending;case"multiply":return THREE.MultiplyBlending;default:return THREE.NormalBlending}}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:{alphaTest:{default:0,min:0,max:1},depthTest:{default:!0},depthWrite:{default:!0},flatShading:{default:!1},npot:{default:!1},offset:{type:"vec2",default:{x:0,y:0}},opacity:{default:1,min:0,max:1},repeat:{type:"vec2",default:{x:1,y:1}},shader:{default:"standard",oneOf:shaderNames,schemaChange:!0},side:{default:"front",oneOf:["front","back","double"]},transparent:{default:!1},vertexColors:{type:"string",default:"none",oneOf:["face","vertex"]},visible:{default:!0},blending:{default:"normal",oneOf:["none","normal","additive","subtractive","multiply"]},dithering:{default:!0}},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(e)},updateSchema:function(e){var t,a,r,i;a=e&&e.shader,t=this.oldData&&this.oldData.shader,i=a||t,r=shaders[i]&&shaders[i].schema,r||error("Unknown shader schema "+i),t&&a===t||(this.extendSchema(r),this.updateBehavior())},updateBehavior:function(){function e(e,t){var r;for(r in a)a[r]=e;s.shader.update(a)}var t,a,r=this.el.sceneEl,i=this.schema,s=this;this.tick=void 0,a={};for(t in i)"time"===i[t].type&&(this.tick=e,a[t]=!0);r&&(this.tick?r.addBehavior(this):r.removeBehavior(this))},updateShader:function(e){var t,a=this.data,r=shaders[e]&&shaders[e].Shader;if(!r)throw new Error("Unknown shader "+e);t=this.shader=new r,t.el=this.el,t.init(a),this.setMaterial(t.material),this.updateSchema(a)},updateMaterial:function(e){var t,a=this.data,r=this.material;r.alphaTest=a.alphaTest,r.depthTest=!1!==a.depthTest,r.depthWrite=!1!==a.depthWrite,r.opacity=a.opacity,r.flatShading=a.flatShading,r.side=parseSide(a.side),r.transparent=!1!==a.transparent||a.opacity<1,r.vertexColors=parseVertexColors(a.vertexColors),r.visible=a.visible,r.blending=parseBlending(a.blending),r.dithering=a.dithering;for(t in e)break;!t||e.alphaTest===a.alphaTest&&e.side===a.side&&e.vertexColors===a.vertexColors||(r.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,a=this.el,r=this.system;this.material&&disposeMaterial(this.material,r),this.material=e,r.registerMaterial(e),t=a.getObject3D("mesh"),t?t.material=e:a.addEventListener("object3dset",function t(r){"mesh"===r.detail.type&&r.target===a&&(a.getObject3D("mesh").material=e,a.removeEventListener("object3dset",t))})}});
- },{"../core/component":128,"../core/shader":138,"../lib/three":176,"../utils/":202}],90:[function(_dereq_,module,exports){
- 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(){var e=this;this.model=null,this.objLoader=new THREE.OBJLoader,this.mtlLoader=new THREE.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin="",this.el.addEventListener("componentinitialized",function(o){e.model&&"material"===o.detail.name&&e.applyMaterial()})},update:function(){var e=this.data;e.obj&&(this.resetMesh(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.resetMesh()},resetMesh:function(){this.el.removeObject3D("mesh")},loadObj:function(e,o){var t=this,r=this.el,i=this.mtlLoader,a=this.objLoader,s=this.el.sceneEl.systems.renderer,n=o.substr(0,o.lastIndexOf("/")+1);if(o)return r.hasAttribute("material")&&warn("Material component properties are ignored when a .MTL is provided"),i.setResourcePath(n),void i.load(o,function(o){o.preload(),a.setMaterials(o),a.load(e,function(e){t.model=e,t.model.traverse(function(e){if(e.isMesh){var o=e.material;o.color&&s.applyColorCorrection(o.color),o.map&&s.applyColorCorrection(o.map),o.emissive&&s.applyColorCorrection(o.emissive),o.emissiveMap&&s.applyColorCorrection(o.emissiveMap)}}),r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})});a.load(e,function(e){t.model=e,t.applyMaterial(),r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})},applyMaterial:function(){var e=this.el.components.material;e&&this.model.traverse(function(o){o instanceof THREE.Mesh&&(o.material=e.material)})}});
- },{"../core/component":128,"../lib/three":176,"../utils/debug":198}],91:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,isWebXRAvailable=_dereq_("../utils/").device.isWebXRAvailable,GAMEPAD_ID_WEBXR="oculus-go",GAMEPAD_ID_WEBVR="Oculus Go",OCULUS_GO_CONTROLLER_MODEL_URL="https://cdn.aframe.io/controllers/oculus/go/oculus-go-controller.gltf",GAMEPAD_ID_PREFIX=isWebXRAvailable?GAMEPAD_ID_WEBXR:GAMEPAD_ID_WEBVR,INPUT_MAPPING_WEBVR={axes:{trackpad:[0,1]},buttons:["trackpad","trigger"]},INPUT_MAPPING_WEBXR={axes:{touchpad:[0,1]},buttons:["trigger","none","touchpad"]},INPUT_MAPPING=isWebXRAvailable?INPUT_MAPPING_WEBXR:INPUT_MAPPING_WEBVR;module.exports.Component=registerComponent("oculus-go-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#FFFFFF"},buttonTouchedColor:{type:"color",default:"#BBBBBB"},buttonHighlightColor:{type:"color",default:"#7A7A7A"},model:{default:!0},orientationOffset:{type:"vec3"},armModel:{default:!0}},mapping:INPUT_MAPPING,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)},init:function(){var t=this;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.controllerPresent=!1,this.lastControllerCheck=0,this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},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(){checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,this.data.hand?{hand:this.data.hand}:{})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{armModel:e.armModel,hand:e.hand,idPrefix:GAMEPAD_ID_PREFIX,orientationOffset:e.orientationOffset}),this.data.model&&this.el.setAttribute("gltf-model",OCULUS_GO_CONTROLLER_MODEL_URL)},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,o=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.trigger=o.getObjectByName("oculus_go_button_trigger"),e.trackpad=o.getObjectByName("oculus_go_touchpad"))},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){this.data.model&&this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var o=this.buttonMeshes;if(o&&o[t]){var n,i;switch(e){case"down":n=this.data.buttonHighlightColor;break;case"touchstart":n=this.data.buttonTouchedColor;break;default:n=this.data.buttonColor}i=o[t],i.material.color.set(n),this.rendererSystem.applyColorCorrection(i.material.color)}}});
- },{"../core/component":128,"../utils/":202,"../utils/bind":196,"../utils/tracked-controls":210}],92:[function(_dereq_,module,exports){
- var bind=_dereq_("../utils/bind"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,isOculusBrowser=_dereq_("../utils/").device.isOculusBrowser(),isWebXRAvailable=_dereq_("../utils/").device.isWebXRAvailable,GAMEPAD_ID_WEBXR="oculus-touch",GAMEPAD_ID_WEBVR="Oculus Touch",GAMEPAD_ID_PREFIX=isWebXRAvailable?GAMEPAD_ID_WEBXR:GAMEPAD_ID_WEBVR,TOUCH_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-",TOUCH_GEN2_CONTROLLER_MODEL_BASE_URL=TOUCH_CONTROLLER_MODEL_BASE_URL,OCULUS_TOUCH_WEBVR={left:{modelUrl:TOUCH_CONTROLLER_MODEL_BASE_URL+"left.gltf",rayOrigin:{origin:{x:.008,y:-.01,z:0},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new THREE.Vector3(-.005,.003,-.055),modelPivotRotation:new THREE.Euler(0,0,0)},right:{modelUrl:TOUCH_CONTROLLER_MODEL_BASE_URL+"right.gltf",rayOrigin:{origin:{x:-.008,y:-.01,z:0},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new THREE.Vector3(.005,.003,-.055),modelPivotRotation:new THREE.Euler(0,0,0)}},OCULUS_TOUCH_WEBXR={left:{modelUrl:TOUCH_CONTROLLER_MODEL_BASE_URL+"left.gltf",rayOrigin:{origin:{x:.002,y:-.005,z:-.03},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new THREE.Vector3(-.005,.036,-.037),modelPivotRotation:new THREE.Euler(Math.PI/4.5,0,0)},right:{modelUrl:TOUCH_CONTROLLER_MODEL_BASE_URL+"right.gltf",rayOrigin:{origin:{x:-.002,y:-.005,z:-.03},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new THREE.Vector3(.005,.036,-.037),modelPivotRotation:new THREE.Euler(Math.PI/4.5,0,0)}},OCULUS_TOUCH_CONFIG=isWebXRAvailable?OCULUS_TOUCH_WEBXR:OCULUS_TOUCH_WEBVR,CONTROLLER_DEFAULT="oculus-touch",CONTROLLER_PROPERTIES={"oculus-touch":OCULUS_TOUCH_CONFIG,"oculus-touch-v2":{left:{modelUrl:TOUCH_GEN2_CONTROLLER_MODEL_BASE_URL+"gen2-left.gltf",rayOrigin:{origin:{x:-.01,y:0,z:-.02},direction:{x:0,y:-.5,z:-1}},modelPivotOffset:new THREE.Vector3(0,0,0),modelPivotRotation:new THREE.Euler(0,0,0)},right:{modelUrl:TOUCH_GEN2_CONTROLLER_MODEL_BASE_URL+"gen2-right.gltf",rayOrigin:{origin:{x:.01,y:0,z:-.02},direction:{x:0,y:-.5,z:-1}},modelPivotOffset:new THREE.Vector3(0,0,0),modelPivotRotation:new THREE.Euler(0,0,0)}}},INPUT_MAPPING_WEBVR={left:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","xbutton","ybutton","surface"]},right:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","abutton","bbutton","surface"]}},INPUT_MAPPING_WEBXR={left:{axes:{thumbstick:[2,3]},buttons:["trigger","grip","none","thumbstick","xbutton","ybutton","surface"]},right:{axes:{thumbstick:[2,3]},buttons:["trigger","grip","none","thumbstick","abutton","bbutton","surface"]}},INPUT_MAPPING=isWebXRAvailable?INPUT_MAPPING_WEBXR:INPUT_MAPPING_WEBVR;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},controllerType:{default:"auto",oneOf:["auto","oculus-touch","oculus-touch-v2"]},orientationOffset:{type:"vec3",default:{x:43,y:0,z:0}}},mapping:INPUT_MAPPING,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){onButtonEvent(e.detail.id,"down",t,t.data.hand)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t,t.data.hand)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t,t.data.hand)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t,t.data.hand)},this.controllerPresent=!1,this.lastControllerCheck=0,this.previousButtonValues={},this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},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(){checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},loadModel:function(){var t=this.data;if(t.model){if(this.displayModel=CONTROLLER_PROPERTIES[t.controllerType]||CONTROLLER_PROPERTIES[CONTROLLER_DEFAULT],"auto"===t.controllerType){var e=this.el.sceneEl.systems["tracked-controls-webvr"];if(e&&e.vrDisplay){/^Oculus Quest$/.test(e.vrDisplay.displayName)&&(this.displayModel=CONTROLLER_PROPERTIES["oculus-touch-v2"])}isOculusBrowser&&(this.displayModel=CONTROLLER_PROPERTIES["oculus-touch-v2"])}var o=this.displayModel[t.hand].modelUrl;this.el.setAttribute("gltf-model",o)}},injectTrackedControls:function(){var t=this.data,e=GAMEPAD_ID_WEBXR,o="right"===t.hand?"Oculus Touch (Right)":"Oculus Touch (Left)",n=isWebXRAvailable?e:o;this.el.setAttribute("tracked-controls",{id:n,hand:t.hand,orientationOffset:t.orientationOffset}),this.loadModel()},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=this.originalXRotationTrigger-e*(Math.PI/26)),"grip"===o&&n.grip&&(n.grip.position.x=this.originalXPositionGrip+("left"===this.data.hand?-1:1)*e*.004)),this.el.emit(o+"changed",t.detail.state))},onModelLoaded:function(t){var e,o=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.grip=o.getObjectByName("buttonHand"),this.originalXPositionGrip=e.grip.position.x,e.thumbstick=o.getObjectByName("stick"),e.trigger=o.getObjectByName("buttonTrigger"),this.originalXRotationTrigger=e.trigger.rotation.x,e.xbutton=o.getObjectByName("buttonX"),e.abutton=o.getObjectByName("buttonA"),e.ybutton=o.getObjectByName("buttonY"),e.bbutton=o.getObjectByName("buttonB"),o.position.copy(this.displayModel[this.data.hand].modelPivotOffset),o.rotation.copy(this.displayModel[this.data.hand].modelPivotRotation),this.el.emit("controllermodelready",{name:"oculus-touch-controls",model:this.data.model,rayOrigin:this.displayModel[this.data.hand].rayOrigin}))},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping[this.data.hand].axes,t)},updateModel:function(t,e){this.data.model&&this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var o,n="up"===e||"touchend"===e?this.data.buttonColor:"touchstart"===e?this.data.buttonTouchColor:this.data.buttonHighlightColor,i=this.buttonMeshes;this.data.model&&i&&i[t]&&(o=i[t],o.material.color.set(n),this.rendererSystem.applyColorCorrection(o.material.color))}});
- },{"../core/component":128,"../lib/three":176,"../utils/":202,"../utils/bind":196,"../utils/tracked-controls":210}],93:[function(_dereq_,module,exports){
- 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)},remove:function(){this.el.object3D.position.set(0,0,0)}});
- },{"../core/component":128}],94:[function(_dereq_,module,exports){
- 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/"),warn=utils.debug("components:raycaster:warn"),OBSERVER_SELECTOR_RE=/^[\w\s-.,[\]#]*$/,OBSERVER_CONFIG={childList:!0,attributes:!0,subtree:!0},EVENTS={INTERSECT:"raycaster-intersected",INTERSECTION:"raycaster-intersection",INTERSECT_CLEAR:"raycaster-intersected-cleared",INTERSECTION_CLEAR:"raycaster-intersection-cleared"};module.exports.Component=registerComponent("raycaster",{schema:{autoRefresh:{default:!0},direction:{type:"vec3",default:{x:0,y:0,z:-1}},enabled:{default:!0},far:{default:1e3},interval:{default:0},near:{default:0},objects:{default:""},origin:{type:"vec3"},showLine:{default:!1},useWorldCoordinates:{default:!1}},multiple:!0,init:function(){this.clearedIntersectedEls=[],this.unitLineEndVec3=new THREE.Vector3,this.intersectedEls=[],this.intersections=[],this.newIntersectedEls=[],this.newIntersections=[],this.objects=[],this.prevCheckTime=void 0,this.prevIntersectedEls=[],this.rawIntersections=[],this.raycaster=new THREE.Raycaster,this.updateOriginDirection(),this.setDirty=this.setDirty.bind(this),this.updateLine=this.updateLine.bind(this),this.observer=new MutationObserver(this.setDirty),this.dirty=!0,this.lineEndVec3=new THREE.Vector3,this.otherLineEndVec3=new THREE.Vector3,this.lineData={end:this.lineEndVec3},this.getIntersection=this.getIntersection.bind(this),this.intersectedDetail={el:this.el,getIntersection:this.getIntersection},this.intersectedClearedDetail={el:this.el},this.intersectionClearedDetail={clearedEls:this.clearedIntersectedEls},this.intersectionDetail={}},update:function(e){var t=this.data,i=this.el,s=this.raycaster;s.far=t.far,s.near=t.near,!t.showLine||t.far===e.far&&t.origin===e.origin&&t.direction===e.direction&&e.showLine||(this.unitLineEndVec3.copy(t.origin).add(t.direction).normalize(),this.drawLine()),!t.showLine&&e.showLine&&i.removeAttribute("line"),t.objects===e.objects||OBSERVER_SELECTOR_RE.test(t.objects)||warn('[raycaster] Selector "'+t.objects+'" may not update automatically with DOM changes.'),t.objects||warn('[raycaster] For performance, please define raycaster.objects when using raycaster or cursor components to whitelist which entities to intersect with. e.g., raycaster="objects: [data-raycastable]".'),t.autoRefresh!==e.autoRefresh&&i.isPlaying&&(t.autoRefresh?this.addEventListeners():this.removeEventListeners()),e.enabled&&!t.enabled&&this.clearAllIntersections(),this.setDirty()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){this.data.showLine&&this.el.removeAttribute("line"),this.clearAllIntersections()},addEventListeners:function(){this.data.autoRefresh&&(this.observer.observe(this.el.sceneEl,OBSERVER_CONFIG),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty))},removeEventListeners:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},setDirty:function(){this.dirty=!0},refreshObjects:function(){var e,t=this.data;e=t.objects?this.el.sceneEl.querySelectorAll(t.objects):this.el.sceneEl.querySelectorAll("*"),this.objects=this.flattenObject3DMaps(e),this.dirty=!1},tick:function(e){var t=this.data,i=this.prevCheckTime;t.enabled&&(i&&e-i<t.interval||(this.prevCheckTime=e,this.checkIntersections()))},checkIntersections:function(){var e,t,i=this.clearedIntersectedEls,s=this.el,n=this.data,r=this.intersectedEls,c=this.intersections,o=this.newIntersectedEls,a=this.newIntersections,h=this.prevIntersectedEls,l=this.rawIntersections;for(this.dirty&&this.refreshObjects(),copyArray(this.prevIntersectedEls,this.intersectedEls),this.updateOriginDirection(),l.length=0,this.raycaster.intersectObjects(this.objects,!0,l),c.length=0,r.length=0,e=0;e<l.length;e++)t=l[e],n.showLine&&t.object===s.getObject3D("line")||t.object.el&&(c.push(t),r.push(t.object.el));for(a.length=0,o.length=0,e=0;e<c.length;e++)-1===h.indexOf(c[e].object.el)&&(a.push(c[e]),o.push(c[e].object.el));for(i.length=0,e=0;e<h.length;e++)-1===r.indexOf(h[e])&&(h[e].emit(EVENTS.INTERSECT_CLEAR,this.intersectedClearedDetail),i.push(h[e]));for(i.length&&s.emit(EVENTS.INTERSECTION_CLEAR,this.intersectionClearedDetail),e=0;e<o.length;e++)o[e].emit(EVENTS.INTERSECT,this.intersectedDetail);a.length&&(this.intersectionDetail.els=o,this.intersectionDetail.intersections=a,s.emit(EVENTS.INTERSECTION,this.intersectionDetail)),n.showLine&&setTimeout(this.updateLine)},updateLine:function(){var e,t=this.el,i=this.intersections;i.length&&(e=i[0].object.el===t&&i[1]?i[1].distance:i[0].distance),this.drawLine(e)},getIntersection:function(e){var t,i;for(t=0;t<this.intersections.length;t++)if(i=this.intersections[t],i.object.el===e)return i;return null},updateOriginDirection:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(){var i=this.el,s=this.data;if(s.useWorldCoordinates)return void this.raycaster.set(s.origin,s.direction);i.object3D.updateMatrixWorld(),t.setFromMatrixPosition(i.object3D.matrixWorld),0===s.origin.x&&0===s.origin.y&&0===s.origin.z||(t=i.object3D.localToWorld(t.copy(s.origin))),e.copy(s.direction).transformDirection(i.object3D.matrixWorld).normalize(),this.raycaster.set(t,e)}}(),drawLine:function(e){var t,i=this.data,s=this.el;t=this.lineData.end===this.lineEndVec3?this.otherLineEndVec3:this.lineEndVec3,void 0===e&&(e=i.far===1/0?1e3:i.far),this.lineData.start=i.origin,this.lineData.end=t.copy(this.unitLineEndVec3).multiplyScalar(e),s.setAttribute("line",this.lineData)},flattenObject3DMaps:function(e){var t,i,s=this.objects;for(s.length=0,i=0;i<e.length;i++)if(e[i].isEntity&&e[i].object3D)for(t in e[i].object3DMap)s.push(e[i].getObject3D(t));return s},clearAllIntersections:function(){var e;for(e=0;e<this.intersectedEls.length;e++)this.intersectedEls[e].emit(EVENTS.INTERSECT_CLEAR,this.intersectedClearedDetail);copyArray(this.clearedIntersectedEls,this.intersectedEls),this.intersectedEls.length=0,this.intersections.length=0,this.el.emit(EVENTS.INTERSECTION_CLEAR,this.intersectionClearedDetail)}});
- },{"../core/component":128,"../lib/three":176,"../utils/":202}],95:[function(_dereq_,module,exports){
- 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"},remove:function(){this.el.object3D.rotation.set(0,0,0)}});
- },{"../core/component":128,"../lib/three":176}],96:[function(_dereq_,module,exports){
- 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,c=0===e.z?zeroScale:e.z;o.scale.set(t,r,c)},remove:function(){this.el.object3D.scale.set(1,1,1)}});
- },{"../core/component":128}],97:[function(_dereq_,module,exports){
- var register=_dereq_("../../core/component").registerComponent;module.exports.Component=register("background",{schema:{color:{type:"color",default:"black"},transparent:{default:!1}},update:function(){var e=this.data,r=this.el.object3D;if(e.transparent)return void(r.background=null);r.background=new THREE.Color(e.color)}});
- },{"../../core/component":128}],98:[function(_dereq_,module,exports){
- var register=_dereq_("../../core/component").registerComponent;module.exports.Component=register("debug",{schema:{default:!0}});
- },{"../../core/component":128}],99:[function(_dereq_,module,exports){
- function createPermissionDialog(e,t,i){var n,o,s;return n=document.createElement("div"),n.classList.add(DIALOG_BUTTONS_CONTAINER_CLASS),o=document.createElement("button"),o.classList.add(DIALOG_BUTTON_CLASS,DIALOG_DENY_BUTTON_CLASS),o.setAttribute(constants.AFRAME_INJECTED,""),o.innerHTML="Deny",n.appendChild(o),s=document.createElement("button"),s.classList.add(DIALOG_BUTTON_CLASS,DIALOG_ALLOW_BUTTON_CLASS),s.setAttribute(constants.AFRAME_INJECTED,""),s.innerHTML="Allow",n.appendChild(s),s.addEventListener("click",function(e){e.stopPropagation(),t()}),o.addEventListener("click",function(e){e.stopPropagation(),i()}),createDialog(e,n)}function createAlertDialog(e,t){var i,n;return i=document.createElement("div"),i.classList.add(DIALOG_BUTTONS_CONTAINER_CLASS),n=document.createElement("button"),n.classList.add(DIALOG_BUTTON_CLASS,DIALOG_OK_BUTTON_CLASS),n.setAttribute(constants.AFRAME_INJECTED,""),n.innerHTML="Close",i.appendChild(n),n.addEventListener("click",function(e){e.stopPropagation(),t()}),createDialog(e,i)}function createDialog(e,t){var i,n,o,s;return i=document.createElement("div"),i.classList.add(MODAL_CLASS),i.setAttribute(constants.AFRAME_INJECTED,""),n=document.createElement("div"),n.className=DIALOG_CLASS,n.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(n),o=document.createElement("div"),o.classList.add(DIALOG_TEXT_CONTAINER_CLASS),n.appendChild(o),s=document.createElement("div"),s.classList.add(DIALOG_TEXT_CLASS),s.innerHTML=e,o.appendChild(s),n.appendChild(t),i}var registerComponent=_dereq_("../../core/component").registerComponent,utils=_dereq_("../../utils/"),bind=utils.bind,constants=_dereq_("../../constants/"),MODAL_CLASS="a-modal",DIALOG_CLASS="a-dialog",DIALOG_TEXT_CLASS="a-dialog-text",DIALOG_TEXT_CONTAINER_CLASS="a-dialog-text-container",DIALOG_BUTTONS_CONTAINER_CLASS="a-dialog-buttons-container",DIALOG_BUTTON_CLASS="a-dialog-button",DIALOG_ALLOW_BUTTON_CLASS="a-dialog-allow-button",DIALOG_DENY_BUTTON_CLASS="a-dialog-deny-button",DIALOG_OK_BUTTON_CLASS="a-dialog-ok-button";module.exports.Component=registerComponent("device-orientation-permission-ui",{schema:{enabled:{default:!0}},init:function(){var e=this;if(this.data.enabled){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&"http:"===location.protocol&&this.showHTTPAlert(),utils.device.isMobileDeviceRequestingDesktopSite())return void this.showMobileDesktopModeAlert();if("undefined"==typeof DeviceOrientationEvent||!DeviceOrientationEvent.requestPermission)return void(this.permissionGranted=!0);this.onDeviceMotionDialogAllowClicked=bind(this.onDeviceMotionDialogAllowClicked,this),this.onDeviceMotionDialogDenyClicked=bind(this.onDeviceMotionDialogDenyClicked,this),DeviceOrientationEvent.requestPermission().catch(function(){e.devicePermissionDialogEl=createPermissionDialog("This immersive website requires access to your device motion sensors.",e.onDeviceMotionDialogAllowClicked,e.onDeviceMotionDialogDenyClicked),e.el.appendChild(e.devicePermissionDialogEl)}).then(function(){e.el.emit("deviceorientationpermissiongranted"),e.permissionGranted=!0})}},remove:function(){this.devicePermissionDialogEl&&this.el.removeChild(this.devicePermissionDialogEl)},onDeviceMotionDialogDenyClicked:function(){this.remove()},showMobileDesktopModeAlert:function(){var e=this,t=createAlertDialog("Set your browser to request the mobile version of the site and reload the page to enjoy immersive mode.",function(){e.el.removeChild(t)});this.el.appendChild(t)},showHTTPAlert:function(){var e=this,t=createAlertDialog("Access this site over HTTPS to enter VR mode and grant access to the device sensors.",function(){e.el.removeChild(t)});this.el.appendChild(t)},onDeviceMotionDialogAllowClicked:function(){var e=this;this.el.emit("deviceorientationpermissionrequested"),DeviceOrientationEvent.requestPermission().then(function(t){"granted"===t?(e.el.emit("deviceorientationpermissiongranted"),e.permissionGranted=!0):e.el.emit("deviceorientationpermissionrejected"),e.remove()}).catch(console.error)}});
- },{"../../constants/":120,"../../core/component":128,"../../utils/":202}],100:[function(_dereq_,module,exports){
- 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())}});
- },{"../../core/component":128}],101:[function(_dereq_,module,exports){
- 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)}});
- },{"../../core/component":128,"../../lib/three":176,"../../utils/debug":198}],102:[function(_dereq_,module,exports){
- (function (process){
- function getFuzzyPatchVersion(e){var n=e.split(".");return n[2]="x",n.join(".")}var AFRAME_INJECTED=_dereq_("../../constants").AFRAME_INJECTED,pkg=_dereq_("../../../package"),registerComponent=_dereq_("../../core/component").registerComponent,utils=_dereq_("../../utils/"),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.firstPlay=!0,this.onKeydown=this.onKeydown.bind(this),this.onMessage=this.onMessage.bind(this),this.initOverlay(),window.addEventListener("keydown",this.onKeydown),window.addEventListener("message",this.onMessage)},play:function(){var e;this.firstPlay&&"false"!==(e=utils.getUrlParameter("inspector"))&&e&&(this.openInspector(),this.firstPlay=!1)},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){73===e.keyCode&&e.ctrlKey&&e.altKey&&this.openInspector()},showLoader:function(){document.body.appendChild(this.loadingMessageEl)},hideLoader:function(){document.body.removeChild(this.loadingMessageEl)},onMessage:function(e){"INJECT_AFRAME_INSPECTOR"===e.data&&this.openInspector()},openInspector:function(e){var n,t=this;if(AFRAME.INSPECTOR||AFRAME.inspectorInjected)return void AFRAME.INSPECTOR.open(e);this.showLoader(),n=document.createElement("script"),n.src=this.data.url,n.setAttribute("data-name","aframe-inspector"),n.setAttribute(AFRAME_INJECTED,""),n.onload=function(){AFRAME.INSPECTOR.open(e),t.hideLoader(),t.removeEventListeners()},n.onerror=function(){t.loadingMessageEl.innerHTML=LOADING_ERROR_MESSAGE},document.head.appendChild(n),AFRAME.inspectorInjected=!0},removeEventListeners:function(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("message",this.onMessage)}});
- }).call(this,_dereq_('_process'))
- },{"../../../package":72,"../../constants":120,"../../core/component":128,"../../utils/":202,"_process":49}],103:[function(_dereq_,module,exports){
- 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(){this.onKeyup=this.onKeyup.bind(this)},update:function(e){var t=this.data;this.enterVREnabled=t.enterVR},play:function(){window.addEventListener("keyup",this.onKeyup,!1)},pause:function(){window.removeEventListener("keyup",this.onKeyup)},onKeyup:function(e){var t=this.el;shouldCaptureKeyEvent(e)&&(this.enterVREnabled&&70===e.keyCode&&t.enterVR(),this.enterVREnabled&&27===e.keyCode&&t.exitVR())}});
- },{"../../core/component":128,"../../utils/":202}],104:[function(_dereq_,module,exports){
- var debug=_dereq_("../../utils/debug"),registerComponent=_dereq_("../../core/component").registerComponent,warn=debug("components:pool:warn");module.exports.Component=registerComponent("pool",{schema:{container:{default:""},mixin:{default:""},size:{default:0},dynamic:{default:!1}},multiple:!0,initPool:function(){var t;for(this.availableEls=[],this.usedEls=[],this.data.mixin||warn("No mixin provided for pool component."),this.data.container&&(this.container=document.querySelector(this.data.container),this.container||warn("Container "+this.data.container+" not found.")),this.container=this.container||this.el,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;t=document.createElement("a-entity"),t.play=this.wrapPlay(t.play),t.setAttribute("mixin",this.data.mixin),t.object3D.visible=!1,t.pause(),this.container.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.attrName);warn("Requested entity from empty pool. This pool is dynamic and will resize automatically. You might want to increase its initial size: "+this.attrName),this.createEntity()}return t=this.availableEls.shift(),this.usedEls.push(t),t.object3D.visible=!0,t},returnEntity:function(t){var i=this.usedEls.indexOf(t);return-1===i?void warn("The returned entity was not previously pooled from "+this.attrName):(this.usedEls.splice(i,1),this.availableEls.push(t),t.object3D.visible=!1,t.pause(),t)}});
- },{"../../core/component":128,"../../utils/debug":198}],105:[function(_dereq_,module,exports){
- 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},camera:{type:"selector"}},init:function(){function e(){var e=t.renderer.getContext();e&&(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.object3D.add(a.quad),a.onKeyDown=a.onKeyDown.bind(a))}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)},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,r,i=this.el;return"perspective"===e?(this.quad.visible=!1,a=this.data.camera&&this.data.camera.components.camera.camera||i.camera,t={width:this.data.width,height:this.data.height}):(a=this.camera,r=new THREE.CubeCamera(i.camera.near,i.camera.far,Math.min(this.cubeMapSize,2048)),i.camera.getWorldPosition(r.position),i.camera.getWorldQuaternion(r.quaternion),r.update(i.renderer,i.object3D),this.quad.material.uniforms.map.value=r.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,a=this.el.renderer.xr.enabled,r=this.el.renderer;r.xr.enabled=!1,t=this.setCapture(e),this.renderCapture(t.camera,t.size,t.projection),this.saveCapture(),r.xr.enabled=a},getCanvas:function(e){var t=this.el.renderer.xr.enabled,a=this.el.renderer,r=this.setCapture(e);return a.xr.enabled=!1,this.renderCapture(r.camera,r.size,r.projection),a.xr.enabled=t,this.canvas},renderCapture:function(e,t,a){var r,i,n,o=this.el.renderer.autoClear,d=this.el,s=d.renderer;i=this.getRenderTarget(t.width,t.height),n=new Uint8Array(4*t.width*t.height),this.resize(t.width,t.height),s.autoClear=!0,s.clear(),s.setRenderTarget(i),s.render(d.object3D,e),s.autoClear=o,s.readRenderTargetPixels(i,0,0,t.width,t.height,n),s.setRenderTarget(null),"perspective"===a&&(n=this.flipPixelsVertically(n,t.width,t.height)),r=new ImageData(new Uint8ClampedArray(n),t.width,t.height),this.quad.visible=!1,this.ctx.putImageData(r,0,0)},flipPixelsVertically:function(e,t,a){for(var r=e.slice(0),i=0;i<t;++i)for(var n=0;n<a;++n)r[4*i+n*t*4]=e[4*i+(a-n)*t*4],r[4*i+1+n*t*4]=e[4*i+1+(a-n)*t*4],r[4*i+2+n*t*4]=e[4*i+2+(a-n)*t*4],r[4*i+3+n*t*4]=e[4*i+3+(a-n)*t*4];return r},saveCapture:function(){this.canvas.toBlob(function(e){var t="screenshot-"+document.title.toLowerCase()+"-"+Date.now()+".png",a=document.createElement("a"),r=URL.createObjectURL(e);a.href=r,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")}});
- },{"../../core/component":128,"../../lib/three":176}],106:[function(_dereq_,module,exports){
- 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)}});
- },{"../../../vendor/rStats":213,"../../../vendor/rStats.extras":212,"../../core/component":128,"../../lib/rStatsAframe":175,"../../utils":202}],107:[function(_dereq_,module,exports){
- function createEnterVRButton(t){var e,n;return n=document.createElement("div"),n.classList.add(ENTER_VR_CLASS),n.setAttribute(constants.AFRAME_INJECTED,""),e=document.createElement("button"),e.className=ENTER_VR_BTN_CLASS,e.setAttribute("title","Enter VR mode with a headset or fullscreen mode on a desktop. Visit https://webvr.rocks or https://webvr.info for more information."),e.setAttribute(constants.AFRAME_INJECTED,""),utils.device.isMobile()&&applyStickyHoverFix(e),n.appendChild(e),e.addEventListener("click",function(e){t(),e.stopPropagation()}),n}function createEnterARButton(t){var e,n;return n=document.createElement("div"),n.classList.add(ENTER_AR_CLASS),n.setAttribute(constants.AFRAME_INJECTED,""),e=document.createElement("button"),e.className=ENTER_AR_BTN_CLASS,e.setAttribute("title","Enter AR mode with a headset or handheld device. Visit https://webvr.rocks or https://webvr.info for more information."),e.setAttribute(constants.AFRAME_INJECTED,""),utils.device.isMobile()&&applyStickyHoverFix(e),n.appendChild(e),e.addEventListener("click",function(e){t(),e.stopPropagation()}),n}function createOrientationModal(t){var e=document.createElement("div");e.className=ORIENTATION_MODAL_CLASS,e.classList.add(HIDDEN_CLASS),e.setAttribute(constants.AFRAME_INJECTED,"");var n=document.createElement("button");return n.setAttribute(constants.AFRAME_INJECTED,""),n.innerHTML="Exit VR",n.addEventListener("click",t),e.appendChild(n),e}function applyStickyHoverFix(t){t.addEventListener("touchstart",function(){t.classList.remove("resethover")}),t.addEventListener("touchend",function(){t.classList.add("resethover")})}var registerComponent=_dereq_("../../core/component").registerComponent,constants=_dereq_("../../constants/"),utils=_dereq_("../../utils/"),bind=utils.bind,ENTER_VR_CLASS="a-enter-vr",ENTER_AR_CLASS="a-enter-ar",ENTER_VR_BTN_CLASS="a-enter-vr-button",ENTER_AR_BTN_CLASS="a-enter-ar-button",HIDDEN_CLASS="a-hidden",ORIENTATION_MODAL_CLASS="a-orientation-modal";module.exports.Component=registerComponent("vr-mode-ui",{dependencies:["canvas"],schema:{enabled:{default:!0},enterVRButton:{default:""},enterARButton:{default:""}},init:function(){var t=this,e=this.el;"false"!==utils.getUrlParameter("ui")&&(this.insideLoader=!1,this.enterVREl=null,this.enterAREl=null,this.orientationModalEl=null,this.bindMethods(),e.addEventListener("enter-vr",this.updateEnterInterfaces),e.addEventListener("exit-vr",this.updateEnterInterfaces),e.addEventListener("update-vr-devices",this.updateEnterInterfaces),window.addEventListener("message",function(e){"loaderReady"===e.data.type&&(t.insideLoader=!0,t.remove())}),window.addEventListener("orientationchange",this.toggleOrientationModalIfNeeded))},bindMethods:function(){this.onEnterVRButtonClick=bind(this.onEnterVRButtonClick,this),this.onEnterARButtonClick=bind(this.onEnterARButtonClick,this),this.onModalClick=bind(this.onModalClick,this),this.toggleOrientationModalIfNeeded=bind(this.toggleOrientationModalIfNeeded,this),this.updateEnterInterfaces=bind(this.updateEnterInterfaces,this)},onModalClick:function(){this.el.exitVR()},onEnterVRButtonClick:function(){this.el.enterVR()},onEnterARButtonClick:function(){this.el.enterAR()},update:function(){var t=this.data,e=this.el;if(!t.enabled||this.insideLoader||"false"===utils.getUrlParameter("ui"))return this.remove();this.enterVREl||this.enterAREl||this.orientationModalEl||(t.enterVRButton?(this.enterVREl=document.querySelector(t.enterVRButton),this.enterVREl.addEventListener("click",this.onEnterVRButtonClick)):(this.enterVREl=createEnterVRButton(this.onEnterVRButtonClick),e.appendChild(this.enterVREl)),t.enterARButton?(this.enterAREl=document.querySelector(t.enterARButton),this.enterAREl.addEventListener("click",this.onEnterARButtonClick)):(this.enterAREl=createEnterARButton(this.onEnterARButtonClick),e.appendChild(this.enterAREl)),this.orientationModalEl=createOrientationModal(this.onModalClick),e.appendChild(this.orientationModalEl),this.updateEnterInterfaces())},remove:function(){[this.enterVREl,this.enterAREl,this.orientationModalEl].forEach(function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})},updateEnterInterfaces:function(){this.toggleEnterVRButtonIfNeeded(),this.toggleEnterARButtonIfNeeded(),this.toggleOrientationModalIfNeeded()},toggleEnterVRButtonIfNeeded:function(){var t=this.el;this.enterVREl&&(t.is("vr-mode")?this.enterVREl.classList.add(HIDDEN_CLASS):this.enterVREl.classList.remove(HIDDEN_CLASS))},toggleEnterARButtonIfNeeded:function(){var t=this.el;this.enterAREl&&(t.is("vr-mode")||!utils.device.checkARSupport()?this.enterAREl.classList.add(HIDDEN_CLASS):this.enterAREl.classList.remove(HIDDEN_CLASS))},toggleOrientationModalIfNeeded:function(){var t=this.el,e=this.orientationModalEl;e&&t.isMobile&&(!utils.device.isLandscape()&&t.is("vr-mode")?e.classList.remove(HIDDEN_CLASS):e.classList.add(HIDDEN_CLASS))}});
- },{"../../constants/":120,"../../core/component":128,"../../utils/":202}],108:[function(_dereq_,module,exports){
- 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=Array.isArray(s.material)?s.material:[s.material],i=0;i<a.length;i++)a[i].needsUpdate=!0})}});
- },{"../core/component":128,"../lib/three":176,"../utils/bind":196}],109:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,debug=_dereq_("../utils/debug"),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(){var e=this;this.listener=null,this.audioLoader=new THREE.AudioLoader,this.pool=new THREE.Group,this.loaded=!1,this.mustPlay=!1,this.playSoundBound=function(){e.playSound()}},update:function(e){var t,o,i=this.data,n=i.src!==e.src;if(n){if(!i.src)return;this.setupSound()}for(t=0;t<this.pool.children.length;t++)o=this.pool.children[t],i.positional&&(o.setDistanceModel(i.distanceModel),o.setMaxDistance(i.maxDistance),o.setRefDistance(i.refDistance),o.setRolloffFactor(i.rolloffFactor)),o.setLoop(i.loop),o.setVolume(i.volume),o.isPaused=!1;if(i.on!==e.on&&this.updateEventListener(e.on),n){var s=this;this.loaded=!1,this.audioLoader.load(i.src,function(e){for(t=0;t<s.pool.children.length;t++)o=s.pool.children[t],o.setBuffer(e);s.loaded=!0,THREE.Cache.remove(i.src),(s.data.autoplay||s.mustPlay)&&s.playSound(),s.el.emit("sound-loaded",s.evtDetail,!1)})}},pause:function(){this.stopSound(),this.removeEventListener()},play:function(){this.data.autoplay&&this.playSound(),this.updateEventListener()},remove:function(){var e,t;this.removeEventListener(),this.el.getObject3D(this.attrName)&&this.el.removeObject3D(this.attrName);try{for(e=0;e<this.pool.children.length;e++)t=this.pool.children[e],t.disconnect()}catch(e){warn("Audio source not properly disconnected")}},updateEventListener:function(e){var t=this.el;e&&t.removeEventListener(e,this.playSoundBound),t.addEventListener(this.data.on,this.playSoundBound)},removeEventListener:function(){this.el.removeEventListener(this.data.on,this.playSoundBound)},setupSound:function(){var e,t,o=this.el,i=o.sceneEl,n=this;this.pool.children.length>0&&(this.stopSound(),o.removeObject3D("sound"));var s=this.listener=i.audioListener||new THREE.AudioListener;for(i.audioListener=s,i.camera&&i.camera.add(s),i.addEventListener("camera-set-active",function(e){e.detail.cameraEl.getObject3D("camera").add(s)}),this.pool=new THREE.Group,e=0;e<this.data.poolSize;e++)t=this.data.positional?new THREE.PositionalAudio(s):new THREE.Audio(s),this.pool.add(t);for(o.setObject3D(this.attrName,this.pool),e=0;e<this.pool.children.length;e++)t=this.pool.children[e],t.onEnded=function(){this.isPlaying=!1,n.el.emit("sound-ended",n.evtDetail,!1)}},pauseSound:function(){var e,t;for(this.isPlaying=!1,e=0;e<this.pool.children.length;e++)t=this.pool.children[e],t.source&&t.source.buffer&&t.isPlaying&&!t.isPaused&&(t.isPaused=!0,t.pause())},playSound:function(e){var t,o,i;if(!this.loaded)return warn("Sound not loaded yet. It will be played once it finished loading"),void(this.mustPlay=!0);for(t=!1,this.isPlaying=!0,o=0;o<this.pool.children.length;o++)i=this.pool.children[o],i.isPlaying||!i.buffer||t||(e&&e(i),i.play(),i.isPaused=!1,t=!0);if(!t)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(){var e,t;for(this.isPlaying=!1,e=0;e<this.pool.children.length;e++){if(t=this.pool.children[e],!t.source||!t.source.buffer)return;t.stop()}}});
- },{"../core/component":128,"../lib/three":176,"../utils/debug":198}],110:[function(_dereq_,module,exports){
- function parseSide(t){switch(t){case"back":return THREE.FrontSide;case"double":return THREE.DoubleSide;default:return THREE.BackSide}}function loadFont(t,e){return new Promise(function(r,n){loadBMFont(t,function(o,a){if(o)return error("Error loading font",t),void n(o);t.indexOf("/Roboto-msdf.json")>=0&&(e=30),e&&a.chars.map(function(t){t.yoffset+=e}),r(a)})})}function loadTexture(t){return new Promise(function(e,r){(new THREE.ImageLoader).load(t,function(t){e(t)},void 0,function(){error("Error loading font image",t),r(null)})})}function createShader(t,e,r){var n,o;return o=new shaders[e].Shader,o.el=t,o.init(r),o.update(r),n=o.material,n.transparent=r.transparent,{material:n,shader:o}}function computeWidth(t,e,r){return t||(.5+e)*r}function computeFontWidthFactor(t){var e=0,r=0,n=0;return t.chars.map(function(t){e+=t.xadvance,t.id>=48&&t.id<=57&&(n++,r+=t.xadvance)}),n?r/n:e/t.chars.length}function PromiseCache(){var t=this.cache={};this.get=function(e,r){return e in t?t[e]:(t[e]=r(),t[e])}}var createTextGeometry=_dereq_("three-bmfont-text"),loadBMFont=_dereq_("load-bmfont"),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={},textures={},protocolRe=/^\w+:/;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"},negate:{type:"boolean",default:!0},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"},xOffset:{type:"number",default:0},yOffset:{type:"number",default:0},zOffset:{type:"number",default:.001}},init:function(){this.shaderData={},this.geometry=createTextGeometry(),this.createOrUpdateMaterial(),this.mesh=new THREE.Mesh(this.geometry,this.material),this.el.setObject3D(this.attrName,this.mesh)},update:function(t){var e=this.data,r=this.currentFont;if(textures[e.font]?this.texture=textures[e.font]:(this.texture=textures[e.font]=new THREE.Texture,this.texture.anisotropy=MAX_ANISOTROPY),this.createOrUpdateMaterial(),t.font!==e.font)return void this.updateFont();r&&(this.updateGeometry(this.geometry,r),this.updateLayout())},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 t,e,r,n=this.data,o=this.material,a=this.shaderData;if(r=n.shader,-1!==MSDF_FONTS.indexOf(n.font)||n.font.indexOf("-msdf.")>=0?r="msdf":n.font in FONTS&&-1===MSDF_FONTS.indexOf(n.font)&&(r="sdf"),t=(this.shaderObject&&this.shaderObject.name)!==r,a.alphaTest=n.alphaTest,a.color=n.color,a.map=this.texture,a.opacity=n.opacity,a.side=parseSide(n.side),a.transparent=n.transparent,a.negate=n.negate,!t)return this.shaderObject.update(a),o.transparent=a.transparent,void(o.side=a.side);e=createShader(this.el,r,a),this.material=e.material,this.shaderObject=e.shader,this.material.side=a.side,this.mesh&&(this.mesh.material=this.material)},updateFont:function(){var t,e=this.data,r=this.el,n=this.geometry,o=this;e.font||warn("No font specified. Using the default font."),this.mesh.visible=!1,t=this.lookupFont(e.font||DEFAULT_FONT)||e.font,cache.get(t,function(){return loadFont(t,e.yOffset)}).then(function(a){var i;if(1!==a.pages.length)throw new Error("Currently only single-page bitmap fonts are supported.");fontWidthFactors[t]||(a.widthFactor=fontWidthFactors[a]=computeFontWidthFactor(a)),o.updateGeometry(n,a),o.currentFont=a,o.updateLayout(),i=o.getFontImageSrc(),cache.get(i,function(){return loadTexture(i)}).then(function(t){var n=o.texture;n.image=t,n.needsUpdate=!0,textures[e.font]=n,o.texture=n,o.mesh.visible=!0,r.emit("textfontset",{font:e.font,fontObj:a})}).catch(function(t){error(t.message),error(t.stack)})}).catch(function(t){error(t.message),error(t.stack)})},getFontImageSrc:function(){if(this.data.fontImage)return this.data.fontImage;var t=this.lookupFont(this.data.font||DEFAULT_FONT)||this.data.font,e=this.currentFont.pages[0];return e.match(protocolRe)&&0!==e.indexOf("http")?t.replace(/(\.fnt)|(\.json)/,".png"):THREE.LoaderUtils.extractUrlBase(t)+e},updateLayout:function(){var t,e,r,n,o,a,i,s,h,u,d=this.el,l=this.data,f=this.geometry,c=this.mesh;if(f.layout){if(r=d.getAttribute("geometry"),s=l.width||r&&r.width||DEFAULT_WIDTH,a=computeWidth(l.wrapPixels,l.wrapCount,this.currentFont.widthFactor),i=s/a,o=f.layout,n=i*(o.height+o.descender),r&&"plane"===r.primitive&&(r.width||d.setAttribute("geometry","width",s),r.height||d.setAttribute("geometry","height",n)),"left"===(t="align"===l.anchor?l.align:l.anchor))h=0;else if("right"===t)h=-1*o.width;else{if("center"!==t)throw new TypeError("Invalid text.anchor property value",t);h=-1*o.width/2}if("bottom"===(e=l.baseline))u=0;else if("top"===e)u=-1*o.height+o.ascender;else{if("center"!==e)throw new TypeError("Invalid text.baseline property value",e);u=-1*o.height/2}c.position.x=h*i+l.xOffset,c.position.y=u*i,c.position.z=l.zOffset,c.scale.set(i,-1*i,i)}},lookupFont:function(t){return FONTS[t]},updateGeometry:function(){var t={},e={},r=/\\n/g,n=/\\t/g;return function(o,a){var i=this.data;e.font=a,e.lineHeight=i.lineHeight&&isFinite(i.lineHeight)?i.lineHeight:a.common.lineHeight,e.text=i.value.toString().replace(r,"\n").replace(n,"\t"),e.width=computeWidth(i.wrapPixels,i.wrapCount,a.widthFactor),o.update(utils.extend(t,i,e))}}()});
- },{"../core/component":128,"../core/shader":138,"../lib/three":176,"../utils/":202,"load-bmfont":37,"three-bmfont-text":62}],111:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,controllerUtils=_dereq_("../utils/tracked-controls"),DEFAULT_CAMERA_HEIGHT=_dereq_("../constants").DEFAULT_CAMERA_HEIGHT,THREE=_dereq_("../lib/three"),DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,EYES_TO_ELBOW={x:.175,y:-.3,z:-.03},FOREARM={x:0,y:0,z:-.175},EMPTY_DAYDREAM_TOUCHES={touches:[]},EVENTS={AXISMOVE:"axismove",BUTTONCHANGED:"buttonchanged",BUTTONDOWN:"buttondown",BUTTONUP:"buttonup",TOUCHSTART:"touchstart",TOUCHEND:"touchend"};module.exports.Component=registerComponent("tracked-controls-webvr",{schema:{autoHide:{default:!0},controller:{default:0},id:{type:"string",default:""},hand:{type:"string",default:""},idPrefix:{type:"string",default:""},orientationOffset:{type:"vec3"},armModel:{default:!1},headElement:{type:"selector"}},init:function(){this.axis=this.el.components["tracked-controls"].axis=[0,0,0],this.buttonStates=this.el.components["tracked-controls"].buttonStates={},this.changedAxes=[],this.targetControllerNumber=this.data.controller,this.axisMoveEventDetail={axis:this.axis,changed:this.changedAxes},this.deltaControllerPosition=new THREE.Vector3,this.controllerQuaternion=new THREE.Quaternion,this.controllerEuler=new THREE.Euler,this.updateGamepad(),this.buttonEventDetails={}},tick:function(t,e){var i=this.el.getObject3D("mesh");i&&i.update&&i.update(e/1e3),this.updateGamepad(),this.updatePose(),this.updateButtons()},defaultUserHeight:function(){return DEFAULT_CAMERA_HEIGHT},getHeadElement:function(){return this.data.headElement||this.el.sceneEl.camera.el},updateGamepad:function(){var t=this.data,e=controllerUtils.findMatchingControllerWebVR(this.system.controllers,t.id,t.idPrefix,t.hand,t.controller);this.controller=e,this.el.components["tracked-controls"].controller=e,this.data.autoHide&&(this.el.object3D.visible=!!this.controller)},applyArmModel:function(t){var e,i,o,n,s,a=this.controller,r=this.controllerEuler,l=this.controllerQuaternion,h=this.deltaControllerPosition;i=this.getHeadElement(),o=i.object3D,s=this.defaultUserHeight(),n=a.pose,e=(a?a.hand:void 0)||DEFAULT_HANDEDNESS,t.copy(o.position),h.set(EYES_TO_ELBOW.x*("left"===e?-1:"right"===e?1:0),EYES_TO_ELBOW.y,EYES_TO_ELBOW.z),h.multiplyScalar(s),h.applyAxisAngle(o.up,o.rotation.y),t.add(h),h.set(FOREARM.x,FOREARM.y,FOREARM.z),h.multiplyScalar(s),n.orientation?l.fromArray(n.orientation):l.copy(o.quaternion),r.setFromQuaternion(l),r.set(r.x,r.y,0),h.applyEuler(r),t.add(h)},updatePose:function(){var t,e,i=this.controller,o=this.data,n=this.el.object3D,s=this.system.vrDisplay;i&&(t=i.pose,t.position?n.position.fromArray(t.position):o.armModel&&this.applyArmModel(n.position),t.orientation&&n.quaternion.fromArray(t.orientation),s&&t.position&&(e=this.el.sceneEl.renderer.xr.getStandingMatrix(),n.matrix.compose(n.position,n.quaternion,n.scale),n.matrix.multiplyMatrices(e,n.matrix),n.matrix.decompose(n.position,n.quaternion,n.scale)),n.rotateX(this.data.orientationOffset.x*THREE.Math.DEG2RAD),n.rotateY(this.data.orientationOffset.y*THREE.Math.DEG2RAD),n.rotateZ(this.data.orientationOffset.z*THREE.Math.DEG2RAD))},updateButtons:function(){var t,e,i=this.controller;if(i){for(e=0;e<i.buttons.length;++e)this.buttonStates[e]||(this.buttonStates[e]={pressed:!1,touched:!1,value:0}),this.buttonEventDetails[e]||(this.buttonEventDetails[e]={id:e,state:this.buttonStates[e]}),t=i.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(EVENTS.BUTTONCHANGED,this.buttonEventDetails[t],!1),!0)},handleAxes:function(){var t,e=!1,i=this.controller.axes,o=this.axis,n=this.changedAxes;for(this.changedAxes.splice(0,this.changedAxes.length),t=0;t<i.length;++t)n.push(o[t]!==i[t]),n[t]&&(e=!0);if(!e)return!1;for(this.axis.splice(0,this.axis.length),t=0;t<i.length;t++)this.axis.push(i[t]);return this.el.emit(EVENTS.AXISMOVE,this.axisMoveEventDetail,!1),!0},handlePress:function(t,e){var i,o=this.buttonStates[t];return e.pressed!==o.pressed&&(i=e.pressed?EVENTS.BUTTONDOWN:EVENTS.BUTTONUP,this.el.emit(i,this.buttonEventDetails[t],!1),o.pressed=e.pressed,!0)},handleTouch:function(t,e){var i,o=this.buttonStates[t];return e.touched!==o.touched&&(i=e.touched?EVENTS.TOUCHSTART:EVENTS.TOUCHEND,this.el.emit(i,this.buttonEventDetails[t],!1,EMPTY_DAYDREAM_TOUCHES),o.touched=e.touched,!0)},handleValue:function(t,e){var i=this.buttonStates[t];return e.value!==i.value&&(i.value=e.value,!0)}});
- },{"../constants":120,"../core/component":128,"../lib/three":176,"../utils/tracked-controls":210}],112:[function(_dereq_,module,exports){
- var controllerUtils=_dereq_("../utils/tracked-controls"),registerComponent=_dereq_("../core/component").registerComponent,EVENTS={AXISMOVE:"axismove",BUTTONCHANGED:"buttonchanged",BUTTONDOWN:"buttondown",BUTTONUP:"buttonup",TOUCHSTART:"touchstart",TOUCHEND:"touchend"};module.exports.Component=registerComponent("tracked-controls-webxr",{schema:{id:{type:"string",default:""},hand:{type:"string",default:""},index:{type:"int",default:-1},iterateControllerProfiles:{default:!1}},init:function(){this.addSessionEventListeners=this.addSessionEventListeners.bind(this),this.updateController=this.updateController.bind(this),this.emitButtonUpEvent=this.emitButtonUpEvent.bind(this),this.emitButtonDownEvent=this.emitButtonDownEvent.bind(this),this.selectEventDetails={id:"trigger",state:{pressed:!1}},this.buttonEventDetails={},this.buttonStates=this.el.components["tracked-controls"].buttonStates={},this.axis=this.el.components["tracked-controls"].axis=[0,0,0],this.changedAxes=[],this.axisMoveEventDetail={axis:this.axis,changed:this.changedAxes}},update:function(){this.updateController()},play:function(){var t=this.el.sceneEl;this.updateController(),this.addSessionEventListeners(),t.addEventListener("enter-vr",this.addSessionEventListeners),t.addEventListener("controllersupdated",this.updateController)},pause:function(){var t=this.el.sceneEl;this.removeSessionEventListeners(),t.removeEventListener("enter-vr",this.addSessionEventListeners),t.removeEventListener("controllersupdated",this.updateController)},addSessionEventListeners:function(){var t=this.el.sceneEl;t.xrSession&&(t.xrSession.addEventListener("selectstart",this.emitButtonDownEvent),t.xrSession.addEventListener("selectend",this.emitButtonUpEvent))},removeSessionEventListeners:function(){var t=this.el.sceneEl;t.xrSession&&(t.xrSession.removeEventListener("selectstart",this.emitButtonDownEvent),t.xrSession.removeEventListener("selectend",this.emitButtonUpEvent))},isControllerPresent:function(t){return!(!this.controller||this.controller.gamepad)&&("none"===t.inputSource.handedness||t.inputSource.handedness===this.data.hand)},emitButtonDownEvent:function(t){this.isControllerPresent(t)&&(this.selectEventDetails.state.pressed=!0,this.el.emit("buttondown",this.selectEventDetails),this.el.emit("buttonchanged",this.selectEventDetails),this.el.emit("triggerdown"))},emitButtonUpEvent:function(t){this.isControllerPresent(t)&&(this.selectEventDetails.state.pressed=!1,this.el.emit("buttonup",this.selectEventDetails),this.el.emit("buttonchanged",this.selectEventDetails),this.el.emit("triggerup"))},updateController:function(){this.controller=controllerUtils.findMatchingControllerWebXR(this.system.controllers,this.data.id,this.data.hand,this.data.index,this.data.iterateControllerProfiles),this.el.components["tracked-controls"].controller=this.controller,this.data.autoHide&&(this.el.object3D.visible=!!this.controller)},tick:function(){var t=this.el.sceneEl;this.controller&&t.frame&&this.system.referenceSpace&&(this.pose=t.frame.getPose(this.controller.targetRaySpace,this.system.referenceSpace),this.updatePose(),this.updateButtons())},updatePose:function(){var t=this.el.object3D,e=this.pose;e&&(t.matrix.elements=e.transform.matrix,t.matrix.decompose(t.position,t.rotation,t.scale))},updateButtons:function(){var t,e,s,n=this.controller;if(n&&n.gamepad){for(s=n.gamepad,e=0;e<s.buttons.length;++e)this.buttonStates[e]||(this.buttonStates[e]={pressed:!1,touched:!1,value:0}),this.buttonEventDetails[e]||(this.buttonEventDetails[e]={id:e,state:this.buttonStates[e]}),t=s.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(EVENTS.BUTTONCHANGED,this.buttonEventDetails[t],!1),!0)},handleAxes:function(){var t,e=!1,s=this.controller.gamepad.axes,n=this.axis,i=this.changedAxes;for(this.changedAxes.splice(0,this.changedAxes.length),t=0;t<s.length;++t)i.push(n[t]!==s[t]),i[t]&&(e=!0);if(!e)return!1;for(this.axis.splice(0,this.axis.length),t=0;t<s.length;t++)this.axis.push(s[t]);return this.el.emit(EVENTS.AXISMOVE,this.axisMoveEventDetail,!1),!0},handlePress:function(t,e){var s,n=this.buttonStates[t];return e.pressed!==n.pressed&&(s=e.pressed?EVENTS.BUTTONDOWN:EVENTS.BUTTONUP,this.el.emit(s,this.buttonEventDetails[t],!1),n.pressed=e.pressed,!0)},handleTouch:function(t,e){var s,n=this.buttonStates[t];return e.touched!==n.touched&&(s=e.touched?EVENTS.TOUCHSTART:EVENTS.TOUCHEND,this.el.emit(s,this.buttonEventDetails[t],!1),n.touched=e.touched,!0)},handleValue:function(t,e){var s=this.buttonStates[t];return e.value!==s.value&&(s.value=e.value,!0)}});
- },{"../core/component":128,"../utils/tracked-controls":210}],113:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("tracked-controls",{schema:{autoHide:{default:!0},controller:{default:-1},id:{type:"string",default:""},hand:{type:"string",default:""},idPrefix:{type:"string",default:""},orientationOffset:{type:"vec3"},armModel:{default:!1},headElement:{type:"selector"},iterateControllerProfiles:{default:!1}},update:function(){var e=this.data,t=this.el;t.sceneEl.hasWebXR?t.setAttribute("tracked-controls-webxr",{id:e.id,hand:e.hand,index:e.controller,iterateControllerProfiles:e.iterateControllerProfiles}):t.setAttribute("tracked-controls-webvr",e)}});
- },{"../core/component":128}],114:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),THREE=_dereq_("../lib/three"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,INDEX_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/valve/index/valve_index_",INDEX_CONTROLLER_MODEL_URL={left:INDEX_CONTROLLER_MODEL_BASE_URL+"left.gltf",right:INDEX_CONTROLLER_MODEL_BASE_URL+"right.gltf"},GAMEPAD_ID_PREFIX="valve",INDEX_CONTROLLER_POSITION_OFFSET={left:{x:-.00023692678902063457,y:.04724540367838371,z:-.061959880395271096},right:{x:.002471558599671131,y:.055765208987076195,z:-.061068168708348844}},INDEX_CONTROLLER_ROTATION_OFFSET={left:{_x:.692295102620542,_y:-.0627618864318427,_z:-.06265893149611756,_order:"XYZ"},right:{_x:.6484021229942998,_y:-.032563619881892894,_z:-.1327973171917482,_order:"XYZ"}};module.exports.Component=registerComponent("valve-index-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#FAFAFA"},buttonHighlightColor:{type:"color",default:"#22D1EE"},model:{default:!0},orientationOffset:{type:"vec3"}},mapping:{axes:{trackpad:[0,1]},buttons:["trigger","grip","joystick","abutton","abutton","system","finger1","finger2","finger3","finger4","finger5"]},init:function(){var t=this;this.controllerPresent=!1,this.lastControllerCheck=0,this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.previousButtonValues={},this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},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;checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{index:e,iterateControllerProfiles:!0,hand:t.hand})},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,controller:"right"===e.hand?1:"left"===e.hand?0:2,hand:e.hand,orientationOffset:e.orientationOffset}),this.loadModel()},loadModel:function(){var t=this.data;t.model&&this.el.setAttribute("gltf-model",""+INDEX_CONTROLLER_MODEL_URL[t.hand])},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.copy(INDEX_CONTROLLER_POSITION_OFFSET[this.data.hand]),n.rotation.copy(INDEX_CONTROLLER_ROTATION_OFFSET[this.data.hand]),this.el.emit("controllermodelready",{name:"valve-index-controlls",model:this.data.model,rayOrigin:new THREE.Vector3(0,0,0)}))},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){var n;this.data.model&&(-1!==e.indexOf("touch")||(n="up"===e?this.data.buttonColor:this.data.buttonHighlightColor,this.setButtonColor(t,n)))},setButtonColor:function(t,e){}});
- },{"../core/component":128,"../lib/three":176,"../utils/bind":196,"../utils/tracked-controls":210}],115:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("visible",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data}});
- },{"../core/component":128}],116:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,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",isWebXRAvailable=_dereq_("../utils/").device.isWebXRAvailable,GAMEPAD_ID_WEBXR="htc-vive-controller-mv",GAMEPAD_ID_WEBVR="OpenVR ",GAMEPAD_ID_PREFIX=isWebXRAvailable?GAMEPAD_ID_WEBXR:GAMEPAD_ID_WEBVR,INPUT_MAPPING_WEBVR={axes:{trackpad:[0,1]},buttons:["trackpad","trigger","grip","menu","system"]},INPUT_MAPPING_WEBXR={axes:{thumbstick:[0,1]},buttons:["trigger","grip","trackpad","none","menu"]},INPUT_MAPPING=isWebXRAvailable?INPUT_MAPPING_WEBXR:INPUT_MAPPING_WEBVR;module.exports.Component=registerComponent("vive-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#FAFAFA"},buttonHighlightColor:{type:"color",default:"#22D1EE"},model:{default:!0},orientationOffset:{type:"vec3"}},mapping:INPUT_MAPPING,init:function(){var t=this;this.controllerPresent=!1,this.lastControllerCheck=0,this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.previousButtonValues={},this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},update:function(){var t=this.data;this.controllerIndex="right"===t.hand?0:"left"===t.hand?1:2},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},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;checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{index:this.controllerIndex,hand:t.hand})},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,hand:e.hand,controller:this.controllerIndex,orientationOffset:e.orientationOffset}),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,o=this.mapping.buttons[t.detail.id],n=this.buttonMeshes;o&&("trigger"===o&&(e=t.detail.state.value,n&&n.trigger&&(n.trigger.rotation.x=-e*(Math.PI/12))),this.el.emit(o+"changed",t.detail.state))},onModelLoaded:function(t){var e,o=t.detail.model,n=this;this.data.model&&(e=this.buttonMeshes={},e.grip={left:o.getObjectByName("leftgrip"),right:o.getObjectByName("rightgrip")},e.menu=o.getObjectByName("menubutton"),e.system=o.getObjectByName("systembutton"),e.trackpad=o.getObjectByName("touchpad"),e.trigger=o.getObjectByName("trigger"),Object.keys(e).forEach(function(t){n.setButtonColor(t,n.data.buttonColor)}),o.position.set(0,-.015,.04))},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){var o;this.data.model&&(-1!==e.indexOf("touch")||(o="up"===e?this.data.buttonColor:this.data.buttonHighlightColor,this.setButtonColor(t,o)))},setButtonColor:function(t,e){var o=this.buttonMeshes,n=this.rendererSystem;if(o){if("grip"===t)return o.grip.left.material.color.set(e),o.grip.right.material.color.set(e),n.applyColorCorrection(o.grip.left.material.color),void n.applyColorCorrection(o.grip.right.material.color);o[t].material.color.set(e),n.applyColorCorrection(o[t].material.color)}}});
- },{"../core/component":128,"../utils/":202,"../utils/bind":196,"../utils/tracked-controls":210}],117:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,GAMEPAD_ID_PREFIX="HTC Vive Focus",VIVE_FOCUS_CONTROLLER_MODEL_URL="https://cdn.aframe.io/controllers/vive/focus-controller/focus-controller.gltf";module.exports.Component=registerComponent("vive-focus-controls",{schema:{hand:{default:""},buttonTouchedColor:{type:"color",default:"#BBBBBB"},buttonHighlightColor:{type:"color",default:"#7A7A7A"},model:{default:!0},orientationOffset:{type:"vec3"},armModel:{default:!0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","trigger"]},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)},init:function(){var t=this;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.controllerPresent=!1,this.lastControllerCheck=0,this.bindMethods()},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(){checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,this.data.hand?{hand:this.data.hand}:{})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{armModel:e.armModel,idPrefix:GAMEPAD_ID_PREFIX,orientationOffset:e.orientationOffset}),this.data.model&&this.el.setAttribute("gltf-model",VIVE_FOCUS_CONTROLLER_MODEL_URL)},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,o=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.trigger=o.getObjectByName("BumperKey"),e.triggerPressed=o.getObjectByName("BumperKey_Press"),e.triggerPressed&&(e.triggerPressed.visible=!1),e.trackpad=o.getObjectByName("TouchPad"),e.trackpadPressed=o.getObjectByName("TouchPad_Press"),e.trackpadPressed&&(e.trackpadPressed.visible=!1))},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},onAxisMoved:function(t){emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){this.data.model&&this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var o=this.buttonMeshes,n=t+"Pressed";if(o&&o[t]&&o[n]){var s;switch(e){case"down":s=this.data.buttonHighlightColor;break;case"touchstart":s=this.data.buttonTouchedColor}s&&o[n].material.color.set(s),o[n].visible=!!s,o[t].visible=!s}}});
- },{"../core/component":128,"../utils/bind":196,"../utils/tracked-controls":210}],118:[function(_dereq_,module,exports){
- function isEmptyObject(e){var t;for(t in e)return!1;return!0}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,KEYS=["KeyW","KeyA","KeyS","KeyD","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"];module.exports.Component=registerComponent("wasd-controls",{schema:{acceleration:{default:65},adAxis:{default:"x",oneOf:["x","y","z"]},adEnabled:{default:!0},adInverted:{default:!1},enabled:{default:!0},fly:{default:!1},wsAxis:{default:"z",oneOf:["x","y","z"]},wsEnabled:{default:!0},wsInverted:{default:!1}},init:function(){this.keys={},this.easing=1.1,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=this.data,n=this.el,s=this.velocity;(s[i.adAxis]||s[i.wsAxis]||!isEmptyObject(this.keys))&&(t/=1e3,this.updateVelocity(t),(s[i.adAxis]||s[i.wsAxis])&&n.object3D.position.add(this.getMovementVector(t)))},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);var h=Math.pow(1/this.easing,60*e);0!==d[i]&&(d[i]=d[i]*h),0!==d[s]&&(d[s]=d[s]*h),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],-1!==KEYS.indexOf(t)&&(this.keys[t]=!0))},onKeyUp:function(e){var t;t=e.code||KEYCODE_TO_CODE[e.keyCode],delete this.keys[t]}});
- },{"../constants":120,"../core/component":128,"../lib/three":176,"../utils/":202}],119:[function(_dereq_,module,exports){
- var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,utils=_dereq_("../utils/"),debug=utils.debug("components:windows-motion-controls:debug"),warn=utils.debug("components:windows-motion-controls:warn"),DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,MODEL_BASE_URL="https://cdn.aframe.io/controllers/microsoft/",MODEL_FILENAMES={left:"left.glb",right:"right.glb",default:"universal.glb"},isWebXRAvailable=_dereq_("../utils/").device.isWebXRAvailable,GAMEPAD_ID_WEBXR="windows-mixed-reality",GAMEPAD_ID_WEBVR="Spatial Controller (Spatial Interaction Source) ",GAMEPAD_ID_PATTERN=/([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/,GAMEPAD_ID_PREFIX=isWebXRAvailable?GAMEPAD_ID_WEBXR:GAMEPAD_ID_WEBVR,INPUT_MAPPING_WEBVR={axes:{thumbstick:[0,1],trackpad:[2,3]},buttons:["thumbstick","trigger","grip","menu","trackpad"],axisMeshNames:["THUMBSTICK_X","THUMBSTICK_Y","TOUCHPAD_TOUCH_X","TOUCHPAD_TOUCH_Y"],buttonMeshNames:{trigger:"SELECT",menu:"MENU",grip:"GRASP",thumbstick:"THUMBSTICK_PRESS",trackpad:"TOUCHPAD_PRESS"},pointingPoseMeshName:"POINTING_POSE"},INPUT_MAPPING_WEBXR={axes:{touchpad:[0,1],thumbstick:[2,3]},buttons:["trigger","squeeze","touchpad","thumbstick","menu"],axisMeshNames:["TOUCHPAD_TOUCH_X","TOUCHPAD_TOUCH_X","THUMBSTICK_X","THUMBSTICK_Y"],buttonMeshNames:{trigger:"SELECT",menu:"MENU",squeeze:"GRASP",thumbstick:"THUMBSTICK_PRESS",touchpad:"TOUCHPAD_PRESS"},pointingPoseMeshName:"POINTING_POSE"},INPUT_MAPPING=isWebXRAvailable?INPUT_MAPPING_WEBXR:INPUT_MAPPING_WEBVR;module.exports.Component=registerComponent("windows-motion-controls",{schema:{hand:{default:DEFAULT_HANDEDNESS},pair:{default:0},model:{default:!0},hideDisconnected:{default:!0}},mapping:INPUT_MAPPING,bindMethods:function(){this.onModelError=bind(this.onModelError,this),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 e=this,t=this.el;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(t){onButtonEvent(t.detail.id,"down",e)},this.onButtonUp=function(t){onButtonEvent(t.detail.id,"up",e)},this.onButtonTouchStart=function(t){onButtonEvent(t.detail.id,"touchstart",e)},this.onButtonTouchEnd=function(t){onButtonEvent(t.detail.id,"touchend",e)},this.onControllerConnected=function(){e.setModelVisibility(!0)},this.onControllerDisconnected=function(){e.setModelVisibility(!1)},this.controllerPresent=!1,this.lastControllerCheck=0,this.previousButtonValues={},this.bindMethods(),this.loadedMeshInfo={buttonMeshes:null,axisMeshes:null},this.rayOrigin={origin:new THREE.Vector3,direction:new THREE.Vector3(0,0,-1),createdFromMesh:!1},t.addEventListener("controllerconnected",this.onControllerConnected),t.addEventListener("controllerdisconnected",this.onControllerDisconnected)},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("axismove",this.onAxisMoved),e.addEventListener("model-error",this.onModelError),e.addEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!0},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("axismove",this.onAxisMoved),e.removeEventListener("model-error",this.onModelError),e.removeEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!1},checkIfControllerPresent:function(){checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand,index:this.data.pair,iterateControllerProfiles:!0})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},updateControllerModel:function(){if(!this.data.model||this.rayOrigin.createdFromMesh)return void this.modelReady();var e=this.createControllerModelUrl();this.loadModel(e)},createControllerModelUrl:function(e){var t,n=this.el.components["tracked-controls"],o=n?n.controller:null,i="default",s=this.data.hand;if(o&&!window.hasNativeWebXRImplementation&&(s=o.hand,!e)){var r=o.id.match(GAMEPAD_ID_PATTERN);i=r&&r[0]||i}return t=MODEL_FILENAMES[s]||MODEL_FILENAMES.default,MODEL_BASE_URL+i+"/"+t},injectTrackedControls:function(){var e=this.data;this.el.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,controller:e.pair,hand:e.hand,armModel:!1}),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()},onModelError:function(e){var t=this.createControllerModelUrl(!0);e.detail.src!==t?(warn("Failed to load controller model for device, attempting to load default."),this.loadModel(t)):warn("Failed to load default controller model.")},loadModel:function(e){this.el.setAttribute("gltf-model","url("+e+")")},onModelLoaded:function(e){function t(e,t){for(var n=0,o=e.children.length;n<o;n++){var i=e.children[n];if(i&&i.name===t)return i}}var n,o,i,s,r=this.controllerModel=e.detail.model,a=this.loadedMeshInfo;if(debug("Processing model"),a.buttonMeshes={},a.axisMeshes={},r){for(n=0;n<this.mapping.buttons.length;n++)o=this.mapping.buttonMeshNames[this.mapping.buttons[n]],o?(i=r.getObjectByName(o),i?(s={index:n,value:t(i,"VALUE"),pressed:t(i,"PRESSED"),unpressed:t(i,"UNPRESSED")},s.value&&s.pressed&&s.unpressed?a.buttonMeshes[this.mapping.buttons[n]]=s:warn("Missing button submesh under mesh with name: "+o+"(VALUE: "+!!s.value+", PRESSED: "+!!s.pressed+", UNPRESSED:"+!!s.unpressed+")")):warn("Missing button mesh with name: "+o)):debug("Skipping unknown button at index: "+n+" with mapped name: "+this.mapping.buttons[n]);for(n=0;n<this.mapping.axisMeshNames.length;n++)o=this.mapping.axisMeshNames[n],o?(i=r.getObjectByName(o),i?(s={index:n,value:t(i,"VALUE"),min:t(i,"MIN"),max:t(i,"MAX")},s.value&&s.min&&s.max?a.axisMeshes[n]=s:warn("Missing axis submesh under mesh with name: "+o+"(VALUE: "+!!s.value+", MIN: "+!!s.min+", MAX:"+!!s.max+")")):warn("Missing axis mesh with name: "+o)):debug("Skipping unknown axis at index: "+n);this.calculateRayOriginFromMesh(r),this.setModelVisibility()}debug("Model load complete.")},calculateRayOriginFromMesh:function(){var e=new THREE.Quaternion;return function(t){var n;if(this.rayOrigin.origin.set(0,0,0),this.rayOrigin.direction.set(0,0,-1),this.rayOrigin.createdFromMesh=!0,n=t.getObjectByName(this.mapping.pointingPoseMeshName)){var o=t.parent;o&&(t.parent=null,t.updateMatrixWorld(!0),t.parent=o),n.getWorldPosition(this.rayOrigin.origin),n.getWorldQuaternion(e),this.rayOrigin.direction.applyQuaternion(e),o&&t.updateMatrixWorld(!0)}else debug("Mesh does not contain pointing origin data, defaulting to none.");this.modelReady()}}(),lerpAxisTransform:function(){var e=new THREE.Quaternion;return function(t,n){var o=this.loadedMeshInfo.axisMeshes[t];if(o){var i=o.min,s=o.max,r=o.value,a=.5*n+.5;r.setRotationFromQuaternion(e.copy(i.quaternion).slerp(s.quaternion,a)),r.position.lerpVectors(i.position,s.position,a)}}}(),lerpButtonTransform:function(){var e=new THREE.Quaternion;return function(t,n){var o=this.loadedMeshInfo.buttonMeshes[t];if(o){var i=o.unpressed,s=o.pressed,r=o.value;r.setRotationFromQuaternion(e.copy(i.quaternion).slerp(s.quaternion,n)),r.position.lerpVectors(i.position,s.position,n)}}}(),modelReady:function(){this.el.emit("controllermodelready",{name:"windows-motion-controls",model:this.data.model,rayOrigin:this.rayOrigin})},onButtonChanged:function(e){var t=this.mapping.buttons[e.detail.id];t&&(this.loadedMeshInfo&&this.loadedMeshInfo.buttonMeshes&&this.lerpButtonTransform(t,e.detail.state.value),this.el.emit(t+"changed",e.detail.state))},onAxisMoved:function(e){var t=this.mapping.axisMeshNames.length;if(this.loadedMeshInfo&&this.loadedMeshInfo.axisMeshes)for(var n=0;n<t;n++)this.lerpAxisTransform(n,e.detail.axis[n]||0);emitIfAxesChanged(this,this.mapping.axes,e)},setModelVisibility:function(e){var t=this.el.getObject3D("mesh");e=void 0!==e?e:this.modelVisible,this.modelVisible=e,t&&(t.visible=e)}});
- },{"../constants":120,"../core/component":128,"../utils/":202,"../utils/bind":196,"../utils/tracked-controls":210}],120:[function(_dereq_,module,exports){
- module.exports={AFRAME_INJECTED:"aframe-injected",DEFAULT_CAMERA_HEIGHT:1.6,DEFAULT_HANDEDNESS:"right",keyboardevent:_dereq_("./keyboardevent")};
- },{"./keyboardevent":121}],121:[function(_dereq_,module,exports){
- module.exports={KEYCODE_TO_CODE:{38:"ArrowUp",37:"ArrowLeft",40:"ArrowDown",39:"ArrowRight",87:"KeyW",65:"KeyA",83:"KeyS",68:"KeyD"}};
- },{}],122:[function(_dereq_,module,exports){
- 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&&("VIDEO"===e.tagName&&(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){var t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t.substring(0,t.indexOf(":"))}function inferResponseType(e){var t=getFileNameFromURL(e),r=t.lastIndexOf(".");if(r>=0){if(".glb"===t.slice(r,e.search(/\?|#|$/)))return"arraybuffer"}return"text"}function getFileNameFromURL(e){var t=document.createElement("a");t.href=e;var r=t.search.replace(/^\?/,""),i=e.replace(r,"").replace("?","");return i.substring(i.lastIndexOf("/")+1)}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,s,a=this,n=[];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]),n.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]),t.src||t.srcObject||warn("Audio/video asset has neither `src` nor `srcObject` attributes."),n.push(mediaElementLoaded(t));Promise.all(n).then(bind(this.load,this)),s=parseInt(this.getAttribute("timeout"),10)||3e3,this.timeout=setTimeout(function(){a.hasLoaded||(warn("Asset loading timed out in ",s,"ms"),a.emit("timeout"),a.load())},s)}},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,module.exports.getFileNameFromURL=getFileNameFromURL;
- },{"../lib/three":176,"../utils/bind":196,"../utils/debug":198,"./a-node":126,"./a-register-element":127}],123:[function(_dereq_,module,exports){
- 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}})});
- },{"../utils/debug":198,"./a-register-element":127}],124:[function(_dereq_,module,exports){
- function checkComponentDefined(t,e){return!(!t.components[e]||!t.components[e].attrValue)||isComponentMixedIn(e,t.mixinEls)}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}function isComponent(t){return-1!==t.indexOf(MULTIPLE_COMPONENT_DELIMITER)&&(t=utils.split(t,MULTIPLE_COMPONENT_DELIMITER)[0]),!!COMPONENTS[t]}function getRotation(t){var e=THREE.Math.radToDeg,i=t.object3D.rotation,n=t.rotationObj;return n.x=e(i.x),n.y=e(i.y),n.z=e(i.z),n}var ANode=_dereq_("./a-node"),COMPONENTS=_dereq_("./component").components,registerElement=_dereq_("./a-register-element").registerElement,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),AEntity,debug=utils.debug("core:a-entity:debug"),warn=utils.debug("core:a-entity:warn"),MULTIPLE_COMPONENT_DELIMITER="__",OBJECT3D_COMPONENTS=["position","rotation","scale","visible"],ONCE={once:!0},proto=Object.create(ANode.prototype,{createdCallback:{value:function(){this.components={},this.initializingComponents={},this.componentsToUpdate={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new THREE.Group,this.object3D.el=this,this.object3DMap={},this.parentEl=null,this.rotationObj={},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(){var t;if(this.parentEl){for(t in this.components)this.removeComponent(t,!1);this.isScene||(this.removeFromParent(),ANode.prototype.detachedCallback.call(this),this.object3D.el=null)}}},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)),warn("`getOrCreateObject3D` has been deprecated. Use `setObject3D()` and `object3dset` event instead."),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=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){t?this.object3D.remove(t.object3D):this.parentNode.removeChild(this)}},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,s,a;if(s=utils.split(t,MULTIPLE_COMPONENT_DELIMITER),a=s[0],o=s.length>2?s.slice(1).join("__"):s[1],COMPONENTS[a]&&(checkComponentDefined(this,t)||void 0!==e||i)&&!(t in this.components)){if(this.initComponentDependencies(a),o&&!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,o),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,n=this,o=COMPONENTS[t];if(o&&(e=COMPONENTS[t].dependencies))for(i=0;i<e.length;i++)n.initComponent(e[i],window.HTMLElement.prototype.getAttribute.call(n,e[i])||void 0,!0)}},removeComponent:{value:function(t,e){var i;if(i=this.components[t]){if(!i.initialized)return void this.addEventListener("componentinitialized",function i(n){n.detail.name===t&&(this.removeComponent(t,e),this.removeEventListener("componentinitialized",i))});i.pause(),i.remove(),e&&(i.destroy(),delete this.components[t]),this.emit("componentremoved",i.evtDetail,!1)}},writable:window.debug},updateComponents:{value:function(){var t,e,i,n,o=this.componentsToUpdate;if(this.hasLoaded){for(i=0;i<this.mixinEls.length;i++)for(n in this.mixinEls[i].componentCache)isComponent(n)&&(o[n]=!0);if(this.getExtraComponents){e=this.getExtraComponents();for(n in e)isComponent(n)&&(o[n]=!0)}for(i=0;i<this.attributes.length;++i)n=this.attributes[i].name,-1===OBJECT3D_COMPONENTS.indexOf(n)&&isComponent(n)&&(o[n]=!0);for(i=0;i<OBJECT3D_COMPONENTS.length;i++)n=OBJECT3D_COMPONENTS[i],this.hasAttribute(n)&&this.updateComponent(n,this.getDOMAttribute(n));for(n in o)t=mergeComponentData(this.getDOMAttribute(n),e&&e[n]),this.updateComponent(n,t),delete o[n]}},writable:window.debug},updateComponent:{value:function(t,e,i){var n=this.components[t];if(n)return null!==e||checkComponentDefined(this,t)?void n.updateProperties(e,i):void this.removeComponent(t,!0);this.initComponent(t,e,!1)}},removeAttribute:{value:function(t,e){var i=this.components[t];if(i&&void 0===e&&this.removeComponent(t,!0),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,e,i;if(!this.isPlaying&&this.hasLoaded){this.isPlaying=!0;for(i in this.components)this.components[i].play();for(t=this.getChildEntities(),e=0;e<t.length;e++)t[e].play();this.emit("play")}},writable:!0},pause:{value:function(){var t,e,i;if(this.isPlaying){this.isPlaying=!1;for(i in this.components)this.components[i].pause();for(t=this.getChildEntities(),e=0;e<t.length;e++)t[e].pause();this.emit("pause")}},writable:!0},setEntityAttribute:{value:function(t,e,i){if(COMPONENTS[t]||this.components[t])return void this.updateComponent(t,i);if("mixin"===t){if(i===this.computedMixinStr)return;this.mixinUpdate(i,e)}}},mixinUpdate:{value:function(){var t=[];return function(e,i){var n,o,s,a,r=this;if(!this.hasLoaded)return void this.addEventListener("loaded",function(){r.mixinUpdate(e,i)},ONCE);for(i=i||this.getAttribute("mixin"),s=this.updateMixins(e,i),t.length=0,a=0;a<this.mixinEls.length;a++)for(n in this.mixinEls[a].componentCache)-1===t.indexOf(n)&&(this.components[n]?this.components[n].handleMixinUpdate():this.initComponent(n,null),t.push(n));for(a=0;a<s.oldMixinIds.length;a++)if(o=document.getElementById(s.oldMixinIds[a]))for(n in o.componentCache)-1===t.indexOf(n)&&this.components[n]&&(this.getDOMAttribute(n)?this.components[n].handleMixinUpdate():this.removeComponent(n,!0))}}()},setAttribute:{value:function(){var t={};return function(e,i,n){var o,s,a,r,h,l;if(r=e.indexOf(MULTIPLE_COMPONENT_DELIMITER),a=r>0?e.substring(0,r):e,!COMPONENTS[a])return"mixin"===e&&this.mixinUpdate(i),void ANode.prototype.setAttribute.call(this,e,i);if(!this.components[e]&&this.hasAttribute(e)&&this.updateComponent(e,window.HTMLElement.prototype.getAttribute.call(this,e)),void 0!==n&&"string"==typeof i&&i.length>0&&"string"==typeof utils.styleParser.parse(i)){for(l in t)delete t[l];o=t,o[i]=n,s=!1}else o=i,s=!0===n;this.updateComponent(e,o,s),(h=this.sceneEl&&this.sceneEl.getAttribute("debug"))&&this.components[e].flushToDOM()}}(),writable:window.debug},flushToDOM:{value:function(t){var e,i,n,o=this.components,s=this.children;for(n in o)o[n].flushToDOM();if(t)for(i=0;i<s.length;++i)e=s[i],e.flushToDOM&&e.flushToDOM(t)}},getAttribute:{value:function(t){var e;return"position"===t?this.object3D.position:"rotation"===t?getRotation(this):"scale"===t?this.object3D.scale:"visible"===t?this.object3D.visible:(e=this.components[t],e?e.data:window.HTMLElement.prototype.getAttribute.call(this,t))},writable:window.debug},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.emit("stateadded",t))}},removeState:{value:function(t){var e=this.states.indexOf(t);-1!==e&&(this.states.splice(e,1),this.emit("stateremoved",t))}},is:{value:function(t){return-1!==this.states.indexOf(t)}},inspect:{value:function(){this.sceneEl.components.inspector.openInspector(this)}},destroy:{value:function(){var t;if(this.parentNode)return void warn("Entity can only be destroyed if detached from scenegraph.");for(t in this.components)this.components[t].destroy()}}});AEntity=registerElement("a-entity",{prototype:proto}),module.exports=AEntity;
- },{"../lib/three":176,"../utils/":202,"./a-node":126,"./a-register-element":127,"./component":128}],125:[function(_dereq_,module,exports){
- var ANode=_dereq_("./a-node"),registerElement=_dereq_("./a-register-element").registerElement,components=_dereq_("./component").components,utils=_dereq_("../utils"),MULTIPLE_COMPONENT_DELIMITER="__";module.exports=registerElement("a-mixin",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.componentCache={},this.id=this.getAttribute("id"),this.isMixin=!0}},attributeChangedCallback:{value:function(t,e,i){this.cacheAttribute(t,i),this.updateEntities()}},attachedCallback:{value:function(){this.sceneEl=this.closestScene(),this.cacheAttributes(),this.updateEntities(),this.load()}},setAttribute:{value:function(t,e){window.HTMLElement.prototype.setAttribute.call(this,t,e),this.cacheAttribute(t,e)}},cacheAttribute:{value:function(t,e){var i,n;n=utils.split(t,MULTIPLE_COMPONENT_DELIMITER)[0],(i=components[n])&&(void 0===e&&(e=window.HTMLElement.prototype.getAttribute.call(this,t)),this.componentCache[t]=i.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(){var t,e,i;if(this.sceneEl)for(e=this.sceneEl.querySelectorAll("[mixin~="+this.id+"]"),i=0;i<e.length;i++)t=e[i],t.hasLoaded&&!t.isMixin&&t.mixinUpdate(this.id)}}})});
- },{"../utils":202,"./a-node":126,"./a-register-element":127,"./component":128}],126:[function(_dereq_,module,exports){
- var registerElement=_dereq_("./a-register-element").registerElement,isNode=_dereq_("./a-register-element").isNode,utils=_dereq_("../utils/"),warn=utils.debug("core:a-node:warn"),error=utils.debug("core:a-node:error");module.exports=registerElement("a-node",{prototype:Object.create(window.HTMLElement.prototype,{createdCallback:{value:function(){this.computedMixinStr="",this.hasLoaded=!1,this.isNode=!0,this.mixinEls=[]},writable:window.debug},attachedCallback:{value:function(){var t;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",void 0,!1),this.isMixin||(t=this.getAttribute("mixin"))&&this.updateMixins(t)},writable:window.debug},attributeChangedCallback:{value:function(t,e,i){i!==this.computedMixinStr&&("mixin"!==t||this.isMixin||this.updateMixins(i,e))}},closestScene:{value:function(){for(var t=this;t&&!t.isScene;)t=t.parentElement;return t}},closest:{value:function(t){for(var e=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,i=this;i&&!e.call(i,t);)i=i.parentElement;return i}},detachedCallback:{value:function(){this.hasLoaded=!1}},load:{value:function(t,e){var i,n,s=this;this.hasLoaded||(e=e||isNode,i=this.getChildren(),n=i.filter(e).map(function(t){return new Promise(function(e){if(t.hasLoaded)return e();t.addEventListener("loaded",e)})}),Promise.all(n).then(function(){s.hasLoaded=!0,t&&t(),s.emit("loaded",void 0,!1)}).catch(function(t){error("Failure loading node: ",t)}))},writable:!0},getChildren:{value:function(){return Array.prototype.slice.call(this.children,0)}},updateMixins:{value:function(){var t=[],e=[],i={};return function(n,s){var r,a,o;for(t.length=0,e.length=0,a=n?utils.split(n.trim(),/\s+/):t,o=s?utils.split(s.trim(),/\s+/):e,i.newMixinIds=a,i.oldMixinIds=o,r=0;r<o.length;r++)-1===a.indexOf(o[r])&&this.unregisterMixin(o[r]);for(this.computedMixinStr="",this.mixinEls.length=0,r=0;r<a.length;r++)this.registerMixin(document.getElementById(a[r]));return this.computedMixinStr&&(this.computedMixinStr=this.computedMixinStr.trim(),window.HTMLElement.prototype.setAttribute.call(this,"mixin",this.computedMixinStr)),i}}()},registerMixin:{value:function(t){var e,i,n;if(t){if(n=t.getAttribute("mixin"))for(e=utils.split(n.trim(),/\s+/),i=0;i<e.length;i++)this.registerMixin(document.getElementById(e[i]));this.computedMixinStr=this.computedMixinStr+" "+t.id,this.mixinEls.push(t)}}},setAttribute:{value:function(t,e){"mixin"===t&&this.updateMixins(e),window.HTMLElement.prototype.setAttribute.call(this,t,e)}},unregisterMixin:{value:function(t){var e,i,n=this.mixinEls;for(e=0;e<n.length;++e)if(i=n[e],t===i.id){n.splice(e,1);break}}},emit:{value:function(){var t={};return function(e,i,n,s){void 0===n&&(n=!0),t.bubbles=!!n,t.detail=i,s&&(t=utils.extend({},s,t)),this.dispatchEvent(new CustomEvent(e,t))}}(),writable:window.debug}})});
- },{"../utils/":202,"./a-register-element":127}],127:[function(_dereq_,module,exports){
- function addTagName(e){knownTags[e.toLowerCase()]=!0}function wrapANodeMethods(e){var t={};return wrapMethods(t,["attachedCallback","attributeChangedCallback","createdCallback","detachedCallback"],e,ANode.prototype),copyProperties(e,t),t}function wrapAEntityMethods(e){var t={},o=["attachedCallback","attributeChangedCallback","createdCallback","detachedCallback"],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)}),Object.getOwnPropertyNames(a.prototype).forEach(function(e){var t=a.prototype[e];"function"==typeof t&&(t.displayName=e)}),document.registerElement(e,a)},module.exports.wrapMethods=wrapMethods,ANode=_dereq_("./a-node"),AEntity=_dereq_("./a-entity");
- },{"./a-entity":124,"./a-node":126,"document-register-element":12}],128:[function(_dereq_,module,exports){
- function eventsBind(t,e){var i;for(i in e)t.events[i]=e[i].bind(t)}function copyData(t,e){var i,s;for(s in e)void 0!==e[s]&&(i=e[s],t[s]=isObjectOrArray(i)?utils.clone(i):i);return t}function extendProperties(t,e,i){var s;if(i&&e.constructor===Object){for(s in e)void 0!==e[s]&&(e[s]&&e[s].constructor===Object?t[s]=utils.clone(e[s]):t[s]=e[s]);return t}return e}function hasBehavior(t){return t.tick||t.tock}function wrapPause(t){return function(){var e=this.el.sceneEl;this.isPlaying&&(t.call(this),this.isPlaying=!1,this.eventsDetach(),hasBehavior(this)&&e.removeBehavior(this))}}function wrapPlay(t){return function(){var e=this.el.sceneEl,i=this.el.isPlaying&&!this.isPlaying;this.initialized&&i&&(t.call(this),this.isPlaying=!0,this.eventsAttach(),hasBehavior(this)&&e.addBehavior(this))}}function isObject(t){return t&&t.constructor===Object&&!(t instanceof window.HTMLElement)}function isObjectOrArray(t){return t&&(t.constructor===Object||t.constructor===Array)&&!(t instanceof window.HTMLElement)}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]+"),objectPools={},Component=module.exports.Component=function(t,e,i){var s=this;this.el=t,this.id=i,this.attrName=this.name+(i?"__"+i:""),this.evtDetail={id:this.id,name:this.name},this.initialized=!1,this.isSingleProperty=isSingleProp(this.schema),this.isSinglePropertyObject=this.isSingleProperty&&isObject(parseProperty(void 0,this.schema))&&!(this.schema.default instanceof window.HTMLElement),this.isObjectBased=!this.isSingleProperty||this.isSinglePropertyObject,this.el.components[this.attrName]=this,this.objectPool=objectPools[this.name];const a=this.events;this.events={},eventsBind(this,a),this.attrValue=void 0,this.isObjectBased?(this.nextData=this.objectPool.use(),utils.objectPool.removeUnusedKeys(this.nextData,this.schema),this.oldData=this.objectPool.use(),utils.objectPool.removeUnusedKeys(this.oldData,this.schema),this.previousOldData=this.objectPool.use(),utils.objectPool.removeUnusedKeys(this.previousOldData,this.schema),this.parsingAttrValue=this.objectPool.use(),utils.objectPool.removeUnusedKeys(this.parsingAttrValue,this.schema)):(this.nextData=void 0,this.oldData=void 0,this.previousOldData=void 0,this.parsingAttrValue=void 0),this.throttledEmitComponentChanged=utils.throttle(function(){t.emit("componentchanged",s.evtDetail,!1)},200),this.updateProperties(e)};if(Component.prototype={schema:{},init:function(){},events:{},update:function(t){},updateSchema:void 0,tick:void 0,tock:void 0,play:function(){},pause:function(){},remove:function(){},parse:function(t,e){var i=this.schema;return this.isSingleProperty?parseProperty(t,i):parseProperties(styleParser.parse(t),i,!0,this.name,e)},stringify:function(t){var e=this.schema;return"string"==typeof t?t:this.isSingleProperty?stringifyProperty(t,e):(t=stringifyProperties(t,e),styleParser.stringify(t))},updateCachedAttrValue:function(t,e){var i,s,a;if(void 0!==t){if(null===t)return this.isObjectBased&&this.attrValue&&this.objectPool.recycle(this.attrValue),void(this.attrValue=void 0);if(t instanceof Object&&!(t instanceof window.HTMLElement)?(s=this.objectPool.use(),i=utils.extend(s,t)):i=this.parseAttrValueForCache(t),this.isObjectBased&&!e&&this.attrValue)for(a in this.attrValue)void 0===i[a]&&(i[a]=this.attrValue[a]);this.isObjectBased&&!this.attrValue&&(this.attrValue=this.objectPool.use()),utils.objectPool.clearObject(this.attrValue),this.attrValue=extendProperties(this.attrValue,i,this.isObjectBased),utils.objectPool.clearObject(s)}},parseAttrValueForCache:function(t){var e;return"string"!=typeof t?t:(this.isSingleProperty?"string"==typeof(e=this.schema.parse(t))&&(e=t):(utils.objectPool.clearObject(this.parsingAttrValue),e=styleParser.parse(t,this.parsingAttrValue)),e)},flushToDOM:function(t){var e=t?this.data:this.attrValue;null!==e&&void 0!==e&&window.HTMLElement.prototype.setAttribute.call(this.el,this.attrName,this.stringify(e))},updateProperties:function(t,e){if(!this.el.hasLoaded)return void this.updateCachedAttrValue(t);null!==t&&(t=this.parseAttrValueForCache(t)),this.updateCachedAttrValue(t,e),this.initialized?(this.updateComponent(t,e),this.callUpdateHandler()):this.initComponent()},initComponent:function(){var t,e=this.el;this.updateSchema&&this.updateSchema(this.buildData(this.attrValue,!1,!0)),this.data=this.buildData(this.attrValue),e.initializingComponents[this.name]||(e.initializingComponents[this.name]=!0,this.init(),this.initialized=!0,delete e.initializingComponents[this.name],this.oldData=extendProperties(this.oldData,this.data,this.isObjectBased),t=this.isObjectBased?this.objectPool.use():void 0,this.update(t),this.isObjectBased&&this.objectPool.recycle(t),e.isPlaying&&this.play(),e.emit("componentinitialized",this.evtDetail,!1))},updateComponent:function(t,e){var i,s;if(e)return this.updateSchema&&this.updateSchema(this.buildData(this.attrValue,!0,!0)),void(this.data=this.buildData(this.attrValue,!0,!1));if(this.isSingleProperty)return this.isObjectBased&&parseProperty(t,this.schema),void(this.data=t);if(parseProperties(t,this.schema,!0,this.name),this.schemaChangeKeys.length)for(i in t)if(this.schema[i].schemaChange){s=!0;break}if(s)return this.updateSchema&&this.updateSchema(this.buildData(this.attrValue,!0,!0)),void(this.data=this.buildData(this.attrValue,!0,!1));for(i in t)void 0!==t[i]&&(this.data[i]=t[i])},callUpdateHandler:function(){var t;this.previousOldData instanceof Object&&utils.objectPool.clearObject(this.previousOldData),this.isObjectBased?copyData(this.previousOldData,this.oldData):this.previousOldData=this.oldData,t=!utils.deepEqual(this.oldData,this.data),(this.isPositionRotationScale||t)&&(this.oldData instanceof Object&&utils.objectPool.clearObject(this.oldData),this.oldData=extendProperties(this.oldData,this.data,this.isObjectBased),this.update(this.previousOldData),this.throttledEmitComponentChanged())},handleMixinUpdate:function(){this.data=this.buildData(this.attrValue),this.callUpdateHandler()},resetProperty:function(t){if(this.isObjectBased){if(!(t in this.attrValue))return;delete this.attrValue[t],this.data[t]=this.schema[t].default}else this.attrValue=this.schema.default,this.data=this.schema.default;this.updateProperties(this.attrValue)},extendSchema:function(t){var e;e=utils.extend({},components[this.name].schema),utils.extend(e,t),this.schema=processSchema(e),this.el.emit("schemachanged",this.evtDetail)},buildData:function(t,e,i){var s,a,o,r,n,h,c,l=this.nextData,p=this.schema,u=this.el.mixinEls;if(s=t&&t.constructor===Array?t.length:void 0!==t&&null!==t,this.isObjectBased&&utils.objectPool.clearObject(l),this.isSingleProperty)a=this.isObjectBased?copyData(l,p.default):isObjectOrArray(p.default)?utils.clone(p.default):p.default;else{c=!e&&this.attrValue,a=c instanceof Object?copyData(l,c):l;for(r in p)o=p[r].default,void 0===a[r]&&(a[r]=isObjectOrArray(o)?utils.clone(o):o)}for(h=0;h<u.length;h++)(n=u[h].getAttribute(this.attrName))&&(a=extendProperties(a,n,this.isObjectBased));if(s){if(this.isSingleProperty)return isObject(t)?(copyData(this.parsingAttrValue,t),parseProperty(this.parsingAttrValue,p)):parseProperty(t,p);a=extendProperties(a,t,this.isObjectBased)}else if(this.isSingleProperty)return parseProperty(a,p);return parseProperties(a,p,void 0,this.name,i)},eventsAttach:function(){var t;this.eventsDetach();for(t in this.events)this.el.addEventListener(t,this.events[t])},eventsDetach:function(){var t;for(t in this.events)this.el.removeEventListener(t,this.events[t])},destroy:function(){this.objectPool.recycle(this.attrValue),this.objectPool.recycle(this.oldData),this.objectPool.recycle(this.parsingAttrValue),this.attrValue=this.oldData=this.parsingAttrValue=void 0}},window.debug)var registrationOrderWarnings=module.exports.registrationOrderWarnings={};module.exports.registerComponent=function(t,e){var i,s,a,o,r={};if(document.currentScript&&document.currentScript!==aframeScript&&scenes.forEach(function(e){e.hasLoaded||document.currentScript.compareDocumentPosition(e)!==Node.DOCUMENT_POSITION_FOLLOWING&&(warn("The component `"+t+"` 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[t]=!0))}),!0===upperCaseRegExp.test(t)&&warn("The component name `"+t+"` contains uppercase characters, but HTML will ignore the capitalization of attribute names. Change the name to be lowercase: `"+t.toLowerCase()+"`"),-1!==t.indexOf("__"))throw new Error("The component name `"+t+"` is not allowed. The sequence __ (double underscore) is reserved to specify an id for multiple components of the same type");if(Object.keys(e).forEach(function(t){r[t]={value:e[t],writable:!0}}),components[t])throw new Error("The component `"+t+"` has been already registered. Check that you are not loading two versions of the same component or two different components of the same name.");if(i=function(t,e,i){Component.call(this,t,e,i)},i.prototype=Object.create(Component.prototype,r),i.prototype.name=t,i.prototype.isPositionRotationScale="position"===t||"rotation"===t||"scale"===t,i.prototype.constructor=i,i.prototype.system=systems&&systems.systems[t],i.prototype.play=wrapPlay(i.prototype.play),i.prototype.pause=wrapPause(i.prototype.pause),a=utils.extend(processSchema(i.prototype.schema,i.prototype.name)),!(o=isSingleProp(i.prototype.schema))){i.prototype.schemaChangeKeys=[];for(s in a)a[s].schemaChange&&i.prototype.schemaChangeKeys.push(s)}return objectPools[t]=utils.objectPool.createPool(),components[t]={Component:i,dependencies:i.prototype.dependencies,isSingleProp:o,multiple:i.prototype.multiple,name:t,parse:i.prototype.parse,parseAttrValueForCache:i.prototype.parseAttrValueForCache,schema:a,stringify:i.prototype.stringify,type:i.prototype.type},i};
- },{"../utils/":202,"./scene/scenes":135,"./schema":137,"./system":139}],129:[function(_dereq_,module,exports){
- 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};
- },{"../lib/three":176,"./schema":137}],130:[function(_dereq_,module,exports){
- function registerPropertyType(e,r,t,n){if("type"in propertyTypes)return void error("Property type "+e+" is already registered.");propertyTypes[e]={default:r,parse:t||defaultParse,stringify:n||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(urlRegex),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||null===r)&&(("selectorAll"!==e||"string"==typeof r||null===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,n=e.y,i=e.z,o=e.w;return"number"==typeof t&&"number"==typeof n&&(!(r>2&&"number"!=typeof i)&&!(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=/[,> .[\]:]/,urlRegex=/\url\((.+)\)/;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",null,selectorParse,selectorStringify),registerPropertyType("selectorAll",null,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:1},vecParse,coordinates.stringify),module.exports.registerPropertyType=registerPropertyType,module.exports.isValidDefaultValue=isValidDefaultValue,module.exports.isValidDefaultCoordinate=isValidDefaultCoordinate;
- },{"../utils/coordinates":197,"debug":8}],131:[function(_dereq_,module,exports){
- function getCanvasSize(e,t,i,s){return t?{height:e.parentElement.offsetHeight,width:e.parentElement.offsetWidth}:getMaxSize(i,s)}function getMaxSize(e,t){var i,s,n=window.devicePixelRatio;return s={height:document.body.offsetHeight,width:document.body.offsetWidth},!e||t||-1===e.width&&-1===e.height?s:s.width*n<e.width&&s.height*n<e.height?s:(i=s.width/s.height,s.width*n>e.width&&-1!==e.width&&(s.width=Math.round(e.width/n),s.height=Math.round(e.width/i/n)),s.height*n>e.height&&-1!==e.height&&(s.height=Math.round(e.height/n),s.width=Math.round(e.height*i/n)),s)}function requestFullscreen(e){(e.requestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen).apply(e,[{navigationUI:"hide"}])}function exitFullscreen(){(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement)&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen())}function setupCanvas(e){function t(){document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||e.exitVR(),document.activeElement.blur(),document.body.focus()}var i;i=document.createElement("canvas"),i.classList.add("a-canvas"),i.dataset.aframeCanvas=!0,e.appendChild(i),document.addEventListener("fullscreenchange",t),document.addEventListener("mozfullscreenchange",t),document.addEventListener("webkitfullscreenchange",t),document.addEventListener("MSFullscreenChange",t),i.addEventListener("touchmove",function(e){e.preventDefault()}),e.canvas=i,e.emit("render-target-loaded",{target:i}),setTimeout(bind(e.resize,e),0)}var initMetaTags=_dereq_("./metaTags").inject,initWakelock=_dereq_("./wakelock"),loadingScreen=_dereq_("./loadingScreen"),re=_dereq_("../a-register-element"),scenes=_dereq_("./scenes"),systems=_dereq_("../system").systems,THREE=_dereq_("../../lib/three"),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(),isWebXRAvailable=utils.device.isWebXRAvailable,registerElement=re.registerElement,warn=utils.debug("core:a-scene:warn");module.exports.AScene=registerElement("a-scene",{prototype:Object.create(AEntity.prototype,{createdCallback:{value:function(){this.clock=new THREE.Clock,this.isIOS=isIOS,this.isMobile=isMobile,this.hasWebXR=isWebXRAvailable,this.isAR=!1,this.isScene=!0,this.object3D=new THREE.Scene;var e=this;this.object3D.onAfterRender=function(t,i,s){e.isPlaying&&e.tock(e.time,e.delta,s)},this.resize=bind(this.resize,this),this.render=bind(this.render,this),this.systems={},this.systemNames=[],this.time=this.delta=0,this.behaviors={tick:[],tock:[]},this.hasLoaded=!1,this.isPlaying=!1,this.originalHTML=this.innerHTML,this.setAttribute("inspector",""),this.setAttribute("keyboard-shortcuts",""),this.setAttribute("screenshot",""),this.setAttribute("vr-mode-ui",""),this.setAttribute("device-orientation-permission-ui","")}},addFullScreenStyles:{value:function(){document.documentElement.classList.add("a-fullscreen")}},removeFullScreenStyles:{value:function(){document.documentElement.classList.remove("a-fullscreen")}},attachedCallback:{value:function(){var e=this,t=this.hasAttribute("embedded");setupCanvas(this),this.setupRenderer(),this.resize(),t||this.addFullScreenStyles(),initPostMessageAPI(this),initMetaTags(this),initWakelock(this),this.onVRPresentChangeBound=bind(this.onVRPresentChange,this),window.addEventListener("vrdisplaypresentchange",this.onVRPresentChangeBound),this.enterVRBound=function(){e.enterVR()},this.exitVRBound=function(){e.exitVR()},this.exitVRTrueBound=function(){e.exitVR(!0)},this.pointerRestrictedBound=function(){e.pointerRestricted()},this.pointerUnrestrictedBound=function(){e.pointerUnrestricted()},isWebXRAvailable||(window.addEventListener("vrdisplaydeactivate",this.exitVRBound),window.addEventListener("vrdisplaydisconnect",this.exitVRTrueBound),window.addEventListener("vrdisplaypointerrestricted",this.pointerRestrictedBound),window.addEventListener("vrdisplaypointerunrestricted",this.pointerUnrestrictedBound)),window.addEventListener("sessionend",this.resize),this.addEventListener("cameraready",function(){e.attachedCallbackPostCamera()}),this.initSystems()}},attachedCallbackPostCamera:{value:function(){var e=this;window.addEventListener("load",void 0),window.addEventListener("resize",function(){e.isIOS?setTimeout(e.resize,100):e.resize()}),this.play(),scenes.push(this)},writable:window.debug},initSystems:{value:function(){var e;this.initSystem("camera");for(e in systems)"camera"!==e&&this.initSystem(e)}},initSystem:{value:function(e){this.systems[e]||(this.systems[e]=new systems[e](this),this.systemNames.push(e))}},detachedCallback:{value:function(){var e=scenes.indexOf(this);scenes.splice(e,1),window.removeEventListener("vrdisplaypresentchange",this.onVRPresentChangeBound),window.removeEventListener("vrdisplayactivate",this.enterVRBound),window.removeEventListener("vrdisplaydeactivate",this.exitVRBound),window.removeEventListener("vrdisplayconnect",this.enterVRBound),window.removeEventListener("vrdisplaydisconnect",this.exitVRTrueBound),window.removeEventListener("vrdisplaypointerrestricted",this.pointerRestrictedBound),window.removeEventListener("vrdisplaypointerunrestricted",this.pointerUnrestrictedBound),window.removeEventListener("sessionend",this.resize)}},addBehavior:{value:function(e){var t,i,s=this.behaviors;for(i in s)e[i]&&(t=this.behaviors[i],-1===t.indexOf(e)&&t.push(e))}},getPointerLockElement:{value:function(){return document.pointerLockElement},writable:window.debug},checkHeadsetConnected:{value:utils.device.checkHeadsetConnected,writable:window.debug},enterAR:{value:function(){if(!this.hasWebXR)throw new Error("Failed to enter AR mode, WebXR not supported.");this.enterVR(!0)}},enterVR:{value:function(e){function t(){var e;window.hasNativeWebVRImplementation&&!window.hasNativeWebXRImplementation&&(e=new CustomEvent("vrdisplaypresentchange",{detail:{display:utils.device.getVRDisplay()}}),window.dispatchEvent(e)),n.addState("vr-mode"),n.emit("enter-vr",{target:n}),!isWebXRAvailable&&n.isMobile&&screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape"),n.addFullScreenStyles(),n.isMobile||n.checkHeadsetConnected()||requestFullscreen(n.canvas),n.renderer.setAnimationLoop(n.render),n.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,n=this,r=n.renderer.xr;if(this.is("vr-mode"))return Promise.resolve("Already in VR.");if(this.checkHeadsetConnected()||this.isMobile){if(r.enabled=!0,!this.hasWebXR){if(s=utils.device.getVRDisplay(),r.setDevice(s),s.isPresenting&&!window.hasNativeWebVRImplementation)return t(),Promise.resolve();var a=this.getAttribute("renderer"),o={highRefreshRate:a.highRefreshRate,foveationLevel:a.foveationLevel};return s.requestPresent([{source:this.canvas,attributes:o}]).then(t,i)}this.xrSession&&this.xrSession.removeEventListener("end",this.exitVRBound);var d=this.sceneEl.systems.webxr.sessionReferenceSpaceType;r.setReferenceSpaceType(d);var h=e?"immersive-ar":"immersive-vr",c=this.sceneEl.systems.webxr.sessionConfiguration;return navigator.xr.requestSession(h,c).then(function(i){n.xrSession=i,r.setSession(i),i.addEventListener("end",n.exitVRBound),e&&n.addState("ar-mode"),t()}),Promise.resolve()}return t(),Promise.resolve()},writable:!0},exitVR:{value:function(){function e(){s.removeState("vr-mode"),s.removeState("ar-mode"),s.isMobile&&screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),s.hasAttribute("embedded")&&s.removeFullScreenStyles(),s.resize(),s.isIOS&&utils.forceCanvasResizeSafariMobile(s.canvas),s.renderer.setPixelRatio(window.devicePixelRatio),s.emit("exit-vr",{target:s})}function t(e){throw e&&e.message?new Error("Failed to exit VR mode (`exitPresent`): "+e.message):new Error("Failed to exit VR mode (`exitPresent`).")}var i,s=this,n=this.renderer.xr;if(!this.is("vr-mode"))return Promise.resolve("Not in VR.");if(this.checkHeadsetConnected()||this.isMobile){if(n.enabled=!1,i=utils.device.getVRDisplay(),this.hasWebXR)this.xrSession.removeEventListener("end",this.exitVRBound),this.xrSession.end().then(function(){},function(){}),this.xrSession=void 0,n.setSession(null);else if(i.isPresenting)return i.exitPresent().then(e,t)}else exitFullscreen();return e(),Promise.resolve()},writable:!0},pointerRestricted:{value:function(){if(this.canvas){var e=this.getPointerLockElement();e&&e!==this.canvas&&document.exitPointerLock&&document.exitPointerLock(),this.canvas.requestPointerLock&&this.canvas.requestPointerLock()}}},pointerUnrestricted:{value:function(){var e=this.getPointerLockElement();e&&e===this.canvas&&document.exitPointerLock&&document.exitPointerLock()}},onVRPresentChange:{value:function(e){var t=e.display||e.detail.display;if(t&&t.isPresenting)return void this.enterVR();this.exitVR()}},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,i,s,n=this.behaviors;for(i in n)e[i]&&(t=this.behaviors[i],-1!==(s=t.indexOf(e))&&t.splice(s,1))}},resize:{value:function(){var e,t,i,s=this.camera,n=this.canvas,r=this.renderer.xr.isPresenting;t=this.renderer.xr.enabled&&r,!s||!n||this.is("vr-mode")&&(this.isMobile||t)||(e=this.getAttribute("embedded")&&!this.is("vr-mode"),i=getCanvasSize(n,e,this.maxCanvasSize,this.is("vr-mode")),s.aspect=i.width/i.height,s.updateProjectionMatrix(),this.renderer.setSize(i.width,i.height,!1),this.emit("rendererresize",null,!1))},writable:!0},setupRenderer:{value:function(){var e,t,i,s,n=this;s={alpha:!0,antialias:!isMobile,canvas:this.canvas,logarithmicDepthBuffer:!1,powerPreference:"high-performance"},this.maxCanvasSize={height:1920,width:1920},this.hasAttribute("renderer")&&(i=this.getAttribute("renderer"),t=utils.styleParser.parse(i),t.precision&&(s.precision=t.precision+"p"),t.antialias&&"auto"!==t.antialias&&(s.antialias="true"===t.antialias),t.logarithmicDepthBuffer&&"auto"!==t.logarithmicDepthBuffer&&(s.logarithmicDepthBuffer="true"===t.logarithmicDepthBuffer),t.alpha&&(s.alpha="true"===t.alpha),this.maxCanvasSize={width:t.maxCanvasWidth?parseInt(t.maxCanvasWidth):this.maxCanvasSize.width,height:t.maxCanvasHeight?parseInt(t.maxCanvasHeight):this.maxCanvasSize.height}),e=this.renderer=new THREE.WebGLRenderer(s),e.setPixelRatio(window.devicePixelRatio),e.sortObjects=!1,this.camera&&e.xr.setPoseTarget(this.camera.el.object3D),this.addEventListener("camera-set-active",function(){e.xr.setPoseTarget(n.camera.el.object3D)}),loadingScreen.setup(this,getCanvasSize)},writable:window.debug},play:{value:function(){var e=this,t=this;if(this.renderStarted)return void AEntity.prototype.play.call(this);this.addEventListener("loaded",function(){var e,i=this.renderer,s=this.renderer.xr;AEntity.prototype.play.call(this),t.renderStarted||(t.resize(),t.renderer&&(window.performance&&window.performance.mark("render-started"),loadingScreen.remove(),e=utils.device.getVRDisplay(),e&&e.isPresenting&&(s.setDevice(e),s.enabled=!0,t.enterVR()),i.setAnimationLoop(this.render),t.renderStarted=!0,t.emit("renderstart")))}),setTimeout(function(){AEntity.prototype.load.call(e)})}},updateComponent:{value:function(e){e in systems||AEntity.prototype.updateComponent.apply(this,arguments)}},tick:{value:function(e,t){var i,s=this.systems;for(i=0;i<this.behaviors.tick.length;i++)this.behaviors.tick[i].el.isPlaying&&this.behaviors.tick[i].tick(e,t);for(i=0;i<this.systemNames.length;i++)s[this.systemNames[i]].tick&&s[this.systemNames[i]].tick(e,t)}},tock:{value:function(e,t,i){var s,n=this.systems;for(s=0;s<this.behaviors.tock.length;s++)this.behaviors.tock[s].el.isPlaying&&this.behaviors.tock[s].tock(e,t,i);for(s=0;s<this.systemNames.length;s++)n[this.systemNames[s]].tock&&n[this.systemNames[s]].tock(e,t,i)}},render:{value:function(e,t){var i=this.renderer;this.frame=t,this.delta=1e3*this.clock.getDelta(),this.time=1e3*this.clock.elapsedTime,this.isPlaying&&this.tick(this.time,this.delta);var s=null;this.is("ar-mode")&&(s=this.object3D.background,this.object3D.background=null),i.render(this.object3D,this.camera),s&&(this.object3D.background=s)},writable:!0}})}),module.exports.setupCanvas=setupCanvas;
- },{"../../lib/three":176,"../../utils/":202,"../a-entity":124,"../a-node":126,"../a-register-element":127,"../system":139,"./loadingScreen":132,"./metaTags":133,"./postMessage":134,"./scenes":135,"./wakelock":136}],132:[function(_dereq_,module,exports){
- function resize(e){var t=sceneEl.hasAttribute("embedded"),i=getSceneCanvasSize(sceneEl.canvas,t,sceneEl.maxCanvasSize,sceneEl.is("vr-mode"));e.aspect=i.width/i.height,e.updateProjectionMatrix(),sceneEl.renderer.setSize(i.width,i.height,!1)}function setupTitle(){titleEl=document.createElement("div"),titleEl.className=LOADER_TITLE_CLASS,titleEl.innerHTML=document.title,titleEl.style.display="none",sceneEl.appendChild(titleEl)}var utils=_dereq_("../../utils/"),styleParser=utils.styleParser,sceneEl,titleEl,getSceneCanvasSize,ATTR_NAME="loading-screen",LOADER_TITLE_CLASS="a-loader-title";module.exports.setup=function(e,t){sceneEl=e,getSceneCanvasSize=t;var i,n,s,l,r,o,a,d,E,c,u=sceneEl.hasAttribute(ATTR_NAME)?styleParser.parse(sceneEl.getAttribute(ATTR_NAME)):void 0,T=u&&u.dotsColor||"white",v=u&&u.backgroundColor||"#24CAFF",p=void 0===u||"true"===u.enabled||void 0===u.enabled;p&&(i=new THREE.Scene,n=new THREE.SphereGeometry(.2,36,18,0,2*Math.PI,0,Math.PI),s=new THREE.MeshBasicMaterial({color:T}),l=new THREE.Mesh(n,s),r=l.clone(),o=l.clone(),a=new THREE.PerspectiveCamera(80,window.innerWidth/window.innerHeight,5e-4,1e4),d=new THREE.Clock,E=0,c=function(){sceneEl.renderer.render(i,a),E=d.getElapsedTime()%4,l.visible=E>=1,r.visible=E>=2,o.visible=E>=3},i.background=new THREE.Color(v),i.add(a),l.position.set(-1,0,-15),r.position.set(0,0,-15),o.position.set(1,0,-15),a.add(l),a.add(r),a.add(o),setupTitle(),setTimeout(function(){sceneEl.hasLoaded||(resize(a),titleEl.style.display="block",window.addEventListener("resize",function(){resize(a)}),sceneEl.renderer.setAnimationLoop(c))},200))},module.exports.remove=function(){window.removeEventListener("resize",resize),titleEl&&(titleEl.style.display="none")};
- },{"../../utils/":202}],133:[function(_dereq_,module,exports){
- 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,viewport-fit=cover"}),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};
- },{"../../constants/":120,"../../utils":202}],134:[function(_dereq_,module,exports){
- 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))};
- },{"../../utils/":202,"../../utils/bind":196}],135:[function(_dereq_,module,exports){
- module.exports=[];
- },{}],136:[function(_dereq_,module,exports){
- 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()})}};
- },{"../../../vendor/wakelock/wakelock":216}],137:[function(_dereq_,module,exports){
- function isSingleProperty(r){return"type"in r?"string"==typeof r.type:"default"in r}function processPropertyDefinition(r,e){var t,o,n=r.default,p=r.type;return r.type?"bool"===r.type?p="boolean":"float"===r.type&&(p="number"):p=void 0===n||"boolean"!=typeof n&&"number"!=typeof n?Array.isArray(n)?"array":"string":typeof n,o=propertyTypes[p],o||warn("Unknown property type for component `"+e+"`: "+p),t=!!r.parse,r.parse=r.parse||o.parse,r.stringify=r.stringify||o.stringify,r.type=p,"default"in r?t||isValidDefaultValue(p,n)||warn("Default value `"+n+"` does not match type `"+p+"` in component `"+e+"`"):r.default=o.default,r}function parseProperty(r,e){return void 0!==r&&null!==r&&""!==r||(r=e.default,Array.isArray(r)&&(r=r.slice())),e.parse(r,e.default)}function stringifyProperty(r,e){return"object"!=typeof r?r:e&&null!==r?e.stringify(r):JSON.stringify(r)}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(r,e){var t;if(isSingleProperty(r))return processPropertyDefinition(r,e);for(t in r)r[t]=processPropertyDefinition(r[t],e);return r},module.exports.processPropertyDefinition=processPropertyDefinition,module.exports.parseProperties=function(){var r=[];return function(e,t,o,n,p){var i,s,y,u;r.length=0;for(s in o?e:t)o&&void 0===e[s]||r.push(s);if(null===e||"object"!=typeof e)return e;for(s in e)void 0===e[s]||t[s]||p||warn("Unknown property `"+s+"` for component/system `"+n+"`.");for(i=0;i<r.length;i++){if(s=r[i],y=t[s],u=e[s],!t[s])return;e[s]=parseProperty(u,y)}return e}}(),module.exports.parseProperty=parseProperty,module.exports.stringifyProperties=function(r,e){var t,o,n,p,i={};for(t in r)o=e[t],n=r[t],p=n,"object"==typeof p&&(p=stringifyProperty(n,o),o||warn("Unknown component property: "+t)),i[t]=p;return i},module.exports.stringifyProperty=stringifyProperty;
- },{"../utils/":202,"./propertyTypes":130}],138:[function(_dereq_,module,exports){
- 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,i=this.schema,s={};for(t in i)i[t].is===r&&(a=propertyToThreeMapping[i[t].type],s[t]={type:a,value:void 0});return s},update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform")},updateVariables:function(e,r){var t,a,i,s=this.schema;i="uniform"===r?this.uniforms:this.attributes;for(t in e)if(s[t]&&s[t].is===r)if("map"!==s[t].type)i[t].value=this.parseValue(s[t].type,e[t]),i[t].needsUpdate=!0;else{if(!i[t]||i[t].value===e[t])continue;a="_texture_"+t,this.setMapOnTextureLoad(i,t,a),utils.material.updateMapMaterialFromData(a,t,this,e)}},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}},setMapOnTextureLoad:function(e,r,t){var a=this;this.el.addEventListener("materialtextureloaded",function(){e[r].value=a.material[t],e[r].needsUpdate=!0})}},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};
- },{"../lib/three":176,"../utils":202,"./schema":137}],139:[function(_dereq_,module,exports){
- 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)};
- },{"../utils/":202,"./component":128,"./schema":137}],140:[function(_dereq_,module,exports){
- _dereq_("./pivot");
- },{"./pivot":141}],141:[function(_dereq_,module,exports){
- 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)}});
- },{"../../core/component":128,"../../lib/three":176}],142:[function(_dereq_,module,exports){
- 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)}};
- },{"../../core/component":128,"../../core/shader":138,"../../utils/":202}],143:[function(_dereq_,module,exports){
- _dereq_("./primitives/a-camera"),_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");
- },{"./primitives/a-camera":145,"./primitives/a-cursor":146,"./primitives/a-curvedimage":147,"./primitives/a-gltf-model":148,"./primitives/a-image":149,"./primitives/a-light":150,"./primitives/a-link":151,"./primitives/a-obj-model":152,"./primitives/a-sky":153,"./primitives/a-sound":154,"./primitives/a-text":155,"./primitives/a-video":156,"./primitives/a-videosphere":157,"./primitives/meshPrimitives":158}],144:[function(_dereq_,module,exports){
- 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.trim()):o[u]=r.value.trim());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;
- },{"../../core/a-entity":124,"../../core/a-register-element":127,"../../core/component":128,"../../utils/":202}],145:[function(_dereq_,module,exports){
- var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-camera",{defaultComponents:{camera:{},"look-controls":{},"wasd-controls":{},position:{x:0,y:1.6,z:0}},mappings:{active:"camera.active",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","pointer-lock-enabled":"look-controls.pointerLockEnabled","wasd-controls-enabled":"wasd-controls.enabled","reverse-mouse-drag":"look-controls.reverseMouseDrag",zoom:"camera.zoom"}});
- },{"../primitives":144}],146:[function(_dereq_,module,exports){
- 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"}}));
- },{"../../../utils/":202,"../getMeshMixin":142,"../primitives":144}],147:[function(_dereq_,module,exports){
- 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"}}));
- },{"../../../utils/":202,"../getMeshMixin":142,"../primitives":144}],148:[function(_dereq_,module,exports){
- var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-gltf-model",{mappings:{src:"gltf-model"}});
- },{"../primitives":144}],149:[function(_dereq_,module,exports){
- 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"}}));
- },{"../../../utils/":202,"../getMeshMixin":142,"../primitives":144}],150:[function(_dereq_,module,exports){
- 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"}});
- },{"../primitives":144}],151:[function(_dereq_,module,exports){
- var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-link",{defaultComponents:{link:{visualAspectEnabled:!0}},mappings:{href:"link.href",image:"link.image",title:"link.title"}});
- },{"../primitives":144}],152:[function(_dereq_,module,exports){
- 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"}}));
- },{"../../../utils/":202,"../getMeshMixin":142,"../primitives":144}],153:[function(_dereq_,module,exports){
- 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:500,segmentsWidth:64,segmentsHeight:32},material:{color:"#FFF",side:"back",shader:"flat",npot:!0},scale:"-1 1 1"},mappings:utils.extendDeep({},meshPrimitives["a-sphere"].prototype.mappings)}));
- },{"../../../utils/":202,"../getMeshMixin":142,"../primitives":144,"./meshPrimitives":158}],154:[function(_dereq_,module,exports){
- 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"}});
- },{"../primitives":144}],155:[function(_dereq_,module,exports){
- var definePrimitive=_dereq_("../primitives").definePrimitive;definePrimitive("a-text",{text:{anchor:"align",width:5}});
- },{"../primitives":144}],156:[function(_dereq_,module,exports){
- 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"}}));
- },{"../../../utils/":202,"../getMeshMixin":142,"../primitives":144}],157:[function(_dereq_,module,exports){
- var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-videosphere",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"sphere",radius:500,segmentsWidth:64,segmentsHeight:32},material:{color:"#FFF",shader:"flat",side:"back",npot:!0},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-height":"geometry.segmentsHeight","segments-width":"geometry.segmentsWidth"}}));
- },{"../../../utils/":202,"../getMeshMixin":142,"../primitives":144}],158:[function(_dereq_,module,exports){
- 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});
- },{"../../../core/geometry":129,"../../../utils/":202,"../getMeshMixin":142,"../primitives":144}],159:[function(_dereq_,module,exports){
- 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,e.segmentsWidth,e.segmentsHeight,e.segmentsDepth)}});
- },{"../core/geometry":129,"../lib/three":176}],160:[function(_dereq_,module,exports){
- 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))}});
- },{"../core/geometry":129,"../lib/three":176}],161:[function(_dereq_,module,exports){
- 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))}});
- },{"../core/geometry":129,"../lib/three":176}],162:[function(_dereq_,module,exports){
- 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))}});
- },{"../core/geometry":129,"../lib/three":176}],163:[function(_dereq_,module,exports){
- 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)}});
- },{"../core/geometry":129,"../lib/three":176}],164:[function(_dereq_,module,exports){
- 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)}});
- },{"../core/geometry":129,"../lib/three":176}],165:[function(_dereq_,module,exports){
- _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");
- },{"./box.js":159,"./circle.js":160,"./cone.js":161,"./cylinder.js":162,"./dodecahedron.js":163,"./icosahedron.js":164,"./octahedron.js":166,"./plane.js":167,"./ring.js":168,"./sphere.js":169,"./tetrahedron.js":170,"./torus.js":171,"./torusKnot.js":172,"./triangle.js":173}],166:[function(_dereq_,module,exports){
- 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)}});
- },{"../core/geometry":129,"../lib/three":176}],167:[function(_dereq_,module,exports){
- 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)}});
- },{"../core/geometry":129,"../lib/three":176}],168:[function(_dereq_,module,exports){
- 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))}});
- },{"../core/geometry":129,"../lib/three":176}],169:[function(_dereq_,module,exports){
- 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))}});
- },{"../core/geometry":129,"../lib/three":176}],170:[function(_dereq_,module,exports){
- 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)}});
- },{"../core/geometry":129,"../lib/three":176}],171:[function(_dereq_,module,exports){
- 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))}});
- },{"../core/geometry":129,"../lib/three":176}],172:[function(_dereq_,module,exports){
- 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)}});
- },{"../core/geometry":129,"../lib/three":176}],173:[function(_dereq_,module,exports){
- 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.getNormal(new THREE.Vector3),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]]}});
- },{"../core/geometry":129,"../lib/three":176}],174:[function(_dereq_,module,exports){
- if(window.Promise=window.Promise||_dereq_("promise-polyfill"),window.hasNativeWebVRImplementation=!!window.navigator.getVRDisplays||!!window.navigator.getVRDevices,window.hasNativeWebXRImplementation=void 0!==navigator.xr,!window.hasNativeWebXRImplementation&&!window.hasNativeWebVRImplementation){var isIOSOlderThan10=_dereq_("./utils/isIOSOlderThan10"),bufferScale=isIOSOlderThan10(window.navigator.userAgent)?1/window.devicePixelRatio:1,WebVRPolyfill=_dereq_("webvr-polyfill"),polyfillConfig={BUFFER_SCALE:bufferScale,CARDBOARD_UI_DISABLED:!0,ROTATE_INSTRUCTIONS_DISABLED:!0};window.webvrpolyfill=new WebVRPolyfill(polyfillConfig)}var utils=_dereq_("./utils/"),debug=utils.debug;utils.isIE11&&(_dereq_("custom-event-polyfill"),_dereq_("../vendor/starts-with-polyfill"));var 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."),_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"),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-assets"),_dereq_("./core/a-cubemap"),_dereq_("./core/a-mixin"),_dereq_("./extras/components/"),_dereq_("./extras/primitives/"),console.log("A-Frame Version: 1.0.4 (Date 2020-03-20, Commit #a52d7e77)"),console.log("THREE Version (https://github.com/supermedium/three.js):",pkg.dependencies["super-three"]),console.log("WebVR Polyfill Version:",pkg.dependencies["webvr-polyfill"]),module.exports=window.AFRAME={AComponent:_dereq_("./core/component").Component,AEntity:AEntity,ANode:ANode,ANIME:_dereq_("super-animejs"),AScene:AScene,components:components,coreComponents:Object.keys(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,utils:utils,version:pkg.version};
- },{"../package":72,"../vendor/starts-with-polyfill":214,"./components/index":82,"./core/a-assets":122,"./core/a-cubemap":123,"./core/a-entity":124,"./core/a-mixin":125,"./core/a-node":126,"./core/a-register-element":127,"./core/component":128,"./core/geometry":129,"./core/scene/a-scene":131,"./core/scene/scenes":135,"./core/schema":137,"./core/shader":138,"./core/system":139,"./extras/components/":140,"./extras/primitives/":143,"./extras/primitives/getMeshMixin":142,"./extras/primitives/primitives":144,"./geometries/index":165,"./lib/three":176,"./shaders/index":178,"./style/aframe.css":183,"./style/rStats.css":184,"./systems/index":188,"./utils/":202,"./utils/isIOSOlderThan10":204,"custom-event-polyfill":7,"present":48,"promise-polyfill":50,"super-animejs":56,"webvr-polyfill":67}],175:[function(_dereq_,module,exports){
- 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});
- },{}],176:[function(_dereq_,module,exports){
- (function (global){
- var THREE=global.THREE=_dereq_("super-three");THREE.TextureLoader&&(THREE.TextureLoader.prototype.crossOrigin="anonymous"),THREE.ImageLoader&&(THREE.ImageLoader.prototype.crossOrigin="anonymous"),THREE.Cache&&(THREE.Cache.enabled=!0),_dereq_("../../vendor/DeviceOrientationControls"),_dereq_("super-three/examples/js/loaders/DRACOLoader"),_dereq_("super-three/examples/js/loaders/GLTFLoader"),_dereq_("super-three/examples/js/loaders/OBJLoader"),_dereq_("super-three/examples/js/loaders/MTLLoader"),THREE.DRACOLoader.prototype.crossOrigin="anonymous",THREE.GLTFLoader.prototype.crossOrigin="anonymous",THREE.MTLLoader.prototype.crossOrigin="anonymous",THREE.OBJLoader.prototype.crossOrigin="anonymous",module.exports=THREE;
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
- },{"../../vendor/DeviceOrientationControls":211,"super-three":57,"super-three/examples/js/loaders/DRACOLoader":58,"super-three/examples/js/loaders/GLTFLoader":59,"super-three/examples/js/loaders/MTLLoader":60,"super-three/examples/js/loaders/OBJLoader":61}],177:[function(_dereq_,module,exports){
- function getMaterialData(e,t){return t.color.set(e.color),t.fog=e.fog,t.wireframe=e.wireframe,t.wireframeLinewidth=e.wireframeLinewidth,t}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.rendererSystem=this.el.sceneEl.systems.renderer,this.materialData={color:new THREE.Color},this.textureSrc=null,getMaterialData(e,this.materialData),this.rendererSystem.applyColorCorrection(this.materialData.color),this.material=new THREE.MeshBasicMaterial(this.materialData),utils.material.updateMap(this,e)},update:function(e){this.updateMaterial(e),utils.material.updateMap(this,e)},updateMaterial:function(e){var t;getMaterialData(e,this.materialData),this.rendererSystem.applyColorCorrection(this.materialData.color);for(t in this.materialData)this.material[t]=this.materialData[t]}});
- },{"../core/shader":138,"../lib/three":176,"../utils/":202}],178:[function(_dereq_,module,exports){
- _dereq_("./flat"),_dereq_("./standard"),_dereq_("./sdf"),_dereq_("./msdf"),_dereq_("./ios10hls");
- },{"./flat":177,"./ios10hls":179,"./msdf":180,"./sdf":181,"./standard":182}],179:[function(_dereq_,module,exports){
- 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")});
- },{"../core/shader":138}],180:[function(_dereq_,module,exports){
- 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"},negate:{type:"boolean",is:"uniform",default:!0},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;","uniform bool negate;","uniform float alphaTest;","uniform float opacity;","uniform sampler2D map;","uniform vec3 color;","varying vec2 vUV;","float median(float r, float g, float b) {"," return max(min(r, g), min(max(r, g), b));","}","#define BIG_ENOUGH 0.001","#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)","void main() {"," vec3 sampleColor = texture2D(map, vUV).rgb;"," if (negate) { sampleColor = 1.0 - sampleColor; }"," float sigDist = median(sampleColor.r, sampleColor.g, sampleColor.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));"," // Do modified alpha test."," if (isBigEnough > BIG_ENOUGH) {"," float ratio = BIG_ENOUGH / isBigEnough;"," alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);"," }"," // Do modified alpha test."," if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }"," gl_FragColor = vec4(color.xyz, alpha * opacity);","}"].join("\n")});
- },{"../core/shader":138}],181:[function(_dereq_,module,exports){
- 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;","uniform float alphaTest;","uniform float opacity;","uniform sampler2D map;","uniform vec3 color;","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","#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))","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;"," }"," 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 (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 && alpha <= DISCARD_ALPHA) { discard; return; }"," #endif"," gl_FragColor = vec4(color, opacity * alpha);","}"].join("\n")});
- },{"../core/shader":138}],182:[function(_dereq_,module,exports){
- function getMaterialData(e,t){return t.color.set(e.color),t.emissive.set(e.emissive),t.emissiveIntensity=e.emissiveIntensity,t.fog=e.fog,t.metalness=e.metalness,t.roughness=e.roughness,t.wireframe=e.wireframe,t.wireframeLinewidth=e.wireframeLinewidth,e.normalMap&&(t.normalScale=e.normalScale),e.ambientOcclusionMap&&(t.aoMapIntensity=e.ambientOcclusionMapIntensity),e.displacementMap&&(t.displacementScale=e.displacementScale,t.displacementBias=e.displacementBias),t}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}},emissive:{type:"color",default:"#000"},emissiveIntensity:{default:1},envMap:{default:""},fog:{default:!0},height:{default:256},metalness:{default:0,min:0,max:1},metalnessMap:{type:"map"},metalnessTextureOffset:{type:"vec2"},metalnessTextureRepeat:{type:"vec2",default:{x:1,y: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},roughnessMap:{type:"map"},roughnessTextureOffset:{type:"vec2"},roughnessTextureRepeat:{type:"vec2",default:{x:1,y:1}},sphericalEnvMap:{type:"map"},src:{type:"map"},width:{default:512},wireframe:{default:!1},wireframeLinewidth:{default:2}},init:function(e){this.rendererSystem=this.el.sceneEl.systems.renderer,this.materialData={color:new THREE.Color,emissive:new THREE.Color},getMaterialData(e,this.materialData),this.rendererSystem.applyColorCorrection(this.materialData.color),this.rendererSystem.applyColorCorrection(this.materialData.emissive),this.material=new THREE.MeshStandardMaterial(this.materialData),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),e.metalnessMap&&utils.material.updateDistortionMap("metalness",this,e),e.roughnessMap&&utils.material.updateDistortionMap("roughness",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),e.metalnessMap&&utils.material.updateDistortionMap("metalness",this,e),e.roughnessMap&&utils.material.updateDistortionMap("roughness",this,e),this.updateEnvMap(e)},updateMaterial:function(e){var t,a=this.material;getMaterialData(e,this.materialData),this.rendererSystem.applyColorCorrection(this.materialData.color),this.rendererSystem.applyColorCorrection(this.materialData.emissive);for(t in this.materialData)a[t]=this.materialData[t]},updateEnvMap:function(e){var t=this,a=this.material,i=e.envMap,s=e.sphericalEnvMap;return!i&&!s||this.isLoadingEnvMap?(a.envMap=null,void(a.needsUpdate=!0)):(this.isLoadingEnvMap=!0,s?void this.el.sceneEl.systems.material.loadTexture(s,{src:s},function(e){t.isLoadingEnvMap=!1,e.mapping=THREE.SphericalReflectionMapping,a.envMap=e,utils.material.handleTextureEvents(t.el,e),a.needsUpdate=!0}):texturePromises[i]?void texturePromises[i].then(function(e){t.isLoadingEnvMap=!1,a.envMap=e,utils.material.handleTextureEvents(t.el,e),a.needsUpdate=!0}):void(texturePromises[i]=new Promise(function(e){utils.srcLoader.validateCubemapSrc(i,function(i){CubeLoader.load(i,function(i){t.isLoadingEnvMap=!1,a.envMap=i,utils.material.handleTextureEvents(t.el,i),e(i)})})})))}});
- },{"../core/shader":138,"../lib/three":176,"../utils/":202}],183:[function(_dereq_,module,exports){
- var css = "html.a-fullscreen{bottom:0;left:0;position:fixed;right:0;top:0}html.a-fullscreen body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}html.a-fullscreen .a-canvas{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;position:fixed!important}html:not(.a-fullscreen) .a-enter-ar,html:not(.a-fullscreen) .a-enter-vr{right:5px;bottom:5px}:-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}canvas.a-canvas.a-mouse-cursor-hover:hover{cursor:pointer}.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-ar,.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-ar{right:80px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff;user-select:none;outline:0}.a-enter-vr-button{background:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='108' height='62' viewBox='0 0 108 62'%3E%3Ctitle%3Eaframe-vrmode-noborder-reduced-tracking%3C/title%3E%3Cpath d='M68.81,21.56H64.23v8.27h4.58a4.13,4.13,0,0,0,3.1-1.09,4.2,4.2,0,0,0,1-3,4.24,4.24,0,0,0-1-3A4.05,4.05,0,0,0,68.81,21.56Z' fill='%23fff'/%3E%3Cpath d='M96,0H12A12,12,0,0,0,0,12V50A12,12,0,0,0,12,62H96a12,12,0,0,0,12-12V12A12,12,0,0,0,96,0ZM41.9,46H34L24,16h8l6,21.84,6-21.84H52Zm39.29,0H73.44L68.15,35.39H64.23V46H57V16H68.81q5.32,0,8.34,2.37a8,8,0,0,1,3,6.69,9.68,9.68,0,0,1-1.27,5.18,8.9,8.9,0,0,1-4,3.34l6.26,12.11Z' fill='%23fff'/%3E%3C/svg%3E\") 50% 50% no-repeat rgba(0,0,0,.35)}.a-enter-ar-button{background:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='108' height='62' viewBox='0 0 108 62'%3E%3Ctitle%3Eaframe-armode-noborder-reduced-tracking%3C/title%3E%3Cpath d='M96,0H12A12,12,0,0,0,0,12V50A12,12,0,0,0,12,62H96a12,12,0,0,0,12-12V12A12,12,0,0,0,96,0Zm8,50a8,8,0,0,1-8,8H12a8,8,0,0,1-8-8V12a8,8,0,0,1,8-8H96a8,8,0,0,1,8,8Z' fill='%23fff'/%3E%3Cpath d='M43.35,39.82H32.51L30.45,46H23.88L35,16h5.73L52,46H45.43Zm-9.17-5h7.5L37.91,23.58Z' fill='%23fff'/%3E%3Cpath d='M68.11,35H63.18V46H57V16H68.15q5.31,0,8.2,2.37a8.18,8.18,0,0,1,2.88,6.7,9.22,9.22,0,0,1-1.33,5.12,9.09,9.09,0,0,1-4,3.26l6.49,12.26V46H73.73Zm-4.93-5h5a5.09,5.09,0,0,0,3.6-1.18,4.21,4.21,0,0,0,1.28-3.27,4.56,4.56,0,0,0-1.2-3.34A5,5,0,0,0,68.15,21h-5Z' fill='%23fff'/%3E%3C/svg%3E\") 50% 50% no-repeat rgba(0,0,0,.2)}.a-enter-ar-button,.a-enter-vr-button{background-size:90% 90%;border:0;bottom:0;cursor:pointer;min-width:58px;min-height:34px;padding-right:0;padding-top:0;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999;border-radius:8px;touch-action:manipulation}.a-enter-ar-button{background-size:100% 90%;margin-right:10px;border-radius:7px}.a-enter-ar-button:active,.a-enter-ar-button:hover,.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#ef2d5e}.a-enter-vr-button.resethover{background-color:rgba(0,0,0,.35)}[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}.a-loader-title{background-color:rgba(0,0,0,.6);font-family:sans-serif,monospace;text-align:center;font-size:20px;height:50px;font-weight:300;line-height:50px;position:absolute;right:0;left:0;top:0;color:#fff}.a-modal{background:0 0/50% 50% rgba(0,0,0,.6);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-dialog{position:relative;left:50%;top:50%;transform:translate(-50%,-50%);z-index:199995;width:300px;height:200px;background-size:contain;background-color:#fff;font-family:sans-serif,monospace;font-size:20px;border-radius:3px;padding:6px}.a-dialog-text-container{width:100%;height:70%;align-self:flex-start;display:flex;justify-content:center;align-content:center;flex-direction:column}.a-dialog-text{display:inline-block;font-weight:400;font-size:14pt;margin:8px}.a-dialog-buttons-container{display:inline-flex;align-self:flex-end;width:100%;height:30%}.a-dialog-button{cursor:pointer;align-self:center;opacity:.9;height:80%;width:50%;font-size:12pt;margin:4px;border-radius:2px;text-align:center;border:none;display:inline-block;-webkit-transition:all .25s ease-in-out;transition:all .25s ease-in-out;box-shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.2);user-select:none}.a-dialog-permission-button:hover{box-shadow:0 7px 14px rgba(0,0,0,.2),0 2px 2px rgba(0,0,0,.2)}.a-dialog-allow-button{background-color:#00ceff}.a-dialog-deny-button{background-color:#ff005b}.a-dialog-ok-button{background-color:#00ceff;width:100%}"; (_dereq_("browserify-css").createStyle(css, { "href": "src/style/aframe.css"})); module.exports = css;
- },{"browserify-css":4}],184:[function(_dereq_,module,exports){
- 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;
- },{"browserify-css":4}],185:[function(_dereq_,module,exports){
- function removeDefaultCamera(e){var t;e.camera&&(t=e.querySelector("["+DEFAULT_CAMERA_ATTR+"]"))&&e.removeChild(t)}var 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.render=this.render.bind(this),this.unwrapRender=this.unwrapRender.bind(this),this.wrapRender=this.wrapRender.bind(this),this.initialCameraFound=!1,this.numUserCameras=0,this.numUserCamerasChecked=0,this.setupInitialCamera()},setupInitialCamera:function(){var e,t,a=this.sceneEl,r=this;if(a.camera&&!a.camera.el.getAttribute("camera").spectator)return void a.emit("cameraready",{cameraEl:a.camera.el});if(e=a.querySelectorAll("a-camera, [camera]"),!e.length)return void this.createDefaultCamera();for(this.numUserCameras=e.length,t=0;t<e.length;t++)e[t].addEventListener("object3dset",function(e){"camera"===e.detail.type&&r.checkUserCamera(this)}),e[t].isNode?e[t].load():e[t].addEventListener("nodeready",function(){this.load()})},checkUserCamera:function(e){var t,a=this.el.sceneEl;if(this.numUserCamerasChecked++,!this.initialCameraFound){if(t=e.getAttribute("camera"),!t.active||t.spectator)return void(this.numUserCamerasChecked===this.numUserCameras&&this.createDefaultCamera());this.initialCameraFound=!0,a.camera=e.getObject3D("camera"),a.emit("cameraready",{cameraEl:e})}},createDefaultCamera:function(){var e,t=this.sceneEl;e=document.createElement("a-entity"),e.setAttribute("camera",{active:!0}),e.setAttribute("position",{x:0,y:constants.DEFAULT_CAMERA_HEIGHT,z:0}),e.setAttribute("wasd-controls",""),e.setAttribute("look-controls",""),e.setAttribute(constants.AFRAME_INJECTED,""),e.addEventListener("object3dset",function(a){"camera"===a.detail.type&&(t.camera=a.detail.object,t.emit("cameraready",{cameraEl:e}))}),t.appendChild(e)},disableActiveCamera:function(){var e,t;e=this.sceneEl.querySelectorAll("[camera]"),t=e[e.length-1],t.setAttribute("camera","active",!0)},setActiveCamera:function(e){var t,a,r,i,s=this.activeCameraEl,n=this.sceneEl;if((i=e.getObject3D("camera"))&&e!==this.activeCameraEl){var c=n.querySelector("["+DEFAULT_CAMERA_ATTR+"]"),m=c&&c.querySelector("[camera]");for(e!==m&&removeDefaultCamera(n),this.activeCameraEl=e,this.activeCameraEl.play(),n.camera=i,s&&s.setAttribute("camera","active",!1),a=n.querySelectorAll("[camera]"),r=0;r<a.length;r++)t=a[r],t.isEntity&&e!==t&&(t.setAttribute("camera","active",!1),t.pause());n.emit("camera-set-active",{cameraEl:e})}},setSpectatorCamera:function(e){var t,a,r=this.spectatorCameraEl,i=this.sceneEl;(t=e.getObject3D("camera"))&&e!==this.spectatorCameraEl&&(r&&r.setAttribute("camera","spectator",!1),a=this.spectatorCameraEl=e,i.addEventListener("enter-vr",this.wrapRender),i.addEventListener("exit-vr",this.unwrapRender),a.setAttribute("camera","active",!1),a.play(),i.emit("camera-set-spectator",{cameraEl:e}))},disableSpectatorCamera:function(){this.spectatorCameraEl=void 0},wrapRender:function(){this.spectatorCameraEl&&(this.originalRender=this.sceneEl.renderer.render,this.sceneEl.renderer.render=this.render)},unwrapRender:function(){this.originalRender&&(this.sceneEl.renderer.render=this.originalRender,this.originalRender=void 0)},render:function(e,t){var a,r,i=this.sceneEl;a=i.renderer.xr.enabled,this.originalRender.call(i.renderer,e,t),this.spectatorCameraEl&&!i.isMobile&&a&&(r=this.spectatorCameraEl.components.camera.camera,i.renderer.xr.enabled=!1,this.originalRender.call(i.renderer,e,r),i.renderer.xr.enabled=a)}});
- },{"../constants/":120,"../core/system":139}],186:[function(_dereq_,module,exports){
- 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?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||(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)}});
- },{"../core/geometry":129,"../core/system":139,"../lib/three":176}],187:[function(_dereq_,module,exports){
- var registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three");module.exports.System=registerSystem("gltf-model",{schema:{dracoDecoderPath:{default:""}},init:function(){var e=this.data.dracoDecoderPath;this.dracoLoader=new THREE.DRACOLoader,this.dracoLoader.setDecoderPath(e)},update:function(){var e;this.dracoLoader||(e=this.data.dracoDecoderPath,this.dracoLoader=new THREE.DRACOLoader,this.dracoLoader.setDecoderPath(e))},getDRACOLoader:function(){return this.dracoLoader}});
- },{"../core/system":139,"../lib/three":176}],188:[function(_dereq_,module,exports){
- _dereq_("./camera"),_dereq_("./geometry"),_dereq_("./gltf-model"),_dereq_("./light"),_dereq_("./material"),_dereq_("./renderer"),_dereq_("./shadow"),_dereq_("./tracked-controls-webvr"),_dereq_("./tracked-controls-webxr"),_dereq_("./webxr");
- },{"./camera":185,"./geometry":186,"./gltf-model":187,"./light":189,"./material":190,"./renderer":191,"./shadow":192,"./tracked-controls-webvr":193,"./tracked-controls-webxr":194,"./webxr":195}],189:[function(_dereq_,module,exports){
- 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"),t.setAttribute("light",{color:"#BBB",type:"ambient"}),t.setAttribute(DEFAULT_LIGHT_ATTR,""),t.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(t),e=document.createElement("a-entity"),e.setAttribute("light",{color:"#FFF",intensity:.6,castShadow:!0}),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)}});
- },{"../constants/":120,"../core/system":139,"../utils/bind":196}],190:[function(_dereq_,module,exports){
- function calculateVideoCacheHash(e,t){var r,i,n,a=t.getAttribute("id");if(a)return a;for(i="",n=e||{},r=0;r<t.attributes.length;r++)n[t.attributes[r].name]=t.attributes[r].value;return Object.keys(n).sort().forEach(function(e){i+=e+":"+n[e]+";"}),i}function loadImageTexture(e,t){function r(r,i){function n(e){setTextureProperties(e,t),e.needsUpdate=!0,r(e)}if("string"!=typeof e)return void n(new THREE.Texture(e));TextureLoader.load(e,n,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){a.loadImage(e,t,r)}function n(e){a.loadVideo(e,t,r)}var a=this;return"CANVAS"===e.tagName?void this.loadCanvas(e,t,r):"VIDEO"===e.tagName?(e.src||e.srcObject||e.childElementCount||warn("Video element was defined with neither `source` elements nor `src` / `srcObject` attributes."),void this.loadVideo(e,t,r)):void utils.srcLoader.validateSrc(e,i,n)},loadImage:function(e,t,r){var i=this.hash(t),n=this.textureCache;if(n[i])return void n[i].then(r);n[i]=loadImageTexture(e,t),n[i].then(r)},loadCanvas:function(e,t,r){var i;i=new THREE.CanvasTexture(e),setTextureProperties(i,t),r(i)},loadVideo:function(e,t,r){function i(e){e.texture.needsUpdate=!0,r(e.texture,e.videoEl)}var n,a,s,o,u=this.textureCache;if("string"!=typeof e){if(s=e,n=this.hashVideo(t,s),u[n])return void u[n].then(i);fixVideoAttributes(s)}if(s=s||createVideoEl(e,t.width,t.height),n=this.hashVideo(t,s),u[n])return void u[n].then(i);a=new THREE.VideoTexture(s),a.minFilter=THREE.LinearFilter,setTextureProperties(a,t),this.sceneEl.isIOS&&isHLS(s.src||s.getAttribute("src"),s.type||s.getAttribute("type"))&&(a.format=THREE.RGBAFormat,a.needsCorrectionBGRA=!0,a.flipY=!1,a.needsCorrectionFlipY=!0),o={texture:a,videoEl:s},u[n]=Promise.resolve(o),i(o)},hash:function(e){return e.src.tagName&&(e=utils.extendDeep({},e),e.src=e.src.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]++}});
- },{"../core/system":139,"../lib/three":176,"../utils/":202,"../utils/material":205}],191:[function(_dereq_,module,exports){
- var registerSystem=_dereq_("../core/system").registerSystem,utils=_dereq_("../utils/"),THREE=_dereq_("../lib/three"),debug=utils.debug,warn=debug("components:renderer:warn");module.exports.System=registerSystem("renderer",{schema:{antialias:{default:"auto",oneOf:["true","false","auto"]},highRefreshRate:{default:utils.device.isOculusBrowser()},logarithmicDepthBuffer:{default:"auto",oneOf:["true","false","auto"]},maxCanvasWidth:{default:1920},maxCanvasHeight:{default:1920},physicallyCorrectLights:{default:!1},precision:{default:"high",oneOf:["high","medium","low"]},sortObjects:{default:!1},colorManagement:{default:!1},gammaOutput:{default:!1},alpha:{default:!0},foveationLevel:{default:0}},init:function(){var e=this.data,t=this.el,a=t.renderer;a.sortObjects=e.sortObjects,a.physicallyCorrectLights=e.physicallyCorrectLights,(e.colorManagement||e.gammaOutput)&&(a.outputEncoding=THREE.sRGBEncoding,e.gammaOutput&&warn('Property `gammaOutput` is deprecated. Use `renderer="colorManagement: true;"` instead.')),t.hasAttribute("antialias")&&warn('Component `antialias` is deprecated. Use `renderer="antialias: true"` instead.'),t.hasAttribute("logarithmicDepthBuffer")&&warn('Component `logarithmicDepthBuffer` is deprecated. Use `renderer="logarithmicDepthBuffer: true"` instead.')},applyColorCorrection:function(e){this.data.colorManagement&&e&&(e.isColor?e.convertSRGBToLinear():e.isTexture&&(e.encoding=THREE.sRGBEncoding))}});
- },{"../core/system":139,"../lib/three":176,"../utils/":202}],192:[function(_dereq_,module,exports){
- var registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three"),SHADOW_MAP_TYPE_MAP={basic:THREE.BasicShadowMap,pcf:THREE.PCFShadowMap,pcfsoft:THREE.PCFSoftShadowMap};module.exports.System=registerSystem("shadow",{schema:{enabled:{default:!0},autoUpdate:{default:!0},type:{default:"pcf",oneOf:["basic","pcf","pcfsoft"]}},init:function(){var e=this.sceneEl,a=this.data;this.shadowMapEnabled=!1,e.renderer&&(e.renderer.shadowMap.type=SHADOW_MAP_TYPE_MAP[a.type],e.renderer.shadowMap.autoUpdate=a.autoUpdate,this.setShadowMapEnabled(this.shadowMapEnabled))},update:function(e){e.enabled!==this.data.enabled&&this.setShadowMapEnabled(this.data.enabled)},setShadowMapEnabled:function(e){var a=this.sceneEl.renderer;this.shadowMapEnabled=this.data.enabled&&e,a&&(a.shadowMap.enabled=this.shadowMapEnabled)}});
- },{"../core/system":139,"../lib/three":176}],193:[function(_dereq_,module,exports){
- var registerSystem=_dereq_("../core/system").registerSystem,utils=_dereq_("../utils"),isWebXRAvailable=utils.device.isWebXRAvailable;module.exports.System=registerSystem("tracked-controls-webvr",{init:function(){var t=this;this.controllers=[],this.isChrome=-1!==navigator.userAgent.indexOf("Chrome"),this.updateControllerList(),this.throttledUpdateControllerList=utils.throttle(this.updateControllerList,500,this),isWebXRAvailable||navigator.getVRDisplays&&this.sceneEl.addEventListener("enter-vr",function(){navigator.getVRDisplays().then(function(e){e.length&&(t.vrDisplay=e[0])})})},tick:function(){this.isChrome?this.updateControllerList():this.throttledUpdateControllerList()},updateControllerList:function(){var t,e,i,s,r=this.controllers;if(e=navigator.getGamepads&&navigator.getGamepads()){for(s=r.length,r.length=0,i=0;i<e.length;++i)(t=e[i])&&t.pose&&r.push(t);r.length!==s&&this.el.emit("controllersupdated",void 0,!1)}}});
- },{"../core/system":139,"../utils":202}],194:[function(_dereq_,module,exports){
- var registerSystem=_dereq_("../core/system").registerSystem,utils=_dereq_("../utils");module.exports.System=registerSystem("tracked-controls-webxr",{init:function(){this.controllers=[],this.oldControllersLength=0,this.throttledUpdateControllerList=utils.throttle(this.updateControllerList,500,this),this.updateReferenceSpace=this.updateReferenceSpace.bind(this),this.el.addEventListener("enter-vr",this.updateReferenceSpace),this.el.addEventListener("exit-vr",this.updateReferenceSpace)},tick:function(){this.throttledUpdateControllerList()},updateReferenceSpace:function(){var e=this,t=this.el.xrSession;if(!t)return this.referenceSpace=void 0,this.controllers=[],void(this.oldControllersLength>0&&(this.oldControllersLength=0,this.el.emit("controllersupdated",void 0,!1)));var r=e.el.sceneEl.systems.webxr.sessionReferenceSpaceType;t.requestReferenceSpace(r).then(function(t){e.referenceSpace=t}).catch(function(t){throw e.el.sceneEl.systems.webxr.warnIfFeatureNotRequested(r,'tracked-controls-webxr uses reference space "'+r+'".'),t})},updateControllerList:function(){var e=this.el.xrSession;if(!e){if(0===this.oldControllersLength)return;return this.oldControllersLength=0,this.controllers=[],void this.el.emit("controllersupdated",void 0,!1)}this.controllers=e.inputSources,this.oldControllersLength!==this.controllers.length&&(this.oldControllersLength=this.controllers.length,this.el.emit("controllersupdated",void 0,!1))}});
- },{"../core/system":139,"../utils":202}],195:[function(_dereq_,module,exports){
- var registerSystem=_dereq_("../core/system").registerSystem,utils=_dereq_("../utils/"),warn=utils.debug("systems:webxr:warn");module.exports.System=registerSystem("webxr",{schema:{referenceSpaceType:{type:"string",default:"local-floor"},requiredFeatures:{type:"array",default:["local-floor"]},optionalFeatures:{type:"array",default:["bounded-floor"]},overlayElement:{type:"selector"}},update:function(){var e=this.data;this.sessionConfiguration={requiredFeatures:e.requiredFeatures,optionalFeatures:e.optionalFeatures},this.sessionReferenceSpaceType=e.referenceSpaceType,e.overlayElement&&(this.warnIfFeatureNotRequested("dom-overlay"),this.sessionConfiguration.domOverlay={root:e.overlayElement})},wasFeatureRequested:function(e){return"viewer"===e||"local"===e||!(!this.sessionConfiguration.requiredFeatures.includes(e)&&!this.sessionConfiguration.optionalFeatures.includes(e))},warnIfFeatureNotRequested:function(e,r){if(!this.wasFeatureRequested(e)){var t='Please add the feature "'+e+"\" to a-scene's webxr system options in requiredFeatures/optionalFeatures.";warn((r?r+" ":"")+t)}}});
- },{"../core/system":139,"../utils/":202}],196:[function(_dereq_,module,exports){
- 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))};
- },{}],197:[function(_dereq_,module,exports){
- function parse(e,r){var t,i,n,o,s,u,d,a,l;if(e&&e instanceof Object)return u=void 0===e.x?r&&r.x:e.x,d=void 0===e.y?r&&r.y:e.y,a=void 0===e.z?r&&r.z:e.z,l=void 0===e.w?r&&r.w:e.w,void 0!==u&&null!==u&&(e.x=parseIfString(u)),void 0!==d&&null!==d&&(e.y=parseIfString(d)),void 0!==a&&null!==a&&(e.z=parseIfString(a)),void 0!==l&&null!==l&&(e.w=parseIfString(l)),e;if(null===e||void 0===e)return typeof r===OBJECT?extend({},r):r;for(t=e.trim().split(whitespaceRegex),s={},o=0;o<COORDINATE_KEYS.length;o++)if(n=COORDINATE_KEYS[o],t[o])s[n]=parseFloat(t[o],10);else{if(void 0===(i=r&&r[n]))continue;s[n]=parseIfString(i)}return s}function stringify(e){var r;return typeof e!==OBJECT?e:(r=e.x+" "+e.y,null!=e.z&&(r+=" "+e.z),null!=e.w&&(r+=" "+e.w),r)}function isCoordinates(e){return regex.test(e)}function parseIfString(e){return null!==e&&void 0!==e&&e.constructor===String?parseFloat(e,10):e}var debug=_dereq_("./debug"),extend=_dereq_("object-assign"),warn=debug("utils:coordinates:warn"),COORDINATE_KEYS=["x","y","z","w"],regex=/^\s*((-?\d*\.{0,1}\d+(e-?\d+)?)\s+){2,3}(-?\d*\.{0,1}\d+(e-?\d+)?)\s*$/;module.exports.regex=regex;var OBJECT="object",whitespaceRegex=/\s+/g;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)};
- },{"./debug":198,"object-assign":39}],198:[function(_dereq_,module,exports){
- (function (process){
- 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;
- }).call(this,_dereq_('_process'))
- },{"_process":49,"debug":8,"object-assign":39}],199:[function(_dereq_,module,exports){
- (function (process){
- function getVRDisplay(){return vrDisplay}function checkHeadsetConnected(){return supportsVRSession||supportsARSession||!!getVRDisplay()}function checkARSupport(){return supportsARSession}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 isMobileDeviceRequestingDesktopSite(){return!isMobile()&&!isMobileVR()&&void 0!==window.orientation}function isOculusBrowser(){return/(OculusBrowser)/i.test(window.navigator.userAgent)}function isFirefoxReality(){return/(Mobile VR)/i.test(window.navigator.userAgent)}function isMobileVR(){return isOculusBrowser()||isFirefoxReality()}function isR7(){return/R7 Build/.test(window.navigator.userAgent)}var error=_dereq_("debug")("device:error"),vrDisplay,supportsVRSession=!1,supportsARSession=!1,isWebXRAvailable=module.exports.isWebXRAvailable=!window.debug&&void 0!==navigator.xr;if(window.addEventListener("vrdisplayactivate",function(e){var i;isWebXRAvailable||(i=document.createElement("canvas"),vrDisplay=e.display,i.getContext("webgl",{}),vrDisplay.requestPresent([{source:i}]).then(function(){},function(){}))}),isWebXRAvailable){var updateEnterInterfaces=function(){var e=document.querySelector("a-scene");if(!e)return void window.addEventListener("DOMContentLoaded",updateEnterInterfaces);e.hasLoaded?e.components["vr-mode-ui"].updateEnterInterfaces():e.addEventListener("loaded",updateEnterInterfaces)},errorHandler=function(e){error("WebXR session support error: "+e.message)};navigator.xr.isSessionSupported?(navigator.xr.isSessionSupported("immersive-vr").then(function(e){supportsVRSession=e,updateEnterInterfaces()}).catch(errorHandler),navigator.xr.isSessionSupported("immersive-ar").then(function(e){supportsARSession=e,updateEnterInterfaces()}).catch(function(){})):navigator.xr.supportsSession?(navigator.xr.supportsSession("immersive-vr").then(function(){supportsVRSession=!0,updateEnterInterfaces()}).catch(errorHandler),navigator.xr.supportsSession("immersive-ar").then(function(){supportsARSession=!0,updateEnterInterfaces()}).catch(function(){})):error("WebXR has neither isSessionSupported or supportsSession?!")}else navigator.getVRDisplays&&navigator.getVRDisplays().then(function(e){var i=document.querySelector("a-scene");vrDisplay=e.length&&e[0],i&&i.emit("displayconnected",{vrDisplay:vrDisplay})});module.exports.getVRDisplay=getVRDisplay,module.exports.checkHeadsetConnected=checkHeadsetConnected,module.exports.checkARSupport=checkARSupport;var 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),(isIOS()||isTablet()||isR7())&&(e=!0),isMobileVR()&&(e=!1)}(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.isMobileDeviceRequestingDesktopSite=isMobileDeviceRequestingDesktopSite,module.exports.isOculusBrowser=isOculusBrowser,module.exports.isFirefoxReality=isFirefoxReality,module.exports.isMobileVR=isMobileVR,module.exports.isR7=isR7,module.exports.isLandscape=function(){var e=window.orientation;return isR7()&&(e+=90),90===e||-90===e},module.exports.isBrowserEnvironment=!(process&&!process.browser),module.exports.isNodeEnvironment=!module.exports.isBrowserEnvironment;
- }).call(this,_dereq_('_process'))
- },{"_process":49,"debug":8}],200:[function(_dereq_,module,exports){
- function getComponentPropertyPath(t,e){return e=e||".",propertyPathCache[e]||(propertyPathCache[e]={}),-1!==t.indexOf(e)?propertyPathCache[e][t]=t.split(e):propertyPathCache[e][t]=t,propertyPathCache[e][t]}var propertyPathCache={};module.exports.getComponentPropertyPath=getComponentPropertyPath,module.exports.propertyPathCache=propertyPathCache,module.exports.getComponentProperty=function(t,e,r){var o;return r=r||".",-1!==e.indexOf(r)?(o=getComponentPropertyPath(e,r),o.constructor===String?t.getAttribute(o):t.getAttribute(o[0])[o[1]]):t.getAttribute(e)},module.exports.setComponentProperty=function(t,e,r,o){var p;if(o=o||".",-1!==e.indexOf(o))return p=getComponentPropertyPath(e,o),void(p.constructor===String?t.setAttribute(p,r):t.setAttribute(p[0],p[1],r));t.setAttribute(e,r)};
- },{}],201:[function(_dereq_,module,exports){
- 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)};
- },{}],202:[function(_dereq_,module,exports){
- var debug=_dereq_("./debug"),deepAssign=_dereq_("deep-assign"),device=_dereq_("./device"),objectAssign=_dereq_("object-assign"),objectPool=_dereq_("./object-pool"),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.isIE11=_dereq_("./is-ie11"),module.exports.material=_dereq_("./material"),module.exports.objectPool=objectPool,module.exports.split=_dereq_("./split").split,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=module.exports.device.isGearVR=function(){warn("`utils.isGearVR` has been deprecated, use `utils.device.isMobileVR`")},module.exports.isIOS=function(){return warn("`utils.isIOS` has moved to `utils.device.isIOS`"),device.isIOS(arguments)},module.exports.isOculusGo=module.exports.device.isOculusGo=function(){warn("`utils.isOculusGo` has been deprecated, use `utils.device.isMobileVR`")},module.exports.isMobile=function(){return warn("`utils.isMobile has moved to `utils.device.isMobile`"),device.isMobile(arguments)},module.exports.throttle=function(e,r,t){var o;return t&&(e=module.exports.bind(e,t)),function(){var t=Date.now(),i=void 0===o?r:t-o;(void 0===o||i>=r)&&(o=t,e.apply(null,arguments))}},module.exports.throttleTick=function(e,r,t){var o;return t&&(e=module.exports.bind(e,t)),function(t,i){var n=void 0===o?i:t-o;(void 0===o||n>=r)&&(o=t,e(t,n))}},module.exports.debounce=function(e,r,t){var o;return function(){var i=this,n=arguments,u=function(){o=null,t||e.apply(i,n)},s=t&&!o;clearTimeout(o),o=setTimeout(u,r),s&&e.apply(i,n)}},module.exports.extend=objectAssign,module.exports.extendDeep=deepAssign,module.exports.clone=function(e){return JSON.parse(JSON.stringify(e))};var deepEqual=function(){var e=objectPool.createPool(function(){return[]});return function(r,t){var o,i,n,u,s,c;if(void 0===r||void 0===t||null===r||null===t||!(r&&t&&r.constructor===Object&&t.constructor===Object||r.constructor===Array&&t.constructor===Array))return r===t;i=e.use(),n=e.use(),i.length=0,n.length=0;for(o in r)i.push(o);for(o in t)n.push(o);if(i.length!==n.length)return e.recycle(i),e.recycle(n),!1;for(u=0;u<i.length;++u)if(s=r[i[u]],c=t[i[u]],"object"==typeof s||"object"==typeof c||Array.isArray(s)&&Array.isArray(c)){if(s===c)continue;if(!deepEqual(s,c))return e.recycle(i),e.recycle(n),!1}else if(s!==c)return e.recycle(i),e.recycle(n),!1;return e.recycle(i),e.recycle(n),!0}}();module.exports.deepEqual=deepEqual,module.exports.diff=function(){var e=[];return function(r,t,o){var i,n,u,s,c,l,d;s=o||{},e.length=0;for(c in r)e.push(c);if(!t)return s;for(u in t)-1===e.indexOf(u)&&e.push(u);for(l=0;l<e.length;l++)c=e[l],i=r[c],n=t[c],((d=i&&n&&i.constructor===Object&&n.constructor===Object)&&!deepEqual(i,n)||!d&&i!==n)&&(s[c]=n);return s}}(),module.exports.shouldCaptureKeyEvent=function(e){return!e.metaKey&&document.activeElement===document.body},module.exports.splitString=function(e,r){void 0===r&&(r=" ");var t=new RegExp(r,"g");return e=(e||"").replace(t,r),e.split(r)},module.exports.getElData=function(e,r){function t(r){e.hasAttribute(r)&&(o[r]=e.getAttribute(r))}r=r||{};var o={};return Object.keys(r).forEach(t),o},module.exports.getUrlParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+e+"=([^&#]*)"),t=r.exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},module.exports.isIframed=function(){return window.top!==window.self},module.exports.findAllScenes=function(e){for(var r=[],t=e.getElementsByTagName("*"),o=0,i=t.length;o<i;o++)t[o].isScene&&r.push(t[o]);return r},module.exports.srcLoader=_dereq_("./src-loader");
- },{"./bind":196,"./coordinates":197,"./debug":198,"./device":199,"./entity":200,"./forceCanvasResizeSafariMobile":201,"./is-ie11":203,"./material":205,"./object-pool":206,"./split":207,"./src-loader":208,"./styleParser":209,"./tracked-controls":210,"deep-assign":10,"object-assign":39}],203:[function(_dereq_,module,exports){
- function getInternetExplorerVersion(){var e,r=-1,n=navigator.userAgent;return"Microsoft Internet Explorer"===navigator.appName?(e=new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})"),null!=e.exec(n)&&(r=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(e=new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})"),null!=e.exec(n)&&(r=parseFloat(RegExp.$1))),r}module.exports=11===getInternetExplorerVersion();
- },{}],204:[function(_dereq_,module,exports){
- module.exports=function(o){return/(iphone|ipod|ipad).*os.(7_|8_|9_)/i.test(o)};
- },{}],205:[function(_dereq_,module,exports){
- 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"],COLOR_MAPS=new Set(["emissiveMap","envMap","map","specularMap"]);module.exports.updateMapMaterialFromData=function(e,t,a,r){function n(t){a.materialSrcs[e]===d&&i(t)}function i(t){o[e]=t,t&&COLOR_MAPS.has(e)&&l.applyColorCorrection(t),o.needsUpdate=!0,handleTextureEvents(s,t)}var s=a.el,o=a.material,l=s.sceneEl.systems.renderer,d=r[t];if(a.materialSrcs||(a.materialSrcs={}),!d)return delete a.materialSrcs[e],void i(null);d!==a.materialSrcs[e]&&(a.materialSrcs[e]=d,d instanceof THREE.Texture?i(d):s.sceneEl.systems.material.loadTexture(d,{src:d,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){var t=n+"Map";s[t]=e,e&&COLOR_MAPS.has(t)&&o.applyColorCorrection(e),s.needsUpdate=!0,handleTextureEvents(i,e)}var n=e;"ambientOcclusion"===e&&(n="ao");var i=t.el,s=t.material,o=i.sceneEl.systems.renderer,l=a[e+"Map"],d={};if(d.src=l,d.offset=a[e+"TextureOffset"],d.repeat=a[e+"TextureRepeat"],d.wrap=a[e+"TextureWrap"],l){if(l===t[e+"TextureSrc"])return;return t[e+"TextureSrc"]=l,void i.sceneEl.systems.material.loadTexture(l,d,r)}s.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)};
- },{"../lib/three":176}],206:[function(_dereq_,module,exports){
- function defaultObjectFactory(){return{}}function clearObject(e){var t;if(e&&e.constructor===Object)for(t in e)e[t]=void 0}function removeUnusedKeys(e,t){var n;if(e&&e.constructor===Object)for(n in e)n in t||delete e[n]}var EMPTY_SLOT=Object.freeze(Object.create(null));module.exports.createPool=function(e){function t(){var e;return null!==l&&l!==c.length||r(c.length||5),e=c[l],c[l++]=EMPTY_SLOT,clearObject(e),e}function n(e){if(e instanceof Object)return null===l||-1===l?void(c[c.length]=e):void(c[--l]=e)}function r(t){var n,r;if(t=void 0===t?c.length:t,t>0&&null==l&&(l=0),t>0)for(n=c.length,c.length+=Number(t),r=n;r<c.length;r++)c[r]=e();return c.length}function o(){return c.length}var c=[],l=null;return e=e||defaultObjectFactory,{grow:r,pool:c,recycle:n,size:o,use:t}},module.exports.clearObject=clearObject,module.exports.removeUnusedKeys=removeUnusedKeys;
- },{}],207:[function(_dereq_,module,exports){
- module.exports.split=function(){var n={};return function(t,i){return i in n||(n[i]={}),t in n[i]?n[i][t]:(n[i][t]=t.split(i),n[i][t])}}();
- },{}],208:[function(_dereq_,module,exports){
- function validateSrc(e,a,t){checkIsImage(e,function(r){if(r)return void a(e);t(e)})}function validateCubemapSrc(e,a){function t(e){o.push(e),6===o.length&&a(o)}var r,n,c,s="",o=[];for(n=0;n<5;n++)s+="(url\\((?:[^\\)]+)\\),\\s*)";if(s+="(url\\((?:[^\\)]+)\\)\\s*)",c=e.match(new RegExp(s)))for(n=1;n<7;n++)validateSrc(parseUrl(c[n]),t);else if(r=validateAndGetQuerySelector(e))return"A-CUBEMAP"===r.tagName&&r.srcs?a(r.srcs):void warn('Selector "%s" does not point to <a-cubemap>',e)}function parseUrl(e){var a=e.match(/\url\((.+)\)/);if(a)return a[1]}function checkIsImage(e,a){var t;if(e.tagName)return void a("IMG"===e.tagName);t=new XMLHttpRequest,t.open("HEAD",e),t.addEventListener("load",function(r){var n;t.status>=200&&t.status<300?(n=t.getResponseHeader("Content-Type"),null==n?checkIsImageFallback(e,a):a(n.startsWith("image")?!0:!1)):checkIsImageFallback(e,a),t.abort()}),t.send()}function checkIsImageFallback(e,a){function t(){a(!0)}function r(){a(!1)}var n=new Image;n.addEventListener("load",t),n.addEventListener("error",r),n.src=e}function validateAndGetQuerySelector(e){try{var a=document.querySelector(e);return a||warn('No element was found matching the selector: "%s"',e),a}catch(a){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};
- },{"./debug":198}],209:[function(_dereq_,module,exports){
- function toCamelCase(e){return e.replace(DASH_REGEX,upperCase)}function transformKeysToCamelCase(e){var r,t;for(t in e)r=toCamelCase(t),t!==r&&(e[r]=e[t],delete e[t]);return e}function styleParse(e,r){var t,n,s,a,o,u;for(r=r||{},t=getKeyValueChunks(e),n=0;n<t.length;n++)(s=t[n])&&(a=s.indexOf(":"),o=s.substr(0,a).trim(),u=s.substr(a+1).trim(),r[o]=u);return r}function styleStringify(e){var r,t=0,n=0,s="";for(r in e)t++;for(r in e)s+=r+": "+e[r],n<t-1&&(s+="; "),n++;return s}function upperCase(e){return e[1].toUpperCase()}var DASH_REGEX=/-([a-z])/g;module.exports.parse=function(e,r){var t;return"string"!=typeof e?e:(t=styleParse(e,r),t[""]?e:transformKeysToCamelCase(t))},module.exports.stringify=function(e){return"string"==typeof e?e:styleStringify(e)},module.exports.toCamelCase=toCamelCase,module.exports.transformKeysToCamelCase=transformKeysToCamelCase;var getKeyValueChunks=function(){var e=[],r=/url\([^)]+$/;return function(t){var n,s="",a=0;for(e.length=0;a<t.length;)n=t.indexOf(";",a),-1===n&&(n=t.length),s+=t.substring(a,n),r.test(s)?(s+=";",a=n+1):(e.push(s.trim()),s="",a=n+1);return e}}();
- },{}],210:[function(_dereq_,module,exports){
- function isControllerPresentWebVR(e,n,t){var r,o,l=e.el.sceneEl,i=t.index||0;return!!n&&(!!(o=l&&l.systems["tracked-controls-webvr"])&&(r=o.controllers,!!r.length&&!!findMatchingControllerWebVR(r,null,n,t.hand,i)))}function isControllerPresentWebXR(e,n,t){var r,o=e.el.sceneEl,l=o&&o.systems["tracked-controls-webxr"];return!!l&&(!(!(r=l.controllers)||!r.length)&&findMatchingControllerWebXR(r,n,t.hand,t.index,t.iterateControllerProfiles))}function findMatchingControllerWebVR(e,n,t,r,o){var l,i,s=0,d=o>=0?o:0;for(i=0;i<e.length;i++)if(l=e[i],(!t||l.id.startsWith(t))&&(t||l.id===n)&&(!r||!l.hand||r===l.hand)){if(!r||l.hand)return l;if(d=NUM_HANDS*o+(r===DEFAULT_HANDEDNESS?0:1),s===d)return l;++s}}function findMatchingControllerWebXR(e,n,t,r,o){var l,i,s,d,a=!1;for(l=0;l<e.length;l++){if(s=e[l],d=s.profiles,0===d.length)return;if(o)for(i=0;i<d.length&&!(a=d[i].startsWith(n));i++);else a=d[0].startsWith(n);if(a)if("right"===s.handedness||"left"===s.handedness){if(s.handedness===t)return e[l]}else if(l===r)return e[l]}}var DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,AXIS_LABELS=["x","y","z","w"],NUM_HANDS=2;module.exports.checkControllerPresentAndSetup=function(e,n,t){var r,o,l=e.el,i=l.sceneEl.hasWebXR,s=i?isControllerPresentWebXR:isControllerPresentWebVR;if(r=s(e,n,t),o=!!r,!e.controllerPresent||e.controllerEventsActive||i||e.addEventListeners(),o===e.controllerPresent)return o;e.controllerPresent=o,o?(e.injectTrackedControls(),e.addEventListeners(),l.emit("controllerconnected",{name:e.name,component:e})):(e.removeEventListeners(),l.emit("controllerdisconnected",{name:e.name,component:e}))},module.exports.isControllerPresentWebVR=isControllerPresentWebVR,module.exports.isControllerPresentWebXR=isControllerPresentWebXR,module.exports.findMatchingControllerWebVR=findMatchingControllerWebVR,module.exports.findMatchingControllerWebXR=findMatchingControllerWebXR,module.exports.emitIfAxesChanged=function(e,n,t){var r,o,l,i,s;for(o in n){for(r=n[o],l=!1,s=0;s<r.length;s++)t.detail.changed[r[s]]&&(l=!0);if(l){for(i={},s=0;s<r.length;s++)i[AXIS_LABELS[s]]=t.detail.axis[r[s]];e.el.emit(o+"moved",i)}}},module.exports.onButtonEvent=function(e,n,t,r){var o=r?t.mapping[r]:t.mapping,l=o.buttons[e];t.el.emit(l+n),t.updateModel&&t.updateModel(l,n)};
- },{"../constants":120}],211:[function(_dereq_,module,exports){
- THREE.DeviceOrientationControls=function(e){var n=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var t=function(e){n.deviceOrientation=e},i=function(){n.screenOrientation=window.orientation||0},o=function(){var e=new THREE.Vector3(0,0,1),n=new THREE.Euler,t=new THREE.Quaternion,i=new THREE.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return function(o,a,r,c,s){n.set(r,a,-c,"YXZ"),o.setFromEuler(n),o.multiply(i),o.multiply(t.setFromAxisAngle(e,-s))}}();this.connect=function(){i(),window.addEventListener("orientationchange",i,!1),window.addEventListener("deviceorientation",t,!1),n.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",i,!1),window.removeEventListener("deviceorientation",t,!1),n.enabled=!1},this.update=function(){if(!1!==n.enabled){var e=n.deviceOrientation;if(e){var t=e.alpha?THREE.Math.degToRad(e.alpha)+n.alphaOffset:0,i=e.beta?THREE.Math.degToRad(e.beta):0,a=e.gamma?THREE.Math.degToRad(e.gamma):0,r=n.screenOrientation?THREE.Math.degToRad(n.screenOrientation):0;o(n.object.quaternion,t,i,a,r)}}},this.dispose=function(){n.disconnect()},this.connect()};
- },{}],212:[function(_dereq_,module,exports){
- 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(c),a("useProgram").set(l),a("glfaces").set(d),a("glvertices").set(m),a("glpoints").set(p)}function t(){s=0,i=0,l=0,d=0,m=0,p=0,c=0}function n(){}function o(e){a=e}var a=null,s=0,i=0,l=0,d=0,m=0,p=0,c=0;return WebGLRenderingContext.prototype.drawArrays=e(WebGLRenderingContext.prototype.drawArrays,function(){s++,arguments[0]==this.POINTS?p+=arguments[2]:m+=arguments[2]}),WebGLRenderingContext.prototype.drawElements=e(WebGLRenderingContext.prototype.drawElements,function(){i++,d+=arguments[1]/3,m+=arguments[1]}),WebGLRenderingContext.prototype.useProgram=e(WebGLRenderingContext.prototype.useProgram,function(){l++}),WebGLRenderingContext.prototype.bindTexture=e(WebGLRenderingContext.prototype.bindTexture,function(){c++}),{update:r,start:t,end:n,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.triangles").set(e.info.render.triangles),a("renderer.info.render.points").set(e.info.render.points)}function t(){}function n(){}function o(e){a=e}var a=null;return{update:r,start:t,end:n,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.triangles":{caption:"Triangles",over:1e3},"renderer.info.render.points":{caption:"Points"}},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.triangles","renderer.info.render.points"]}],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 t(){s=0}function n(){}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 l={memory:{caption:"Used Memory",average:!0,avgMs:1e3,over:22},total:{caption:"Total Memory"}},d=[{caption:"Browser",values:["memory","total"]}],m=[{base:"total",steps:["memory"]}],p=Math.log(1024);return{update:r,start:t,end:n,attach:o,values:l,groups:d,fractions:m}},"object"==typeof module&&(module.exports={glStats:window.glStats,threeStats:window.threeStats,BrowserStats:window.BrowserStats});
- },{}],213:[function(_dereq_,module,exports){
- "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);
- },{}],214:[function(_dereq_,module,exports){
- String.prototype.startsWith||(String.prototype.startsWith=function(t,r){return r=r||0,this.substr(r,t.length)===t});
- },{}],215:[function(_dereq_,module,exports){
- 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;
- },{}],216:[function(_dereq_,module,exports){
- 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.href="/",setTimeout(window.stop,0)},15e3))},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();
- },{"./util.js":215}]},{},[174])(174)
- });
- //# sourceMappingURL=aframe-master.min.js.map
|